diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..ed2b2bc7 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,48 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v2.0.0-rc1] - 2024-02-10 + +### Added + +- On non-gnome desktop with systray icon enabled, IBus will display the + currently selected input mode. + +### Changed + +- IBus-Chewing Preferences has been rewritten in GTK4 and libadwaita. +- Removed GOB2 dependency. Now gobjects are written in plain C99. +- Removed cmake-fedora dependency. Now CMakeLists.txt only depends on built-in + modules. +- New CMake presets can be used for building with different configurations. + +### Deprecated + +- X11 support has been deprecated. IBus-chewing no longer requires X11 to build. + Running in X11 environment will continue to work as long as IBus still + supports X11/XIM. + +### Removed + +- GtkStatusIcon based systray icon has been removed. Now there is only one icon + provided by IBus to avoid confusion. +- Sync IM status back to CapsLock has been removed. + +### Fixed + +- Modifier key handling has been improved. Super key will no longer conflict + with desktop shortcut handling. +- Shift key handling in English mode has been improved. Now Shift+Arrow key will + work correctly for highlighting text or scroll window. +- Shift_L or Shift_R can be individually asssigned as Eng/Chi toggle key. + +## 1.x releases + +See [ChangeLog-1.x](./ChangeLog-1.x) + +[unreleased]: https://github.com/chewing/ibus-chewing/compare/1.6.2...HEAD +[v2.0.0-rc1]: https://github.com/chewing/ibus-chewing/compare/1.6.2...HEAD \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index c8f81cb1..553dc149 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.21.0) -project(ibus-chewing VERSION 1.6.2 LANGUAGES C) +project(ibus-chewing VERSION 2.0.0 LANGUAGES C) set(PRJ_SUMMARY "The Chewing engine for IBus input platform") set(SUMMARY_TRANSLATIONS "zh_TW" "IBus新酷音輸入法") @@ -27,8 +27,7 @@ set(MAINTAINER "Ding-Yi Chen ") set(VENDOR "Red Hat, APAC, Inc.") set(LICENSE "GPLv2+") set(PRJ_GROUP "System Environment/Libraries") -set(RPM_SPEC_URL "https://github.com/definite/${PROJECT_NAME}") -set(RPM_SPEC_SOURCES "https://github.com/definite/%{name}/releases/download/%{version}/%{name}-%{version}-Source.tar.gz") +set(RRJ_URL "https://github.com/chewing/${PROJECT_NAME}") enable_testing() include(GNUInstallDirs) @@ -51,6 +50,7 @@ pkg_check_modules(GTK4 REQUIRED IMPORTED_TARGET gtk4) pkg_check_modules(LIBADWAITA REQUIRED IMPORTED_TARGET libadwaita-1) find_program(GLIB_COMPILE_RESOURCES NAMES glib-compile-resources REQUIRED) +find_program(GLIB_COMPILE_SCHEMAS NAMES glib-compile-schemas) set(CMAKE_C_STANDARD 99) add_compile_definitions(_XOPEN_SOURCE) @@ -74,6 +74,7 @@ add_compile_definitions( DATA_DIR=${CMAKE_INSTALL_FULL_DATADIR} PRJ_DATA_DIR=${PRJ_DATA_DIR} PRJ_VER=${PRJ_VER} + PRJ_URL=${PRJ_URL} LIBEXEC_DIR=${LIBEXEC_DIR} CHEWING_DATADIR_REAL=${CHEWING_DATADIR_REAL} ) @@ -101,7 +102,7 @@ add_subdirectory(po) add_subdirectory(src bin) add_subdirectory(test) -install(FILES AUTHORS README.md ChangeLog COPYING USER-GUIDE +install(FILES AUTHORS README.md CHANGELOG.md ChangeLog-1.x COPYING USER-GUIDE DESTINATION ${CMAKE_INSTALL_DOCDIR}) install(FILES ${CMAKE_BINARY_DIR}/data/chewing.xml DESTINATION ${CMAKE_INSTALL_DATADIR}/ibus/component) diff --git a/ChangeLog b/ChangeLog-1.x similarity index 99% rename from ChangeLog rename to ChangeLog-1.x index 8f8df68d..1218bdb5 100644 --- a/ChangeLog +++ b/ChangeLog-1.x @@ -10,7 +10,7 @@ + GitHub Issue: #165 Support vertical lookup table and optimize turn page keys + GitHub Issue: #166 Tweak ibus-setup dialog window and replace some deprecated APIs + GitHub Issue: #167 Add dropdown menu for Chi-Eng-Mode toggle key -- Fix: +- Fix: + GitHub Issue: #130 Destroy *preEditText, *auxText and *outgoingText when disable to prevent leak + GitHub Issue: #144, 149 Ignore keystrokes in English mode - Acknowledge: diff --git a/README.md b/README.md index b1c5753c..b002f2a5 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,16 @@ Bugs and enhancement can be filed to either: * [GitHub ibus-chewing](https://github.com/definite/ibus-chewing/issues) +ibus-chewing releases can be verified with the following [minisign][] public key + + RWRzJFnXiLZleAyCIv1talBjyRewelcy9gzYQq9pd3SKSFBPoy57sf5s + +For example, to verify the 2.0.0 release + + minisign -Vm ibus-chewing-2.0.0-Source.tar.xz -P RWRzJFnXiLZleAyCIv1talBjyRewelcy9gzYQq9pd3SKSFBPoy57sf5s + +[minisign]: https://jedisct1.github.io/minisign/ + # Development We use LLVM coding style to make our review easier, so if you like to @@ -38,3 +48,9 @@ ln -s ../../pre-commit .git/hooks/pre-commit export G_MESSAGES_DEBUG=all ibus-daemon -rvx ``` + +# Translation + +There is a weblate instance at +https://translate.fedoraproject.org/projects/ibus-chewing/ for easier +contribution. \ No newline at end of file diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt deleted file mode 100644 index c9cf367e..00000000 --- a/RELEASE-NOTES.txt +++ /dev/null @@ -1,19 +0,0 @@ -PRJ_VER=1.6.2 -SUMMARY=Port to GTK+-3 and support selecting candidate by cursor -REDHAT_BUGZILLA= -[Changes] -- Enhancement: - + GitHub Issue: #119 Refresh property list (language bar) only when needed - + GitHub Issue: #122 Add a setup button to the ibus indicator (and the language bar) - + GitHub Issue: #131 Port to GTK+-3 - + GitHub Issue: #147 Use arrow keys to choose candidate - + GitHub Issue: #148 Display page number of the lookup table - + GitHub Issue: #152 Show cursor on lookup table - + GitHub Issue: #165 Support vertical lookup table and optimize turn page keys - + GitHub Issue: #166 Tweak ibus-setup dialog window and replace some deprecated APIs - + GitHub Issue: #167 Add dropdown menu for Chi-Eng-Mode toggle key - -- Fix: - + GitHub Issue: #130 Destroy *preEditText, *auxText and *outgoingText when disable to prevent leak - + GitHub Issue: #144, 149 Ignore keystrokes in English mode - diff --git a/data/chewing.xml.in b/data/chewing.xml.in index 5087c226..b0d3c7f1 100644 --- a/data/chewing.xml.in +++ b/data/chewing.xml.in @@ -6,7 +6,7 @@ @PRJ_VER@ @LICENSE@ Peng Huang, Ding-Yi Chen - @RPM_SPEC_URL@ + @PRJ_URL@ @LIBEXEC_DIR@/ibus-engine-chewing --ibus ibus-chewing diff --git a/rsign.pub b/rsign.pub new file mode 100644 index 00000000..83701219 --- /dev/null +++ b/rsign.pub @@ -0,0 +1,2 @@ +untrusted comment: minisign public key: 7865B688D7592473 +RWRzJFnXiLZleAyCIv1talBjyRewelcy9gzYQq9pd3SKSFBPoy57sf5s diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 82fff26c..9aa4da82 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -77,7 +77,7 @@ add_executable(ibus-engine-chewing main.c ) target_compile_definitions(ibus-engine-chewing - PRIVATE VERBOSE_LEVEL=$,DEBUG,MSG>) + PRIVATE VERBOSE_LEVEL=$,DEBUG,WARN>) target_include_directories(ibus-engine-chewing PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) @@ -89,6 +89,9 @@ set(GSETTINGS_SCHEMAS_DIR ${CMAKE_INSTALL_DATADIR}/glib-2.0/schemas) install(FILES setup/${PROJECT_GSCHEMA_XML} DESTINATION ${GSETTINGS_SCHEMAS_DIR} ) +if(GLIB_COMPILE_SCHEMAS) + install(CODE "execute_process(COMMAND glib-compile-schemas ${CMAKE_INSTALL_PREFIX}/${GSETTINGS_SCHEMAS_DIR})") +endif() install(TARGETS ibus-engine-chewing ibus-setup-chewing DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}) \ No newline at end of file diff --git a/src/IBusChewingProperties.c b/src/IBusChewingProperties.c index 3b51ce1a..0daa0017 100644 --- a/src/IBusChewingProperties.c +++ b/src/IBusChewingProperties.c @@ -60,7 +60,7 @@ MkdgPropertySpec propSpecs[] = { NULL}, /*== The callback will be handled in IBusChewingEngine.gob ==*/ {G_TYPE_BOOLEAN, "show-systray", PAGE_KEYBOARD, N_("Show systray icons"), - IBUS_CHEWING_PROPERTIES_SUBSECTION, "1", NULL, NULL, 0, 1, NULL, 0, + IBUS_CHEWING_PROPERTIES_SUBSECTION, "0", NULL, NULL, 0, 1, NULL, 0, N_("On: Show Chinese/English and Full/Half shape status as a systray " "icon\n" "Off: Do not show the status icon"), @@ -76,7 +76,7 @@ MkdgPropertySpec propSpecs[] = { N_("Use Ctrl + Numbers (2-9) to add new phrase before the cursor"), NULL}, {G_TYPE_BOOLEAN, "clean-buffer-focus-out", PAGE_EDITING, N_("Clean pre-edit buffer when focus out"), - IBUS_CHEWING_PROPERTIES_SUBSECTION, "0", NULL, NULL, 0, 1, + IBUS_CHEWING_PROPERTIES_SUBSECTION, "1", NULL, NULL, 0, 1, cleanBufferFocusOut_apply_callback, 0, N_("On: Clean pre-edit buffer when focus out to prevent program crash\n" "Off: Keep what you already type for convenience"), @@ -97,7 +97,7 @@ MkdgPropertySpec propSpecs[] = { NULL}, {G_TYPE_STRING, "chi-eng-mode-toggle", PAGE_EDITING, N_("Chinese/Alphanumeric Mode Toggle Key"), - IBUS_CHEWING_PROPERTIES_SUBSECTION, "caps_lock", chiEngToggle, NULL, 0, 0, + IBUS_CHEWING_PROPERTIES_SUBSECTION, "shift", chiEngToggle, NULL, 0, 0, chiEngToggle_apply_callback, MKDG_PROPERTY_FLAG_NO_NEW | MKDG_PROPERTY_FLAG_HAS_TRANSLATION, NULL, NULL}, @@ -116,7 +116,7 @@ MkdgPropertySpec propSpecs[] = { /* Sync between CapsLock and IM */ {G_TYPE_STRING, "sync-caps-lock", PAGE_EDITING, N_("Sync between CapsLock and IM"), IBUS_CHEWING_PROPERTIES_SUBSECTION, - "keyboard", syncCapsLock_strs, "Sync", 0, 1, syncCapsLock_apply_callback, + "disable", syncCapsLock_strs, "Sync", 0, 1, syncCapsLock_apply_callback, MKDG_PROPERTY_FLAG_NO_NEW | MKDG_PROPERTY_FLAG_HAS_TRANSLATION, N_("Occasionally, the CapsLock status does not match the IM, this option " "determines how these status be synchronized. Valid values:\n" @@ -131,7 +131,7 @@ MkdgPropertySpec propSpecs[] = { "options are disabled or ignored."), NULL}, {G_TYPE_UINT, "cand-per-page", PAGE_SELECTING, N_("Candidate per page"), - IBUS_CHEWING_PROPERTIES_SUBSECTION, "5", NULL, NULL, 4, 10, + IBUS_CHEWING_PROPERTIES_SUBSECTION, "10", NULL, NULL, 4, 10, candPerPage_apply_callback, 0, N_("Number of candidate per page."), NULL}, {G_TYPE_BOOLEAN, "show-page-number", PAGE_SELECTING, N_("Show page number"), IBUS_CHEWING_PROPERTIES_SUBSECTION, "0", NULL, NULL, 0, 1, @@ -144,11 +144,11 @@ MkdgPropertySpec propSpecs[] = { "cursor to the front."), NULL}, {G_TYPE_BOOLEAN, "space-as-selection", PAGE_SELECTING, - N_("Space to select"), IBUS_CHEWING_PROPERTIES_SUBSECTION, "0", NULL, NULL, + N_("Space to select"), IBUS_CHEWING_PROPERTIES_SUBSECTION, "1", NULL, NULL, 0, 1, spaceAsSelection_apply_callback, 0, "Press Space to select the candidate.", NULL}, {G_TYPE_BOOLEAN, "vertical-lookup-table", PAGE_SELECTING, - N_("Vertical Lookup Table"), IBUS_CHEWING_PROPERTIES_SUBSECTION, "0", NULL, + N_("Vertical Lookup Table"), IBUS_CHEWING_PROPERTIES_SUBSECTION, "1", NULL, NULL, 0, 1, verticalLookupTable_apply_callback, 0, "Use vertical lookup table.", NULL}, {G_TYPE_INVALID, "", "", "", IBUS_CHEWING_PROPERTIES_SUBSECTION, "", NULL, diff --git a/src/ibus-chewing-engine.c b/src/ibus-chewing-engine.c index 84979057..7b3fc664 100644 --- a/src/ibus-chewing-engine.c +++ b/src/ibus-chewing-engine.c @@ -33,10 +33,6 @@ #include #include -#define GOB_VERSION_MAJOR 2 -#define GOB_VERSION_MINOR 0 -#define GOB_VERSION_PATCHLEVEL 20 - #define selfp \ ((IBusChewingEnginePrivate *)ibus_chewing_engine_get_instance_private(self)) @@ -46,13 +42,6 @@ #include "ibus-chewing-engine-private.h" -#ifdef G_LIKELY -#define ___GOB_LIKELY(expr) G_LIKELY(expr) -#define ___GOB_UNLIKELY(expr) G_UNLIKELY(expr) -#else /* ! G_LIKELY */ -#define ___GOB_LIKELY(expr) (expr) -#define ___GOB_UNLIKELY(expr) (expr) -#endif /* G_LIKELY */ static const GEnumValue _chewing_input_style_values[] = { {CHEWING_INPUT_STYLE_IN_APPLICATION, (char *)"CHEWING_INPUT_STYLE_IN_APPLICATION", (char *)"in-application"}, @@ -63,7 +52,7 @@ static const GEnumValue _chewing_input_style_values[] = { GType chewing_input_style_get_type(void) { static GType type = 0; - if ___GOB_UNLIKELY (type == 0) + if G_UNLIKELY (type == 0) type = g_enum_register_static("ChewingInputStyle", _chewing_input_style_values); return type; @@ -84,7 +73,7 @@ static const GEnumValue _engine_flag_values[] = { GType engine_flag_get_type(void) { static GType type = 0; - if ___GOB_UNLIKELY (type == 0) + if G_UNLIKELY (type == 0) type = g_enum_register_static("EngineFlag", _engine_flag_values); return type; } @@ -95,11 +84,7 @@ extern gint ibus_chewing_verbose; /* self casting macros */ #define SELF(x) IBUS_CHEWING_ENGINE(x) -#define SELF_CONST(x) IBUS_CHEWING_ENGINE_CONST(x) #define IS_SELF(x) IBUS_IS_CHEWING_ENGINE(x) -#define TYPE_SELF IBUS_TYPE_CHEWING_ENGINE -#define SELF_CLASS(x) IBUS_CHEWING_ENGINE_CLASS(x) - #define SELF_GET_CLASS(x) IBUS_CHEWING_ENGINE_GET_CLASS(x) /* self typedefs */ @@ -142,12 +127,8 @@ ___16_ibus_chewing_engine_property_hide(IBusEngine *engine, static IBusEngineClass *parent_class = NULL; /* Short form macros */ -#define self_use_setting ibus_chewing_engine_use_setting -#define self_restore_mode ibus_chewing_engine_restore_mode #define self_update ibus_chewing_engine_update #define self_refresh_property ibus_chewing_engine_refresh_property -#define self_refresh_property_list ibus_chewing_engine_refresh_property_list -#define self_hide_property_list ibus_chewing_engine_hide_property_list #define self_get_ibus_property_by_name \ ibus_chewing_engine_get_ibus_property_by_name @@ -175,27 +156,8 @@ static IBusEngineClass *parent_class = NULL; #define ibus_text_is_empty(iText) \ ((iText == NULL) || STRING_IS_EMPTY(iText->text)) -/* a macro for creating a new object of our type */ -#define GET_NEW \ - ((IBusChewingEngine *)g_object_new(ibus_chewing_engine_get_type(), NULL)) - -/* a function for creating a new object of our type */ -#include -static IBusChewingEngine *GET_NEW_VARG(const char *first, ...) G_GNUC_UNUSED; -static IBusChewingEngine *GET_NEW_VARG(const char *first, ...) { - IBusChewingEngine *ret; - va_list ap; - - va_start(ap, first); - ret = (IBusChewingEngine *)g_object_new_valist( - ibus_chewing_engine_get_type(), first, ap); - va_end(ap); - return ret; -} - static GObject *___constructor(GType type, guint n_construct_properties, GObjectConstructParam *construct_properties) { -#define __GOB_FUNCTION__ "IBus:Chewing:Engine::constructor" GObject *obj_self; IBusChewingEngine *self; @@ -207,10 +169,7 @@ static GObject *___constructor(GType type, guint n_construct_properties, return obj_self; } -#undef __GOB_FUNCTION__ - static void ___finalize(GObject *obj_self) { -#define __GOB_FUNCTION__ "IBus:Chewing:Engine::finalize" IBusChewingEngine *self G_GNUC_UNUSED = IBUS_CHEWING_ENGINE(obj_self); gpointer priv G_GNUC_UNUSED = selfp; @@ -250,10 +209,7 @@ static void ___finalize(GObject *obj_self) { (*G_OBJECT_CLASS(parent_class)->finalize)(obj_self); } -#undef __GOB_FUNCTION__ - static void ibus_chewing_engine_init(IBusChewingEngine *self G_GNUC_UNUSED) { -#define __GOB_FUNCTION__ "IBus:Chewing:Engine::init" self->icPreEdit = NULL; self->sDialog = NULL; self->preEditText = NULL; @@ -278,9 +234,7 @@ static void ibus_chewing_engine_init(IBusChewingEngine *self G_GNUC_UNUSED) { PROP_STATE_UNCHECKED, NULL)); self->prop_list = g_object_ref_sink(ibus_prop_list_new()); self->keymap_us = ibus_keymap_get("us"); - { - - /* initialize the object here */ + { /* initialize the object here */ IBUS_CHEWING_LOG(INFO, "init() %sinitialized", (selfp->statusFlags & ENGINE_FLAG_INITIALIZED) ? "" : "un"); @@ -328,10 +282,8 @@ static void ibus_chewing_engine_init(IBusChewingEngine *self G_GNUC_UNUSED) { } } -#undef __GOB_FUNCTION__ static void ibus_chewing_engine_class_init(IBusChewingEngineClass *klass G_GNUC_UNUSED) { -#define __GOB_FUNCTION__ "IBus:Chewing:Engine::class_init" GObjectClass *g_object_class G_GNUC_UNUSED = (GObjectClass *)klass; IBusEngineClass *ibus_engine_class = (IBusEngineClass *)klass; @@ -383,7 +335,6 @@ ibus_chewing_engine_class_init(IBusChewingEngineClass *klass G_GNUC_UNUSED) { g_object_class->constructor = ___constructor; g_object_class->finalize = ___finalize; { - ibus_engine_class->property_activate = ibus_chewing_engine_property_activate; ibus_engine_class->process_key_event = @@ -397,23 +348,13 @@ ibus_chewing_engine_class_init(IBusChewingEngineClass *klass G_GNUC_UNUSED) { } } -#undef __GOB_FUNCTION__ - static void -ibus_chewing_engine_constructor(IBusChewingEngine *self G_GNUC_UNUSED) { -#define __GOB_FUNCTION__ "IBus:Chewing:Engine::constructor" - { /* GOB need this for generating constructor */ - } -} - -#undef __GOB_FUNCTION__ +ibus_chewing_engine_constructor(IBusChewingEngine *self G_GNUC_UNUSED) {} void ibus_chewing_engine_use_setting(IBusChewingEngine *self) { -#define __GOB_FUNCTION__ "IBus:Chewing:Engine::use_setting" g_return_if_fail(self != NULL); g_return_if_fail(IBUS_IS_CHEWING_ENGINE(self)); { - IBUS_CHEWING_LOG(INFO, "use_setting()"); ibus_chewing_pre_edit_use_all_configure(self->icPreEdit); @@ -429,14 +370,10 @@ void ibus_chewing_engine_use_setting(IBusChewingEngine *self) { } } -#undef __GOB_FUNCTION__ - void ibus_chewing_engine_restore_mode(IBusChewingEngine *self) { -#define __GOB_FUNCTION__ "IBus:Chewing:Engine::restore_mode" g_return_if_fail(self != NULL); g_return_if_fail(IBUS_IS_CHEWING_ENGINE(self)); { - IBUS_CHEWING_LOG(DEBUG, "restore_mode() statusFlags=%x", selfp->statusFlags); GdkDisplay *display = gdk_display_get_default(); @@ -468,14 +405,10 @@ void ibus_chewing_engine_restore_mode(IBusChewingEngine *self) { } } -#undef __GOB_FUNCTION__ - void ibus_chewing_engine_update(IBusChewingEngine *self) { -#define __GOB_FUNCTION__ "IBus:Chewing:Engine::update" g_return_if_fail(self != NULL); g_return_if_fail(IBUS_IS_CHEWING_ENGINE(self)); { - IBUS_CHEWING_LOG(DEBUG, "update() statusFlags=%x", selfp->statusFlags); commit_text(self); update_pre_edit_text(self); @@ -488,15 +421,11 @@ void ibus_chewing_engine_update(IBusChewingEngine *self) { } } -#undef __GOB_FUNCTION__ - void ibus_chewing_engine_refresh_property(IBusChewingEngine *self, const gchar *prop_name) { -#define __GOB_FUNCTION__ "IBus:Chewing:Engine::refresh_property" g_return_if_fail(self != NULL); g_return_if_fail(IBUS_IS_CHEWING_ENGINE(self)); { - #ifndef UNIT_TEST IBUS_CHEWING_LOG(DEBUG, "refresh_property(%s) status=%x", prop_name, selfp->statusFlags); @@ -549,8 +478,6 @@ void ibus_chewing_engine_refresh_property(IBusChewingEngine *self, } } -#undef __GOB_FUNCTION__ - /** * ibus_chewing_engine_refresh_property_list: * @self: this instances. @@ -558,11 +485,9 @@ void ibus_chewing_engine_refresh_property(IBusChewingEngine *self, * Refresh the property list (language bar). **/ void ibus_chewing_engine_refresh_property_list(IBusChewingEngine *self) { -#define __GOB_FUNCTION__ "IBus:Chewing:Engine::refresh_property_list" g_return_if_fail(self != NULL); g_return_if_fail(IBUS_IS_CHEWING_ENGINE(self)); { - #ifndef UNIT_TEST self_refresh_property(self, "InputMode"); self_refresh_property(self, "AlnumSize"); @@ -571,8 +496,6 @@ void ibus_chewing_engine_refresh_property_list(IBusChewingEngine *self) { } } -#undef __GOB_FUNCTION__ - /** * ibus_chewing_engine_hide_property_list: * @self: this instances. @@ -580,11 +503,9 @@ void ibus_chewing_engine_refresh_property_list(IBusChewingEngine *self) { * Hide the property list (language bar). **/ void ibus_chewing_engine_hide_property_list(IBusChewingEngine *self) { -#define __GOB_FUNCTION__ "IBus:Chewing:Engine::hide_property_list" g_return_if_fail(self != NULL); g_return_if_fail(IBUS_IS_CHEWING_ENGINE(self)); { - #ifndef UNIT_TEST IBUS_ENGINE_GET_CLASS(self)->property_hide(IBUS_ENGINE(self), "AlnumSize"); @@ -592,16 +513,12 @@ void ibus_chewing_engine_hide_property_list(IBusChewingEngine *self) { } } -#undef __GOB_FUNCTION__ - static IBusProperty * ibus_chewing_engine_get_ibus_property_by_name(IBusChewingEngine *self, const gchar *prop_name) { -#define __GOB_FUNCTION__ "IBus:Chewing:Engine::get_ibus_property_by_name" g_return_val_if_fail(self != NULL, (IBusProperty *)0); g_return_val_if_fail(IBUS_IS_CHEWING_ENGINE(self), (IBusProperty *)0); { - if (STRING_EQUALS(prop_name, "InputMode")) { return self->InputMode; } else if (STRING_EQUALS(prop_name, "AlnumSize")) { @@ -615,266 +532,108 @@ ibus_chewing_engine_get_ibus_property_by_name(IBusChewingEngine *self, } } -#undef __GOB_FUNCTION__ - -static void ___b_ibus_chewing_engine_reset(IBusEngine *engine G_GNUC_UNUSED) -#define PARENT_HANDLER(___engine) \ - { \ - if (IBUS_ENGINE_CLASS(parent_class)->reset) \ - (*IBUS_ENGINE_CLASS(parent_class)->reset)(___engine); \ - } -{ -#define __GOB_FUNCTION__ "IBus:Chewing:Engine::reset" - { +static void ___b_ibus_chewing_engine_reset(IBusEngine *engine G_GNUC_UNUSED) { + Self *self = SELF(engine); - Self *self = SELF(engine); - - ibus_chewing_engine_reset(self); - } + ibus_chewing_engine_reset(self); } -#undef __GOB_FUNCTION__ -#undef PARENT_HANDLER - -static void ___c_ibus_chewing_engine_page_up(IBusEngine *engine G_GNUC_UNUSED) -#define PARENT_HANDLER(___engine) \ - { \ - if (IBUS_ENGINE_CLASS(parent_class)->page_up) \ - (*IBUS_ENGINE_CLASS(parent_class)->page_up)(___engine); \ - } -{ -#define __GOB_FUNCTION__ "IBus:Chewing:Engine::page_up" - { - - Self *self = SELF(engine); +static void ___c_ibus_chewing_engine_page_up(IBusEngine *engine G_GNUC_UNUSED) { + Self *self = SELF(engine); - if (is_password(self)) - return; - ibus_chewing_pre_edit_process_key(self->icPreEdit, IBUS_KEY_Page_Up, 0); - self_update(self); - } + if (is_password(self)) + return; + ibus_chewing_pre_edit_process_key(self->icPreEdit, IBUS_KEY_Page_Up, 0); + self_update(self); } -#undef __GOB_FUNCTION__ -#undef PARENT_HANDLER - -static void ___d_ibus_chewing_engine_page_down(IBusEngine *engine G_GNUC_UNUSED) -#define PARENT_HANDLER(___engine) \ - { \ - if (IBUS_ENGINE_CLASS(parent_class)->page_down) \ - (*IBUS_ENGINE_CLASS(parent_class)->page_down)(___engine); \ - } -{ -#define __GOB_FUNCTION__ "IBus:Chewing:Engine::page_down" - { - - Self *self = SELF(engine); +static void +___d_ibus_chewing_engine_page_down(IBusEngine *engine G_GNUC_UNUSED) { + Self *self = SELF(engine); - if (is_password(self)) - return; - ibus_chewing_pre_edit_process_key(self->icPreEdit, IBUS_KEY_Page_Down, - 0); - self_update(self); - } + if (is_password(self)) + return; + ibus_chewing_pre_edit_process_key(self->icPreEdit, IBUS_KEY_Page_Down, 0); + self_update(self); } -#undef __GOB_FUNCTION__ -#undef PARENT_HANDLER - -static void ___e_ibus_chewing_engine_cursor_up(IBusEngine *engine G_GNUC_UNUSED) -#define PARENT_HANDLER(___engine) \ - { \ - if (IBUS_ENGINE_CLASS(parent_class)->cursor_up) \ - (*IBUS_ENGINE_CLASS(parent_class)->cursor_up)(___engine); \ - } -{ -#define __GOB_FUNCTION__ "IBus:Chewing:Engine::cursor_up" - { - - Self *self = SELF(engine); +static void +___e_ibus_chewing_engine_cursor_up(IBusEngine *engine G_GNUC_UNUSED) { + Self *self = SELF(engine); - if (is_password(self)) - return; - ibus_chewing_pre_edit_process_key(self->icPreEdit, IBUS_KEY_Up, 0); - self_update(self); - } + if (is_password(self)) + return; + ibus_chewing_pre_edit_process_key(self->icPreEdit, IBUS_KEY_Up, 0); + self_update(self); } -#undef __GOB_FUNCTION__ -#undef PARENT_HANDLER - static void -___f_ibus_chewing_engine_cursor_down(IBusEngine *engine G_GNUC_UNUSED) -#define PARENT_HANDLER(___engine) \ - { \ - if (IBUS_ENGINE_CLASS(parent_class)->cursor_down) \ - (*IBUS_ENGINE_CLASS(parent_class)->cursor_down)(___engine); \ - } -{ -#define __GOB_FUNCTION__ "IBus:Chewing:Engine::cursor_down" - { - - Self *self = SELF(engine); +___f_ibus_chewing_engine_cursor_down(IBusEngine *engine G_GNUC_UNUSED) { + Self *self = SELF(engine); - if (is_password(self)) - return; - ibus_chewing_pre_edit_process_key(self->icPreEdit, IBUS_KEY_Down, 0); - self_update(self); - } + if (is_password(self)) + return; + ibus_chewing_pre_edit_process_key(self->icPreEdit, IBUS_KEY_Down, 0); + self_update(self); } -#undef __GOB_FUNCTION__ -#undef PARENT_HANDLER - -static void ___10_ibus_chewing_engine_enable(IBusEngine *engine G_GNUC_UNUSED) -#define PARENT_HANDLER(___engine) \ - { \ - if (IBUS_ENGINE_CLASS(parent_class)->enable) \ - (*IBUS_ENGINE_CLASS(parent_class)->enable)(___engine); \ - } -{ -#define __GOB_FUNCTION__ "IBus:Chewing:Engine::enable" - { +static void ___10_ibus_chewing_engine_enable(IBusEngine *engine G_GNUC_UNUSED) { + Self *self = SELF(engine); - Self *self = SELF(engine); - - ibus_chewing_engine_enable(self); - } + ibus_chewing_engine_enable(self); } -#undef __GOB_FUNCTION__ -#undef PARENT_HANDLER - -static void ___11_ibus_chewing_engine_disable(IBusEngine *engine G_GNUC_UNUSED) -#define PARENT_HANDLER(___engine) \ - { \ - if (IBUS_ENGINE_CLASS(parent_class)->disable) \ - (*IBUS_ENGINE_CLASS(parent_class)->disable)(___engine); \ - } -{ -#define __GOB_FUNCTION__ "IBus:Chewing:Engine::disable" - { - - Self *self = SELF(engine); +static void +___11_ibus_chewing_engine_disable(IBusEngine *engine G_GNUC_UNUSED) { + Self *self = SELF(engine); - ibus_chewing_engine_disable(self); - } + ibus_chewing_engine_disable(self); } -#undef __GOB_FUNCTION__ -#undef PARENT_HANDLER - -static void ___12_ibus_chewing_engine_focus_in(IBusEngine *engine G_GNUC_UNUSED) -#define PARENT_HANDLER(___engine) \ - { \ - if (IBUS_ENGINE_CLASS(parent_class)->focus_in) \ - (*IBUS_ENGINE_CLASS(parent_class)->focus_in)(___engine); \ - } -{ -#define __GOB_FUNCTION__ "IBus:Chewing:Engine::focus_in" - { - - Self *self = SELF(engine); +static void +___12_ibus_chewing_engine_focus_in(IBusEngine *engine G_GNUC_UNUSED) { + Self *self = SELF(engine); - ibus_chewing_engine_focus_in(self); - } + ibus_chewing_engine_focus_in(self); } -#undef __GOB_FUNCTION__ -#undef PARENT_HANDLER - static void -___13_ibus_chewing_engine_focus_out(IBusEngine *engine G_GNUC_UNUSED) -#define PARENT_HANDLER(___engine) \ - { \ - if (IBUS_ENGINE_CLASS(parent_class)->focus_out) \ - (*IBUS_ENGINE_CLASS(parent_class)->focus_out)(___engine); \ - } -{ -#define __GOB_FUNCTION__ "IBus:Chewing:Engine::focus_out" - { +___13_ibus_chewing_engine_focus_out(IBusEngine *engine G_GNUC_UNUSED) { + Self *self = SELF(engine); - Self *self = SELF(engine); - - ibus_chewing_engine_focus_out(self); - } + ibus_chewing_engine_focus_out(self); } -#undef __GOB_FUNCTION__ -#undef PARENT_HANDLER - static void ___14_ibus_chewing_engine_set_capabilities(IBusEngine *engine G_GNUC_UNUSED, - guint caps) -#define PARENT_HANDLER(___engine, ___caps) \ - { \ - if (IBUS_ENGINE_CLASS(parent_class)->set_capabilities) \ - (*IBUS_ENGINE_CLASS(parent_class)->set_capabilities)(___engine, \ - ___caps); \ - } -{ -#define __GOB_FUNCTION__ "IBus:Chewing:Engine::set_capabilities" - { + guint caps) { + Self *self = SELF(engine); - Self *self = SELF(engine); - - selfp->capabilite = caps; - IBUS_CHEWING_LOG(MSG, "***** set_capabilities(%x): statusFlags=%x", - caps, selfp->statusFlags); - } + selfp->capabilite = caps; + IBUS_CHEWING_LOG(MSG, "***** set_capabilities(%x): statusFlags=%x", caps, + selfp->statusFlags); } -#undef __GOB_FUNCTION__ -#undef PARENT_HANDLER - static void ___15_ibus_chewing_engine_property_show(IBusEngine *engine G_GNUC_UNUSED, - const gchar *prop_name) -#define PARENT_HANDLER(___engine, ___prop_name) \ - { \ - if (IBUS_ENGINE_CLASS(parent_class)->property_show) \ - (*IBUS_ENGINE_CLASS(parent_class)->property_show)(___engine, \ - ___prop_name); \ - } -{ -#define __GOB_FUNCTION__ "IBus:Chewing:Engine::property_show" - { - - IBUS_CHEWING_LOG(INFO, "property_show(-, %s)", prop_name); - Self *self = SELF(engine); - IBusProperty *prop = self_get_ibus_property_by_name(self, prop_name); + const gchar *prop_name) { + IBUS_CHEWING_LOG(INFO, "property_show(-, %s)", prop_name); + Self *self = SELF(engine); + IBusProperty *prop = self_get_ibus_property_by_name(self, prop_name); - ibus_property_set_visible(prop, TRUE); - } + ibus_property_set_visible(prop, TRUE); } -#undef __GOB_FUNCTION__ -#undef PARENT_HANDLER - static void ___16_ibus_chewing_engine_property_hide(IBusEngine *engine G_GNUC_UNUSED, - const gchar *prop_name) -#define PARENT_HANDLER(___engine, ___prop_name) \ - { \ - if (IBUS_ENGINE_CLASS(parent_class)->property_hide) \ - (*IBUS_ENGINE_CLASS(parent_class)->property_hide)(___engine, \ - ___prop_name); \ - } -{ -#define __GOB_FUNCTION__ "IBus:Chewing:Engine::property_hide" - { - - IBUS_CHEWING_LOG(INFO, "property_hide(-, %s)", prop_name); - Self *self = SELF(engine); - IBusProperty *prop = self_get_ibus_property_by_name(self, prop_name); + const gchar *prop_name) { + IBUS_CHEWING_LOG(INFO, "property_hide(-, %s)", prop_name); + Self *self = SELF(engine); + IBusProperty *prop = self_get_ibus_property_by_name(self, prop_name); - ibus_property_set_visible(prop, FALSE); - } + ibus_property_set_visible(prop, FALSE); } -#undef __GOB_FUNCTION__ -#undef PARENT_HANDLER - /** * ibus_chewing_engine_start: * @self: IBusChewingEngine instance. @@ -1181,10 +940,6 @@ void commit_text(IBusChewingEngine *self) { ibus_chewing_pre_edit_clear_outgoing(self->icPreEdit); } -#include "IBusChewingProperties.h" -#include "ibus-chewing-engine-private.h" -#include "ibus-chewing-engine.h" - gboolean ibus_chewing_engine_process_key_event(IBusEngine *engine, KSym keySym, guint keycode, KeyModifiers unmaskedMod) { diff --git a/src/main.c b/src/main.c index b26c2ec7..9f66a8b8 100644 --- a/src/main.c +++ b/src/main.c @@ -22,6 +22,7 @@ */ #include "IBusChewingUtil.h" +#include "MakerDialogUtil.h" #include "ibus-chewing-engine.h" #include #include diff --git a/src/setup/ibus-setup-chewing-window.ui b/src/setup/ibus-setup-chewing-window.ui index 7a0c1989..09608675 100644 --- a/src/setup/ibus-setup-chewing-window.ui +++ b/src/setup/ibus-setup-chewing-window.ui @@ -105,10 +105,10 @@ - 5.0 + 11.0 1.0 - 20.0 - 10.0 + 33.0 + 20.0 Maximum Chinese Characters @@ -128,6 +128,7 @@ + 1 @@ -140,6 +141,7 @@ + 0 Sync Caps Lock and IM @@ -168,9 +170,9 @@ - 1.0 + 4.0 1.0 - 20.0 + 10.0 10.0 @@ -179,7 +181,7 @@ - True + False Show Page Number