当前位置:网站首页>Development and application of fcitx functional plug-ins
Development and application of fcitx functional plug-ins
2022-07-03 23:50:00 【Manon Feifei】
Fcitx Add plug-ins to the framework
Fcitx Plug ins can be divided into four categories :
1.Frontend
2.Input Method
3.Module
4.User Interface
Frontend The plug-in is responsible for the interface key message and passing the message to Fcitx frame ,
InputMethod Plug ins are responsible for converting keyboard input into their language information , That is, the core module of input method
Module It is a general module , Various functions can be realized by registering hooks
User interface The module is responsible for displaying various UI Elements
If the plug-in needs a configuration file , The plug-in should first provide a configuration description file , The name of the file should be the same as that of the plug-in . If the plug-in needs a series of sub configuration files , Or text files , The description file of the plug-in should contain SubConfig Field is used to match various file names .
The format of the plug-in description file is as follows :
[Addon]
Name=fcitx-table
_GeneralName=Table
_Comment=Table Input Method for Fcitx
Category=InputMethod
Enabled=True
Library=fcitx-table.so
Type=SharedLibrary
Dependency=fcitx-pinyin,fcitx-punc
SubConfig=Table:configfile:table/*.conf:table.desc,fcitx:domainfcitx-table The plug-in has multiple configuration files , The format of the sub configuration is as follows :
SuConfig=SubConfig1,SubConfig2,...The definition format of each sub configuration is as follows :
Name:type:descriptionThe current configuration type can be :configfile, native,domain
native Format configuration file defines a simple text file name in the description , File names do not support fuzzy matching characters .
configfile The profile name described in the profile description of format supports fuzzy matching symbols
domian The format configuration file defines the text translation of the module .
configfile and natvie The names of are translatable , The corresponding translation content should be configured in domain In the sub configuration of .
How to achieve fcitx Of user interface modular
If there is no special need , Actually fcitx It is not recommended to realize a brand new user interface Modular , Because of the existing fcitx There are already three in the framework User Interface Module . Namely :
1.fcitx-classic-ui
2. be based on DBus Of fcitx-kimpanel-ui
3.fcitx-light-ui
To implement the new user interface module , It is best to use with kimpanel Compatible protocols , Do not modify fcitx Agreement of .
In the custom User Interface In the plug-in, we first need to define the interfaces of the plug-in :
// Define the name of the plug-in , Field , And type
// The name is feifei_ui, The field is ui field , The type is FcitxUI
FCITX_DEFINE_PLUGIN(feifei_ui, ui, FcitxUI) = {
FeifeiUICreate, //UI Built callback function
FeifeiUICloseInputWindow, // Close the callback of the input window
FeifeiUIShowInputWindow, // Display the callback of the input window
FeifeiUIMoveInputWindow, // Move the callback of the input window
FeifeiUIUpdateStatus, // to update UI Status callback
FeifeiUIRegisterStatus, // register UI Status callback
FeifeiUIRegisterMenu, // register UI Menu callback
FeifeiUIOnInputFocus, // Callback to get focus
FeifeiUIOnInputUnFocus, // A callback that loses focus
FeifeiUIOnTriggerOn, // Activated callback
FeifeiUIOnTriggerOff, // Closed callback
NULL, // Show message callback ( Ban )
FeifeiUIMainWindowSizeHint, // Get the callback of the main window size
ReloadConfigFeifeiUI, // Reload the configured callback
FeifeiUISuspend, // Pause the callback of switching
FeifeiUIResume, // Callback to resume from pause
NULL, // The destruction user interface The callback
FeifeiUIRegisterComplexStatus, // Register complex status
FeifeiUIUpdateComplexStatus, // Update complex status
FeifeiUIUnRegisterMenu, // Registration menu
};stay CMakeLists.txt Through the file fcitx_addon_full Interface to declare the information of the plug-in
fcitx_add_addon_full(feifei-ui DESC SCAN SCAN_PRIV ${kimpanel_noinstall}
HEADER_DIR feifeiui
FXADDON_SRC fcitx-feifeiui.fxaddon
FXADDON_GEN fcitx-feifeiui.h
SOURCES ${FEIFEI_KIMPANEL_UI_SOURCES}
HEADERS feifeiinterface.h
LINK_LIBS ${FEIFEI_KIMPANEL_LINK_LIBS}
EXTRA_DESC skin.desc
EXTRA_PO fcitx-skin-installer.desktop.in fcitx-skin-installer.sh)
//DESC Parameter determines the of installing the plug-in desc file , With desc The path of the configuration file with suffix ,
// adopt DESC_SRC To make sure
//SCAN Parameter generation API The header file , The name of the generated header file is passed FXADDON_GEN Parameters to determine
// The path of the input file passes FXADDON_SRC Parameters to determine ,
//SCAN_PRIV Generate the added function header file , The path of the input file passes FXADDON_SRC Parameters to determine ,
// The generated header file passes ADDFUNCTIONS_GEN Parameter determination
//NO_INSTALL Do not install any files when the module is disabled , Nor compile any resources , But what needs to be produced
// The header file
//SCAN_IN adopt .in File generation api The header file ,fxaddon.in The path of the file passes FXADDON_SRC Parameters
// To make sure . The name of the generated header file passes through the parameter FXADDON_GEN To make sure
//HEADR_DIR fcitx/module A subdirectory under a directory , The header file of the plug-in will be installed in this directory
//LIB_NAME: The binary name of the plug-in defaults to (fcitx_${short_name})
//CONF_SRC: plug-in unit conf Path to file ( No, .in suffix ), The default is fxitx-${short_name}.desc
//DESC_SRC: plug-in unit desc The path to the configuration file
//UNIQUE_NAME: Unique name of the plug-in , The default is fcitx-${short_name}
/******** The following are multivalued parameters ******/
//SOURCES: The plug-in needs to compile the source file
//HEADER: The plug-in needs to install the header file ( The generated parameters are not included )
//EXTRA_DESC: Additional DESC Parameters
//EXTRA_PO: Additional files for browsing string translations
//EXTRA_LIBS Additional library files you need to rely on
//DEPENDS: Some other files that the plug-in needs to rely on
//IM_CONFIG: IME profile 边栏推荐
- How to make icons easily
- Kubedl hostnetwork: accelerating the efficiency of distributed training communication
- Ramble 72 of redis source code
- Iclr2022: how does AI recognize "things I haven't seen"?
- Apple released a supplementary update to MacOS Catalina 10.15.5, which mainly fixes security vulnerabilities
- Gossip about redis source code 74
- How to write a good title of 10w+?
- How to solve the "safe startup function prevents the operating system from starting" prompt when installing windows10 on parallel desktop?
- 网上的低佣金链接安全吗?招商证券怎么开户?
- Report on prospects and future investment recommendations of China's assisted reproductive industry, 2022-2028 Edition
猜你喜欢

