diff --git a/cpp/SampleIME/cbindgen/composition_processor.h b/cpp/SampleIME/cbindgen/composition_processor.h index 3cd2db9..a765c1c 100644 --- a/cpp/SampleIME/cbindgen/composition_processor.h +++ b/cpp/SampleIME/cbindgen/composition_processor.h @@ -1,6 +1,7 @@ #include #include #include +#include #include #include @@ -44,51 +45,41 @@ enum class KeystrokeFunction { extern "C" { -HRESULT compartment_callback(const void *wrapper, const GUID *guid); - -bool compositionprocessorengine_add_virtual_key(void *engine, uint16_t wch); - -void compositionprocessorengine_compartmentwrapper_conversion_mode_compartment_updated(void *engine, - ITfThreadMgr* thread_mgr); - -const void *compositionprocessorengine_compartmentwrapper_raw_ptr(void *engine); - -void compositionprocessorengine_disable_language_bar_button(void *engine, bool disable); +void *compositionprocessorengine_new(ITfThreadMgr* thread_mgr, uint32_t tf_client_id); void compositionprocessorengine_free(void *engine); -uintptr_t compositionprocessorengine_get_candidate_list(const void *engine, - void **keys_buffer, - void **values_buffer, - uintptr_t buffer_length, - bool is_incremental_word_search, - bool is_wildcard_search); +bool compositionprocessorengine_add_virtual_key(void *engine, uint16_t wch); -uintptr_t compositionprocessorengine_get_candidate_string_in_converted(const void *engine, - const void *search_key, - void **keys_buffer, - void **values_buffer, - uintptr_t buffer_length); +void compositionprocessorengine_pop_virtual_key(void *engine); -const void *compositionprocessorengine_get_table_dictionary_engine(const void *engine); +void compositionprocessorengine_purge_virtual_key(void *engine); bool compositionprocessorengine_has_virtual_key(void *engine); -void compositionprocessorengine_hide_language_bar_button(void *engine, bool hide); - void *compositionprocessorengine_keystroke_buffer_get_reading_string(void *engine); bool compositionprocessorengine_keystroke_buffer_includes_wildcard(void *engine); -bool compositionprocessorengine_modifiers_is_alt_key_down_only(void *engine); +const void *compositionprocessorengine_get_table_dictionary_engine(const void *engine); -bool compositionprocessorengine_modifiers_is_control_key_down_only(void *engine); +void compositionprocessorengine_modifiers_update(void *engine, WPARAM w, LPARAM l); bool compositionprocessorengine_modifiers_is_shift_key_down_only(void *engine); -void compositionprocessorengine_modifiers_update(void *engine, WPARAM w, LPARAM l); +bool compositionprocessorengine_modifiers_is_control_key_down_only(void *engine); -void *compositionprocessorengine_new(ITfThreadMgr* thread_mgr, uint32_t tf_client_id); +bool compositionprocessorengine_modifiers_is_alt_key_down_only(void *engine); + +bool compositionprocessorengine_punctuations_has_alternative_punctuation(void *engine, + uint16_t wch); + +uint16_t compositionprocessorengine_punctuations_get_alternative_punctuation_counted(void *engine, + uint16_t wch); + +HRESULT compositionprocessorengine_preserved_keys_init(void *engine, + ITfThreadMgr* thread_mgr, + uint32_t client_id); HRESULT compositionprocessorengine_on_preserved_key(void *engine, const GUID *guid, @@ -96,22 +87,32 @@ HRESULT compositionprocessorengine_on_preserved_key(void *engine, ITfThreadMgr* thread_mgr, uint32_t client_id); -void compositionprocessorengine_pop_virtual_key(void *engine); +void compositionprocessorengine_compartmentwrapper_conversion_mode_compartment_updated(void *engine, + ITfThreadMgr* thread_mgr); -HRESULT compositionprocessorengine_preserved_keys_init(void *engine, +const void *compositionprocessorengine_compartmentwrapper_raw_ptr(void *engine); + +bool compositionprocessorengine_setup_language_profile(void *engine, ITfThreadMgr* thread_mgr, uint32_t client_id); -uint16_t compositionprocessorengine_punctuations_get_alternative_punctuation_counted(void *engine, - uint16_t wch); +void compositionprocessorengine_hide_language_bar_button(void *engine, bool hide); -bool compositionprocessorengine_punctuations_has_alternative_punctuation(void *engine, - uint16_t wch); +void compositionprocessorengine_disable_language_bar_button(void *engine, bool disable); -void compositionprocessorengine_purge_virtual_key(void *engine); +uintptr_t compositionprocessorengine_get_candidate_list(const void *engine, + void **keys_buffer, + void **values_buffer, + uintptr_t buffer_length, + bool is_incremental_word_search, + bool is_wildcard_search); -bool compositionprocessorengine_setup_language_profile(void *engine, - ITfThreadMgr* thread_mgr, - uint32_t client_id); +uintptr_t compositionprocessorengine_get_candidate_string_in_converted(const void *engine, + const void *search_key, + void **keys_buffer, + void **values_buffer, + uintptr_t buffer_length); + +HRESULT compartment_callback(const void *wrapper, const GUID *guid); } // extern "C" diff --git a/cpp/SampleIME/cbindgen/globals.h b/cpp/SampleIME/cbindgen/globals.h index 530bd0a..5395679 100644 --- a/cpp/SampleIME/cbindgen/globals.h +++ b/cpp/SampleIME/cbindgen/globals.h @@ -1,6 +1,7 @@ #include #include #include +#include #include #include @@ -8,22 +9,22 @@ extern "C" { extern const GUID SAMPLEIME_CLSID; -extern const GUID SAMPLEIME_GUID_CAND_UIELEMENT; +extern const GUID SAMPLEIME_GUID_PROFILE; -extern const GUID SAMPLEIME_GUID_COMPARTMENT_DOUBLE_SINGLE_BYTE; +extern const GUID SAMPLEIME_GUID_IME_MODE_PRESERVE_KEY; -extern const GUID SAMPLEIME_GUID_COMPARTMENT_PUNCTUATION; +extern const GUID SAMPLEIME_GUID_DOUBLE_SINGLE_BYTE_PRESERVE_KEY; -extern const GUID SAMPLEIME_GUID_DISPLAY_ATTRIBUTE_CONVERTED; +extern const GUID SAMPLEIME_GUID_PUNCTUATION_PRESERVE_KEY; -extern const GUID SAMPLEIME_GUID_DISPLAY_ATTRIBUTE_INPUT; +extern const GUID SAMPLEIME_GUID_COMPARTMENT_DOUBLE_SINGLE_BYTE; -extern const GUID SAMPLEIME_GUID_DOUBLE_SINGLE_BYTE_PRESERVE_KEY; +extern const GUID SAMPLEIME_GUID_COMPARTMENT_PUNCTUATION; -extern const GUID SAMPLEIME_GUID_IME_MODE_PRESERVE_KEY; +extern const GUID SAMPLEIME_GUID_DISPLAY_ATTRIBUTE_INPUT; -extern const GUID SAMPLEIME_GUID_PROFILE; +extern const GUID SAMPLEIME_GUID_DISPLAY_ATTRIBUTE_CONVERTED; -extern const GUID SAMPLEIME_GUID_PUNCTUATION_PRESERVE_KEY; +extern const GUID SAMPLEIME_GUID_CAND_UIELEMENT; } // extern "C" diff --git a/cpp/SampleIME/cbindgen/ime.h b/cpp/SampleIME/cbindgen/ime.h index cbaa977..a8158fb 100644 --- a/cpp/SampleIME/cbindgen/ime.h +++ b/cpp/SampleIME/cbindgen/ime.h @@ -1,16 +1,17 @@ #include #include #include +#include #include -static const uint32_t IME_MODE_OFF_ICO_INDEX = 22; +constexpr static const uint32_t IME_MODE_ON_ICO_INDEX = 21; -static const uint32_t IME_MODE_ON_ICO_INDEX = 21; +constexpr static const uint32_t IME_MODE_OFF_ICO_INDEX = 22; extern "C" { -extern HFONT DEFAULT_FONT_HANDLE; - extern HMODULE DLL_INSTANCE; +extern HFONT DEFAULT_FONT_HANDLE; + } // extern "C" diff --git a/cpp/SampleIME/cbindgen/input_processor.h b/cpp/SampleIME/cbindgen/input_processor.h index c31c754..01bd59a 100644 --- a/cpp/SampleIME/cbindgen/input_processor.h +++ b/cpp/SampleIME/cbindgen/input_processor.h @@ -1,15 +1,26 @@ #include #include #include +#include #include #include extern "C" { +bool key_event_sink_on_key_up(ITfThreadMgr* thread_mgr, + uint32_t tf_client_id, + void *engine, + bool composing, + CandidateMode candidate_mode, + WPARAM wparam, + LPARAM lparam); + bool key_event_sink_init_key_event_sink(ITfThreadMgr* thread_mgr, uint32_t tf_client_id, ITfKeyEventSink* sink); +void key_event_sink_uninit_key_event_sink(ITfThreadMgr* thread_mgr, uint32_t tf_client_id); + bool key_event_sink_is_key_eaten(ITfThreadMgr* thread_mgr, uint32_t tf_client_id, const void *engine, @@ -20,14 +31,4 @@ bool key_event_sink_is_key_eaten(ITfThreadMgr* thread_mgr, KeystrokeCategory *category, KeystrokeFunction *function); -bool key_event_sink_on_key_up(ITfThreadMgr* thread_mgr, - uint32_t tf_client_id, - void *engine, - bool composing, - CandidateMode candidate_mode, - WPARAM wparam, - LPARAM lparam); - -void key_event_sink_uninit_key_event_sink(ITfThreadMgr* thread_mgr, uint32_t tf_client_id); - } // extern "C" diff --git a/cpp/SampleIME/cbindgen/itf_components.h b/cpp/SampleIME/cbindgen/itf_components.h index ee1d4fd..e8da94c 100644 --- a/cpp/SampleIME/cbindgen/itf_components.h +++ b/cpp/SampleIME/cbindgen/itf_components.h @@ -1,48 +1,49 @@ #include #include #include +#include #include using CESCALLBACK = HRESULT(*)(const void *pv, const GUID *guid); extern "C" { -HRESULT compartment_clear(void *compartment); +void *compartment_new(ITfThreadMgr* thread_mgr, uint32_t tf_client_id, const GUID *guid); void compartment_free(void *compartment); HRESULT compartment_get_bool(void *compartment, bool *data); +HRESULT compartment_set_bool(void *compartment, bool flag); + HRESULT compartment_get_u32(void *compartment, uint32_t *data); -void compartment_guid(void *compartment, GUID *guid); +HRESULT compartment_set_u32(void *compartment, uint32_t data); -void *compartment_new(ITfThreadMgr* thread_mgr, uint32_t tf_client_id, const GUID *guid); +HRESULT compartment_clear(void *compartment); -HRESULT compartment_set_bool(void *compartment, bool flag); +void compartment_guid(void *compartment, GUID *guid); -HRESULT compartment_set_u32(void *compartment, uint32_t data); +void *compartmenteventsink_new(CESCALLBACK callback, const void *pv); HRESULT compartmenteventsink_advise(ITfCompartmentEventSink* sink, IUnknown* punk, const GUID *guid); -void *compartmenteventsink_new(CESCALLBACK callback, const void *pv); - HRESULT compartmenteventsink_unadvise(ITfCompartmentEventSink* sink); -void langbaritembutton_cleanup(ITfLangBarItemButton* button); +void *langbaritembutton_new(const GUID *item_guid, + void *description, + void *tooltip, + uint32_t on_icon_index, + uint32_t off_icon_index); HRESULT langbaritembutton_init(ITfLangBarItemButton* button, ITfThreadMgr* thread_mgr, uint32_t tf_client_id, const GUID *compartment_guid); -void *langbaritembutton_new(const GUID *item_guid, - void *description, - void *tooltip, - uint32_t on_icon_index, - uint32_t off_icon_index); +void langbaritembutton_cleanup(ITfLangBarItemButton* button); HRESULT langbaritembutton_set_status(ITfLangBarItemButton* button, uint32_t status, bool set); diff --git a/cpp/SampleIME/cbindgen/numberkey_windows.h b/cpp/SampleIME/cbindgen/numberkey_windows.h index b64522c..8aa51ea 100644 --- a/cpp/SampleIME/cbindgen/numberkey_windows.h +++ b/cpp/SampleIME/cbindgen/numberkey_windows.h @@ -1,6 +1,7 @@ #include #include #include +#include #include extern "C" { diff --git a/cpp/SampleIME/cbindgen/ruststringrange.h b/cpp/SampleIME/cbindgen/ruststringrange.h index 46e51ce..b9c1ebd 100644 --- a/cpp/SampleIME/cbindgen/ruststringrange.h +++ b/cpp/SampleIME/cbindgen/ruststringrange.h @@ -1,22 +1,23 @@ #include #include #include +#include #include extern "C" { -void *ruststringrange_clone(const void *p); +void *ruststringrange_new(const uint16_t *buffer, uintptr_t buffer_len); -int8_t ruststringrange_compare(void *x_raw, void *y_raw); +void *ruststringrange_new_utf8(const uint8_t *buffer, uintptr_t buffer_len); void ruststringrange_free(void *p); -uintptr_t ruststringrange_len(const void *p); +const uint8_t *ruststringrange_raw(void *p); -void *ruststringrange_new(const uint16_t *buffer, uintptr_t buffer_len); +uintptr_t ruststringrange_len(const void *p); -void *ruststringrange_new_utf8(const uint8_t *buffer, uintptr_t buffer_len); +int8_t ruststringrange_compare(void *x_raw, void *y_raw); -const uint8_t *ruststringrange_raw(void *p); +void *ruststringrange_clone(const void *p); } // extern "C"