├── .clang-format ├── .codedocs ├── .formatignore ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.yml │ ├── config.yml │ └── feature_request.yml └── workflows │ └── check.yml ├── .gitignore ├── .reuse └── dep5 ├── CMakeLists.txt ├── Doxyfile.in ├── LICENSES ├── LGPL-2.1-or-later.txt └── Unicode-DFS-2016.txt ├── Messages.sh ├── README.md ├── cmake ├── Fcitx5CompilerSettings.cmake ├── FindDL.cmake ├── FindExecinfo.cmake ├── FindExpat.cmake ├── FindIsoCodes.cmake ├── FindLibIntl.cmake ├── FindLibKVM.cmake ├── FindLibUUID.cmake ├── FindPango.cmake ├── FindPthread.cmake ├── FindSystemd.cmake ├── FindWaylandProtocols.cmake ├── FindXKBCommon.cmake └── FindXKeyboardConfig.cmake ├── config.h.in ├── data ├── 20-fcitx-x11.in ├── CMakeLists.txt ├── default │ ├── ar_DZ │ ├── as_IN │ ├── ast_ES │ ├── az_AZ │ ├── be_BY │ ├── bg_BG │ ├── bn_IN │ ├── cat_ES │ ├── cs_CZ │ ├── de_CH │ ├── de_DE │ ├── el_CY │ ├── el_GR │ ├── en_GB │ ├── en_US │ ├── en_ZA │ ├── es_ES │ ├── es_GT │ ├── es_MX │ ├── fr_BE │ ├── fr_CH │ ├── fr_FR │ ├── gl_ES │ ├── gu_IN │ ├── he_IL │ ├── hi_IN │ ├── id_ID │ ├── it_IT │ ├── ja_JP │ ├── kn_IN │ ├── ko_KR │ ├── mai_IN │ ├── ml_IN │ ├── mr_IN │ ├── nl_NL │ ├── or_IN │ ├── pa_IN │ ├── pl_PL │ ├── pt_BR │ ├── pt_PT │ ├── ru_RU │ ├── sd_IN │ ├── sk_SK │ ├── ta_IN │ ├── te_IN │ ├── ur_IN │ ├── zh_CN │ ├── zh_HK │ └── zh_TW ├── fcitx5-configtool.desktop.in.in ├── fcitx5-configtool.sh ├── fcitx5-diagnose.sh ├── fcitx5-wayland-launcher.desktop.in.in ├── icon │ ├── 128x128 │ │ └── apps │ │ │ ├── fcitx.png │ │ │ └── org.fcitx.Fcitx5.png │ ├── 16x16 │ │ └── apps │ │ │ ├── fcitx.png │ │ │ └── org.fcitx.Fcitx5.png │ ├── 22x22 │ │ └── apps │ │ │ ├── fcitx.png │ │ │ └── org.fcitx.Fcitx5.png │ ├── 24x24 │ │ └── apps │ │ │ ├── fcitx.png │ │ │ └── org.fcitx.Fcitx5.png │ ├── 32x32 │ │ └── apps │ │ │ ├── fcitx.png │ │ │ └── org.fcitx.Fcitx5.png │ ├── 48x48 │ │ └── apps │ │ │ ├── fcitx.png │ │ │ └── org.fcitx.Fcitx5.png │ ├── CMakeLists.txt │ └── scalable │ │ └── apps │ │ ├── fcitx.svg │ │ └── org.fcitx.Fcitx5.svg ├── org.fcitx.Fcitx5.desktop.in.in └── org.fcitx.Fcitx5.metainfo.xml.in ├── po ├── CMakeLists.txt ├── LINGUAS ├── ca.po ├── da.po ├── de.po ├── es.po ├── fcitx5.pot ├── fr.po ├── he.po ├── ja.po ├── ko.po ├── ru.po ├── vi.po ├── zh_CN.po └── zh_TW.po ├── src ├── CMakeLists.txt ├── frontend │ ├── CMakeLists.txt │ ├── dbusfrontend │ │ ├── CMakeLists.txt │ │ ├── dbusfrontend.conf.in.in │ │ ├── dbusfrontend.cpp │ │ └── dbusfrontend.h │ ├── fcitx4frontend │ │ ├── CMakeLists.txt │ │ ├── fcitx4frontend.conf.in.in │ │ ├── fcitx4frontend.cpp │ │ └── fcitx4frontend.h │ ├── ibusfrontend │ │ ├── CMakeLists.txt │ │ ├── ibusfrontend.conf.in.in │ │ ├── ibusfrontend.cpp │ │ └── ibusfrontend.h │ ├── waylandim │ │ ├── CMakeLists.txt │ │ ├── appmonitor.cpp │ │ ├── appmonitor.h │ │ ├── plasmaappmonitor.cpp │ │ ├── plasmaappmonitor.h │ │ ├── virtualinputcontext.cpp │ │ ├── virtualinputcontext.h │ │ ├── waylandim.conf.in.in │ │ ├── waylandim.cpp │ │ ├── waylandim.h │ │ ├── waylandim_public.h │ │ ├── waylandimserver.cpp │ │ ├── waylandimserver.h │ │ ├── waylandimserverbase.cpp │ │ ├── waylandimserverbase.h │ │ ├── waylandimserverv2.cpp │ │ ├── waylandimserverv2.h │ │ ├── wlrappmonitor.cpp │ │ └── wlrappmonitor.h │ └── xim │ │ ├── CMakeLists.txt │ │ ├── xim.conf.in.in │ │ ├── xim.cpp │ │ └── xim.h ├── im │ ├── CMakeLists.txt │ └── keyboard │ │ ├── CMakeLists.txt │ │ ├── chardata.h │ │ ├── compose.cpp │ │ ├── compose.h │ │ ├── isocodes.cpp │ │ ├── isocodes.h │ │ ├── keyboard.conf.in.in │ │ ├── keyboard.cpp │ │ ├── keyboard.h │ │ ├── keyboard_public.h │ │ ├── longpress.cpp │ │ ├── longpress.h │ │ ├── xkbrules.cpp │ │ ├── xkbrules.h │ │ ├── xmlparser.cpp │ │ └── xmlparser.h ├── lib │ ├── CMakeLists.txt │ ├── fcitx-config │ │ ├── CMakeLists.txt │ │ ├── Fcitx5Config.pc.in │ │ ├── Fcitx5ConfigConfig.cmake.in │ │ ├── configuration.cpp │ │ ├── configuration.h │ │ ├── dbushelper.cpp │ │ ├── dbushelper.h │ │ ├── enum.h │ │ ├── iniparser.cpp │ │ ├── iniparser.h │ │ ├── iniparser_deprecated.cpp │ │ ├── marshallfunction.cpp │ │ ├── marshallfunction.h │ │ ├── option.cpp │ │ ├── option.h │ │ ├── option_details.h │ │ ├── optiontypename.h │ │ ├── rawconfig.cpp │ │ └── rawconfig.h │ ├── fcitx-utils │ │ ├── CMakeLists.txt │ │ ├── Fcitx5Download.cmake.in │ │ ├── Fcitx5Macros.cmake │ │ ├── Fcitx5ModuleTemplate.cmake.in │ │ ├── Fcitx5Utils.pc.in │ │ ├── Fcitx5UtilsConfig.cmake.in │ │ ├── capabilityflags.h │ │ ├── charutils.h │ │ ├── color.cpp │ │ ├── color.h │ │ ├── connectableobject.cpp │ │ ├── connectableobject.h │ │ ├── cutf8.cpp │ │ ├── cutf8.h │ │ ├── dbus │ │ │ ├── bus.h │ │ │ ├── libdbus │ │ │ │ ├── bus.cpp │ │ │ │ ├── bus_p.h │ │ │ │ ├── message.cpp │ │ │ │ ├── message_p.h │ │ │ │ ├── objectvtable_libdbus.cpp │ │ │ │ ├── objectvtable_p_libdbus.h │ │ │ │ ├── servicenamecache.cpp │ │ │ │ └── servicenamecache.h │ │ │ ├── matchrule.cpp │ │ │ ├── matchrule.h │ │ │ ├── message.h │ │ │ ├── message_details.h │ │ │ ├── objectvtable.cpp │ │ │ ├── objectvtable.h │ │ │ ├── objectvtable_p.h │ │ │ ├── sdbus │ │ │ │ ├── bus.cpp │ │ │ │ ├── bus_p.h │ │ │ │ ├── message.cpp │ │ │ │ ├── message_p.h │ │ │ │ ├── objectvtable_p_sdbus.h │ │ │ │ ├── objectvtable_sdbus.cpp │ │ │ │ ├── objectvtablewrapper.c │ │ │ │ ├── objectvtablewrapper_p.h │ │ │ │ └── sd-bus-wrap.h │ │ │ ├── servicewatcher.cpp │ │ │ ├── servicewatcher.h │ │ │ ├── utils_p.h │ │ │ ├── variant.cpp │ │ │ └── variant.h │ │ ├── element.cpp │ │ ├── element.h │ │ ├── endian_p.h │ │ ├── environ.cpp │ │ ├── environ.h │ │ ├── event.cpp │ │ ├── event.h │ │ ├── event_libuv.cpp │ │ ├── event_libuv.h │ │ ├── event_none.cpp │ │ ├── event_p.h │ │ ├── event_sdevent.cpp │ │ ├── eventdispatcher.cpp │ │ ├── eventdispatcher.h │ │ ├── eventloopinterface.cpp │ │ ├── eventloopinterface.h │ │ ├── fdstreambuf.cpp │ │ ├── fdstreambuf.h │ │ ├── flags.h │ │ ├── fs.cpp │ │ ├── fs.h │ │ ├── fs_deprecated.cpp │ │ ├── gen-hotkey.sh │ │ ├── handlertable.h │ │ ├── handlertable_details.h │ │ ├── i18n.cpp │ │ ├── i18n.h │ │ ├── i18nstring.cpp │ │ ├── i18nstring.h │ │ ├── inputbuffer.cpp │ │ ├── inputbuffer.h │ │ ├── intrusivelist.h │ │ ├── key.cpp │ │ ├── key.h │ │ ├── keydata.cpp │ │ ├── keydata.h │ │ ├── keylist │ │ ├── keynametable-compat.h │ │ ├── keynametable.h │ │ ├── keysym.h │ │ ├── keysymgen.h │ │ ├── library.cpp │ │ ├── library.h │ │ ├── log.cpp │ │ ├── log.h │ │ ├── macros.h │ │ ├── metastring.h │ │ ├── misc.cpp │ │ ├── misc.h │ │ ├── misc_p.h │ │ ├── rect.h │ │ ├── semver.cpp │ │ ├── semver.h │ │ ├── signals.h │ │ ├── signals_details.h │ │ ├── standardpath.cpp │ │ ├── standardpath.h │ │ ├── standardpaths.cpp │ │ ├── standardpaths.h │ │ ├── standardpaths_p.h │ │ ├── standardpaths_p_unix.cpp │ │ ├── standardpaths_p_win.cpp │ │ ├── stringutils.cpp │ │ ├── stringutils.h │ │ ├── stringutils_details.h │ │ ├── testing.cpp │ │ ├── testing.h │ │ ├── textformatflags.h │ │ ├── trackableobject.h │ │ ├── tuplehelpers.h │ │ ├── unixfd.cpp │ │ ├── unixfd.h │ │ ├── update-keydata.py │ │ ├── utf8.cpp │ │ ├── utf8.h │ │ └── uuid_p.h │ ├── fcitx-wayland │ │ ├── CMakeLists.txt │ │ ├── blur │ │ │ ├── CMakeLists.txt │ │ │ ├── blur.xml │ │ │ ├── org_kde_kwin_blur.cpp │ │ │ ├── org_kde_kwin_blur.h │ │ │ ├── org_kde_kwin_blur_manager.cpp │ │ │ └── org_kde_kwin_blur_manager.h │ │ ├── core │ │ │ ├── CMakeLists.txt │ │ │ ├── display.cpp │ │ │ ├── display.h │ │ │ ├── outputinfomation.cpp │ │ │ ├── outputinformation.h │ │ │ ├── wl_buffer.cpp │ │ │ ├── wl_buffer.h │ │ │ ├── wl_callback.cpp │ │ │ ├── wl_callback.h │ │ │ ├── wl_compositor.cpp │ │ │ ├── wl_compositor.h │ │ │ ├── wl_data_device.cpp │ │ │ ├── wl_data_device.h │ │ │ ├── wl_data_device_manager.cpp │ │ │ ├── wl_data_device_manager.h │ │ │ ├── wl_data_offer.cpp │ │ │ ├── wl_data_offer.h │ │ │ ├── wl_data_source.cpp │ │ │ ├── wl_data_source.h │ │ │ ├── wl_keyboard.cpp │ │ │ ├── wl_keyboard.h │ │ │ ├── wl_output.cpp │ │ │ ├── wl_output.h │ │ │ ├── wl_pointer.cpp │ │ │ ├── wl_pointer.h │ │ │ ├── wl_region.cpp │ │ │ ├── wl_region.h │ │ │ ├── wl_registry.cpp │ │ │ ├── wl_registry.h │ │ │ ├── wl_seat.cpp │ │ │ ├── wl_seat.h │ │ │ ├── wl_shell.cpp │ │ │ ├── wl_shell.h │ │ │ ├── wl_shell_surface.cpp │ │ │ ├── wl_shell_surface.h │ │ │ ├── wl_shm.cpp │ │ │ ├── wl_shm.h │ │ │ ├── wl_shm_pool.cpp │ │ │ ├── wl_shm_pool.h │ │ │ ├── wl_subcompositor.cpp │ │ │ ├── wl_subcompositor.h │ │ │ ├── wl_subsurface.cpp │ │ │ ├── wl_subsurface.h │ │ │ ├── wl_surface.cpp │ │ │ ├── wl_surface.h │ │ │ ├── wl_touch.cpp │ │ │ └── wl_touch.h │ │ ├── cursor-shape │ │ │ ├── CMakeLists.txt │ │ │ ├── cursor-shape-v1.xml │ │ │ ├── wp_cursor_shape_device_v1.cpp │ │ │ ├── wp_cursor_shape_device_v1.h │ │ │ ├── wp_cursor_shape_manager_v1.cpp │ │ │ └── wp_cursor_shape_manager_v1.h │ │ ├── fractional-scale-v1 │ │ │ ├── CMakeLists.txt │ │ │ ├── fractional-scale-v1.xml │ │ │ ├── wp_fractional_scale_manager_v1.cpp │ │ │ ├── wp_fractional_scale_manager_v1.h │ │ │ ├── wp_fractional_scale_v1.cpp │ │ │ └── wp_fractional_scale_v1.h │ │ ├── input-method-v2 │ │ │ ├── CMakeLists.txt │ │ │ ├── input-method-unstable-v2.xml │ │ │ ├── virtual-keyboard-unstable-v1.xml │ │ │ ├── zwp_input_method_keyboard_grab_v2.cpp │ │ │ ├── zwp_input_method_keyboard_grab_v2.h │ │ │ ├── zwp_input_method_manager_v2.cpp │ │ │ ├── zwp_input_method_manager_v2.h │ │ │ ├── zwp_input_method_v2.cpp │ │ │ ├── zwp_input_method_v2.h │ │ │ ├── zwp_input_popup_surface_v2.cpp │ │ │ ├── zwp_input_popup_surface_v2.h │ │ │ ├── zwp_virtual_keyboard_manager_v1.cpp │ │ │ ├── zwp_virtual_keyboard_manager_v1.h │ │ │ ├── zwp_virtual_keyboard_v1.cpp │ │ │ └── zwp_virtual_keyboard_v1.h │ │ ├── input-method │ │ │ ├── CMakeLists.txt │ │ │ ├── zwp_input_method_context_v1.cpp │ │ │ ├── zwp_input_method_context_v1.h │ │ │ ├── zwp_input_method_v1.cpp │ │ │ ├── zwp_input_method_v1.h │ │ │ ├── zwp_input_panel_surface_v1.cpp │ │ │ ├── zwp_input_panel_surface_v1.h │ │ │ ├── zwp_input_panel_v1.cpp │ │ │ └── zwp_input_panel_v1.h │ │ ├── plasma-window-management │ │ │ ├── CMakeLists.txt │ │ │ ├── org_kde_plasma_window.cpp │ │ │ ├── org_kde_plasma_window.h │ │ │ ├── org_kde_plasma_window_management.cpp │ │ │ ├── org_kde_plasma_window_management.h │ │ │ └── plasma-window-management.xml │ │ ├── tablet-v2 │ │ │ ├── CMakeLists.txt │ │ │ ├── zwp_tablet_manager_v2.cpp │ │ │ ├── zwp_tablet_manager_v2.h │ │ │ ├── zwp_tablet_pad_group_v2.cpp │ │ │ ├── zwp_tablet_pad_group_v2.h │ │ │ ├── zwp_tablet_pad_ring_v2.cpp │ │ │ ├── zwp_tablet_pad_ring_v2.h │ │ │ ├── zwp_tablet_pad_strip_v2.cpp │ │ │ ├── zwp_tablet_pad_strip_v2.h │ │ │ ├── zwp_tablet_pad_v2.cpp │ │ │ ├── zwp_tablet_pad_v2.h │ │ │ ├── zwp_tablet_seat_v2.cpp │ │ │ ├── zwp_tablet_seat_v2.h │ │ │ ├── zwp_tablet_tool_v2.cpp │ │ │ ├── zwp_tablet_tool_v2.h │ │ │ ├── zwp_tablet_v2.cpp │ │ │ └── zwp_tablet_v2.h │ │ ├── viewporter │ │ │ ├── CMakeLists.txt │ │ │ ├── wp_viewport.cpp │ │ │ ├── wp_viewport.h │ │ │ ├── wp_viewporter.cpp │ │ │ └── wp_viewporter.h │ │ ├── wlr-data-control │ │ │ ├── CMakeLists.txt │ │ │ ├── wlr-data-control-unstable-v1.xml │ │ │ ├── zwlr_data_control_device_v1.cpp │ │ │ ├── zwlr_data_control_device_v1.h │ │ │ ├── zwlr_data_control_manager_v1.cpp │ │ │ ├── zwlr_data_control_manager_v1.h │ │ │ ├── zwlr_data_control_offer_v1.cpp │ │ │ ├── zwlr_data_control_offer_v1.h │ │ │ ├── zwlr_data_control_source_v1.cpp │ │ │ └── zwlr_data_control_source_v1.h │ │ └── wlr-foreign-toplevel-management-unstable-v1 │ │ │ ├── CMakeLists.txt │ │ │ ├── wlr-foreign-toplevel-management-unstable-v1.xml │ │ │ ├── zwlr_foreign_toplevel_handle_v1.cpp │ │ │ ├── zwlr_foreign_toplevel_handle_v1.h │ │ │ ├── zwlr_foreign_toplevel_manager_v1.cpp │ │ │ └── zwlr_foreign_toplevel_manager_v1.h │ └── fcitx │ │ ├── CMakeLists.txt │ │ ├── Fcitx5Core.pc.in │ │ ├── Fcitx5CoreConfig.cmake.in │ │ ├── action.cpp │ │ ├── action.h │ │ ├── addonfactory.cpp │ │ ├── addonfactory.h │ │ ├── addoninfo.cpp │ │ ├── addoninfo.h │ │ ├── addoninstance.cpp │ │ ├── addoninstance.h │ │ ├── addoninstance_details.h │ │ ├── addoninstance_p.h │ │ ├── addonloader.cpp │ │ ├── addonloader.h │ │ ├── addonloader_p.h │ │ ├── addonmanager.cpp │ │ ├── addonmanager.h │ │ ├── candidateaction.cpp │ │ ├── candidateaction.h │ │ ├── candidatelist.cpp │ │ ├── candidatelist.h │ │ ├── event.cpp │ │ ├── event.h │ │ ├── focusgroup.cpp │ │ ├── focusgroup.h │ │ ├── focusgroup_p.h │ │ ├── globalconfig.cpp │ │ ├── globalconfig.h │ │ ├── icontheme.cpp │ │ ├── icontheme.h │ │ ├── inputcontext.cpp │ │ ├── inputcontext.h │ │ ├── inputcontext_p.h │ │ ├── inputcontextmanager.cpp │ │ ├── inputcontextmanager.h │ │ ├── inputcontextproperty.cpp │ │ ├── inputcontextproperty.h │ │ ├── inputcontextproperty_p.h │ │ ├── inputmethodconfig_p.h │ │ ├── inputmethodengine.cpp │ │ ├── inputmethodengine.h │ │ ├── inputmethodentry.cpp │ │ ├── inputmethodentry.h │ │ ├── inputmethodgroup.cpp │ │ ├── inputmethodgroup.h │ │ ├── inputmethodmanager.cpp │ │ ├── inputmethodmanager.h │ │ ├── inputpanel.cpp │ │ ├── inputpanel.h │ │ ├── instance.cpp │ │ ├── instance.h │ │ ├── instance_p.h │ │ ├── menu.cpp │ │ ├── menu.h │ │ ├── misc_p.h │ │ ├── statusarea.cpp │ │ ├── statusarea.h │ │ ├── surroundingtext.cpp │ │ ├── surroundingtext.h │ │ ├── text.cpp │ │ ├── text.h │ │ ├── userinterface.cpp │ │ ├── userinterface.h │ │ ├── userinterfacemanager.cpp │ │ └── userinterfacemanager.h ├── modules │ ├── CMakeLists.txt │ ├── Fcitx5Module.pc.in │ ├── Fcitx5ModuleConfig.cmake.in │ ├── clipboard │ │ ├── CMakeLists.txt │ │ ├── clipboard.conf.in.in │ │ ├── clipboard.cpp │ │ ├── clipboard.h │ │ ├── clipboard_public.h │ │ ├── clipboardentry.h │ │ ├── waylandclipboard.cpp │ │ ├── waylandclipboard.h │ │ ├── xcbclipboard.cpp │ │ └── xcbclipboard.h │ ├── dbus │ │ ├── CMakeLists.txt │ │ ├── dbus.conf.in.in │ │ ├── dbus_public.h │ │ ├── dbusmodule.cpp │ │ ├── dbusmodule.h │ │ └── org.fcitx.Fcitx5.service.in │ ├── emoji │ │ ├── CMakeLists.txt │ │ ├── data │ │ │ ├── CMakeLists.txt │ │ │ ├── README.md │ │ │ ├── af.dict │ │ │ ├── am.dict │ │ │ ├── ar.dict │ │ │ ├── ar_SA.dict │ │ │ ├── as.dict │ │ │ ├── ast.dict │ │ │ ├── az.dict │ │ │ ├── be.dict │ │ │ ├── bg.dict │ │ │ ├── bn.dict │ │ │ ├── br.dict │ │ │ ├── bs.dict │ │ │ ├── ca.dict │ │ │ ├── ccp.dict │ │ │ ├── ceb.dict │ │ │ ├── chr.dict │ │ │ ├── ckb.dict │ │ │ ├── cs.dict │ │ │ ├── cy.dict │ │ │ ├── da.dict │ │ │ ├── de.dict │ │ │ ├── de_CH.dict │ │ │ ├── dsb.dict │ │ │ ├── el.dict │ │ │ ├── en.dict │ │ │ ├── en_001.dict │ │ │ ├── en_AU.dict │ │ │ ├── en_CA.dict │ │ │ ├── en_GB.dict │ │ │ ├── es.dict │ │ │ ├── es_419.dict │ │ │ ├── es_MX.dict │ │ │ ├── es_US.dict │ │ │ ├── et.dict │ │ │ ├── eu.dict │ │ │ ├── fa.dict │ │ │ ├── fi.dict │ │ │ ├── fil.dict │ │ │ ├── fo.dict │ │ │ ├── fr.dict │ │ │ ├── fr_CA.dict │ │ │ ├── ga.dict │ │ │ ├── gd.dict │ │ │ ├── gl.dict │ │ │ ├── gu.dict │ │ │ ├── ha.dict │ │ │ ├── he.dict │ │ │ ├── hi.dict │ │ │ ├── hi_Latn.dict │ │ │ ├── hr.dict │ │ │ ├── hsb.dict │ │ │ ├── hu.dict │ │ │ ├── hy.dict │ │ │ ├── ia.dict │ │ │ ├── id.dict │ │ │ ├── ig.dict │ │ │ ├── is.dict │ │ │ ├── it.dict │ │ │ ├── ja.dict │ │ │ ├── jv.dict │ │ │ ├── ka.dict │ │ │ ├── kab.dict │ │ │ ├── kk.dict │ │ │ ├── kl.dict │ │ │ ├── km.dict │ │ │ ├── kn.dict │ │ │ ├── ko.dict │ │ │ ├── kok.dict │ │ │ ├── ky.dict │ │ │ ├── lb.dict │ │ │ ├── lo.dict │ │ │ ├── lt.dict │ │ │ ├── lv.dict │ │ │ ├── mi.dict │ │ │ ├── mk.dict │ │ │ ├── ml.dict │ │ │ ├── mn.dict │ │ │ ├── mni.dict │ │ │ ├── mr.dict │ │ │ ├── ms.dict │ │ │ ├── mt.dict │ │ │ ├── my.dict │ │ │ ├── ne.dict │ │ │ ├── nl.dict │ │ │ ├── nn.dict │ │ │ ├── no.dict │ │ │ ├── or.dict │ │ │ ├── pa.dict │ │ │ ├── pa_Arab.dict │ │ │ ├── pcm.dict │ │ │ ├── pl.dict │ │ │ ├── ps.dict │ │ │ ├── pt.dict │ │ │ ├── pt_PT.dict │ │ │ ├── qu.dict │ │ │ ├── rm.dict │ │ │ ├── ro.dict │ │ │ ├── ru.dict │ │ │ ├── rw.dict │ │ │ ├── sc.dict │ │ │ ├── sd.dict │ │ │ ├── si.dict │ │ │ ├── sk.dict │ │ │ ├── sl.dict │ │ │ ├── so.dict │ │ │ ├── sq.dict │ │ │ ├── sr.dict │ │ │ ├── sr_Cyrl_BA.dict │ │ │ ├── sr_Latn.dict │ │ │ ├── sr_Latn_BA.dict │ │ │ ├── sv.dict │ │ │ ├── sw.dict │ │ │ ├── sw_KE.dict │ │ │ ├── ta.dict │ │ │ ├── te.dict │ │ │ ├── tg.dict │ │ │ ├── th.dict │ │ │ ├── ti.dict │ │ │ ├── tk.dict │ │ │ ├── to.dict │ │ │ ├── tr.dict │ │ │ ├── ug.dict │ │ │ ├── uk.dict │ │ │ ├── update-emoji-data.py │ │ │ ├── ur.dict │ │ │ ├── uz.dict │ │ │ ├── vi.dict │ │ │ ├── wo.dict │ │ │ ├── xh.dict │ │ │ ├── yo.dict │ │ │ ├── yo_BJ.dict │ │ │ ├── yue.dict │ │ │ ├── yue_Hans.dict │ │ │ ├── zh.dict │ │ │ ├── zh_Hant.dict │ │ │ ├── zh_Hant_HK.dict │ │ │ └── zu.dict │ │ ├── emoji.conf.in.in │ │ ├── emoji.cpp │ │ ├── emoji.h │ │ └── emoji_public.h │ ├── imselector │ │ ├── CMakeLists.txt │ │ ├── imselector.conf.in.in │ │ ├── imselector.cpp │ │ └── imselector.h │ ├── notificationitem │ │ ├── CMakeLists.txt │ │ ├── dbusmenu.cpp │ │ ├── dbusmenu.h │ │ ├── notificationitem.conf.in.in │ │ ├── notificationitem.cpp │ │ ├── notificationitem.h │ │ └── notificationitem_public.h │ ├── notifications │ │ ├── CMakeLists.txt │ │ ├── notifications.conf.in.in │ │ ├── notifications.cpp │ │ ├── notifications.h │ │ └── notifications_public.h │ ├── quickphrase │ │ ├── CMakeLists.txt │ │ ├── quickphrase.conf.in.in │ │ ├── quickphrase.cpp │ │ ├── quickphrase.d │ │ │ ├── emoji-eac.mb │ │ │ ├── emoji.mb │ │ │ └── latex.mb │ │ ├── quickphrase.h │ │ ├── quickphrase_public.h │ │ ├── quickphraseprovider.cpp │ │ └── quickphraseprovider.h │ ├── spell │ │ ├── CMakeLists.txt │ │ ├── comp_spell_dict.cpp │ │ ├── spell-custom-dict.cpp │ │ ├── spell-custom-dict.h │ │ ├── spell-custom.cpp │ │ ├── spell-custom.h │ │ ├── spell-enchant.cpp │ │ ├── spell-enchant.h │ │ ├── spell.conf.in.in │ │ ├── spell.cpp │ │ ├── spell.h │ │ └── spell_public.h │ ├── unicode │ │ ├── CMakeLists.txt │ │ ├── charselectdata │ │ ├── charselectdata.cpp │ │ ├── charselectdata.h │ │ ├── gen.py │ │ ├── unicode.conf.in.in │ │ ├── unicode.cpp │ │ ├── unicode.h │ │ └── unicode_public.h │ ├── wayland │ │ ├── CMakeLists.txt │ │ ├── wayland.conf.in.in │ │ ├── wayland_public.h │ │ ├── waylandeventreader.cpp │ │ ├── waylandeventreader.h │ │ ├── waylandmodule.cpp │ │ └── waylandmodule.h │ └── xcb │ │ ├── CMakeLists.txt │ │ ├── xcb.conf.in.in │ │ ├── xcb_public.h │ │ ├── xcbconnection.cpp │ │ ├── xcbconnection.h │ │ ├── xcbconvertselection.cpp │ │ ├── xcbconvertselection.h │ │ ├── xcbeventreader.cpp │ │ ├── xcbeventreader.h │ │ ├── xcbkeyboard.cpp │ │ ├── xcbkeyboard.h │ │ ├── xcbmodule.cpp │ │ └── xcbmodule.h ├── server │ ├── CMakeLists.txt │ ├── errorhandler.cpp │ ├── errorhandler.h │ └── main.cpp ├── tools │ ├── CMakeLists.txt │ ├── remote.cpp │ └── wayland-launcher.cpp └── ui │ ├── CMakeLists.txt │ ├── classic │ ├── CMakeLists.txt │ ├── buffer.cpp │ ├── buffer.h │ ├── classicui.conf.in.in │ ├── classicui.cpp │ ├── classicui.h │ ├── classicui_public.h │ ├── colorhelper.cpp │ ├── colorhelper.h │ ├── common.h │ ├── inputwindow.cpp │ ├── inputwindow.h │ ├── plasmathemewatchdog.cpp │ ├── plasmathemewatchdog.h │ ├── portalsettingmonitor.cpp │ ├── portalsettingmonitor.h │ ├── theme.cpp │ ├── theme.h │ ├── themes │ │ ├── CMakeLists.txt │ │ ├── default-dark │ │ │ ├── CMakeLists.txt │ │ │ ├── arrow.png │ │ │ ├── next.png │ │ │ ├── prev.png │ │ │ ├── radio.png │ │ │ └── theme-dark.conf.in │ │ └── default │ │ │ ├── CMakeLists.txt │ │ │ ├── arrow.png │ │ │ ├── next.png │ │ │ ├── prev.png │ │ │ ├── radio.png │ │ │ └── theme.conf.in │ ├── waylandcursor.cpp │ ├── waylandcursor.h │ ├── waylandcursortheme.cpp │ ├── waylandcursortheme.h │ ├── waylandinputwindow.cpp │ ├── waylandinputwindow.h │ ├── waylandpointer.cpp │ ├── waylandpointer.h │ ├── waylandshmwindow.cpp │ ├── waylandshmwindow.h │ ├── waylandui.cpp │ ├── waylandui.h │ ├── waylandwindow.cpp │ ├── waylandwindow.h │ ├── window.cpp │ ├── window.h │ ├── xcbinputwindow.cpp │ ├── xcbinputwindow.h │ ├── xcbmenu.cpp │ ├── xcbmenu.h │ ├── xcbtraywindow.cpp │ ├── xcbtraywindow.h │ ├── xcbui.cpp │ ├── xcbui.h │ ├── xcbwindow.cpp │ └── xcbwindow.h │ ├── kimpanel │ ├── CMakeLists.txt │ ├── kimpanel.conf.in.in │ ├── kimpanel.cpp │ └── kimpanel.h │ └── virtualkeyboard │ ├── CMakeLists.txt │ ├── virtualkeyboard.conf.in.in │ ├── virtualkeyboard.cpp │ └── virtualkeyboard.h ├── test ├── CMakeLists.txt ├── addon │ ├── CMakeLists.txt │ ├── dummyaddon.cpp │ ├── dummyaddon_public.h │ ├── dummyaddondeps.cpp │ └── fcitx5 │ │ ├── addon │ │ ├── testfrontend.conf │ │ └── testim.conf │ │ └── data │ │ ├── QuickPhrase.mb │ │ └── quickphrase.d │ │ ├── test-disable.mb │ │ ├── test-disable.mb.disable │ │ └── test.mb ├── addon2 │ └── fcitx5 │ │ └── addon │ │ ├── dummyaddon.conf │ │ ├── dummyaddon2.conf │ │ └── dummyaddon3.conf ├── dbus_wrapper.sh ├── eventlooptests.cpp ├── eventlooptests.h ├── invalid_uuid ├── testaddon.cpp ├── testcandidatelist.cpp ├── testcolor.cpp ├── testcompose.cpp ├── testconfig.cpp ├── testconfig.h ├── testconfigdbus.cpp ├── testcustomeventloop.cpp ├── testdbus.cpp ├── testdbusmessage.cpp ├── testdir.h.in ├── testelement.cpp ├── testemoji.cpp ├── testenviron.cpp ├── testevent.cpp ├── testeventdispatcher.cpp ├── testfallbackuuid.cpp ├── testfdstreambuf.cpp ├── testflags.cpp ├── testfs.cpp ├── testhandlertable.cpp ├── testi18nstring.cpp ├── testicontheme.cpp ├── testinputbuffer.cpp ├── testinputcontext.cpp ├── testinstance.cpp ├── testisocodes.cpp ├── testkey.cpp ├── testlibrary.cpp ├── testlist.cpp ├── testlog.cpp ├── testmenu.cpp ├── testmetastring.cpp ├── testquickphrase.cpp ├── testrect.cpp ├── testsemver.cpp ├── testservicewatcher.cpp ├── testsignals.cpp ├── testspell.cpp ├── teststandardpath.cpp ├── teststandardpaths_unix.cpp ├── teststandardpaths_win.cpp ├── teststringutils.cpp ├── testsurroundingtext.cpp ├── testtext.cpp ├── testunicode.cpp ├── testunixfd.cpp ├── testuserinterfacemanager.cpp ├── testutf8.cpp ├── testxim.cpp ├── testxkbrules.cpp ├── uuid └── xvfb_wrapper.sh └── testing ├── CMakeLists.txt ├── testfrontend ├── CMakeLists.txt ├── testfrontend.conf ├── testfrontend.cpp ├── testfrontend.h └── testfrontend_public.h ├── testim ├── CMakeLists.txt ├── testim.conf ├── testim.cpp ├── testim.h └── testim_public.h └── testui ├── CMakeLists.txt ├── testui.conf ├── testui.cpp └── testui.h /.codedocs: -------------------------------------------------------------------------------- 1 | INPUT = src/lib 2 | DOXYFILE_ENCODING = UTF-8 3 | PROJECT_NAME = Fcitx 4 | OUTPUT_LANGUAGE = English 5 | SOURCE_BROWSER = YES 6 | FILE_PATTERNS = 7 | QT_AUTOBRIEF = YES 8 | RECURSIVE = YES 9 | STRIP_CODE_COMMENTS = NO 10 | EXCLUDE_PATTERNS = "*/src/lib/fcitx-wayland/*" "*/*_p.h" 11 | ENABLE_PREPROCESSING = YES 12 | MACRO_EXPANSION = YES 13 | 14 | STRIP_FROM_PATH = src/lib 15 | STRIP_FROM_INC_PATH = src/lib 16 | -------------------------------------------------------------------------------- /.formatignore: -------------------------------------------------------------------------------- 1 | keynametable.h 2 | keysymgen.h 3 | keysymdef.h 4 | XF86keysym.h 5 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.yml: -------------------------------------------------------------------------------- 1 | name: Bug Report 2 | description: Create a report to help us improve 3 | 4 | body: 5 | - type: textarea 6 | id: summary 7 | attributes: 8 | label: Summary 9 | description: Briefly describe the bug. It is Ok to write the issue in Chinese. 以下内容均可使用中文。 10 | 11 | - type: textarea 12 | id: step_to_reproduce 13 | attributes: 14 | label: Steps to Reproduce 15 | description: How to reproduce the bug. 16 | placeholder: | 17 | 1. Switch to which input method 18 | 2. The key that you pressed 19 | 3. Something when wrong ... (Unexpected text committed, etc) 20 | validations: 21 | required: true 22 | 23 | - type: textarea 24 | id: expected_behavior 25 | attributes: 26 | label: Expected Behavior 27 | description: What is expected to happen after the steps above. 28 | validations: 29 | required: true 30 | 31 | - type: textarea 32 | id: diagnose 33 | attributes: 34 | label: Output of fcitx5-diagnose command 35 | description: Please copy-paste the output of `LANGUAGE=en fcitx5-diagnose` command. If your issue is related to certain application (e.g. cannot use fcitx in some application), please make sure you run this command while this application is running. 36 | validations: 37 | required: true 38 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | 3 | contact_links: 4 | - name: GitHub Discussions 5 | url: https://github.com/fcitx/fcitx5/dicussions 6 | about: Ask any question about Fcitx here 7 | 8 | - name: Telegram Group 9 | url: https://fcitx-im.org/telegram/captcha.html 10 | about: You may also ask questions or discuss new features in the group. 11 | 12 | - name: Wiki 13 | url: https://fcitx-im.org 14 | about: Wiki 15 | 16 | - name: Release 17 | url: https://download.fcitx-im.org/ 18 | about: Source code release 19 | 20 | - name: Android 21 | url: https://github.com/fcitx5-android/fcitx5-android 22 | about: Android 23 | 24 | - name: Mac OS 25 | url: https://github.com/fcitx-contrib/fcitx5-macos/ 26 | about: Mac OS 27 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.yml: -------------------------------------------------------------------------------- 1 | name: Feature Request 2 | description: Suggest a new feature for this project 3 | 4 | body: 5 | - type: textarea 6 | id: summary 7 | attributes: 8 | label: Summary 9 | description: Describe this new feature 10 | validations: 11 | required: true 12 | 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build*/ 2 | .* 3 | !.git* 4 | .git/ 5 | *.tar.* 6 | *.kdev4 7 | *.kate-swp 8 | *.orig 9 | tags 10 | astyle.sh 11 | cscope.* 12 | *.part 13 | XF86keysym.h 14 | keysymdef.h 15 | *~ 16 | -------------------------------------------------------------------------------- /.reuse/dep5: -------------------------------------------------------------------------------- 1 | Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ 2 | Upstream-Name: fcitx5 3 | Upstream-Contact: fcitx-dev 4 | Source: https://github.com/fcitx/fcitx5 5 | 6 | Files: src/modules/emoji/data/*.dict 7 | Copyright: Unicode, Inc. 8 | License: Unicode-DFS-2016 9 | -------------------------------------------------------------------------------- /Doxyfile.in: -------------------------------------------------------------------------------- 1 | OUTPUT_DIRECTORY = @CMAKE_CURRENT_BINARY_DIR@/doc/ 2 | PROJECT_NUMBER = @FCITX_VERSION@ 3 | 4 | @FCITX_DOXYGEN_CONFIGURATION@ 5 | -------------------------------------------------------------------------------- /Messages.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | gen_pot cxx:desktop:appdata:sh fcitx5 po . 4 | -------------------------------------------------------------------------------- /cmake/FindIsoCodes.cmake: -------------------------------------------------------------------------------- 1 | # - Try to find the IsoCodes libraries 2 | # Once done this will define 3 | # 4 | # ISOCODES_FOUND - system has ISOCODES 5 | # ISOCODES_INCLUDE_DIR - the ISOCODES include directory 6 | # ISOCODES_LIBRARIES - ISOCODES library 7 | # 8 | # Copyright (c) 2012 CSSlayer 9 | # 10 | # Redistribution and use is allowed according to the terms of the BSD license. 11 | # For details see the accompanying COPYING-CMAKE-SCRIPTS file. 12 | 13 | if(ISOCODES_INCLUDE_DIR AND ISOCODES_LIBRARIES) 14 | # Already in cache, be silent 15 | set(ISOCODES_FIND_QUIETLY TRUE) 16 | endif(ISOCODES_INCLUDE_DIR AND ISOCODES_LIBRARIES) 17 | 18 | find_package(PkgConfig) 19 | pkg_check_modules(PC_ISOCODES iso-codes) 20 | 21 | if(NOT DEFINED ISOCODES_ISO639_JSON) 22 | find_file(ISOCODES_ISO639_JSON iso_639-3.json 23 | HINTS "${PC_ISOCODES_PREFIX}/share/iso-codes/json/" 24 | ) 25 | endif() 26 | 27 | if(NOT DEFINED ISOCODES_ISO3166_JSON) 28 | find_file(ISOCODES_ISO3166_JSON iso_3166-1.json 29 | HINTS "${PC_ISOCODES_PREFIX}/share/iso-codes/json/" 30 | ) 31 | endif() 32 | 33 | include(FindPackageHandleStandardArgs) 34 | find_package_handle_standard_args(IsoCodes DEFAULT_MSG ISOCODES_ISO639_JSON ISOCODES_ISO3166_JSON) 35 | 36 | mark_as_advanced(ISOCODES_ISO639_JSON ISOCODES_ISO3166_JSON) 37 | -------------------------------------------------------------------------------- /cmake/FindLibKVM.cmake: -------------------------------------------------------------------------------- 1 | # Try to find LibKVM functionality 2 | # Once done this will define 3 | # 4 | # LIBKVM_FOUND - system has LibKVM 5 | # LIBKVM_INCLUDE_DIR - LibKVM include directory 6 | # LIBKVM_LIBRARIES - Libraries needed to use LibKVM 7 | # 8 | 9 | find_path(LIBKVM_INCLUDE_DIR kvm.h) 10 | find_library(LIBKVM_LIBRARIES NAMES kvm) 11 | 12 | include(FindPackageHandleStandardArgs) 13 | find_package_handle_standard_args(LibKVM 14 | REQUIRED_VARS LIBKVM_INCLUDE_DIR LIBKVM_LIBRARIES 15 | ) 16 | 17 | mark_as_advanced(LIBKVM_INCLUDE_DIR LIBKVM_LIBRARIES) 18 | 19 | if(LIBKVM_FOUND AND NOT TARGET LibKVM::LibKVM) 20 | add_library(LibKVM::LibKVM UNKNOWN IMPORTED) 21 | set_target_properties(LibKVM::LibKVM PROPERTIES 22 | IMPORTED_LOCATION "${LIBKVM_LIBRARIES}" 23 | INTERFACE_INCLUDE_DIRECTORIES "${LIBKVM_INCLUDE_DIR}" 24 | ) 25 | endif() 26 | -------------------------------------------------------------------------------- /cmake/FindLibUUID.cmake: -------------------------------------------------------------------------------- 1 | find_package(PkgConfig) 2 | 3 | pkg_check_modules(PKG_LIBUUID QUIET uuid) 4 | 5 | set(LIBUUID_DEFINITIONS ${PKG_LIBUUID_CFLAGS_OTHER}) 6 | set(LIBUUID_VERSION ${PKG_LIBUUID_VERSION}) 7 | 8 | find_path(LIBUUID_INCLUDE_DIR 9 | NAMES uuid.h 10 | HINTS ${PKG_LIBUUID_INCLUDE_DIRS} 11 | ) 12 | find_library(LIBUUID_LIBRARY 13 | NAMES uuid 14 | HINTS ${PKG_LIBUUID_LIBRARY_DIRS} 15 | ) 16 | 17 | include(FindPackageHandleStandardArgs) 18 | find_package_handle_standard_args(LibUUID 19 | FOUND_VAR 20 | LIBUUID_FOUND 21 | REQUIRED_VARS 22 | LIBUUID_LIBRARY 23 | LIBUUID_INCLUDE_DIR 24 | VERSION_VAR 25 | LIBUUID_VERSION 26 | ) 27 | 28 | if(LIBUUID_FOUND AND NOT TARGET LibUUID::LibUUID) 29 | add_library(LibUUID::LibUUID UNKNOWN IMPORTED) 30 | set_target_properties(LibUUID::LibUUID PROPERTIES 31 | IMPORTED_LOCATION "${LIBUUID_LIBRARY}" 32 | INTERFACE_COMPILE_OPTIONS "${LIBUUID_DEFINITIONS}" 33 | INTERFACE_INCLUDE_DIRECTORIES "${LIBUUID_INCLUDE_DIR}" 34 | ) 35 | endif() 36 | 37 | mark_as_advanced(LIBUUID_INCLUDE_DIR LIBUUID_LIBRARY) 38 | 39 | include(FeatureSummary) 40 | set_package_properties(LibUUID PROPERTIES 41 | URL "http://www.kernel.org/pub/linux/utils/util-linux/" 42 | DESCRIPTION "uuid library in util-linux" 43 | ) 44 | -------------------------------------------------------------------------------- /cmake/FindSystemd.cmake: -------------------------------------------------------------------------------- 1 | find_package(PkgConfig) 2 | 3 | pkg_check_modules(PKG_SYSTEMD QUIET systemd) 4 | 5 | set(SYSTEMD_DEFINITIONS ${PKG_SYSTEMD_CFLAGS_OTHER}) 6 | set(SYSTEMD_VERSION ${PKG_SYSTEMD_VERSION}) 7 | 8 | find_path(SYSTEMD_INCLUDE_DIR 9 | NAMES systemd/sd-bus.h systemd/sd-event.h 10 | HINTS ${PKG_SYSTEMD_INCLUDE_DIRS} 11 | ) 12 | 13 | find_library(SYSTEMD_LIBRARY 14 | NAMES systemd 15 | HINTS ${PKG_SYSTEMD_LIBRARY_DIRS} 16 | ) 17 | 18 | include(FindPackageHandleStandardArgs) 19 | find_package_handle_standard_args(Systemd 20 | FOUND_VAR 21 | SYSTEMD_FOUND 22 | REQUIRED_VARS 23 | SYSTEMD_LIBRARY 24 | SYSTEMD_INCLUDE_DIR 25 | VERSION_VAR 26 | SYSTEMD_VERSION 27 | ) 28 | 29 | if(SYSTEMD_FOUND AND NOT TARGET Systemd::Systemd) 30 | add_library(Systemd::Systemd UNKNOWN IMPORTED) 31 | set_target_properties(Systemd::Systemd PROPERTIES 32 | IMPORTED_LOCATION "${SYSTEMD_LIBRARY}" 33 | INTERFACE_COMPILE_OPTIONS "${SYSTEMD_DEFINITIONS}" 34 | INTERFACE_INCLUDE_DIRECTORIES "${SYSTEMD_INCLUDE_DIR}" 35 | ) 36 | endif() 37 | 38 | mark_as_advanced(SYSTEMD_INCLUDE_DIR SYSTEMD_ARCH_INCLUDE_DIR SYSTEMD_LIBRARY) 39 | 40 | include(FeatureSummary) 41 | set_package_properties(Systemd PROPERTIES 42 | URL "http://www.freedesktop.org/wiki/Software/systemd" 43 | DESCRIPTION "A system and service manager for Linux" 44 | ) 45 | -------------------------------------------------------------------------------- /cmake/FindWaylandProtocols.cmake: -------------------------------------------------------------------------------- 1 | find_package(PkgConfig) 2 | 3 | pkg_check_modules(WaylandProtocols QUIET "wayland-protocols>=${WaylandProtocols_FIND_VERSION}") 4 | 5 | pkg_get_variable(WaylandProtocols_PKGDATADIR wayland-protocols pkgdatadir) 6 | 7 | mark_as_advanced(WaylandProtocols_PKGDATADIR) 8 | 9 | string(REGEX REPLACE "[\r\n]" "" WaylandProtocols_PKGDATADIR "${WaylandProtocols_PKGDATADIR}") 10 | 11 | find_package_handle_standard_args(WaylandProtocols 12 | FOUND_VAR 13 | WaylandProtocols_FOUND 14 | REQUIRED_VARS 15 | WaylandProtocols_PKGDATADIR 16 | VERSION_VAR 17 | WaylandProtocols_VERSION 18 | HANDLE_COMPONENTS 19 | ) 20 | 21 | set(WAYLAND_PROTOCOLS_FOUND ${WaylandProtocols_FOUND}) 22 | set(WAYLAND_PROTOCOLS_PKGDATADIR ${WaylandProtocols_PKGDATADIR}) 23 | set(WAYLAND_PROTOCOLS_VERSION ${WaylandProtocols_VERSION}) 24 | 25 | -------------------------------------------------------------------------------- /cmake/FindXKBCommon.cmake: -------------------------------------------------------------------------------- 1 | 2 | include(ECMFindModuleHelpersStub) 3 | 4 | ecm_find_package_version_check(XKBCommon) 5 | 6 | # Note that this list needs to be ordered such that any component 7 | # appears after its dependencies 8 | set(XKBCommon_known_components 9 | XKBCommon 10 | X11) 11 | 12 | set(XKBCommon_XKBCommon_component_deps) 13 | set(XKBCommon_XKBCommon_pkg_config "xkbcommon") 14 | set(XKBCommon_XKBCommon_lib "xkbcommon") 15 | set(XKBCommon_XKBCommon_header "xkbcommon/xkbcommon.h") 16 | 17 | set(XKBCommon_X11_component_deps XKBCommon) 18 | set(XKBCommon_X11_pkg_config "xkbcommon-x11") 19 | set(XKBCommon_X11_lib "xkbcommon-x11") 20 | set(XKBCommon_X11_header "xkbcommon/xkbcommon-x11.h") 21 | 22 | ecm_find_package_parse_components(XKBCommon 23 | RESULT_VAR XKBCommon_components 24 | KNOWN_COMPONENTS ${XKBCommon_known_components} 25 | ) 26 | ecm_find_package_handle_library_components(XKBCommon 27 | COMPONENTS ${XKBCommon_components} 28 | ) 29 | 30 | find_package_handle_standard_args(XKBCommon 31 | FOUND_VAR 32 | XKBCommon_FOUND 33 | REQUIRED_VARS 34 | XKBCommon_LIBRARIES 35 | VERSION_VAR 36 | XKBCommon_VERSION 37 | HANDLE_COMPONENTS 38 | ) 39 | 40 | include(FeatureSummary) 41 | set_package_properties(XKBCommon PROPERTIES 42 | URL "http://xkbcommon.org" 43 | DESCRIPTION "Keyboard handling library using XKB data" 44 | ) 45 | -------------------------------------------------------------------------------- /cmake/FindXKeyboardConfig.cmake: -------------------------------------------------------------------------------- 1 | find_package(PkgConfig) 2 | 3 | pkg_check_modules(PKG_XKEYBOARDCONFIG QUIET xkeyboard-config) 4 | 5 | if(NOT DEFINED XKEYBOARDCONFIG_XKBBASE) 6 | pkg_get_variable(XKEYBOARDCONFIG_XKBBASE xkeyboard-config xkb_base) 7 | endif() 8 | if(NOT DEFINED XKEYBOARDCONFIG_DATADIR) 9 | pkg_get_variable(XKEYBOARDCONFIG_DATADIR xkeyboard-config datadir) 10 | endif() 11 | 12 | set(XKEYBOARDCONFIG_VERSION ${PKG_XKEYBOARDCONFIG_VERSION}) 13 | mark_as_advanced(XKEYBOARDCONFIG_VERSION) 14 | 15 | include(FindPackageHandleStandardArgs) 16 | find_package_handle_standard_args(XKeyboardConfig 17 | FOUND_VAR 18 | XKEYBOARDCONFIG_FOUND 19 | REQUIRED_VARS 20 | XKEYBOARDCONFIG_XKBBASE 21 | XKEYBOARDCONFIG_DATADIR 22 | VERSION_VAR 23 | XKEYBOARDCONFIG_VERSION 24 | ) 25 | -------------------------------------------------------------------------------- /data/20-fcitx-x11.in: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | @FCITX_INSTALL_BINDIR@/fcitx5-remote --check -x 3 | -------------------------------------------------------------------------------- /data/default/ar_DZ: -------------------------------------------------------------------------------- 1 | [ExtraLayout] 2 | 0=ara-azerty 3 | -------------------------------------------------------------------------------- /data/default/as_IN: -------------------------------------------------------------------------------- 1 | [DefaultInputMethod] 2 | 0= 3 | -------------------------------------------------------------------------------- /data/default/ast_ES: -------------------------------------------------------------------------------- 1 | [DefaultInputMethod] 2 | 0=m17n_as_phonetic 3 | -------------------------------------------------------------------------------- /data/default/az_AZ: -------------------------------------------------------------------------------- 1 | [ExtraLayout] 2 | 0=az 3 | -------------------------------------------------------------------------------- /data/default/be_BY: -------------------------------------------------------------------------------- 1 | [ExtraLayout] 2 | 0=by 3 | -------------------------------------------------------------------------------- /data/default/bg_BG: -------------------------------------------------------------------------------- 1 | [ExtraLayout] 2 | 0=bg-phonetic 3 | -------------------------------------------------------------------------------- /data/default/bn_IN: -------------------------------------------------------------------------------- 1 | [DefaultInputMethod] 2 | 0=m17n_bn_inscript 3 | -------------------------------------------------------------------------------- /data/default/cat_ES: -------------------------------------------------------------------------------- 1 | [ExtraLayout] 2 | 0=es-cat 3 | -------------------------------------------------------------------------------- /data/default/cs_CZ: -------------------------------------------------------------------------------- 1 | [ExtraLayout] 2 | 0=cz 3 | -------------------------------------------------------------------------------- /data/default/de_CH: -------------------------------------------------------------------------------- 1 | [ExtraLayout] 2 | 0=ch 3 | -------------------------------------------------------------------------------- /data/default/de_DE: -------------------------------------------------------------------------------- 1 | [ExtraLayout] 2 | 0=de 3 | -------------------------------------------------------------------------------- /data/default/el_CY: -------------------------------------------------------------------------------- 1 | [ExtraLayout] 2 | 0=gr 3 | -------------------------------------------------------------------------------- /data/default/el_GR: -------------------------------------------------------------------------------- 1 | [ExtraLayout] 2 | 0=gr 3 | -------------------------------------------------------------------------------- /data/default/en_GB: -------------------------------------------------------------------------------- 1 | [ExtraLayout] 2 | 0=gb 3 | -------------------------------------------------------------------------------- /data/default/en_US: -------------------------------------------------------------------------------- 1 | [ExtraLayout] 2 | 0=us 3 | -------------------------------------------------------------------------------- /data/default/en_ZA: -------------------------------------------------------------------------------- 1 | [ExtraLayout] 2 | 0=za 3 | -------------------------------------------------------------------------------- /data/default/es_ES: -------------------------------------------------------------------------------- 1 | [ExtraLayout] 2 | 0=es 3 | -------------------------------------------------------------------------------- /data/default/es_GT: -------------------------------------------------------------------------------- 1 | [ExtraLayout] 2 | 0=latam 3 | -------------------------------------------------------------------------------- /data/default/es_MX: -------------------------------------------------------------------------------- 1 | [ExtraLayout] 2 | 0=latam 3 | -------------------------------------------------------------------------------- /data/default/fr_BE: -------------------------------------------------------------------------------- 1 | [ExtraLayout] 2 | 0=be 3 | -------------------------------------------------------------------------------- /data/default/fr_CH: -------------------------------------------------------------------------------- 1 | [ExtraLayout] 2 | 0=ch-fr 3 | -------------------------------------------------------------------------------- /data/default/fr_FR: -------------------------------------------------------------------------------- 1 | [ExtraLayout] 2 | 0=fr-oss 3 | -------------------------------------------------------------------------------- /data/default/gl_ES: -------------------------------------------------------------------------------- 1 | [ExtraLayout] 2 | 0=es 3 | -------------------------------------------------------------------------------- /data/default/gu_IN: -------------------------------------------------------------------------------- 1 | [DefaultInputMethod] 2 | 0=m17n_gu_inscript 3 | -------------------------------------------------------------------------------- /data/default/he_IL: -------------------------------------------------------------------------------- 1 | [ExtraLayout] 2 | 0=il 3 | -------------------------------------------------------------------------------- /data/default/hi_IN: -------------------------------------------------------------------------------- 1 | [DefaultInputMethod] 2 | 0=m17n_hi_inscript 3 | -------------------------------------------------------------------------------- /data/default/id_ID: -------------------------------------------------------------------------------- 1 | [ExtraLayout] 2 | 0=us 3 | -------------------------------------------------------------------------------- /data/default/it_IT: -------------------------------------------------------------------------------- 1 | [ExtraLayout] 2 | 0=it 3 | -------------------------------------------------------------------------------- /data/default/ja_JP: -------------------------------------------------------------------------------- 1 | [DefaultInputMethod] 2 | 0=kkc 3 | 1=mozc 4 | 2=anthy 5 | -------------------------------------------------------------------------------- /data/default/kn_IN: -------------------------------------------------------------------------------- 1 | [DefaultInputMethod] 2 | 0=m17n_kn_kgp 3 | -------------------------------------------------------------------------------- /data/default/ko_KR: -------------------------------------------------------------------------------- 1 | [DefaultInputMethod] 2 | 0=hangul 3 | -------------------------------------------------------------------------------- /data/default/mai_IN: -------------------------------------------------------------------------------- 1 | [DefaultInputMethod] 2 | 0=m17n_mai_inscript 3 | -------------------------------------------------------------------------------- /data/default/ml_IN: -------------------------------------------------------------------------------- 1 | [DefaultInputMethod] 2 | 0=m17n_ml_inscript 3 | -------------------------------------------------------------------------------- /data/default/mr_IN: -------------------------------------------------------------------------------- 1 | [DefaultInputMethod] 2 | 0=m17n_mr_inscript 3 | -------------------------------------------------------------------------------- /data/default/nl_NL: -------------------------------------------------------------------------------- 1 | [ExtraLayout] 2 | 0=us-altgr-intl 3 | -------------------------------------------------------------------------------- /data/default/or_IN: -------------------------------------------------------------------------------- 1 | [DefaultInputMethod] 2 | 0=m17n_or_inscript 3 | -------------------------------------------------------------------------------- /data/default/pa_IN: -------------------------------------------------------------------------------- 1 | [DefaultInputMethod] 2 | 0=m17n_pa_inscript 3 | -------------------------------------------------------------------------------- /data/default/pl_PL: -------------------------------------------------------------------------------- 1 | [ExtraLayout] 2 | 0=pl 3 | -------------------------------------------------------------------------------- /data/default/pt_BR: -------------------------------------------------------------------------------- 1 | [ExtraLayout] 2 | 0=br 3 | -------------------------------------------------------------------------------- /data/default/pt_PT: -------------------------------------------------------------------------------- 1 | [ExtraLayout] 2 | 0=pt 3 | -------------------------------------------------------------------------------- /data/default/ru_RU: -------------------------------------------------------------------------------- 1 | [ExtraLayout] 2 | 0=ru 3 | -------------------------------------------------------------------------------- /data/default/sd_IN: -------------------------------------------------------------------------------- 1 | [DefaultInputMethod] 2 | 0=m17n_sd_inscript 3 | -------------------------------------------------------------------------------- /data/default/sk_SK: -------------------------------------------------------------------------------- 1 | [ExtraLayout] 2 | 0=sk 3 | -------------------------------------------------------------------------------- /data/default/ta_IN: -------------------------------------------------------------------------------- 1 | [DefaultInputMethod] 2 | 0=m17n_ta_tamil99 3 | -------------------------------------------------------------------------------- /data/default/te_IN: -------------------------------------------------------------------------------- 1 | [DefaultInputMethod] 2 | 0=m17n_ts_inscript 3 | -------------------------------------------------------------------------------- /data/default/ur_IN: -------------------------------------------------------------------------------- 1 | [DefaultInputMethod] 2 | 0=m17n_ur_phonetic 3 | -------------------------------------------------------------------------------- /data/default/zh_CN: -------------------------------------------------------------------------------- 1 | [DefaultInputMethod] 2 | 0=pinyin 3 | 1=rime 4 | -------------------------------------------------------------------------------- /data/default/zh_HK: -------------------------------------------------------------------------------- 1 | [DefaultInputMethod] 2 | 0=cangjie 3 | 1=rime 4 | -------------------------------------------------------------------------------- /data/default/zh_TW: -------------------------------------------------------------------------------- 1 | [DefaultInputMethod] 2 | 0=chewing 3 | -------------------------------------------------------------------------------- /data/fcitx5-configtool.desktop.in.in: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=Fcitx 5 Configuration 3 | GenericName=Input Method Configuration 4 | Comment=Change Fcitx 5 Configuration 5 | Exec=@FCITX_INSTALL_BINDIR@/fcitx5-configtool 6 | Icon=@FCITX_ICON_NAME@ 7 | Type=Application 8 | Categories=Settings; 9 | X-KDE-StartupNotify=false 10 | StartupNotify=false 11 | X-AppStream-Ignore=true 12 | NotShowIn=KDE 13 | -------------------------------------------------------------------------------- /data/fcitx5-wayland-launcher.desktop.in.in: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=Fcitx 5 Wayland Launcher (Experimental) 3 | GenericName=Input Method 4 | Comment=Start Input Method 5 | Exec=@FCITX_INSTALL_LIBEXECDIR@/fcitx5-wayland-launcher --reopen 6 | Icon=@FCITX_ICON_NAME@ 7 | Terminal=false 8 | Type=Application 9 | Categories=System;Utility; 10 | StartupNotify=false 11 | NoDisplay=true 12 | OnlyShowIn=KDE 13 | X-KDE-StartupNotify=false 14 | X-KDE-Wayland-VirtualKeyboard=true 15 | X-KDE-Wayland-Interfaces=org_kde_plasma_window_management 16 | -------------------------------------------------------------------------------- /data/icon/128x128/apps/fcitx.png: -------------------------------------------------------------------------------- 1 | org.fcitx.Fcitx5.png -------------------------------------------------------------------------------- /data/icon/128x128/apps/org.fcitx.Fcitx5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/data/icon/128x128/apps/org.fcitx.Fcitx5.png -------------------------------------------------------------------------------- /data/icon/16x16/apps/fcitx.png: -------------------------------------------------------------------------------- 1 | org.fcitx.Fcitx5.png -------------------------------------------------------------------------------- /data/icon/16x16/apps/org.fcitx.Fcitx5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/data/icon/16x16/apps/org.fcitx.Fcitx5.png -------------------------------------------------------------------------------- /data/icon/22x22/apps/fcitx.png: -------------------------------------------------------------------------------- 1 | org.fcitx.Fcitx5.png -------------------------------------------------------------------------------- /data/icon/22x22/apps/org.fcitx.Fcitx5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/data/icon/22x22/apps/org.fcitx.Fcitx5.png -------------------------------------------------------------------------------- /data/icon/24x24/apps/fcitx.png: -------------------------------------------------------------------------------- 1 | org.fcitx.Fcitx5.png -------------------------------------------------------------------------------- /data/icon/24x24/apps/org.fcitx.Fcitx5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/data/icon/24x24/apps/org.fcitx.Fcitx5.png -------------------------------------------------------------------------------- /data/icon/32x32/apps/fcitx.png: -------------------------------------------------------------------------------- 1 | org.fcitx.Fcitx5.png -------------------------------------------------------------------------------- /data/icon/32x32/apps/org.fcitx.Fcitx5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/data/icon/32x32/apps/org.fcitx.Fcitx5.png -------------------------------------------------------------------------------- /data/icon/48x48/apps/fcitx.png: -------------------------------------------------------------------------------- 1 | org.fcitx.Fcitx5.png -------------------------------------------------------------------------------- /data/icon/48x48/apps/org.fcitx.Fcitx5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/data/icon/48x48/apps/org.fcitx.Fcitx5.png -------------------------------------------------------------------------------- /data/icon/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | foreach(size 16 22 24 32 48 128) 2 | install(DIRECTORY ${size}x${size} DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor" 3 | PATTERN .* EXCLUDE 4 | PATTERN *~ EXCLUDE) 5 | endforeach(size 16 22 24 32 48 128) 6 | 7 | install(DIRECTORY scalable DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor" 8 | PATTERN ".*" EXCLUDE 9 | PATTERN "*~" EXCLUDE) 10 | -------------------------------------------------------------------------------- /data/icon/scalable/apps/fcitx.svg: -------------------------------------------------------------------------------- 1 | org.fcitx.Fcitx5.svg -------------------------------------------------------------------------------- /data/org.fcitx.Fcitx5.desktop.in.in: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=Fcitx 5 3 | GenericName=Input Method 4 | Comment=Start Input Method 5 | Exec=@FCITX_INSTALL_BINDIR@/fcitx5 6 | Icon=@FCITX_ICON_NAME@ 7 | Terminal=false 8 | Type=Application 9 | Categories=System;Utility; 10 | StartupNotify=false 11 | X-GNOME-AutoRestart=false 12 | X-GNOME-Autostart-Notify=false 13 | X-KDE-autostart-after=panel 14 | X-KDE-StartupNotify=false 15 | X-KDE-Wayland-VirtualKeyboard=true 16 | X-KDE-Wayland-Interfaces=org_kde_plasma_window_management 17 | -------------------------------------------------------------------------------- /po/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | fcitx5_install_translation(fcitx5) 2 | -------------------------------------------------------------------------------- /po/LINGUAS: -------------------------------------------------------------------------------- 1 | 2 | ca 3 | da 4 | de 5 | es 6 | fr 7 | he 8 | ja 9 | ko 10 | ru 11 | vi 12 | zh_CN 13 | zh_TW 14 | -------------------------------------------------------------------------------- /src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_definitions("-DFCITX_GETTEXT_DOMAIN=\"fcitx5\"") 2 | 3 | add_subdirectory(lib) 4 | add_subdirectory(modules) 5 | add_subdirectory(frontend) 6 | add_subdirectory(im) 7 | add_subdirectory(ui) 8 | 9 | 10 | if (ENABLE_SERVER) 11 | add_subdirectory(server) 12 | 13 | if (NOT BUILD_SHARED_FCITX_ADDON) 14 | fcitx5_get_addon_targets(ADDON_TARGETS modules frontend im ui) 15 | 16 | fcitx5_import_addons(fcitx5 17 | REGISTRY_VARNAME getStaticAddon 18 | ADDONS ${ADDON_TARGETS} 19 | ) 20 | endif() 21 | endif() 22 | 23 | add_subdirectory(tools) 24 | -------------------------------------------------------------------------------- /src/frontend/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (ENABLE_X11) 2 | add_subdirectory(xim) 3 | endif() 4 | 5 | if (WAYLAND_FOUND) 6 | add_subdirectory(waylandim) 7 | endif() 8 | 9 | if (ENABLE_DBUS) 10 | add_subdirectory(dbusfrontend) 11 | add_subdirectory(fcitx4frontend) 12 | add_subdirectory(ibusfrontend) 13 | endif() 14 | -------------------------------------------------------------------------------- /src/frontend/dbusfrontend/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_fcitx5_addon(dbusfrontend dbusfrontend.cpp) 2 | target_link_libraries(dbusfrontend Fcitx5::Core Fcitx5::Module::DBus) 3 | install(TARGETS dbusfrontend DESTINATION "${FCITX_INSTALL_ADDONDIR}") 4 | configure_file(dbusfrontend.conf.in.in dbusfrontend.conf.in @ONLY) 5 | fcitx5_translate_desktop_file(${CMAKE_CURRENT_BINARY_DIR}/dbusfrontend.conf.in dbusfrontend.conf) 6 | install(FILES "${CMAKE_CURRENT_BINARY_DIR}/dbusfrontend.conf" DESTINATION "${FCITX_INSTALL_PKGDATADIR}/addon" 7 | COMPONENT config) 8 | -------------------------------------------------------------------------------- /src/frontend/dbusfrontend/dbusfrontend.conf.in.in: -------------------------------------------------------------------------------- 1 | [Addon] 2 | Name=DBus Frontend 3 | Type=@FCITX_ADDON_TYPE@ 4 | Library=libdbusfrontend 5 | Category=Frontend 6 | Version=@PROJECT_VERSION@ 7 | 8 | [Addon/Dependencies] 9 | 0=core:@PROJECT_VERSION@ 10 | 1=dbus 11 | -------------------------------------------------------------------------------- /src/frontend/fcitx4frontend/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_fcitx5_addon(fcitx4frontend fcitx4frontend.cpp) 2 | target_link_libraries(fcitx4frontend Fcitx5::Core Fcitx5::Module::DBus) 3 | if (ENABLE_X11) 4 | target_link_libraries(fcitx4frontend Fcitx5::Module::XCB XCB::XCB) 5 | endif() 6 | install(TARGETS fcitx4frontend DESTINATION "${FCITX_INSTALL_ADDONDIR}") 7 | configure_file(fcitx4frontend.conf.in.in fcitx4frontend.conf.in @ONLY) 8 | fcitx5_translate_desktop_file(${CMAKE_CURRENT_BINARY_DIR}/fcitx4frontend.conf.in fcitx4frontend.conf) 9 | install(FILES "${CMAKE_CURRENT_BINARY_DIR}/fcitx4frontend.conf" DESTINATION "${FCITX_INSTALL_PKGDATADIR}/addon" 10 | COMPONENT config) 11 | -------------------------------------------------------------------------------- /src/frontend/fcitx4frontend/fcitx4frontend.conf.in.in: -------------------------------------------------------------------------------- 1 | [Addon] 2 | Name=Fcitx4 Frontend 3 | Type=@FCITX_ADDON_TYPE@ 4 | Library=libfcitx4frontend 5 | Category=Frontend 6 | Version=@PROJECT_VERSION@ 7 | 8 | [Addon/Dependencies] 9 | 0=core:@PROJECT_VERSION@ 10 | 1=dbus 11 | 12 | [Addon/OptionalDependencies] 13 | 0=xcb 14 | 15 | -------------------------------------------------------------------------------- /src/frontend/ibusfrontend/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_fcitx5_addon(ibusfrontend ibusfrontend.cpp) 2 | target_link_libraries(ibusfrontend Fcitx5::Core Fcitx5::Module::DBus) 3 | install(TARGETS ibusfrontend DESTINATION "${FCITX_INSTALL_ADDONDIR}") 4 | configure_file(ibusfrontend.conf.in.in ibusfrontend.conf.in @ONLY) 5 | fcitx5_translate_desktop_file(${CMAKE_CURRENT_BINARY_DIR}/ibusfrontend.conf.in ibusfrontend.conf) 6 | install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ibusfrontend.conf" DESTINATION "${FCITX_INSTALL_PKGDATADIR}/addon" 7 | COMPONENT config) 8 | 9 | if (ENABLE_LIBUUID) 10 | target_link_libraries(ibusfrontend LibUUID::LibUUID) 11 | endif() 12 | -------------------------------------------------------------------------------- /src/frontend/ibusfrontend/ibusfrontend.conf.in.in: -------------------------------------------------------------------------------- 1 | [Addon] 2 | Name=IBus Frontend 3 | Type=@FCITX_ADDON_TYPE@ 4 | Library=libibusfrontend 5 | Category=Frontend 6 | Version=@PROJECT_VERSION@ 7 | 8 | [Addon/Dependencies] 9 | 0=core:@PROJECT_VERSION@ 10 | 1=dbus 11 | 12 | -------------------------------------------------------------------------------- /src/frontend/waylandim/appmonitor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2022~2022 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | * 6 | */ 7 | #ifndef _FCITX5_FRONTEND_WAYLANDIM_APPMONITOR_H_ 8 | #define _FCITX5_FRONTEND_WAYLANDIM_APPMONITOR_H_ 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include "fcitx-utils/signals.h" 16 | 17 | namespace fcitx { 18 | 19 | class AppMonitor { 20 | public: 21 | virtual ~AppMonitor() = default; 22 | Signal &appState, 23 | const std::optional &focus)> 24 | appUpdated; 25 | 26 | virtual bool isAvailable() const = 0; 27 | }; 28 | 29 | class AggregatedAppMonitor : public AppMonitor { 30 | public: 31 | AggregatedAppMonitor(); 32 | 33 | void addSubMonitor(std::unique_ptr monitor); 34 | bool isAvailable() const override; 35 | AppMonitor *activeMonitor() const; 36 | 37 | private: 38 | std::vector> subMonitors_; 39 | }; 40 | 41 | } // namespace fcitx 42 | 43 | #endif // _FCITX5_FRONTEND_WAYLANDIM_APPMONITOR_H_ 44 | -------------------------------------------------------------------------------- /src/frontend/waylandim/plasmaappmonitor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2022~2022 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | * 6 | */ 7 | #ifndef _FCITX5_FRONTEND_WAYLANDIM_PLASMAAPPMONITOR_H_ 8 | #define _FCITX5_FRONTEND_WAYLANDIM_PLASMAAPPMONITOR_H_ 9 | 10 | #include 11 | #include 12 | #include "fcitx-utils/signals.h" 13 | #include "fcitx-wayland/core/display.h" 14 | #include "appmonitor.h" 15 | 16 | namespace fcitx { 17 | namespace wayland { 18 | class OrgKdePlasmaWindowManagement; 19 | class OrgKdePlasmaWindow; 20 | } // namespace wayland 21 | class PlasmaWindow; 22 | 23 | class PlasmaAppMonitor : public AppMonitor { 24 | public: 25 | PlasmaAppMonitor(wayland::Display *display); 26 | ~PlasmaAppMonitor() override; 27 | 28 | void setup(wayland::OrgKdePlasmaWindowManagement *management); 29 | void remove(wayland::OrgKdePlasmaWindow *window); 30 | void refresh(); 31 | bool isAvailable() const override; 32 | 33 | private: 34 | ScopedConnection globalConn_; 35 | ScopedConnection windowConn_; 36 | std::unordered_map> 38 | windows_; 39 | }; 40 | 41 | } // namespace fcitx 42 | 43 | #endif // _FCITX5_FRONTEND_WAYLANDIM_PLASMAAPPMONITOR_H_ 44 | -------------------------------------------------------------------------------- /src/frontend/waylandim/waylandim.conf.in.in: -------------------------------------------------------------------------------- 1 | [Addon] 2 | Name=Wayland Input method frontend 3 | Type=@FCITX_ADDON_TYPE@ 4 | Library=libwaylandim 5 | Category=Frontend 6 | Version=@PROJECT_VERSION@ 7 | Configurable=True 8 | 9 | [Addon/Dependencies] 10 | 0=core:@PROJECT_VERSION@ 11 | 1=wayland:@PROJECT_VERSION@ 12 | 13 | -------------------------------------------------------------------------------- /src/frontend/waylandim/waylandim_public.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2020~2020 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | * 6 | */ 7 | #ifndef _FCITX5_FRONTEND_WAYLANDIM_WAYLANDIM_PUBLIC_H_ 8 | #define _FCITX5_FRONTEND_WAYLANDIM_WAYLANDIM_PUBLIC_H_ 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | namespace fcitx::wayland { 17 | class ZwpInputMethodV2; 18 | } 19 | 20 | FCITX_ADDON_DECLARE_FUNCTION( 21 | WaylandIMModule, getInputMethodV2, 22 | fcitx::wayland::ZwpInputMethodV2 *(fcitx::InputContext *)); 23 | 24 | FCITX_ADDON_DECLARE_FUNCTION(WaylandIMModule, hasKeyboardGrab, 25 | bool(const std::string &display)); 26 | 27 | #endif // _FCITX5_FRONTEND_WAYLANDIM_WAYLANDIM_PUBLIC_H_ 28 | -------------------------------------------------------------------------------- /src/frontend/xim/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_fcitx5_addon(xim xim.cpp) 2 | target_link_libraries(xim Fcitx5::Core XCBImdkit::XCBImdkit XCB::XCB XCB::AUX XCB::EWMH XKBCommon::XKBCommon Fcitx5::Module::XCB) 3 | target_compile_definitions(xim PRIVATE -DFCITX_XCB_EWMH) 4 | install(TARGETS xim DESTINATION "${FCITX_INSTALL_ADDONDIR}") 5 | install(FILES "${CMAKE_CURRENT_BINARY_DIR}/xim.conf" DESTINATION "${FCITX_INSTALL_PKGDATADIR}/addon" 6 | COMPONENT config) 7 | 8 | configure_file(xim.conf.in.in xim.conf.in @ONLY) 9 | fcitx5_translate_desktop_file(${CMAKE_CURRENT_BINARY_DIR}/xim.conf.in xim.conf) 10 | -------------------------------------------------------------------------------- /src/frontend/xim/xim.conf.in.in: -------------------------------------------------------------------------------- 1 | [Addon] 2 | Name=X Input Method Frontend 3 | Type=@FCITX_ADDON_TYPE@ 4 | Library=libxim 5 | Category=Frontend 6 | Version=@PROJECT_VERSION@ 7 | Configurable=True 8 | 9 | [Addon/Dependencies] 10 | 0=core:@PROJECT_VERSION@ 11 | 1=xcb 12 | 13 | # This intends to load xim after dbus & ibusfrontend, so xim is released before dbus. 14 | # This helps new fcitx server to become xim server properly when replacing. 15 | [Addon/OptionalDependencies] 16 | 0=dbus 17 | 1=ibusfrontend 18 | -------------------------------------------------------------------------------- /src/im/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (ENABLE_KEYBOARD) 2 | add_subdirectory(keyboard) 3 | endif() 4 | -------------------------------------------------------------------------------- /src/im/keyboard/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(keyboard STATIC keyboard.cpp isocodes.cpp xkbrules.cpp xmlparser.cpp longpress.cpp compose.cpp) 2 | target_link_libraries(keyboard Fcitx5::Core Expat::Expat LibIntl::LibIntl Fcitx5::Module::Spell Fcitx5::Module::Notifications XKBCommon::XKBCommon Fcitx5::Module::QuickPhrase PkgConfig::JsonC) 3 | if (ENABLE_X11) 4 | target_link_libraries(keyboard Fcitx5::Module::XCB) 5 | endif() 6 | if (TARGET Fcitx5::Module::Emoji) 7 | target_link_libraries(keyboard Fcitx5::Module::Emoji) 8 | endif() 9 | configure_file(keyboard.conf.in.in keyboard.conf.in @ONLY) 10 | fcitx5_translate_desktop_file(${CMAKE_CURRENT_BINARY_DIR}/keyboard.conf.in keyboard.conf) 11 | install(FILES "${CMAKE_CURRENT_BINARY_DIR}/keyboard.conf" DESTINATION "${FCITX_INSTALL_PKGDATADIR}/addon" 12 | COMPONENT config) 13 | fcitx5_export_module(Keyboard TARGET keyboard BUILD_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}" HEADERS keyboard_public.h) 14 | -------------------------------------------------------------------------------- /src/im/keyboard/compose.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2022-2022 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | * 6 | */ 7 | #ifndef _FCITX_IM_KEYBOARD_COMPOSE_H_ 8 | #define _FCITX_IM_KEYBOARD_COMPOSE_H_ 9 | 10 | #include 11 | #include 12 | #include 13 | #include "fcitx-utils/key.h" 14 | #include "fcitx/instance.h" 15 | 16 | namespace fcitx { 17 | class ComposeState { 18 | public: 19 | ComposeState(Instance *instance, InputContext *inputContext); 20 | std::tuple type(KeySym sym); 21 | void backspace(); 22 | std::string preedit() const; 23 | void reset(); 24 | bool isComposing() const { return !composeBuffer_.empty(); } 25 | 26 | private: 27 | bool typeImpl(KeySym sym, std::string &result); 28 | Instance *instance_; 29 | InputContext *inputContext_; 30 | std::deque composeBuffer_; 31 | }; 32 | } // namespace fcitx 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/im/keyboard/keyboard.conf.in.in: -------------------------------------------------------------------------------- 1 | [Addon] 2 | Name=Keyboard 3 | Type=StaticLibrary 4 | Library=keyboard 5 | Category=InputMethod 6 | Version=@PROJECT_VERSION@ 7 | Configurable=True 8 | 9 | [Addon/Dependencies] 10 | 0=core:@PROJECT_VERSION@ 11 | 12 | [Addon/OptionalDependencies] 13 | 0=xcb 14 | 1=spell 15 | 2=notifications 16 | 3=emoji 17 | 4=quickphrase 18 | -------------------------------------------------------------------------------- /src/im/keyboard/keyboard_public.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2017-2017 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | * 6 | */ 7 | #ifndef _FCITX_IM_KEYBOARD_KEYBOARD_PUBLIC_H_ 8 | #define _FCITX_IM_KEYBOARD_KEYBOARD_PUBLIC_H_ 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | FCITX_ADDON_DECLARE_FUNCTION( 16 | KeyboardEngine, foreachLayout, 17 | bool(const std::function< 18 | bool(const std::string &layout, const std::string &description, 19 | const std::vector &languages)> &callback)); 20 | 21 | FCITX_ADDON_DECLARE_FUNCTION( 22 | KeyboardEngine, foreachVariant, 23 | bool(const std::string &layout, 24 | const std::function< 25 | bool(const std::string &variant, const std::string &description, 26 | const std::vector &languages)> &callback)); 27 | 28 | #endif // _FCITX_IM_KEYBOARD_KEYBOARD_PUBLIC_H_ 29 | -------------------------------------------------------------------------------- /src/im/keyboard/xmlparser.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2017-2017 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | * 6 | */ 7 | #ifndef _FCITX_IM_KEYBOARD_XMLPARSER_H_ 8 | #define _FCITX_IM_KEYBOARD_XMLPARSER_H_ 9 | 10 | #include 11 | #include 12 | 13 | namespace fcitx { 14 | 15 | class XMLParser { 16 | public: 17 | virtual ~XMLParser() {} 18 | bool parse(const std::string &name); 19 | 20 | protected: 21 | virtual void startElement(const char *name, const char **attrs) = 0; 22 | virtual void endElement(const char *) = 0; 23 | virtual void characterData(const char *ch, int len) = 0; 24 | }; 25 | } // namespace fcitx 26 | 27 | #endif // _FCITX_IM_KEYBOARD_XMLPARSER_H_ 28 | -------------------------------------------------------------------------------- /src/lib/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(fcitx-utils) 2 | add_subdirectory(fcitx-config) 3 | add_subdirectory(fcitx) 4 | 5 | if (WAYLAND_FOUND) 6 | 7 | add_subdirectory(fcitx-wayland) 8 | endif() 9 | -------------------------------------------------------------------------------- /src/lib/fcitx-config/Fcitx5Config.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | exec_prefix=${prefix} 3 | libdir=@CMAKE_INSTALL_FULL_LIBDIR@ 4 | includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@/Fcitx5/Config 5 | 6 | Name: Fcitx5Config 7 | Description: Fcitx Config Library 8 | Version: @FCITX_VERSION@ 9 | Requires: Fcitx5Utils 10 | Cflags: -I${includedir} 11 | Libs: -L${libdir} -lFcitx5Config 12 | -------------------------------------------------------------------------------- /src/lib/fcitx-config/Fcitx5ConfigConfig.cmake.in: -------------------------------------------------------------------------------- 1 | @PACKAGE_INIT@ 2 | 3 | include(CMakeFindDependencyMacro) 4 | 5 | find_dependency(Fcitx5Utils @FCITX_VERSION@) 6 | 7 | include("${CMAKE_CURRENT_LIST_DIR}/Fcitx5ConfigTargets.cmake") 8 | -------------------------------------------------------------------------------- /src/lib/fcitx-config/dbushelper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2017-2017 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | * 6 | */ 7 | #ifndef _FCITX_CONFIG_DBUSHELPER_H_ 8 | #define _FCITX_CONFIG_DBUSHELPER_H_ 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | namespace fcitx { 18 | 19 | // a{sv} 20 | using DBusVariantMap = std::vector>; 21 | // name, type, description, defaultValue, constrain. 22 | // (sssva{sv}) 23 | using DBusConfigOption = dbus::DBusStruct; 25 | // a(sa(sssva{sv})) 26 | using DBusConfig = 27 | std::vector>>; 28 | 29 | FCITXCONFIG_EXPORT dbus::Variant rawConfigToVariant(const RawConfig &config); 30 | FCITXCONFIG_EXPORT RawConfig variantToRawConfig(const dbus::Variant &map); 31 | FCITXCONFIG_EXPORT DBusConfig 32 | dumpDBusConfigDescription(const Configuration &config); 33 | 34 | } // namespace fcitx 35 | 36 | #endif // _FCITX_CONFIG_DBUSHELPER_H_ 37 | -------------------------------------------------------------------------------- /src/lib/fcitx-utils/Fcitx5Download.cmake.in: -------------------------------------------------------------------------------- 1 | if (NOT EXISTS "@FCITX5_DOWNLOAD_DEST@") 2 | message(STATUS "Downloading '@FCITX5_DOWNLOAD_URL@' to '@FCITX5_DOWNLOAD_DEST@'...") 3 | file(DOWNLOAD 4 | "@FCITX5_DOWNLOAD_URL@" 5 | "@FCITX5_DOWNLOAD_DEST@" 6 | EXPECTED_HASH SHA256=@FCITX5_DOWNLOAD_SHA256@ 7 | TLS_VERIFY ON 8 | SHOW_PROGRESS) 9 | else() 10 | file(SHA256 "@FCITX5_DOWNLOAD_DEST@" actual_value) 11 | if(NOT "${actual_value}" STREQUAL "@FCITX5_DOWNLOAD_SHA256@") 12 | message(STATUS "File exists but hash doesn't match, removing...") 13 | file(REMOVE "@FCITX5_DOWNLOAD_DEST@") 14 | endif() 15 | endif() 16 | -------------------------------------------------------------------------------- /src/lib/fcitx-utils/Fcitx5ModuleTemplate.cmake.in: -------------------------------------------------------------------------------- 1 | if (TARGET Fcitx5::Module::@FEM_EXPORTNAME@ AND TARGET @FEM_TARGET@-interface) 2 | return() 3 | endif() 4 | 5 | add_library(@FEM_TARGET@-interface INTERFACE) 6 | add_library(Fcitx5::Module::@FEM_EXPORTNAME@ ALIAS @FEM_TARGET@-interface) 7 | set_target_properties(@FEM_TARGET@-interface PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "@_MODULE_HEADER_DIR@") 8 | -------------------------------------------------------------------------------- /src/lib/fcitx-utils/Fcitx5Utils.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | exec_prefix=${prefix} 3 | libdir=@CMAKE_INSTALL_FULL_LIBDIR@ 4 | includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@/Fcitx5/Utils 5 | 6 | Name: Fcitx5Utils 7 | Description: Fcitx Utils Library 8 | Version: @FCITX_VERSION@ 9 | Cflags: -I${includedir} 10 | Libs: -L${libdir} -lFcitx5Utils 11 | -------------------------------------------------------------------------------- /src/lib/fcitx-utils/dbus/libdbus/objectvtable_p_libdbus.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2016-2016 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | * 6 | */ 7 | #ifndef _FCITX_UTILS_DBUS_OBJECTVTABLE_P_H_ 8 | #define _FCITX_UTILS_DBUS_OBJECTVTABLE_P_H_ 9 | 10 | #include 11 | #include 12 | #include 13 | #include "../objectvtable.h" 14 | 15 | namespace fcitx::dbus { 16 | class DBusObjectVTableSlot; 17 | 18 | class ObjectVTableBasePrivate { 19 | public: 20 | ~ObjectVTableBasePrivate(); 21 | 22 | const std::string &getXml(ObjectVTableBase *q); 23 | 24 | std::map methods_; 25 | std::map properties_; 26 | std::map sigs_; 27 | std::unique_ptr slot_; 28 | Message *msg_ = nullptr; 29 | }; 30 | } // namespace fcitx::dbus 31 | 32 | #endif // _FCITX_UTILS_DBUS_OBJECTVTABLE_P_H_ 33 | -------------------------------------------------------------------------------- /src/lib/fcitx-utils/dbus/libdbus/servicenamecache.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2017-2017 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | * 6 | */ 7 | #ifndef _FCITX_UTILS_DBUS_LIBDBUS_SERVICENAMECACHE_P_H_ 8 | #define _FCITX_UTILS_DBUS_LIBDBUS_SERVICENAMECACHE_P_H_ 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include "../../handlertable.h" 15 | 16 | namespace fcitx::dbus { 17 | 18 | class Bus; 19 | class ServiceWatcher; 20 | 21 | class ServiceNameCache { 22 | public: 23 | ServiceNameCache(Bus &bus); 24 | ~ServiceNameCache(); 25 | std::string owner(const std::string &query); 26 | void addWatch(const std::string &name); 27 | void removeWatch(const std::string &name); 28 | 29 | private: 30 | std::unique_ptr watcher_; 31 | std::unordered_map nameMap_; 32 | std::unordered_map>> 34 | watcherMap_; 35 | }; 36 | 37 | } // namespace fcitx::dbus 38 | 39 | #endif // _FCITX_UTILS_DBUS_LIBDBUS_SERVICENAMECACHE_P_H_ 40 | -------------------------------------------------------------------------------- /src/lib/fcitx-utils/dbus/sdbus/objectvtable_p_sdbus.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2016-2016 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | * 6 | */ 7 | #ifndef _FCITX_UTILS_DBUS_OBJECTVTABLE_P_SDBUS_H_ 8 | #define _FCITX_UTILS_DBUS_OBJECTVTABLE_P_SDBUS_H_ 9 | 10 | #include 11 | #include 12 | #include 13 | #include "../objectvtable.h" 14 | #include "sd-bus-wrap.h" 15 | 16 | namespace fcitx::dbus { 17 | class SDVTableSlot; 18 | 19 | class ObjectVTableBasePrivate { 20 | public: 21 | ~ObjectVTableBasePrivate(); 22 | 23 | const sd_bus_vtable *toSDBusVTable(ObjectVTableBase *q); 24 | 25 | std::map methods_; 26 | std::map properties_; 27 | std::map sigs_; 28 | std::unique_ptr slot_; 29 | Message *msg_ = nullptr; 30 | }; 31 | 32 | } // namespace fcitx::dbus 33 | 34 | #endif // _FCITX_UTILS_DBUS_OBJECTVTABLE_SDBUS_P_H_ 35 | -------------------------------------------------------------------------------- /src/lib/fcitx-utils/dbus/sdbus/sd-bus-wrap.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2016-2016 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | * 6 | */ 7 | #ifndef _FCITX_UTILS_DBUS_SD_BUS_WRAP_H_ 8 | #define _FCITX_UTILS_DBUS_SD_BUS_WRAP_H_ 9 | 10 | #if defined(__COVERITY__) && !defined(__INCLUDE_LEVEL__) 11 | #define __INCLUDE_LEVEL__ 2 12 | #endif 13 | #include // IWYU pragma: export 14 | #include // IWYU pragma: export 15 | #include // IWYU pragma: export 16 | #include // IWYU pragma: export 17 | 18 | #endif // _FCITX_UTILS_DBUS_SD_BUS_WRAP_H_ 19 | -------------------------------------------------------------------------------- /src/lib/fcitx-utils/environ.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2025~2025 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | * 6 | */ 7 | #ifndef _FCITX_UTILS_SHIM_WIN32_H_ 8 | #define _FCITX_UTILS_SHIM_WIN32_H_ 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | namespace fcitx { 15 | 16 | /** 17 | * Set environment variable 18 | * 19 | * @param variable variable name 20 | * @return value 21 | * 22 | * @since 5.1.13 23 | */ 24 | FCITXUTILS_EXPORT void setEnvironment(const char *variable, const char *value); 25 | 26 | /** 27 | * Get environment variable value. 28 | * 29 | * @param variable variable name 30 | * @return value 31 | * 32 | * @since 5.1.13 33 | */ 34 | FCITXUTILS_EXPORT std::optional 35 | getEnvironment(const char *variable); 36 | 37 | FCITXUTILS_EXPORT std::string getEnvironmentOrEmpty(const char *variable); 38 | 39 | } // namespace fcitx 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /src/lib/fcitx-utils/event_none.cpp: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * SPDX-FileCopyrightText: 2015-2015 CSSlayer 4 | * 5 | * SPDX-License-Identifier: LGPL-2.1-or-later 6 | * 7 | */ 8 | #include 9 | #include "event_p.h" 10 | #include "eventloopinterface.h" 11 | 12 | namespace fcitx { 13 | 14 | std::unique_ptr createDefaultEventLoop() { return nullptr; } 15 | 16 | const char *defaultEventLoopImplementation() { return "none"; } 17 | 18 | } // namespace fcitx -------------------------------------------------------------------------------- /src/lib/fcitx-utils/event_p.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2015-2015 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | * 6 | */ 7 | #ifndef _FCITX_UTILS_EVENT_P_H_ 8 | #define _FCITX_UTILS_EVENT_P_H_ 9 | 10 | #include 11 | #include 12 | 13 | namespace fcitx { 14 | 15 | std::unique_ptr createDefaultEventLoop(); 16 | 17 | const char *defaultEventLoopImplementation(); 18 | 19 | } // namespace fcitx 20 | 21 | #endif // _FCITX_UTILS_EVENT_P_H_ 22 | -------------------------------------------------------------------------------- /src/lib/fcitx-utils/fs_deprecated.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2016-2016 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | * 6 | */ 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include "fcitx-utils/fcitxutils_export.h" 14 | #include "fs.h" 15 | #include "misc.h" 16 | #include "standardpath.h" 17 | 18 | namespace fcitx::fs { 19 | 20 | // FIXME: Remove this deprecated API in future releases. 21 | FCITXUTILS_DEPRECATED_EXPORT bool makePath(const std::string &path) { 22 | return makePath(std::filesystem::path(path)); 23 | } 24 | 25 | FCITXUTILS_DEPRECATED_EXPORT std::string baseName(const std::string &path) { 26 | return baseName(std::string_view(path)); 27 | } 28 | 29 | FCITXUTILS_DEPRECATED_EXPORT int64_t modifiedTime(const std::string &path) { 30 | return modifiedTime(std::filesystem::path(path)); 31 | } 32 | 33 | UniqueFilePtr openFD(StandardPathFile &file, const char *modes) { 34 | if (!file.isValid()) { 35 | return nullptr; 36 | } 37 | UniqueFilePtr fd(fdopen(file.fd(), modes)); 38 | if (fd) { 39 | file.release(); 40 | } 41 | return fd; 42 | } 43 | 44 | } // namespace fcitx::fs 45 | -------------------------------------------------------------------------------- /src/lib/fcitx-utils/gen-hotkey.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | function download_file() 4 | { 5 | if [ "x$3" != "xf" ]; then 6 | if [ -f $1 ]; then 7 | return 8 | fi 9 | fi 10 | rm -f $1 11 | wget $2 12 | } 13 | 14 | XKEYSYM=http://cgit.freedesktop.org/xorg/proto/xproto/plain/keysymdef.h 15 | XF86KEYSYM=http://cgit.freedesktop.org/xorg/proto/x11proto/plain/XF86keysym.h 16 | KEYSYMGEN_HEADER=keysymgen.h 17 | KEYNAMETABLE_HEADER=keynametable.h 18 | 19 | download_file keysymdef.h $XKEYSYM 20 | download_file XF86keysym.h $XF86KEYSYM 21 | 22 | grep '^#define' keysymdef.h | sed 's|^#define XK_\([a-zA-Z_0-9]\+\) \+0x\([0-9A-Fa-f]\+\)\(.*\)$|\1\t0x\2\t\3|g' > keylist 23 | grep '^#define' XF86keysym.h | grep -v 'XF86XK_Calculater\|XF86XK_Q' | sed 's|XF86XK_Clear|XF86XK_WindowClear|g' | sed 's|XF86XK_Select|XF86XK_SelectButton|g' | sed 's|^#define XF86XK_\([a-zA-Z_0-9]\+\)[ \t]\+0x\([0-9A-Fa-f]\+\)\(.*\)$|\1\t0x\2\t\3|g' >> keylist 24 | 25 | python3 update-keydata.py 26 | -------------------------------------------------------------------------------- /src/lib/fcitx-utils/keydata.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2023-2023 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | * 6 | */ 7 | #include "keydata.h" 8 | #include 9 | #include 10 | 11 | namespace fcitx { 12 | const UnicodeToKeySymTab &unicode_to_keysym_tab() { 13 | static const UnicodeToKeySymTab tab = []() { 14 | UnicodeToKeySymTab tab; 15 | for (size_t i = 0; i < tab.size(); i++) { 16 | tab[i] = keysym_to_unicode_tab[i]; 17 | } 18 | std::stable_sort(tab.begin(), tab.end(), [](auto &lhs, auto &rhs) { 19 | return lhs.ucs < rhs.ucs; 20 | }); 21 | return tab; 22 | }(); 23 | 24 | return tab; 25 | } 26 | } // namespace fcitx -------------------------------------------------------------------------------- /src/lib/fcitx-utils/textformatflags.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2017-2017 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | * 6 | */ 7 | #ifndef _FCITX_UTILS_TEXTFORMATFLAGS_H_ 8 | #define _FCITX_UTILS_TEXTFORMATFLAGS_H_ 9 | 10 | /// \addtogroup FcitxUtils 11 | /// \{ 12 | /// \file 13 | /// \brief Enum flag for text formatting. 14 | 15 | #include 16 | 17 | namespace fcitx { 18 | 19 | /// \brief Enum flag for text formatting. 20 | enum class TextFormatFlag : int { 21 | Underline = (1 << 3), /**< underline is a flag */ 22 | HighLight = (1 << 4), /**< highlight the preedit */ 23 | DontCommit = (1 << 5), 24 | Bold = (1 << 6), 25 | Strike = (1 << 7), 26 | Italic = (1 << 8), 27 | NoFlag = 0, 28 | }; 29 | 30 | using TextFormatFlags = Flags; 31 | } // namespace fcitx 32 | 33 | #endif // _FCITX_UTILS_TEXTFORMATFLAGS_H_ 34 | -------------------------------------------------------------------------------- /src/lib/fcitx-wayland/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(core) 2 | add_subdirectory(input-method) 3 | add_subdirectory(input-method-v2) 4 | add_subdirectory(wlr-data-control) 5 | add_subdirectory(blur) 6 | add_subdirectory(plasma-window-management) 7 | add_subdirectory(wlr-foreign-toplevel-management-unstable-v1) 8 | add_subdirectory(fractional-scale-v1) 9 | add_subdirectory(viewporter) 10 | # Unused for now, introduced as a dependency to cursor-shape 11 | add_subdirectory(tablet-v2) 12 | add_subdirectory(cursor-shape) 13 | #add_subdirectory(input-method-v3) 14 | -------------------------------------------------------------------------------- /src/lib/fcitx-wayland/blur/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ecm_add_wayland_client_protocol(BLUR_PROTOCOL_SRCS 2 | PROTOCOL ${CMAKE_CURRENT_SOURCE_DIR}/blur.xml 3 | BASENAME blur) 4 | 5 | set(FCITX_WAYLAND_BLUR_PROTOCOL_SOURCES 6 | org_kde_kwin_blur.cpp 7 | org_kde_kwin_blur_manager.cpp 8 | ) 9 | 10 | add_library(Fcitx5WaylandBlur STATIC ${FCITX_WAYLAND_BLUR_PROTOCOL_SOURCES} ${BLUR_PROTOCOL_SRCS}) 11 | set_target_properties(Fcitx5WaylandBlur PROPERTIES 12 | POSITION_INDEPENDENT_CODE ON 13 | ) 14 | target_include_directories(Fcitx5WaylandBlur PUBLIC 15 | "$") 16 | target_link_libraries(Fcitx5WaylandBlur Wayland::Client Fcitx5::Utils Fcitx5::Wayland::Core) 17 | 18 | add_library(Fcitx5::Wayland::Blur ALIAS Fcitx5WaylandBlur) 19 | 20 | -------------------------------------------------------------------------------- /src/lib/fcitx-wayland/blur/blur.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /src/lib/fcitx-wayland/blur/org_kde_kwin_blur.cpp: -------------------------------------------------------------------------------- 1 | #include "org_kde_kwin_blur.h" 2 | #include "wayland-blur-client-protocol.h" 3 | #include "wl_region.h" 4 | 5 | namespace fcitx::wayland { 6 | 7 | OrgKdeKwinBlur::OrgKdeKwinBlur(org_kde_kwin_blur *data) 8 | : version_(org_kde_kwin_blur_get_version(data)), data_(data) { 9 | org_kde_kwin_blur_set_user_data(*this, this); 10 | } 11 | 12 | void OrgKdeKwinBlur::destructor(org_kde_kwin_blur *data) { 13 | const auto version = org_kde_kwin_blur_get_version(data); 14 | if (version >= 1) { 15 | org_kde_kwin_blur_release(data); 16 | return; 17 | } 18 | org_kde_kwin_blur_destroy(data); 19 | } 20 | void OrgKdeKwinBlur::commit() { org_kde_kwin_blur_commit(*this); } 21 | void OrgKdeKwinBlur::setRegion(WlRegion *region) { 22 | org_kde_kwin_blur_set_region(*this, rawPointer(region)); 23 | } 24 | } // namespace fcitx::wayland 25 | -------------------------------------------------------------------------------- /src/lib/fcitx-wayland/blur/org_kde_kwin_blur_manager.cpp: -------------------------------------------------------------------------------- 1 | #include "org_kde_kwin_blur_manager.h" 2 | #include "org_kde_kwin_blur.h" 3 | #include "wayland-blur-client-protocol.h" 4 | #include "wl_surface.h" 5 | 6 | namespace fcitx::wayland { 7 | 8 | OrgKdeKwinBlurManager::OrgKdeKwinBlurManager(org_kde_kwin_blur_manager *data) 9 | : version_(org_kde_kwin_blur_manager_get_version(data)), data_(data) { 10 | org_kde_kwin_blur_manager_set_user_data(*this, this); 11 | } 12 | 13 | void OrgKdeKwinBlurManager::destructor(org_kde_kwin_blur_manager *data) { 14 | org_kde_kwin_blur_manager_destroy(data); 15 | } 16 | OrgKdeKwinBlur *OrgKdeKwinBlurManager::create(WlSurface *surface) { 17 | return new OrgKdeKwinBlur( 18 | org_kde_kwin_blur_manager_create(*this, rawPointer(surface))); 19 | } 20 | void OrgKdeKwinBlurManager::unset(WlSurface *surface) { 21 | org_kde_kwin_blur_manager_unset(*this, rawPointer(surface)); 22 | } 23 | 24 | } // namespace fcitx::wayland 25 | -------------------------------------------------------------------------------- /src/lib/fcitx-wayland/core/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(FCITX_WAYLAND_CORE_SOURCES 2 | display.cpp 3 | outputinfomation.cpp 4 | wl_buffer.cpp 5 | wl_callback.cpp 6 | wl_compositor.cpp 7 | wl_data_device.cpp 8 | wl_data_device_manager.cpp 9 | wl_data_offer.cpp 10 | wl_data_source.cpp 11 | wl_keyboard.cpp 12 | wl_output.cpp 13 | wl_pointer.cpp 14 | wl_region.cpp 15 | wl_registry.cpp 16 | wl_seat.cpp 17 | wl_shell.cpp 18 | wl_shell_surface.cpp 19 | wl_shm.cpp 20 | wl_shm_pool.cpp 21 | wl_subcompositor.cpp 22 | wl_subsurface.cpp 23 | wl_surface.cpp 24 | wl_touch.cpp 25 | ) 26 | 27 | add_library(Fcitx5WaylandCore STATIC ${FCITX_WAYLAND_CORE_SOURCES}) 28 | set_target_properties(Fcitx5WaylandCore PROPERTIES 29 | POSITION_INDEPENDENT_CODE ON 30 | ) 31 | target_include_directories(Fcitx5WaylandCore PUBLIC 32 | "$") 33 | target_link_libraries(Fcitx5WaylandCore Wayland::Client Fcitx5::Utils) 34 | 35 | add_library(Fcitx5::Wayland::Core ALIAS Fcitx5WaylandCore) 36 | -------------------------------------------------------------------------------- /src/lib/fcitx-wayland/core/outputinformation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2017-2017 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | * 6 | */ 7 | #ifndef _FCITX_WAYLAND_CORE_OUTPUTINFORMATION_H_ 8 | #define _FCITX_WAYLAND_CORE_OUTPUTINFORMATION_H_ 9 | 10 | #include "wl_output.h" 11 | 12 | #include 13 | 14 | namespace fcitx { 15 | namespace wayland { 16 | 17 | class OutputInfomationPrivate; 18 | 19 | class OutputInfomation { 20 | friend class Display; 21 | 22 | public: 23 | OutputInfomation(wayland::WlOutput *output); 24 | ~OutputInfomation(); 25 | 26 | int32_t x() const; 27 | int32_t y() const; 28 | int32_t width() const; 29 | int32_t height() const; 30 | int32_t refreshRate() const; 31 | int32_t phyiscalWidth() const; 32 | int32_t phyiscalHeight() const; 33 | wl_output_subpixel subpixel() const; 34 | const std::string &make() const; 35 | const std::string &model() const; 36 | wl_output_transform transform() const; 37 | int32_t scale() const; 38 | 39 | private: 40 | std::unique_ptr d_ptr; 41 | FCITX_DECLARE_PRIVATE(OutputInfomation); 42 | }; 43 | } // namespace wayland 44 | } // namespace fcitx 45 | 46 | #endif // _FCITX_WAYLAND_CORE_OUTPUTINFORMATION_H_ 47 | -------------------------------------------------------------------------------- /src/lib/fcitx-wayland/core/wl_buffer.cpp: -------------------------------------------------------------------------------- 1 | #include "wl_buffer.h" 2 | #include 3 | 4 | namespace fcitx::wayland { 5 | const struct wl_buffer_listener WlBuffer::listener = { 6 | .release = 7 | [](void *data, wl_buffer *wldata) { 8 | auto *obj = static_cast(data); 9 | assert(*obj == wldata); 10 | { 11 | obj->release()(); 12 | } 13 | }, 14 | }; 15 | 16 | WlBuffer::WlBuffer(wl_buffer *data) 17 | : version_(wl_buffer_get_version(data)), data_(data) { 18 | wl_buffer_set_user_data(*this, this); 19 | wl_buffer_add_listener(*this, &WlBuffer::listener, this); 20 | } 21 | 22 | void WlBuffer::destructor(wl_buffer *data) { 23 | const auto version = wl_buffer_get_version(data); 24 | if (version >= 1) { 25 | wl_buffer_destroy(data); 26 | return; 27 | } 28 | } 29 | 30 | } // namespace fcitx::wayland 31 | -------------------------------------------------------------------------------- /src/lib/fcitx-wayland/core/wl_callback.cpp: -------------------------------------------------------------------------------- 1 | #include "wl_callback.h" 2 | #include 3 | 4 | namespace fcitx::wayland { 5 | const struct wl_callback_listener WlCallback::listener = { 6 | .done = 7 | [](void *data, wl_callback *wldata, uint32_t callbackData) { 8 | auto *obj = static_cast(data); 9 | assert(*obj == wldata); 10 | { 11 | obj->done()(callbackData); 12 | } 13 | }, 14 | }; 15 | 16 | WlCallback::WlCallback(wl_callback *data) 17 | : version_(wl_callback_get_version(data)), data_(data) { 18 | wl_callback_set_user_data(*this, this); 19 | wl_callback_add_listener(*this, &WlCallback::listener, this); 20 | } 21 | 22 | void WlCallback::destructor(wl_callback *data) { wl_callback_destroy(data); } 23 | 24 | } // namespace fcitx::wayland 25 | -------------------------------------------------------------------------------- /src/lib/fcitx-wayland/core/wl_compositor.cpp: -------------------------------------------------------------------------------- 1 | #include "wl_compositor.h" 2 | #include "wl_region.h" 3 | #include "wl_surface.h" 4 | 5 | namespace fcitx::wayland { 6 | 7 | WlCompositor::WlCompositor(wl_compositor *data) 8 | : version_(wl_compositor_get_version(data)), data_(data) { 9 | wl_compositor_set_user_data(*this, this); 10 | } 11 | 12 | void WlCompositor::destructor(wl_compositor *data) { 13 | wl_compositor_destroy(data); 14 | } 15 | WlSurface *WlCompositor::createSurface() { 16 | return new WlSurface(wl_compositor_create_surface(*this)); 17 | } 18 | WlRegion *WlCompositor::createRegion() { 19 | return new WlRegion(wl_compositor_create_region(*this)); 20 | } 21 | 22 | } // namespace fcitx::wayland 23 | -------------------------------------------------------------------------------- /src/lib/fcitx-wayland/core/wl_data_device_manager.cpp: -------------------------------------------------------------------------------- 1 | #include "wl_data_device_manager.h" 2 | #include "wl_data_device.h" 3 | #include "wl_data_source.h" 4 | #include "wl_seat.h" 5 | 6 | namespace fcitx::wayland { 7 | 8 | WlDataDeviceManager::WlDataDeviceManager(wl_data_device_manager *data) 9 | : version_(wl_data_device_manager_get_version(data)), data_(data) { 10 | wl_data_device_manager_set_user_data(*this, this); 11 | } 12 | 13 | void WlDataDeviceManager::destructor(wl_data_device_manager *data) { 14 | wl_data_device_manager_destroy(data); 15 | } 16 | WlDataSource *WlDataDeviceManager::createDataSource() { 17 | return new WlDataSource(wl_data_device_manager_create_data_source(*this)); 18 | } 19 | WlDataDevice *WlDataDeviceManager::getDataDevice(WlSeat *seat) { 20 | return new WlDataDevice( 21 | wl_data_device_manager_get_data_device(*this, rawPointer(seat))); 22 | } 23 | 24 | } // namespace fcitx::wayland 25 | -------------------------------------------------------------------------------- /src/lib/fcitx-wayland/core/wl_region.cpp: -------------------------------------------------------------------------------- 1 | #include "wl_region.h" 2 | 3 | namespace fcitx::wayland { 4 | 5 | WlRegion::WlRegion(wl_region *data) 6 | : version_(wl_region_get_version(data)), data_(data) { 7 | wl_region_set_user_data(*this, this); 8 | } 9 | 10 | void WlRegion::destructor(wl_region *data) { 11 | const auto version = wl_region_get_version(data); 12 | if (version >= 1) { 13 | wl_region_destroy(data); 14 | return; 15 | } 16 | } 17 | void WlRegion::add(int32_t x, int32_t y, int32_t width, int32_t height) { 18 | wl_region_add(*this, x, y, width, height); 19 | } 20 | void WlRegion::subtract(int32_t x, int32_t y, int32_t width, int32_t height) { 21 | wl_region_subtract(*this, x, y, width, height); 22 | } 23 | 24 | } // namespace fcitx::wayland 25 | -------------------------------------------------------------------------------- /src/lib/fcitx-wayland/core/wl_registry.cpp: -------------------------------------------------------------------------------- 1 | #include "wl_registry.h" 2 | #include 3 | 4 | namespace fcitx::wayland { 5 | const struct wl_registry_listener WlRegistry::listener = { 6 | .global = 7 | [](void *data, wl_registry *wldata, uint32_t name, 8 | const char *interface, uint32_t version) { 9 | auto *obj = static_cast(data); 10 | assert(*obj == wldata); 11 | { 12 | obj->global()(name, interface, version); 13 | } 14 | }, 15 | .global_remove = 16 | [](void *data, wl_registry *wldata, uint32_t name) { 17 | auto *obj = static_cast(data); 18 | assert(*obj == wldata); 19 | { 20 | obj->globalRemove()(name); 21 | } 22 | }, 23 | }; 24 | 25 | WlRegistry::WlRegistry(wl_registry *data) 26 | : version_(wl_registry_get_version(data)), data_(data) { 27 | wl_registry_set_user_data(*this, this); 28 | wl_registry_add_listener(*this, &WlRegistry::listener, this); 29 | } 30 | 31 | void WlRegistry::destructor(wl_registry *data) { wl_registry_destroy(data); } 32 | 33 | } // namespace fcitx::wayland 34 | -------------------------------------------------------------------------------- /src/lib/fcitx-wayland/core/wl_shell.cpp: -------------------------------------------------------------------------------- 1 | #include "wl_shell.h" 2 | #include "wl_shell_surface.h" 3 | #include "wl_surface.h" 4 | 5 | namespace fcitx::wayland { 6 | 7 | WlShell::WlShell(wl_shell *data) 8 | : version_(wl_shell_get_version(data)), data_(data) { 9 | wl_shell_set_user_data(*this, this); 10 | } 11 | 12 | void WlShell::destructor(wl_shell *data) { wl_shell_destroy(data); } 13 | WlShellSurface *WlShell::getShellSurface(WlSurface *surface) { 14 | return new WlShellSurface( 15 | wl_shell_get_shell_surface(*this, rawPointer(surface))); 16 | } 17 | 18 | } // namespace fcitx::wayland 19 | -------------------------------------------------------------------------------- /src/lib/fcitx-wayland/core/wl_shell.h: -------------------------------------------------------------------------------- 1 | #ifndef WL_SHELL_H_ 2 | #define WL_SHELL_H_ 3 | #include 4 | #include 5 | #include 6 | #include "fcitx-utils/misc.h" 7 | namespace fcitx::wayland { 8 | 9 | class WlShellSurface; 10 | class WlSurface; 11 | 12 | class WlShell final { 13 | public: 14 | static constexpr const char *interface = "wl_shell"; 15 | static constexpr const wl_interface *const wlInterface = 16 | &wl_shell_interface; 17 | static constexpr const uint32_t version = 1; 18 | using wlType = wl_shell; 19 | operator wl_shell *() { return data_.get(); } 20 | WlShell(wlType *data); 21 | WlShell(WlShell &&other) noexcept = delete; 22 | WlShell &operator=(WlShell &&other) noexcept = delete; 23 | auto actualVersion() const { return version_; } 24 | void *userData() const { return userData_; } 25 | void setUserData(void *userData) { userData_ = userData; } 26 | WlShellSurface *getShellSurface(WlSurface *surface); 27 | 28 | private: 29 | static void destructor(wl_shell *); 30 | 31 | uint32_t version_; 32 | void *userData_ = nullptr; 33 | UniqueCPtr data_; 34 | }; 35 | static inline wl_shell *rawPointer(WlShell *p) { 36 | return p ? static_cast(*p) : nullptr; 37 | } 38 | 39 | } // namespace fcitx::wayland 40 | 41 | #endif // WL_SHELL_H_ 42 | -------------------------------------------------------------------------------- /src/lib/fcitx-wayland/core/wl_shm.cpp: -------------------------------------------------------------------------------- 1 | #include "wl_shm.h" 2 | #include 3 | #include "wl_shm_pool.h" 4 | 5 | namespace fcitx::wayland { 6 | const struct wl_shm_listener WlShm::listener = { 7 | .format = 8 | [](void *data, wl_shm *wldata, uint32_t format) { 9 | auto *obj = static_cast(data); 10 | assert(*obj == wldata); 11 | { 12 | obj->format()(format); 13 | } 14 | }, 15 | }; 16 | 17 | WlShm::WlShm(wl_shm *data) : version_(wl_shm_get_version(data)), data_(data) { 18 | wl_shm_set_user_data(*this, this); 19 | wl_shm_add_listener(*this, &WlShm::listener, this); 20 | } 21 | 22 | void WlShm::destructor(wl_shm *data) { wl_shm_destroy(data); } 23 | WlShmPool *WlShm::createPool(int32_t fd, int32_t size) { 24 | return new WlShmPool(wl_shm_create_pool(*this, fd, size)); 25 | } 26 | 27 | } // namespace fcitx::wayland 28 | -------------------------------------------------------------------------------- /src/lib/fcitx-wayland/core/wl_shm_pool.cpp: -------------------------------------------------------------------------------- 1 | #include "wl_shm_pool.h" 2 | #include "wl_buffer.h" 3 | 4 | namespace fcitx::wayland { 5 | 6 | WlShmPool::WlShmPool(wl_shm_pool *data) 7 | : version_(wl_shm_pool_get_version(data)), data_(data) { 8 | wl_shm_pool_set_user_data(*this, this); 9 | } 10 | 11 | void WlShmPool::destructor(wl_shm_pool *data) { 12 | const auto version = wl_shm_pool_get_version(data); 13 | if (version >= 1) { 14 | wl_shm_pool_destroy(data); 15 | return; 16 | } 17 | } 18 | WlBuffer *WlShmPool::createBuffer(int32_t offset, int32_t width, int32_t height, 19 | int32_t stride, uint32_t format) { 20 | return new WlBuffer(wl_shm_pool_create_buffer(*this, offset, width, height, 21 | stride, format)); 22 | } 23 | void WlShmPool::resize(int32_t size) { wl_shm_pool_resize(*this, size); } 24 | 25 | } // namespace fcitx::wayland 26 | -------------------------------------------------------------------------------- /src/lib/fcitx-wayland/core/wl_subcompositor.cpp: -------------------------------------------------------------------------------- 1 | #include "wl_subcompositor.h" 2 | #include "wl_subsurface.h" 3 | #include "wl_surface.h" 4 | 5 | namespace fcitx::wayland { 6 | 7 | WlSubcompositor::WlSubcompositor(wl_subcompositor *data) 8 | : version_(wl_subcompositor_get_version(data)), data_(data) { 9 | wl_subcompositor_set_user_data(*this, this); 10 | } 11 | 12 | void WlSubcompositor::destructor(wl_subcompositor *data) { 13 | const auto version = wl_subcompositor_get_version(data); 14 | if (version >= 1) { 15 | wl_subcompositor_destroy(data); 16 | return; 17 | } 18 | } 19 | WlSubsurface *WlSubcompositor::getSubsurface(WlSurface *surface, 20 | WlSurface *parent) { 21 | return new WlSubsurface(wl_subcompositor_get_subsurface( 22 | *this, rawPointer(surface), rawPointer(parent))); 23 | } 24 | 25 | } // namespace fcitx::wayland 26 | -------------------------------------------------------------------------------- /src/lib/fcitx-wayland/core/wl_subsurface.cpp: -------------------------------------------------------------------------------- 1 | #include "wl_subsurface.h" 2 | #include "wl_surface.h" 3 | 4 | namespace fcitx::wayland { 5 | 6 | WlSubsurface::WlSubsurface(wl_subsurface *data) 7 | : version_(wl_subsurface_get_version(data)), data_(data) { 8 | wl_subsurface_set_user_data(*this, this); 9 | } 10 | 11 | void WlSubsurface::destructor(wl_subsurface *data) { 12 | const auto version = wl_subsurface_get_version(data); 13 | if (version >= 1) { 14 | wl_subsurface_destroy(data); 15 | return; 16 | } 17 | } 18 | void WlSubsurface::setPosition(int32_t x, int32_t y) { 19 | wl_subsurface_set_position(*this, x, y); 20 | } 21 | void WlSubsurface::placeAbove(WlSurface *sibling) { 22 | wl_subsurface_place_above(*this, rawPointer(sibling)); 23 | } 24 | void WlSubsurface::placeBelow(WlSurface *sibling) { 25 | wl_subsurface_place_below(*this, rawPointer(sibling)); 26 | } 27 | void WlSubsurface::setSync() { wl_subsurface_set_sync(*this); } 28 | void WlSubsurface::setDesync() { wl_subsurface_set_desync(*this); } 29 | 30 | } // namespace fcitx::wayland 31 | -------------------------------------------------------------------------------- /src/lib/fcitx-wayland/cursor-shape/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ecm_add_wayland_client_protocol(CURSOR_SHAPE_PROTOCOL_SRCS 2 | PROTOCOL ${CMAKE_CURRENT_SOURCE_DIR}/cursor-shape-v1.xml 3 | BASENAME cursor-shape-v1) 4 | 5 | set(FCITX_WAYLAND_CURSOR_SHAPE_PROTOCOL_SOURCES 6 | wp_cursor_shape_manager_v1.cpp 7 | wp_cursor_shape_device_v1.cpp 8 | ) 9 | 10 | add_library(Fcitx5WaylandCursorShape STATIC ${FCITX_WAYLAND_CURSOR_SHAPE_PROTOCOL_SOURCES} ${CURSOR_SHAPE_PROTOCOL_SRCS}) 11 | set_target_properties(Fcitx5WaylandCursorShape PROPERTIES 12 | POSITION_INDEPENDENT_CODE ON 13 | ) 14 | target_include_directories(Fcitx5WaylandCursorShape PUBLIC 15 | "$") 16 | target_link_libraries(Fcitx5WaylandCursorShape PUBLIC Wayland::Client Fcitx5::Utils Fcitx5::Wayland::Core Fcitx5::Wayland::Tablet) 17 | 18 | add_library(Fcitx5::Wayland::CursorShape ALIAS Fcitx5WaylandCursorShape) 19 | 20 | -------------------------------------------------------------------------------- /src/lib/fcitx-wayland/cursor-shape/wp_cursor_shape_device_v1.cpp: -------------------------------------------------------------------------------- 1 | #include "wp_cursor_shape_device_v1.h" 2 | #include "wayland-cursor-shape-v1-client-protocol.h" 3 | 4 | namespace fcitx::wayland { 5 | 6 | WpCursorShapeDeviceV1::WpCursorShapeDeviceV1(wp_cursor_shape_device_v1 *data) 7 | : version_(wp_cursor_shape_device_v1_get_version(data)), data_(data) { 8 | wp_cursor_shape_device_v1_set_user_data(*this, this); 9 | } 10 | 11 | void WpCursorShapeDeviceV1::destructor(wp_cursor_shape_device_v1 *data) { 12 | const auto version = wp_cursor_shape_device_v1_get_version(data); 13 | if (version >= 1) { 14 | wp_cursor_shape_device_v1_destroy(data); 15 | return; 16 | } 17 | } 18 | void WpCursorShapeDeviceV1::setShape(uint32_t serial, uint32_t shape) { 19 | wp_cursor_shape_device_v1_set_shape(*this, serial, shape); 20 | } 21 | 22 | } // namespace fcitx::wayland 23 | -------------------------------------------------------------------------------- /src/lib/fcitx-wayland/cursor-shape/wp_cursor_shape_manager_v1.cpp: -------------------------------------------------------------------------------- 1 | #include "wp_cursor_shape_manager_v1.h" 2 | #include "wayland-cursor-shape-v1-client-protocol.h" 3 | #include "wl_pointer.h" 4 | #include "wp_cursor_shape_device_v1.h" 5 | #include "zwp_tablet_tool_v2.h" 6 | 7 | namespace fcitx::wayland { 8 | 9 | WpCursorShapeManagerV1::WpCursorShapeManagerV1(wp_cursor_shape_manager_v1 *data) 10 | : version_(wp_cursor_shape_manager_v1_get_version(data)), data_(data) { 11 | wp_cursor_shape_manager_v1_set_user_data(*this, this); 12 | } 13 | 14 | void WpCursorShapeManagerV1::destructor(wp_cursor_shape_manager_v1 *data) { 15 | const auto version = wp_cursor_shape_manager_v1_get_version(data); 16 | if (version >= 1) { 17 | wp_cursor_shape_manager_v1_destroy(data); 18 | return; 19 | } 20 | } 21 | WpCursorShapeDeviceV1 *WpCursorShapeManagerV1::getPointer(WlPointer *pointer) { 22 | return new WpCursorShapeDeviceV1( 23 | wp_cursor_shape_manager_v1_get_pointer(*this, rawPointer(pointer))); 24 | } 25 | WpCursorShapeDeviceV1 * 26 | WpCursorShapeManagerV1::getTabletToolV2(ZwpTabletToolV2 *tabletTool) { 27 | return new WpCursorShapeDeviceV1( 28 | wp_cursor_shape_manager_v1_get_tablet_tool_v2(*this, 29 | rawPointer(tabletTool))); 30 | } 31 | 32 | } // namespace fcitx::wayland 33 | -------------------------------------------------------------------------------- /src/lib/fcitx-wayland/fractional-scale-v1/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ecm_add_wayland_client_protocol(FRACTIONAL_SCALE_PROTOCOL_SRCS 2 | PROTOCOL ${CMAKE_CURRENT_SOURCE_DIR}/fractional-scale-v1.xml 3 | BASENAME fractional-scale-v1) 4 | 5 | set(FCITX_WAYLAND_FRACTIONAL_SCALE_PROTOCOL_SRCS 6 | wp_fractional_scale_manager_v1.cpp 7 | wp_fractional_scale_v1.cpp 8 | ) 9 | 10 | add_library(Fcitx5WaylandFractionalScale STATIC ${FCITX_WAYLAND_FRACTIONAL_SCALE_PROTOCOL_SRCS} ${FRACTIONAL_SCALE_PROTOCOL_SRCS}) 11 | set_target_properties(Fcitx5WaylandFractionalScale PROPERTIES 12 | POSITION_INDEPENDENT_CODE ON 13 | ) 14 | target_include_directories(Fcitx5WaylandFractionalScale PUBLIC 15 | "$") 16 | target_link_libraries(Fcitx5WaylandFractionalScale Wayland::Client Fcitx5::Utils Fcitx5::Wayland::Core) 17 | 18 | add_library(Fcitx5::Wayland::FractionalScale ALIAS Fcitx5WaylandFractionalScale) 19 | 20 | -------------------------------------------------------------------------------- /src/lib/fcitx-wayland/fractional-scale-v1/wp_fractional_scale_manager_v1.cpp: -------------------------------------------------------------------------------- 1 | #include "wp_fractional_scale_manager_v1.h" 2 | #include "wayland-fractional-scale-v1-client-protocol.h" 3 | #include "wl_surface.h" 4 | #include "wp_fractional_scale_v1.h" 5 | 6 | namespace fcitx::wayland { 7 | 8 | WpFractionalScaleManagerV1::WpFractionalScaleManagerV1( 9 | wp_fractional_scale_manager_v1 *data) 10 | : version_(wp_fractional_scale_manager_v1_get_version(data)), data_(data) { 11 | wp_fractional_scale_manager_v1_set_user_data(*this, this); 12 | } 13 | 14 | void WpFractionalScaleManagerV1::destructor( 15 | wp_fractional_scale_manager_v1 *data) { 16 | const auto version = wp_fractional_scale_manager_v1_get_version(data); 17 | if (version >= 1) { 18 | wp_fractional_scale_manager_v1_destroy(data); 19 | return; 20 | } 21 | } 22 | WpFractionalScaleV1 * 23 | WpFractionalScaleManagerV1::getFractionalScale(WlSurface *surface) { 24 | return new WpFractionalScaleV1( 25 | wp_fractional_scale_manager_v1_get_fractional_scale( 26 | *this, rawPointer(surface))); 27 | } 28 | 29 | } // namespace fcitx::wayland 30 | -------------------------------------------------------------------------------- /src/lib/fcitx-wayland/fractional-scale-v1/wp_fractional_scale_v1.cpp: -------------------------------------------------------------------------------- 1 | #include "wp_fractional_scale_v1.h" 2 | #include 3 | #include "wayland-fractional-scale-v1-client-protocol.h" 4 | 5 | namespace fcitx::wayland { 6 | const struct wp_fractional_scale_v1_listener WpFractionalScaleV1::listener = { 7 | .preferred_scale = 8 | [](void *data, wp_fractional_scale_v1 *wldata, uint32_t scale) { 9 | auto *obj = static_cast(data); 10 | assert(*obj == wldata); 11 | { 12 | obj->preferredScale()(scale); 13 | } 14 | }, 15 | }; 16 | 17 | WpFractionalScaleV1::WpFractionalScaleV1(wp_fractional_scale_v1 *data) 18 | : version_(wp_fractional_scale_v1_get_version(data)), data_(data) { 19 | wp_fractional_scale_v1_set_user_data(*this, this); 20 | wp_fractional_scale_v1_add_listener(*this, &WpFractionalScaleV1::listener, 21 | this); 22 | } 23 | 24 | void WpFractionalScaleV1::destructor(wp_fractional_scale_v1 *data) { 25 | const auto version = wp_fractional_scale_v1_get_version(data); 26 | if (version >= 1) { 27 | wp_fractional_scale_v1_destroy(data); 28 | return; 29 | } 30 | } 31 | 32 | } // namespace fcitx::wayland 33 | -------------------------------------------------------------------------------- /src/lib/fcitx-wayland/input-method-v2/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ecm_add_wayland_client_protocol(WAYLAND_IM_V2_PROTOCOL_SRCS 2 | PROTOCOL ${CMAKE_CURRENT_SOURCE_DIR}/input-method-unstable-v2.xml 3 | BASENAME input-method-unstable-v2) 4 | ecm_add_wayland_client_protocol(WAYLAND_IM_V2_PROTOCOL_SRCS 5 | PROTOCOL ${CMAKE_CURRENT_SOURCE_DIR}/virtual-keyboard-unstable-v1.xml 6 | BASENAME virtual-keyboard-unstable-v1) 7 | 8 | set(FCITX_WAYLAND_INPUTMETHOD_V2_SOURCES 9 | zwp_input_popup_surface_v2.cpp 10 | zwp_input_method_keyboard_grab_v2.cpp 11 | zwp_input_method_manager_v2.cpp 12 | zwp_input_method_v2.cpp 13 | zwp_virtual_keyboard_manager_v1.cpp 14 | zwp_virtual_keyboard_v1.cpp 15 | ) 16 | 17 | add_library(Fcitx5WaylandInputMethodV2 STATIC ${FCITX_WAYLAND_INPUTMETHOD_V2_SOURCES} ${WAYLAND_IM_V2_PROTOCOL_SRCS}) 18 | set_target_properties(Fcitx5WaylandInputMethodV2 PROPERTIES 19 | POSITION_INDEPENDENT_CODE ON 20 | ) 21 | target_include_directories(Fcitx5WaylandInputMethodV2 PUBLIC 22 | "$") 23 | target_link_libraries(Fcitx5WaylandInputMethodV2 Wayland::Client Fcitx5::Utils Fcitx5::Wayland::Core) 24 | 25 | add_library(Fcitx5::Wayland::InputMethodV2 ALIAS Fcitx5WaylandInputMethodV2) 26 | -------------------------------------------------------------------------------- /src/lib/fcitx-wayland/input-method-v2/zwp_input_method_manager_v2.cpp: -------------------------------------------------------------------------------- 1 | #include "zwp_input_method_manager_v2.h" 2 | #include "wayland-input-method-unstable-v2-client-protocol.h" 3 | #include "wl_seat.h" 4 | #include "zwp_input_method_v2.h" 5 | 6 | namespace fcitx::wayland { 7 | 8 | ZwpInputMethodManagerV2::ZwpInputMethodManagerV2( 9 | zwp_input_method_manager_v2 *data) 10 | : version_(zwp_input_method_manager_v2_get_version(data)), data_(data) { 11 | zwp_input_method_manager_v2_set_user_data(*this, this); 12 | } 13 | 14 | void ZwpInputMethodManagerV2::destructor(zwp_input_method_manager_v2 *data) { 15 | const auto version = zwp_input_method_manager_v2_get_version(data); 16 | if (version >= 1) { 17 | zwp_input_method_manager_v2_destroy(data); 18 | return; 19 | } 20 | } 21 | ZwpInputMethodV2 *ZwpInputMethodManagerV2::getInputMethod(WlSeat *seat) { 22 | return new ZwpInputMethodV2( 23 | zwp_input_method_manager_v2_get_input_method(*this, rawPointer(seat))); 24 | } 25 | 26 | } // namespace fcitx::wayland 27 | -------------------------------------------------------------------------------- /src/lib/fcitx-wayland/input-method-v2/zwp_virtual_keyboard_manager_v1.cpp: -------------------------------------------------------------------------------- 1 | #include "zwp_virtual_keyboard_manager_v1.h" 2 | #include "wl_seat.h" 3 | #include "zwp_virtual_keyboard_v1.h" 4 | namespace fcitx::wayland { 5 | ZwpVirtualKeyboardManagerV1::ZwpVirtualKeyboardManagerV1( 6 | zwp_virtual_keyboard_manager_v1 *data) 7 | : version_(zwp_virtual_keyboard_manager_v1_get_version(data)), data_(data) { 8 | zwp_virtual_keyboard_manager_v1_set_user_data(*this, this); 9 | } 10 | void ZwpVirtualKeyboardManagerV1::destructor( 11 | zwp_virtual_keyboard_manager_v1 *data) { 12 | { 13 | return zwp_virtual_keyboard_manager_v1_destroy(data); 14 | } 15 | } 16 | ZwpVirtualKeyboardV1 * 17 | ZwpVirtualKeyboardManagerV1::createVirtualKeyboard(WlSeat *seat) { 18 | return new ZwpVirtualKeyboardV1( 19 | zwp_virtual_keyboard_manager_v1_create_virtual_keyboard( 20 | *this, rawPointer(seat))); 21 | } 22 | } // namespace fcitx::wayland 23 | -------------------------------------------------------------------------------- /src/lib/fcitx-wayland/input-method-v2/zwp_virtual_keyboard_v1.cpp: -------------------------------------------------------------------------------- 1 | #include "zwp_virtual_keyboard_v1.h" 2 | namespace fcitx::wayland { 3 | ZwpVirtualKeyboardV1::ZwpVirtualKeyboardV1(zwp_virtual_keyboard_v1 *data) 4 | : version_(zwp_virtual_keyboard_v1_get_version(data)), data_(data) { 5 | zwp_virtual_keyboard_v1_set_user_data(*this, this); 6 | } 7 | void ZwpVirtualKeyboardV1::destructor(zwp_virtual_keyboard_v1 *data) { 8 | auto version = zwp_virtual_keyboard_v1_get_version(data); 9 | if (version >= 1) { 10 | return zwp_virtual_keyboard_v1_destroy(data); 11 | } 12 | } 13 | void ZwpVirtualKeyboardV1::keymap(uint32_t format, int32_t fd, uint32_t size) { 14 | return zwp_virtual_keyboard_v1_keymap(*this, format, fd, size); 15 | } 16 | void ZwpVirtualKeyboardV1::key(uint32_t time, uint32_t key, uint32_t state) { 17 | return zwp_virtual_keyboard_v1_key(*this, time, key, state); 18 | } 19 | void ZwpVirtualKeyboardV1::modifiers(uint32_t modsDepressed, 20 | uint32_t modsLatched, uint32_t modsLocked, 21 | uint32_t group) { 22 | return zwp_virtual_keyboard_v1_modifiers(*this, modsDepressed, modsLatched, 23 | modsLocked, group); 24 | } 25 | } // namespace fcitx::wayland 26 | -------------------------------------------------------------------------------- /src/lib/fcitx-wayland/input-method/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ecm_add_wayland_client_protocol(WAYLAND_IM_PROTOCOL_SRCS 2 | PROTOCOL ${WAYLAND_PROTOCOLS_PKGDATADIR}/unstable/input-method/input-method-unstable-v1.xml 3 | BASENAME input-method-unstable-v1) 4 | 5 | set(FCITX_WAYLAND_INPUTMETHOD_SOURCES 6 | zwp_input_method_context_v1.cpp 7 | zwp_input_method_v1.cpp 8 | zwp_input_panel_surface_v1.cpp 9 | zwp_input_panel_v1.cpp 10 | ) 11 | 12 | add_library(Fcitx5WaylandInputMethod STATIC ${FCITX_WAYLAND_INPUTMETHOD_SOURCES} ${WAYLAND_IM_PROTOCOL_SRCS}) 13 | set_target_properties(Fcitx5WaylandInputMethod PROPERTIES 14 | POSITION_INDEPENDENT_CODE ON 15 | ) 16 | target_include_directories(Fcitx5WaylandInputMethod PUBLIC 17 | "$") 18 | target_link_libraries(Fcitx5WaylandInputMethod Wayland::Client Fcitx5::Utils Fcitx5::Wayland::Core) 19 | 20 | add_library(Fcitx5::Wayland::InputMethod ALIAS Fcitx5WaylandInputMethod) 21 | -------------------------------------------------------------------------------- /src/lib/fcitx-wayland/input-method/zwp_input_panel_surface_v1.cpp: -------------------------------------------------------------------------------- 1 | #include "zwp_input_panel_surface_v1.h" 2 | #include "wayland-input-method-unstable-v1-client-protocol.h" 3 | #include "wl_output.h" 4 | 5 | namespace fcitx::wayland { 6 | 7 | ZwpInputPanelSurfaceV1::ZwpInputPanelSurfaceV1(zwp_input_panel_surface_v1 *data) 8 | : version_(zwp_input_panel_surface_v1_get_version(data)), data_(data) { 9 | zwp_input_panel_surface_v1_set_user_data(*this, this); 10 | } 11 | 12 | void ZwpInputPanelSurfaceV1::destructor(zwp_input_panel_surface_v1 *data) { 13 | zwp_input_panel_surface_v1_destroy(data); 14 | } 15 | void ZwpInputPanelSurfaceV1::setToplevel(WlOutput *output, uint32_t position) { 16 | zwp_input_panel_surface_v1_set_toplevel(*this, rawPointer(output), 17 | position); 18 | } 19 | void ZwpInputPanelSurfaceV1::setOverlayPanel() { 20 | zwp_input_panel_surface_v1_set_overlay_panel(*this); 21 | } 22 | 23 | } // namespace fcitx::wayland 24 | -------------------------------------------------------------------------------- /src/lib/fcitx-wayland/input-method/zwp_input_panel_v1.cpp: -------------------------------------------------------------------------------- 1 | #include "zwp_input_panel_v1.h" 2 | #include "wayland-input-method-unstable-v1-client-protocol.h" 3 | #include "wl_surface.h" 4 | #include "zwp_input_panel_surface_v1.h" 5 | 6 | namespace fcitx::wayland { 7 | 8 | ZwpInputPanelV1::ZwpInputPanelV1(zwp_input_panel_v1 *data) 9 | : version_(zwp_input_panel_v1_get_version(data)), data_(data) { 10 | zwp_input_panel_v1_set_user_data(*this, this); 11 | } 12 | 13 | void ZwpInputPanelV1::destructor(zwp_input_panel_v1 *data) { 14 | zwp_input_panel_v1_destroy(data); 15 | } 16 | ZwpInputPanelSurfaceV1 * 17 | ZwpInputPanelV1::getInputPanelSurface(WlSurface *surface) { 18 | return new ZwpInputPanelSurfaceV1( 19 | zwp_input_panel_v1_get_input_panel_surface(*this, rawPointer(surface))); 20 | } 21 | 22 | } // namespace fcitx::wayland 23 | -------------------------------------------------------------------------------- /src/lib/fcitx-wayland/plasma-window-management/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ecm_add_wayland_client_protocol(PLASMA_WINDOW_MANAGEMENT_PROTOCOL_SRCS 2 | PROTOCOL ${CMAKE_CURRENT_SOURCE_DIR}/plasma-window-management.xml 3 | BASENAME plasma-window-management) 4 | 5 | set(FCITX_WAYLAND_PLASMA_WINDOW_MANAGEMENT_SOURCES 6 | org_kde_plasma_window_management.cpp 7 | org_kde_plasma_window.cpp 8 | ) 9 | 10 | add_library(Fcitx5WaylandPlasmaWindowManagement STATIC ${FCITX_WAYLAND_PLASMA_WINDOW_MANAGEMENT_SOURCES} ${PLASMA_WINDOW_MANAGEMENT_PROTOCOL_SRCS}) 11 | set_target_properties(Fcitx5WaylandPlasmaWindowManagement PROPERTIES 12 | POSITION_INDEPENDENT_CODE ON 13 | ) 14 | target_include_directories(Fcitx5WaylandPlasmaWindowManagement PUBLIC 15 | "$") 16 | target_link_libraries(Fcitx5WaylandPlasmaWindowManagement Wayland::Client Fcitx5::Utils Fcitx5::Wayland::Core) 17 | 18 | add_library(Fcitx5::Wayland::PlasmaWindowManagement ALIAS Fcitx5WaylandPlasmaWindowManagement) 19 | 20 | -------------------------------------------------------------------------------- /src/lib/fcitx-wayland/tablet-v2/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ecm_add_wayland_client_protocol(WAYLAND_TABLET_PROTOCOL_SRCS 2 | PROTOCOL ${WAYLAND_PROTOCOLS_PKGDATADIR}/unstable/tablet/tablet-unstable-v2.xml 3 | BASENAME tablet-unstable-v2) 4 | 5 | set(FCITX_WAYLAND_TABLET_SOURCES 6 | zwp_tablet_manager_v2.cpp 7 | zwp_tablet_pad_group_v2.cpp 8 | zwp_tablet_pad_ring_v2.cpp 9 | zwp_tablet_pad_strip_v2.cpp 10 | zwp_tablet_pad_v2.cpp 11 | zwp_tablet_seat_v2.cpp 12 | zwp_tablet_tool_v2.cpp 13 | zwp_tablet_v2.cpp 14 | ) 15 | 16 | add_library(Fcitx5WaylandTablet STATIC ${FCITX_WAYLAND_TABLET_SOURCES} ${WAYLAND_TABLET_PROTOCOL_SRCS}) 17 | set_target_properties(Fcitx5WaylandTablet PROPERTIES 18 | POSITION_INDEPENDENT_CODE ON 19 | ) 20 | target_include_directories(Fcitx5WaylandTablet PUBLIC 21 | "$") 22 | target_link_libraries(Fcitx5WaylandTablet Wayland::Client Fcitx5::Utils Fcitx5::Wayland::Core) 23 | 24 | add_library(Fcitx5::Wayland::Tablet ALIAS Fcitx5WaylandTablet) 25 | -------------------------------------------------------------------------------- /src/lib/fcitx-wayland/tablet-v2/zwp_tablet_manager_v2.cpp: -------------------------------------------------------------------------------- 1 | #include "zwp_tablet_manager_v2.h" 2 | #include "wayland-tablet-unstable-v2-client-protocol.h" 3 | #include "wl_seat.h" 4 | #include "zwp_tablet_seat_v2.h" 5 | 6 | namespace fcitx::wayland { 7 | 8 | ZwpTabletManagerV2::ZwpTabletManagerV2(zwp_tablet_manager_v2 *data) 9 | : version_(zwp_tablet_manager_v2_get_version(data)), data_(data) { 10 | zwp_tablet_manager_v2_set_user_data(*this, this); 11 | } 12 | 13 | void ZwpTabletManagerV2::destructor(zwp_tablet_manager_v2 *data) { 14 | const auto version = zwp_tablet_manager_v2_get_version(data); 15 | if (version >= 1) { 16 | zwp_tablet_manager_v2_destroy(data); 17 | return; 18 | } 19 | } 20 | ZwpTabletSeatV2 *ZwpTabletManagerV2::getTabletSeat(WlSeat *seat) { 21 | return new ZwpTabletSeatV2( 22 | zwp_tablet_manager_v2_get_tablet_seat(*this, rawPointer(seat))); 23 | } 24 | 25 | } // namespace fcitx::wayland 26 | -------------------------------------------------------------------------------- /src/lib/fcitx-wayland/viewporter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ecm_add_wayland_client_protocol(VIEWPORTER_PROTOCOL_SRCS 2 | PROTOCOL ${WAYLAND_PROTOCOLS_PKGDATADIR}/stable/viewporter/viewporter.xml 3 | BASENAME viewporter) 4 | 5 | set(FCITX_WAYLAND_VIEWPORTER_SOURCES 6 | wp_viewport.cpp 7 | wp_viewporter.cpp 8 | ) 9 | 10 | add_library(Fcitx5WaylandViewporter STATIC ${FCITX_WAYLAND_VIEWPORTER_SOURCES} ${VIEWPORTER_PROTOCOL_SRCS}) 11 | set_target_properties(Fcitx5WaylandViewporter PROPERTIES 12 | POSITION_INDEPENDENT_CODE ON 13 | ) 14 | target_include_directories(Fcitx5WaylandViewporter PUBLIC 15 | "$") 16 | target_link_libraries(Fcitx5WaylandViewporter Wayland::Client Fcitx5::Utils Fcitx5::Wayland::Core) 17 | 18 | add_library(Fcitx5::Wayland::Viewporter ALIAS Fcitx5WaylandViewporter) 19 | -------------------------------------------------------------------------------- /src/lib/fcitx-wayland/viewporter/wp_viewport.cpp: -------------------------------------------------------------------------------- 1 | #include "wp_viewport.h" 2 | #include "wayland-viewporter-client-protocol.h" 3 | 4 | namespace fcitx::wayland { 5 | 6 | WpViewport::WpViewport(wp_viewport *data) 7 | : version_(wp_viewport_get_version(data)), data_(data) { 8 | wp_viewport_set_user_data(*this, this); 9 | } 10 | 11 | void WpViewport::destructor(wp_viewport *data) { 12 | const auto version = wp_viewport_get_version(data); 13 | if (version >= 1) { 14 | wp_viewport_destroy(data); 15 | return; 16 | } 17 | } 18 | void WpViewport::setSource(wl_fixed_t x, wl_fixed_t y, wl_fixed_t width, 19 | wl_fixed_t height) { 20 | wp_viewport_set_source(*this, x, y, width, height); 21 | } 22 | void WpViewport::setDestination(int32_t width, int32_t height) { 23 | wp_viewport_set_destination(*this, width, height); 24 | } 25 | 26 | } // namespace fcitx::wayland 27 | -------------------------------------------------------------------------------- /src/lib/fcitx-wayland/viewporter/wp_viewporter.cpp: -------------------------------------------------------------------------------- 1 | #include "wp_viewporter.h" 2 | #include "wayland-viewporter-client-protocol.h" 3 | #include "wl_surface.h" 4 | #include "wp_viewport.h" 5 | 6 | namespace fcitx::wayland { 7 | 8 | WpViewporter::WpViewporter(wp_viewporter *data) 9 | : version_(wp_viewporter_get_version(data)), data_(data) { 10 | wp_viewporter_set_user_data(*this, this); 11 | } 12 | 13 | void WpViewporter::destructor(wp_viewporter *data) { 14 | const auto version = wp_viewporter_get_version(data); 15 | if (version >= 1) { 16 | wp_viewporter_destroy(data); 17 | return; 18 | } 19 | } 20 | WpViewport *WpViewporter::getViewport(WlSurface *surface) { 21 | return new WpViewport( 22 | wp_viewporter_get_viewport(*this, rawPointer(surface))); 23 | } 24 | 25 | } // namespace fcitx::wayland 26 | -------------------------------------------------------------------------------- /src/lib/fcitx-wayland/wlr-data-control/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ecm_add_wayland_client_protocol(WLR_DATA_CONTROL_PROTOCOL_SRCS 2 | PROTOCOL ${CMAKE_CURRENT_SOURCE_DIR}/wlr-data-control-unstable-v1.xml 3 | BASENAME wlr-data-control-unstable-v1) 4 | 5 | set(FCITX_WAYLAND_WLR_DATA_CONTROL_PROTOCOL_SOURCES 6 | zwlr_data_control_device_v1.cpp 7 | zwlr_data_control_manager_v1.cpp 8 | zwlr_data_control_offer_v1.cpp 9 | zwlr_data_control_source_v1.cpp 10 | ) 11 | 12 | add_library(Fcitx5WaylandWLRDataControl STATIC ${FCITX_WAYLAND_WLR_DATA_CONTROL_PROTOCOL_SOURCES} ${WLR_DATA_CONTROL_PROTOCOL_SRCS}) 13 | set_target_properties(Fcitx5WaylandWLRDataControl PROPERTIES 14 | POSITION_INDEPENDENT_CODE ON 15 | ) 16 | target_include_directories(Fcitx5WaylandWLRDataControl PUBLIC 17 | "$") 18 | target_link_libraries(Fcitx5WaylandWLRDataControl Wayland::Client Fcitx5::Utils Fcitx5::Wayland::Core) 19 | 20 | add_library(Fcitx5::Wayland::WLRDataControl ALIAS Fcitx5WaylandWLRDataControl) 21 | -------------------------------------------------------------------------------- /src/lib/fcitx-wayland/wlr-data-control/zwlr_data_control_manager_v1.cpp: -------------------------------------------------------------------------------- 1 | #include "zwlr_data_control_manager_v1.h" 2 | #include "wayland-wlr-data-control-unstable-v1-client-protocol.h" 3 | #include "wl_seat.h" 4 | #include "zwlr_data_control_device_v1.h" 5 | #include "zwlr_data_control_source_v1.h" 6 | 7 | namespace fcitx::wayland { 8 | 9 | ZwlrDataControlManagerV1::ZwlrDataControlManagerV1( 10 | zwlr_data_control_manager_v1 *data) 11 | : version_(zwlr_data_control_manager_v1_get_version(data)), data_(data) { 12 | zwlr_data_control_manager_v1_set_user_data(*this, this); 13 | } 14 | 15 | void ZwlrDataControlManagerV1::destructor(zwlr_data_control_manager_v1 *data) { 16 | const auto version = zwlr_data_control_manager_v1_get_version(data); 17 | if (version >= 1) { 18 | zwlr_data_control_manager_v1_destroy(data); 19 | return; 20 | } 21 | } 22 | ZwlrDataControlSourceV1 *ZwlrDataControlManagerV1::createDataSource() { 23 | return new ZwlrDataControlSourceV1( 24 | zwlr_data_control_manager_v1_create_data_source(*this)); 25 | } 26 | ZwlrDataControlDeviceV1 *ZwlrDataControlManagerV1::getDataDevice(WlSeat *seat) { 27 | return new ZwlrDataControlDeviceV1( 28 | zwlr_data_control_manager_v1_get_data_device(*this, rawPointer(seat))); 29 | } 30 | 31 | } // namespace fcitx::wayland 32 | -------------------------------------------------------------------------------- /src/lib/fcitx-wayland/wlr-foreign-toplevel-management-unstable-v1/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ecm_add_wayland_client_protocol(WLR_FOREIGN_TOPLEVEL_MANAGEMENT_PROTOCOL_SRCS 2 | PROTOCOL ${CMAKE_CURRENT_SOURCE_DIR}/wlr-foreign-toplevel-management-unstable-v1.xml 3 | BASENAME wlr-foreign-toplevel-management-unstable-v1) 4 | 5 | set(FCITX_WAYLAND_WLR_FOREIGN_TOPLEVEL_MANAGEMENT_PROTOCOL_SOURCES 6 | zwlr_foreign_toplevel_manager_v1.cpp 7 | zwlr_foreign_toplevel_handle_v1.cpp 8 | ) 9 | 10 | add_library(Fcitx5WaylandWLRForeignToplevelManagement STATIC ${FCITX_WAYLAND_WLR_FOREIGN_TOPLEVEL_MANAGEMENT_PROTOCOL_SOURCES} ${WLR_FOREIGN_TOPLEVEL_MANAGEMENT_PROTOCOL_SRCS}) 11 | set_target_properties(Fcitx5WaylandWLRForeignToplevelManagement PROPERTIES 12 | POSITION_INDEPENDENT_CODE ON 13 | ) 14 | target_include_directories(Fcitx5WaylandWLRForeignToplevelManagement PUBLIC 15 | "$") 16 | target_link_libraries(Fcitx5WaylandWLRForeignToplevelManagement Wayland::Client Fcitx5::Utils Fcitx5::Wayland::Core) 17 | 18 | add_library(Fcitx5::Wayland::WLRForeignToplevelManagement ALIAS Fcitx5WaylandWLRForeignToplevelManagement) 19 | 20 | -------------------------------------------------------------------------------- /src/lib/fcitx/Fcitx5Core.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | exec_prefix=${prefix} 3 | libdir=@CMAKE_INSTALL_FULL_LIBDIR@ 4 | includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@/Fcitx5/Core 5 | 6 | Name: Fcitx5Core 7 | Description: Fcitx Core Library 8 | Version: @FCITX_VERSION@ 9 | Requires: Fcitx5Config Fcitx5Utils 10 | Cflags: -I${includedir} 11 | Libs: -L${libdir} -lFcitx5Core 12 | -------------------------------------------------------------------------------- /src/lib/fcitx/Fcitx5CoreConfig.cmake.in: -------------------------------------------------------------------------------- 1 | @PACKAGE_INIT@ 2 | 3 | include(CMakeFindDependencyMacro) 4 | 5 | find_dependency(Fcitx5Config @FCITX_VERSION@) 6 | find_dependency(Fcitx5Utils @FCITX_VERSION@) 7 | 8 | include("${CMAKE_CURRENT_LIST_DIR}/Fcitx5CoreTargets.cmake") 9 | -------------------------------------------------------------------------------- /src/lib/fcitx/addonfactory.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2016-2016 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | * 6 | */ 7 | 8 | #include "addonfactory.h" 9 | 10 | namespace fcitx { 11 | 12 | AddonFactory::~AddonFactory() {} 13 | } // namespace fcitx 14 | -------------------------------------------------------------------------------- /src/lib/fcitx/addonfactory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2016-2016 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | * 6 | */ 7 | #ifndef _FCITX_ADDONFACTORY_H_ 8 | #define _FCITX_ADDONFACTORY_H_ 9 | 10 | #include 11 | #include 12 | 13 | /// \addtogroup FcitxCore 14 | /// \{ 15 | /// \file 16 | /// \brief Addon Factory class 17 | 18 | namespace fcitx { 19 | 20 | class AddonManager; 21 | 22 | /// Base class for addon factory. 23 | class FCITXCORE_EXPORT AddonFactory { 24 | public: 25 | virtual ~AddonFactory(); 26 | /** 27 | * Create a addon instance for given addon manager. 28 | * 29 | * This function is called by AddonManager 30 | * 31 | * @return a created addon instance. 32 | * 33 | * @see AddonManager 34 | */ 35 | virtual AddonInstance *create(AddonManager *manager) = 0; 36 | }; 37 | } // namespace fcitx 38 | 39 | #endif // _FCITX_ADDONFACTORY_H_ 40 | -------------------------------------------------------------------------------- /src/lib/fcitx/addoninstance_p.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2022-2022 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | * 6 | */ 7 | #ifndef _FCITX_ADDONINSTANCE_P_H_ 8 | #define _FCITX_ADDONINSTANCE_P_H_ 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | namespace fcitx { 16 | 17 | class AddonInstancePrivate { 18 | public: 19 | std::unordered_map callbackMap_; 20 | const AddonInfo *addonInfo_ = nullptr; 21 | bool canRestart_ = true; 22 | }; 23 | 24 | } // namespace fcitx 25 | 26 | #endif // _FCITX_ADDONINSTANCE_P_H_ 27 | -------------------------------------------------------------------------------- /src/lib/fcitx/addonloader.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2016-2016 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | * 6 | */ 7 | #ifndef _FCITX_ADDONLOADER_H_ 8 | #define _FCITX_ADDONLOADER_H_ 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | namespace fcitx { 17 | 18 | class AddonFactory; 19 | class AddonManager; 20 | 21 | using StaticAddonRegistry = std::unordered_map; 22 | 23 | class FCITXCORE_EXPORT AddonLoader { 24 | public: 25 | virtual ~AddonLoader(); 26 | virtual std::string type() const = 0; 27 | virtual AddonInstance *load(const AddonInfo &info, 28 | AddonManager *manager) = 0; 29 | }; 30 | } // namespace fcitx 31 | 32 | #endif // _FCITX_ADDONLOADER_H_ 33 | -------------------------------------------------------------------------------- /src/lib/fcitx/candidateaction.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2024-2024 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | * 6 | */ 7 | #include "candidateaction.h" 8 | #include 9 | #include 10 | #include "fcitx-utils/macros.h" 11 | 12 | namespace fcitx { 13 | 14 | class CandidateActionPrivate { 15 | public: 16 | CandidateActionPrivate() = default; 17 | FCITX_INLINE_DEFINE_DEFAULT_DTOR_COPY_AND_MOVE_WITHOUT_SPEC( 18 | CandidateActionPrivate); 19 | 20 | int id_ = 0; 21 | std::string text_; 22 | bool isSeparator_ = false; 23 | std::string icon_; 24 | bool isCheckable_ = false; 25 | bool isChecked_ = false; 26 | }; 27 | 28 | CandidateAction::CandidateAction() 29 | : d_ptr(std::make_unique()) {} 30 | 31 | FCITX_DEFINE_DPTR_COPY_AND_DEFAULT_DTOR_AND_MOVE(CandidateAction); 32 | 33 | FCITX_DEFINE_PROPERTY_PRIVATE(CandidateAction, int, id, setId); 34 | FCITX_DEFINE_PROPERTY_PRIVATE(CandidateAction, std::string, text, setText); 35 | FCITX_DEFINE_PROPERTY_PRIVATE(CandidateAction, bool, isSeparator, setSeparator); 36 | FCITX_DEFINE_PROPERTY_PRIVATE(CandidateAction, std::string, icon, setIcon); 37 | FCITX_DEFINE_PROPERTY_PRIVATE(CandidateAction, bool, isCheckable, setCheckable); 38 | FCITX_DEFINE_PROPERTY_PRIVATE(CandidateAction, bool, isChecked, setChecked); 39 | 40 | } // namespace fcitx 41 | -------------------------------------------------------------------------------- /src/lib/fcitx/candidateaction.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2024-2024 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | * 6 | */ 7 | #ifndef _FCITX_CANDIDATEACTION_H_ 8 | #define _FCITX_CANDIDATEACTION_H_ 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | namespace fcitx { 16 | 17 | class CandidateActionPrivate; 18 | 19 | class FCITXCORE_EXPORT CandidateAction { 20 | public: 21 | CandidateAction(); 22 | virtual ~CandidateAction(); 23 | FCITX_DECLARE_COPY_AND_MOVE(CandidateAction); 24 | 25 | FCITX_DECLARE_PROPERTY(int, id, setId); 26 | FCITX_DECLARE_PROPERTY(std::string, text, setText); 27 | FCITX_DECLARE_PROPERTY(bool, isSeparator, setSeparator); 28 | FCITX_DECLARE_PROPERTY(std::string, icon, setIcon); 29 | FCITX_DECLARE_PROPERTY(bool, isCheckable, setCheckable); 30 | FCITX_DECLARE_PROPERTY(bool, isChecked, setChecked); 31 | 32 | private: 33 | FCITX_DECLARE_PRIVATE(CandidateAction); 34 | std::unique_ptr d_ptr; 35 | }; 36 | 37 | } // namespace fcitx 38 | 39 | #endif // _FCITX_CANDIDATEACTION_H_ 40 | -------------------------------------------------------------------------------- /src/lib/fcitx/focusgroup_p.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2016-2016 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | * 6 | */ 7 | #ifndef _FCITX_FOCUSGROUP_P_H_ 8 | #define _FCITX_FOCUSGROUP_P_H_ 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include "fcitx-utils/macros.h" 16 | 17 | namespace fcitx { 18 | 19 | class InputContextManager; 20 | 21 | class FocusGroupPrivate : public QPtrHolder { 22 | public: 23 | FocusGroupPrivate(FocusGroup *q, std::string display, 24 | InputContextManager &manager) 25 | : QPtrHolder(q), display_(std::move(display)), manager_(manager), 26 | focus_(nullptr) {} 27 | 28 | std::string display_; 29 | InputContextManager &manager_; 30 | InputContext *focus_; 31 | std::unordered_set ics_; 32 | 33 | IntrusiveListNode listNode_; 34 | }; 35 | } // namespace fcitx 36 | 37 | #endif // _FCITX_FOCUSGROUP_P_H_ 38 | -------------------------------------------------------------------------------- /src/lib/fcitx/inputcontextproperty.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2017-2017 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | * 6 | */ 7 | #include "inputcontextmanager.h" 8 | #include "inputcontextproperty_p.h" 9 | 10 | namespace fcitx { 11 | 12 | InputContextPropertyFactory::InputContextPropertyFactory() 13 | : d_ptr(std::make_unique(this)) {} 14 | 15 | InputContextPropertyFactory::~InputContextPropertyFactory() { unregister(); } 16 | 17 | bool InputContextPropertyFactory::registered() const { 18 | FCITX_D(); 19 | return d->manager_; 20 | } 21 | 22 | void InputContextPropertyFactory::unregister() { 23 | FCITX_D(); 24 | if (d->manager_) { 25 | d->manager_->unregisterProperty(d->name_); 26 | } 27 | } 28 | } // namespace fcitx 29 | -------------------------------------------------------------------------------- /src/lib/fcitx/inputcontextproperty_p.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2017-2017 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | * 6 | */ 7 | #ifndef _FCITX_INPUTCONTEXTPROPERTY_P_H_ 8 | #define _FCITX_INPUTCONTEXTPROPERTY_P_H_ 9 | 10 | #include 11 | #include 12 | #include "fcitx-utils/macros.h" 13 | #include "fcitx/inputcontextmanager.h" 14 | 15 | namespace fcitx { 16 | class InputContextManagerPrivate; 17 | class InputContextPropertyFactoryPrivate 18 | : public QPtrHolder { 19 | public: 20 | InputContextPropertyFactoryPrivate(InputContextPropertyFactory *q) 21 | : QPtrHolder(q) {} 22 | InputContextManager *manager_ = nullptr; 23 | int slot_ = -1; 24 | std::string name_; 25 | }; 26 | } // namespace fcitx 27 | 28 | #endif // _FCITX_INPUTCONTEXTPROPERTY_P_H_ 29 | -------------------------------------------------------------------------------- /src/lib/fcitx/menu.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2016-2016 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | * 6 | */ 7 | #ifndef _FCITX_MENU_H_ 8 | #define _FCITX_MENU_H_ 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | /// \addtogroup FcitxCore 17 | /// \{ 18 | /// \file 19 | /// \brief Class for menu in UI. 20 | 21 | namespace fcitx { 22 | 23 | class MenuPrivate; 24 | 25 | /** 26 | * Menu that contains a list of actions. 27 | * 28 | * The user interface may only support one-level of menu, so you 29 | * may want to avoid multiple level of menu if possible. 30 | */ 31 | class FCITXCORE_EXPORT Menu : public Element { 32 | public: 33 | friend class Action; 34 | Menu(); 35 | virtual ~Menu(); 36 | 37 | void addAction(Action *action); 38 | void removeAction(Action *action); 39 | void insertAction(Action *before, Action *action); 40 | std::vector actions(); 41 | 42 | FCITX_DECLARE_SIGNAL(Menu, Update, void()); 43 | 44 | private: 45 | std::unique_ptr d_ptr; 46 | FCITX_DECLARE_PRIVATE(Menu); 47 | }; 48 | } // namespace fcitx 49 | 50 | #endif // _FCITX_MENU_H_ 51 | -------------------------------------------------------------------------------- /src/lib/fcitx/userinterface.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2016-2016 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | * 6 | */ 7 | 8 | #include "userinterface.h" 9 | 10 | namespace fcitx { 11 | 12 | UserInterface::~UserInterface() {} 13 | 14 | VirtualKeyboardUserInterface::~VirtualKeyboardUserInterface() {} 15 | 16 | } // namespace fcitx 17 | -------------------------------------------------------------------------------- /src/modules/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(xcb) 2 | 3 | if (ENABLE_DBUS) 4 | add_subdirectory(dbus) 5 | endif() 6 | 7 | add_subdirectory(notifications) 8 | add_subdirectory(notificationitem) 9 | 10 | if (WAYLAND_FOUND) 11 | add_subdirectory(wayland) 12 | endif() 13 | 14 | add_subdirectory(spell) 15 | add_subdirectory(quickphrase) 16 | add_subdirectory(unicode) 17 | add_subdirectory(clipboard) 18 | add_subdirectory(emoji) 19 | add_subdirectory(imselector) 20 | 21 | write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/Fcitx5ModuleConfigVersion.cmake" VERSION @FCITX_VERSION@ COMPATIBILITY AnyNewerVersion) 22 | 23 | configure_file("${CMAKE_CURRENT_SOURCE_DIR}/Fcitx5ModuleConfig.cmake.in" 24 | "${CMAKE_CURRENT_BINARY_DIR}/Fcitx5ModuleConfig.cmake" @ONLY) 25 | 26 | install(FILES "${CMAKE_CURRENT_BINARY_DIR}/Fcitx5ModuleConfigVersion.cmake" 27 | "${CMAKE_CURRENT_BINARY_DIR}/Fcitx5ModuleConfig.cmake" 28 | DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Fcitx5Module 29 | COMPONENT Devel ) 30 | 31 | configure_file(Fcitx5Module.pc.in ${CMAKE_CURRENT_BINARY_DIR}/Fcitx5Module.pc @ONLY) 32 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Fcitx5Module.pc 33 | DESTINATION "${CMAKE_INSTALL_LIBDATADIR}/pkgconfig") 34 | -------------------------------------------------------------------------------- /src/modules/Fcitx5Module.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | exec_prefix=${prefix} 3 | libdir=@CMAKE_INSTALL_FULL_LIBDIR@ 4 | includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@/Fcitx5/Module 5 | 6 | Name: Fcitx5Module 7 | Description: Fcitx Public Module Library 8 | Version: @FCITX_VERSION@ 9 | Requires: Fcitx5Core 10 | Cflags: -I${includedir} 11 | 12 | -------------------------------------------------------------------------------- /src/modules/clipboard/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_fcitx5_addon(clipboard) 2 | 3 | target_sources(clipboard PRIVATE clipboard.cpp) 4 | target_link_libraries(clipboard Fcitx5::Core) 5 | 6 | if (ENABLE_X11) 7 | target_sources(clipboard PRIVATE xcbclipboard.cpp) 8 | target_link_libraries(clipboard Fcitx5::Module::XCB XCB::XCB) 9 | endif() 10 | 11 | if (WAYLAND_FOUND) 12 | target_sources(clipboard PRIVATE waylandclipboard.cpp) 13 | target_link_libraries(clipboard Fcitx5::Module::Wayland Fcitx5::Wayland::WLRDataControl Pthread::Pthread) 14 | endif() 15 | 16 | install(TARGETS clipboard DESTINATION "${FCITX_INSTALL_ADDONDIR}") 17 | install(FILES "${CMAKE_CURRENT_BINARY_DIR}/clipboard.conf" DESTINATION "${FCITX_INSTALL_PKGDATADIR}/addon" 18 | COMPONENT config) 19 | configure_file(clipboard.conf.in.in clipboard.conf.in @ONLY) 20 | fcitx5_translate_desktop_file(${CMAKE_CURRENT_BINARY_DIR}/clipboard.conf.in clipboard.conf) 21 | fcitx5_export_module(Clipboard TARGET clipboard BUILD_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}" HEADERS clipboard_public.h INSTALL) 22 | 23 | -------------------------------------------------------------------------------- /src/modules/clipboard/clipboard.conf.in.in: -------------------------------------------------------------------------------- 1 | [Addon] 2 | Name=Clipboard 3 | Type=@FCITX_ADDON_TYPE@ 4 | Library=libclipboard 5 | Category=Module 6 | Version=@PROJECT_VERSION@ 7 | OnDemand=False 8 | Configurable=True 9 | 10 | [Addon/OptionalDependencies] 11 | 0=core:@PROJECT_VERSION@ 12 | 1=xcb:@PROJECT_VERSION@ 13 | 2=wayland:@PROJECT_VERSION@ 14 | -------------------------------------------------------------------------------- /src/modules/dbus/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_fcitx5_addon(dbus dbusmodule.cpp) 2 | target_link_libraries(dbus Fcitx5::Core Fcitx5::Module::Keyboard) 3 | if (ENABLE_X11) 4 | target_link_libraries(dbus Fcitx5::Module::XCB XCB::XCB) 5 | endif() 6 | if (WAYLAND_FOUND) 7 | target_link_libraries(dbus Fcitx5::Module::Wayland Wayland::Client) 8 | endif() 9 | install(TARGETS dbus DESTINATION "${FCITX_INSTALL_ADDONDIR}") 10 | configure_file(dbus.conf.in.in dbus.conf.in @ONLY) 11 | fcitx5_translate_desktop_file(${CMAKE_CURRENT_BINARY_DIR}/dbus.conf.in dbus.conf) 12 | install(FILES "${CMAKE_CURRENT_BINARY_DIR}/dbus.conf" DESTINATION "${FCITX_INSTALL_PKGDATADIR}/addon" 13 | COMPONENT config) 14 | fcitx5_export_module(DBus TARGET dbus BUILD_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}" HEADERS dbus_public.h INSTALL) 15 | 16 | configure_file("${CMAKE_CURRENT_SOURCE_DIR}/org.fcitx.Fcitx5.service.in" "${CMAKE_CURRENT_BINARY_DIR}/org.fcitx.Fcitx5.service" @ONLY) 17 | install(FILES "${CMAKE_CURRENT_BINARY_DIR}/org.fcitx.Fcitx5.service" DESTINATION "${CMAKE_INSTALL_DATADIR}/dbus-1/services") 18 | -------------------------------------------------------------------------------- /src/modules/dbus/dbus.conf.in.in: -------------------------------------------------------------------------------- 1 | [Addon] 2 | Name=DBus 3 | Type=@FCITX_ADDON_TYPE@ 4 | Library=libdbus 5 | Category=Module 6 | Version=@PROJECT_VERSION@ 7 | 8 | [Addon/Dependencies] 9 | 0=core:@PROJECT_VERSION@ 10 | 1=keyboard 11 | 12 | [Addon/OptionalDependencies] 13 | 0=xcb 14 | 1=wayland 15 | -------------------------------------------------------------------------------- /src/modules/dbus/dbus_public.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2016-2016 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | * 6 | */ 7 | #ifndef _FCITX_MODULES_DBUS_DBUS_PUBLIC_H_ 8 | #define _FCITX_MODULES_DBUS_DBUS_PUBLIC_H_ 9 | 10 | #include 11 | #include 12 | 13 | FCITX_ADDON_DECLARE_FUNCTION(DBusModule, bus, fcitx::dbus::Bus *()); 14 | FCITX_ADDON_DECLARE_FUNCTION(DBusModule, lockGroup, bool(int group)); 15 | FCITX_ADDON_DECLARE_FUNCTION(DBusModule, hasXkbHelper, bool()); 16 | 17 | #endif // _FCITX_MODULES_DBUS_DBUS_PUBLIC_H_ 18 | -------------------------------------------------------------------------------- /src/modules/dbus/org.fcitx.Fcitx5.service.in: -------------------------------------------------------------------------------- 1 | [D-BUS Service] 2 | Name=org.fcitx.Fcitx5 3 | Exec=@FCITX_INSTALL_BINDIR@/fcitx5 4 | 5 | -------------------------------------------------------------------------------- /src/modules/emoji/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (ENABLE_EMOJI) 2 | add_fcitx5_addon(emoji emoji.cpp) 3 | target_link_libraries(emoji Fcitx5::Core ZLIB::ZLIB) 4 | install(TARGETS emoji DESTINATION "${FCITX_INSTALL_ADDONDIR}") 5 | install(FILES "${CMAKE_CURRENT_BINARY_DIR}/emoji.conf" DESTINATION "${FCITX_INSTALL_PKGDATADIR}/addon" 6 | COMPONENT config) 7 | add_subdirectory(data) 8 | endif() 9 | 10 | configure_file(emoji.conf.in.in emoji.conf.in @ONLY) 11 | fcitx5_translate_desktop_file(${CMAKE_CURRENT_BINARY_DIR}/emoji.conf.in emoji.conf) 12 | fcitx5_export_module(Emoji TARGET emoji BUILD_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}" HEADERS emoji_public.h INSTALL) 13 | -------------------------------------------------------------------------------- /src/modules/emoji/data/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB DICT_FILES *.dict) 2 | 3 | install(FILES ${DICT_FILES} DESTINATION ${FCITX_INSTALL_PKGDATADIR}/emoji/data 4 | COMPONENT config) 5 | 6 | -------------------------------------------------------------------------------- /src/modules/emoji/data/README.md: -------------------------------------------------------------------------------- 1 | Dictionary file under this directory is generated from Unicode CLDR project 2 | (https://cldr.unicode.org/) and https://unicode.org/Public/emoji/. 3 | -------------------------------------------------------------------------------- /src/modules/emoji/data/af.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/af.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/am.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/am.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/ar.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/ar.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/ar_SA.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/ar_SA.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/as.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/as.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/ast.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/ast.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/az.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/az.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/be.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/be.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/bg.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/bg.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/bn.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/bn.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/br.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/br.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/bs.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/bs.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/ca.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/ca.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/ccp.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/ccp.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/ceb.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/ceb.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/chr.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/chr.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/ckb.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/ckb.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/cs.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/cs.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/cy.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/cy.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/da.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/da.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/de.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/de.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/de_CH.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/de_CH.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/dsb.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/dsb.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/el.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/el.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/en.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/en.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/en_001.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/en_001.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/en_AU.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/en_AU.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/en_CA.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/en_CA.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/en_GB.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/en_GB.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/es.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/es.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/es_419.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/es_419.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/es_MX.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/es_MX.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/es_US.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/es_US.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/et.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/et.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/eu.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/eu.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/fa.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/fa.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/fi.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/fi.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/fil.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/fil.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/fo.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/fo.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/fr.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/fr.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/fr_CA.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/fr_CA.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/ga.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/ga.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/gd.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/gd.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/gl.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/gl.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/gu.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/gu.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/ha.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/ha.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/he.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/he.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/hi.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/hi.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/hi_Latn.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/hi_Latn.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/hr.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/hr.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/hsb.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/hsb.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/hu.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/hu.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/hy.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/hy.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/ia.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/ia.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/id.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/id.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/ig.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/ig.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/is.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/is.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/it.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/it.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/ja.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/ja.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/jv.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/jv.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/ka.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/ka.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/kab.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/kab.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/kk.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/kk.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/kl.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/kl.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/km.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/km.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/kn.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/kn.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/ko.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/ko.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/kok.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/kok.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/ky.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/ky.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/lb.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/lb.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/lo.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/lo.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/lt.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/lt.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/lv.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/lv.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/mi.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/mi.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/mk.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/mk.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/ml.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/ml.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/mn.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/mn.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/mni.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/mni.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/mr.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/mr.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/ms.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/ms.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/mt.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/mt.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/my.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/my.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/ne.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/ne.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/nl.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/nl.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/nn.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/nn.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/no.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/no.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/or.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/or.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/pa.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/pa.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/pa_Arab.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/pa_Arab.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/pcm.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/pcm.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/pl.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/pl.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/ps.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/ps.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/pt.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/pt.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/pt_PT.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/pt_PT.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/qu.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/qu.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/rm.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/rm.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/ro.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/ro.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/ru.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/ru.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/rw.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/rw.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/sc.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/sc.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/sd.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/sd.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/si.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/si.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/sk.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/sk.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/sl.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/sl.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/so.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/so.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/sq.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/sq.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/sr.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/sr.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/sr_Cyrl_BA.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/sr_Cyrl_BA.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/sr_Latn.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/sr_Latn.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/sr_Latn_BA.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/sr_Latn_BA.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/sv.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/sv.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/sw.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/sw.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/sw_KE.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/sw_KE.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/ta.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/ta.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/te.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/te.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/tg.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/tg.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/th.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/th.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/ti.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/ti.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/tk.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/tk.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/to.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/to.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/tr.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/tr.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/ug.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/ug.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/uk.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/uk.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/ur.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/ur.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/uz.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/uz.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/vi.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/vi.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/wo.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/wo.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/xh.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/xh.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/yo.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/yo.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/yo_BJ.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/yo_BJ.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/yue.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/yue.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/yue_Hans.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/yue_Hans.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/zh.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/zh.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/zh_Hant.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/zh_Hant.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/zh_Hant_HK.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/zh_Hant_HK.dict -------------------------------------------------------------------------------- /src/modules/emoji/data/zu.dict: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/emoji/data/zu.dict -------------------------------------------------------------------------------- /src/modules/emoji/emoji.conf.in.in: -------------------------------------------------------------------------------- 1 | [Addon] 2 | Name=Emoji 3 | Type=@FCITX_ADDON_TYPE@ 4 | Library=libemoji 5 | Category=Module 6 | Version=@PROJECT_VERSION@ 7 | OnDemand=True 8 | 9 | [Addon/Dependencies] 10 | 0=core:@PROJECT_VERSION@ 11 | -------------------------------------------------------------------------------- /src/modules/emoji/emoji_public.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2020-2020 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | * 6 | */ 7 | #ifndef _FCITX5_MODULES_EMOJI_EMOJI_PUBLIC_H_ 8 | #define _FCITX5_MODULES_EMOJI_EMOJI_PUBLIC_H_ 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | FCITX_ADDON_DECLARE_FUNCTION(Emoji, check, 16 | bool(const std::string &language, 17 | bool fallbackToEn)); 18 | 19 | FCITX_ADDON_DECLARE_FUNCTION(Emoji, query, 20 | const std::vector &( 21 | const std::string &language, 22 | const std::string &key, bool fallbackToEn)); 23 | 24 | FCITX_ADDON_DECLARE_FUNCTION( 25 | Emoji, prefix, 26 | void(const std::string &language, const std::string &key, bool fallbackToEn, 27 | const std::function &)> &)); 29 | 30 | #endif // _FCITX5_MODULES_EMOJI_EMOJI_PUBLIC_H_ 31 | -------------------------------------------------------------------------------- /src/modules/imselector/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_fcitx5_addon(imselector imselector.cpp) 2 | target_link_libraries(imselector Fcitx5::Core) 3 | install(TARGETS imselector DESTINATION "${FCITX_INSTALL_ADDONDIR}") 4 | configure_file(imselector.conf.in.in imselector.conf.in @ONLY) 5 | fcitx5_translate_desktop_file(${CMAKE_CURRENT_BINARY_DIR}/imselector.conf.in imselector.conf) 6 | install(FILES "${CMAKE_CURRENT_BINARY_DIR}/imselector.conf" DESTINATION "${FCITX_INSTALL_PKGDATADIR}/addon" 7 | COMPONENT config) 8 | 9 | -------------------------------------------------------------------------------- /src/modules/imselector/imselector.conf.in.in: -------------------------------------------------------------------------------- 1 | [Addon] 2 | Name=Input method selector 3 | Comment=Select specific input method via keyboard 4 | Category=Module 5 | Version=@PROJECT_VERSION@ 6 | Library=libimselector 7 | Type=@FCITX_ADDON_TYPE@ 8 | OnDemand=False 9 | Configurable=True 10 | 11 | [Addon/Dependencies] 12 | 0=core:@PROJECT_VERSION@ 13 | -------------------------------------------------------------------------------- /src/modules/notificationitem/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (ENABLE_DBUS) 2 | add_fcitx5_addon(notificationitem notificationitem.cpp dbusmenu.cpp) 3 | target_link_libraries(notificationitem Fcitx5::Core Fcitx5::Module::DBus Fcitx5::Module::ClassicUI ) 4 | install(TARGETS notificationitem DESTINATION "${FCITX_INSTALL_ADDONDIR}") 5 | install(FILES "${CMAKE_CURRENT_BINARY_DIR}/notificationitem.conf" DESTINATION "${FCITX_INSTALL_PKGDATADIR}/addon" 6 | COMPONENT config) 7 | endif() 8 | 9 | configure_file(notificationitem.conf.in.in notificationitem.conf.in @ONLY) 10 | fcitx5_translate_desktop_file(${CMAKE_CURRENT_BINARY_DIR}/notificationitem.conf.in notificationitem.conf) 11 | fcitx5_export_module(NotificationItem TARGET notificationitem BUILD_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}" HEADERS notificationitem_public.h INSTALL) 12 | -------------------------------------------------------------------------------- /src/modules/notificationitem/notificationitem.conf.in.in: -------------------------------------------------------------------------------- 1 | [Addon] 2 | Name=Status Notifier 3 | Comment=DBus based new Freedesktop.org tray icon 4 | Type=@FCITX_ADDON_TYPE@ 5 | Library=libnotificationitem 6 | Category=Module 7 | Version=@PROJECT_VERSION@ 8 | OnDemand=True 9 | 10 | [Addon/Dependencies] 11 | 0=core:@PROJECT_VERSION@ 12 | 1=dbus 13 | -------------------------------------------------------------------------------- /src/modules/notificationitem/notificationitem_public.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2017-2017 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | * 6 | */ 7 | #ifndef _FCITX_MODULES_NOTIFICATIONITEM_NOTIFICATIONITEM_PUBLIC_H_ 8 | #define _FCITX_MODULES_NOTIFICATIONITEM_NOTIFICATIONITEM_PUBLIC_H_ 9 | 10 | #include 11 | #include 12 | 13 | namespace fcitx { 14 | 15 | using NotificationItemCallback = std::function; 16 | 17 | } // namespace fcitx 18 | 19 | // When enable is called 20 | FCITX_ADDON_DECLARE_FUNCTION(NotificationItem, enable, void()); 21 | // Callback will be called when registered changed. 22 | FCITX_ADDON_DECLARE_FUNCTION( 23 | NotificationItem, watch, 24 | std::unique_ptr>( 25 | NotificationItemCallback)); 26 | FCITX_ADDON_DECLARE_FUNCTION(NotificationItem, disable, void()); 27 | // Can be used to query current state. 28 | FCITX_ADDON_DECLARE_FUNCTION(NotificationItem, registered, bool()); 29 | 30 | #endif // _FCITX_MODULES_NOTIFICATIONITEM_NOTIFICATIONITEM_PUBLIC_H_ 31 | -------------------------------------------------------------------------------- /src/modules/notifications/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (ENABLE_DBUS) 2 | add_fcitx5_addon(notifications notifications.cpp) 3 | target_link_libraries(notifications Fcitx5::Core Fcitx5::Module::DBus) 4 | install(TARGETS notifications DESTINATION "${FCITX_INSTALL_ADDONDIR}") 5 | install(FILES "${CMAKE_CURRENT_BINARY_DIR}/notifications.conf" DESTINATION "${FCITX_INSTALL_PKGDATADIR}/addon" 6 | COMPONENT config) 7 | endif() 8 | 9 | configure_file(notifications.conf.in.in notifications.conf.in @ONLY) 10 | fcitx5_translate_desktop_file(${CMAKE_CURRENT_BINARY_DIR}/notifications.conf.in notifications.conf) 11 | fcitx5_export_module(Notifications TARGET notifications BUILD_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}" HEADERS notifications_public.h INSTALL) 12 | 13 | -------------------------------------------------------------------------------- /src/modules/notifications/notifications.conf.in.in: -------------------------------------------------------------------------------- 1 | [Addon] 2 | Name=Notification 3 | Comment=Freedesktop.org Notification Support 4 | Type=@FCITX_ADDON_TYPE@ 5 | Library=libnotifications 6 | Category=Module 7 | Version=@PROJECT_VERSION@ 8 | OnDemand=True 9 | Configurable=True 10 | 11 | [Addon/Dependencies] 12 | 0=core:@PROJECT_VERSION@ 13 | 1=dbus 14 | -------------------------------------------------------------------------------- /src/modules/quickphrase/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_fcitx5_addon(quickphrase quickphrase.cpp quickphraseprovider.cpp) 2 | target_link_libraries(quickphrase Fcitx5::Core Fcitx5::Module::Spell) 3 | install(TARGETS quickphrase DESTINATION "${FCITX_INSTALL_ADDONDIR}") 4 | configure_file(quickphrase.conf.in.in quickphrase.conf.in @ONLY) 5 | fcitx5_translate_desktop_file(${CMAKE_CURRENT_BINARY_DIR}/quickphrase.conf.in quickphrase.conf) 6 | install(FILES "${CMAKE_CURRENT_BINARY_DIR}/quickphrase.conf" DESTINATION "${FCITX_INSTALL_PKGDATADIR}/addon" 7 | COMPONENT config) 8 | fcitx5_export_module(QuickPhrase TARGET quickphrase BUILD_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}" HEADERS quickphrase_public.h INSTALL) 9 | 10 | install(DIRECTORY quickphrase.d DESTINATION "${FCITX_INSTALL_PKGDATADIR}/data" 11 | COMPONENT config 12 | FILES_MATCHING PATTERN "*.mb") 13 | 14 | -------------------------------------------------------------------------------- /src/modules/quickphrase/quickphrase.conf.in.in: -------------------------------------------------------------------------------- 1 | [Addon] 2 | Name=Quick Phrase 3 | Type=@FCITX_ADDON_TYPE@ 4 | Library=libquickphrase 5 | Category=Module 6 | Version=@PROJECT_VERSION@ 7 | OnDemand=False 8 | Configurable=True 9 | 10 | [Dependencies] 11 | 0=core:@PROJECT_VERSION@ 12 | 13 | [OptionalDependencies] 14 | 0=spell 15 | -------------------------------------------------------------------------------- /src/modules/quickphrase/quickphrase.d/emoji.mb: -------------------------------------------------------------------------------- 1 | rec ●REC 2 | yawn ( ̄□ ̄) 3 | yawn (๑´ڡ`๑) 4 | point (「・ω・)「 5 | poke ( ´∀`)σ)Д`) 6 | cry T_T 7 | cry (╥_╥) 8 | cry (;´༎ຶД༎ຶ`) 9 | poor (´・ω・`) 10 | poor (。・_・。) 11 | poor QAQ 12 | love (。♥‿♥。) 13 | love (✿ ♥‿♥) 14 | cute (。◕‿◕。) 15 | cute (◕‿◕✿) 16 | smile ☺ 17 | smile ~^_^~ 18 | smile (・∀・) 19 | smile ლ(╹◡╹ლ) 20 | amazed (°Д°) 21 | amazed ( ゚Д゚)σ 22 | amazed Σ(っ°Д °;)っ 23 | effort (ง •̀_•́)ง 24 | bye (。・ω・)ノ 25 | orz _(:з」∠)_ 26 | throw_table (┙>∧<)┙へ┻┻ 27 | blash o(///▽///)q 28 | sob >_< 29 | sob ( >﹏<。) 30 | bear (・ェ-) 31 | bear (✪㉨✪) 32 | bear ( ̄(エ) ̄) 33 | hi ´ ▽ ` )ノ 34 | kira (ゝ∀・) 35 | ah ´_>` 36 | ah (´_>`) 37 | ah ╮( ̄▽ ̄)╭ 38 | ah ●﹏● 39 | shrug ¯\\_(ツ)_/¯ 40 | -------------------------------------------------------------------------------- /src/modules/spell/spell-custom-dict.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2012-2012 Yichao Yu 3 | * SPDX-FileCopyrightText: 2017-2017 CSSlayer 4 | * 5 | * SPDX-License-Identifier: LGPL-2.1-or-later 6 | * 7 | */ 8 | #ifndef _FCITX_MODULES_SPELL_SPELL_CUSTOM_DICT_H_ 9 | #define _FCITX_MODULES_SPELL_SPELL_CUSTOM_DICT_H_ 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | namespace fcitx { 16 | 17 | class SpellCustomDict { 18 | public: 19 | virtual ~SpellCustomDict() {} 20 | 21 | static SpellCustomDict *requestDict(const std::string &language); 22 | static bool checkDict(const std::string &language); 23 | 24 | std::vector> 25 | hint(const std::string &str, size_t limit); 26 | 27 | protected: 28 | void loadDict(const std::string &lang); 29 | int getDistance(const char *word, int utf8Len, const char *dict); 30 | virtual bool wordCompare(unsigned int c1, unsigned int c2) = 0; 31 | virtual int wordCheck(const std::string &word) = 0; 32 | virtual void hintComplete(std::vector &hints, int type) = 0; 33 | std::vector data_; 34 | std::vector words_; 35 | std::string delim_; 36 | }; 37 | } // namespace fcitx 38 | 39 | #endif // _FCITX_MODULES_SPELL_SPELL_CUSTOM_DICT_H_ 40 | -------------------------------------------------------------------------------- /src/modules/spell/spell-custom.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2012-2012 Yichao Yu 3 | * SPDX-FileCopyrightText: 2017-2017 CSSlayer 4 | * 5 | * SPDX-License-Identifier: LGPL-2.1-or-later 6 | * 7 | */ 8 | 9 | #include "spell-custom.h" 10 | #include "spell-custom-dict.h" 11 | 12 | fcitx::SpellCustom::SpellCustom(fcitx::Spell *spell) 13 | : fcitx::SpellBackend(spell) {} 14 | 15 | fcitx::SpellCustom::~SpellCustom() {} 16 | 17 | void fcitx::SpellCustom::addWord(const std::string &, const std::string &) { 18 | // TODO 19 | } 20 | 21 | bool fcitx::SpellCustom::checkDict(const std::string &language) { 22 | return SpellCustomDict::checkDict(language); 23 | } 24 | 25 | bool fcitx::SpellCustom::loadDict(const std::string &language) { 26 | if (language_ == language) { 27 | return true; 28 | } 29 | 30 | auto *dict = SpellCustomDict::requestDict(language); 31 | if (dict) { 32 | language_ = language; 33 | dict_.reset(dict); 34 | return true; 35 | } 36 | 37 | return false; 38 | } 39 | 40 | std::vector> 41 | fcitx::SpellCustom::hint(const std::string &language, const std::string &str, 42 | size_t limit) { 43 | if (!loadDict(language)) { 44 | return {}; 45 | } 46 | return dict_->hint(str, limit); 47 | } 48 | -------------------------------------------------------------------------------- /src/modules/spell/spell-custom.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2012-2012 Yichao Yu 3 | * SPDX-FileCopyrightText: 2017-2017 CSSlayer 4 | * 5 | * SPDX-License-Identifier: LGPL-2.1-or-later 6 | * 7 | */ 8 | #ifndef _FCITX_MODULES_SPELL_SPELL_CUSTOM_H_ 9 | #define _FCITX_MODULES_SPELL_SPELL_CUSTOM_H_ 10 | 11 | #include "spell.h" 12 | 13 | namespace fcitx { 14 | 15 | class SpellCustomDict; 16 | 17 | class SpellCustom : public SpellBackend { 18 | public: 19 | SpellCustom(Spell *spell); 20 | ~SpellCustom(); 21 | 22 | bool checkDict(const std::string &language) override; 23 | void addWord(const std::string &language, const std::string &word) override; 24 | std::vector> 25 | hint(const std::string &language, const std::string &str, 26 | size_t limit) override; 27 | 28 | private: 29 | bool loadDict(const std::string &language); 30 | std::unique_ptr dict_; 31 | std::string language_; 32 | }; 33 | } // namespace fcitx 34 | 35 | #endif // _FCITX_MODULES_SPELL_SPELL_CUSTOM_H_ 36 | -------------------------------------------------------------------------------- /src/modules/spell/spell-enchant.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2012-2012 Yichao Yu 3 | * SPDX-FileCopyrightText: 2017-2017 CSSlayer 4 | * 5 | * SPDX-License-Identifier: LGPL-2.1-or-later 6 | * 7 | */ 8 | #ifndef _FCITX_MODULES_SPELL_SPELL_ENCHANT_H_ 9 | #define _FCITX_MODULES_SPELL_SPELL_ENCHANT_H_ 10 | 11 | #include 12 | #include "spell.h" 13 | 14 | namespace fcitx { 15 | 16 | class SpellEnchant : public SpellBackend { 17 | public: 18 | SpellEnchant(Spell *spell); 19 | ~SpellEnchant(); 20 | 21 | bool checkDict(const std::string &language) override; 22 | void addWord(const std::string &language, const std::string &word) override; 23 | std::vector> 24 | hint(const std::string &language, const std::string &word, 25 | size_t limit) override; 26 | 27 | private: 28 | bool loadDict(const std::string &language); 29 | UniqueCPtr broker_; 30 | std::unique_ptr> dict_; 31 | std::string language_; 32 | std::string systemLanguage_; 33 | }; 34 | } // namespace fcitx 35 | 36 | #endif // _FCITX_MODULES_SPELL_SPELL_ENCHANT_H_ 37 | -------------------------------------------------------------------------------- /src/modules/spell/spell.conf.in.in: -------------------------------------------------------------------------------- 1 | [Addon] 2 | Name=Spell 3 | Type=@FCITX_ADDON_TYPE@ 4 | Library=libspell 5 | Category=Module 6 | Version=@PROJECT_VERSION@ 7 | OnDemand=True 8 | Configurable=True 9 | 10 | [Addon/Dependencies] 11 | 0=core:@PROJECT_VERSION@ 12 | -------------------------------------------------------------------------------- /src/modules/unicode/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_fcitx5_addon(unicode unicode.cpp charselectdata.cpp) 2 | target_link_libraries(unicode Fcitx5::Core Fcitx5::Module::Clipboard) 3 | install(TARGETS unicode DESTINATION "${FCITX_INSTALL_ADDONDIR}") 4 | configure_file(unicode.conf.in.in unicode.conf.in @ONLY) 5 | fcitx5_translate_desktop_file(${CMAKE_CURRENT_BINARY_DIR}/unicode.conf.in unicode.conf) 6 | install(FILES "${CMAKE_CURRENT_BINARY_DIR}/unicode.conf" DESTINATION "${FCITX_INSTALL_PKGDATADIR}/addon" 7 | COMPONENT config) 8 | fcitx5_export_module(Unicode TARGET unicode BUILD_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}" HEADERS unicode_public.h INSTALL) 9 | 10 | install(FILES charselectdata DESTINATION "${FCITX_INSTALL_PKGDATADIR}/unicode" COMPONENT config) 11 | 12 | -------------------------------------------------------------------------------- /src/modules/unicode/charselectdata: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/modules/unicode/charselectdata -------------------------------------------------------------------------------- /src/modules/unicode/unicode.conf.in.in: -------------------------------------------------------------------------------- 1 | [Addon] 2 | Name=Unicode 3 | Comment=Add Unicode Typing Support 4 | Type=@FCITX_ADDON_TYPE@ 5 | Library=libunicode 6 | Category=Module 7 | Version=@PROJECT_VERSION@ 8 | OnDemand=False 9 | Configurable=True 10 | 11 | [Addon/Dependencies] 12 | 0=core:@PROJECT_VERSION@ 13 | 14 | [Addon/OptionalDependencies] 15 | 0=clipboard 16 | -------------------------------------------------------------------------------- /src/modules/unicode/unicode_public.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2021-2021 Rocket Aaron 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | * 6 | */ 7 | #ifndef _FCITX_MODULES_UNICODE_UNICODE_PUBLIC_H_ 8 | #define _FCITX_MODULES_UNICODE_UNICODE_PUBLIC_H_ 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | FCITX_ADDON_DECLARE_FUNCTION(Unicode, trigger, bool(InputContext *ic)); 15 | 16 | #endif // _FCITX_MODULES_UNICODE_UNICODE_PUBLIC_H_ 17 | -------------------------------------------------------------------------------- /src/modules/wayland/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_fcitx5_addon(wayland waylandmodule.cpp waylandeventreader.cpp) 2 | target_link_libraries(wayland Fcitx5::Core Wayland::Client Fcitx5::Wayland::Core PkgConfig::Gio Pthread::Pthread Fcitx5::Module::Notifications) 3 | 4 | if (ENABLE_DBUS) 5 | target_link_libraries(wayland Fcitx5::Module::DBus) 6 | endif() 7 | if (ENABLE_X11) 8 | target_link_libraries(wayland Fcitx5::Module::XCB) 9 | endif() 10 | install(TARGETS wayland DESTINATION "${FCITX_INSTALL_ADDONDIR}") 11 | configure_file(wayland.conf.in.in wayland.conf.in @ONLY) 12 | fcitx5_translate_desktop_file(${CMAKE_CURRENT_BINARY_DIR}/wayland.conf.in wayland.conf) 13 | install(FILES "${CMAKE_CURRENT_BINARY_DIR}/wayland.conf" DESTINATION "${FCITX_INSTALL_PKGDATADIR}/addon" 14 | COMPONENT config) 15 | fcitx5_export_module(Wayland TARGET wayland BUILD_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}" HEADERS wayland_public.h INSTALL) 16 | -------------------------------------------------------------------------------- /src/modules/wayland/wayland.conf.in.in: -------------------------------------------------------------------------------- 1 | [Addon] 2 | Name=Wayland 3 | Type=@FCITX_ADDON_TYPE@ 4 | Library=libwayland 5 | Category=Module 6 | Version=@PROJECT_VERSION@ 7 | Configurable=True 8 | 9 | [Addon/Dependencies] 10 | 0=core:@PROJECT_VERSION@ 11 | -------------------------------------------------------------------------------- /src/modules/xcb/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (ENABLE_X11) 2 | add_fcitx5_addon(xcb xcbmodule.cpp xcbconnection.cpp xcbconvertselection.cpp xcbkeyboard.cpp 3 | xcbeventreader.cpp) 4 | target_compile_definitions(xcb PRIVATE -DFCITX_XCB_EWMH) 5 | target_link_libraries(xcb Fcitx5::Core XCB::XCB XCB::AUX XCB::XKB XCB::XFIXES XCB::EWMH XCB::RANDR XCB::KEYSYMS XKBCommon::XKBCommon XKBCommon::X11 PkgConfig::XkbFile Pthread::Pthread Fcitx5::Module::Notifications) 6 | 7 | if (ENABLE_DBUS) 8 | target_link_libraries(xcb Fcitx5::Module::DBus) 9 | endif() 10 | 11 | if (WAYLAND_FOUND) 12 | target_link_libraries(xcb Fcitx5::Module::WaylandIM) 13 | endif() 14 | 15 | install(TARGETS xcb DESTINATION "${FCITX_INSTALL_ADDONDIR}") 16 | install(FILES "${CMAKE_CURRENT_BINARY_DIR}/xcb.conf" DESTINATION "${FCITX_INSTALL_PKGDATADIR}/addon" 17 | COMPONENT config) 18 | endif() 19 | 20 | configure_file(xcb.conf.in.in xcb.conf.in @ONLY) 21 | fcitx5_translate_desktop_file(${CMAKE_CURRENT_BINARY_DIR}/xcb.conf.in xcb.conf) 22 | fcitx5_export_module(XCB TARGET xcb BUILD_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}" HEADERS xcb_public.h INSTALL) 23 | -------------------------------------------------------------------------------- /src/modules/xcb/xcb.conf.in.in: -------------------------------------------------------------------------------- 1 | [Addon] 2 | Name=XCB 3 | Type=@FCITX_ADDON_TYPE@ 4 | Library=libxcb 5 | Category=Module 6 | Version=@PROJECT_VERSION@ 7 | Configurable=True 8 | 9 | [Addon/Dependencies] 10 | 0=core:@PROJECT_VERSION@ 11 | -------------------------------------------------------------------------------- /src/server/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(fcitx5 main.cpp errorhandler.cpp) 2 | target_link_libraries(fcitx5 Fcitx5::Core LibIntl::LibIntl) 3 | if (ENABLE_KEYBOARD) 4 | target_link_libraries(fcitx5 keyboard) 5 | endif() 6 | if (EXECINFO_FOUND) 7 | target_link_libraries(fcitx5 Execinfo::Execinfo) 8 | endif() 9 | 10 | if(HAVE_NO_DEPRECATED_DECLARATIONS) 11 | set_source_files_properties(main.cpp PROPERTIES COMPILE_FLAGS "-Wno-deprecated-declarations") 12 | endif() 13 | 14 | install(TARGETS fcitx5 DESTINATION "${FCITX_INSTALL_BINDIR}") 15 | -------------------------------------------------------------------------------- /src/server/errorhandler.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2002-2005 Yuking 3 | * yuking_net@sohu.com 4 | * SPDX-FileCopyrightText: 2010-2015 CSSlayer 5 | * 6 | * SPDX-License-Identifier: LGPL-2.1-or-later 7 | * 8 | */ 9 | 10 | #ifndef _ERRORHANDLER_H 11 | #define _ERRORHANDLER_H 12 | 13 | /* *********************************************************** 14 | // Consts 15 | // *********************************************************** */ 16 | #ifndef SIGUNUSED 17 | #define SIGUNUSED 29 18 | #endif 19 | /* *********************************************************** 20 | // Data structures 21 | // *********************************************************** */ 22 | 23 | /* *********************************************************** 24 | // Functions 25 | // *********************************************************** */ 26 | 27 | // 28 | // Set Posix Signal Handler 29 | // 30 | // 31 | void SetMyExceptionHandler(void); 32 | 33 | // 34 | // Process Posix signal 35 | // 36 | void OnException(int signo); 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /src/tools/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (ENABLE_DBUS) 2 | add_executable(fcitx5-remote remote.cpp) 3 | target_link_libraries(fcitx5-remote Fcitx5::Utils) 4 | 5 | install(TARGETS fcitx5-remote DESTINATION "${FCITX_INSTALL_BINDIR}") 6 | endif() 7 | 8 | if (ENABLE_DBUS AND WAYLAND_FOUND) 9 | add_executable(fcitx5-wayland-launcher wayland-launcher.cpp) 10 | target_link_libraries(fcitx5-wayland-launcher Fcitx5::Utils) 11 | 12 | install(TARGETS fcitx5-wayland-launcher DESTINATION "${FCITX_INSTALL_LIBEXECDIR}") 13 | endif() 14 | -------------------------------------------------------------------------------- /src/ui/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(classic) 2 | 3 | if (ENABLE_DBUS) 4 | add_subdirectory(kimpanel) 5 | add_subdirectory(virtualkeyboard) 6 | endif() 7 | -------------------------------------------------------------------------------- /src/ui/classic/classicui.conf.in.in: -------------------------------------------------------------------------------- 1 | [Addon] 2 | Name=Classic User Interface 3 | Type=@FCITX_ADDON_TYPE@ 4 | Library=libclassicui 5 | Category=UI 6 | Version=@PROJECT_VERSION@ 7 | OnDemand=True 8 | Configurable=True 9 | 10 | [Addon/Dependencies] 11 | 0=core:@PROJECT_VERSION@ 12 | 13 | [Addon/OptionalDependencies] 14 | 0=xcb 15 | 1=wayland 16 | 2=notificationitem 17 | 3=dbus 18 | 4=waylandim 19 | -------------------------------------------------------------------------------- /src/ui/classic/classicui_public.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2021~2021 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | * 6 | */ 7 | #ifndef _FCITX5_UI_CLASSIC_CLASSICUI_PUBLIC_H_ 8 | #define _FCITX5_UI_CLASSIC_CLASSICUI_PUBLIC_H_ 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | FCITX_ADDON_DECLARE_FUNCTION( 16 | ClassicUI, labelIcon, 17 | std::vector(const std::string &label, unsigned int size)); 18 | FCITX_ADDON_DECLARE_FUNCTION(ClassicUI, preferTextIcon, bool()); 19 | FCITX_ADDON_DECLARE_FUNCTION(ClassicUI, showLayoutNameInIcon, bool()); 20 | 21 | #endif // _FCITX5_UI_CLASSIC_CLASSICUI_PUBLIC_H_ 22 | -------------------------------------------------------------------------------- /src/ui/classic/colorhelper.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2023-2023 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | */ 6 | 7 | #include "colorhelper.h" 8 | #include 9 | #include "fcitx-utils/color.h" 10 | 11 | namespace fcitx::classicui { 12 | 13 | inline float normalize(float v) { 14 | return (v < 1.0 ? (v > 0.0 ? v : 0.0) : 1.0); 15 | } 16 | 17 | float gamma(float n) { return std::pow(normalize(n), 2.2); } 18 | 19 | float lumag(float r, float g, float b) { 20 | return r * 0.2126 + g * 0.7152 + b * 0.0722; 21 | } 22 | 23 | float luma(const Color &c) { 24 | return lumag(gamma(c.redF()), gamma(c.greenF()), gamma(c.blueF())); 25 | } 26 | 27 | Color accentForeground(const Color &accent) { 28 | auto c = Color(255, 255, 255); 29 | // light bg 30 | if (luma(accent) > 0.5) { 31 | c = Color(0, 0, 0); 32 | } 33 | return c; 34 | } 35 | 36 | } // namespace fcitx::classicui 37 | -------------------------------------------------------------------------------- /src/ui/classic/colorhelper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2023-2023 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | * 6 | */ 7 | #ifndef _FCITX_UI_CLASSIC_COLORHELPER_H_ 8 | #define _FCITX_UI_CLASSIC_COLORHELPER_H_ 9 | 10 | #include "fcitx-utils/color.h" 11 | 12 | namespace fcitx::classicui { 13 | 14 | Color accentForeground(const Color &accent); 15 | 16 | } 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /src/ui/classic/common.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2020-2020 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | * 6 | */ 7 | #ifndef _FCITX5_UI_CLASSIC_COMMON_H_ 8 | #define _FCITX5_UI_CLASSIC_COMMON_H_ 9 | 10 | #include 11 | #include "fcitx-utils/log.h" 12 | #include "fcitx-utils/misc.h" 13 | 14 | namespace fcitx::classicui { 15 | 16 | template 17 | using GObjectUniquePtr = UniqueCPtr; 18 | 19 | FCITX_DECLARE_LOG_CATEGORY(classicui_logcategory); 20 | #define CLASSICUI_DEBUG() \ 21 | FCITX_LOGC(::fcitx::classicui::classicui_logcategory, Debug) 22 | #define CLASSICUI_ERROR() \ 23 | FCITX_LOGC(::fcitx::classicui::classicui_logcategory, Error) 24 | #define CLASSICUI_INFO() \ 25 | FCITX_LOGC(::fcitx::classicui::classicui_logcategory, Info) 26 | 27 | } // namespace fcitx::classicui 28 | 29 | #endif // _FCITX5_UI_CLASSIC_COMMON_H_ 30 | -------------------------------------------------------------------------------- /src/ui/classic/plasmathemewatchdog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2022~2022 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | * 6 | */ 7 | #ifndef _FCITX5_UI_CLASSIC_PLASMATHEMEWATCHDOG_H_ 8 | #define _FCITX5_UI_CLASSIC_PLASMATHEMEWATCHDOG_H_ 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include "fcitx-utils/event.h" 15 | #include "fcitx-utils/eventloopinterface.h" 16 | #include "fcitx-utils/unixfd.h" 17 | 18 | namespace fcitx::classicui { 19 | 20 | class PlasmaThemeWatchdog { 21 | public: 22 | PlasmaThemeWatchdog(EventLoop *event, std::function callback); 23 | 24 | ~PlasmaThemeWatchdog(); 25 | 26 | bool isRunning() const { return running_; } 27 | 28 | static bool isAvailable(); 29 | 30 | private: 31 | void cleanup(); 32 | std::function callback_; 33 | UnixFD monitorFD_; 34 | std::unique_ptr ioEvent_; 35 | std::unique_ptr timerEvent_; 36 | pid_t generator_ = 0; 37 | bool destruct_ = false; 38 | bool running_ = false; 39 | }; 40 | 41 | } // namespace fcitx::classicui 42 | 43 | #endif // _FCITX5_UI_CLASSIC_PLASMATHEMEWATCHDOG_H_ 44 | -------------------------------------------------------------------------------- /src/ui/classic/themes/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(default) 2 | add_subdirectory(default-dark) 3 | -------------------------------------------------------------------------------- /src/ui/classic/themes/default-dark/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB IMAGE_FILES *.png) 2 | 3 | fcitx5_translate_desktop_file(theme-dark.conf.in theme.conf) 4 | 5 | install(FILES ${IMAGE_FILES} ${CMAKE_CURRENT_BINARY_DIR}/theme.conf DESTINATION ${FCITX_INSTALL_PKGDATADIR}/themes/default-dark 6 | COMPONENT config) 7 | -------------------------------------------------------------------------------- /src/ui/classic/themes/default-dark/arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/ui/classic/themes/default-dark/arrow.png -------------------------------------------------------------------------------- /src/ui/classic/themes/default-dark/next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/ui/classic/themes/default-dark/next.png -------------------------------------------------------------------------------- /src/ui/classic/themes/default-dark/prev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/ui/classic/themes/default-dark/prev.png -------------------------------------------------------------------------------- /src/ui/classic/themes/default-dark/radio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/ui/classic/themes/default-dark/radio.png -------------------------------------------------------------------------------- /src/ui/classic/themes/default/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB IMAGE_FILES *.png) 2 | 3 | fcitx5_translate_desktop_file(theme.conf.in theme.conf) 4 | 5 | install(FILES ${IMAGE_FILES} ${CMAKE_CURRENT_BINARY_DIR}/theme.conf DESTINATION ${FCITX_INSTALL_PKGDATADIR}/themes/default 6 | COMPONENT config) 7 | -------------------------------------------------------------------------------- /src/ui/classic/themes/default/arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/ui/classic/themes/default/arrow.png -------------------------------------------------------------------------------- /src/ui/classic/themes/default/next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/ui/classic/themes/default/next.png -------------------------------------------------------------------------------- /src/ui/classic/themes/default/prev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/ui/classic/themes/default/prev.png -------------------------------------------------------------------------------- /src/ui/classic/themes/default/radio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/src/ui/classic/themes/default/radio.png -------------------------------------------------------------------------------- /src/ui/classic/waylandshmwindow.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2017-2017 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | * 6 | */ 7 | #ifndef _FCITX_UI_CLASSIC_WAYLANDSHMWINDOW_H_ 8 | #define _FCITX_UI_CLASSIC_WAYLANDSHMWINDOW_H_ 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include "fcitx-utils/eventloopinterface.h" 15 | #include "buffer.h" 16 | #include "waylandui.h" 17 | #include "waylandwindow.h" 18 | 19 | namespace fcitx::classicui { 20 | 21 | class WaylandShmWindow : public WaylandWindow { 22 | public: 23 | WaylandShmWindow(WaylandUI *ui); 24 | ~WaylandShmWindow(); 25 | 26 | void destroyWindow(); 27 | cairo_surface_t *prerender() override; 28 | void render() override; 29 | void hide() override; 30 | 31 | private: 32 | void newBuffer(uint32_t width, uint32_t height); 33 | 34 | std::shared_ptr shm_; 35 | std::vector> buffers_; 36 | // Pointer to the current buffer. 37 | wayland::Buffer *buffer_ = nullptr; 38 | bool pending_ = false; 39 | std::unique_ptr deferEvent_; 40 | }; 41 | 42 | } // namespace fcitx::classicui 43 | 44 | #endif // _FCITX_UI_CLASSIC_WAYLANDSHMWINDOW_H_ 45 | -------------------------------------------------------------------------------- /src/ui/classic/window.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2016-2016 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | * 6 | */ 7 | 8 | #include "window.h" 9 | 10 | namespace fcitx::classicui { 11 | 12 | Window::Window() = default; 13 | 14 | void Window::resize(unsigned int width, unsigned int height) { 15 | width_ = width; 16 | height_ = height; 17 | } 18 | } // namespace fcitx::classicui 19 | -------------------------------------------------------------------------------- /src/ui/classic/window.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2016-2016 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | * 6 | */ 7 | #ifndef _FCITX_UI_CLASSIC_WINDOW_H_ 8 | #define _FCITX_UI_CLASSIC_WINDOW_H_ 9 | 10 | #include 11 | 12 | namespace fcitx::classicui { 13 | 14 | class Window { 15 | public: 16 | Window(); 17 | virtual ~Window() = default; 18 | 19 | int width() const { return width_; } 20 | int height() const { return height_; } 21 | virtual void resize(unsigned int width, unsigned int height); 22 | 23 | virtual cairo_surface_t *prerender() = 0; 24 | virtual void render() = 0; 25 | 26 | protected: 27 | unsigned int width_ = 100; 28 | unsigned int height_ = 100; 29 | }; 30 | 31 | } // namespace fcitx::classicui 32 | 33 | #endif // _FCITX_UI_CLASSIC_WINDOW_H_ 34 | -------------------------------------------------------------------------------- /src/ui/kimpanel/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_fcitx5_addon(kimpanel kimpanel.cpp) 2 | 3 | target_link_libraries(kimpanel 4 | Fcitx5::Core Fcitx5::Module::DBus Fcitx5::Module::XCB) 5 | install(TARGETS kimpanel DESTINATION "${FCITX_INSTALL_ADDONDIR}") 6 | configure_file(kimpanel.conf.in.in kimpanel.conf.in @ONLY) 7 | fcitx5_translate_desktop_file(${CMAKE_CURRENT_BINARY_DIR}/kimpanel.conf.in kimpanel.conf) 8 | install(FILES "${CMAKE_CURRENT_BINARY_DIR}/kimpanel.conf" DESTINATION "${FCITX_INSTALL_PKGDATADIR}/addon" 9 | COMPONENT config) 10 | 11 | -------------------------------------------------------------------------------- /src/ui/kimpanel/kimpanel.conf.in.in: -------------------------------------------------------------------------------- 1 | [Addon] 2 | Name=KDE Input Method Panel 3 | Type=@FCITX_ADDON_TYPE@ 4 | Library=libkimpanel 5 | Category=UI 6 | Version=@PROJECT_VERSION@ 7 | UIPriority=50 8 | OnDemand=True 9 | Configurable=True 10 | 11 | [Addon/Dependencies] 12 | 0=dbus:@PROJECT_VERSION@ 13 | 1=core:@PROJECT_VERSION@ 14 | 15 | [Addon/OptionalDependencies] 16 | 0=classicui:@PROJECT_VERSION@ 17 | -------------------------------------------------------------------------------- /src/ui/virtualkeyboard/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_fcitx5_addon(virtualkeyboard virtualkeyboard.cpp) 2 | 3 | target_link_libraries(virtualkeyboard 4 | Fcitx5::Core Fcitx5::Module::DBus Fcitx5::Module::NotificationItem) 5 | install(TARGETS virtualkeyboard DESTINATION "${FCITX_INSTALL_ADDONDIR}") 6 | configure_file(virtualkeyboard.conf.in.in virtualkeyboard.conf.in @ONLY) 7 | fcitx5_translate_desktop_file(${CMAKE_CURRENT_BINARY_DIR}/virtualkeyboard.conf.in virtualkeyboard.conf) 8 | install(FILES "${CMAKE_CURRENT_BINARY_DIR}/virtualkeyboard.conf" DESTINATION "${FCITX_INSTALL_PKGDATADIR}/addon" 9 | COMPONENT config) 10 | 11 | -------------------------------------------------------------------------------- /src/ui/virtualkeyboard/virtualkeyboard.conf.in.in: -------------------------------------------------------------------------------- 1 | [Addon] 2 | Name=DBus Virtual Keyboard 3 | Comment=A virtual keyboard backend based on DBus 4 | Type=@FCITX_ADDON_TYPE@ 5 | Library=libvirtualkeyboard 6 | Category=UI 7 | Version=@PROJECT_VERSION@ 8 | UIPriority=0 9 | OnDemand=True 10 | UIType=OnScreenKeyboard 11 | 12 | [Addon/Dependencies] 13 | 0=dbus 14 | 1=core:@PROJECT_VERSION@ 15 | -------------------------------------------------------------------------------- /test/addon/dummyaddon.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2016-2016 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | * 6 | */ 7 | 8 | #include "fcitx-utils/metastring.h" 9 | #include "fcitx/addonfactory.h" 10 | #include "fcitx/addoninstance.h" 11 | #include "dummyaddon_public.h" 12 | 13 | class DummyAddon : public fcitx::AddonInstance { 14 | public: 15 | int addOne(int a) { return a + 1; } 16 | 17 | const Data &testCopy() { return data_; } 18 | 19 | FCITX_ADDON_EXPORT_FUNCTION(DummyAddon, addOne); 20 | FCITX_ADDON_EXPORT_FUNCTION(DummyAddon, testCopy); 21 | 22 | private: 23 | Data data_; 24 | }; 25 | 26 | class DummyAddonFactory : public fcitx::AddonFactory { 27 | fcitx::AddonInstance *create(fcitx::AddonManager *) override { 28 | return new DummyAddon; 29 | } 30 | }; 31 | 32 | FCITX_ADDON_FACTORY_V2_BACKWARDS(dummyaddon, DummyAddonFactory) 33 | -------------------------------------------------------------------------------- /test/addon/dummyaddon_public.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2016-2016 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | * 6 | */ 7 | #ifndef _DUMMYADDON_PUBLIC_H_ 8 | #define _DUMMYADDON_PUBLIC_H_ 9 | 10 | #include "fcitx-utils/metastring.h" 11 | #include "fcitx/addoninstance.h" 12 | 13 | class Data { 14 | public: 15 | Data() {} 16 | Data(const Data &) : copy_(true) {} 17 | 18 | bool isCopy() const { return copy_; } 19 | 20 | private: 21 | const bool copy_ = false; 22 | }; 23 | 24 | FCITX_ADDON_DECLARE_FUNCTION(DummyAddon, addOne, int(int)); 25 | FCITX_ADDON_DECLARE_FUNCTION(DummyAddon, testCopy, const Data &()); 26 | 27 | #endif // _DUMMYADDON_PUBLIC_H_ 28 | -------------------------------------------------------------------------------- /test/addon/dummyaddondeps.cpp: -------------------------------------------------------------------------------- 1 | #include "fcitx-utils/log.h" 2 | 3 | FCITX_DEFINE_LOG_CATEGORY(dummyaddondeps, "dummyaddondeps"); 4 | 5 | static int init = []() { 6 | fcitx::Log::setLogRule("default=3"); 7 | return 0; 8 | }(); 9 | -------------------------------------------------------------------------------- /test/addon/fcitx5/addon/testfrontend.conf: -------------------------------------------------------------------------------- 1 | [Addon] 2 | Name=testfrontend 3 | Type=SharedLibrary 4 | Library=libtestfrontend 5 | Category=Frontend 6 | 7 | [Addon/Dependencies] 8 | 0=core:@PROJECT_VERSION@ 9 | -------------------------------------------------------------------------------- /test/addon/fcitx5/addon/testim.conf: -------------------------------------------------------------------------------- 1 | [Addon] 2 | Name=testim 3 | Type=StaticLibrary 4 | Category=InputMethod 5 | 6 | [Addon/Dependencies] 7 | 0=core:@PROJECT_VERSION@ 8 | -------------------------------------------------------------------------------- /test/addon/fcitx5/data/QuickPhrase.mb: -------------------------------------------------------------------------------- 1 | ABCD abcd 2 | -------------------------------------------------------------------------------- /test/addon/fcitx5/data/quickphrase.d/test-disable.mb: -------------------------------------------------------------------------------- 1 | DEF G 2 | -------------------------------------------------------------------------------- /test/addon/fcitx5/data/quickphrase.d/test-disable.mb.disable: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /test/addon/fcitx5/data/quickphrase.d/test.mb: -------------------------------------------------------------------------------- 1 | ABC DEF 2 | -------------------------------------------------------------------------------- /test/addon2/fcitx5/addon/dummyaddon.conf: -------------------------------------------------------------------------------- 1 | [Addon] 2 | Name=dummyaddon 3 | Type=SharedLibrary 4 | Library=libdummyaddon 5 | Category=Module 6 | Version=1.0.0 7 | -------------------------------------------------------------------------------- /test/addon2/fcitx5/addon/dummyaddon2.conf: -------------------------------------------------------------------------------- 1 | [Addon] 2 | Name=dummyaddon2 3 | Type=SharedLibrary 4 | Library=libdummyaddondeps;libdummyaddon 5 | Category=Module 6 | 7 | [Addon/Dependencies] 8 | 0=dummyaddon:0.1.0 9 | 10 | [Addon/OptionalDependencies] 11 | 0=dummyaddon:2.1.1 12 | -------------------------------------------------------------------------------- /test/addon2/fcitx5/addon/dummyaddon3.conf: -------------------------------------------------------------------------------- 1 | [Addon] 2 | Name=dummyaddon3 3 | Type=SharedLibrary 4 | Library=libdummyaddon 5 | Category=Module 6 | 7 | [Addon/Dependencies] 8 | 0=dummyaddon:2.0.0 9 | -------------------------------------------------------------------------------- /test/dbus_wrapper.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | finish() 4 | { 5 | if [ -n "$DBUS_SESSION_BUS_PID" ]; then 6 | kill "$DBUS_SESSION_BUS_PID" || exit 1 7 | fi 8 | if [ -n "$ADDRESS_FILE" ]; then 9 | rm -f -- "$ADDRESS_FILE" 10 | fi 11 | if [ -n "$PID_FILE" ]; then 12 | rm -f -- "$PID_FILE" 13 | fi 14 | } 15 | 16 | ADDRESS_FILE= 17 | PID_FILE= 18 | 19 | trap finish EXIT 20 | 21 | ADDRESS_FILE=$(mktemp -p "$PWD" dbus-session-bus-address.XXXXXX) 22 | PID_FILE=$(mktemp -p "$PWD" dbus-session-bus-pid.XXXXXX) 23 | 24 | DBUS_DAEMON=$1 25 | shift 26 | 27 | "$DBUS_DAEMON" --fork --session --print-address=3 --print-pid=4 \ 28 | 3> "$ADDRESS_FILE" 4> "$PID_FILE" || exit 1 29 | 30 | DBUS_SESSION_BUS_ADDRESS=$(cat "$ADDRESS_FILE") 31 | DBUS_SESSION_BUS_PID=$(cat "$PID_FILE") 32 | 33 | export DBUS_SESSION_BUS_ADDRESS 34 | 35 | "$@" 36 | RET=$? 37 | exit $RET 38 | -------------------------------------------------------------------------------- /test/eventlooptests.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2024-2024 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | * 6 | */ 7 | 8 | #ifndef _TEST_EVENTLOOPTESTS_H_ 9 | #define _TEST_EVENTLOOPTESTS_H_ 10 | 11 | void runAllEventLoopTests(); 12 | 13 | #endif -------------------------------------------------------------------------------- /test/invalid_uuid: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx5/6689c540222825f6f780e01428d2b9a2666cfc83/test/invalid_uuid -------------------------------------------------------------------------------- /test/testconfigdbus.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2017-2017 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | * 6 | */ 7 | 8 | #include 9 | #include "fcitx-config/dbushelper.h" 10 | #include "fcitx-config/iniparser.h" 11 | #include "fcitx-config/rawconfig.h" 12 | #include "fcitx-utils/dbus/variant.h" 13 | #include "fcitx-utils/log.h" 14 | #include "testconfig.h" 15 | 16 | using namespace fcitx; 17 | 18 | int main() { 19 | 20 | RawConfig config; 21 | *config.get("OptionA/SubOptionB", true) = "abc"; 22 | *config.get("OptionC", true) = "def"; 23 | 24 | auto map = rawConfigToVariant(config); 25 | FCITX_INFO() << map; 26 | 27 | RawConfig config2 = variantToRawConfig(map); 28 | FCITX_ASSERT(config == config2); 29 | 30 | writeAsIni(config2, STDOUT_FILENO); 31 | 32 | RawConfig desc; 33 | TestConfig testconfig; 34 | testconfig.dumpDescription(desc); 35 | FCITX_INFO() << dumpDBusConfigDescription(testconfig); 36 | 37 | return 0; 38 | } 39 | -------------------------------------------------------------------------------- /test/testdir.h.in: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2017~2017 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | */ 6 | #ifndef _TEST_TESTDIR_H_ 7 | #define _TEST_TESTDIR_H_ 8 | 9 | #define FCITX5_SOURCE_DIR "@PROJECT_SOURCE_DIR@" 10 | #define FCITX5_BINARY_DIR "@CMAKE_BINARY_DIR@" 11 | 12 | #endif // _TEST_TESTDIR_H_ 13 | -------------------------------------------------------------------------------- /test/testenviron.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2025~2025 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | * 6 | */ 7 | 8 | #include 9 | #include "fcitx-utils/environ.h" 10 | #include "fcitx-utils/log.h" 11 | 12 | int main() { 13 | fcitx::setEnvironment("TEST_VAR", "TEST_VALUE"); 14 | FCITX_ASSERT(fcitx::getEnvironment("TEST_VAR") == "TEST_VALUE"); 15 | FCITX_ASSERT(fcitx::getEnvironment("__BAD_VAR") == std::nullopt); 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /test/testevent.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2015-2024 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | * 6 | */ 7 | #include "eventlooptests.h" 8 | 9 | int main() { 10 | runAllEventLoopTests(); 11 | return 0; 12 | } -------------------------------------------------------------------------------- /test/testflags.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2017-2017 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | * 6 | */ 7 | #include "fcitx-utils/flags.h" 8 | #include "fcitx-utils/log.h" 9 | 10 | using namespace fcitx; 11 | 12 | enum class F { F1 = 1, F2 = 2, F3 = 4 }; 13 | 14 | int main() { 15 | Flags f{F::F1, F::F3}; 16 | FCITX_ASSERT(f.test(F::F1)); 17 | FCITX_ASSERT(!f.test(F::F2)); 18 | FCITX_ASSERT(f.test(F::F3)); 19 | FCITX_ASSERT(f.testAny(F::F1)); 20 | FCITX_ASSERT(f.testAny(Flags{F::F1, F::F2})); 21 | FCITX_ASSERT(f.testAny(F::F3)); 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /test/testi18nstring.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2015-2015 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | * 6 | */ 7 | #include "fcitx-utils/i18nstring.h" 8 | #include "fcitx-utils/log.h" 9 | 10 | using namespace fcitx; 11 | 12 | int main() { 13 | I18NString s; 14 | s.set("TEST1", "zh"); 15 | s.set("TEST2", "zh_CN"); 16 | s.set("TEST3"); 17 | 18 | FCITX_ASSERT("TEST2" == s.match("zh_CN@whatever")); 19 | FCITX_ASSERT("TEST2" == s.match("zh_CN")); 20 | FCITX_ASSERT("TEST1" == s.match("zh_TW")); 21 | FCITX_ASSERT("TEST2" == s.match("zh_CN.UTF-8")); 22 | FCITX_ASSERT("TEST2" == s.match("zh_CN.utf8")); 23 | FCITX_ASSERT("TEST3" == s.match("")); 24 | FCITX_ASSERT("TEST3" == s.match("en")); 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /test/testisocodes.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2020-2020 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | * 6 | */ 7 | #include "fcitx-utils/log.h" 8 | #include "config.h" 9 | #include "im/keyboard/isocodes.h" 10 | 11 | using namespace fcitx; 12 | 13 | int main() { 14 | IsoCodes isocodes; 15 | isocodes.read(ISOCODES_ISO639_JSON, ISOCODES_ISO3166_JSON); 16 | const auto *entry = isocodes.entry("eng"); 17 | FCITX_ASSERT(entry); 18 | FCITX_ASSERT(entry->iso_639_1_code == "en"); 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /test/testlibrary.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2016-2016 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | * 6 | */ 7 | 8 | #include 9 | #include "fcitx-utils/library.h" 10 | #include "fcitx-utils/log.h" 11 | 12 | #define DATA "AAAAAAAAA" 13 | #define MAGIC "MAGIC_TEST_DATA" 14 | 15 | #if defined(_WIN32) 16 | #define MY_EXPORT __declspec(dllexport) 17 | #else 18 | #define MY_EXPORT __attribute__((visibility("default"))) 19 | #endif 20 | 21 | extern "C" { 22 | MY_EXPORT char magic_test[] = MAGIC DATA; 23 | 24 | MY_EXPORT int func() { return 0; } 25 | } 26 | 27 | void parser(const char *data) { FCITX_ASSERT(strcmp(data, DATA) == 0); } 28 | 29 | int main() { 30 | fcitx::Library lib; 31 | FCITX_ASSERT(lib.load(fcitx::LibraryLoadHint::DefaultHint)); 32 | FCITX_ASSERT(func == lib.resolve("func")); 33 | FCITX_ASSERT(lib.findData("magic_test", MAGIC, strlen(MAGIC), parser)); 34 | 35 | FCITX_ASSERT(lib.unload()); 36 | 37 | return 0; 38 | } 39 | -------------------------------------------------------------------------------- /test/testlog.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2017-2017 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | * 6 | */ 7 | #include 8 | #include "fcitx-utils/log.h" 9 | #include "fcitx-utils/metastring.h" 10 | 11 | int main() { 12 | int a = 0; 13 | fcitx::Log::setLogRule("*=5"); 14 | 15 | FCITX_INFO() << (a = 1); 16 | FCITX_ASSERT(a == 1); 17 | 18 | fcitx::Log::setLogRule("*=4"); 19 | FCITX_DEBUG() << (a = 2); 20 | FCITX_ASSERT(a == 1); 21 | 22 | std::vector vec{1, 2, 3}; 23 | FCITX_INFO() << vec; 24 | 25 | std::unordered_map map{{1, 1}, {2, 3}}; 26 | FCITX_INFO() << map; 27 | 28 | FCITX_INFO() << std::make_tuple(1, 3, "a", false); 29 | 30 | std::stringstream s; 31 | fcitx::Log::setLogStream(s); 32 | FCITX_INFO() << "ABCD"; 33 | fcitx::Log::setLogStream(std::cerr); 34 | 35 | FCITX_ASSERT(s.str().find("ABCD") != std::string::npos); 36 | 37 | return 0; 38 | } 39 | -------------------------------------------------------------------------------- /test/testmenu.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2016-2016 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | * 6 | */ 7 | 8 | #include "fcitx-utils/log.h" 9 | #include "fcitx/menu.h" 10 | 11 | using namespace fcitx; 12 | 13 | int main() { 14 | { 15 | auto menu = std::make_unique(); 16 | { 17 | SimpleAction a; 18 | menu->addAction(&a); 19 | FCITX_ASSERT(menu->actions().size() == 1); 20 | } 21 | FCITX_ASSERT(menu->actions().empty()); 22 | SimpleAction a2; 23 | menu->addAction(&a2); 24 | FCITX_ASSERT(menu->actions().size() == 1); 25 | menu.reset(); 26 | } 27 | { 28 | auto menu = std::make_unique(); 29 | SimpleAction a; 30 | a.setMenu(menu.get()); 31 | menu.reset(); 32 | FCITX_ASSERT(a.menu() == nullptr); 33 | } 34 | return 0; 35 | } 36 | -------------------------------------------------------------------------------- /test/testxkbrules.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2016-2016 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | * 6 | */ 7 | 8 | #include "config.h" 9 | #include "im/keyboard/xkbrules.h" 10 | 11 | int main() { 12 | fcitx::XkbRules xkbRules; 13 | xkbRules.read({XKEYBOARDCONFIG_XKBBASE}, DEFAULT_XKB_RULES, {}); 14 | xkbRules.dump(); 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /test/uuid: -------------------------------------------------------------------------------- 1 | 42f9a33a-b4b8-43ca-ae70-6abb89d9340c 2 | -------------------------------------------------------------------------------- /test/xvfb_wrapper.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | XVFB_DISPLAY=:9345 4 | 5 | XVFB=$1 6 | shift 7 | 8 | "$XVFB" $XVFB_DISPLAY & 9 | 10 | XVFB_PID=$! 11 | export DISPLAY=$XVFB_DISPLAY 12 | 13 | finish() 14 | { 15 | if [ -n "$XVFB_PID" ]; then 16 | kill $XVFB_PID >/dev/null 2>&1 17 | wait $XVFB_PID 18 | fi 19 | } 20 | 21 | trap finish EXIT 22 | 23 | if which xprop >/dev/null 2>&1; then 24 | i=1 25 | while [ "$i" -lt 5 ]; do 26 | if xprop -root >/dev/null 2>&1; then 27 | break 28 | else 29 | echo "Can't connect to Xvfb, retrying..." 30 | sleep "$i" 31 | fi 32 | i=$((i + 1)) 33 | done 34 | if [ "$i" -eq 6 ]; then 35 | exit 1 36 | fi 37 | else 38 | sleep 1 39 | fi 40 | 41 | "$@" 42 | RET=$? 43 | exit $RET 44 | -------------------------------------------------------------------------------- /testing/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(testfrontend) 2 | add_subdirectory(testim) 3 | add_subdirectory(testui) 4 | -------------------------------------------------------------------------------- /testing/testfrontend/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_fcitx5_addon(testfrontend testfrontend.cpp) 2 | 3 | target_link_libraries(testfrontend 4 | Fcitx5::Core) 5 | install(TARGETS testfrontend DESTINATION "${FCITX_INSTALL_ADDONDIR}") 6 | install(FILES testfrontend.conf DESTINATION "${FCITX_INSTALL_PKGDATADIR}/testing/addon") 7 | 8 | fcitx5_export_module(TestFrontend TARGET testfrontend BUILD_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}" HEADERS testfrontend_public.h INSTALL) 9 | -------------------------------------------------------------------------------- /testing/testfrontend/testfrontend.conf: -------------------------------------------------------------------------------- 1 | [Addon] 2 | Name=testfrontend 3 | Type=SharedLibrary 4 | Library=libtestfrontend 5 | Category=Frontend 6 | 7 | [Addon/Dependencies] 8 | 0=core:@PROJECT_VERSION@ 9 | -------------------------------------------------------------------------------- /testing/testfrontend/testfrontend_public.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2020-2020 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | * 6 | */ 7 | #ifndef _TESTFRONTEND_TESTFRONTEND_PUBLIC_H_ 8 | #define _TESTFRONTEND_TESTFRONTEND_PUBLIC_H_ 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | FCITX_ADDON_DECLARE_FUNCTION(TestFrontend, createInputContext, 16 | ICUUID(const std::string &)); 17 | 18 | FCITX_ADDON_DECLARE_FUNCTION(TestFrontend, destroyInputContext, void(ICUUID)); 19 | 20 | FCITX_ADDON_DECLARE_FUNCTION(TestFrontend, keyEvent, 21 | void(ICUUID, const Key &, bool isRelease)); 22 | 23 | FCITX_ADDON_DECLARE_FUNCTION(TestFrontend, sendKeyEvent, 24 | bool(ICUUID, const Key &, bool isRelease)); 25 | 26 | FCITX_ADDON_DECLARE_FUNCTION(TestFrontend, pushCommitExpectation, 27 | void(std::string)); 28 | 29 | #endif // _TESTFRONTEND_TESTFRONTEND_PUBLIC_H_ 30 | -------------------------------------------------------------------------------- /testing/testim/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_fcitx5_addon(testim testim.cpp) 2 | 3 | target_link_libraries(testim 4 | Fcitx5::Core) 5 | install(TARGETS testim DESTINATION "${FCITX_INSTALL_ADDONDIR}") 6 | install(FILES testim.conf DESTINATION "${FCITX_INSTALL_PKGDATADIR}/testing/addon") 7 | 8 | fcitx5_export_module(TestIM TARGET testim BUILD_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}" HEADERS testim_public.h INSTALL) 9 | -------------------------------------------------------------------------------- /testing/testim/testim.conf: -------------------------------------------------------------------------------- 1 | [Addon] 2 | Name=testim 3 | Type=SharedLibrary 4 | Library=libtestim 5 | Category=InputMethod 6 | 7 | [Addon/Dependencies] 8 | 0=core:@PROJECT_VERSION@ 9 | -------------------------------------------------------------------------------- /testing/testim/testim.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2020-2020 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | * 6 | */ 7 | #include "testim.h" 8 | #include "fcitx/addonfactory.h" 9 | #include "fcitx/addonmanager.h" 10 | 11 | namespace fcitx { 12 | 13 | TestIM::TestIM(Instance *instance) : instance_(instance) {} 14 | 15 | TestIM::~TestIM() {} 16 | 17 | void TestIM::keyEvent(const InputMethodEntry &entry, KeyEvent &keyEvent) { 18 | FCITX_INFO() << "IM " << entry.uniqueName() 19 | << " received event: " << keyEvent.key().toString() 20 | << keyEvent.isRelease(); 21 | if (handler_) { 22 | handler_(entry, keyEvent); 23 | } 24 | } 25 | 26 | class TestIMFactory : public AddonFactory { 27 | public: 28 | AddonInstance *create(AddonManager *manager) override { 29 | return new TestIM(manager->instance()); 30 | } 31 | }; 32 | 33 | } // namespace fcitx 34 | 35 | FCITX_ADDON_FACTORY_V2(testim, fcitx::TestIMFactory); 36 | -------------------------------------------------------------------------------- /testing/testim/testim_public.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2020-2020 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | * 6 | */ 7 | #ifndef _TESTIM_TESTIM_PUBLIC_H_ 8 | #define _TESTIM_TESTIM_PUBLIC_H_ 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | FCITX_ADDON_DECLARE_FUNCTION( 16 | TestIM, setHandler, 17 | void(std::function)); 19 | 20 | #endif // _TESTIM_TESTIM_PUBLIC_H_ 21 | -------------------------------------------------------------------------------- /testing/testui/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_fcitx5_addon(testui testui.cpp) 2 | 3 | target_link_libraries(testui 4 | Fcitx5::Core) 5 | install(TARGETS testui DESTINATION "${FCITX_INSTALL_ADDONDIR}") 6 | install(FILES testui.conf DESTINATION "${FCITX_INSTALL_PKGDATADIR}/testing/addon") 7 | 8 | -------------------------------------------------------------------------------- /testing/testui/testui.conf: -------------------------------------------------------------------------------- 1 | [Addon] 2 | Name=Simple UI for testing 3 | Type=SharedLibrary 4 | Library=libtestui 5 | Category=UI 6 | 7 | [Addon/Dependencies] 8 | 0=core:@PROJECT_VERSION@ 9 | -------------------------------------------------------------------------------- /testing/testui/testui.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2017-2017 CSSlayer 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | * 6 | */ 7 | #ifndef _FCITX_UI_TEST_TESTUI_H_ 8 | #define _FCITX_UI_TEST_TESTUI_H_ 9 | 10 | #include "fcitx/instance.h" 11 | #include "fcitx/userinterface.h" 12 | 13 | namespace fcitx { 14 | 15 | class TestUI : public UserInterface { 16 | public: 17 | TestUI(Instance *instance); 18 | ~TestUI(); 19 | 20 | Instance *instance() { return instance_; } 21 | void suspend() override; 22 | void resume() override; 23 | bool available() override { return true; } 24 | void update(UserInterfaceComponent component, 25 | InputContext *inputContext) override; 26 | 27 | private: 28 | void printStatusArea(InputContext *inputContext); 29 | void printInputPanel(InputContext *inputContext); 30 | 31 | Instance *instance_; 32 | bool suspended_ = true; 33 | }; 34 | } // namespace fcitx 35 | 36 | #endif // _FCITX_UI_TEST_TESTUI_H_ 37 | --------------------------------------------------------------------------------