From dfa7453d7b9b30341d7079df7d7bb7efd2018cfb Mon Sep 17 00:00:00 2001 From: jeon Date: Tue, 28 Jul 2020 08:18:21 +0900 Subject: [PATCH] DSWaylandInputMethod: add skeleton codes for wl_input_method and wl_input_method_context Change-Id: Ib432d18df446f8f19a4338ba584a443e03b53ac2 --- packaging/libds.spec | 1 + src/DSWaylandServer/DSWaylandInputMethod.cpp | 157 +++++++++++++++++++++ src/DSWaylandServer/DSWaylandInputMethod.h | 27 ++++ src/DSWaylandServer/DSWaylandInputMethodContext.h | 27 ++++ .../DSWaylandInputMethodContextPrivate.h | 54 +++++++ src/DSWaylandServer/DSWaylandInputMethodPrivate.h | 24 ++++ src/meson.build | 10 +- 7 files changed, 299 insertions(+), 1 deletion(-) create mode 100644 src/DSWaylandServer/DSWaylandInputMethod.cpp create mode 100644 src/DSWaylandServer/DSWaylandInputMethod.h create mode 100644 src/DSWaylandServer/DSWaylandInputMethodContext.h create mode 100644 src/DSWaylandServer/DSWaylandInputMethodContextPrivate.h create mode 100644 src/DSWaylandServer/DSWaylandInputMethodPrivate.h diff --git a/packaging/libds.spec b/packaging/libds.spec index 9b432b6..c47a179 100644 --- a/packaging/libds.spec +++ b/packaging/libds.spec @@ -14,6 +14,7 @@ BuildRequires: pkgconfig(dlog) BuildRequires: pkgconfig(libtdm) BuildRequires: pkgconfig(wayland-server) BuildRequires: pkgconfig(tizen-extension-server) +BuildRequires: pkgconfig(input-method-server) BuildRequires: pkgconfig(text-server) BuildRequires: pkgconfig(tizen-launch-server) BuildRequires: pkgconfig(tizen-surface-server) diff --git a/src/DSWaylandServer/DSWaylandInputMethod.cpp b/src/DSWaylandServer/DSWaylandInputMethod.cpp new file mode 100644 index 0000000..e361ae4 --- /dev/null +++ b/src/DSWaylandServer/DSWaylandInputMethod.cpp @@ -0,0 +1,157 @@ +#include "DSWaylandInputMethodContext.h" +#include "DSWaylandInputMethodContextPrivate.h" +#include "DSWaylandInputMethod.h" +#include "DSWaylandInputMethodPrivate.h" + +namespace display_server { + +DSWaylandInputMethodContextPrivate::DSWaylandInputMethodContextPrivate(DSWaylandInputMethodContext *p_ptr) + : DSObjectPrivate(p_ptr), + __p_ptr(p_ptr) +{ +} + +DSWaylandInputMethodContextPrivate::~DSWaylandInputMethodContextPrivate() +{ +} + +void DSWaylandInputMethodContextPrivate::input_method_context_destroy(Resource *resource) +{ +} + +void DSWaylandInputMethodContextPrivate::input_method_context_commit_string(Resource *resource, uint32_t serial, const std::string &text) +{ +} + +void DSWaylandInputMethodContextPrivate::input_method_context_preedit_string(Resource *resource, uint32_t serial, const std::string &text, const std::string &commit) +{ +} + +void DSWaylandInputMethodContextPrivate::input_method_context_preedit_styling(Resource *resource, uint32_t index, uint32_t length, uint32_t style) +{ +} + +void DSWaylandInputMethodContextPrivate::input_method_context_preedit_cursor(Resource *resource, int32_t index) +{ +} + +void DSWaylandInputMethodContextPrivate::input_method_context_delete_surrounding_text(Resource *resource, int32_t index, uint32_t length) +{ +} + +void DSWaylandInputMethodContextPrivate::input_method_context_cursor_position(Resource *resource, int32_t index, int32_t anchor) +{ +} + +void DSWaylandInputMethodContextPrivate::input_method_context_modifiers_map(Resource *resource, wl_array *map) +{ +} + +void DSWaylandInputMethodContextPrivate::input_method_context_keysym(Resource *resource, uint32_t serial, uint32_t time, uint32_t sym, uint32_t state, uint32_t modifiers) +{ +} + +void DSWaylandInputMethodContextPrivate::input_method_context_grab_keyboard(Resource *resource, uint32_t keyboard) +{ +} + +void DSWaylandInputMethodContextPrivate::input_method_context_key(Resource *resource, uint32_t serial, uint32_t time, uint32_t key, uint32_t state) +{ +} + +void DSWaylandInputMethodContextPrivate::input_method_context_modifiers(Resource *resource, uint32_t serial, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group) +{ +} + +void DSWaylandInputMethodContextPrivate::input_method_context_language(Resource *resource, uint32_t serial, const std::string &language) +{ +} + +void DSWaylandInputMethodContextPrivate::input_method_context_text_direction(Resource *resource, uint32_t serial, uint32_t direction) +{ +} + +void DSWaylandInputMethodContextPrivate::input_method_context_selection_region(Resource *resource, uint32_t serial, int32_t start, int32_t end) +{ +} + +void DSWaylandInputMethodContextPrivate::input_method_context_private_command(Resource *resource, uint32_t serial, const std::string &command) +{ +} + +void DSWaylandInputMethodContextPrivate::input_method_context_update_input_panel_data(Resource *resource, uint32_t serial, const std::string &input_panel_data, uint32_t input_panel_data_length) +{ +} + +void DSWaylandInputMethodContextPrivate::input_method_context_hide_input_panel(Resource *resource, uint32_t serial) +{ +} + +void DSWaylandInputMethodContextPrivate::input_method_context_get_selection_text(Resource *resource, int32_t fd) +{ +} + +void DSWaylandInputMethodContextPrivate::input_method_context_get_surrounding_text(Resource *resource, uint32_t maxlen_before, uint32_t maxlen_after, int32_t fd) +{ +} + +void DSWaylandInputMethodContextPrivate::input_method_context_filter_key_event_done(Resource *resource, uint32_t serial, uint32_t state) +{ +} + +void DSWaylandInputMethodContextPrivate::input_method_context_update_ise_geometry(Resource *resource, uint32_t serial, uint32_t x, uint32_t y, uint32_t width, uint32_t height) +{ +} + +void DSWaylandInputMethodContextPrivate::input_method_context_recapture_string(Resource *resource, uint32_t serial, int32_t index, uint32_t length, const std::string &preedit, const std::string &preedit_commit, const std::string &commit) +{ +} + +void DSWaylandInputMethodContextPrivate::input_method_context_input_panel_event(Resource *resource, uint32_t serial, uint32_t event_type, uint32_t value) +{ +} + +void DSWaylandInputMethodContextPrivate::input_method_context_commit_content(Resource *resource, uint32_t serial, const std::string &content, const std::string &description, const std::string &mime_types) +{ +} + +void DSWaylandInputMethodContextPrivate::input_method_context_update_candidate_state(Resource *resource, uint32_t state) +{ +} + +void DSWaylandInputMethodContextPrivate::input_method_context_reshow_input_panel(Resource *resource) +{ +} + + +DSWaylandInputMethodContext::DSWaylandInputMethodContext() + : DSObject(), _d_ptr(std::make_unique(this)) +{ +} + +DSWaylandInputMethodContext::~DSWaylandInputMethodContext() +{ +} + + +DSWaylandInputMethodPrivate::DSWaylandInputMethodPrivate(DSWaylandInputMethod *p_ptr) + : DSObjectPrivate(p_ptr), + __p_ptr(p_ptr) +{ +} + +DSWaylandInputMethodPrivate::~DSWaylandInputMethodPrivate() +{ +} + + +DSWaylandInputMethod::DSWaylandInputMethod() + : DSObject(), _d_ptr(std::make_unique(this)) +{ +} + +DSWaylandInputMethod::~DSWaylandInputMethod() +{ +} + +} \ No newline at end of file diff --git a/src/DSWaylandServer/DSWaylandInputMethod.h b/src/DSWaylandServer/DSWaylandInputMethod.h new file mode 100644 index 0000000..caf0317 --- /dev/null +++ b/src/DSWaylandServer/DSWaylandInputMethod.h @@ -0,0 +1,27 @@ +#ifndef __DS_WAYLAND_INPUT_METHOD_H__ +#define __DS_WAYLAND_INPUT_METHOD_H__ + +#include "DSCore.h" +#include "DSObject.h" + +namespace display_server +{ + +class DSWaylandInputMethodPrivate; + +class DS_DECL_EXPORT DSWaylandInputMethod : public DSObject +{ +DS_PIMPL_USE_PRIVATE(DSWaylandInputMethod); +public: + DSWaylandInputMethod(); + ~DSWaylandInputMethod() override; + +protected: + +private: + +}; + +} + +#endif //__DS_WAYLAND_INPUT_METHOD_H__ diff --git a/src/DSWaylandServer/DSWaylandInputMethodContext.h b/src/DSWaylandServer/DSWaylandInputMethodContext.h new file mode 100644 index 0000000..b4fb94a --- /dev/null +++ b/src/DSWaylandServer/DSWaylandInputMethodContext.h @@ -0,0 +1,27 @@ +#ifndef __DS_WAYLAND_INPUT_METHOD_CONTEXT_H__ +#define __DS_WAYLAND_INPUT_METHOD_CONTEXT_H__ + +#include "DSCore.h" +#include "DSObject.h" + +namespace display_server +{ + +class DSWaylandInputMethodContextPrivate; + +class DS_DECL_EXPORT DSWaylandInputMethodContext : public DSObject +{ +DS_PIMPL_USE_PRIVATE(DSWaylandInputMethodContext); +public: + DSWaylandInputMethodContext(); + ~DSWaylandInputMethodContext() override; + +protected: + +private: + +}; + +} + +#endif //__DS_WAYLAND_INPUT_METHOD_CONTEXT_H__ diff --git a/src/DSWaylandServer/DSWaylandInputMethodContextPrivate.h b/src/DSWaylandServer/DSWaylandInputMethodContextPrivate.h new file mode 100644 index 0000000..0b362b3 --- /dev/null +++ b/src/DSWaylandServer/DSWaylandInputMethodContextPrivate.h @@ -0,0 +1,54 @@ +#ifndef __DS_WAYLAND_INPUT_METHOD_CONTEXT_PRIVATE_H__ +#define __DS_WAYLAND_INPUT_METHOD_CONTEXT_PRIVATE_H__ + +#include "dswayland-server-input-method.h" + +#include "DSCore.h" +#include "DSObjectPrivate.h" +#include "DSWaylandInputMethodContext.h" + +namespace display_server +{ + +class DS_DECL_EXPORT DSWaylandInputMethodContextPrivate : public DSObjectPrivate, public DSWaylandServer::wl_input_method_context +{ +DS_PIMPL_USE_PUBLIC(DSWaylandInputMethodContext); +public: + DSWaylandInputMethodContextPrivate(DSWaylandInputMethodContext *p_ptr); + ~DSWaylandInputMethodContextPrivate() override; + +protected: + void input_method_context_destroy(Resource *resource); + void input_method_context_commit_string(Resource *resource, uint32_t serial, const std::string &text); + void input_method_context_preedit_string(Resource *resource, uint32_t serial, const std::string &text, const std::string &commit); + void input_method_context_preedit_styling(Resource *resource, uint32_t index, uint32_t length, uint32_t style); + void input_method_context_preedit_cursor(Resource *resource, int32_t index); + void input_method_context_delete_surrounding_text(Resource *resource, int32_t index, uint32_t length); + void input_method_context_cursor_position(Resource *resource, int32_t index, int32_t anchor); + void input_method_context_modifiers_map(Resource *resource, wl_array *map); + void input_method_context_keysym(Resource *resource, uint32_t serial, uint32_t time, uint32_t sym, uint32_t state, uint32_t modifiers); + void input_method_context_grab_keyboard(Resource *resource, uint32_t keyboard); + void input_method_context_key(Resource *resource, uint32_t serial, uint32_t time, uint32_t key, uint32_t state); + void input_method_context_modifiers(Resource *resource, uint32_t serial, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group); + void input_method_context_language(Resource *resource, uint32_t serial, const std::string &language); + void input_method_context_text_direction(Resource *resource, uint32_t serial, uint32_t direction); + void input_method_context_selection_region(Resource *resource, uint32_t serial, int32_t start, int32_t end); + void input_method_context_private_command(Resource *resource, uint32_t serial, const std::string &command); + void input_method_context_update_input_panel_data(Resource *resource, uint32_t serial, const std::string &input_panel_data, uint32_t input_panel_data_length); + void input_method_context_hide_input_panel(Resource *resource, uint32_t serial); + void input_method_context_get_selection_text(Resource *resource, int32_t fd); + void input_method_context_get_surrounding_text(Resource *resource, uint32_t maxlen_before, uint32_t maxlen_after, int32_t fd); + void input_method_context_filter_key_event_done(Resource *resource, uint32_t serial, uint32_t state); + void input_method_context_update_ise_geometry(Resource *resource, uint32_t serial, uint32_t x, uint32_t y, uint32_t width, uint32_t height); + void input_method_context_recapture_string(Resource *resource, uint32_t serial, int32_t index, uint32_t length, const std::string &preedit, const std::string &preedit_commit, const std::string &commit); + void input_method_context_input_panel_event(Resource *resource, uint32_t serial, uint32_t event_type, uint32_t value); + void input_method_context_commit_content(Resource *resource, uint32_t serial, const std::string &content, const std::string &description, const std::string &mime_types); + void input_method_context_update_candidate_state(Resource *resource, uint32_t state); + void input_method_context_reshow_input_panel(Resource *resource); + +}; + +} + +#endif //__DS_WAYLAND_INPUT_METHOD_CONTEXT_PRIVATE_H__ + diff --git a/src/DSWaylandServer/DSWaylandInputMethodPrivate.h b/src/DSWaylandServer/DSWaylandInputMethodPrivate.h new file mode 100644 index 0000000..dfc4e48 --- /dev/null +++ b/src/DSWaylandServer/DSWaylandInputMethodPrivate.h @@ -0,0 +1,24 @@ +#ifndef __DS_WAYLAND_INPUT_METHOD_PRIVATE_H__ +#define __DS_WAYLAND_INPUT_METHOD_PRIVATE_H__ + +#include "dswayland-server-input-method.h" + +#include "DSCore.h" +#include "DSObjectPrivate.h" +#include "DSWaylandInputMethod.h" + +namespace display_server +{ + +class DS_DECL_EXPORT DSWaylandInputMethodPrivate : public DSObjectPrivate, public DSWaylandServer::wl_input_method +{ +DS_PIMPL_USE_PUBLIC(DSWaylandInputMethod); +public: + DSWaylandInputMethodPrivate(DSWaylandInputMethod *p_ptr); + ~DSWaylandInputMethodPrivate() override; +}; + +} + +#endif //__DS_WAYLAND_INPUT_METHOD_PRIVATE_H__ + diff --git a/src/meson.build b/src/meson.build index 4a06e85..7e5401b 100644 --- a/src/meson.build +++ b/src/meson.build @@ -73,6 +73,8 @@ libds_wayland_srcs = [ 'DSWaylandServer/dswayland-server-text.h', 'DSWaylandServer/dswayland-server-tizen-launch.cpp', 'DSWaylandServer/dswayland-server-tizen-launch.h', + 'DSWaylandServer/dswayland-server-input-method.cpp', + 'DSWaylandServer/dswayland-server-input-method.h', 'DSWaylandServer/DSWaylandCallback.cpp', 'DSWaylandServer/DSWaylandCallback.h', 'DSWaylandServer/DSWaylandCallbackPrivate.h', @@ -118,6 +120,11 @@ libds_wayland_srcs = [ 'DSWaylandServer/DSWaylandTizenIndicatorPrivate.h', 'DSWaylandServer/DSWaylandTizenIndicator.h', 'DSWaylandServer/DSWaylandTizenIndicator.cpp', + 'DSWaylandServer/DSWaylandInputMethodContextPrivate.h', + 'DSWaylandServer/DSWaylandInputMethodContext.h', + 'DSWaylandServer/DSWaylandInputMethodPrivate.h', + 'DSWaylandServer/DSWaylandInputMethod.h', + 'DSWaylandServer/DSWaylandInputMethod.cpp', ] libds_srcs += libds_wayland_srcs @@ -141,10 +148,11 @@ tizen_ext_dep = dependency('tizen-extension-server') xdg_shell_unstable_v6_dep = dependency('xdg-shell-unstable-v6-server') xdg_shell_dep = dependency('xdg-shell-server') tizen_surface_dep = dependency('tizen-surface-server') +input_method_dep = dependency('input-method-server') text_dep = dependency('text-server') tizen_launch_dep = dependency('tizen-launch-server') -tizen_ext_deps = [tizen_ext_dep, text_dep, tizen_launch_dep, tizen_surface_dep] +tizen_ext_deps = [tizen_ext_dep, input_method_dep, text_dep, tizen_launch_dep, tizen_surface_dep] tizen_ext_deps = [tizen_ext_deps, xdg_shell_unstable_v6_dep, xdg_shell_dep] libds_deps = [ecore_dep] -- 2.7.4