"Learning notes" recursive & recursive

Unity shader visualizer shader graph

Ningde times and BYD have refuted rumors one after another. Why does someone always want to harm domestic brands?

leetcode-43. String multiplication

2022 free examination questions for hoisting machinery command and hoisting machinery command theory examination

Ningde times and BYD have refuted rumors one after another. Why does someone always want to harm domestic brands?

NLP pre training technology development

Apple released a supplementary update to MacOS Catalina 10.15.5, which mainly fixes security vulnerabilities

Yyds dry goods inventory three JS source code interpretation - getobjectbyproperty method

Alibaba cloud container service differentiation SLO hybrid technology practice
随机推荐
Gossip about redis source code 75
C # basic knowledge (2)
What is the Valentine's Day gift given by the operator to the product?
Analysis of refrigeration and air conditioning equipment operation in 2022 and examination question bank of refrigeration and air conditioning equipment operation
The interviewer's biggest lie to deceive you, bypassing three years of less struggle
D23:multiple of 3 or 5 (multiple of 3 or 5, translation + solution)
The difference between single power amplifier and dual power amplifier
Docking Alipay process [pay in person, QR code Payment]
Live app source code, jump to links outside the station or jump to pages inside the platform
Idea integrates Microsoft TFs plug-in
It is forbidden to splice SQL in code
Design of logic level conversion in high speed circuit
Ningde times and BYD have refuted rumors one after another. Why does someone always want to harm domestic brands?
Current detection circuit - including op amp current scheme
股票开户佣金最低的券商有哪些大家推荐一下,手机上开户安全吗
C summary of knowledge point definitions, summary notes
2022 free examination questions for hoisting machinery command and hoisting machinery command theory examination
[2021]NeRF in the Wild: Neural Radiance Fields for Unconstrained Photo Collections
Make small tip
Correlation analysis summary