当前位置:网站首页>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 边栏推荐
- 2022 Guangdong Provincial Safety Officer a certificate third batch (main person in charge) simulated examination and Guangdong Provincial Safety Officer a certificate third batch (main person in charg
- D28:maximum sum (maximum sum, translation)
- C # basic knowledge (2)
- Vscode regular match replace console log(.*)
- Idea a method for starting multiple instances of a service
- P1339 [USACO09OCT]Heat Wave G
- [about text classification trick] things you don't know
- IO flow principle and classification
- Subgraph isomorphism -subgraph isomorphism
- Gossip about redis source code 83
猜你喜欢

How to understand the gain bandwidth product operational amplifier gain

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

A method to solve Bert long text matching

X Opencv feature point detection and matching

Vscode regular match replace console log(.*)
![Docking Alipay process [pay in person, QR code Payment]](/img/30/665580241020ee3adb872e725f0624.jpg)
Docking Alipay process [pay in person, QR code Payment]

Amway by head has this project management tool to improve productivity in a straight line

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

Loop compensation - explanation and calculation of first-order, second-order and op amp compensation

2022.02.14
随机推荐
EPF: a fuzzy testing framework for network protocols based on evolution, protocol awareness and coverage guidance
[note] glide process and source code analysis
Correlation analysis summary
Interpretation of corolla sub low configuration, three cylinder power configuration, CVT fuel saving and smooth, safety configuration is in place
Gossip about redis source code 82
网上的低佣金链接安全吗?招商证券怎么开户?
Subgraph isomorphism -subgraph isomorphism
[Mongodb] 2. Use mongodb --------- use compass
Ningde times and BYD have refuted rumors one after another. Why does someone always want to harm domestic brands?
How to make recv have a little temper?
NLP pre training technology development
Idea integrates Microsoft TFs plug-in
X Opencv feature point detection and matching
Gossip about redis source code 75
Report on the construction and development mode and investment mode of sponge cities in China 2022-2028
Open 2022 efficient office, starting from project management
Docking Alipay process [pay in person, QR code Payment]
Social network analysis -social network analysis
How to prevent malicious crawling of information by one-to-one live broadcast source server
2022 free examination questions for hoisting machinery command and hoisting machinery command theory examination