From 5668e0553d9a84398f4bec8f16a4942e150fc36a Mon Sep 17 00:00:00 2001 From: Sung-Jin Park Date: Mon, 7 Sep 2020 17:43:03 +0900 Subject: [PATCH 01/16] DSWaylandServer: define LCOV_EXCL blocks Change-Id: Ia41e80c487d74a6763c4db240baf27cd646f5ef2 Signed-off-by: Sung-Jin Park --- src/DSWaylandServer/DSWaylandBuffer.cpp | 2 + src/DSWaylandServer/DSWaylandBuffer.h | 2 + src/DSWaylandServer/DSWaylandInputMethod.cpp | 2 + src/DSWaylandServer/DSWaylandInputMethod.h | 2 + src/DSWaylandServer/DSWaylandInputMethodContext.h | 2 + .../DSWaylandInputMethodContextPrivate.h | 2 + src/DSWaylandServer/DSWaylandInputMethodPrivate.h | 2 + src/DSWaylandServer/DSWaylandInputPanel.cpp | 2 + src/DSWaylandServer/DSWaylandInputPanel.h | 2 + src/DSWaylandServer/DSWaylandInputPanelPrivate.h | 2 + src/DSWaylandServer/DSWaylandInputPanelSurface.h | 2 + .../DSWaylandInputPanelSurfacePrivate.h | 2 + src/DSWaylandServer/DSWaylandKeyboard.cpp | 2 + src/DSWaylandServer/DSWaylandOutput.cpp | 2 + src/DSWaylandServer/DSWaylandRegion.cpp | 2 + src/DSWaylandServer/DSWaylandRegion.h | 2 + src/DSWaylandServer/DSWaylandRegionPrivate.h | 2 + src/DSWaylandServer/DSWaylandSurface.cpp | 10 +++++ src/DSWaylandServer/DSWaylandTizenIndicator.cpp | 3 +- src/DSWaylandServer/DSWaylandTizenInputDevice.h | 2 + .../DSWaylandTizenInputDeviceManager.h | 2 + src/DSWaylandServer/DSWaylandTizenLaunchEffect.cpp | 4 +- src/DSWaylandServer/DSWaylandTizenLaunchEffect.h | 4 +- .../DSWaylandTizenLaunchEffectPrivate.h | 4 +- src/DSWaylandServer/DSWaylandTizenLaunchSplash.cpp | 5 ++- src/DSWaylandServer/DSWaylandTizenLaunchSplash.h | 2 + .../DSWaylandTizenLaunchSplashPrivate.h | 4 +- src/DSWaylandServer/DSWaylandTizenPolicy.cpp | 5 +-- src/DSWaylandServer/DSWaylandTizenPolicy.h | 2 + src/DSWaylandServer/DSWaylandTizenPolicyExt.cpp | 2 + src/DSWaylandServer/DSWaylandTizenPolicyExt.h | 2 + src/DSWaylandServer/DSWaylandTizenPolicyPrivate.h | 2 + src/DSWaylandServer/DSWaylandTizenPosition.cpp | 3 +- src/DSWaylandServer/DSWaylandTizenPosition.h | 2 + src/DSWaylandServer/DSWaylandTizenSurface.cpp | 2 + src/DSWaylandServer/DSWaylandTizenSurface.h | 2 + src/DSWaylandServer/DSWaylandTizenSurfaceShm.cpp | 2 + src/DSWaylandServer/DSWaylandTizenSurfaceShm.h | 2 + src/DSWaylandServer/DSWaylandTizenVisibility.cpp | 3 +- src/DSWaylandServer/DSWaylandTizenVisibility.h | 2 + src/DSWaylandServer/DSWaylandTouch.cpp | 6 +++ src/DSWaylandServer/DSWaylandTouch.h | 2 + src/DSWaylandServer/DSWaylandZxdgShellV6.cpp | 2 + src/DSWaylandServer/DSWaylandZxdgShellV6.h | 3 +- src/DSWaylandServer/DSWaylandZxdgShellV6Private.h | 3 +- src/DSWaylandServer/IDSWaylandShell.h | 3 +- .../dswayland-server-tizen-extension.cpp | 51 ---------------------- .../dswayland-server-tizen-extension.h | 34 --------------- 48 files changed, 109 insertions(+), 100 deletions(-) diff --git a/src/DSWaylandServer/DSWaylandBuffer.cpp b/src/DSWaylandServer/DSWaylandBuffer.cpp index 3f1f751..3f32057 100644 --- a/src/DSWaylandServer/DSWaylandBuffer.cpp +++ b/src/DSWaylandServer/DSWaylandBuffer.cpp @@ -27,6 +27,7 @@ namespace display_server { +/*LCOV_EXCL_START*/ DSWaylandBufferPrivate::DSWaylandBufferPrivate(DSWaylandBuffer *p_ptr) : DSObjectPrivate(p_ptr), __p_ptr(p_ptr) @@ -60,5 +61,6 @@ void DSWaylandBuffer::sendRelease() priv->send_release(); } +/*LCOV_EXCL_STOP*/ } /* namespace display_server */ diff --git a/src/DSWaylandServer/DSWaylandBuffer.h b/src/DSWaylandServer/DSWaylandBuffer.h index e52759a..a9bfca4 100644 --- a/src/DSWaylandServer/DSWaylandBuffer.h +++ b/src/DSWaylandServer/DSWaylandBuffer.h @@ -30,6 +30,7 @@ namespace display_server { +/*LCOV_EXCL_START*/ class DSWaylandBufferPrivate; class DSWaylandBuffer : public DSObject @@ -41,6 +42,7 @@ public: void sendRelease(); }; +/*LCOV_EXCL_STOP*/ } /* namespace display_server */ diff --git a/src/DSWaylandServer/DSWaylandInputMethod.cpp b/src/DSWaylandServer/DSWaylandInputMethod.cpp index cb279fa..4001547 100644 --- a/src/DSWaylandServer/DSWaylandInputMethod.cpp +++ b/src/DSWaylandServer/DSWaylandInputMethod.cpp @@ -28,6 +28,7 @@ namespace display_server { +/*LCOV_EXCL_START*/ DSWaylandInputMethodContextPrivate::DSWaylandInputMethodContextPrivate(DSWaylandInputMethodContext *p_ptr, DSWaylandCompositor *compositor) : DSObjectPrivate(p_ptr), __p_ptr(p_ptr), @@ -917,5 +918,6 @@ void DSWaylandInputMethod::setGeometryUpdated(bool updated) __dsTextInputPrivate->setGeometryUpdated(updated); } +/*LCOV_EXCL_STOP*/ } diff --git a/src/DSWaylandServer/DSWaylandInputMethod.h b/src/DSWaylandServer/DSWaylandInputMethod.h index e4f9870..590f81c 100644 --- a/src/DSWaylandServer/DSWaylandInputMethod.h +++ b/src/DSWaylandServer/DSWaylandInputMethod.h @@ -32,6 +32,7 @@ namespace display_server { +/*LCOV_EXCL_START*/ class DSWaylandInputMethodPrivate; class DSWaylandInputMethodContext; @@ -102,6 +103,7 @@ private: void *__activateContext; unsigned int __candidateState; }; +/*LCOV_EXCL_STOP*/ } diff --git a/src/DSWaylandServer/DSWaylandInputMethodContext.h b/src/DSWaylandServer/DSWaylandInputMethodContext.h index 068ac43..94cd080 100644 --- a/src/DSWaylandServer/DSWaylandInputMethodContext.h +++ b/src/DSWaylandServer/DSWaylandInputMethodContext.h @@ -31,6 +31,7 @@ namespace display_server { +/*LCOV_EXCL_START*/ class DSWaylandInputMethodContextPrivate; class DSWaylandInputMethod; @@ -66,6 +67,7 @@ private: DSWaylandCompositor *__compositor; DSWaylandInputMethod *__inputMethod; }; +/*LCOV_EXCL_STOP*/ } diff --git a/src/DSWaylandServer/DSWaylandInputMethodContextPrivate.h b/src/DSWaylandServer/DSWaylandInputMethodContextPrivate.h index 3a01bce..72bc88d 100644 --- a/src/DSWaylandServer/DSWaylandInputMethodContextPrivate.h +++ b/src/DSWaylandServer/DSWaylandInputMethodContextPrivate.h @@ -33,6 +33,7 @@ namespace display_server { +/*LCOV_EXCL_START*/ class DS_DECL_EXPORT DSWaylandInputMethodContextPrivate : public DSObjectPrivate, public DSWaylandServer::wl_input_method_context { DS_PIMPL_USE_PUBLIC(DSWaylandInputMethodContext); @@ -91,6 +92,7 @@ protected: private: DSWaylandCompositor *__compositor; }; +/*LCOV_EXCL_STOP*/ } diff --git a/src/DSWaylandServer/DSWaylandInputMethodPrivate.h b/src/DSWaylandServer/DSWaylandInputMethodPrivate.h index 49a86cf..90b98e3 100644 --- a/src/DSWaylandServer/DSWaylandInputMethodPrivate.h +++ b/src/DSWaylandServer/DSWaylandInputMethodPrivate.h @@ -33,6 +33,7 @@ namespace display_server { +/*LCOV_EXCL_START*/ class DSWaylandInputMethodContextPrivate; class DS_DECL_EXPORT DSWaylandInputMethodPrivate : public DSObjectPrivate, public DSWaylandServer::wl_input_method @@ -58,6 +59,7 @@ private: Resource *__resource; std::multimap __contextMap; }; +/*LCOV_EXCL_STOP*/ } diff --git a/src/DSWaylandServer/DSWaylandInputPanel.cpp b/src/DSWaylandServer/DSWaylandInputPanel.cpp index 191fced..46e643b 100644 --- a/src/DSWaylandServer/DSWaylandInputPanel.cpp +++ b/src/DSWaylandServer/DSWaylandInputPanel.cpp @@ -32,6 +32,7 @@ namespace display_server { +/*LCOV_EXCL_START*/ class DSWaylandInputPanelFloating { public: @@ -686,6 +687,7 @@ stGeometry DSWaylandInputPanelSurface::getGeometry(DSWaylandSurface *wlSurface) return priv->getGeometry(wlSurface); } +/*LCOV_EXCL_STOP*/ } diff --git a/src/DSWaylandServer/DSWaylandInputPanel.h b/src/DSWaylandServer/DSWaylandInputPanel.h index f9f39fa..c65ec60 100644 --- a/src/DSWaylandServer/DSWaylandInputPanel.h +++ b/src/DSWaylandServer/DSWaylandInputPanel.h @@ -34,6 +34,7 @@ namespace display_server { +/*LCOV_EXCL_START*/ class DSWaylandInputPanelPrivate; class DSWaylandInputPanelSurface; class DSWaylandInputPanelFloating; @@ -79,6 +80,7 @@ private: void __onSurfaceCommitted(std::shared_ptr waylandSurfaceCommitInfo); void __onEventIdleEnterer(void *data); }; +/*LCOV_EXCL_STOP*/ } diff --git a/src/DSWaylandServer/DSWaylandInputPanelPrivate.h b/src/DSWaylandServer/DSWaylandInputPanelPrivate.h index 7de9465..fe4bd53 100644 --- a/src/DSWaylandServer/DSWaylandInputPanelPrivate.h +++ b/src/DSWaylandServer/DSWaylandInputPanelPrivate.h @@ -33,6 +33,7 @@ namespace display_server { +/*LCOV_EXCL_START*/ class DS_DECL_EXPORT DSWaylandInputPanelPrivate : public DSObjectPrivate, public DSWaylandServer::wl_input_panel { DS_PIMPL_USE_PUBLIC(DSWaylandInputPanel); @@ -47,6 +48,7 @@ protected: private: DSWaylandCompositor *__compositor; }; +/*LCOV_EXCL_STOP*/ } diff --git a/src/DSWaylandServer/DSWaylandInputPanelSurface.h b/src/DSWaylandServer/DSWaylandInputPanelSurface.h index ca90872..825cb57 100644 --- a/src/DSWaylandServer/DSWaylandInputPanelSurface.h +++ b/src/DSWaylandServer/DSWaylandInputPanelSurface.h @@ -32,6 +32,7 @@ namespace display_server { +/*LCOV_EXCL_START*/ class DSWaylandInputPanelSurfacePrivate; class DSWaylandSurface; @@ -58,6 +59,7 @@ private: DSWaylandCompositor *__compositor; DSWaylandInputPanel *__inputPanel; }; +/*LCOV_EXCL_STOP*/ } diff --git a/src/DSWaylandServer/DSWaylandInputPanelSurfacePrivate.h b/src/DSWaylandServer/DSWaylandInputPanelSurfacePrivate.h index 4896e3c..22e10b3 100644 --- a/src/DSWaylandServer/DSWaylandInputPanelSurfacePrivate.h +++ b/src/DSWaylandServer/DSWaylandInputPanelSurfacePrivate.h @@ -34,6 +34,7 @@ namespace display_server { +/*LCOV_EXCL_START*/ class DSWaylandInputPanelSurfaceData; class DS_DECL_EXPORT DSWaylandInputPanelSurfacePrivate : public DSObjectPrivate, public DSWaylandServer::wl_input_panel_surface @@ -70,6 +71,7 @@ private: void __updateSurfaceVisibility(DSWaylandInputPanelSurfaceData *surfaceData); void __appendSurface(Resource *resource, void *inputPanelResource, void *surface); }; +/*LCOV_EXCL_STOP*/ } diff --git a/src/DSWaylandServer/DSWaylandKeyboard.cpp b/src/DSWaylandServer/DSWaylandKeyboard.cpp index 851c169..f61bba7 100644 --- a/src/DSWaylandServer/DSWaylandKeyboard.cpp +++ b/src/DSWaylandServer/DSWaylandKeyboard.cpp @@ -83,6 +83,7 @@ DSWaylandKeyboardPrivate::~DSWaylandKeyboardPrivate() wl_array_release(&__keys); } +/*LCOV_EXCL_START*/ void DSWaylandKeyboardPrivate::keyboard_bind_resource(Resource *resource) { DSLOG_INF("DSWaylandKeyboardPrivate",""); @@ -225,6 +226,7 @@ void DSWaylandKeyboardPrivate::__addClient(struct ::wl_client *wlClient, uint32_ } } } +/*LCOV_EXCL_STOP*/ /* Begin Public Class Implementation */ DSWaylandKeyboard::DSWaylandKeyboard(DSWaylandSeat *seat) diff --git a/src/DSWaylandServer/DSWaylandOutput.cpp b/src/DSWaylandServer/DSWaylandOutput.cpp index 7216dbb..a0f5f7a 100644 --- a/src/DSWaylandServer/DSWaylandOutput.cpp +++ b/src/DSWaylandServer/DSWaylandOutput.cpp @@ -49,6 +49,7 @@ DSWaylandOutputPrivate::~DSWaylandOutputPrivate() { } +/*LCOV_EXCL_START*/ void DSWaylandOutputPrivate::output_bind_resource(wl_output::Resource *resource) { DSLOG_DBG("DSWaylandOutputPriv", ""); @@ -125,6 +126,7 @@ bool DSWaylandOutputPrivate::getBaseResolutionFromAppinfo(Resource *resource, in DSTizenAppinfoMgr::releaseInstance(); return true; } +/*LCOV_EXCL_STOP*/ void DSWaylandOutputPrivate::sendWaylandOutputInfo(void) { diff --git a/src/DSWaylandServer/DSWaylandRegion.cpp b/src/DSWaylandServer/DSWaylandRegion.cpp index 19d3231..406da3c 100644 --- a/src/DSWaylandServer/DSWaylandRegion.cpp +++ b/src/DSWaylandServer/DSWaylandRegion.cpp @@ -28,6 +28,7 @@ namespace display_server { +/*LCOV_EXCL_START*/ /* DSWaylandRegionPrivate */ DSWaylandRegionPrivate::DSWaylandRegionPrivate(DSWaylandRegion *p_ptr) : DSObjectPrivate(p_ptr), @@ -104,5 +105,6 @@ bool DSWaylandRegion::hasResource() return true; return false; } +/*LCOV_EXCL_STOP*/ } /* namespace display_server */ diff --git a/src/DSWaylandServer/DSWaylandRegion.h b/src/DSWaylandServer/DSWaylandRegion.h index 996b583..c4bd950 100644 --- a/src/DSWaylandServer/DSWaylandRegion.h +++ b/src/DSWaylandServer/DSWaylandRegion.h @@ -34,6 +34,7 @@ struct wl_resource; namespace display_server { +/*LCOV_EXCL_START*/ class DSWaylandRegionPrivate; class DSWaylandRegion : public DSObject @@ -51,6 +52,7 @@ public: private: }; +/*LCOV_EXCL_STOP*/ } /* namespace display_server */ diff --git a/src/DSWaylandServer/DSWaylandRegionPrivate.h b/src/DSWaylandServer/DSWaylandRegionPrivate.h index d2d6338..f5b6a22 100644 --- a/src/DSWaylandServer/DSWaylandRegionPrivate.h +++ b/src/DSWaylandServer/DSWaylandRegionPrivate.h @@ -30,6 +30,7 @@ namespace display_server { +/*LCOV_EXCL_START*/ class DSWaylandRegion; class DSWaylandRegionPrivate : public DSObjectPrivate, public DSWaylandServer::wl_region @@ -51,6 +52,7 @@ protected: private: }; +/*LCOV_EXCL_STOP*/ } /*namespace display_server */ diff --git a/src/DSWaylandServer/DSWaylandSurface.cpp b/src/DSWaylandServer/DSWaylandSurface.cpp index 1eb9b2d..5136242 100644 --- a/src/DSWaylandServer/DSWaylandSurface.cpp +++ b/src/DSWaylandServer/DSWaylandSurface.cpp @@ -58,6 +58,7 @@ DSWaylandSurfaceCommitInfo::DSWaylandSurfaceCommitInfo() DSWaylandSurfaceCommitInfo::~DSWaylandSurfaceCommitInfo() {} +/*LCOV_EXCL_START*/ std::shared_ptr DSWaylandSurfaceCommitInfo::getBuffer() { DS_GET_PRIV(DSWaylandSurfaceCommitInfo); @@ -71,6 +72,7 @@ bool DSWaylandSurfaceCommitInfo::bufferChanged() return priv->bufferChanged; } +/*LCOV_EXCL_STOP*/ /* DSWaylandSurfacePrivate */ static uint32_t tizenResIdCnt = 0; @@ -110,6 +112,7 @@ DSWaylandSurfacePrivate::~DSWaylandSurfacePrivate() DSBufferManager::releaseInstance(); } +/*LCOV_EXCL_START*/ uint32_t DSWaylandSurfacePrivate::getResourceId() { return __resId; @@ -133,6 +136,7 @@ void DSWaylandSurfacePrivate::surface_destroy(Resource *resource) { __sendSurfaceDestroy(); } +/*LCOV_EXCL_STOP*/ void DSWaylandSurfacePrivate::surface_attach(Resource *resource, struct ::wl_resource *buffer, int32_t x, int32_t y) { @@ -164,6 +168,7 @@ void DSWaylandSurfacePrivate::surface_damage(Resource *resource, int32_t x, int3 commitInfoPendingPriv->damageSurface.height = height; } +/*LCOV_EXCL_START*/ void DSWaylandSurfacePrivate::surface_frame(Resource *resource, uint32_t callback) { //TODO: @@ -178,6 +183,7 @@ void DSWaylandSurfacePrivate::surface_set_input_region(Resource *resource, struc { //TODO: } +/*LCOV_EXCL_STOP*/ void DSWaylandSurfacePrivate::surface_commit(Resource *resource) { @@ -200,6 +206,7 @@ void DSWaylandSurfacePrivate::surface_commit(Resource *resource) pub->__surfaceCommittedSignal.emit(__commitInfo); } +/*LCOV_EXCL_START*/ void DSWaylandSurfacePrivate::surface_set_buffer_transform(Resource *resource, int32_t transform) { DSWaylandSurfaceCommitInfoPrivate *commitInfoPendingPriv = DSWaylandSurfaceCommitInfoPrivate::getPrivate(__commitInfoPending.get()); @@ -223,6 +230,7 @@ void DSWaylandSurfacePrivate::surface_damage_buffer(Resource *resource, int32_t commitInfoPendingPriv->damageBuffer.width = width; commitInfoPendingPriv->damageBuffer.height = height; } +/*LCOV_EXCL_STOP*/ void DSWaylandSurfacePrivate::__sendSurfaceDestroy(void) { @@ -287,6 +295,7 @@ bool DSWaylandSurface::hasResource() return false; } +/*LCOV_EXCL_START*/ uint32_t DSWaylandSurface::getResourceId() { DS_GET_PRIV(DSWaylandSurface); @@ -300,5 +309,6 @@ uint32_t DSWaylandSurface::getTizenResourceId() return priv->getTizenResourceId(); } +/*LCOV_EXCL_STOP*/ } /* namespace display_server */ diff --git a/src/DSWaylandServer/DSWaylandTizenIndicator.cpp b/src/DSWaylandServer/DSWaylandTizenIndicator.cpp index 51076c5..6f2916c 100644 --- a/src/DSWaylandServer/DSWaylandTizenIndicator.cpp +++ b/src/DSWaylandServer/DSWaylandTizenIndicator.cpp @@ -27,7 +27,6 @@ namespace display_server { - DSWaylandTizenIndicator::DSWaylandTizenIndicator() : DSObject(), DS_INIT_PRIVATE_PTR(DSWaylandTizenIndicator) { @@ -62,6 +61,7 @@ DSWaylandTizenIndicatorPrivate::~DSWaylandTizenIndicatorPrivate() { } +/*LCOV_EXCL_START*/ void DSWaylandTizenIndicatorPrivate::tizen_indicator_bind_resource(Resource *resource) { } @@ -88,6 +88,7 @@ void DSWaylandTizenIndicatorPrivate::tizen_indicator_set_visible_type(Resource * this->setVisibleType(vtype); } +/*LCOV_EXCL_STOP*/ void DSWaylandTizenIndicatorPrivate::setVisibleType(DSWaylandTizenIndicator::visible_type type) { diff --git a/src/DSWaylandServer/DSWaylandTizenInputDevice.h b/src/DSWaylandServer/DSWaylandTizenInputDevice.h index 241fb85..1bbcc23 100644 --- a/src/DSWaylandServer/DSWaylandTizenInputDevice.h +++ b/src/DSWaylandServer/DSWaylandTizenInputDevice.h @@ -32,6 +32,7 @@ namespace display_server { +/*LCOV_EXCL_START*/ class DSWaylandTizenInputDevicePrivate; class DSWaylandTizenInputDevice : public DSObject @@ -47,6 +48,7 @@ public: private: DSWaylandTizenInputDeviceManager *__tzInputDeviceManager; }; +/*LCOV_EXCL_STOP*/ } diff --git a/src/DSWaylandServer/DSWaylandTizenInputDeviceManager.h b/src/DSWaylandServer/DSWaylandTizenInputDeviceManager.h index 41920b5..cb2917a 100644 --- a/src/DSWaylandServer/DSWaylandTizenInputDeviceManager.h +++ b/src/DSWaylandServer/DSWaylandTizenInputDeviceManager.h @@ -32,6 +32,7 @@ namespace display_server { +/*LCOV_EXCL_START*/ class DSWaylandTizenInputDeviceManagerPrivate; class DSWaylandTizenInputDevice; @@ -52,6 +53,7 @@ private: DSWaylandCompositor *__compositor; DSWaylandTizenInputDevice *__tzInputDevice; }; +/*LCOV_EXCL_STOP*/ } diff --git a/src/DSWaylandServer/DSWaylandTizenLaunchEffect.cpp b/src/DSWaylandServer/DSWaylandTizenLaunchEffect.cpp index 9b0c1df..ae5b139 100644 --- a/src/DSWaylandServer/DSWaylandTizenLaunchEffect.cpp +++ b/src/DSWaylandServer/DSWaylandTizenLaunchEffect.cpp @@ -31,6 +31,7 @@ const int TIZEN_LAUNCH_EFFECT_VERSION = 1; namespace display_server { +/*LCOV_EXCL_START*/ DSWaylandTizenLaunchEffectPrivate::DSWaylandTizenLaunchEffectPrivate(DSWaylandTizenLaunchEffect *p_ptr) : DSObjectPrivate(p_ptr), __p_ptr(p_ptr) @@ -131,5 +132,6 @@ void DSWaylandTizenLaunchEffect::finalize(void) DSLOG_INF("TizenLaunchEffect", "TizenLaunchEffect finalized"); __isCreated = false; } +/*LCOV_EXCL_STOP*/ -} \ No newline at end of file +} diff --git a/src/DSWaylandServer/DSWaylandTizenLaunchEffect.h b/src/DSWaylandServer/DSWaylandTizenLaunchEffect.h index 06a737e..e309ac6 100644 --- a/src/DSWaylandServer/DSWaylandTizenLaunchEffect.h +++ b/src/DSWaylandServer/DSWaylandTizenLaunchEffect.h @@ -29,6 +29,7 @@ namespace display_server { +/*LCOV_EXCL_START*/ class DSWaylandTizenLaunchEffectPrivate; class DSWaylandTizenLaunchEffect : public DSObject @@ -49,6 +50,7 @@ private: bool __isCreated; }; +/*LCOV_EXCL_STOP*/ } -#endif \ No newline at end of file +#endif diff --git a/src/DSWaylandServer/DSWaylandTizenLaunchEffectPrivate.h b/src/DSWaylandServer/DSWaylandTizenLaunchEffectPrivate.h index ad31c16..8ec0f59 100644 --- a/src/DSWaylandServer/DSWaylandTizenLaunchEffectPrivate.h +++ b/src/DSWaylandServer/DSWaylandTizenLaunchEffectPrivate.h @@ -31,6 +31,7 @@ namespace display_server { +/*LCOV_EXCL_START*/ class DSWaylandTizenLaunchSplash; class DS_DECL_EXPORT DSWaylandTizenLaunchEffectPrivate : public DSObjectPrivate, public DSWaylandServer::tizen_launch_effect @@ -58,6 +59,7 @@ private: std::list> __tzSplashList; }; +/*LCOV_EXCL_STOP*/ } -#endif \ No newline at end of file +#endif diff --git a/src/DSWaylandServer/DSWaylandTizenLaunchSplash.cpp b/src/DSWaylandServer/DSWaylandTizenLaunchSplash.cpp index 96dd7c0..737af3f 100644 --- a/src/DSWaylandServer/DSWaylandTizenLaunchSplash.cpp +++ b/src/DSWaylandServer/DSWaylandTizenLaunchSplash.cpp @@ -27,6 +27,7 @@ namespace display_server { +/*LCOV_EXCL_START*/ DSWaylandTizenLaunchSplashPrivate::DSWaylandTizenLaunchSplashPrivate(DSWaylandTizenLaunchSplash *p_ptr) : DSObjectPrivate(p_ptr), __p_ptr(p_ptr) @@ -65,6 +66,6 @@ DSWaylandTizenLaunchSplash::DSWaylandTizenLaunchSplash(DSWaylandClient *waylandC DSWaylandTizenLaunchSplash::~DSWaylandTizenLaunchSplash() {} +/*LCOV_EXCL_STOP*/ - -} \ No newline at end of file +} diff --git a/src/DSWaylandServer/DSWaylandTizenLaunchSplash.h b/src/DSWaylandServer/DSWaylandTizenLaunchSplash.h index 3536c93..c04b995 100644 --- a/src/DSWaylandServer/DSWaylandTizenLaunchSplash.h +++ b/src/DSWaylandServer/DSWaylandTizenLaunchSplash.h @@ -29,6 +29,7 @@ namespace display_server { +/*LCOV_EXCL_START*/ class DSWaylandTizenLaunchSplashPrivate; class DSWaylandTizenLaunchSplash : public DSObject @@ -42,6 +43,7 @@ public: private: }; +/*LCOV_EXCL_STOP*/ } #endif diff --git a/src/DSWaylandServer/DSWaylandTizenLaunchSplashPrivate.h b/src/DSWaylandServer/DSWaylandTizenLaunchSplashPrivate.h index 6aa9015..72da257 100644 --- a/src/DSWaylandServer/DSWaylandTizenLaunchSplashPrivate.h +++ b/src/DSWaylandServer/DSWaylandTizenLaunchSplashPrivate.h @@ -31,6 +31,7 @@ namespace display_server { +/*LCOV_EXCL_START*/ class DSWaylandTizenLaunchSplash; class DS_DECL_EXPORT DSWaylandTizenLaunchSplashPrivate : public DSObjectPrivate, public DSWaylandServer::tizen_launch_splash @@ -56,6 +57,7 @@ protected: private: }; +/*LCOV_EXCL_STOP*/ } -#endif \ No newline at end of file +#endif diff --git a/src/DSWaylandServer/DSWaylandTizenPolicy.cpp b/src/DSWaylandServer/DSWaylandTizenPolicy.cpp index d33e82a..5076ffb 100644 --- a/src/DSWaylandServer/DSWaylandTizenPolicy.cpp +++ b/src/DSWaylandServer/DSWaylandTizenPolicy.cpp @@ -31,10 +31,8 @@ const int TIZEN_POLICY_VERSION = 7; namespace display_server { -///////////////////////////////// -// DSWaylandTizenPolicyPrivate -///////////////////////////////// +/*LCOV_EXCL_START*/ DSWaylandTizenPolicyPrivate::DSWaylandTizenPolicyPrivate(DSWaylandTizenPolicy *p_ptr) : DSObjectPrivate(p_ptr), __p_ptr(p_ptr) @@ -422,6 +420,7 @@ DSWaylandCompositor *DSWaylandTizenPolicy::getWlCompositor() { return __wlCompositor; } +/*LCOV_EXCL_STOP*/ } // namespace display_server diff --git a/src/DSWaylandServer/DSWaylandTizenPolicy.h b/src/DSWaylandServer/DSWaylandTizenPolicy.h index f526683..ddd6045 100644 --- a/src/DSWaylandServer/DSWaylandTizenPolicy.h +++ b/src/DSWaylandServer/DSWaylandTizenPolicy.h @@ -31,6 +31,7 @@ namespace display_server { +/*LCOV_EXCL_START*/ class DSWaylandTizenPolicyPrivate; class DSWaylandTizenPolicy : public DSObject @@ -52,6 +53,7 @@ private: DSWaylandCompositor *__wlCompositor; bool __isCreated; }; +/*LCOV_EXCL_STOP*/ } diff --git a/src/DSWaylandServer/DSWaylandTizenPolicyExt.cpp b/src/DSWaylandServer/DSWaylandTizenPolicyExt.cpp index 2ffff5b..7e9c9f2 100644 --- a/src/DSWaylandServer/DSWaylandTizenPolicyExt.cpp +++ b/src/DSWaylandServer/DSWaylandTizenPolicyExt.cpp @@ -27,6 +27,7 @@ namespace display_server { +/*LCOV_EXCL_START*/ /* DSWaylandTizenPolicyExt */ DSWaylandTizenPolicyExtPrivate::DSWaylandTizenPolicyExtPrivate(DSWaylandTizenPolicyExt *p_ptr, DSWaylandCompositor *compositor) : DSObjectPrivate(p_ptr), @@ -158,5 +159,6 @@ struct ::wl_resource *DSWaylandTizenRotation::getRotationSurface(void) return priv->getRotationSurface(); } +/*LCOV_EXCL_STOP*/ } // namespace display_server diff --git a/src/DSWaylandServer/DSWaylandTizenPolicyExt.h b/src/DSWaylandServer/DSWaylandTizenPolicyExt.h index eef13dc..27b8119 100644 --- a/src/DSWaylandServer/DSWaylandTizenPolicyExt.h +++ b/src/DSWaylandServer/DSWaylandTizenPolicyExt.h @@ -32,6 +32,7 @@ namespace display_server { +/*LCOV_EXCL_START*/ class DSWaylandTizenPolicyExtPrivate; class DSWaylandTizenRotationPrivate; @@ -60,6 +61,7 @@ public: DSWaylandTizenRotation *getTizenRotation(struct ::wl_resource *surface); void delTizenRotation(DSWaylandTizenRotation *resource); }; +/*LCOV_EXCL_STOP*/ } diff --git a/src/DSWaylandServer/DSWaylandTizenPolicyPrivate.h b/src/DSWaylandServer/DSWaylandTizenPolicyPrivate.h index ac08165..e917d2e 100644 --- a/src/DSWaylandServer/DSWaylandTizenPolicyPrivate.h +++ b/src/DSWaylandServer/DSWaylandTizenPolicyPrivate.h @@ -31,6 +31,7 @@ namespace display_server { +/*LCOV_EXCL_START*/ class DSWaylandTizenVisibility; class DSWaylandTizenPosition; @@ -96,6 +97,7 @@ private: std::list> __tzPosList; std::list> __tzVisList; }; +/*LCOV_EXCL_STOP*/ } diff --git a/src/DSWaylandServer/DSWaylandTizenPosition.cpp b/src/DSWaylandServer/DSWaylandTizenPosition.cpp index 7b0455a..34e4dbf 100644 --- a/src/DSWaylandServer/DSWaylandTizenPosition.cpp +++ b/src/DSWaylandServer/DSWaylandTizenPosition.cpp @@ -28,6 +28,7 @@ namespace display_server { +/*LCOV_EXCL_START*/ DSWaylandTizenPosition::DSWaylandTizenPosition(struct ::wl_client *client, uint32_t id, int version, struct ::wl_resource *surface) : DSObject(), DS_INIT_PRIVATE_PTR(DSWaylandTizenPosition) { @@ -88,6 +89,6 @@ void DSWaylandTizenPositionPrivate::tizen_position_set(Resource *resource, int32 wm->setWindowPosition(__dswlSurface, x, y); DSWindowManager::releaseInstance(); } - +/*LCOV_EXCL_STOP*/ } // namespace display_server diff --git a/src/DSWaylandServer/DSWaylandTizenPosition.h b/src/DSWaylandServer/DSWaylandTizenPosition.h index f6a0396..084fe1e 100644 --- a/src/DSWaylandServer/DSWaylandTizenPosition.h +++ b/src/DSWaylandServer/DSWaylandTizenPosition.h @@ -32,6 +32,7 @@ namespace display_server { +/*LCOV_EXCL_START*/ class DSWaylandTizenPositionPrivate; class DSWaylandTizenPosition : public DSObject @@ -48,6 +49,7 @@ protected: private: }; +/*LCOV_EXCL_STOP*/ } // namespace display_server diff --git a/src/DSWaylandServer/DSWaylandTizenSurface.cpp b/src/DSWaylandServer/DSWaylandTizenSurface.cpp index e430097..d0f933d 100644 --- a/src/DSWaylandServer/DSWaylandTizenSurface.cpp +++ b/src/DSWaylandServer/DSWaylandTizenSurface.cpp @@ -27,6 +27,7 @@ namespace display_server { +/*LCOV_EXCL_START*/ /* DSWaylandTizenSurface */ DSWaylandTizenSurfacePrivate::DSWaylandTizenSurfacePrivate(DSWaylandTizenSurface *p_ptr, DSWaylandCompositor *compositor) : DSObjectPrivate(p_ptr), @@ -219,5 +220,6 @@ uint32_t DSWaylandTizenResource::getResourceId(void) return priv->getResourceId(); } +/*LCOV_EXCL_STOP*/ } // namespace display_server diff --git a/src/DSWaylandServer/DSWaylandTizenSurface.h b/src/DSWaylandServer/DSWaylandTizenSurface.h index 6621b53..3b56188 100644 --- a/src/DSWaylandServer/DSWaylandTizenSurface.h +++ b/src/DSWaylandServer/DSWaylandTizenSurface.h @@ -32,6 +32,7 @@ namespace display_server { +/*LCOV_EXCL_START*/ class DSWaylandTizenSurfacePrivate; class DSWaylandTizenResourcePrivate; @@ -60,6 +61,7 @@ public: DSWaylandTizenResource *getTizenResource(struct ::wl_resource *surface); void delTizenResource(DSWaylandTizenResource *resource); }; +/*LCOV_EXCL_STOP*/ } diff --git a/src/DSWaylandServer/DSWaylandTizenSurfaceShm.cpp b/src/DSWaylandServer/DSWaylandTizenSurfaceShm.cpp index ae1147c..4fd5917 100644 --- a/src/DSWaylandServer/DSWaylandTizenSurfaceShm.cpp +++ b/src/DSWaylandServer/DSWaylandTizenSurfaceShm.cpp @@ -27,6 +27,7 @@ namespace display_server { +/*LCOV_EXCL_START*/ /* DSWaylandTizenSurfaceShm */ DSWaylandTizenSurfaceShmPrivate::DSWaylandTizenSurfaceShmPrivate(DSWaylandTizenSurfaceShm *p_ptr, DSWaylandCompositor *compositor) : DSObjectPrivate(p_ptr), @@ -163,5 +164,6 @@ struct ::wl_resource *DSWaylandTizenSurfaceShmFlusher::getShmFlusherSurface(void return priv->getShmFlusherSurface(); } +/*LCOV_EXCL_STOP*/ } // namespace display_server diff --git a/src/DSWaylandServer/DSWaylandTizenSurfaceShm.h b/src/DSWaylandServer/DSWaylandTizenSurfaceShm.h index 350f80e..8adf4b2 100644 --- a/src/DSWaylandServer/DSWaylandTizenSurfaceShm.h +++ b/src/DSWaylandServer/DSWaylandTizenSurfaceShm.h @@ -32,6 +32,7 @@ namespace display_server { +/*LCOV_EXCL_START*/ class DSWaylandTizenSurfaceShmPrivate; class DSWaylandTizenSurfaceShmFlusherPrivate; @@ -58,6 +59,7 @@ public: DSWaylandTizenSurfaceShmFlusher *getShmFlusher(DSWaylandTizenSurfaceShm *TizenSurfaceShm); }; +/*LCOV_EXCL_STOP*/ } diff --git a/src/DSWaylandServer/DSWaylandTizenVisibility.cpp b/src/DSWaylandServer/DSWaylandTizenVisibility.cpp index 3bc43ff..77b7507 100644 --- a/src/DSWaylandServer/DSWaylandTizenVisibility.cpp +++ b/src/DSWaylandServer/DSWaylandTizenVisibility.cpp @@ -28,6 +28,7 @@ namespace display_server { +/*LCOV_EXCL_START*/ DSWaylandTizenVisibilityPrivate::DSWaylandTizenVisibilityPrivate(DSWaylandTizenVisibility *p_ptr) : DSObjectPrivate(p_ptr), __p_ptr(p_ptr), @@ -76,6 +77,6 @@ void DSWaylandTizenVisibility::init(struct ::wl_client *client, uint32_t id, int DS_GET_PRIV(DSWaylandTizenVisibility); priv->init(client, id, version, surface); } - +/*LCOV_EXCL_STOP*/ } // namespace display_server diff --git a/src/DSWaylandServer/DSWaylandTizenVisibility.h b/src/DSWaylandServer/DSWaylandTizenVisibility.h index a0fe5d3..da6dbf2 100644 --- a/src/DSWaylandServer/DSWaylandTizenVisibility.h +++ b/src/DSWaylandServer/DSWaylandTizenVisibility.h @@ -32,6 +32,7 @@ namespace display_server { +/*LCOV_EXCL_START*/ class DSWaylandTizenVisibilityPrivate; class DSWaylandTizenVisibility : public DSObject @@ -44,6 +45,7 @@ public: void init(struct ::wl_client *client, uint32_t id, int version, struct ::wl_resource *surface); }; +/*LCOV_EXCL_STOP*/ } // namespace display_server diff --git a/src/DSWaylandServer/DSWaylandTouch.cpp b/src/DSWaylandServer/DSWaylandTouch.cpp index 4044a6b..248a198 100644 --- a/src/DSWaylandServer/DSWaylandTouch.cpp +++ b/src/DSWaylandServer/DSWaylandTouch.cpp @@ -46,6 +46,7 @@ DSWaylandTouchPrivate::~DSWaylandTouchPrivate() { } +/*LCOV_EXCL_START*/ void DSWaylandTouchPrivate::setFocus(DSWaylandSurface *waylandSurface) { DSLOG_INF("DSWaylandTouchPrivate", "touch focus changed (%p -> %p)", __waylandSurface, waylandSurface); @@ -76,12 +77,14 @@ void DSWaylandTouchPrivate::setFocus(DSWaylandSurface *waylandSurface) } } +/*LCOV_EXCL_STOP*/ DSWaylandSurface *DSWaylandTouchPrivate::getFocus() { return __waylandSurface; } +/*LCOV_EXCL_START*/ void DSWaylandTouchPrivate::touch_bind_resource(Resource *resource) { DSLOG_INF("DSWaylandTouchPrivate",""); @@ -97,6 +100,7 @@ void DSWaylandTouchPrivate::touch_release(Resource *resource) DSLOG_INF("DSWaylandTouchPrivate",""); wl_resource_destroy(resource->handle); } +/*LCOV_EXCL_STOP*/ /*LCOV_EXCL_START*/ void DSWaylandTouchPrivate::sendDown(int32_t id, int x, int y) @@ -149,6 +153,7 @@ DSWaylandSeat *DSWaylandTouch::seat() return priv->__seat; } +/*LCOV_EXCL_START*/ void DSWaylandTouch::addClient(DSWaylandClient *client, uint32_t id, int version) { DS_GET_PRIV(DSWaylandTouch); @@ -157,6 +162,7 @@ void DSWaylandTouch::addClient(DSWaylandClient *client, uint32_t id, int version priv->add(client->wlClient(), id, version); } +/*LCOV_EXCL_STOP*/ void DSWaylandTouch::setFocus(DSWaylandSurface *waylandSurface) { diff --git a/src/DSWaylandServer/DSWaylandTouch.h b/src/DSWaylandServer/DSWaylandTouch.h index 8f251c1..203bbc6 100644 --- a/src/DSWaylandServer/DSWaylandTouch.h +++ b/src/DSWaylandServer/DSWaylandTouch.h @@ -30,6 +30,7 @@ namespace display_server { +/*LCOV_EXCL_START*/ class DSWaylandSeat; class DSWaylandTouchPrivate; class DSWaylandClient; @@ -58,6 +59,7 @@ protected: private: }; +/*LCOV_EXCL_STOP*/ } diff --git a/src/DSWaylandServer/DSWaylandZxdgShellV6.cpp b/src/DSWaylandServer/DSWaylandZxdgShellV6.cpp index 40ba862..e3e49bf 100644 --- a/src/DSWaylandServer/DSWaylandZxdgShellV6.cpp +++ b/src/DSWaylandServer/DSWaylandZxdgShellV6.cpp @@ -36,6 +36,7 @@ namespace display_server { +/*LCOV_EXCL_START*/ /****************************************** DSWaylandZxdgShellV6 *****************************************/ @@ -676,6 +677,7 @@ void DSWaylandZxdgPopupV6Private::zxdg_popup_v6_destroy(zxdg_popup_v6::Resource void DSWaylandZxdgPopupV6Private::zxdg_popup_v6_grab(zxdg_popup_v6::Resource *resource, struct ::wl_resource *seat, uint32_t serial) { } +/*LCOV_EXCL_STOP*/ } // namespace display_server diff --git a/src/DSWaylandServer/DSWaylandZxdgShellV6.h b/src/DSWaylandServer/DSWaylandZxdgShellV6.h index 0ba2f2a..8c539c2 100644 --- a/src/DSWaylandServer/DSWaylandZxdgShellV6.h +++ b/src/DSWaylandServer/DSWaylandZxdgShellV6.h @@ -34,6 +34,7 @@ namespace display_server { +/*LCOV_EXCL_START*/ class DSWaylandCompositor; class DSWaylandZxdgShellV6; class DSWaylandZxdgPositionerV6; @@ -145,7 +146,7 @@ public: void init(DSWaylandZxdgSurfaceV6 *zxdgSurface, struct ::wl_client *client, int id, int ver); void sendConfigure(int x, int y, unsigned int w, unsigned int h); }; - +/*LCOV_EXCL_STOP*/ } diff --git a/src/DSWaylandServer/DSWaylandZxdgShellV6Private.h b/src/DSWaylandServer/DSWaylandZxdgShellV6Private.h index 0369b2e..bd35be9 100644 --- a/src/DSWaylandServer/DSWaylandZxdgShellV6Private.h +++ b/src/DSWaylandServer/DSWaylandZxdgShellV6Private.h @@ -32,6 +32,7 @@ namespace display_server { +/*LCOV_EXCL_START*/ class DSWaylandZxdgShellV6Private : public DSObjectPrivate, public DSWaylandServer::zxdg_shell_v6 { DS_PIMPL_USE_PUBLIC(DSWaylandZxdgShellV6); @@ -181,7 +182,7 @@ protected: private: DSWaylandZxdgSurfaceV6 *__zxdgSurface; }; - +/*LCOV_EXCL_STOP*/ } diff --git a/src/DSWaylandServer/IDSWaylandShell.h b/src/DSWaylandServer/IDSWaylandShell.h index d64a1bc..0de876a 100644 --- a/src/DSWaylandServer/IDSWaylandShell.h +++ b/src/DSWaylandServer/IDSWaylandShell.h @@ -33,6 +33,7 @@ namespace display_server { +/*LCOV_EXCL_START*/ class IDSWaylandShellSurface; class IDSWaylandShell : public DSObject @@ -59,7 +60,7 @@ public: virtual void sendConfigure(int x, int y, unsigned int w, unsigned int h) = 0; }; - +/*LCOV_EXCL_STOP*/ } diff --git a/src/DSWaylandServer/dswayland-server-tizen-extension.cpp b/src/DSWaylandServer/dswayland-server-tizen-extension.cpp index 66269f9..15a014c 100644 --- a/src/DSWaylandServer/dswayland-server-tizen-extension.cpp +++ b/src/DSWaylandServer/dswayland-server-tizen-extension.cpp @@ -1971,7 +1971,6 @@ namespace DSWaylandServer { y); } -/*LCOV_EXCL_START*/ tizen_move_resize::tizen_move_resize(struct ::wl_client *client, uint32_t id, int version) : m_resource_map() , m_resource(NULL) @@ -2201,9 +2200,7 @@ namespace DSWaylandServer { h, error_state); } -/*LCOV_EXCL_STOP*/ -/*LCOV_EXCL_START*/ tizen_gesture::tizen_gesture(struct ::wl_client *client, uint32_t id, int version) : m_resource_map() , m_resource(NULL) @@ -2841,9 +2838,7 @@ namespace DSWaylandServer { active, error); } -/*LCOV_EXCL_STOP*/ -/*LCOV_EXCL_START*/ tizen_keyrouter::tizen_keyrouter(struct ::wl_client *client, uint32_t id, int version) : m_resource_map() , m_resource(NULL) @@ -3361,9 +3356,7 @@ namespace DSWaylandServer { key, mode); } -/*LCOV_EXCL_STOP*/ -/*LCOV_EXCL_START*/ tizen_screenshooter::tizen_screenshooter(struct ::wl_client *client, uint32_t id, int version) : m_resource_map() , m_resource(NULL) @@ -3610,9 +3603,7 @@ namespace DSWaylandServer { resource, noti); } -/*LCOV_EXCL_STOP*/ -/*LCOV_EXCL_START*/ tizen_screenmirror::tizen_screenmirror(struct ::wl_client *client, uint32_t id, int version) : m_resource_map() , m_resource(NULL) @@ -3922,9 +3913,7 @@ namespace DSWaylandServer { tizen_screenmirror_send_stop( resource); } -/*LCOV_EXCL_STOP*/ -/*LCOV_EXCL_START*/ tizen_video::tizen_video(struct ::wl_client *client, uint32_t id, int version) : m_resource_map() , m_resource(NULL) @@ -4153,9 +4142,7 @@ namespace DSWaylandServer { resource, format); } -/*LCOV_EXCL_STOP*/ -/*LCOV_EXCL_START*/ tizen_video_object::tizen_video_object(struct ::wl_client *client, uint32_t id, int version) : m_resource_map() , m_resource(NULL) @@ -4455,9 +4442,7 @@ namespace DSWaylandServer { max_h, prefer_align); } -/*LCOV_EXCL_STOP*/ -/*LCOV_EXCL_START*/ tizen_subsurface_watcher::tizen_subsurface_watcher(struct ::wl_client *client, uint32_t id, int version) : m_resource_map() , m_resource(NULL) @@ -4648,9 +4633,7 @@ namespace DSWaylandServer { resource, value); } -/*LCOV_EXCL_STOP*/ -/*LCOV_EXCL_START*/ tizen_viewport::tizen_viewport(struct ::wl_client *client, uint32_t id, int version) : m_resource_map() , m_resource(NULL) @@ -5019,9 +5002,7 @@ namespace DSWaylandServer { width, height); } -/*LCOV_EXCL_STOP*/ -/*LCOV_EXCL_START*/ tizen_destination_mode::tizen_destination_mode(struct ::wl_client *client, uint32_t id, int version) : m_resource_map() , m_resource(NULL) @@ -5320,9 +5301,7 @@ namespace DSWaylandServer { w, h); } -/*LCOV_EXCL_STOP*/ -/*LCOV_EXCL_START*/ tizen_embedded_compositor::tizen_embedded_compositor(struct ::wl_client *client, uint32_t id, int version) : m_resource_map() , m_resource(NULL) @@ -5528,9 +5507,7 @@ namespace DSWaylandServer { resource, sock_fd); } -/*LCOV_EXCL_STOP*/ -/*LCOV_EXCL_START*/ tizen_input_device_manager::tizen_input_device_manager(struct ::wl_client *client, uint32_t id, int version) : m_resource_map() , m_resource(NULL) @@ -5560,7 +5537,6 @@ namespace DSWaylandServer { { init(resource); } -/*LCOV_EXCL_STOP*/ tizen_input_device_manager::tizen_input_device_manager() : m_resource_map() @@ -5585,7 +5561,6 @@ namespace DSWaylandServer { } } -/*LCOV_EXCL_START*/ void tizen_input_device_manager::init(struct ::wl_client *client, uint32_t id, int version) { m_resource = bind(client, id, version); @@ -5602,7 +5577,6 @@ namespace DSWaylandServer { m_resource_map.insert(std::pair(client, resource)); return resource; } -/*LCOV_EXCL_STOP*/ tizen_input_device_manager::Resource *tizen_input_device_manager::add(struct ::wl_client *client, uint32_t id, int version) { @@ -5701,7 +5675,6 @@ namespace DSWaylandServer { tizen_input_device_manager::handle_generate_axis }; -/*LCOV_EXCL_START*/ void tizen_input_device_manager::tizen_input_device_manager_block_events(Resource *, uint32_t , uint32_t , uint32_t ) { } @@ -5990,9 +5963,7 @@ namespace DSWaylandServer { tizen_input_device_manager_send_block_expired( resource); } -/*LCOV_EXCL_STOP*/ -/*LCOV_EXCL_START*/ tizen_input_device::tizen_input_device(struct ::wl_client *client, uint32_t id, int version) : m_resource_map() , m_resource(NULL) @@ -6022,7 +5993,6 @@ namespace DSWaylandServer { { init(resource); } -/*LCOV_EXCL_STOP*/ tizen_input_device::tizen_input_device() : m_resource_map() @@ -6047,7 +6017,6 @@ namespace DSWaylandServer { } } -/*LCOV_EXCL_START*/ void tizen_input_device::init(struct ::wl_client *client, uint32_t id, int version) { m_resource = bind(client, id, version); @@ -6057,7 +6026,6 @@ namespace DSWaylandServer { { m_resource = bind(resource); } -/*LCOV_EXCL_STOP*/ tizen_input_device::Resource *tizen_input_device::add(struct ::wl_client *client, int version) { @@ -6066,7 +6034,6 @@ namespace DSWaylandServer { return resource; } -/*LCOV_EXCL_START*/ tizen_input_device::Resource *tizen_input_device::add(struct ::wl_client *client, uint32_t id, int version) { Resource *resource = bind(client, id, version); @@ -6082,7 +6049,6 @@ namespace DSWaylandServer { m_displayDestroyedListener.parent = this; wl_display_add_destroy_listener(display, &m_displayDestroyedListener); } -/*LCOV_EXCL_STOP*/ const struct wl_interface *tizen_input_device::interface() { @@ -6102,13 +6068,11 @@ namespace DSWaylandServer { { } -/*LCOV_EXCL_START*/ void tizen_input_device::bind_func(struct ::wl_client *client, void *data, uint32_t version, uint32_t id) { tizen_input_device *that = static_cast(data); that->add(client, id, std::min(that->m_globalVersion, version)); } -/*LCOV_EXCL_STOP*/ void tizen_input_device::display_destroy_func(struct ::wl_listener *listener, void *data) { @@ -6158,7 +6122,6 @@ namespace DSWaylandServer { tizen_input_device::handle_release }; -/*LCOV_EXCL_START*/ void tizen_input_device::tizen_input_device_select_axes(Resource *, struct ::wl_array *) { } @@ -6260,9 +6223,7 @@ namespace DSWaylandServer { axis_type, value); } -/*LCOV_EXCL_STOP*/ -/*LCOV_EXCL_START*/ tizen_launchscreen::tizen_launchscreen(struct ::wl_client *client, uint32_t id, int version) : m_resource_map() , m_resource(NULL) @@ -6451,9 +6412,7 @@ namespace DSWaylandServer { static_cast(r->tizen_launchscreen_object)->tizen_launchscreen_destroy( r); } -/*LCOV_EXCL_STOP*/ -/*LCOV_EXCL_START*/ tizen_launch_image::tizen_launch_image(struct ::wl_client *client, uint32_t id, int version) : m_resource_map() , m_resource(NULL) @@ -6699,9 +6658,7 @@ namespace DSWaylandServer { static_cast(r->tizen_launch_image_object)->tizen_launch_image_hide( r); } -/*LCOV_EXCL_STOP*/ -/*LCOV_EXCL_START*/ tizen_effect::tizen_effect(struct ::wl_client *client, uint32_t id, int version) : m_resource_map() , m_resource(NULL) @@ -6916,9 +6873,7 @@ namespace DSWaylandServer { surface, type); } -/*LCOV_EXCL_STOP*/ -/*LCOV_EXCL_START*/ tizen_display_policy::tizen_display_policy(struct ::wl_client *client, uint32_t id, int version) : m_resource_map() , m_resource(NULL) @@ -7132,7 +7087,6 @@ namespace DSWaylandServer { brightness, error_state); } -/*LCOV_EXCL_STOP*/ tizen_indicator::tizen_indicator(struct ::wl_client *client, uint32_t id, int version) : m_resource_map() @@ -7384,7 +7338,6 @@ namespace DSWaylandServer { type); } -/*LCOV_EXCL_START*/ tizen_clipboard::tizen_clipboard(struct ::wl_client *client, uint32_t id, int version) : m_resource_map() , m_resource(NULL) @@ -7646,9 +7599,7 @@ namespace DSWaylandServer { resource, allowed); } -/*LCOV_EXCL_STOP*/ -/*LCOV_EXCL_START*/ tizen_screen_rotation::tizen_screen_rotation(struct ::wl_client *client, uint32_t id, int version) : m_resource_map() , m_resource(NULL) @@ -7861,5 +7812,3 @@ namespace DSWaylandServer { } /*LCOV_EXCL_STOP*/ - -/*LCOV_EXCL_STOP*/ diff --git a/src/DSWaylandServer/dswayland-server-tizen-extension.h b/src/DSWaylandServer/dswayland-server-tizen-extension.h index 509acfc..cdc2b1f 100644 --- a/src/DSWaylandServer/dswayland-server-tizen-extension.h +++ b/src/DSWaylandServer/dswayland-server-tizen-extension.h @@ -745,7 +745,6 @@ namespace DSWaylandServer { DisplayDestroyedListener m_displayDestroyedListener; }; -/*LCOV_EXCL_START*/ class tizen_move_resize { public: @@ -845,9 +844,7 @@ namespace DSWaylandServer { }; DisplayDestroyedListener m_displayDestroyedListener; }; -/*LCOV_EXCL_STOP*/ -/*LCOV_EXCL_START*/ class tizen_gesture { public: @@ -1059,9 +1056,7 @@ namespace DSWaylandServer { }; DisplayDestroyedListener m_displayDestroyedListener; }; -/*LCOV_EXCL_STOP*/ -/*LCOV_EXCL_START*/ class tizen_keyrouter { public: @@ -1241,9 +1236,7 @@ namespace DSWaylandServer { }; DisplayDestroyedListener m_displayDestroyedListener; }; -/*LCOV_EXCL_STOP*/ -/*LCOV_EXCL_START*/ class tizen_screenshooter { public: @@ -1340,9 +1333,7 @@ namespace DSWaylandServer { }; DisplayDestroyedListener m_displayDestroyedListener; }; -/*LCOV_EXCL_STOP*/ -/*LCOV_EXCL_START*/ class tizen_screenmirror { public: @@ -1463,9 +1454,7 @@ namespace DSWaylandServer { }; DisplayDestroyedListener m_displayDestroyedListener; }; -/*LCOV_EXCL_STOP*/ -/*LCOV_EXCL_START*/ class tizen_video { public: @@ -1567,9 +1556,7 @@ namespace DSWaylandServer { }; DisplayDestroyedListener m_displayDestroyedListener; }; -/*LCOV_EXCL_STOP*/ -/*LCOV_EXCL_START*/ class tizen_video_object { public: @@ -1677,9 +1664,7 @@ namespace DSWaylandServer { }; DisplayDestroyedListener m_displayDestroyedListener; }; -/*LCOV_EXCL_STOP*/ -/*LCOV_EXCL_START*/ class tizen_subsurface_watcher { public: @@ -1769,9 +1754,7 @@ namespace DSWaylandServer { }; DisplayDestroyedListener m_displayDestroyedListener; }; -/*LCOV_EXCL_STOP*/ -/*LCOV_EXCL_START*/ class tizen_viewport { public: @@ -1903,9 +1886,7 @@ namespace DSWaylandServer { }; DisplayDestroyedListener m_displayDestroyedListener; }; -/*LCOV_EXCL_STOP*/ -/*LCOV_EXCL_START*/ class tizen_destination_mode { public: @@ -2038,9 +2019,7 @@ namespace DSWaylandServer { }; DisplayDestroyedListener m_displayDestroyedListener; }; -/*LCOV_EXCL_STOP*/ -/*LCOV_EXCL_START*/ class tizen_embedded_compositor { public: @@ -2128,7 +2107,6 @@ namespace DSWaylandServer { }; DisplayDestroyedListener m_displayDestroyedListener; }; -/*LCOV_EXCL_STOP*/ class tizen_input_device_manager { @@ -2431,7 +2409,6 @@ namespace DSWaylandServer { DisplayDestroyedListener m_displayDestroyedListener; }; -/*LCOV_EXCL_START*/ class tizen_launchscreen { public: @@ -2517,9 +2494,7 @@ namespace DSWaylandServer { }; DisplayDestroyedListener m_displayDestroyedListener; }; -/*LCOV_EXCL_STOP*/ -/*LCOV_EXCL_START*/ class tizen_launch_image { public: @@ -2640,9 +2615,7 @@ namespace DSWaylandServer { }; DisplayDestroyedListener m_displayDestroyedListener; }; -/*LCOV_EXCL_STOP*/ -/*LCOV_EXCL_START*/ class tizen_effect { public: @@ -2735,9 +2708,7 @@ namespace DSWaylandServer { }; DisplayDestroyedListener m_displayDestroyedListener; }; -/*LCOV_EXCL_STOP*/ -/*LCOV_EXCL_START*/ class tizen_display_policy { public: @@ -2832,7 +2803,6 @@ namespace DSWaylandServer { }; DisplayDestroyedListener m_displayDestroyedListener; }; -/*LCOV_EXCL_STOP*/ class tizen_indicator { @@ -2955,7 +2925,6 @@ namespace DSWaylandServer { DisplayDestroyedListener m_displayDestroyedListener; }; -/*LCOV_EXCL_START*/ class tizen_clipboard { public: @@ -3056,9 +3025,7 @@ namespace DSWaylandServer { }; DisplayDestroyedListener m_displayDestroyedListener; }; -/*LCOV_EXCL_STOP*/ -/*LCOV_EXCL_START*/ class tizen_screen_rotation { public: @@ -3151,4 +3118,3 @@ namespace DSWaylandServer { /*LCOV_EXCL_STOP*/ #endif -/*LCOV_EXCL_STOP*/ -- 2.7.4 From d479b3deb077668c35944991d2e23f43c331e762 Mon Sep 17 00:00:00 2001 From: SooChan Lim Date: Mon, 7 Sep 2020 17:47:02 +0900 Subject: [PATCH 02/16] tests: enhance the coverage for DSWaylandSurface Change-Id: I708a6fc597911c54d9bfe7711fc2563b82dfb8d9 --- tests/DSWaylandSurface-test.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/DSWaylandSurface-test.cpp b/tests/DSWaylandSurface-test.cpp index a83d794..d8db123 100644 --- a/tests/DSWaylandSurface-test.cpp +++ b/tests/DSWaylandSurface-test.cpp @@ -137,6 +137,10 @@ TEST_F(DSWaylandSurfaceTest, registerCallbackSurfaceCommitted) wl_surface_attach(testClient->surface, testClient->buffer, 0, 0); wl_surface_damage(testClient->surface, 0, 0, 100, 100); + wl_surface_set_buffer_transform(testClient->surface, 0); + wl_surface_set_buffer_scale(testClient->surface, 1); + wl_surface_damage_buffer(testClient->surface, 0, 0, 100, 100); + wl_surface_frame(testClient->surface); wl_surface_commit(testClient->surface); wl_display_roundtrip(testClient->display); -- 2.7.4 From 36b7c4672f054b25db540ed1375a1efd1d4d6ff5 Mon Sep 17 00:00:00 2001 From: Joogab Yun Date: Wed, 2 Sep 2020 14:23:01 +0900 Subject: [PATCH 03/16] DSRenderViewDaliImpl:Renaming PropertyBuffer to VertexBuffer Change-Id: I4e5987f9508f4d212484cf4c3b74a22a22233219 Signed-off-by: SooChan Lim --- src/DSRender/DSRenderViewDaliImpl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/DSRender/DSRenderViewDaliImpl.cpp b/src/DSRender/DSRenderViewDaliImpl.cpp index 6595726..b8f4881 100644 --- a/src/DSRender/DSRenderViewDaliImpl.cpp +++ b/src/DSRender/DSRenderViewDaliImpl.cpp @@ -65,13 +65,13 @@ Geometry DSRenderViewDaliImpl::CreateTexturedQuad() { Vector2(-0.5f, 0.5f), Vector2(0.0f, 1.0f) }, { Vector2(0.5f, 0.5f), Vector2(1.0f, 1.0f) } }; - PropertyBuffer vertexBuffer; + VertexBuffer vertexBuffer; Property::Map vertexFormat; vertexFormat["aPosition"] = Property::VECTOR2; vertexFormat["aTexCoord"] = Property::VECTOR2; //Create a vertex buffer for vertex positions and texture coordinates - vertexBuffer = PropertyBuffer::New(vertexFormat); + vertexBuffer = VertexBuffer::New(vertexFormat); vertexBuffer.SetData(data, 4u); //Create the geometry -- 2.7.4 From b48a2f1a31693c2f9d4da9417f4bd6d9980e3d9e Mon Sep 17 00:00:00 2001 From: "Junseok, Kim" Date: Tue, 8 Sep 2020 11:31:02 +0900 Subject: [PATCH 04/16] DSKeyboard: add LCOV_EXCL for event functions Change-Id: I45e0b13abc87f14bbf831a4e2ad96bae6dc5c9db Signed-off-by: Junseok, Kim --- src/DSSeat/DSKeyboard.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/DSSeat/DSKeyboard.cpp b/src/DSSeat/DSKeyboard.cpp index c97f7e7..6b1180f 100644 --- a/src/DSSeat/DSKeyboard.cpp +++ b/src/DSSeat/DSKeyboard.cpp @@ -55,6 +55,7 @@ DSKeyboard::DSKeyboard(DSSeat *seat, DSWaylandKeyboard *keyboard) DSKeyboard::~DSKeyboard() {} +/*LCOV_EXCL_START*/ void DSKeyboard::processEvent(DSInputKeyboardEvent *ev, void *data) { //TODO : get kbdFocus and send event to it via DSWaylandKeyboard instance @@ -79,6 +80,7 @@ void DSKeyboard::processEvent(DSInputKeyboardEvent *ev, void *data) } } +/*LCOV_EXCL_STOP*/ void DSKeyboard::keyDown(uint32_t keycode) { @@ -112,6 +114,7 @@ void DSKeyboard::setRepeatDelay(uint32_t delay) } } +/*LCOV_EXCL_START*/ void DSKeyboard::setFocus(std::shared_ptr window) { if (!window) @@ -143,7 +146,9 @@ void DSKeyboard::setFocus(std::shared_ptr window) __dswlKeyboard->setFocus(waylandSurface); } +/*LCOV_EXCL_STOP*/ +/*LCOV_EXCL_START*/ void DSKeyboard::resetFocus() { if (__kbdFocus) @@ -155,6 +160,7 @@ void DSKeyboard::resetFocus() if (__dswlKeyboard) __dswlKeyboard->resetFocus(); } +/*LCOV_EXCL_STOP*/ std::shared_ptr DSKeyboard::getFocus() { -- 2.7.4 From bd5a0aae8271f3d95d27070ccc1de4b4ab43f51f Mon Sep 17 00:00:00 2001 From: "Junseok, Kim" Date: Tue, 8 Sep 2020 11:31:23 +0900 Subject: [PATCH 05/16] DSPointer: add LCOV_EXCL for event functions Change-Id: I62ea6fc6e6ac9cfe7d0369410a85426b4be66864 Signed-off-by: Junseok, Kim --- src/DSSeat/DSPointer.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/DSSeat/DSPointer.cpp b/src/DSSeat/DSPointer.cpp index 02e3b3b..2f7b1e1 100644 --- a/src/DSSeat/DSPointer.cpp +++ b/src/DSSeat/DSPointer.cpp @@ -51,6 +51,7 @@ DSPointer::DSPointer(DSSeat *seat, DSWaylandPointer *pointer) DSPointer::~DSPointer() {} +/*LCOV_EXCL_START*/ void DSPointer::processEvent(DSInputMouseEvent *ev, void *data) { //TODO : get ptrFocus and send event to it via DSWaylandPointer instance @@ -99,7 +100,9 @@ void DSPointer::processEvent(DSInputMouseEvent *ev, void *data) return; } } +/*LCOV_EXCL_STOP*/ +/*LCOV_EXCL_START*/ void DSPointer::mouseDown(uint32_t button) { if (__ptrFocus && __dswlPointer) @@ -107,7 +110,9 @@ void DSPointer::mouseDown(uint32_t button) __dswlPointer->sendButtonDown(button); } } +/*LCOV_EXCL_STOP*/ +/*LCOV_EXCL_START*/ void DSPointer::mouseUp(uint32_t button) { if (__ptrFocus && __dswlPointer) @@ -115,7 +120,9 @@ void DSPointer::mouseUp(uint32_t button) __dswlPointer->sendButtonUp(button); } } +/*LCOV_EXCL_STOP*/ +/*LCOV_EXCL_START*/ void DSPointer::mouseMove(int x, int y) { if (__ptrFocus && __dswlPointer) @@ -123,7 +130,9 @@ void DSPointer::mouseMove(int x, int y) __dswlPointer->sendMotion(x, y); } } +/*LCOV_EXCL_STOP*/ +/*LCOV_EXCL_START*/ void DSPointer::mouseIn(int x, int y) { if (__dswlPointer) @@ -131,7 +140,9 @@ void DSPointer::mouseIn(int x, int y) __dswlPointer->sendEnter(x, y); } } +/*LCOV_EXCL_STOP*/ +/*LCOV_EXCL_START*/ void DSPointer::mouseOut() { if (__dswlPointer) @@ -139,7 +150,9 @@ void DSPointer::mouseOut() __dswlPointer->sendLeave(); } } +/*LCOV_EXCL_STOP*/ +/*LCOV_EXCL_START*/ void DSPointer::setFocus(std::shared_ptr window) { if (!window) @@ -170,7 +183,9 @@ void DSPointer::setFocus(std::shared_ptr window) __dswlPointer->setFocus(waylandSurface); } +/*LCOV_EXCL_STOP*/ +/*LCOV_EXCL_START*/ void DSPointer::resetFocus() { if (__ptrFocus) @@ -182,6 +197,7 @@ void DSPointer::resetFocus() if (__dswlPointer) __dswlPointer->resetFocus(); } +/*LCOV_EXCL_STOP*/ std::shared_ptr DSPointer::getFocus() { -- 2.7.4 From fc530b455818e33dc67689feb53902d88e3d8184 Mon Sep 17 00:00:00 2001 From: "Junseok, Kim" Date: Tue, 8 Sep 2020 11:31:40 +0900 Subject: [PATCH 06/16] DSSeat: add LCOV_EXCL for event functions Change-Id: If93d9a62ca14f7f0d0645b7ecbf82afa8beb191f Signed-off-by: Junseok, Kim --- src/DSSeat/DSSeat.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/DSSeat/DSSeat.cpp b/src/DSSeat/DSSeat.cpp index 87e69fb..bc1470d 100644 --- a/src/DSSeat/DSSeat.cpp +++ b/src/DSSeat/DSSeat.cpp @@ -203,6 +203,7 @@ void DSSeat::slotDeviceAdd(std::shared_ptr device) } } +/*LCOV_EXCL_START*/ void DSSeat::slotDeviceRemove(std::shared_ptr device) { DSLOG_INF("DSSeat", ""); @@ -248,6 +249,7 @@ void DSSeat::slotDeviceRemove(std::shared_ptr device) if (capNeedUpdate) __dswlSeat->setCapability((DSWaylandSeat::seatCapability)cap); } +/*LCOV_EXCL_STOP*/ void DSSeat::addPointer() { @@ -269,6 +271,7 @@ void DSSeat::addPointer() __numPointer++; } +/*LCOV_EXCL_START*/ void DSSeat::addKeyboard() { if (0 < __numKeyboard) @@ -288,7 +291,9 @@ void DSSeat::addKeyboard() __numKeyboard++; } +/*LCOV_EXCL_STOP*/ +/*LCOV_EXCL_START*/ void DSSeat::addTouch() { if (0 < __numTouch) @@ -308,7 +313,9 @@ void DSSeat::addTouch() __numTouch++; } +/*LCOV_EXCL_STOP*/ +/*LCOV_EXCL_START*/ void DSSeat::removePointer() { if (0 >= __numPointer) @@ -330,7 +337,9 @@ void DSSeat::removePointer() __pointer = nullptr; } } +/*LCOV_EXCL_STOP*/ +/*LCOV_EXCL_START*/ void DSSeat::removeKeyboard() { if (0 >= __numKeyboard) @@ -352,7 +361,9 @@ void DSSeat::removeKeyboard() __keyboard = nullptr; } } +/*LCOV_EXCL_STOP*/ +/*LCOV_EXCL_START*/ void DSSeat::removeTouch() { if (0 >= __numTouch) @@ -374,6 +385,7 @@ void DSSeat::removeTouch() __touch = nullptr; } } +/*LCOV_EXCL_STOP*/ bool DSSeat::hasPointer() { @@ -400,6 +412,7 @@ std::string DSSeat::getName() return __dswlSeat->getName(); } +/*LCOV_EXCL_START*/ void DSSeat::__onKeyEvent(DSInputKeyboardEvent *ev) { if (__keyboard == nullptr) @@ -411,7 +424,9 @@ void DSSeat::__onKeyEvent(DSInputKeyboardEvent *ev) __dswlSeat->setCurrentEventTime(ev->getTimestamp()); __keyboard->processEvent(ev, nullptr); } +/*LCOV_EXCL_STOP*/ +/*LCOV_EXCL_START*/ void DSSeat::__onPointerEvent(DSInputMouseEvent *ev) { if (__pointer == nullptr) @@ -463,7 +478,9 @@ void DSSeat::__onPointerEvent(DSInputMouseEvent *ev) __pointer->processEvent(ev, nullptr); } +/*LCOV_EXCL_STOP*/ +/*LCOV_EXCL_START*/ void DSSeat::__onTouchEvent(DSInputTouchEvent *ev) { int winX; @@ -514,12 +531,16 @@ void DSSeat::__onTouchEvent(DSInputTouchEvent *ev) __dswlSeat->setCurrentEventTime(ev->getTimestamp()); __touch->processEvent(ev, nullptr); } +/*LCOV_EXCL_STOP*/ +/*LCOV_EXCL_START*/ void DSSeat::__onWindowStackChanged(std::shared_ptr topWindow) { __stackChanged = true; } +/*LCOV_EXCL_STOP*/ +/*LCOV_EXCL_START*/ void DSSeat::__onWindowCreated(std::shared_ptr window) { DSLOG_INF("DSSeat", "window created : %p (%p)", window, window.get()); @@ -547,7 +568,9 @@ void DSSeat::__onWindowCreated(std::shared_ptr window) } } } +/*LCOV_EXCL_STOP*/ +/*LCOV_EXCL_START*/ void DSSeat::__onWindowDestroy(std::shared_ptr window) { DSLOG_INF("DSSeat", "window destroy : %p (%p)", window, window.get()); @@ -588,7 +611,9 @@ void DSSeat::__onWindowDestroy(std::shared_ptr window) } } } +/*LCOV_EXCL_STOP*/ +/*LCOV_EXCL_START*/ Eina_Bool DSSeat::inputEventHandlerKey(void *data, int type, void *event) { DSInputKeyboardEvent *ev = static_cast< DSInputKeyboardEvent* >(event); @@ -596,7 +621,9 @@ Eina_Bool DSSeat::inputEventHandlerKey(void *data, int type, void *event) return EINA_TRUE; } +/*LCOV_EXCL_STOP*/ +/*LCOV_EXCL_START*/ Eina_Bool DSSeat::inputEventHandlerMouse(void *data, int type, void *event) { DSInputMouseEvent *ev = static_cast< DSInputMouseEvent* >(event); @@ -604,7 +631,9 @@ Eina_Bool DSSeat::inputEventHandlerMouse(void *data, int type, void *event) return EINA_TRUE; } +/*LCOV_EXCL_STOP*/ +/*LCOV_EXCL_START*/ Eina_Bool DSSeat::inputEventHandlerTouch(void *data, int type, void *event) { DSInputTouchEvent *ev = static_cast< DSInputTouchEvent* >(event); @@ -612,6 +641,7 @@ Eina_Bool DSSeat::inputEventHandlerTouch(void *data, int type, void *event) return EINA_TRUE; } +/*LCOV_EXCL_STOP*/ std::shared_ptr DSSeat::getTopWindow(std::shared_ptr winExcl) { -- 2.7.4 From f6db906d6a8c0c7565f570dd0a88dc7d6ad680e2 Mon Sep 17 00:00:00 2001 From: "Junseok, Kim" Date: Tue, 8 Sep 2020 11:32:01 +0900 Subject: [PATCH 07/16] DSTouch: add LCOV_EXCL for event functions Change-Id: I93abbda15d38e9746f474eb2461bd40e42af3220 Signed-off-by: Junseok, Kim --- src/DSSeat/DSTouch.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/DSSeat/DSTouch.cpp b/src/DSSeat/DSTouch.cpp index 37b17fb..a9fe988 100644 --- a/src/DSSeat/DSTouch.cpp +++ b/src/DSSeat/DSTouch.cpp @@ -49,6 +49,7 @@ DSTouch::DSTouch(DSSeat *seat, DSWaylandTouch *touch) DSTouch::~DSTouch() {} +/*LCOV_EXCL_START*/ void DSTouch::processEvent(DSInputTouchEvent *ev, void *data) { //TODO : get touchFocus and send event to it via DSWaylandTouch instance @@ -80,7 +81,9 @@ void DSTouch::processEvent(DSInputTouchEvent *ev, void *data) touchMove(ev->getIndex(), ev->getWinX(), ev->getWinY()); } } +/*LCOV_EXCL_STOP*/ +/*LCOV_EXCL_START*/ void DSTouch::touchDown(int32_t id, int x, int y) { if (__touchFocus && __dswlTouch) @@ -88,7 +91,9 @@ void DSTouch::touchDown(int32_t id, int x, int y) __dswlTouch->sendDown(id, x, y); } } +/*LCOV_EXCL_STOP*/ +/*LCOV_EXCL_START*/ void DSTouch::touchUp(int32_t id) { if (__touchFocus && __dswlTouch) @@ -96,7 +101,9 @@ void DSTouch::touchUp(int32_t id) __dswlTouch->sendUp(id); } } +/*LCOV_EXCL_STOP*/ +/*LCOV_EXCL_START*/ void DSTouch::touchMove(int32_t id, int x, int y) { if (__touchFocus && __dswlTouch) @@ -104,7 +111,9 @@ void DSTouch::touchMove(int32_t id, int x, int y) __dswlTouch->sendMotion(id, x, y); } } +/*LCOV_EXCL_STOP*/ +/*LCOV_EXCL_START*/ void DSTouch::setFocus(std::shared_ptr window) { if (!window) @@ -135,7 +144,9 @@ void DSTouch::setFocus(std::shared_ptr window) __dswlTouch->setFocus(waylandSurface); } +/*LCOV_EXCL_STOP*/ +/*LCOV_EXCL_START*/ void DSTouch::resetFocus() { if (__touchFocus) @@ -147,6 +158,7 @@ void DSTouch::resetFocus() if (__dswlTouch) __dswlTouch->resetFocus(); } +/*LCOV_EXCL_STOP*/ std::shared_ptr DSTouch::getFocus() { -- 2.7.4 From ae37d48b7e219c96750d19aac73eae58c1669d40 Mon Sep 17 00:00:00 2001 From: Sung-Jin Park Date: Tue, 8 Sep 2020 11:35:21 +0900 Subject: [PATCH 08/16] DSUtil: define LCOV_EXCL blocks for error handling code Change-Id: I4f2eedf8056e040c5698c0ec31984d982640c423 Signed-off-by: Sung-Jin Park --- src/DSUtil/DSUtilSocket.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/DSUtil/DSUtilSocket.cpp b/src/DSUtil/DSUtilSocket.cpp index 9c0e0ff..0e25111 100644 --- a/src/DSUtil/DSUtilSocket.cpp +++ b/src/DSUtil/DSUtilSocket.cpp @@ -112,8 +112,10 @@ void DSUtilSocket::initSocket(std::string socketName) int nameLength = socketName.length(); if ((dirLength + nameLength + 2) > STRERR_BUFSIZE) { + /*LCOV_EXCL_START*/ DSLOG_WRN("DSUtilSocket", "Size of buffer is not enough. dir:%s name:%s", xdgDir, socketName); return; + /*LCOV_EXCL_STOP*/ } //snprintf(socket_path, sizeof(socket_path), "%s/%s", dir, name); @@ -125,17 +127,21 @@ void DSUtilSocket::initSocket(std::string socketName) res = chmod(socketPath.c_str(), 509); if (res < 0) { + /*LCOV_EXCL_START*/ DSLOG_WRN("DSUtilSocket", "Could not change modes of socket file:%s (%s)", socketPath.c_str(), strerror_r(errno, buf, STRERR_BUFSIZE)); //PRCTL("[Winsys] Could not chane modes of socket file: %s", socketPath.c_str()); return; + /*LCOV_EXCL_STOP*/ } res = chown(socketPath.c_str(), uid, gid); if (res < 0) { + /*LCOV_EXCL_START*/ DSLOG_WRN("DSUtilSocket", "Could not change owner of socket file:%s (%s)", socketPath.c_str(), strerror_r(errno, buf, STRERR_BUFSIZE)); //PRCTL("[Winsys] Could not change owner of socket file: %s", socketPath.c_str()); return; + /*LCOV_EXCL_STOP*/ } } @@ -156,26 +162,32 @@ int DSUtilSocket::__getpwnam(std::string name) buf = (char *)malloc(bufLen); if (buf == NULL) { + /*LCOV_EXCL_START*/ DSLOG_WRN("DSUtilSocket", "failed to create buffer"); return 0; + /*LCOV_EXCL_STOP*/ } u = (struct ::passwd *)malloc(sizeof(struct passwd)); if (!u) { + /*LCOV_EXCL_START*/ DSLOG_WRN("DSUtilSocket", "failed to create password struct"); free(buf); return 0; + /*LCOV_EXCL_STOP*/ } ret = getpwnam_r(name.c_str(), u, buf, bufLen, &uRes); if (uRes == nullptr) { + /*LCOV_EXCL_START*/ if (ret == 0) DSLOG_WRN("DSUtilSocket", "password not found"); else DSLOG_WRN("DSUtilSocket", "errno returned by getpwnam_r is %d", ret); free(buf); free(u); return 0; + /*LCOV_EXCL_STOP*/ } ret = u->pw_uid; free(buf); @@ -201,26 +213,32 @@ int DSUtilSocket::__getgrnam(std::string name) buf = (char *)malloc(bufLen); if (buf == nullptr) { + /*LCOV_EXCL_START*/ DSLOG_WRN("DSUtilSocket", "failed to create buffer"); return 0; + /*LCOV_EXCL_STOP*/ } g = (struct ::group *)malloc(sizeof(struct group)); if (!g) { + /*LCOV_EXCL_START*/ DSLOG_WRN("DSUtilSocket", "failed to create group struct"); free(buf); return 0; + /*LCOV_EXCL_STOP*/ } ret = getgrnam_r(name.c_str(), g, buf, bufLen, &grpRes); if (grpRes == NULL) { + /*LCOV_EXCL_START*/ if (ret == 0) DSLOG_WRN("DSUtilSocket", "Group not found"); else DSLOG_WRN("DSUtilSocket", "errno returned by getpwnam_r is %d", ret); free(buf); free(g); return 0; + /*LCOV_EXCL_STOP*/ } ret = g->gr_gid; -- 2.7.4 From 4a656fc5877758632f206d34eb27517cdcbcfce9 Mon Sep 17 00:00:00 2001 From: Sung-Jin Park Date: Tue, 8 Sep 2020 11:49:05 +0900 Subject: [PATCH 09/16] DSWaylandServer: define LCOV_EXCL blocks for event handling logics from client Change-Id: I9de1b0722e2acdfe3660a7adb68567e5243f5b9b Signed-off-by: Sung-Jin Park --- src/DSWaylandServer/DSWaylandCallback.cpp | 2 ++ src/DSWaylandServer/DSWaylandPointer.cpp | 14 ++------------ src/DSWaylandServer/DSWaylandTextInput.cpp | 2 ++ src/DSWaylandServer/DSWaylandTextInputManagerPrivate.h | 2 ++ src/DSWaylandServer/DSWaylandTizenAppinfo.cpp | 4 ++-- .../DSWaylandTizenInputDeviceManagerPrivate.h | 2 ++ 6 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/DSWaylandServer/DSWaylandCallback.cpp b/src/DSWaylandServer/DSWaylandCallback.cpp index 3e4ae9a..04a6047 100644 --- a/src/DSWaylandServer/DSWaylandCallback.cpp +++ b/src/DSWaylandServer/DSWaylandCallback.cpp @@ -27,6 +27,7 @@ namespace display_server { +/*LCOV_EXCL_START*/ DSWaylandCallbackPrivate::DSWaylandCallbackPrivate(DSWaylandCallback *p_ptr) : DSObjectPrivate(p_ptr) { @@ -52,5 +53,6 @@ DSWaylandCallback::DSWaylandCallback() DSWaylandCallback::~DSWaylandCallback() { } +/*LCOV_EXCL_STOP*/ } /* namespace display_server */ diff --git a/src/DSWaylandServer/DSWaylandPointer.cpp b/src/DSWaylandServer/DSWaylandPointer.cpp index 3ed7813..e856c64 100644 --- a/src/DSWaylandServer/DSWaylandPointer.cpp +++ b/src/DSWaylandServer/DSWaylandPointer.cpp @@ -51,14 +51,6 @@ void DSWaylandPointerPrivate::setFocus(DSWaylandSurface *waylandSurface) { DSLOG_INF("DSWaylandPointerPrivate", "pointer focus changed (%p -> %p)", __waylandSurface, waylandSurface); -#if 0 - if (__waylandSurface) - { - DSLOG_INF("DSWaylandPointerPrivate", "send leave to %p", __waylandSurface); - send_leave(__wlPointerResource, __waylandSurface->getWlResource()); - } -#endif - __waylandSurface = waylandSurface; if (!waylandSurface || !waylandSurface->hasResource()) @@ -68,6 +60,7 @@ void DSWaylandPointerPrivate::setFocus(DSWaylandSurface *waylandSurface) return; } + /*LCOV_EXCL_START*/ struct ::wl_resource *surface = waylandSurface->getWlResource(); auto client = wl_resource_get_client(surface); @@ -90,10 +83,7 @@ void DSWaylandPointerPrivate::setFocus(DSWaylandSurface *waylandSurface) DSLOG_INF("DSWaylandPointerPrivate", "no wlPointerResource available"); return; } -#if 0 - DSLOG_INF("DSWaylandPointerPrivate", "send enter to %p", __waylandSurface); - sendEnter(__wlPointerResource, __waylandSurface->getWlResource(), surface_x, surface_y); -#endif + /*LCOV_EXCL_STOP*/ } DSWaylandSurface *DSWaylandPointerPrivate::getFocus() diff --git a/src/DSWaylandServer/DSWaylandTextInput.cpp b/src/DSWaylandServer/DSWaylandTextInput.cpp index 820e8ba..d365121 100644 --- a/src/DSWaylandServer/DSWaylandTextInput.cpp +++ b/src/DSWaylandServer/DSWaylandTextInput.cpp @@ -29,6 +29,7 @@ namespace display_server { +/*LCOV_EXCL_START*/ DSWaylandTextInputManagerPrivate::DSWaylandTextInputManagerPrivate(DSWaylandTextInputManager *p_ptr, DSWaylandCompositor *compositor) : DSObjectPrivate(p_ptr), __p_ptr(p_ptr), @@ -1120,5 +1121,6 @@ DSWaylandSurface* DSWaylandTextInput::getClientSurface() return priv->__clientSurface; } +/*LCOV_EXCL_STOP*/ } diff --git a/src/DSWaylandServer/DSWaylandTextInputManagerPrivate.h b/src/DSWaylandServer/DSWaylandTextInputManagerPrivate.h index dfa815c..fa5d557 100644 --- a/src/DSWaylandServer/DSWaylandTextInputManagerPrivate.h +++ b/src/DSWaylandServer/DSWaylandTextInputManagerPrivate.h @@ -33,6 +33,7 @@ namespace display_server { +/*LCOV_EXCL_START*/ class DS_DECL_EXPORT DSWaylandTextInputManagerPrivate : public DSObjectPrivate, public DSWaylandServer::wl_text_input_manager { DS_PIMPL_USE_PUBLIC(DSWaylandTextInputManager); @@ -46,6 +47,7 @@ protected: private: DSWaylandCompositor *__compositor; }; +/*LCOV_EXCL_STOP*/ } diff --git a/src/DSWaylandServer/DSWaylandTizenAppinfo.cpp b/src/DSWaylandServer/DSWaylandTizenAppinfo.cpp index 852db56..8bfbd02 100644 --- a/src/DSWaylandServer/DSWaylandTizenAppinfo.cpp +++ b/src/DSWaylandServer/DSWaylandTizenAppinfo.cpp @@ -59,11 +59,11 @@ void DSWaylandTizenAppinfoPrivate::tizen_launch_appinfo_destroy_resource(Resourc { DSLOG_DBG("TizenAppinfoPriv", ""); } +/*LCOV_EXCL_START*/ void DSWaylandTizenAppinfoPrivate::tizen_launch_appinfo_destroy(Resource *resource) { DSLOG_DBG("TizenAppinfoPriv", ""); } -/*LCOV_EXCL_START*/ void DSWaylandTizenAppinfoPrivate::tizen_launch_appinfo_register_pid(Resource *resource, uint32_t pid) { DSLOG_DBG("TizenAppinfoPriv", ""); @@ -76,7 +76,6 @@ void DSWaylandTizenAppinfoPrivate::tizen_launch_appinfo_set_appid(Resource *reso { DSLOG_DBG("TizenAppinfoPriv", ""); } -/*LCOV_EXCL_STOP*/ void DSWaylandTizenAppinfoPrivate::tizen_launch_appinfo_get_base_output_resolution(Resource *resource, uint32_t pid) { @@ -122,6 +121,7 @@ void DSWaylandTizenAppinfoPrivate::tizen_launch_appinfo_ready_metadata(Resource { DSLOG_DBG("TizenAppinfoPriv", ""); } +/*LCOV_EXCL_STOP*/ DSWaylandTizenAppinfo::DSWaylandTizenAppinfo(DSWaylandCompositor *wlCompositor) : DS_INIT_PRIVATE_PTR(DSWaylandTizenAppinfo), diff --git a/src/DSWaylandServer/DSWaylandTizenInputDeviceManagerPrivate.h b/src/DSWaylandServer/DSWaylandTizenInputDeviceManagerPrivate.h index 3850af7..7c5eeb8 100644 --- a/src/DSWaylandServer/DSWaylandTizenInputDeviceManagerPrivate.h +++ b/src/DSWaylandServer/DSWaylandTizenInputDeviceManagerPrivate.h @@ -31,6 +31,7 @@ namespace display_server { +/*LCOV_EXCL_START*/ class DSWaylandTizenInputDeviceManagerPrivate : public DSObjectPrivate, public DSWaylandServer::tizen_input_device_manager { DS_PIMPL_USE_PUBLIC(DSWaylandTizenInputDeviceManager); @@ -61,6 +62,7 @@ protected: private: struct ::wl_display *__display; }; +/*LCOV_EXCL_STOP*/ } -- 2.7.4 From 53cec53f1ab4b74ce91c1f244c72e73a4ff3f14e Mon Sep 17 00:00:00 2001 From: "Junseok, Kim" Date: Thu, 12 Nov 2020 11:17:46 +0900 Subject: [PATCH 10/16] dswayland-server: add new interface of input-method Change-Id: Icbfd28f6b77e54930524a1a467e09b4738525493 Signed-off-by: Junseok, Kim --- .../dswayland-server-input-method.cpp | 186 ++++++++++++++++++++- .../dswayland-server-input-method.h | 87 +++++++++- 2 files changed, 267 insertions(+), 6 deletions(-) diff --git a/src/DSWaylandServer/dswayland-server-input-method.cpp b/src/DSWaylandServer/dswayland-server-input-method.cpp index 34fb3e6..b9c41ac 100644 --- a/src/DSWaylandServer/dswayland-server-input-method.cpp +++ b/src/DSWaylandServer/dswayland-server-input-method.cpp @@ -1330,7 +1330,7 @@ namespace DSWaylandServer { } - void wl_input_method::send_show_input_panel(struct ::wl_resource *context) + void wl_input_method::send_show_input_panel(struct ::wl_resource *context, uint32_t degree) { DS_ASSERT_X(m_resource, "wl_input_method::show_input_panel", "Uninitialised resource"); if (DS_UNLIKELY(!m_resource)) { @@ -1339,14 +1339,16 @@ namespace DSWaylandServer { } send_show_input_panel( m_resource->handle, - context); + context, + degree); } - void wl_input_method::send_show_input_panel(struct ::wl_resource *resource, struct ::wl_resource *context) + void wl_input_method::send_show_input_panel(struct ::wl_resource *resource, struct ::wl_resource *context, uint32_t degree) { wl_input_method_send_show_input_panel( resource, - context); + context, + degree); } @@ -1787,6 +1789,182 @@ namespace DSWaylandServer { r, enabled); } + + wl_input_method_manager::wl_input_method_manager(struct ::wl_client *client, uint32_t id, int version) + : m_resource_map() + , m_resource(NULL) + , m_global(NULL) + , m_globalVersion(0) + , m_displayDestroyedListener() + { + init(client, id, version); + } + + wl_input_method_manager::wl_input_method_manager(struct ::wl_display *display, int version) + : m_resource_map() + , m_resource(NULL) + , m_global(NULL) + , m_globalVersion(0) + , m_displayDestroyedListener() + { + init(display, version); + } + + wl_input_method_manager::wl_input_method_manager(struct ::wl_resource *resource) + : m_resource_map() + , m_resource(NULL) + , m_global(NULL) + , m_globalVersion(0) + , m_displayDestroyedListener() + { + init(resource); + } + + wl_input_method_manager::wl_input_method_manager() + : m_resource_map() + , m_resource(NULL) + , m_global(NULL) + , m_globalVersion(0) + , m_displayDestroyedListener() + { + } + + wl_input_method_manager::~wl_input_method_manager() + { + std::multimap::iterator it; + for (it = m_resource_map.begin() ; it != m_resource_map.end() ; it++) { + wl_input_method_manager::Resource *resource = (*it).second; + wl_resource_set_implementation(resource->handle, NULL, NULL, NULL); + } + + if (m_global) { + wl_global_destroy(m_global); + wl_list_remove(&m_displayDestroyedListener.link); + } + } + + void wl_input_method_manager::init(struct ::wl_client *client, uint32_t id, int version) + { + m_resource = bind(client, id, version); + } + + void wl_input_method_manager::init(struct ::wl_resource *resource) + { + m_resource = bind(resource); + } + + wl_input_method_manager::Resource *wl_input_method_manager::add(struct ::wl_client *client, int version) + { + Resource *resource = bind(client, 0, version); + m_resource_map.insert(std::pair(client, resource)); + return resource; + } + + wl_input_method_manager::Resource *wl_input_method_manager::add(struct ::wl_client *client, uint32_t id, int version) + { + Resource *resource = bind(client, id, version); + m_resource_map.insert(std::pair(client, resource)); + return resource; + } + + void wl_input_method_manager::init(struct ::wl_display *display, int version) + { + m_global = wl_global_create(display, &::wl_input_method_manager_interface, version, this, bind_func); + m_globalVersion = version; + m_displayDestroyedListener.notify = wl_input_method_manager::display_destroy_func; + m_displayDestroyedListener.parent = this; + wl_display_add_destroy_listener(display, &m_displayDestroyedListener); + } + + const struct wl_interface *wl_input_method_manager::interface() + { + return &::wl_input_method_manager_interface; + } + + wl_input_method_manager::Resource *wl_input_method_manager::input_method_manager_allocate() + { + return new Resource; + } + + void wl_input_method_manager::input_method_manager_bind_resource(Resource *) + { + } + + void wl_input_method_manager::input_method_manager_destroy_resource(Resource *) + { + } + + void wl_input_method_manager::bind_func(struct ::wl_client *client, void *data, uint32_t version, uint32_t id) + { + wl_input_method_manager *that = static_cast(data); + that->add(client, id, std::min(that->m_globalVersion, version)); + } + + void wl_input_method_manager::display_destroy_func(struct ::wl_listener *listener, void *data) + { + DS_UNUSED(data); + wl_input_method_manager *that = static_cast(listener)->parent; + that->m_global = NULL; + } + + void wl_input_method_manager::destroy_func(struct ::wl_resource *client_resource) + { + Resource *resource = Resource::fromResource(client_resource); + DS_ASSERT(resource); + wl_input_method_manager *that = resource->input_method_manager_object; + that->m_resource_map.erase(resource->client()); + that->input_method_manager_destroy_resource(resource); + delete resource; + } + + wl_input_method_manager::Resource *wl_input_method_manager::bind(struct ::wl_client *client, uint32_t id, int version) + { + DS_ASSERT_X(!wl_client_get_object(client, id), "DSWaylandObject bind", "binding to object %u more than once", id); + struct ::wl_resource *handle = wl_resource_create(client, &::wl_input_method_manager_interface, version, id); + return bind(handle); + } + + wl_input_method_manager::Resource *wl_input_method_manager::bind(struct ::wl_resource *handle) + { + Resource *resource = input_method_manager_allocate(); + resource->input_method_manager_object = this; + + wl_resource_set_implementation(handle, &m_wl_input_method_manager_interface, resource, destroy_func); + resource->handle = handle; + input_method_manager_bind_resource(resource); + return resource; + } + wl_input_method_manager::Resource *wl_input_method_manager::Resource::fromResource(struct ::wl_resource *resource) + { + if (DS_UNLIKELY(!resource)) + return NULL; + if (wl_resource_instance_of(resource, &::wl_input_method_manager_interface, &m_wl_input_method_manager_interface)) + return static_cast(wl_resource_get_user_data(resource)); + return NULL; + } + + const struct ::wl_input_method_manager_interface wl_input_method_manager::m_wl_input_method_manager_interface = { + wl_input_method_manager::handle_set_transient_for + }; + + void wl_input_method_manager::input_method_manager_set_transient_for(Resource *, uint32_t , uint32_t ) + { + } + + + void wl_input_method_manager::handle_set_transient_for( + ::wl_client *client, + struct wl_resource *resource, + uint32_t parent_pid, + uint32_t child_pid) + { + DS_UNUSED(client); + Resource *r = Resource::fromResource(resource); + static_cast(r->input_method_manager_object)->input_method_manager_set_transient_for( + r, + parent_pid, + child_pid); + } } /*LCOV_EXCL_STOP*/ diff --git a/src/DSWaylandServer/dswayland-server-input-method.h b/src/DSWaylandServer/dswayland-server-input-method.h index 56c6844..0f9a071 100644 --- a/src/DSWaylandServer/dswayland-server-input-method.h +++ b/src/DSWaylandServer/dswayland-server-input-method.h @@ -364,8 +364,8 @@ namespace DSWaylandServer { void send_deactivate(struct ::wl_resource *resource, struct ::wl_resource *context, uint32_t focus_out_event); void send_destroy(struct ::wl_resource *context); void send_destroy(struct ::wl_resource *resource, struct ::wl_resource *context); - void send_show_input_panel(struct ::wl_resource *context); - void send_show_input_panel(struct ::wl_resource *resource, struct ::wl_resource *context); + void send_show_input_panel(struct ::wl_resource *context, uint32_t degree); + void send_show_input_panel(struct ::wl_resource *resource, struct ::wl_resource *context, uint32_t degree); void send_hide_input_panel(struct ::wl_resource *context); void send_hide_input_panel(struct ::wl_resource *resource, struct ::wl_resource *context); @@ -582,6 +582,89 @@ namespace DSWaylandServer { }; DisplayDestroyedListener m_displayDestroyedListener; }; + + class wl_input_method_manager + { + public: + wl_input_method_manager(struct ::wl_client *client, uint32_t id, int version); + wl_input_method_manager(struct ::wl_display *display, int version); + wl_input_method_manager(struct ::wl_resource *resource); + wl_input_method_manager(); + + virtual ~wl_input_method_manager(); + + class Resource + { + public: + Resource() : input_method_manager_object(NULL), handle(NULL) {} + virtual ~Resource() {} + + wl_input_method_manager *input_method_manager_object; + wl_input_method_manager *object() { return input_method_manager_object; } + struct ::wl_resource *handle; + + struct ::wl_client *client() const { return wl_resource_get_client(handle); } + int version() const { return wl_resource_get_version(handle); } + + static Resource *fromResource(struct ::wl_resource *resource); + }; + + void init(struct ::wl_client *client, uint32_t id, int version); + void init(struct ::wl_display *display, int version); + void init(struct ::wl_resource *resource); + + Resource *add(struct ::wl_client *client, int version); + Resource *add(struct ::wl_client *client, uint32_t id, int version); + Resource *add(struct wl_list *resource_list, struct ::wl_client *client, uint32_t id, int version); + + Resource *resource() { return m_resource; } + const Resource *resource() const { return m_resource; } + + std::multimap resourceMap() { return m_resource_map; } + const std::multimap resourceMap() const { return m_resource_map; } + + bool isGlobal() const { return m_global != NULL; } + bool isResource() const { return m_resource != NULL; } + + static const struct ::wl_interface *interface(); + static std::string interfaceName() { return interface()->name; } + static int interfaceVersion() { return interface()->version; } + + + protected: + virtual Resource *input_method_manager_allocate(); + + virtual void input_method_manager_bind_resource(Resource *resource); + virtual void input_method_manager_destroy_resource(Resource *resource); + + virtual void input_method_manager_set_transient_for(Resource *resource, uint32_t parent_pid, uint32_t child_pid); + + private: + static void bind_func(struct ::wl_client *client, void *data, uint32_t version, uint32_t id); + static void destroy_func(struct ::wl_resource *client_resource); + static void display_destroy_func(struct ::wl_listener *listener, void *data); + + Resource *bind(struct ::wl_client *client, uint32_t id, int version); + Resource *bind(struct ::wl_resource *handle); + + static const struct ::wl_input_method_manager_interface m_wl_input_method_manager_interface; + + static void handle_set_transient_for( + ::wl_client *client, + struct wl_resource *resource, + uint32_t parent_pid, + uint32_t child_pid); + + std::multimap m_resource_map; + Resource *m_resource; + struct ::wl_global *m_global; + uint32_t m_globalVersion; + struct DisplayDestroyedListener : ::wl_listener { + wl_input_method_manager *parent; + DisplayDestroyedListener(): parent(NULL) {} + }; + DisplayDestroyedListener m_displayDestroyedListener; + }; } #endif -- 2.7.4 From 43997178b8f8aa534be43bb73bafe8cd5c20c48f Mon Sep 17 00:00:00 2001 From: "Junseok, Kim" Date: Thu, 12 Nov 2020 14:39:05 +0900 Subject: [PATCH 11/16] DSWaylandInputMethod: added temporary rotation degree Change-Id: I755e509a8515f2ab837798521b227af247b6178a Signed-off-by: Junseok, Kim --- src/DSWaylandServer/DSWaylandInputMethod.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/DSWaylandServer/DSWaylandInputMethod.cpp b/src/DSWaylandServer/DSWaylandInputMethod.cpp index 4001547..ad50352 100644 --- a/src/DSWaylandServer/DSWaylandInputMethod.cpp +++ b/src/DSWaylandServer/DSWaylandInputMethod.cpp @@ -549,7 +549,8 @@ void DSWaylandInputMethodPrivate::sendDeactivate(void *contextResource, bool foc void DSWaylandInputMethodPrivate::showInputPanel(void *contextResource, int textInputId) { //Resource *resource = getResource(textInputId); - send_show_input_panel(__resource->handle, (struct ::wl_resource *)contextResource); + //FIXME: please, replace with current client's rotation degree + send_show_input_panel(__resource->handle, (struct ::wl_resource *)contextResource, 0); } void DSWaylandInputMethodPrivate::hideInputPanel(void *contextResource, int textInputId) -- 2.7.4 From d12a1eeb8310f802528e93ae57eb19d3382567e9 Mon Sep 17 00:00:00 2001 From: "Junseok, Kim" Date: Thu, 25 Mar 2021 14:25:29 +0900 Subject: [PATCH 12/16] dswayland-server: update latest wayland protocols update following wayland protocols - wayland - tizen-extension - input-method - tzsh Change-Id: I3f605811dbbe73e2c9122440fb4c9f79e9437c88 Signed-off-by: Junseok, Kim --- .../dswayland-server-input-method.cpp | 72 ++-- .../dswayland-server-input-method.h | 20 +- .../dswayland-server-tizen-extension.cpp | 478 ++++++++++++++++++++- .../dswayland-server-tizen-extension.h | 189 ++++++++ src/DSWaylandServer/dswayland-server-tzsh.cpp | 247 +---------- src/DSWaylandServer/dswayland-server-tzsh.h | 116 +---- src/DSWaylandServer/dswayland-server-wayland.h | 5 + 7 files changed, 744 insertions(+), 383 deletions(-) diff --git a/src/DSWaylandServer/dswayland-server-input-method.cpp b/src/DSWaylandServer/dswayland-server-input-method.cpp index b9c41ac..005ffd1 100644 --- a/src/DSWaylandServer/dswayland-server-input-method.cpp +++ b/src/DSWaylandServer/dswayland-server-input-method.cpp @@ -207,7 +207,9 @@ namespace DSWaylandServer { wl_input_method_context::handle_input_panel_event, wl_input_method_context::handle_commit_content, wl_input_method_context::handle_update_candidate_state, - wl_input_method_context::handle_reshow_input_panel + wl_input_method_context::handle_reshow_input_panel, + wl_input_method_context::handle_set_floating_panel, + wl_input_method_context::handle_set_floating_drag_enabled }; void wl_input_method_context::input_method_context_destroy(Resource *) @@ -318,6 +320,14 @@ namespace DSWaylandServer { { } + void wl_input_method_context::input_method_context_set_floating_panel(Resource *, uint32_t ) + { + } + + void wl_input_method_context::input_method_context_set_floating_drag_enabled(Resource *, uint32_t ) + { + } + void wl_input_method_context::handle_destroy( ::wl_client *client, @@ -723,6 +733,30 @@ namespace DSWaylandServer { r); } + void wl_input_method_context::handle_set_floating_panel( + ::wl_client *client, + struct wl_resource *resource, + uint32_t state) + { + DS_UNUSED(client); + Resource *r = Resource::fromResource(resource); + static_cast(r->input_method_context_object)->input_method_context_set_floating_panel( + r, + state); + } + + void wl_input_method_context::handle_set_floating_drag_enabled( + ::wl_client *client, + struct wl_resource *resource, + uint32_t enabled) + { + DS_UNUSED(client); + Resource *r = Resource::fromResource(resource); + static_cast(r->input_method_context_object)->input_method_context_set_floating_drag_enabled( + r, + enabled); + } + void wl_input_method_context::send_reset() { DS_ASSERT_X(m_resource, "wl_input_method_context::reset", "Uninitialised resource"); @@ -1704,9 +1738,7 @@ namespace DSWaylandServer { const struct ::wl_input_panel_surface_interface wl_input_panel_surface::m_wl_input_panel_surface_interface = { wl_input_panel_surface::handle_set_toplevel, wl_input_panel_surface::handle_set_overlay_panel, - wl_input_panel_surface::handle_set_ready, - wl_input_panel_surface::handle_set_floating_panel, - wl_input_panel_surface::handle_set_floating_drag_enabled + wl_input_panel_surface::handle_set_ready }; void wl_input_panel_surface::input_panel_surface_set_toplevel(Resource *, struct ::wl_resource *, uint32_t ) @@ -1721,14 +1753,6 @@ namespace DSWaylandServer { { } - void wl_input_panel_surface::input_panel_surface_set_floating_panel(Resource *, uint32_t ) - { - } - - void wl_input_panel_surface::input_panel_surface_set_floating_drag_enabled(Resource *, uint32_t ) - { - } - void wl_input_panel_surface::handle_set_toplevel( ::wl_client *client, @@ -1766,30 +1790,6 @@ namespace DSWaylandServer { state); } - void wl_input_panel_surface::handle_set_floating_panel( - ::wl_client *client, - struct wl_resource *resource, - uint32_t state) - { - DS_UNUSED(client); - Resource *r = Resource::fromResource(resource); - static_cast(r->input_panel_surface_object)->input_panel_surface_set_floating_panel( - r, - state); - } - - void wl_input_panel_surface::handle_set_floating_drag_enabled( - ::wl_client *client, - struct wl_resource *resource, - uint32_t enabled) - { - DS_UNUSED(client); - Resource *r = Resource::fromResource(resource); - static_cast(r->input_panel_surface_object)->input_panel_surface_set_floating_drag_enabled( - r, - enabled); - } - wl_input_method_manager::wl_input_method_manager(struct ::wl_client *client, uint32_t id, int version) : m_resource_map() , m_resource(NULL) diff --git a/src/DSWaylandServer/dswayland-server-input-method.h b/src/DSWaylandServer/dswayland-server-input-method.h index 0f9a071..03c49a7 100644 --- a/src/DSWaylandServer/dswayland-server-input-method.h +++ b/src/DSWaylandServer/dswayland-server-input-method.h @@ -139,6 +139,8 @@ namespace DSWaylandServer { virtual void input_method_context_commit_content(Resource *resource, uint32_t serial, const std::string &content, const std::string &description, const std::string &mime_types); virtual void input_method_context_update_candidate_state(Resource *resource, uint32_t state); virtual void input_method_context_reshow_input_panel(Resource *resource); + virtual void input_method_context_set_floating_panel(Resource *resource, uint32_t state); + virtual void input_method_context_set_floating_drag_enabled(Resource *resource, uint32_t enabled); private: static void bind_func(struct ::wl_client *client, void *data, uint32_t version, uint32_t id); @@ -298,6 +300,14 @@ namespace DSWaylandServer { static void handle_reshow_input_panel( ::wl_client *client, struct wl_resource *resource); + static void handle_set_floating_panel( + ::wl_client *client, + struct wl_resource *resource, + uint32_t state); + static void handle_set_floating_drag_enabled( + ::wl_client *client, + struct wl_resource *resource, + uint32_t enabled); std::multimap m_resource_map; Resource *m_resource; @@ -538,8 +548,6 @@ namespace DSWaylandServer { virtual void input_panel_surface_set_toplevel(Resource *resource, struct ::wl_resource *output, uint32_t position); virtual void input_panel_surface_set_overlay_panel(Resource *resource); virtual void input_panel_surface_set_ready(Resource *resource, uint32_t state); - virtual void input_panel_surface_set_floating_panel(Resource *resource, uint32_t state); - virtual void input_panel_surface_set_floating_drag_enabled(Resource *resource, uint32_t enabled); private: static void bind_func(struct ::wl_client *client, void *data, uint32_t version, uint32_t id); @@ -563,14 +571,6 @@ namespace DSWaylandServer { ::wl_client *client, struct wl_resource *resource, uint32_t state); - static void handle_set_floating_panel( - ::wl_client *client, - struct wl_resource *resource, - uint32_t state); - static void handle_set_floating_drag_enabled( - ::wl_client *client, - struct wl_resource *resource, - uint32_t enabled); std::multimap m_resource_map; Resource *m_resource; diff --git a/src/DSWaylandServer/dswayland-server-tizen-extension.cpp b/src/DSWaylandServer/dswayland-server-tizen-extension.cpp index 15a014c..3236c91 100644 --- a/src/DSWaylandServer/dswayland-server-tizen-extension.cpp +++ b/src/DSWaylandServer/dswayland-server-tizen-extension.cpp @@ -603,7 +603,9 @@ namespace DSWaylandServer { tizen_policy::handle_ack_conformant_region, tizen_policy::handle_destroy, tizen_policy::handle_has_video, - tizen_policy::handle_set_appid + tizen_policy::handle_set_appid, + tizen_policy::handle_show, + tizen_policy::handle_hide }; void tizen_policy::tizen_policy_get_visibility(Resource *, uint32_t, struct ::wl_resource *) @@ -766,6 +768,14 @@ namespace DSWaylandServer { { } + void tizen_policy::tizen_policy_show(Resource *, struct ::wl_resource *) + { + } + + void tizen_policy::tizen_policy_hide(Resource *, struct ::wl_resource *) + { + } + void tizen_policy::handle_get_visibility( ::wl_client *client, @@ -1293,6 +1303,30 @@ namespace DSWaylandServer { std::string(appid)); } + void tizen_policy::handle_show( + ::wl_client *client, + struct wl_resource *resource, + struct ::wl_resource *surface) + { + DS_UNUSED(client); + Resource *r = Resource::fromResource(resource); + static_cast(r->tizen_policy_object)->tizen_policy_show( + r, + surface); + } + + void tizen_policy::handle_hide( + ::wl_client *client, + struct wl_resource *resource, + struct ::wl_resource *surface) + { + DS_UNUSED(client); + Resource *r = Resource::fromResource(resource); + static_cast(r->tizen_policy_object)->tizen_policy_hide( + r, + surface); + } + void tizen_policy::send_conformant(struct ::wl_resource *surface, uint32_t is_conformant) { DS_ASSERT_X(m_resource, "tizen_policy::conformant", "Uninitialised resource"); @@ -1971,6 +2005,7 @@ namespace DSWaylandServer { y); } + tizen_move_resize::tizen_move_resize(struct ::wl_client *client, uint32_t id, int version) : m_resource_map() , m_resource(NULL) @@ -2201,6 +2236,7 @@ namespace DSWaylandServer { error_state); } + tizen_gesture::tizen_gesture(struct ::wl_client *client, uint32_t id, int version) : m_resource_map() , m_resource(NULL) @@ -2839,6 +2875,7 @@ namespace DSWaylandServer { error); } + tizen_keyrouter::tizen_keyrouter(struct ::wl_client *client, uint32_t id, int version) : m_resource_map() , m_resource(NULL) @@ -3357,6 +3394,7 @@ namespace DSWaylandServer { mode); } + tizen_screenshooter::tizen_screenshooter(struct ::wl_client *client, uint32_t id, int version) : m_resource_map() , m_resource(NULL) @@ -3604,6 +3642,7 @@ namespace DSWaylandServer { noti); } + tizen_screenmirror::tizen_screenmirror(struct ::wl_client *client, uint32_t id, int version) : m_resource_map() , m_resource(NULL) @@ -3914,6 +3953,7 @@ namespace DSWaylandServer { resource); } + tizen_video::tizen_video(struct ::wl_client *client, uint32_t id, int version) : m_resource_map() , m_resource(NULL) @@ -4143,6 +4183,7 @@ namespace DSWaylandServer { format); } + tizen_video_object::tizen_video_object(struct ::wl_client *client, uint32_t id, int version) : m_resource_map() , m_resource(NULL) @@ -4443,6 +4484,7 @@ namespace DSWaylandServer { prefer_align); } + tizen_subsurface_watcher::tizen_subsurface_watcher(struct ::wl_client *client, uint32_t id, int version) : m_resource_map() , m_resource(NULL) @@ -4634,6 +4676,7 @@ namespace DSWaylandServer { value); } + tizen_viewport::tizen_viewport(struct ::wl_client *client, uint32_t id, int version) : m_resource_map() , m_resource(NULL) @@ -5003,6 +5046,7 @@ namespace DSWaylandServer { height); } + tizen_destination_mode::tizen_destination_mode(struct ::wl_client *client, uint32_t id, int version) : m_resource_map() , m_resource(NULL) @@ -5508,6 +5552,7 @@ namespace DSWaylandServer { sock_fd); } + tizen_input_device_manager::tizen_input_device_manager(struct ::wl_client *client, uint32_t id, int version) : m_resource_map() , m_resource(NULL) @@ -5672,7 +5717,8 @@ namespace DSWaylandServer { tizen_input_device_manager::handle_pointer_warp, tizen_input_device_manager::handle_init_generator_with_name, tizen_input_device_manager::handle_destroy, - tizen_input_device_manager::handle_generate_axis + tizen_input_device_manager::handle_generate_axis, + tizen_input_device_manager::handle_set_touch_count }; void tizen_input_device_manager::tizen_input_device_manager_block_events(Resource *, uint32_t , uint32_t , uint32_t ) @@ -5719,6 +5765,11 @@ namespace DSWaylandServer { { } + void tizen_input_device_manager::tizen_input_device_manager_set_touch_count(Resource *, int32_t ) + { + } + + void tizen_input_device_manager::handle_block_events( ::wl_client *client, struct wl_resource *resource, @@ -5875,6 +5926,18 @@ namespace DSWaylandServer { value); } + void tizen_input_device_manager::handle_set_touch_count( + ::wl_client *client, + struct wl_resource *resource, + int32_t max_count) + { + DS_UNUSED(client); + Resource *r = Resource::fromResource(resource); + static_cast(r->tizen_input_device_manager_object)->tizen_input_device_manager_set_touch_count( + r, + max_count); + } + void tizen_input_device_manager::send_device_add(uint32_t serial, const std::string &identifier, struct ::wl_resource *device, struct ::wl_resource *seat) { DS_ASSERT_X(m_resource, "tizen_input_device_manager::device_add", "Uninitialised resource"); @@ -5964,6 +6027,31 @@ namespace DSWaylandServer { resource); } + + void tizen_input_device_manager::send_max_touch_count(uint32_t serial, int32_t max_count, struct ::wl_resource *seat) + { + DS_ASSERT_X(m_resource, "tizen_input_device_manager::max_touch_count", "Uninitialised resource"); + if (DS_UNLIKELY(!m_resource)) { + WRN("could not call tizen_input_device_manager::max_touch_count as it's not initialised"); + return; + } + send_max_touch_count( + m_resource->handle, + serial, + max_count, + seat); + } + + void tizen_input_device_manager::send_max_touch_count(struct ::wl_resource *resource, uint32_t serial, int32_t max_count, struct ::wl_resource *seat) + { + tizen_input_device_manager_send_max_touch_count( + resource, + serial, + max_count, + seat); + } + + tizen_input_device::tizen_input_device(struct ::wl_client *client, uint32_t id, int version) : m_resource_map() , m_resource(NULL) @@ -6224,6 +6312,7 @@ namespace DSWaylandServer { value); } + tizen_launchscreen::tizen_launchscreen(struct ::wl_client *client, uint32_t id, int version) : m_resource_map() , m_resource(NULL) @@ -6874,6 +6963,7 @@ namespace DSWaylandServer { type); } + tizen_display_policy::tizen_display_policy(struct ::wl_client *client, uint32_t id, int version) : m_resource_map() , m_resource(NULL) @@ -7088,6 +7178,7 @@ namespace DSWaylandServer { error_state); } + tizen_indicator::tizen_indicator(struct ::wl_client *client, uint32_t id, int version) : m_resource_map() , m_resource(NULL) @@ -7338,6 +7429,7 @@ namespace DSWaylandServer { type); } + tizen_clipboard::tizen_clipboard(struct ::wl_client *client, uint32_t id, int version) : m_resource_map() , m_resource(NULL) @@ -7600,6 +7692,7 @@ namespace DSWaylandServer { allowed); } + tizen_screen_rotation::tizen_screen_rotation(struct ::wl_client *client, uint32_t id, int version) : m_resource_map() , m_resource(NULL) @@ -7810,5 +7903,386 @@ namespace DSWaylandServer { ignore); } + + tizen_renderer::tizen_renderer(struct ::wl_client *client, uint32_t id, int version) + : m_resource_map() + , m_resource(NULL) + , m_global(NULL) + , m_globalVersion(0) + , m_displayDestroyedListener() + { + init(client, id, version); + } + + tizen_renderer::tizen_renderer(struct ::wl_display *display, int version) + : m_resource_map() + , m_resource(NULL) + , m_global(NULL) + , m_globalVersion(0) + , m_displayDestroyedListener() + { + init(display, version); + } + + tizen_renderer::tizen_renderer(struct ::wl_resource *resource) + : m_resource_map() + , m_resource(NULL) + , m_global(NULL) + , m_globalVersion(0) + , m_displayDestroyedListener() + { + init(resource); + } + + tizen_renderer::tizen_renderer() + : m_resource_map() + , m_resource(NULL) + , m_global(NULL) + , m_globalVersion(0) + , m_displayDestroyedListener() + { + } + + tizen_renderer::~tizen_renderer() + { + std::multimap::iterator it; + for (it = m_resource_map.begin() ; it != m_resource_map.end() ; it++) { + tizen_renderer::Resource *resource = (*it).second; + wl_resource_set_implementation(resource->handle, NULL, NULL, NULL); + } + + if (m_global) { + wl_global_destroy(m_global); + wl_list_remove(&m_displayDestroyedListener.link); + } + } + + void tizen_renderer::init(struct ::wl_client *client, uint32_t id, int version) + { + m_resource = bind(client, id, version); + } + + void tizen_renderer::init(struct ::wl_resource *resource) + { + m_resource = bind(resource); + } + + tizen_renderer::Resource *tizen_renderer::add(struct ::wl_client *client, int version) + { + Resource *resource = bind(client, 0, version); + m_resource_map.insert(std::pair(client, resource)); + return resource; + } + + tizen_renderer::Resource *tizen_renderer::add(struct ::wl_client *client, uint32_t id, int version) + { + Resource *resource = bind(client, id, version); + m_resource_map.insert(std::pair(client, resource)); + return resource; + } + + void tizen_renderer::init(struct ::wl_display *display, int version) + { + m_global = wl_global_create(display, &::tizen_renderer_interface, version, this, bind_func); + m_globalVersion = version; + m_displayDestroyedListener.notify = tizen_renderer::display_destroy_func; + m_displayDestroyedListener.parent = this; + wl_display_add_destroy_listener(display, &m_displayDestroyedListener); + } + + const struct wl_interface *tizen_renderer::interface() + { + return &::tizen_renderer_interface; + } + + tizen_renderer::Resource *tizen_renderer::tizen_renderer_allocate() + { + return new Resource; + } + + void tizen_renderer::tizen_renderer_bind_resource(Resource *) + { + } + + void tizen_renderer::tizen_renderer_destroy_resource(Resource *) + { + } + + void tizen_renderer::bind_func(struct ::wl_client *client, void *data, uint32_t version, uint32_t id) + { + tizen_renderer *that = static_cast(data); + that->add(client, id, std::min(that->m_globalVersion, version)); + } + + void tizen_renderer::display_destroy_func(struct ::wl_listener *listener, void *data) + { + DS_UNUSED(data); + tizen_renderer *that = static_cast(listener)->parent; + that->m_global = NULL; + } + + void tizen_renderer::destroy_func(struct ::wl_resource *client_resource) + { + Resource *resource = Resource::fromResource(client_resource); + DS_ASSERT(resource); + tizen_renderer *that = resource->tizen_renderer_object; + that->m_resource_map.erase(resource->client()); + that->tizen_renderer_destroy_resource(resource); + delete resource; + } + + tizen_renderer::Resource *tizen_renderer::bind(struct ::wl_client *client, uint32_t id, int version) + { + DS_ASSERT_X(!wl_client_get_object(client, id), "DSWaylandObject bind", "binding to object %u more than once", id); + struct ::wl_resource *handle = wl_resource_create(client, &::tizen_renderer_interface, version, id); + return bind(handle); + } + + tizen_renderer::Resource *tizen_renderer::bind(struct ::wl_resource *handle) + { + Resource *resource = tizen_renderer_allocate(); + resource->tizen_renderer_object = this; + + wl_resource_set_implementation(handle, &m_tizen_renderer_interface, resource, destroy_func); + resource->handle = handle; + tizen_renderer_bind_resource(resource); + return resource; + } + tizen_renderer::Resource *tizen_renderer::Resource::fromResource(struct ::wl_resource *resource) + { + if (DS_UNLIKELY(!resource)) + return NULL; + if (wl_resource_instance_of(resource, &::tizen_renderer_interface, &m_tizen_renderer_interface)) + return static_cast(wl_resource_get_user_data(resource)); + return NULL; + } + + const struct ::tizen_renderer_interface tizen_renderer::m_tizen_renderer_interface = { + tizen_renderer::handle_get_renderer_surface, + tizen_renderer::handle_destroy + }; + + void tizen_renderer::tizen_renderer_get_renderer_surface(Resource *, uint32_t, struct ::wl_resource *) + { + } + + void tizen_renderer::tizen_renderer_destroy(Resource *) + { + } + + + void tizen_renderer::handle_get_renderer_surface( + ::wl_client *client, + struct wl_resource *resource, + uint32_t id, + struct ::wl_resource *surface) + { + DS_UNUSED(client); + Resource *r = Resource::fromResource(resource); + static_cast(r->tizen_renderer_object)->tizen_renderer_get_renderer_surface( + r, + id, + surface); + } + + void tizen_renderer::handle_destroy( + ::wl_client *client, + struct wl_resource *resource) + { + DS_UNUSED(client); + Resource *r = Resource::fromResource(resource); + static_cast(r->tizen_renderer_object)->tizen_renderer_destroy( + r); + } + + tizen_renderer_surface::tizen_renderer_surface(struct ::wl_client *client, uint32_t id, int version) + : m_resource_map() + , m_resource(NULL) + , m_global(NULL) + , m_globalVersion(0) + , m_displayDestroyedListener() + { + init(client, id, version); + } + + tizen_renderer_surface::tizen_renderer_surface(struct ::wl_display *display, int version) + : m_resource_map() + , m_resource(NULL) + , m_global(NULL) + , m_globalVersion(0) + , m_displayDestroyedListener() + { + init(display, version); + } + + tizen_renderer_surface::tizen_renderer_surface(struct ::wl_resource *resource) + : m_resource_map() + , m_resource(NULL) + , m_global(NULL) + , m_globalVersion(0) + , m_displayDestroyedListener() + { + init(resource); + } + + tizen_renderer_surface::tizen_renderer_surface() + : m_resource_map() + , m_resource(NULL) + , m_global(NULL) + , m_globalVersion(0) + , m_displayDestroyedListener() + { + } + + tizen_renderer_surface::~tizen_renderer_surface() + { + std::multimap::iterator it; + for (it = m_resource_map.begin() ; it != m_resource_map.end() ; it++) { + tizen_renderer_surface::Resource *resource = (*it).second; + wl_resource_set_implementation(resource->handle, NULL, NULL, NULL); + } + + if (m_global) { + wl_global_destroy(m_global); + wl_list_remove(&m_displayDestroyedListener.link); + } + } + + void tizen_renderer_surface::init(struct ::wl_client *client, uint32_t id, int version) + { + m_resource = bind(client, id, version); + } + + void tizen_renderer_surface::init(struct ::wl_resource *resource) + { + m_resource = bind(resource); + } + + tizen_renderer_surface::Resource *tizen_renderer_surface::add(struct ::wl_client *client, int version) + { + Resource *resource = bind(client, 0, version); + m_resource_map.insert(std::pair(client, resource)); + return resource; + } + + tizen_renderer_surface::Resource *tizen_renderer_surface::add(struct ::wl_client *client, uint32_t id, int version) + { + Resource *resource = bind(client, id, version); + m_resource_map.insert(std::pair(client, resource)); + return resource; + } + + void tizen_renderer_surface::init(struct ::wl_display *display, int version) + { + m_global = wl_global_create(display, &::tizen_renderer_surface_interface, version, this, bind_func); + m_globalVersion = version; + m_displayDestroyedListener.notify = tizen_renderer_surface::display_destroy_func; + m_displayDestroyedListener.parent = this; + wl_display_add_destroy_listener(display, &m_displayDestroyedListener); + } + + const struct wl_interface *tizen_renderer_surface::interface() + { + return &::tizen_renderer_surface_interface; + } + + tizen_renderer_surface::Resource *tizen_renderer_surface::tizen_renderer_surface_allocate() + { + return new Resource; + } + + void tizen_renderer_surface::tizen_renderer_surface_bind_resource(Resource *) + { + } + + void tizen_renderer_surface::tizen_renderer_surface_destroy_resource(Resource *) + { + } + + void tizen_renderer_surface::bind_func(struct ::wl_client *client, void *data, uint32_t version, uint32_t id) + { + tizen_renderer_surface *that = static_cast(data); + that->add(client, id, std::min(that->m_globalVersion, version)); + } + + void tizen_renderer_surface::display_destroy_func(struct ::wl_listener *listener, void *data) + { + DS_UNUSED(data); + tizen_renderer_surface *that = static_cast(listener)->parent; + that->m_global = NULL; + } + + void tizen_renderer_surface::destroy_func(struct ::wl_resource *client_resource) + { + Resource *resource = Resource::fromResource(client_resource); + DS_ASSERT(resource); + tizen_renderer_surface *that = resource->tizen_renderer_surface_object; + that->m_resource_map.erase(resource->client()); + that->tizen_renderer_surface_destroy_resource(resource); + delete resource; + } + + tizen_renderer_surface::Resource *tizen_renderer_surface::bind(struct ::wl_client *client, uint32_t id, int version) + { + DS_ASSERT_X(!wl_client_get_object(client, id), "DSWaylandObject bind", "binding to object %u more than once", id); + struct ::wl_resource *handle = wl_resource_create(client, &::tizen_renderer_surface_interface, version, id); + return bind(handle); + } + + tizen_renderer_surface::Resource *tizen_renderer_surface::bind(struct ::wl_resource *handle) + { + Resource *resource = tizen_renderer_surface_allocate(); + resource->tizen_renderer_surface_object = this; + + wl_resource_set_implementation(handle, &m_tizen_renderer_surface_interface, resource, destroy_func); + resource->handle = handle; + tizen_renderer_surface_bind_resource(resource); + return resource; + } + tizen_renderer_surface::Resource *tizen_renderer_surface::Resource::fromResource(struct ::wl_resource *resource) + { + if (DS_UNLIKELY(!resource)) + return NULL; + if (wl_resource_instance_of(resource, &::tizen_renderer_surface_interface, &m_tizen_renderer_surface_interface)) + return static_cast(wl_resource_get_user_data(resource)); + return NULL; + } + + const struct ::tizen_renderer_surface_interface tizen_renderer_surface::m_tizen_renderer_surface_interface = { + tizen_renderer_surface::handle_destroy + }; + + void tizen_renderer_surface::tizen_renderer_surface_destroy(Resource *) + { + } + + + void tizen_renderer_surface::handle_destroy( + ::wl_client *client, + struct wl_resource *resource) + { + DS_UNUSED(client); + Resource *r = Resource::fromResource(resource); + static_cast(r->tizen_renderer_surface_object)->tizen_renderer_surface_destroy( + r); + } + + void tizen_renderer_surface::send_redraw_request() + { + DS_ASSERT_X(m_resource, "tizen_renderer_surface::redraw_request", "Uninitialised resource"); + if (DS_UNLIKELY(!m_resource)) { + WRN("could not call tizen_renderer_surface::redraw_request as it's not initialised"); + return; + } + send_redraw_request( + m_resource->handle); + } + + void tizen_renderer_surface::send_redraw_request(struct ::wl_resource *resource) + { + tizen_renderer_surface_send_redraw_request( + resource); + } + } /*LCOV_EXCL_STOP*/ diff --git a/src/DSWaylandServer/dswayland-server-tizen-extension.h b/src/DSWaylandServer/dswayland-server-tizen-extension.h index cdc2b1f..26b8301 100644 --- a/src/DSWaylandServer/dswayland-server-tizen-extension.h +++ b/src/DSWaylandServer/dswayland-server-tizen-extension.h @@ -356,6 +356,8 @@ namespace DSWaylandServer { virtual void tizen_policy_destroy(Resource *resource); virtual void tizen_policy_has_video(Resource *resource, struct ::wl_resource *surface, uint32_t has); virtual void tizen_policy_set_appid(Resource *resource, int32_t pid, const std::string &appid); + virtual void tizen_policy_show(Resource *resource, struct ::wl_resource *surface); + virtual void tizen_policy_hide(Resource *resource, struct ::wl_resource *surface); private: static void bind_func(struct ::wl_client *client, void *data, uint32_t version, uint32_t id); @@ -550,6 +552,14 @@ namespace DSWaylandServer { struct wl_resource *resource, int32_t pid, const char *appid); + static void handle_show( + ::wl_client *client, + struct wl_resource *resource, + struct ::wl_resource *surface); + static void handle_hide( + ::wl_client *client, + struct wl_resource *resource, + struct ::wl_resource *surface); std::multimap m_resource_map; Resource *m_resource; @@ -2172,6 +2182,7 @@ namespace DSWaylandServer { error_invalid_parameter = 5, // argument is invalid error_invalid_surface = 6, // the given surface is not visible or pointer is not on the given surface error_no_pointer_available = 7, // there is no pointer available to warp + error_not_allowed = 8, // this request is not allowed in this system }; enum pointer_event_type { @@ -2199,6 +2210,8 @@ namespace DSWaylandServer { void send_error(struct ::wl_resource *resource, uint32_t errorcode); void send_block_expired(); void send_block_expired(struct ::wl_resource *resource); + void send_max_touch_count(uint32_t serial, int32_t max_count, struct ::wl_resource *seat); + void send_max_touch_count(struct ::wl_resource *resource, uint32_t serial, int32_t max_count, struct ::wl_resource *seat); protected: virtual Resource *tizen_input_device_manager_allocate(); @@ -2217,6 +2230,7 @@ namespace DSWaylandServer { virtual void tizen_input_device_manager_init_generator_with_name(Resource *resource, uint32_t clas, const std::string &name); virtual void tizen_input_device_manager_destroy(Resource *resource); virtual void tizen_input_device_manager_generate_axis(Resource *resource, uint32_t type, wl_fixed_t value); + virtual void tizen_input_device_manager_set_touch_count(Resource *resource, int32_t max_count); private: static void bind_func(struct ::wl_client *client, void *data, uint32_t version, uint32_t id); @@ -2284,6 +2298,10 @@ namespace DSWaylandServer { struct wl_resource *resource, uint32_t type, wl_fixed_t value); + static void handle_set_touch_count( + ::wl_client *client, + struct wl_resource *resource, + int32_t max_count); std::multimap m_resource_map; Resource *m_resource; @@ -3114,6 +3132,177 @@ namespace DSWaylandServer { }; DisplayDestroyedListener m_displayDestroyedListener; }; + + class tizen_renderer + { + public: + tizen_renderer(struct ::wl_client *client, uint32_t id, int version); + tizen_renderer(struct ::wl_display *display, int version); + tizen_renderer(struct ::wl_resource *resource); + tizen_renderer(); + + virtual ~tizen_renderer(); + + class Resource + { + public: + Resource() : tizen_renderer_object(NULL), handle(NULL) {} + virtual ~Resource() {} + + tizen_renderer *tizen_renderer_object; + tizen_renderer *object() { return tizen_renderer_object; } + struct ::wl_resource *handle; + + struct ::wl_client *client() const { return wl_resource_get_client(handle); } + int version() const { return wl_resource_get_version(handle); } + + static Resource *fromResource(struct ::wl_resource *resource); + }; + + void init(struct ::wl_client *client, uint32_t id, int version); + void init(struct ::wl_display *display, int version); + void init(struct ::wl_resource *resource); + + Resource *add(struct ::wl_client *client, int version); + Resource *add(struct ::wl_client *client, uint32_t id, int version); + Resource *add(struct wl_list *resource_list, struct ::wl_client *client, uint32_t id, int version); + + Resource *resource() { return m_resource; } + const Resource *resource() const { return m_resource; } + + std::multimap resourceMap() { return m_resource_map; } + const std::multimap resourceMap() const { return m_resource_map; } + + bool isGlobal() const { return m_global != NULL; } + bool isResource() const { return m_resource != NULL; } + + static const struct ::wl_interface *interface(); + static std::string interfaceName() { return interface()->name; } + static int interfaceVersion() { return interface()->version; } + + + protected: + virtual Resource *tizen_renderer_allocate(); + + virtual void tizen_renderer_bind_resource(Resource *resource); + virtual void tizen_renderer_destroy_resource(Resource *resource); + + virtual void tizen_renderer_get_renderer_surface(Resource *resource, uint32_t id, struct ::wl_resource *surface); + virtual void tizen_renderer_destroy(Resource *resource); + + private: + static void bind_func(struct ::wl_client *client, void *data, uint32_t version, uint32_t id); + static void destroy_func(struct ::wl_resource *client_resource); + static void display_destroy_func(struct ::wl_listener *listener, void *data); + + Resource *bind(struct ::wl_client *client, uint32_t id, int version); + Resource *bind(struct ::wl_resource *handle); + + static const struct ::tizen_renderer_interface m_tizen_renderer_interface; + + static void handle_get_renderer_surface( + ::wl_client *client, + struct wl_resource *resource, + uint32_t id, + struct ::wl_resource *surface); + static void handle_destroy( + ::wl_client *client, + struct wl_resource *resource); + + std::multimap m_resource_map; + Resource *m_resource; + struct ::wl_global *m_global; + uint32_t m_globalVersion; + struct DisplayDestroyedListener : ::wl_listener { + tizen_renderer *parent; + DisplayDestroyedListener(): parent(NULL) {} + }; + DisplayDestroyedListener m_displayDestroyedListener; + }; + + class tizen_renderer_surface + { + public: + tizen_renderer_surface(struct ::wl_client *client, uint32_t id, int version); + tizen_renderer_surface(struct ::wl_display *display, int version); + tizen_renderer_surface(struct ::wl_resource *resource); + tizen_renderer_surface(); + + virtual ~tizen_renderer_surface(); + + class Resource + { + public: + Resource() : tizen_renderer_surface_object(NULL), handle(NULL) {} + virtual ~Resource() {} + + tizen_renderer_surface *tizen_renderer_surface_object; + tizen_renderer_surface *object() { return tizen_renderer_surface_object; } + struct ::wl_resource *handle; + + struct ::wl_client *client() const { return wl_resource_get_client(handle); } + int version() const { return wl_resource_get_version(handle); } + + static Resource *fromResource(struct ::wl_resource *resource); + }; + + void init(struct ::wl_client *client, uint32_t id, int version); + void init(struct ::wl_display *display, int version); + void init(struct ::wl_resource *resource); + + Resource *add(struct ::wl_client *client, int version); + Resource *add(struct ::wl_client *client, uint32_t id, int version); + Resource *add(struct wl_list *resource_list, struct ::wl_client *client, uint32_t id, int version); + + Resource *resource() { return m_resource; } + const Resource *resource() const { return m_resource; } + + std::multimap resourceMap() { return m_resource_map; } + const std::multimap resourceMap() const { return m_resource_map; } + + bool isGlobal() const { return m_global != NULL; } + bool isResource() const { return m_resource != NULL; } + + static const struct ::wl_interface *interface(); + static std::string interfaceName() { return interface()->name; } + static int interfaceVersion() { return interface()->version; } + + + void send_redraw_request(); + void send_redraw_request(struct ::wl_resource *resource); + + protected: + virtual Resource *tizen_renderer_surface_allocate(); + + virtual void tizen_renderer_surface_bind_resource(Resource *resource); + virtual void tizen_renderer_surface_destroy_resource(Resource *resource); + + virtual void tizen_renderer_surface_destroy(Resource *resource); + + private: + static void bind_func(struct ::wl_client *client, void *data, uint32_t version, uint32_t id); + static void destroy_func(struct ::wl_resource *client_resource); + static void display_destroy_func(struct ::wl_listener *listener, void *data); + + Resource *bind(struct ::wl_client *client, uint32_t id, int version); + Resource *bind(struct ::wl_resource *handle); + + static const struct ::tizen_renderer_surface_interface m_tizen_renderer_surface_interface; + + static void handle_destroy( + ::wl_client *client, + struct wl_resource *resource); + + std::multimap m_resource_map; + Resource *m_resource; + struct ::wl_global *m_global; + uint32_t m_globalVersion; + struct DisplayDestroyedListener : ::wl_listener { + tizen_renderer_surface *parent; + DisplayDestroyedListener(): parent(NULL) {} + }; + DisplayDestroyedListener m_displayDestroyedListener; + }; } /*LCOV_EXCL_STOP*/ diff --git a/src/DSWaylandServer/dswayland-server-tzsh.cpp b/src/DSWaylandServer/dswayland-server-tzsh.cpp index ae8c2a1..d6b1d66 100644 --- a/src/DSWaylandServer/dswayland-server-tzsh.cpp +++ b/src/DSWaylandServer/dswayland-server-tzsh.cpp @@ -185,7 +185,6 @@ namespace DSWaylandServer { tizen_ws_shell::handle_service_create, tizen_ws_shell::handle_region_create, tizen_ws_shell::handle_quickpanel_get, - tizen_ws_shell::handle_tvsrv_get, tizen_ws_shell::handle_extension_get, tizen_ws_shell::handle_softkey_get, tizen_ws_shell::handle_shared_widget_launch_get @@ -207,10 +206,6 @@ namespace DSWaylandServer { { } - void tizen_ws_shell::tizen_ws_shell_tvsrv_get(Resource *, uint32_t, uint32_t ) - { - } - void tizen_ws_shell::tizen_ws_shell_extension_get(Resource *, uint32_t, const std::string &) { } @@ -276,20 +271,6 @@ namespace DSWaylandServer { win); } - void tizen_ws_shell::handle_tvsrv_get( - ::wl_client *client, - struct wl_resource *resource, - uint32_t id, - uint32_t win) - { - DS_UNUSED(client); - Resource *r = Resource::fromResource(resource); - static_cast(r->tizen_ws_shell_object)->tizen_ws_shell_tvsrv_get( - r, - id, - win); - } - void tizen_ws_shell::handle_extension_get( ::wl_client *client, struct wl_resource *resource, @@ -719,208 +700,6 @@ namespace DSWaylandServer { } - tws_tvsrv::tws_tvsrv(struct ::wl_client *client, uint32_t id, int version) - : m_resource_map() - , m_resource(NULL) - , m_global(NULL) - , m_globalVersion(0) - , m_displayDestroyedListener() - { - init(client, id, version); - } - - tws_tvsrv::tws_tvsrv(struct ::wl_display *display, int version) - : m_resource_map() - , m_resource(NULL) - , m_global(NULL) - , m_globalVersion(0) - , m_displayDestroyedListener() - { - init(display, version); - } - - tws_tvsrv::tws_tvsrv(struct ::wl_resource *resource) - : m_resource_map() - , m_resource(NULL) - , m_global(NULL) - , m_globalVersion(0) - , m_displayDestroyedListener() - { - init(resource); - } - - tws_tvsrv::tws_tvsrv() - : m_resource_map() - , m_resource(NULL) - , m_global(NULL) - , m_globalVersion(0) - , m_displayDestroyedListener() - { - } - - tws_tvsrv::~tws_tvsrv() - { - std::multimap::iterator it; - for (it = m_resource_map.begin() ; it != m_resource_map.end() ; it++) { - tws_tvsrv::Resource *resource = (*it).second; - wl_resource_set_implementation(resource->handle, NULL, NULL, NULL); - } - - if (m_global) { - wl_global_destroy(m_global); - wl_list_remove(&m_displayDestroyedListener.link); - } - } - - void tws_tvsrv::init(struct ::wl_client *client, uint32_t id, int version) - { - m_resource = bind(client, id, version); - } - - void tws_tvsrv::init(struct ::wl_resource *resource) - { - m_resource = bind(resource); - } - - tws_tvsrv::Resource *tws_tvsrv::add(struct ::wl_client *client, int version) - { - Resource *resource = bind(client, 0, version); - m_resource_map.insert(std::pair(client, resource)); - return resource; - } - - tws_tvsrv::Resource *tws_tvsrv::add(struct ::wl_client *client, uint32_t id, int version) - { - Resource *resource = bind(client, id, version); - m_resource_map.insert(std::pair(client, resource)); - return resource; - } - - void tws_tvsrv::init(struct ::wl_display *display, int version) - { - m_global = wl_global_create(display, &::tws_tvsrv_interface, version, this, bind_func); - m_globalVersion = version; - m_displayDestroyedListener.notify = tws_tvsrv::display_destroy_func; - m_displayDestroyedListener.parent = this; - wl_display_add_destroy_listener(display, &m_displayDestroyedListener); - } - - const struct wl_interface *tws_tvsrv::interface() - { - return &::tws_tvsrv_interface; - } - - tws_tvsrv::Resource *tws_tvsrv::tws_tvsrv_allocate() - { - return new Resource; - } - - void tws_tvsrv::tws_tvsrv_bind_resource(Resource *) - { - } - - void tws_tvsrv::tws_tvsrv_destroy_resource(Resource *) - { - } - - void tws_tvsrv::bind_func(struct ::wl_client *client, void *data, uint32_t version, uint32_t id) - { - tws_tvsrv *that = static_cast(data); - that->add(client, id, std::min(that->m_globalVersion, version)); - } - - void tws_tvsrv::display_destroy_func(struct ::wl_listener *listener, void *data) - { - DS_UNUSED(data); - tws_tvsrv *that = static_cast(listener)->parent; - that->m_global = NULL; - } - - void tws_tvsrv::destroy_func(struct ::wl_resource *client_resource) - { - Resource *resource = Resource::fromResource(client_resource); - DS_ASSERT(resource); - tws_tvsrv *that = resource->tws_tvsrv_object; - that->m_resource_map.erase(resource->client()); - that->tws_tvsrv_destroy_resource(resource); - delete resource; - } - - tws_tvsrv::Resource *tws_tvsrv::bind(struct ::wl_client *client, uint32_t id, int version) - { - DS_ASSERT_X(!wl_client_get_object(client, id), "DSWaylandObject bind", "binding to object %u more than once", id); - struct ::wl_resource *handle = wl_resource_create(client, &::tws_tvsrv_interface, version, id); - return bind(handle); - } - - tws_tvsrv::Resource *tws_tvsrv::bind(struct ::wl_resource *handle) - { - Resource *resource = tws_tvsrv_allocate(); - resource->tws_tvsrv_object = this; - - wl_resource_set_implementation(handle, &m_tws_tvsrv_interface, resource, destroy_func); - resource->handle = handle; - tws_tvsrv_bind_resource(resource); - return resource; - } - tws_tvsrv::Resource *tws_tvsrv::Resource::fromResource(struct ::wl_resource *resource) - { - if (DS_UNLIKELY(!resource)) - return NULL; - if (wl_resource_instance_of(resource, &::tws_tvsrv_interface, &m_tws_tvsrv_interface)) - return static_cast(wl_resource_get_user_data(resource)); - return NULL; - } - - const struct ::tws_tvsrv_interface tws_tvsrv::m_tws_tvsrv_interface = { - tws_tvsrv::handle_release, - tws_tvsrv::handle_bind, - tws_tvsrv::handle_unbind - }; - - void tws_tvsrv::tws_tvsrv_release(Resource *) - { - } - - void tws_tvsrv::tws_tvsrv_bind(Resource *) - { - } - - void tws_tvsrv::tws_tvsrv_unbind(Resource *) - { - } - - - void tws_tvsrv::handle_release( - ::wl_client *client, - struct wl_resource *resource) - { - DS_UNUSED(client); - Resource *r = Resource::fromResource(resource); - static_cast(r->tws_tvsrv_object)->tws_tvsrv_release( - r); - } - - void tws_tvsrv::handle_bind( - ::wl_client *client, - struct wl_resource *resource) - { - DS_UNUSED(client); - Resource *r = Resource::fromResource(resource); - static_cast(r->tws_tvsrv_object)->tws_tvsrv_bind( - r); - } - - void tws_tvsrv::handle_unbind( - ::wl_client *client, - struct wl_resource *resource) - { - DS_UNUSED(client); - Resource *r = Resource::fromResource(resource); - static_cast(r->tws_tvsrv_object)->tws_tvsrv_unbind( - r); - } - tws_region::tws_region(struct ::wl_client *client, uint32_t id, int version) : m_resource_map() , m_resource(NULL) @@ -2062,7 +1841,7 @@ namespace DSWaylandServer { { } - void tws_service_screensaver_manager::tws_service_screensaver_manager_state_get(Resource *) + void tws_service_screensaver_manager::tws_service_screensaver_manager_state_get(Resource *, uint32_t ) { } @@ -2111,12 +1890,14 @@ namespace DSWaylandServer { void tws_service_screensaver_manager::handle_state_get( ::wl_client *client, - struct wl_resource *resource) + struct wl_resource *resource, + uint32_t state_type) { DS_UNUSED(client); Resource *r = Resource::fromResource(resource); static_cast(r->tws_service_screensaver_manager_object)->tws_service_screensaver_manager_state_get( - r); + r, + state_type); } void tws_service_screensaver_manager::send_idle() @@ -3139,11 +2920,11 @@ namespace DSWaylandServer { { } - void tws_softkey::tws_softkey_state_set(Resource *) + void tws_softkey::tws_softkey_state_set(Resource *, int32_t , int32_t ) { } - void tws_softkey::tws_softkey_state_get(Resource *) + void tws_softkey::tws_softkey_state_get(Resource *, int32_t ) { } @@ -3190,22 +2971,28 @@ namespace DSWaylandServer { void tws_softkey::handle_state_set( ::wl_client *client, - struct wl_resource *resource) + struct wl_resource *resource, + int32_t type, + int32_t val) { DS_UNUSED(client); Resource *r = Resource::fromResource(resource); static_cast(r->tws_softkey_object)->tws_softkey_state_set( - r); + r, + type, + val); } void tws_softkey::handle_state_get( ::wl_client *client, - struct wl_resource *resource) + struct wl_resource *resource, + int32_t type) { DS_UNUSED(client); Resource *r = Resource::fromResource(resource); static_cast(r->tws_softkey_object)->tws_softkey_state_get( - r); + r, + type); } void tws_softkey::send_support_check_done(int32_t support) diff --git a/src/DSWaylandServer/dswayland-server-tzsh.h b/src/DSWaylandServer/dswayland-server-tzsh.h index 3b94e6c..0d347b8 100644 --- a/src/DSWaylandServer/dswayland-server-tzsh.h +++ b/src/DSWaylandServer/dswayland-server-tzsh.h @@ -95,7 +95,6 @@ namespace DSWaylandServer { virtual void tizen_ws_shell_service_create(Resource *resource, uint32_t id, uint32_t win, const std::string &name); virtual void tizen_ws_shell_region_create(Resource *resource, uint32_t id); virtual void tizen_ws_shell_quickpanel_get(Resource *resource, uint32_t id, uint32_t win); - virtual void tizen_ws_shell_tvsrv_get(Resource *resource, uint32_t id, uint32_t win); virtual void tizen_ws_shell_extension_get(Resource *resource, uint32_t id, const std::string &name); virtual void tizen_ws_shell_softkey_get(Resource *resource, uint32_t id, uint32_t win); virtual void tizen_ws_shell_shared_widget_launch_get(Resource *resource, uint32_t id, uint32_t win); @@ -128,11 +127,6 @@ namespace DSWaylandServer { struct wl_resource *resource, uint32_t id, uint32_t win); - static void handle_tvsrv_get( - ::wl_client *client, - struct wl_resource *resource, - uint32_t id, - uint32_t win); static void handle_extension_get( ::wl_client *client, struct wl_resource *resource, @@ -236,6 +230,7 @@ namespace DSWaylandServer { type_value_unknown = 0, type_value_system_default = 1, type_value_context_menu = 2, + type_value_apps_menu = 3, }; void send_state_get_done(int32_t type, int32_t value, uint32_t error_state); @@ -307,99 +302,6 @@ namespace DSWaylandServer { DisplayDestroyedListener m_displayDestroyedListener; }; - class tws_tvsrv - { - public: - tws_tvsrv(struct ::wl_client *client, uint32_t id, int version); - tws_tvsrv(struct ::wl_display *display, int version); - tws_tvsrv(struct ::wl_resource *resource); - tws_tvsrv(); - - virtual ~tws_tvsrv(); - - class Resource - { - public: - Resource() : tws_tvsrv_object(NULL), handle(NULL) {} - virtual ~Resource() {} - - tws_tvsrv *tws_tvsrv_object; - tws_tvsrv *object() { return tws_tvsrv_object; } - struct ::wl_resource *handle; - - struct ::wl_client *client() const { return wl_resource_get_client(handle); } - int version() const { return wl_resource_get_version(handle); } - - static Resource *fromResource(struct ::wl_resource *resource); - }; - - void init(struct ::wl_client *client, uint32_t id, int version); - void init(struct ::wl_display *display, int version); - void init(struct ::wl_resource *resource); - - Resource *add(struct ::wl_client *client, int version); - Resource *add(struct ::wl_client *client, uint32_t id, int version); - Resource *add(struct wl_list *resource_list, struct ::wl_client *client, uint32_t id, int version); - - Resource *resource() { return m_resource; } - const Resource *resource() const { return m_resource; } - - std::multimap resourceMap() { return m_resource_map; } - const std::multimap resourceMap() const { return m_resource_map; } - - bool isGlobal() const { return m_global != NULL; } - bool isResource() const { return m_resource != NULL; } - - static const struct ::wl_interface *interface(); - static std::string interfaceName() { return interface()->name; } - static int interfaceVersion() { return interface()->version; } - - - enum error { - error_request_rejected = 0, // given request is denied - }; - - protected: - virtual Resource *tws_tvsrv_allocate(); - - virtual void tws_tvsrv_bind_resource(Resource *resource); - virtual void tws_tvsrv_destroy_resource(Resource *resource); - - virtual void tws_tvsrv_release(Resource *resource); - virtual void tws_tvsrv_bind(Resource *resource); - virtual void tws_tvsrv_unbind(Resource *resource); - - private: - static void bind_func(struct ::wl_client *client, void *data, uint32_t version, uint32_t id); - static void destroy_func(struct ::wl_resource *client_resource); - static void display_destroy_func(struct ::wl_listener *listener, void *data); - - Resource *bind(struct ::wl_client *client, uint32_t id, int version); - Resource *bind(struct ::wl_resource *handle); - - static const struct ::tws_tvsrv_interface m_tws_tvsrv_interface; - - static void handle_release( - ::wl_client *client, - struct wl_resource *resource); - static void handle_bind( - ::wl_client *client, - struct wl_resource *resource); - static void handle_unbind( - ::wl_client *client, - struct wl_resource *resource); - - std::multimap m_resource_map; - Resource *m_resource; - struct ::wl_global *m_global; - uint32_t m_globalVersion; - struct DisplayDestroyedListener : ::wl_listener { - tws_tvsrv *parent; - DisplayDestroyedListener(): parent(NULL) {} - }; - DisplayDestroyedListener m_displayDestroyedListener; - }; - class tws_region { public: @@ -893,7 +795,7 @@ namespace DSWaylandServer { virtual void tws_service_screensaver_manager_enable(Resource *resource); virtual void tws_service_screensaver_manager_disable(Resource *resource); virtual void tws_service_screensaver_manager_idle_time_set(Resource *resource, uint32_t id); - virtual void tws_service_screensaver_manager_state_get(Resource *resource); + virtual void tws_service_screensaver_manager_state_get(Resource *resource, uint32_t state_type); private: static void bind_func(struct ::wl_client *client, void *data, uint32_t version, uint32_t id); @@ -920,7 +822,8 @@ namespace DSWaylandServer { uint32_t id); static void handle_state_get( ::wl_client *client, - struct wl_resource *resource); + struct wl_resource *resource, + uint32_t state_type); std::multimap m_resource_map; Resource *m_resource; @@ -1382,8 +1285,8 @@ namespace DSWaylandServer { virtual void tws_softkey_support_check(Resource *resource); virtual void tws_softkey_show(Resource *resource); virtual void tws_softkey_hide(Resource *resource); - virtual void tws_softkey_state_set(Resource *resource); - virtual void tws_softkey_state_get(Resource *resource); + virtual void tws_softkey_state_set(Resource *resource, int32_t type, int32_t val); + virtual void tws_softkey_state_get(Resource *resource, int32_t type); private: static void bind_func(struct ::wl_client *client, void *data, uint32_t version, uint32_t id); @@ -1409,10 +1312,13 @@ namespace DSWaylandServer { struct wl_resource *resource); static void handle_state_set( ::wl_client *client, - struct wl_resource *resource); + struct wl_resource *resource, + int32_t type, + int32_t val); static void handle_state_get( ::wl_client *client, - struct wl_resource *resource); + struct wl_resource *resource, + int32_t type); std::multimap m_resource_map; Resource *m_resource; diff --git a/src/DSWaylandServer/dswayland-server-wayland.h b/src/DSWaylandServer/dswayland-server-wayland.h index 0cdfa52..4bf6c30 100644 --- a/src/DSWaylandServer/dswayland-server-wayland.h +++ b/src/DSWaylandServer/dswayland-server-wayland.h @@ -1300,6 +1300,7 @@ namespace DSWaylandServer { enum error { error_invalid_scale = 0, // buffer scale value is invalid error_invalid_transform = 1, // buffer transform value is invalid + error_invalid_size = 2, // buffer size is invalid }; void send_enter(struct ::wl_resource *output); @@ -1446,6 +1447,10 @@ namespace DSWaylandServer { capability_touch = 4, // the seat has touch devices }; + enum error { + error_missing_capability = 0, // get_pointer, get_keyboard or get_touch called on seat without the matching capability + }; + void send_capabilities(uint32_t capabilities); void send_capabilities(struct ::wl_resource *resource, uint32_t capabilities); void send_name(const std::string &name); -- 2.7.4 From 7e992e58214100875346fa8ae6f9e6bf84cb882f Mon Sep 17 00:00:00 2001 From: ulgal-park Date: Mon, 10 May 2021 13:49:11 +0900 Subject: [PATCH 13/16] Build: set b_pie option set b_pie option to true for make PIE Change-Id: Ief61c2c76e3b68bfcc316bf4ba37a5fc8431ca3b --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 1c0ab21..7dbefbe 100644 --- a/meson.build +++ b/meson.build @@ -3,7 +3,7 @@ project( ['c', 'cpp'], version : '0.0.1', license : 'MIT', - default_options : ['c_std=c11', 'cpp_std=c++17'] + default_options : ['c_std=c11', 'cpp_std=c++17', 'b_pie=true'] ) libds_version = meson.project_version().split('.') -- 2.7.4 From f9beee40d1a579e3be55e6f9b44f1b5889b28259 Mon Sep 17 00:00:00 2001 From: Sung-Jin Park Date: Tue, 25 May 2021 15:43:48 +0900 Subject: [PATCH 14/16] DSWaylandInputPanel: fix not to use invalid iterator Change-Id: Id5ee96de9d5873ad6ce605b1cebc6a3cc4469aa7 Signed-off-by: Sung-Jin Park --- src/DSWaylandServer/DSWaylandInputPanel.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/DSWaylandServer/DSWaylandInputPanel.cpp b/src/DSWaylandServer/DSWaylandInputPanel.cpp index 46e643b..21d5878 100644 --- a/src/DSWaylandServer/DSWaylandInputPanel.cpp +++ b/src/DSWaylandServer/DSWaylandInputPanel.cpp @@ -326,11 +326,10 @@ void DSWaylandInputPanelSurfacePrivate::clearGlobals(void *inputPanelResource) { for (auto it = __dataMap.begin(); it != __dataMap.end(); it++) { - auto tempIt = it; DSWaylandInputPanelSurfaceData *surfaceData = (*it).second; if (surfaceData->getInputPanelResource() == inputPanelResource) { - __dataMap.erase(tempIt); + it = __dataMap.erase(it); /* TODO: clear window's data */ } } -- 2.7.4 From 38a744c50d2737737910c7f2b676cc71286265ef Mon Sep 17 00:00:00 2001 From: Daekwang Ryu Date: Wed, 2 Jun 2021 11:43:55 +0900 Subject: [PATCH 15/16] Change API usage of OffscreenWindow::New Change-Id: I56aaff48b586c79adcd3b3628230d43f564dbcc4 OffscreenWindow::New was changed. --- src/DSRender/DSRenderEngineDaliImpl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DSRender/DSRenderEngineDaliImpl.cpp b/src/DSRender/DSRenderEngineDaliImpl.cpp index bf2ab39..e1d13c2 100644 --- a/src/DSRender/DSRenderEngineDaliImpl.cpp +++ b/src/DSRender/DSRenderEngineDaliImpl.cpp @@ -39,7 +39,7 @@ DSRenderEngineDaliImpl::DSRenderEngineDaliImpl(std::shared_ptr b __needToRender(false) { tbm_surface_queue_h nativeBufferQueue = (tbm_surface_queue_h)bufferQueue->getNativeBufferQueue(); - __offscreenApplication = OffscreenApplication::New(nativeBufferQueue, true, OffscreenApplication::RenderMode::MANUAL); + __offscreenApplication = OffscreenApplication::New(nativeBufferQueue, OffscreenApplication::RenderMode::MANUAL); __offscreenApplication.InitSignal().Connect(this, &DSRenderEngineDaliImpl::onInitialize); -- 2.7.4 From 79b5d5b275b6178277bf6121bd7a4610ba132f5d Mon Sep 17 00:00:00 2001 From: "Junseok, Kim" Date: Fri, 7 Jan 2022 14:36:30 +0900 Subject: [PATCH 16/16] update following wayland protocols - wayland - tizen-extension - tizen-hwc - input-method Change-Id: If4af733eeeb6c80103a96379ae3c82bafcbd0f79 --- src/DSWaylandServer/DSWaylandInputMethod.cpp | 56 +- src/DSWaylandServer/DSWaylandInputMethod.h | 3 + .../DSWaylandInputMethodContextPrivate.h | 4 +- src/DSWaylandServer/DSWaylandInputMethodPrivate.h | 11 +- src/DSWaylandServer/DSWaylandInputPanel.cpp | 8 +- src/DSWaylandServer/DSWaylandInputPanelPrivate.h | 4 +- .../DSWaylandInputPanelSurfacePrivate.h | 4 +- .../dswayland-server-input-method-unstable-v1.cpp | 2050 ++++++++++++++++++++ ...=> dswayland-server-input-method-unstable-v1.h} | 232 +-- .../dswayland-server-input-method.cpp | 1970 ------------------- .../dswayland-server-tizen-extension.cpp | 117 +- .../dswayland-server-tizen-extension.h | 23 +- src/DSWaylandServer/dswayland-server-tizen-hwc.cpp | 10 +- src/DSWaylandServer/dswayland-server-tizen-hwc.h | 6 +- src/meson.build | 4 +- 15 files changed, 2385 insertions(+), 2117 deletions(-) create mode 100644 src/DSWaylandServer/dswayland-server-input-method-unstable-v1.cpp rename src/DSWaylandServer/{dswayland-server-input-method.h => dswayland-server-input-method-unstable-v1.h} (69%) delete mode 100644 src/DSWaylandServer/dswayland-server-input-method.cpp diff --git a/src/DSWaylandServer/DSWaylandInputMethod.cpp b/src/DSWaylandServer/DSWaylandInputMethod.cpp index ad50352..93d3aee 100644 --- a/src/DSWaylandServer/DSWaylandInputMethod.cpp +++ b/src/DSWaylandServer/DSWaylandInputMethod.cpp @@ -490,7 +490,7 @@ DSWaylandInputMethodPrivate::DSWaylandInputMethodPrivate(DSWaylandInputMethod *p if (!compositor) return; - wl_input_method::init(__compositor->display(), 1); + zwp_input_method_v1::init(__compositor->display(), 1); } DSWaylandInputMethodPrivate::~DSWaylandInputMethodPrivate() @@ -532,18 +532,18 @@ DSWaylandInputMethodContextPrivate::Resource* DSWaylandInputMethodPrivate::getRe return resource; } -void DSWaylandInputMethodPrivate::sendActivate(void *contextResource, int textInputId, bool focusInEvent) +void DSWaylandInputMethodPrivate::sendActivate(void *contextResource, int textInputId) { DSWaylandInputMethodContextPrivate::Resource *resource = DSWaylandInputMethodContextPrivate::Resource::fromResource((struct ::wl_resource *)contextResource); __contextMap.insert(std::pair(resource, textInputId)); - send_activate(__resource->handle, (struct ::wl_resource *)contextResource, textInputId, focusInEvent); + send_activate(__resource->handle, (struct ::wl_resource *)contextResource); } -void DSWaylandInputMethodPrivate::sendDeactivate(void *contextResource, bool focusInEvent) +void DSWaylandInputMethodPrivate::sendDeactivate(void *contextResource) { DSWaylandInputMethodContextPrivate::Resource *resource = DSWaylandInputMethodContextPrivate::Resource::fromResource((struct ::wl_resource *)contextResource); __contextMap.erase(resource); - send_deactivate(__resource->handle, (struct ::wl_resource *)contextResource, focusInEvent); + send_deactivate(__resource->handle, (struct ::wl_resource *)contextResource); } void DSWaylandInputMethodPrivate::showInputPanel(void *contextResource, int textInputId) @@ -559,6 +559,24 @@ void DSWaylandInputMethodPrivate::hideInputPanel(void *contextResource, int text send_hide_input_panel(__resource->handle, (struct ::wl_resource *)contextResource); } +void DSWaylandInputMethodPrivate::openConnection(void *contextResource) +{ + //Resource *resource = getResource(textInputId); + send_open_connection(__resource->handle, (struct ::wl_resource *)contextResource); +} + +void DSWaylandInputMethodPrivate::closeConnection(void *contextResource) +{ + //Resource *resource = getResource(textInputId); + send_close_connection(__resource->handle, (struct ::wl_resource *)contextResource); +} + +void DSWaylandInputMethodPrivate::setTextInputId(void *contextResource, int textInputId) +{ + //Resource *resource = getResource(textInputId); + send_set_text_input_id(__resource->handle, (struct ::wl_resource *)contextResource, textInputId); +} + void DSWaylandInputMethodPrivate::input_method_bind_resource(Resource *resource) { __resource = resource; @@ -618,7 +636,7 @@ void DSWaylandInputMethod::activate(int textInputId) } if (__activateContext) - priv->sendActivate(__activateContext, textInputId, true); + priv->sendActivate(__activateContext, textInputId); } void DSWaylandInputMethod::deactivate() @@ -627,7 +645,7 @@ void DSWaylandInputMethod::deactivate() if (__activateContext) { - priv->sendDeactivate(__activateContext, true); + priv->sendDeactivate(__activateContext); __activateContext = nullptr; } } @@ -653,6 +671,30 @@ void DSWaylandInputMethod::hideInputPanel(int textInputId) priv->hideInputPanel(__activateContext, textInputId); } +void DSWaylandInputMethod::openConnection() +{ + DS_GET_PRIV(DSWaylandInputMethod); + + if (__activateContext) + priv->openConnection(__activateContext); +} + +void DSWaylandInputMethod::closeConnection() +{ + DS_GET_PRIV(DSWaylandInputMethod); + + if (__activateContext) + priv->closeConnection(__activateContext); +} + +void DSWaylandInputMethod::setTextInputId(int textInputId) +{ + DS_GET_PRIV(DSWaylandInputMethod); + + if (__activateContext) + priv->setTextInputId(__activateContext, textInputId); +} + void DSWaylandInputMethod::resetTextInput() { __inputMethodContext->sendReset(__activateContext); diff --git a/src/DSWaylandServer/DSWaylandInputMethod.h b/src/DSWaylandServer/DSWaylandInputMethod.h index 590f81c..3610d84 100644 --- a/src/DSWaylandServer/DSWaylandInputMethod.h +++ b/src/DSWaylandServer/DSWaylandInputMethod.h @@ -50,6 +50,9 @@ public: void deactivate(); void showInputPanel(int textInputId); void hideInputPanel(int textInputId); + void openConnection(); + void closeConnection(); + void setTextInputId(int textInputId); void resetTextInput(); void setContentType(unsigned int hint, unsigned int purpose); void setPreferredLanguage(const std::string language); diff --git a/src/DSWaylandServer/DSWaylandInputMethodContextPrivate.h b/src/DSWaylandServer/DSWaylandInputMethodContextPrivate.h index 72bc88d..0df8a92 100644 --- a/src/DSWaylandServer/DSWaylandInputMethodContextPrivate.h +++ b/src/DSWaylandServer/DSWaylandInputMethodContextPrivate.h @@ -24,7 +24,7 @@ #ifndef __DS_WAYLAND_INPUT_METHOD_CONTEXT_PRIVATE_H__ #define __DS_WAYLAND_INPUT_METHOD_CONTEXT_PRIVATE_H__ -#include "dswayland-server-input-method.h" +#include "dswayland-server-input-method-unstable-v1.h" #include "DSCore.h" #include "DSObjectPrivate.h" @@ -34,7 +34,7 @@ namespace display_server { /*LCOV_EXCL_START*/ -class DS_DECL_EXPORT DSWaylandInputMethodContextPrivate : public DSObjectPrivate, public DSWaylandServer::wl_input_method_context +class DS_DECL_EXPORT DSWaylandInputMethodContextPrivate : public DSObjectPrivate, public DSWaylandServer::zwp_input_method_context_v1 { DS_PIMPL_USE_PUBLIC(DSWaylandInputMethodContext); public: diff --git a/src/DSWaylandServer/DSWaylandInputMethodPrivate.h b/src/DSWaylandServer/DSWaylandInputMethodPrivate.h index 90b98e3..cb4cc5d 100644 --- a/src/DSWaylandServer/DSWaylandInputMethodPrivate.h +++ b/src/DSWaylandServer/DSWaylandInputMethodPrivate.h @@ -24,7 +24,7 @@ #ifndef __DS_WAYLAND_INPUT_METHOD_PRIVATE_H__ #define __DS_WAYLAND_INPUT_METHOD_PRIVATE_H__ -#include "dswayland-server-input-method.h" +#include "dswayland-server-input-method-unstable-v1.h" #include "DSCore.h" #include "DSObjectPrivate.h" @@ -36,17 +36,20 @@ namespace display_server /*LCOV_EXCL_START*/ class DSWaylandInputMethodContextPrivate; -class DS_DECL_EXPORT DSWaylandInputMethodPrivate : public DSObjectPrivate, public DSWaylandServer::wl_input_method +class DS_DECL_EXPORT DSWaylandInputMethodPrivate : public DSObjectPrivate, public DSWaylandServer::zwp_input_method_v1 { DS_PIMPL_USE_PUBLIC(DSWaylandInputMethod); public: DSWaylandInputMethodPrivate(DSWaylandInputMethod *p_ptr, DSWaylandCompositor *compositor); ~DSWaylandInputMethodPrivate() override; - void sendActivate(void *contextResource, int textInputId, bool focusInEvent); - void sendDeactivate(void *contextResource, bool focusInEvent); + void sendActivate(void *contextResource, int textInputId); + void sendDeactivate(void *contextResource); void showInputPanel(void *contextResource, int textInputId); void hideInputPanel(void *contextResource, int textInputId); + void openConnection(void *contextResource); + void closeConnection(void *contextResource); + void setTextInputId(void *contextResource, int textInputId); int getResourceId(DSWaylandInputMethodContextPrivate::Resource *resource); DSWaylandInputMethodContextPrivate::Resource* getResource(int id); diff --git a/src/DSWaylandServer/DSWaylandInputPanel.cpp b/src/DSWaylandServer/DSWaylandInputPanel.cpp index 21d5878..2b63992 100644 --- a/src/DSWaylandServer/DSWaylandInputPanel.cpp +++ b/src/DSWaylandServer/DSWaylandInputPanel.cpp @@ -59,11 +59,11 @@ private: class DSWaylandInputPanelSurfaceData { public: - DSWaylandInputPanelSurfaceData(DSWaylandServer::wl_input_panel_surface::Resource *resource, void *inputPanelResource) + DSWaylandInputPanelSurfaceData(DSWaylandServer::zwp_input_panel_surface_v1::Resource *resource, void *inputPanelResource) : panel(false), showing(false), needShow(false), resizing(false), __resource(resource), __inputPanelResource(inputPanelResource), __wlSurface(nullptr) {} - DSWaylandInputPanelSurfaceData(DSWaylandServer::wl_input_panel_surface::Resource *resource, void *inputPanelResource, void *surfaceResource) + DSWaylandInputPanelSurfaceData(DSWaylandServer::zwp_input_panel_surface_v1::Resource *resource, void *inputPanelResource, void *surfaceResource) : panel(false), showing(false), needShow(false), resizing(false), __resource(resource), __inputPanelResource(inputPanelResource) { __wlSurface = DSWaylandSurface::fromWlResource((struct ::wl_resource *)surfaceResource); } @@ -78,7 +78,7 @@ public: bool resizing; private: - DSWaylandServer::wl_input_panel_surface::Resource *__resource; + DSWaylandServer::zwp_input_panel_surface_v1::Resource *__resource; void *__inputPanelResource; DSWaylandSurface *__wlSurface; }; @@ -90,7 +90,7 @@ DSWaylandInputPanelPrivate::DSWaylandInputPanelPrivate(DSWaylandInputPanel *p_pt if (!compositor) return; - wl_input_panel::init(__compositor->display(), 1); + zwp_input_panel_v1::init(__compositor->display(), 1); } DSWaylandInputPanelPrivate::~DSWaylandInputPanelPrivate() diff --git a/src/DSWaylandServer/DSWaylandInputPanelPrivate.h b/src/DSWaylandServer/DSWaylandInputPanelPrivate.h index fe4bd53..b58135a 100644 --- a/src/DSWaylandServer/DSWaylandInputPanelPrivate.h +++ b/src/DSWaylandServer/DSWaylandInputPanelPrivate.h @@ -24,7 +24,7 @@ #ifndef __DS_WAYLAND_INPUT_PANEL_PRIVATE_H__ #define __DS_WAYLAND_INPUT_PANEL_PRIVATE_H__ -#include "dswayland-server-input-method.h" +#include "dswayland-server-input-method-unstable-v1.h" #include "DSCore.h" #include "DSObjectPrivate.h" @@ -34,7 +34,7 @@ namespace display_server { /*LCOV_EXCL_START*/ -class DS_DECL_EXPORT DSWaylandInputPanelPrivate : public DSObjectPrivate, public DSWaylandServer::wl_input_panel +class DS_DECL_EXPORT DSWaylandInputPanelPrivate : public DSObjectPrivate, public DSWaylandServer::zwp_input_panel_v1 { DS_PIMPL_USE_PUBLIC(DSWaylandInputPanel); public: diff --git a/src/DSWaylandServer/DSWaylandInputPanelSurfacePrivate.h b/src/DSWaylandServer/DSWaylandInputPanelSurfacePrivate.h index 22e10b3..8edd342 100644 --- a/src/DSWaylandServer/DSWaylandInputPanelSurfacePrivate.h +++ b/src/DSWaylandServer/DSWaylandInputPanelSurfacePrivate.h @@ -24,7 +24,7 @@ #ifndef __DS_WAYLAND_INPUT_PANEL_SURFACE_PRIVATE_H__ #define __DS_WAYLAND_INPUT_PANEL_SURFACE_PRIVATE_H__ -#include "dswayland-server-input-method.h" +#include "dswayland-server-input-method-unstable-v1.h" #include "DSCore.h" #include "DSObjectPrivate.h" @@ -37,7 +37,7 @@ namespace display_server /*LCOV_EXCL_START*/ class DSWaylandInputPanelSurfaceData; -class DS_DECL_EXPORT DSWaylandInputPanelSurfacePrivate : public DSObjectPrivate, public DSWaylandServer::wl_input_panel_surface +class DS_DECL_EXPORT DSWaylandInputPanelSurfacePrivate : public DSObjectPrivate, public DSWaylandServer::zwp_input_panel_surface_v1 { DS_PIMPL_USE_PUBLIC(DSWaylandInputPanelSurface); public: diff --git a/src/DSWaylandServer/dswayland-server-input-method-unstable-v1.cpp b/src/DSWaylandServer/dswayland-server-input-method-unstable-v1.cpp new file mode 100644 index 0000000..dd60486 --- /dev/null +++ b/src/DSWaylandServer/dswayland-server-input-method-unstable-v1.cpp @@ -0,0 +1,2050 @@ +/*LCOV_EXCL_START*/ +/* Protocol XML file : wayland-extension/input-method.xml */ + +#include "dswayland-server-input-method-unstable-v1.h" + +#ifndef DS_UNLIKELY +#define DS_UNLIKELY(X) X +#endif +#ifndef DS_UNUSED +#define DS_UNUSED(X) (void)X +#endif +#ifndef DS_ASSERT +#define DS_ASSERT(COND) assert(COND) +#endif +#ifndef DS_ASSERT_X +#define DS_ASSERT_X(COND, ERR_TAG, ERR_MSG, X...) \ + do {\ + if (! (COND))\ + {\ + fprintf(stderr, "%s :: "#ERR_MSG, ERR_TAG, ##X);\ + assert(COND);\ + }\ + } while(0) +#endif +#ifndef WRN +#define WRN(X...) fprintf(stderr,##X) +#endif + +namespace DSWaylandServer { + zwp_input_method_context_v1::zwp_input_method_context_v1(struct ::wl_client *client, uint32_t id, int version) + : m_resource_map() + , m_resource(NULL) + , m_global(NULL) + , m_globalVersion(0) + , m_displayDestroyedListener() + { + init(client, id, version); + } + + zwp_input_method_context_v1::zwp_input_method_context_v1(struct ::wl_display *display, int version) + : m_resource_map() + , m_resource(NULL) + , m_global(NULL) + , m_globalVersion(0) + , m_displayDestroyedListener() + { + init(display, version); + } + + zwp_input_method_context_v1::zwp_input_method_context_v1(struct ::wl_resource *resource) + : m_resource_map() + , m_resource(NULL) + , m_global(NULL) + , m_globalVersion(0) + , m_displayDestroyedListener() + { + init(resource); + } + + zwp_input_method_context_v1::zwp_input_method_context_v1() + : m_resource_map() + , m_resource(NULL) + , m_global(NULL) + , m_globalVersion(0) + , m_displayDestroyedListener() + { + } + + zwp_input_method_context_v1::~zwp_input_method_context_v1() + { + std::multimap::iterator it; + for (it = m_resource_map.begin() ; it != m_resource_map.end() ; it++) { + zwp_input_method_context_v1::Resource *resource = (*it).second; + wl_resource_set_implementation(resource->handle, NULL, NULL, NULL); + } + + if (m_global) { + wl_global_destroy(m_global); + wl_list_remove(&m_displayDestroyedListener.link); + } + } + + void zwp_input_method_context_v1::init(struct ::wl_client *client, uint32_t id, int version) + { + m_resource = bind(client, id, version); + } + + void zwp_input_method_context_v1::init(struct ::wl_resource *resource) + { + m_resource = bind(resource); + } + + zwp_input_method_context_v1::Resource *zwp_input_method_context_v1::add(struct ::wl_client *client, int version) + { + Resource *resource = bind(client, 0, version); + m_resource_map.insert(std::pair(client, resource)); + return resource; + } + + zwp_input_method_context_v1::Resource *zwp_input_method_context_v1::add(struct ::wl_client *client, uint32_t id, int version) + { + Resource *resource = bind(client, id, version); + m_resource_map.insert(std::pair(client, resource)); + return resource; + } + + void zwp_input_method_context_v1::init(struct ::wl_display *display, int version) + { + m_global = wl_global_create(display, &::zwp_input_method_context_v1_interface, version, this, bind_func); + m_globalVersion = version; + m_displayDestroyedListener.notify = zwp_input_method_context_v1::display_destroy_func; + m_displayDestroyedListener.parent = this; + wl_display_add_destroy_listener(display, &m_displayDestroyedListener); + } + + const struct wl_interface *zwp_input_method_context_v1::interface() + { + return &::zwp_input_method_context_v1_interface; + } + + zwp_input_method_context_v1::Resource *zwp_input_method_context_v1::zwp_input_method_context_v1_allocate() + { + return new Resource; + } + + void zwp_input_method_context_v1::zwp_input_method_context_v1_bind_resource(Resource *) + { + } + + void zwp_input_method_context_v1::zwp_input_method_context_v1_destroy_resource(Resource *) + { + } + + void zwp_input_method_context_v1::bind_func(struct ::wl_client *client, void *data, uint32_t version, uint32_t id) + { + zwp_input_method_context_v1 *that = static_cast(data); + that->add(client, id, std::min(that->m_globalVersion, version)); + } + + void zwp_input_method_context_v1::display_destroy_func(struct ::wl_listener *listener, void *data) + { + DS_UNUSED(data); + zwp_input_method_context_v1 *that = static_cast(listener)->parent; + that->m_global = NULL; + } + + void zwp_input_method_context_v1::destroy_func(struct ::wl_resource *client_resource) + { + Resource *resource = Resource::fromResource(client_resource); + DS_ASSERT(resource); + zwp_input_method_context_v1 *that = resource->zwp_input_method_context_v1_object; + that->m_resource_map.erase(resource->client()); + that->zwp_input_method_context_v1_destroy_resource(resource); + delete resource; + } + + zwp_input_method_context_v1::Resource *zwp_input_method_context_v1::bind(struct ::wl_client *client, uint32_t id, int version) + { + DS_ASSERT_X(!wl_client_get_object(client, id), "DSWaylandObject bind", "binding to object %u more than once", id); + struct ::wl_resource *handle = wl_resource_create(client, &::zwp_input_method_context_v1_interface, version, id); + return bind(handle); + } + + zwp_input_method_context_v1::Resource *zwp_input_method_context_v1::bind(struct ::wl_resource *handle) + { + Resource *resource = zwp_input_method_context_v1_allocate(); + resource->zwp_input_method_context_v1_object = this; + + wl_resource_set_implementation(handle, &m_zwp_input_method_context_v1_interface, resource, destroy_func); + resource->handle = handle; + zwp_input_method_context_v1_bind_resource(resource); + return resource; + } + zwp_input_method_context_v1::Resource *zwp_input_method_context_v1::Resource::fromResource(struct ::wl_resource *resource) + { + if (DS_UNLIKELY(!resource)) + return NULL; + if (wl_resource_instance_of(resource, &::zwp_input_method_context_v1_interface, &m_zwp_input_method_context_v1_interface)) + return static_cast(wl_resource_get_user_data(resource)); + return NULL; + } + + const struct ::zwp_input_method_context_v1_interface zwp_input_method_context_v1::m_zwp_input_method_context_v1_interface = { + zwp_input_method_context_v1::handle_destroy, + zwp_input_method_context_v1::handle_commit_string, + zwp_input_method_context_v1::handle_preedit_string, + zwp_input_method_context_v1::handle_preedit_styling, + zwp_input_method_context_v1::handle_preedit_cursor, + zwp_input_method_context_v1::handle_delete_surrounding_text, + zwp_input_method_context_v1::handle_cursor_position, + zwp_input_method_context_v1::handle_modifiers_map, + zwp_input_method_context_v1::handle_keysym, + zwp_input_method_context_v1::handle_grab_keyboard, + zwp_input_method_context_v1::handle_key, + zwp_input_method_context_v1::handle_modifiers, + zwp_input_method_context_v1::handle_language, + zwp_input_method_context_v1::handle_text_direction, + zwp_input_method_context_v1::handle_selection_region, + zwp_input_method_context_v1::handle_private_command, + zwp_input_method_context_v1::handle_update_input_panel_data, + zwp_input_method_context_v1::handle_hide_input_panel, + zwp_input_method_context_v1::handle_get_selection_text, + zwp_input_method_context_v1::handle_get_surrounding_text, + zwp_input_method_context_v1::handle_filter_key_event_done, + zwp_input_method_context_v1::handle_update_ise_geometry, + zwp_input_method_context_v1::handle_recapture_string, + zwp_input_method_context_v1::handle_input_panel_event, + zwp_input_method_context_v1::handle_commit_content, + zwp_input_method_context_v1::handle_update_candidate_state, + zwp_input_method_context_v1::handle_reshow_input_panel, + zwp_input_method_context_v1::handle_set_floating_panel, + zwp_input_method_context_v1::handle_set_floating_drag_enabled + }; + + void zwp_input_method_context_v1::zwp_input_method_context_v1_destroy(Resource *) + { + } + + void zwp_input_method_context_v1::zwp_input_method_context_v1_commit_string(Resource *, uint32_t , const std::string &) + { + } + + void zwp_input_method_context_v1::zwp_input_method_context_v1_preedit_string(Resource *, uint32_t , const std::string &, const std::string &) + { + } + + void zwp_input_method_context_v1::zwp_input_method_context_v1_preedit_styling(Resource *, uint32_t , uint32_t , uint32_t ) + { + } + + void zwp_input_method_context_v1::zwp_input_method_context_v1_preedit_cursor(Resource *, int32_t ) + { + } + + void zwp_input_method_context_v1::zwp_input_method_context_v1_delete_surrounding_text(Resource *, int32_t , uint32_t ) + { + } + + void zwp_input_method_context_v1::zwp_input_method_context_v1_cursor_position(Resource *, int32_t , int32_t ) + { + } + + void zwp_input_method_context_v1::zwp_input_method_context_v1_modifiers_map(Resource *, struct ::wl_array *) + { + } + + void zwp_input_method_context_v1::zwp_input_method_context_v1_keysym(Resource *, uint32_t , uint32_t , uint32_t , uint32_t , uint32_t ) + { + } + + void zwp_input_method_context_v1::zwp_input_method_context_v1_grab_keyboard(Resource *, uint32_t) + { + } + + void zwp_input_method_context_v1::zwp_input_method_context_v1_key(Resource *, uint32_t , uint32_t , uint32_t , uint32_t ) + { + } + + void zwp_input_method_context_v1::zwp_input_method_context_v1_modifiers(Resource *, uint32_t , uint32_t , uint32_t , uint32_t , uint32_t ) + { + } + + void zwp_input_method_context_v1::zwp_input_method_context_v1_language(Resource *, uint32_t , const std::string &) + { + } + + void zwp_input_method_context_v1::zwp_input_method_context_v1_text_direction(Resource *, uint32_t , uint32_t ) + { + } + + void zwp_input_method_context_v1::zwp_input_method_context_v1_selection_region(Resource *, uint32_t , int32_t , int32_t ) + { + } + + void zwp_input_method_context_v1::zwp_input_method_context_v1_private_command(Resource *, uint32_t , const std::string &) + { + } + + void zwp_input_method_context_v1::zwp_input_method_context_v1_update_input_panel_data(Resource *, uint32_t , const std::string &, uint32_t ) + { + } + + void zwp_input_method_context_v1::zwp_input_method_context_v1_hide_input_panel(Resource *, uint32_t ) + { + } + + void zwp_input_method_context_v1::zwp_input_method_context_v1_get_selection_text(Resource *, int32_t ) + { + } + + void zwp_input_method_context_v1::zwp_input_method_context_v1_get_surrounding_text(Resource *, uint32_t , uint32_t , int32_t ) + { + } + + void zwp_input_method_context_v1::zwp_input_method_context_v1_filter_key_event_done(Resource *, uint32_t , uint32_t ) + { + } + + void zwp_input_method_context_v1::zwp_input_method_context_v1_update_ise_geometry(Resource *, uint32_t , uint32_t , uint32_t , uint32_t , uint32_t ) + { + } + + void zwp_input_method_context_v1::zwp_input_method_context_v1_recapture_string(Resource *, uint32_t , int32_t , uint32_t , const std::string &, const std::string &, const std::string &) + { + } + + void zwp_input_method_context_v1::zwp_input_method_context_v1_input_panel_event(Resource *, uint32_t , uint32_t , uint32_t ) + { + } + + void zwp_input_method_context_v1::zwp_input_method_context_v1_commit_content(Resource *, uint32_t , const std::string &, const std::string &, const std::string &) + { + } + + void zwp_input_method_context_v1::zwp_input_method_context_v1_update_candidate_state(Resource *, uint32_t ) + { + } + + void zwp_input_method_context_v1::zwp_input_method_context_v1_reshow_input_panel(Resource *) + { + } + + void zwp_input_method_context_v1::zwp_input_method_context_v1_set_floating_panel(Resource *, uint32_t ) + { + } + + void zwp_input_method_context_v1::zwp_input_method_context_v1_set_floating_drag_enabled(Resource *, uint32_t ) + { + } + + + void zwp_input_method_context_v1::handle_destroy( + ::wl_client *client, + struct wl_resource *resource) + { + DS_UNUSED(client); + Resource *r = Resource::fromResource(resource); + static_cast(r->zwp_input_method_context_v1_object)->zwp_input_method_context_v1_destroy( + r); + } + + void zwp_input_method_context_v1::handle_commit_string( + ::wl_client *client, + struct wl_resource *resource, + uint32_t serial, + const char *text) + { + DS_UNUSED(client); + Resource *r = Resource::fromResource(resource); + static_cast(r->zwp_input_method_context_v1_object)->zwp_input_method_context_v1_commit_string( + r, + serial, + std::string(text)); + } + + void zwp_input_method_context_v1::handle_preedit_string( + ::wl_client *client, + struct wl_resource *resource, + uint32_t serial, + const char *text, + const char *commit) + { + DS_UNUSED(client); + Resource *r = Resource::fromResource(resource); + static_cast(r->zwp_input_method_context_v1_object)->zwp_input_method_context_v1_preedit_string( + r, + serial, + std::string(text), + std::string(commit)); + } + + void zwp_input_method_context_v1::handle_preedit_styling( + ::wl_client *client, + struct wl_resource *resource, + uint32_t index, + uint32_t length, + uint32_t style) + { + DS_UNUSED(client); + Resource *r = Resource::fromResource(resource); + static_cast(r->zwp_input_method_context_v1_object)->zwp_input_method_context_v1_preedit_styling( + r, + index, + length, + style); + } + + void zwp_input_method_context_v1::handle_preedit_cursor( + ::wl_client *client, + struct wl_resource *resource, + int32_t index) + { + DS_UNUSED(client); + Resource *r = Resource::fromResource(resource); + static_cast(r->zwp_input_method_context_v1_object)->zwp_input_method_context_v1_preedit_cursor( + r, + index); + } + + void zwp_input_method_context_v1::handle_delete_surrounding_text( + ::wl_client *client, + struct wl_resource *resource, + int32_t index, + uint32_t length) + { + DS_UNUSED(client); + Resource *r = Resource::fromResource(resource); + static_cast(r->zwp_input_method_context_v1_object)->zwp_input_method_context_v1_delete_surrounding_text( + r, + index, + length); + } + + void zwp_input_method_context_v1::handle_cursor_position( + ::wl_client *client, + struct wl_resource *resource, + int32_t index, + int32_t anchor) + { + DS_UNUSED(client); + Resource *r = Resource::fromResource(resource); + static_cast(r->zwp_input_method_context_v1_object)->zwp_input_method_context_v1_cursor_position( + r, + index, + anchor); + } + + void zwp_input_method_context_v1::handle_modifiers_map( + ::wl_client *client, + struct wl_resource *resource, + struct ::wl_array *map) + { + DS_UNUSED(client); + Resource *r = Resource::fromResource(resource); + static_cast(r->zwp_input_method_context_v1_object)->zwp_input_method_context_v1_modifiers_map( + r, + map); + } + + void zwp_input_method_context_v1::handle_keysym( + ::wl_client *client, + struct wl_resource *resource, + uint32_t serial, + uint32_t time, + uint32_t sym, + uint32_t state, + uint32_t modifiers) + { + DS_UNUSED(client); + Resource *r = Resource::fromResource(resource); + static_cast(r->zwp_input_method_context_v1_object)->zwp_input_method_context_v1_keysym( + r, + serial, + time, + sym, + state, + modifiers); + } + + void zwp_input_method_context_v1::handle_grab_keyboard( + ::wl_client *client, + struct wl_resource *resource, + uint32_t keyboard) + { + DS_UNUSED(client); + Resource *r = Resource::fromResource(resource); + static_cast(r->zwp_input_method_context_v1_object)->zwp_input_method_context_v1_grab_keyboard( + r, + keyboard); + } + + void zwp_input_method_context_v1::handle_key( + ::wl_client *client, + struct wl_resource *resource, + uint32_t serial, + uint32_t time, + uint32_t key, + uint32_t state) + { + DS_UNUSED(client); + Resource *r = Resource::fromResource(resource); + static_cast(r->zwp_input_method_context_v1_object)->zwp_input_method_context_v1_key( + r, + serial, + time, + key, + state); + } + + void zwp_input_method_context_v1::handle_modifiers( + ::wl_client *client, + struct wl_resource *resource, + uint32_t serial, + uint32_t mods_depressed, + uint32_t mods_latched, + uint32_t mods_locked, + uint32_t group) + { + DS_UNUSED(client); + Resource *r = Resource::fromResource(resource); + static_cast(r->zwp_input_method_context_v1_object)->zwp_input_method_context_v1_modifiers( + r, + serial, + mods_depressed, + mods_latched, + mods_locked, + group); + } + + void zwp_input_method_context_v1::handle_language( + ::wl_client *client, + struct wl_resource *resource, + uint32_t serial, + const char *language) + { + DS_UNUSED(client); + Resource *r = Resource::fromResource(resource); + static_cast(r->zwp_input_method_context_v1_object)->zwp_input_method_context_v1_language( + r, + serial, + std::string(language)); + } + + void zwp_input_method_context_v1::handle_text_direction( + ::wl_client *client, + struct wl_resource *resource, + uint32_t serial, + uint32_t direction) + { + DS_UNUSED(client); + Resource *r = Resource::fromResource(resource); + static_cast(r->zwp_input_method_context_v1_object)->zwp_input_method_context_v1_text_direction( + r, + serial, + direction); + } + + void zwp_input_method_context_v1::handle_selection_region( + ::wl_client *client, + struct wl_resource *resource, + uint32_t serial, + int32_t start, + int32_t end) + { + DS_UNUSED(client); + Resource *r = Resource::fromResource(resource); + static_cast(r->zwp_input_method_context_v1_object)->zwp_input_method_context_v1_selection_region( + r, + serial, + start, + end); + } + + void zwp_input_method_context_v1::handle_private_command( + ::wl_client *client, + struct wl_resource *resource, + uint32_t serial, + const char *command) + { + DS_UNUSED(client); + Resource *r = Resource::fromResource(resource); + static_cast(r->zwp_input_method_context_v1_object)->zwp_input_method_context_v1_private_command( + r, + serial, + std::string(command)); + } + + void zwp_input_method_context_v1::handle_update_input_panel_data( + ::wl_client *client, + struct wl_resource *resource, + uint32_t serial, + const char *input_panel_data, + uint32_t input_panel_data_length) + { + DS_UNUSED(client); + Resource *r = Resource::fromResource(resource); + static_cast(r->zwp_input_method_context_v1_object)->zwp_input_method_context_v1_update_input_panel_data( + r, + serial, + std::string(input_panel_data), + input_panel_data_length); + } + + void zwp_input_method_context_v1::handle_hide_input_panel( + ::wl_client *client, + struct wl_resource *resource, + uint32_t serial) + { + DS_UNUSED(client); + Resource *r = Resource::fromResource(resource); + static_cast(r->zwp_input_method_context_v1_object)->zwp_input_method_context_v1_hide_input_panel( + r, + serial); + } + + void zwp_input_method_context_v1::handle_get_selection_text( + ::wl_client *client, + struct wl_resource *resource, + int32_t fd) + { + DS_UNUSED(client); + Resource *r = Resource::fromResource(resource); + static_cast(r->zwp_input_method_context_v1_object)->zwp_input_method_context_v1_get_selection_text( + r, + fd); + } + + void zwp_input_method_context_v1::handle_get_surrounding_text( + ::wl_client *client, + struct wl_resource *resource, + uint32_t maxlen_before, + uint32_t maxlen_after, + int32_t fd) + { + DS_UNUSED(client); + Resource *r = Resource::fromResource(resource); + static_cast(r->zwp_input_method_context_v1_object)->zwp_input_method_context_v1_get_surrounding_text( + r, + maxlen_before, + maxlen_after, + fd); + } + + void zwp_input_method_context_v1::handle_filter_key_event_done( + ::wl_client *client, + struct wl_resource *resource, + uint32_t serial, + uint32_t state) + { + DS_UNUSED(client); + Resource *r = Resource::fromResource(resource); + static_cast(r->zwp_input_method_context_v1_object)->zwp_input_method_context_v1_filter_key_event_done( + r, + serial, + state); + } + + void zwp_input_method_context_v1::handle_update_ise_geometry( + ::wl_client *client, + struct wl_resource *resource, + uint32_t serial, + uint32_t x, + uint32_t y, + uint32_t width, + uint32_t height) + { + DS_UNUSED(client); + Resource *r = Resource::fromResource(resource); + static_cast(r->zwp_input_method_context_v1_object)->zwp_input_method_context_v1_update_ise_geometry( + r, + serial, + x, + y, + width, + height); + } + + void zwp_input_method_context_v1::handle_recapture_string( + ::wl_client *client, + struct wl_resource *resource, + uint32_t serial, + int32_t index, + uint32_t length, + const char *preedit, + const char *preedit_commit, + const char *commit) + { + DS_UNUSED(client); + Resource *r = Resource::fromResource(resource); + static_cast(r->zwp_input_method_context_v1_object)->zwp_input_method_context_v1_recapture_string( + r, + serial, + index, + length, + std::string(preedit), + std::string(preedit_commit), + std::string(commit)); + } + + void zwp_input_method_context_v1::handle_input_panel_event( + ::wl_client *client, + struct wl_resource *resource, + uint32_t serial, + uint32_t event_type, + uint32_t value) + { + DS_UNUSED(client); + Resource *r = Resource::fromResource(resource); + static_cast(r->zwp_input_method_context_v1_object)->zwp_input_method_context_v1_input_panel_event( + r, + serial, + event_type, + value); + } + + void zwp_input_method_context_v1::handle_commit_content( + ::wl_client *client, + struct wl_resource *resource, + uint32_t serial, + const char *content, + const char *description, + const char *mime_types) + { + DS_UNUSED(client); + Resource *r = Resource::fromResource(resource); + static_cast(r->zwp_input_method_context_v1_object)->zwp_input_method_context_v1_commit_content( + r, + serial, + std::string(content), + std::string(description), + std::string(mime_types)); + } + + void zwp_input_method_context_v1::handle_update_candidate_state( + ::wl_client *client, + struct wl_resource *resource, + uint32_t state) + { + DS_UNUSED(client); + Resource *r = Resource::fromResource(resource); + static_cast(r->zwp_input_method_context_v1_object)->zwp_input_method_context_v1_update_candidate_state( + r, + state); + } + + void zwp_input_method_context_v1::handle_reshow_input_panel( + ::wl_client *client, + struct wl_resource *resource) + { + DS_UNUSED(client); + Resource *r = Resource::fromResource(resource); + static_cast(r->zwp_input_method_context_v1_object)->zwp_input_method_context_v1_reshow_input_panel( + r); + } + + void zwp_input_method_context_v1::handle_set_floating_panel( + ::wl_client *client, + struct wl_resource *resource, + uint32_t state) + { + DS_UNUSED(client); + Resource *r = Resource::fromResource(resource); + static_cast(r->zwp_input_method_context_v1_object)->zwp_input_method_context_v1_set_floating_panel( + r, + state); + } + + void zwp_input_method_context_v1::handle_set_floating_drag_enabled( + ::wl_client *client, + struct wl_resource *resource, + uint32_t enabled) + { + DS_UNUSED(client); + Resource *r = Resource::fromResource(resource); + static_cast(r->zwp_input_method_context_v1_object)->zwp_input_method_context_v1_set_floating_drag_enabled( + r, + enabled); + } + + void zwp_input_method_context_v1::send_surrounding_text(const std::string &text, uint32_t cursor, uint32_t anchor) + { + DS_ASSERT_X(m_resource, "zwp_input_method_context_v1::surrounding_text", "Uninitialised resource"); + if (DS_UNLIKELY(!m_resource)) { + WRN("could not call zwp_input_method_context_v1::surrounding_text as it's not initialised"); + return; + } + send_surrounding_text( + m_resource->handle, + text, + cursor, + anchor); + } + + void zwp_input_method_context_v1::send_surrounding_text(struct ::wl_resource *resource, const std::string &text, uint32_t cursor, uint32_t anchor) + { + zwp_input_method_context_v1_send_surrounding_text( + resource, + text.c_str(), + cursor, + anchor); + } + + + void zwp_input_method_context_v1::send_reset() + { + DS_ASSERT_X(m_resource, "zwp_input_method_context_v1::reset", "Uninitialised resource"); + if (DS_UNLIKELY(!m_resource)) { + WRN("could not call zwp_input_method_context_v1::reset as it's not initialised"); + return; + } + send_reset( + m_resource->handle); + } + + void zwp_input_method_context_v1::send_reset(struct ::wl_resource *resource) + { + zwp_input_method_context_v1_send_reset( + resource); + } + + + void zwp_input_method_context_v1::send_content_type(uint32_t hint, uint32_t purpose) + { + DS_ASSERT_X(m_resource, "zwp_input_method_context_v1::content_type", "Uninitialised resource"); + if (DS_UNLIKELY(!m_resource)) { + WRN("could not call zwp_input_method_context_v1::content_type as it's not initialised"); + return; + } + send_content_type( + m_resource->handle, + hint, + purpose); + } + + void zwp_input_method_context_v1::send_content_type(struct ::wl_resource *resource, uint32_t hint, uint32_t purpose) + { + zwp_input_method_context_v1_send_content_type( + resource, + hint, + purpose); + } + + + void zwp_input_method_context_v1::send_invoke_action(uint32_t button, uint32_t index) + { + DS_ASSERT_X(m_resource, "zwp_input_method_context_v1::invoke_action", "Uninitialised resource"); + if (DS_UNLIKELY(!m_resource)) { + WRN("could not call zwp_input_method_context_v1::invoke_action as it's not initialised"); + return; + } + send_invoke_action( + m_resource->handle, + button, + index); + } + + void zwp_input_method_context_v1::send_invoke_action(struct ::wl_resource *resource, uint32_t button, uint32_t index) + { + zwp_input_method_context_v1_send_invoke_action( + resource, + button, + index); + } + + + void zwp_input_method_context_v1::send_commit_state(uint32_t serial) + { + DS_ASSERT_X(m_resource, "zwp_input_method_context_v1::commit_state", "Uninitialised resource"); + if (DS_UNLIKELY(!m_resource)) { + WRN("could not call zwp_input_method_context_v1::commit_state as it's not initialised"); + return; + } + send_commit_state( + m_resource->handle, + serial); + } + + void zwp_input_method_context_v1::send_commit_state(struct ::wl_resource *resource, uint32_t serial) + { + zwp_input_method_context_v1_send_commit_state( + resource, + serial); + } + + + void zwp_input_method_context_v1::send_preferred_language(const std::string &language) + { + DS_ASSERT_X(m_resource, "zwp_input_method_context_v1::preferred_language", "Uninitialised resource"); + if (DS_UNLIKELY(!m_resource)) { + WRN("could not call zwp_input_method_context_v1::preferred_language as it's not initialised"); + return; + } + send_preferred_language( + m_resource->handle, + language); + } + + void zwp_input_method_context_v1::send_preferred_language(struct ::wl_resource *resource, const std::string &language) + { + zwp_input_method_context_v1_send_preferred_language( + resource, + language.c_str()); + } + + + void zwp_input_method_context_v1::send_return_key_type(uint32_t return_key_type) + { + DS_ASSERT_X(m_resource, "zwp_input_method_context_v1::return_key_type", "Uninitialised resource"); + if (DS_UNLIKELY(!m_resource)) { + WRN("could not call zwp_input_method_context_v1::return_key_type as it's not initialised"); + return; + } + send_return_key_type( + m_resource->handle, + return_key_type); + } + + void zwp_input_method_context_v1::send_return_key_type(struct ::wl_resource *resource, uint32_t return_key_type) + { + zwp_input_method_context_v1_send_return_key_type( + resource, + return_key_type); + } + + + void zwp_input_method_context_v1::send_return_key_disabled(uint32_t return_key_disabled) + { + DS_ASSERT_X(m_resource, "zwp_input_method_context_v1::return_key_disabled", "Uninitialised resource"); + if (DS_UNLIKELY(!m_resource)) { + WRN("could not call zwp_input_method_context_v1::return_key_disabled as it's not initialised"); + return; + } + send_return_key_disabled( + m_resource->handle, + return_key_disabled); + } + + void zwp_input_method_context_v1::send_return_key_disabled(struct ::wl_resource *resource, uint32_t return_key_disabled) + { + zwp_input_method_context_v1_send_return_key_disabled( + resource, + return_key_disabled); + } + + + void zwp_input_method_context_v1::send_input_panel_data(const std::string &input_panel_data, uint32_t input_panel_data_length) + { + DS_ASSERT_X(m_resource, "zwp_input_method_context_v1::input_panel_data", "Uninitialised resource"); + if (DS_UNLIKELY(!m_resource)) { + WRN("could not call zwp_input_method_context_v1::input_panel_data as it's not initialised"); + return; + } + send_input_panel_data( + m_resource->handle, + input_panel_data, + input_panel_data_length); + } + + void zwp_input_method_context_v1::send_input_panel_data(struct ::wl_resource *resource, const std::string &input_panel_data, uint32_t input_panel_data_length) + { + zwp_input_method_context_v1_send_input_panel_data( + resource, + input_panel_data.c_str(), + input_panel_data_length); + } + + + void zwp_input_method_context_v1::send_bidi_direction(uint32_t direction) + { + DS_ASSERT_X(m_resource, "zwp_input_method_context_v1::bidi_direction", "Uninitialised resource"); + if (DS_UNLIKELY(!m_resource)) { + WRN("could not call zwp_input_method_context_v1::bidi_direction as it's not initialised"); + return; + } + send_bidi_direction( + m_resource->handle, + direction); + } + + void zwp_input_method_context_v1::send_bidi_direction(struct ::wl_resource *resource, uint32_t direction) + { + zwp_input_method_context_v1_send_bidi_direction( + resource, + direction); + } + + + void zwp_input_method_context_v1::send_cursor_position(uint32_t cursor_position) + { + DS_ASSERT_X(m_resource, "zwp_input_method_context_v1::cursor_position", "Uninitialised resource"); + if (DS_UNLIKELY(!m_resource)) { + WRN("could not call zwp_input_method_context_v1::cursor_position as it's not initialised"); + return; + } + send_cursor_position( + m_resource->handle, + cursor_position); + } + + void zwp_input_method_context_v1::send_cursor_position(struct ::wl_resource *resource, uint32_t cursor_position) + { + zwp_input_method_context_v1_send_cursor_position( + resource, + cursor_position); + } + + + void zwp_input_method_context_v1::send_process_input_device_event(uint32_t event_type, const std::string &event_data, uint32_t event_length) + { + DS_ASSERT_X(m_resource, "zwp_input_method_context_v1::process_input_device_event", "Uninitialised resource"); + if (DS_UNLIKELY(!m_resource)) { + WRN("could not call zwp_input_method_context_v1::process_input_device_event as it's not initialised"); + return; + } + send_process_input_device_event( + m_resource->handle, + event_type, + event_data, + event_length); + } + + void zwp_input_method_context_v1::send_process_input_device_event(struct ::wl_resource *resource, uint32_t event_type, const std::string &event_data, uint32_t event_length) + { + zwp_input_method_context_v1_send_process_input_device_event( + resource, + event_type, + event_data.c_str(), + event_length); + } + + + void zwp_input_method_context_v1::send_filter_key_event(uint32_t serial, uint32_t time, const std::string &keyname, uint32_t state, uint32_t modifiers, const std::string &dev_name, uint32_t dev_class, uint32_t dev_subclass, uint32_t keycode) + { + DS_ASSERT_X(m_resource, "zwp_input_method_context_v1::filter_key_event", "Uninitialised resource"); + if (DS_UNLIKELY(!m_resource)) { + WRN("could not call zwp_input_method_context_v1::filter_key_event as it's not initialised"); + return; + } + send_filter_key_event( + m_resource->handle, + serial, + time, + keyname, + state, + modifiers, + dev_name, + dev_class, + dev_subclass, + keycode); + } + + void zwp_input_method_context_v1::send_filter_key_event(struct ::wl_resource *resource, uint32_t serial, uint32_t time, const std::string &keyname, uint32_t state, uint32_t modifiers, const std::string &dev_name, uint32_t dev_class, uint32_t dev_subclass, uint32_t keycode) + { + zwp_input_method_context_v1_send_filter_key_event( + resource, + serial, + time, + keyname.c_str(), + state, + modifiers, + dev_name.c_str(), + dev_class, + dev_subclass, + keycode); + } + + + void zwp_input_method_context_v1::send_capital_mode(uint32_t mode) + { + DS_ASSERT_X(m_resource, "zwp_input_method_context_v1::capital_mode", "Uninitialised resource"); + if (DS_UNLIKELY(!m_resource)) { + WRN("could not call zwp_input_method_context_v1::capital_mode as it's not initialised"); + return; + } + send_capital_mode( + m_resource->handle, + mode); + } + + void zwp_input_method_context_v1::send_capital_mode(struct ::wl_resource *resource, uint32_t mode) + { + zwp_input_method_context_v1_send_capital_mode( + resource, + mode); + } + + + void zwp_input_method_context_v1::send_prediction_hint(const std::string &text) + { + DS_ASSERT_X(m_resource, "zwp_input_method_context_v1::prediction_hint", "Uninitialised resource"); + if (DS_UNLIKELY(!m_resource)) { + WRN("could not call zwp_input_method_context_v1::prediction_hint as it's not initialised"); + return; + } + send_prediction_hint( + m_resource->handle, + text); + } + + void zwp_input_method_context_v1::send_prediction_hint(struct ::wl_resource *resource, const std::string &text) + { + zwp_input_method_context_v1_send_prediction_hint( + resource, + text.c_str()); + } + + + void zwp_input_method_context_v1::send_mime_type(const std::string &type) + { + DS_ASSERT_X(m_resource, "zwp_input_method_context_v1::mime_type", "Uninitialised resource"); + if (DS_UNLIKELY(!m_resource)) { + WRN("could not call zwp_input_method_context_v1::mime_type as it's not initialised"); + return; + } + send_mime_type( + m_resource->handle, + type); + } + + void zwp_input_method_context_v1::send_mime_type(struct ::wl_resource *resource, const std::string &type) + { + zwp_input_method_context_v1_send_mime_type( + resource, + type.c_str()); + } + + + void zwp_input_method_context_v1::send_finalized_content(const std::string &text, uint32_t cursor_position) + { + DS_ASSERT_X(m_resource, "zwp_input_method_context_v1::finalized_content", "Uninitialised resource"); + if (DS_UNLIKELY(!m_resource)) { + WRN("could not call zwp_input_method_context_v1::finalized_content as it's not initialised"); + return; + } + send_finalized_content( + m_resource->handle, + text, + cursor_position); + } + + void zwp_input_method_context_v1::send_finalized_content(struct ::wl_resource *resource, const std::string &text, uint32_t cursor_position) + { + zwp_input_method_context_v1_send_finalized_content( + resource, + text.c_str(), + cursor_position); + } + + + void zwp_input_method_context_v1::send_prediction_hint_data(const std::string &key, const std::string &value) + { + DS_ASSERT_X(m_resource, "zwp_input_method_context_v1::prediction_hint_data", "Uninitialised resource"); + if (DS_UNLIKELY(!m_resource)) { + WRN("could not call zwp_input_method_context_v1::prediction_hint_data as it's not initialised"); + return; + } + send_prediction_hint_data( + m_resource->handle, + key, + value); + } + + void zwp_input_method_context_v1::send_prediction_hint_data(struct ::wl_resource *resource, const std::string &key, const std::string &value) + { + zwp_input_method_context_v1_send_prediction_hint_data( + resource, + key.c_str(), + value.c_str()); + } + + + void zwp_input_method_context_v1::send_input_panel_enabled(uint32_t enabled) + { + DS_ASSERT_X(m_resource, "zwp_input_method_context_v1::input_panel_enabled", "Uninitialised resource"); + if (DS_UNLIKELY(!m_resource)) { + WRN("could not call zwp_input_method_context_v1::input_panel_enabled as it's not initialised"); + return; + } + send_input_panel_enabled( + m_resource->handle, + enabled); + } + + void zwp_input_method_context_v1::send_input_panel_enabled(struct ::wl_resource *resource, uint32_t enabled) + { + zwp_input_method_context_v1_send_input_panel_enabled( + resource, + enabled); + } + + + zwp_input_method_v1::zwp_input_method_v1(struct ::wl_client *client, uint32_t id, int version) + : m_resource_map() + , m_resource(NULL) + , m_global(NULL) + , m_globalVersion(0) + , m_displayDestroyedListener() + { + init(client, id, version); + } + + zwp_input_method_v1::zwp_input_method_v1(struct ::wl_display *display, int version) + : m_resource_map() + , m_resource(NULL) + , m_global(NULL) + , m_globalVersion(0) + , m_displayDestroyedListener() + { + init(display, version); + } + + zwp_input_method_v1::zwp_input_method_v1(struct ::wl_resource *resource) + : m_resource_map() + , m_resource(NULL) + , m_global(NULL) + , m_globalVersion(0) + , m_displayDestroyedListener() + { + init(resource); + } + + zwp_input_method_v1::zwp_input_method_v1() + : m_resource_map() + , m_resource(NULL) + , m_global(NULL) + , m_globalVersion(0) + , m_displayDestroyedListener() + { + } + + zwp_input_method_v1::~zwp_input_method_v1() + { + std::multimap::iterator it; + for (it = m_resource_map.begin() ; it != m_resource_map.end() ; it++) { + zwp_input_method_v1::Resource *resource = (*it).second; + wl_resource_set_implementation(resource->handle, NULL, NULL, NULL); + } + + if (m_global) { + wl_global_destroy(m_global); + wl_list_remove(&m_displayDestroyedListener.link); + } + } + + void zwp_input_method_v1::init(struct ::wl_client *client, uint32_t id, int version) + { + m_resource = bind(client, id, version); + } + + void zwp_input_method_v1::init(struct ::wl_resource *resource) + { + m_resource = bind(resource); + } + + zwp_input_method_v1::Resource *zwp_input_method_v1::add(struct ::wl_client *client, int version) + { + Resource *resource = bind(client, 0, version); + m_resource_map.insert(std::pair(client, resource)); + return resource; + } + + zwp_input_method_v1::Resource *zwp_input_method_v1::add(struct ::wl_client *client, uint32_t id, int version) + { + Resource *resource = bind(client, id, version); + m_resource_map.insert(std::pair(client, resource)); + return resource; + } + + void zwp_input_method_v1::init(struct ::wl_display *display, int version) + { + m_global = wl_global_create(display, &::zwp_input_method_v1_interface, version, this, bind_func); + m_globalVersion = version; + m_displayDestroyedListener.notify = zwp_input_method_v1::display_destroy_func; + m_displayDestroyedListener.parent = this; + wl_display_add_destroy_listener(display, &m_displayDestroyedListener); + } + + const struct wl_interface *zwp_input_method_v1::interface() + { + return &::zwp_input_method_v1_interface; + } + + zwp_input_method_v1::Resource *zwp_input_method_v1::zwp_input_method_v1_allocate() + { + return new Resource; + } + + void zwp_input_method_v1::zwp_input_method_v1_bind_resource(Resource *) + { + } + + void zwp_input_method_v1::zwp_input_method_v1_destroy_resource(Resource *) + { + } + + void zwp_input_method_v1::bind_func(struct ::wl_client *client, void *data, uint32_t version, uint32_t id) + { + zwp_input_method_v1 *that = static_cast(data); + that->add(client, id, std::min(that->m_globalVersion, version)); + } + + void zwp_input_method_v1::display_destroy_func(struct ::wl_listener *listener, void *data) + { + DS_UNUSED(data); + zwp_input_method_v1 *that = static_cast(listener)->parent; + that->m_global = NULL; + } + + void zwp_input_method_v1::destroy_func(struct ::wl_resource *client_resource) + { + Resource *resource = Resource::fromResource(client_resource); + DS_ASSERT(resource); + zwp_input_method_v1 *that = resource->zwp_input_method_v1_object; + that->m_resource_map.erase(resource->client()); + that->zwp_input_method_v1_destroy_resource(resource); + delete resource; + } + + zwp_input_method_v1::Resource *zwp_input_method_v1::bind(struct ::wl_client *client, uint32_t id, int version) + { + DS_ASSERT_X(!wl_client_get_object(client, id), "DSWaylandObject bind", "binding to object %u more than once", id); + struct ::wl_resource *handle = wl_resource_create(client, &::zwp_input_method_v1_interface, version, id); + return bind(handle); + } + + zwp_input_method_v1::Resource *zwp_input_method_v1::bind(struct ::wl_resource *handle) + { + Resource *resource = zwp_input_method_v1_allocate(); + resource->zwp_input_method_v1_object = this; + + wl_resource_set_implementation(handle, NULL, resource, destroy_func); + resource->handle = handle; + zwp_input_method_v1_bind_resource(resource); + return resource; + } + zwp_input_method_v1::Resource *zwp_input_method_v1::Resource::fromResource(struct ::wl_resource *resource) + { + if (DS_UNLIKELY(!resource)) + return NULL; + if (wl_resource_instance_of(resource, &::zwp_input_method_v1_interface, NULL)) + return static_cast(wl_resource_get_user_data(resource)); + return NULL; + } + + void zwp_input_method_v1::send_activate(struct ::wl_resource *id) + { + DS_ASSERT_X(m_resource, "zwp_input_method_v1::activate", "Uninitialised resource"); + if (DS_UNLIKELY(!m_resource)) { + WRN("could not call zwp_input_method_v1::activate as it's not initialised"); + return; + } + send_activate( + m_resource->handle, + id); + } + + void zwp_input_method_v1::send_activate(struct ::wl_resource *resource, struct ::wl_resource *id) + { + zwp_input_method_v1_send_activate( + resource, + id); + } + + + void zwp_input_method_v1::send_deactivate(struct ::wl_resource *context) + { + DS_ASSERT_X(m_resource, "zwp_input_method_v1::deactivate", "Uninitialised resource"); + if (DS_UNLIKELY(!m_resource)) { + WRN("could not call zwp_input_method_v1::deactivate as it's not initialised"); + return; + } + send_deactivate( + m_resource->handle, + context); + } + + void zwp_input_method_v1::send_deactivate(struct ::wl_resource *resource, struct ::wl_resource *context) + { + zwp_input_method_v1_send_deactivate( + resource, + context); + } + + + void zwp_input_method_v1::send_destroy(struct ::wl_resource *context) + { + DS_ASSERT_X(m_resource, "zwp_input_method_v1::destroy", "Uninitialised resource"); + if (DS_UNLIKELY(!m_resource)) { + WRN("could not call zwp_input_method_v1::destroy as it's not initialised"); + return; + } + send_destroy( + m_resource->handle, + context); + } + + void zwp_input_method_v1::send_destroy(struct ::wl_resource *resource, struct ::wl_resource *context) + { + zwp_input_method_v1_send_destroy( + resource, + context); + } + + + void zwp_input_method_v1::send_show_input_panel(struct ::wl_resource *context, uint32_t degree) + { + DS_ASSERT_X(m_resource, "zwp_input_method_v1::show_input_panel", "Uninitialised resource"); + if (DS_UNLIKELY(!m_resource)) { + WRN("could not call zwp_input_method_v1::show_input_panel as it's not initialised"); + return; + } + send_show_input_panel( + m_resource->handle, + context, + degree); + } + + void zwp_input_method_v1::send_show_input_panel(struct ::wl_resource *resource, struct ::wl_resource *context, uint32_t degree) + { + zwp_input_method_v1_send_show_input_panel( + resource, + context, + degree); + } + + + void zwp_input_method_v1::send_hide_input_panel(struct ::wl_resource *context) + { + DS_ASSERT_X(m_resource, "zwp_input_method_v1::hide_input_panel", "Uninitialised resource"); + if (DS_UNLIKELY(!m_resource)) { + WRN("could not call zwp_input_method_v1::hide_input_panel as it's not initialised"); + return; + } + send_hide_input_panel( + m_resource->handle, + context); + } + + void zwp_input_method_v1::send_hide_input_panel(struct ::wl_resource *resource, struct ::wl_resource *context) + { + zwp_input_method_v1_send_hide_input_panel( + resource, + context); + } + + + void zwp_input_method_v1::send_open_connection(struct ::wl_resource *context) + { + DS_ASSERT_X(m_resource, "zwp_input_method_v1::open_connection", "Uninitialised resource"); + if (DS_UNLIKELY(!m_resource)) { + WRN("could not call zwp_input_method_v1::open_connection as it's not initialised"); + return; + } + send_open_connection( + m_resource->handle, + context); + } + + void zwp_input_method_v1::send_open_connection(struct ::wl_resource *resource, struct ::wl_resource *context) + { + zwp_input_method_v1_send_open_connection( + resource, + context); + } + + + void zwp_input_method_v1::send_close_connection(struct ::wl_resource *context) + { + DS_ASSERT_X(m_resource, "zwp_input_method_v1::close_connection", "Uninitialised resource"); + if (DS_UNLIKELY(!m_resource)) { + WRN("could not call zwp_input_method_v1::close_connection as it's not initialised"); + return; + } + send_close_connection( + m_resource->handle, + context); + } + + void zwp_input_method_v1::send_close_connection(struct ::wl_resource *resource, struct ::wl_resource *context) + { + zwp_input_method_v1_send_close_connection( + resource, + context); + } + + + void zwp_input_method_v1::send_set_text_input_id(struct ::wl_resource *context, uint32_t text_input_id) + { + DS_ASSERT_X(m_resource, "zwp_input_method_v1::set_text_input_id", "Uninitialised resource"); + if (DS_UNLIKELY(!m_resource)) { + WRN("could not call zwp_input_method_v1::set_text_input_id as it's not initialised"); + return; + } + send_set_text_input_id( + m_resource->handle, + context, + text_input_id); + } + + void zwp_input_method_v1::send_set_text_input_id(struct ::wl_resource *resource, struct ::wl_resource *context, uint32_t text_input_id) + { + zwp_input_method_v1_send_set_text_input_id( + resource, + context, + text_input_id); + } + + + zwp_input_panel_v1::zwp_input_panel_v1(struct ::wl_client *client, uint32_t id, int version) + : m_resource_map() + , m_resource(NULL) + , m_global(NULL) + , m_globalVersion(0) + , m_displayDestroyedListener() + { + init(client, id, version); + } + + zwp_input_panel_v1::zwp_input_panel_v1(struct ::wl_display *display, int version) + : m_resource_map() + , m_resource(NULL) + , m_global(NULL) + , m_globalVersion(0) + , m_displayDestroyedListener() + { + init(display, version); + } + + zwp_input_panel_v1::zwp_input_panel_v1(struct ::wl_resource *resource) + : m_resource_map() + , m_resource(NULL) + , m_global(NULL) + , m_globalVersion(0) + , m_displayDestroyedListener() + { + init(resource); + } + + zwp_input_panel_v1::zwp_input_panel_v1() + : m_resource_map() + , m_resource(NULL) + , m_global(NULL) + , m_globalVersion(0) + , m_displayDestroyedListener() + { + } + + zwp_input_panel_v1::~zwp_input_panel_v1() + { + std::multimap::iterator it; + for (it = m_resource_map.begin() ; it != m_resource_map.end() ; it++) { + zwp_input_panel_v1::Resource *resource = (*it).second; + wl_resource_set_implementation(resource->handle, NULL, NULL, NULL); + } + + if (m_global) { + wl_global_destroy(m_global); + wl_list_remove(&m_displayDestroyedListener.link); + } + } + + void zwp_input_panel_v1::init(struct ::wl_client *client, uint32_t id, int version) + { + m_resource = bind(client, id, version); + } + + void zwp_input_panel_v1::init(struct ::wl_resource *resource) + { + m_resource = bind(resource); + } + + zwp_input_panel_v1::Resource *zwp_input_panel_v1::add(struct ::wl_client *client, int version) + { + Resource *resource = bind(client, 0, version); + m_resource_map.insert(std::pair(client, resource)); + return resource; + } + + zwp_input_panel_v1::Resource *zwp_input_panel_v1::add(struct ::wl_client *client, uint32_t id, int version) + { + Resource *resource = bind(client, id, version); + m_resource_map.insert(std::pair(client, resource)); + return resource; + } + + void zwp_input_panel_v1::init(struct ::wl_display *display, int version) + { + m_global = wl_global_create(display, &::zwp_input_panel_v1_interface, version, this, bind_func); + m_globalVersion = version; + m_displayDestroyedListener.notify = zwp_input_panel_v1::display_destroy_func; + m_displayDestroyedListener.parent = this; + wl_display_add_destroy_listener(display, &m_displayDestroyedListener); + } + + const struct wl_interface *zwp_input_panel_v1::interface() + { + return &::zwp_input_panel_v1_interface; + } + + zwp_input_panel_v1::Resource *zwp_input_panel_v1::zwp_input_panel_v1_allocate() + { + return new Resource; + } + + void zwp_input_panel_v1::zwp_input_panel_v1_bind_resource(Resource *) + { + } + + void zwp_input_panel_v1::zwp_input_panel_v1_destroy_resource(Resource *) + { + } + + void zwp_input_panel_v1::bind_func(struct ::wl_client *client, void *data, uint32_t version, uint32_t id) + { + zwp_input_panel_v1 *that = static_cast(data); + that->add(client, id, std::min(that->m_globalVersion, version)); + } + + void zwp_input_panel_v1::display_destroy_func(struct ::wl_listener *listener, void *data) + { + DS_UNUSED(data); + zwp_input_panel_v1 *that = static_cast(listener)->parent; + that->m_global = NULL; + } + + void zwp_input_panel_v1::destroy_func(struct ::wl_resource *client_resource) + { + Resource *resource = Resource::fromResource(client_resource); + DS_ASSERT(resource); + zwp_input_panel_v1 *that = resource->zwp_input_panel_v1_object; + that->m_resource_map.erase(resource->client()); + that->zwp_input_panel_v1_destroy_resource(resource); + delete resource; + } + + zwp_input_panel_v1::Resource *zwp_input_panel_v1::bind(struct ::wl_client *client, uint32_t id, int version) + { + DS_ASSERT_X(!wl_client_get_object(client, id), "DSWaylandObject bind", "binding to object %u more than once", id); + struct ::wl_resource *handle = wl_resource_create(client, &::zwp_input_panel_v1_interface, version, id); + return bind(handle); + } + + zwp_input_panel_v1::Resource *zwp_input_panel_v1::bind(struct ::wl_resource *handle) + { + Resource *resource = zwp_input_panel_v1_allocate(); + resource->zwp_input_panel_v1_object = this; + + wl_resource_set_implementation(handle, &m_zwp_input_panel_v1_interface, resource, destroy_func); + resource->handle = handle; + zwp_input_panel_v1_bind_resource(resource); + return resource; + } + zwp_input_panel_v1::Resource *zwp_input_panel_v1::Resource::fromResource(struct ::wl_resource *resource) + { + if (DS_UNLIKELY(!resource)) + return NULL; + if (wl_resource_instance_of(resource, &::zwp_input_panel_v1_interface, &m_zwp_input_panel_v1_interface)) + return static_cast(wl_resource_get_user_data(resource)); + return NULL; + } + + const struct ::zwp_input_panel_v1_interface zwp_input_panel_v1::m_zwp_input_panel_v1_interface = { + zwp_input_panel_v1::handle_get_input_panel_surface + }; + + void zwp_input_panel_v1::zwp_input_panel_v1_get_input_panel_surface(Resource *, uint32_t, struct ::wl_resource *) + { + } + + + void zwp_input_panel_v1::handle_get_input_panel_surface( + ::wl_client *client, + struct wl_resource *resource, + uint32_t id, + struct ::wl_resource *surface) + { + DS_UNUSED(client); + Resource *r = Resource::fromResource(resource); + static_cast(r->zwp_input_panel_v1_object)->zwp_input_panel_v1_get_input_panel_surface( + r, + id, + surface); + } + + zwp_input_panel_surface_v1::zwp_input_panel_surface_v1(struct ::wl_client *client, uint32_t id, int version) + : m_resource_map() + , m_resource(NULL) + , m_global(NULL) + , m_globalVersion(0) + , m_displayDestroyedListener() + { + init(client, id, version); + } + + zwp_input_panel_surface_v1::zwp_input_panel_surface_v1(struct ::wl_display *display, int version) + : m_resource_map() + , m_resource(NULL) + , m_global(NULL) + , m_globalVersion(0) + , m_displayDestroyedListener() + { + init(display, version); + } + + zwp_input_panel_surface_v1::zwp_input_panel_surface_v1(struct ::wl_resource *resource) + : m_resource_map() + , m_resource(NULL) + , m_global(NULL) + , m_globalVersion(0) + , m_displayDestroyedListener() + { + init(resource); + } + + zwp_input_panel_surface_v1::zwp_input_panel_surface_v1() + : m_resource_map() + , m_resource(NULL) + , m_global(NULL) + , m_globalVersion(0) + , m_displayDestroyedListener() + { + } + + zwp_input_panel_surface_v1::~zwp_input_panel_surface_v1() + { + std::multimap::iterator it; + for (it = m_resource_map.begin() ; it != m_resource_map.end() ; it++) { + zwp_input_panel_surface_v1::Resource *resource = (*it).second; + wl_resource_set_implementation(resource->handle, NULL, NULL, NULL); + } + + if (m_global) { + wl_global_destroy(m_global); + wl_list_remove(&m_displayDestroyedListener.link); + } + } + + void zwp_input_panel_surface_v1::init(struct ::wl_client *client, uint32_t id, int version) + { + m_resource = bind(client, id, version); + } + + void zwp_input_panel_surface_v1::init(struct ::wl_resource *resource) + { + m_resource = bind(resource); + } + + zwp_input_panel_surface_v1::Resource *zwp_input_panel_surface_v1::add(struct ::wl_client *client, int version) + { + Resource *resource = bind(client, 0, version); + m_resource_map.insert(std::pair(client, resource)); + return resource; + } + + zwp_input_panel_surface_v1::Resource *zwp_input_panel_surface_v1::add(struct ::wl_client *client, uint32_t id, int version) + { + Resource *resource = bind(client, id, version); + m_resource_map.insert(std::pair(client, resource)); + return resource; + } + + void zwp_input_panel_surface_v1::init(struct ::wl_display *display, int version) + { + m_global = wl_global_create(display, &::zwp_input_panel_surface_v1_interface, version, this, bind_func); + m_globalVersion = version; + m_displayDestroyedListener.notify = zwp_input_panel_surface_v1::display_destroy_func; + m_displayDestroyedListener.parent = this; + wl_display_add_destroy_listener(display, &m_displayDestroyedListener); + } + + const struct wl_interface *zwp_input_panel_surface_v1::interface() + { + return &::zwp_input_panel_surface_v1_interface; + } + + zwp_input_panel_surface_v1::Resource *zwp_input_panel_surface_v1::zwp_input_panel_surface_v1_allocate() + { + return new Resource; + } + + void zwp_input_panel_surface_v1::zwp_input_panel_surface_v1_bind_resource(Resource *) + { + } + + void zwp_input_panel_surface_v1::zwp_input_panel_surface_v1_destroy_resource(Resource *) + { + } + + void zwp_input_panel_surface_v1::bind_func(struct ::wl_client *client, void *data, uint32_t version, uint32_t id) + { + zwp_input_panel_surface_v1 *that = static_cast(data); + that->add(client, id, std::min(that->m_globalVersion, version)); + } + + void zwp_input_panel_surface_v1::display_destroy_func(struct ::wl_listener *listener, void *data) + { + DS_UNUSED(data); + zwp_input_panel_surface_v1 *that = static_cast(listener)->parent; + that->m_global = NULL; + } + + void zwp_input_panel_surface_v1::destroy_func(struct ::wl_resource *client_resource) + { + Resource *resource = Resource::fromResource(client_resource); + DS_ASSERT(resource); + zwp_input_panel_surface_v1 *that = resource->zwp_input_panel_surface_v1_object; + that->m_resource_map.erase(resource->client()); + that->zwp_input_panel_surface_v1_destroy_resource(resource); + delete resource; + } + + zwp_input_panel_surface_v1::Resource *zwp_input_panel_surface_v1::bind(struct ::wl_client *client, uint32_t id, int version) + { + DS_ASSERT_X(!wl_client_get_object(client, id), "DSWaylandObject bind", "binding to object %u more than once", id); + struct ::wl_resource *handle = wl_resource_create(client, &::zwp_input_panel_surface_v1_interface, version, id); + return bind(handle); + } + + zwp_input_panel_surface_v1::Resource *zwp_input_panel_surface_v1::bind(struct ::wl_resource *handle) + { + Resource *resource = zwp_input_panel_surface_v1_allocate(); + resource->zwp_input_panel_surface_v1_object = this; + + wl_resource_set_implementation(handle, &m_zwp_input_panel_surface_v1_interface, resource, destroy_func); + resource->handle = handle; + zwp_input_panel_surface_v1_bind_resource(resource); + return resource; + } + zwp_input_panel_surface_v1::Resource *zwp_input_panel_surface_v1::Resource::fromResource(struct ::wl_resource *resource) + { + if (DS_UNLIKELY(!resource)) + return NULL; + if (wl_resource_instance_of(resource, &::zwp_input_panel_surface_v1_interface, &m_zwp_input_panel_surface_v1_interface)) + return static_cast(wl_resource_get_user_data(resource)); + return NULL; + } + + const struct ::zwp_input_panel_surface_v1_interface zwp_input_panel_surface_v1::m_zwp_input_panel_surface_v1_interface = { + zwp_input_panel_surface_v1::handle_set_toplevel, + zwp_input_panel_surface_v1::handle_set_overlay_panel, + zwp_input_panel_surface_v1::handle_set_ready + }; + + void zwp_input_panel_surface_v1::zwp_input_panel_surface_v1_set_toplevel(Resource *, struct ::wl_resource *, uint32_t ) + { + } + + void zwp_input_panel_surface_v1::zwp_input_panel_surface_v1_set_overlay_panel(Resource *) + { + } + + void zwp_input_panel_surface_v1::zwp_input_panel_surface_v1_set_ready(Resource *, uint32_t ) + { + } + + + void zwp_input_panel_surface_v1::handle_set_toplevel( + ::wl_client *client, + struct wl_resource *resource, + struct ::wl_resource *output, + uint32_t position) + { + DS_UNUSED(client); + Resource *r = Resource::fromResource(resource); + static_cast(r->zwp_input_panel_surface_v1_object)->zwp_input_panel_surface_v1_set_toplevel( + r, + output, + position); + } + + void zwp_input_panel_surface_v1::handle_set_overlay_panel( + ::wl_client *client, + struct wl_resource *resource) + { + DS_UNUSED(client); + Resource *r = Resource::fromResource(resource); + static_cast(r->zwp_input_panel_surface_v1_object)->zwp_input_panel_surface_v1_set_overlay_panel( + r); + } + + void zwp_input_panel_surface_v1::handle_set_ready( + ::wl_client *client, + struct wl_resource *resource, + uint32_t state) + { + DS_UNUSED(client); + Resource *r = Resource::fromResource(resource); + static_cast(r->zwp_input_panel_surface_v1_object)->zwp_input_panel_surface_v1_set_ready( + r, + state); + } + + zwp_input_method_manager_v1::zwp_input_method_manager_v1(struct ::wl_client *client, uint32_t id, int version) + : m_resource_map() + , m_resource(NULL) + , m_global(NULL) + , m_globalVersion(0) + , m_displayDestroyedListener() + { + init(client, id, version); + } + + zwp_input_method_manager_v1::zwp_input_method_manager_v1(struct ::wl_display *display, int version) + : m_resource_map() + , m_resource(NULL) + , m_global(NULL) + , m_globalVersion(0) + , m_displayDestroyedListener() + { + init(display, version); + } + + zwp_input_method_manager_v1::zwp_input_method_manager_v1(struct ::wl_resource *resource) + : m_resource_map() + , m_resource(NULL) + , m_global(NULL) + , m_globalVersion(0) + , m_displayDestroyedListener() + { + init(resource); + } + + zwp_input_method_manager_v1::zwp_input_method_manager_v1() + : m_resource_map() + , m_resource(NULL) + , m_global(NULL) + , m_globalVersion(0) + , m_displayDestroyedListener() + { + } + + zwp_input_method_manager_v1::~zwp_input_method_manager_v1() + { + std::multimap::iterator it; + for (it = m_resource_map.begin() ; it != m_resource_map.end() ; it++) { + zwp_input_method_manager_v1::Resource *resource = (*it).second; + wl_resource_set_implementation(resource->handle, NULL, NULL, NULL); + } + + if (m_global) { + wl_global_destroy(m_global); + wl_list_remove(&m_displayDestroyedListener.link); + } + } + + void zwp_input_method_manager_v1::init(struct ::wl_client *client, uint32_t id, int version) + { + m_resource = bind(client, id, version); + } + + void zwp_input_method_manager_v1::init(struct ::wl_resource *resource) + { + m_resource = bind(resource); + } + + zwp_input_method_manager_v1::Resource *zwp_input_method_manager_v1::add(struct ::wl_client *client, int version) + { + Resource *resource = bind(client, 0, version); + m_resource_map.insert(std::pair(client, resource)); + return resource; + } + + zwp_input_method_manager_v1::Resource *zwp_input_method_manager_v1::add(struct ::wl_client *client, uint32_t id, int version) + { + Resource *resource = bind(client, id, version); + m_resource_map.insert(std::pair(client, resource)); + return resource; + } + + void zwp_input_method_manager_v1::init(struct ::wl_display *display, int version) + { + m_global = wl_global_create(display, &::zwp_input_method_manager_v1_interface, version, this, bind_func); + m_globalVersion = version; + m_displayDestroyedListener.notify = zwp_input_method_manager_v1::display_destroy_func; + m_displayDestroyedListener.parent = this; + wl_display_add_destroy_listener(display, &m_displayDestroyedListener); + } + + const struct wl_interface *zwp_input_method_manager_v1::interface() + { + return &::zwp_input_method_manager_v1_interface; + } + + zwp_input_method_manager_v1::Resource *zwp_input_method_manager_v1::zwp_input_method_manager_v1_allocate() + { + return new Resource; + } + + void zwp_input_method_manager_v1::zwp_input_method_manager_v1_bind_resource(Resource *) + { + } + + void zwp_input_method_manager_v1::zwp_input_method_manager_v1_destroy_resource(Resource *) + { + } + + void zwp_input_method_manager_v1::bind_func(struct ::wl_client *client, void *data, uint32_t version, uint32_t id) + { + zwp_input_method_manager_v1 *that = static_cast(data); + that->add(client, id, std::min(that->m_globalVersion, version)); + } + + void zwp_input_method_manager_v1::display_destroy_func(struct ::wl_listener *listener, void *data) + { + DS_UNUSED(data); + zwp_input_method_manager_v1 *that = static_cast(listener)->parent; + that->m_global = NULL; + } + + void zwp_input_method_manager_v1::destroy_func(struct ::wl_resource *client_resource) + { + Resource *resource = Resource::fromResource(client_resource); + DS_ASSERT(resource); + zwp_input_method_manager_v1 *that = resource->zwp_input_method_manager_v1_object; + that->m_resource_map.erase(resource->client()); + that->zwp_input_method_manager_v1_destroy_resource(resource); + delete resource; + } + + zwp_input_method_manager_v1::Resource *zwp_input_method_manager_v1::bind(struct ::wl_client *client, uint32_t id, int version) + { + DS_ASSERT_X(!wl_client_get_object(client, id), "DSWaylandObject bind", "binding to object %u more than once", id); + struct ::wl_resource *handle = wl_resource_create(client, &::zwp_input_method_manager_v1_interface, version, id); + return bind(handle); + } + + zwp_input_method_manager_v1::Resource *zwp_input_method_manager_v1::bind(struct ::wl_resource *handle) + { + Resource *resource = zwp_input_method_manager_v1_allocate(); + resource->zwp_input_method_manager_v1_object = this; + + wl_resource_set_implementation(handle, &m_zwp_input_method_manager_v1_interface, resource, destroy_func); + resource->handle = handle; + zwp_input_method_manager_v1_bind_resource(resource); + return resource; + } + zwp_input_method_manager_v1::Resource *zwp_input_method_manager_v1::Resource::fromResource(struct ::wl_resource *resource) + { + if (DS_UNLIKELY(!resource)) + return NULL; + if (wl_resource_instance_of(resource, &::zwp_input_method_manager_v1_interface, &m_zwp_input_method_manager_v1_interface)) + return static_cast(wl_resource_get_user_data(resource)); + return NULL; + } + + const struct ::zwp_input_method_manager_v1_interface zwp_input_method_manager_v1::m_zwp_input_method_manager_v1_interface = { + zwp_input_method_manager_v1::handle_set_transient_for + }; + + void zwp_input_method_manager_v1::zwp_input_method_manager_v1_set_transient_for(Resource *, uint32_t , uint32_t ) + { + } + + + void zwp_input_method_manager_v1::handle_set_transient_for( + ::wl_client *client, + struct wl_resource *resource, + uint32_t parent_pid, + uint32_t child_pid) + { + DS_UNUSED(client); + Resource *r = Resource::fromResource(resource); + static_cast(r->zwp_input_method_manager_v1_object)->zwp_input_method_manager_v1_set_transient_for( + r, + parent_pid, + child_pid); + } +} + +/*LCOV_EXCL_STOP*/ \ No newline at end of file diff --git a/src/DSWaylandServer/dswayland-server-input-method.h b/src/DSWaylandServer/dswayland-server-input-method-unstable-v1.h similarity index 69% rename from src/DSWaylandServer/dswayland-server-input-method.h rename to src/DSWaylandServer/dswayland-server-input-method-unstable-v1.h index 03c49a7..42ae0b2 100644 --- a/src/DSWaylandServer/dswayland-server-input-method.h +++ b/src/DSWaylandServer/dswayland-server-input-method-unstable-v1.h @@ -1,8 +1,8 @@ /*LCOV_EXCL_START*/ /* Protocol XML file : wayland-extension/input-method.xml */ -#ifndef __DS_INPUT_METHOD_PROTOCOL_H__ -#define __DS_INPUT_METHOD_PROTOCOL_H__ +#ifndef __DS_INPUT_METHOD_UNSTABLE_V1_PROTOCOL_H__ +#define __DS_INPUT_METHOD_UNSTABLE_V1_PROTOCOL_H__ #include "wayland-server-core.h" #include "input-method-server-protocol.h" @@ -21,24 +21,24 @@ namespace DSWaylandServer { - class wl_input_method_context + class zwp_input_method_context_v1 { public: - wl_input_method_context(struct ::wl_client *client, uint32_t id, int version); - wl_input_method_context(struct ::wl_display *display, int version); - wl_input_method_context(struct ::wl_resource *resource); - wl_input_method_context(); + zwp_input_method_context_v1(struct ::wl_client *client, uint32_t id, int version); + zwp_input_method_context_v1(struct ::wl_display *display, int version); + zwp_input_method_context_v1(struct ::wl_resource *resource); + zwp_input_method_context_v1(); - virtual ~wl_input_method_context(); + virtual ~zwp_input_method_context_v1(); class Resource { public: - Resource() : input_method_context_object(NULL), handle(NULL) {} + Resource() : zwp_input_method_context_v1_object(NULL), handle(NULL) {} virtual ~Resource() {} - wl_input_method_context *input_method_context_object; - wl_input_method_context *object() { return input_method_context_object; } + zwp_input_method_context_v1 *zwp_input_method_context_v1_object; + zwp_input_method_context_v1 *object() { return zwp_input_method_context_v1_object; } struct ::wl_resource *handle; struct ::wl_client *client() const { return wl_resource_get_client(handle); } @@ -69,6 +69,8 @@ namespace DSWaylandServer { static int interfaceVersion() { return interface()->version; } + void send_surrounding_text(const std::string &text, uint32_t cursor, uint32_t anchor); + void send_surrounding_text(struct ::wl_resource *resource, const std::string &text, uint32_t cursor, uint32_t anchor); void send_reset(); void send_reset(struct ::wl_resource *resource); void send_content_type(uint32_t hint, uint32_t purpose); @@ -107,40 +109,40 @@ namespace DSWaylandServer { void send_input_panel_enabled(struct ::wl_resource *resource, uint32_t enabled); protected: - virtual Resource *input_method_context_allocate(); - - virtual void input_method_context_bind_resource(Resource *resource); - virtual void input_method_context_destroy_resource(Resource *resource); - - virtual void input_method_context_destroy(Resource *resource); - virtual void input_method_context_commit_string(Resource *resource, uint32_t serial, const std::string &text); - virtual void input_method_context_preedit_string(Resource *resource, uint32_t serial, const std::string &text, const std::string &commit); - virtual void input_method_context_preedit_styling(Resource *resource, uint32_t index, uint32_t length, uint32_t style); - virtual void input_method_context_preedit_cursor(Resource *resource, int32_t index); - virtual void input_method_context_delete_surrounding_text(Resource *resource, int32_t index, uint32_t length); - virtual void input_method_context_cursor_position(Resource *resource, int32_t index, int32_t anchor); - virtual void input_method_context_modifiers_map(Resource *resource, struct ::wl_array *map); - virtual void input_method_context_keysym(Resource *resource, uint32_t serial, uint32_t time, uint32_t sym, uint32_t state, uint32_t modifiers); - virtual void input_method_context_grab_keyboard(Resource *resource, uint32_t keyboard); - virtual void input_method_context_key(Resource *resource, uint32_t serial, uint32_t time, uint32_t key, uint32_t state); - virtual 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); - virtual void input_method_context_language(Resource *resource, uint32_t serial, const std::string &language); - virtual void input_method_context_text_direction(Resource *resource, uint32_t serial, uint32_t direction); - virtual void input_method_context_selection_region(Resource *resource, uint32_t serial, int32_t start, int32_t end); - virtual void input_method_context_private_command(Resource *resource, uint32_t serial, const std::string &command); - virtual 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); - virtual void input_method_context_hide_input_panel(Resource *resource, uint32_t serial); - virtual void input_method_context_get_selection_text(Resource *resource, int32_t fd); - virtual void input_method_context_get_surrounding_text(Resource *resource, uint32_t maxlen_before, uint32_t maxlen_after, int32_t fd); - virtual void input_method_context_filter_key_event_done(Resource *resource, uint32_t serial, uint32_t state); - virtual void input_method_context_update_ise_geometry(Resource *resource, uint32_t serial, uint32_t x, uint32_t y, uint32_t width, uint32_t height); - virtual 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); - virtual void input_method_context_input_panel_event(Resource *resource, uint32_t serial, uint32_t event_type, uint32_t value); - virtual void input_method_context_commit_content(Resource *resource, uint32_t serial, const std::string &content, const std::string &description, const std::string &mime_types); - virtual void input_method_context_update_candidate_state(Resource *resource, uint32_t state); - virtual void input_method_context_reshow_input_panel(Resource *resource); - virtual void input_method_context_set_floating_panel(Resource *resource, uint32_t state); - virtual void input_method_context_set_floating_drag_enabled(Resource *resource, uint32_t enabled); + virtual Resource *zwp_input_method_context_v1_allocate(); + + virtual void zwp_input_method_context_v1_bind_resource(Resource *resource); + virtual void zwp_input_method_context_v1_destroy_resource(Resource *resource); + + virtual void zwp_input_method_context_v1_destroy(Resource *resource); + virtual void zwp_input_method_context_v1_commit_string(Resource *resource, uint32_t serial, const std::string &text); + virtual void zwp_input_method_context_v1_preedit_string(Resource *resource, uint32_t serial, const std::string &text, const std::string &commit); + virtual void zwp_input_method_context_v1_preedit_styling(Resource *resource, uint32_t index, uint32_t length, uint32_t style); + virtual void zwp_input_method_context_v1_preedit_cursor(Resource *resource, int32_t index); + virtual void zwp_input_method_context_v1_delete_surrounding_text(Resource *resource, int32_t index, uint32_t length); + virtual void zwp_input_method_context_v1_cursor_position(Resource *resource, int32_t index, int32_t anchor); + virtual void zwp_input_method_context_v1_modifiers_map(Resource *resource, struct ::wl_array *map); + virtual void zwp_input_method_context_v1_keysym(Resource *resource, uint32_t serial, uint32_t time, uint32_t sym, uint32_t state, uint32_t modifiers); + virtual void zwp_input_method_context_v1_grab_keyboard(Resource *resource, uint32_t keyboard); + virtual void zwp_input_method_context_v1_key(Resource *resource, uint32_t serial, uint32_t time, uint32_t key, uint32_t state); + virtual void zwp_input_method_context_v1_modifiers(Resource *resource, uint32_t serial, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group); + virtual void zwp_input_method_context_v1_language(Resource *resource, uint32_t serial, const std::string &language); + virtual void zwp_input_method_context_v1_text_direction(Resource *resource, uint32_t serial, uint32_t direction); + virtual void zwp_input_method_context_v1_selection_region(Resource *resource, uint32_t serial, int32_t start, int32_t end); + virtual void zwp_input_method_context_v1_private_command(Resource *resource, uint32_t serial, const std::string &command); + virtual void zwp_input_method_context_v1_update_input_panel_data(Resource *resource, uint32_t serial, const std::string &input_panel_data, uint32_t input_panel_data_length); + virtual void zwp_input_method_context_v1_hide_input_panel(Resource *resource, uint32_t serial); + virtual void zwp_input_method_context_v1_get_selection_text(Resource *resource, int32_t fd); + virtual void zwp_input_method_context_v1_get_surrounding_text(Resource *resource, uint32_t maxlen_before, uint32_t maxlen_after, int32_t fd); + virtual void zwp_input_method_context_v1_filter_key_event_done(Resource *resource, uint32_t serial, uint32_t state); + virtual void zwp_input_method_context_v1_update_ise_geometry(Resource *resource, uint32_t serial, uint32_t x, uint32_t y, uint32_t width, uint32_t height); + virtual void zwp_input_method_context_v1_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); + virtual void zwp_input_method_context_v1_input_panel_event(Resource *resource, uint32_t serial, uint32_t event_type, uint32_t value); + virtual void zwp_input_method_context_v1_commit_content(Resource *resource, uint32_t serial, const std::string &content, const std::string &description, const std::string &mime_types); + virtual void zwp_input_method_context_v1_update_candidate_state(Resource *resource, uint32_t state); + virtual void zwp_input_method_context_v1_reshow_input_panel(Resource *resource); + virtual void zwp_input_method_context_v1_set_floating_panel(Resource *resource, uint32_t state); + virtual void zwp_input_method_context_v1_set_floating_drag_enabled(Resource *resource, uint32_t enabled); private: static void bind_func(struct ::wl_client *client, void *data, uint32_t version, uint32_t id); @@ -150,7 +152,7 @@ namespace DSWaylandServer { Resource *bind(struct ::wl_client *client, uint32_t id, int version); Resource *bind(struct ::wl_resource *handle); - static const struct ::wl_input_method_context_interface m_wl_input_method_context_interface; + static const struct ::zwp_input_method_context_v1_interface m_zwp_input_method_context_v1_interface; static void handle_destroy( ::wl_client *client, @@ -314,30 +316,30 @@ namespace DSWaylandServer { struct ::wl_global *m_global; uint32_t m_globalVersion; struct DisplayDestroyedListener : ::wl_listener { - wl_input_method_context *parent; + zwp_input_method_context_v1 *parent; DisplayDestroyedListener(): parent(NULL) {} }; DisplayDestroyedListener m_displayDestroyedListener; }; - class wl_input_method + class zwp_input_method_v1 { public: - wl_input_method(struct ::wl_client *client, uint32_t id, int version); - wl_input_method(struct ::wl_display *display, int version); - wl_input_method(struct ::wl_resource *resource); - wl_input_method(); + zwp_input_method_v1(struct ::wl_client *client, uint32_t id, int version); + zwp_input_method_v1(struct ::wl_display *display, int version); + zwp_input_method_v1(struct ::wl_resource *resource); + zwp_input_method_v1(); - virtual ~wl_input_method(); + virtual ~zwp_input_method_v1(); class Resource { public: - Resource() : input_method_object(NULL), handle(NULL) {} + Resource() : zwp_input_method_v1_object(NULL), handle(NULL) {} virtual ~Resource() {} - wl_input_method *input_method_object; - wl_input_method *object() { return input_method_object; } + zwp_input_method_v1 *zwp_input_method_v1_object; + zwp_input_method_v1 *object() { return zwp_input_method_v1_object; } struct ::wl_resource *handle; struct ::wl_client *client() const { return wl_resource_get_client(handle); } @@ -368,22 +370,28 @@ namespace DSWaylandServer { static int interfaceVersion() { return interface()->version; } - void send_activate(struct ::wl_resource *id, uint32_t text_input_id, uint32_t focus_in_event); - void send_activate(struct ::wl_resource *resource, struct ::wl_resource *id, uint32_t text_input_id, uint32_t focus_in_event); - void send_deactivate(struct ::wl_resource *context, uint32_t focus_out_event); - void send_deactivate(struct ::wl_resource *resource, struct ::wl_resource *context, uint32_t focus_out_event); + void send_activate(struct ::wl_resource *id); + void send_activate(struct ::wl_resource *resource, struct ::wl_resource *id); + void send_deactivate(struct ::wl_resource *context); + void send_deactivate(struct ::wl_resource *resource, struct ::wl_resource *context); void send_destroy(struct ::wl_resource *context); void send_destroy(struct ::wl_resource *resource, struct ::wl_resource *context); void send_show_input_panel(struct ::wl_resource *context, uint32_t degree); void send_show_input_panel(struct ::wl_resource *resource, struct ::wl_resource *context, uint32_t degree); void send_hide_input_panel(struct ::wl_resource *context); void send_hide_input_panel(struct ::wl_resource *resource, struct ::wl_resource *context); + void send_open_connection(struct ::wl_resource *context); + void send_open_connection(struct ::wl_resource *resource, struct ::wl_resource *context); + void send_close_connection(struct ::wl_resource *context); + void send_close_connection(struct ::wl_resource *resource, struct ::wl_resource *context); + void send_set_text_input_id(struct ::wl_resource *context, uint32_t text_input_id); + void send_set_text_input_id(struct ::wl_resource *resource, struct ::wl_resource *context, uint32_t text_input_id); protected: - virtual Resource *input_method_allocate(); + virtual Resource *zwp_input_method_v1_allocate(); - virtual void input_method_bind_resource(Resource *resource); - virtual void input_method_destroy_resource(Resource *resource); + virtual void zwp_input_method_v1_bind_resource(Resource *resource); + virtual void zwp_input_method_v1_destroy_resource(Resource *resource); private: static void bind_func(struct ::wl_client *client, void *data, uint32_t version, uint32_t id); @@ -398,30 +406,30 @@ namespace DSWaylandServer { struct ::wl_global *m_global; uint32_t m_globalVersion; struct DisplayDestroyedListener : ::wl_listener { - wl_input_method *parent; + zwp_input_method_v1 *parent; DisplayDestroyedListener(): parent(NULL) {} }; DisplayDestroyedListener m_displayDestroyedListener; }; - class wl_input_panel + class zwp_input_panel_v1 { public: - wl_input_panel(struct ::wl_client *client, uint32_t id, int version); - wl_input_panel(struct ::wl_display *display, int version); - wl_input_panel(struct ::wl_resource *resource); - wl_input_panel(); + zwp_input_panel_v1(struct ::wl_client *client, uint32_t id, int version); + zwp_input_panel_v1(struct ::wl_display *display, int version); + zwp_input_panel_v1(struct ::wl_resource *resource); + zwp_input_panel_v1(); - virtual ~wl_input_panel(); + virtual ~zwp_input_panel_v1(); class Resource { public: - Resource() : input_panel_object(NULL), handle(NULL) {} + Resource() : zwp_input_panel_v1_object(NULL), handle(NULL) {} virtual ~Resource() {} - wl_input_panel *input_panel_object; - wl_input_panel *object() { return input_panel_object; } + zwp_input_panel_v1 *zwp_input_panel_v1_object; + zwp_input_panel_v1 *object() { return zwp_input_panel_v1_object; } struct ::wl_resource *handle; struct ::wl_client *client() const { return wl_resource_get_client(handle); } @@ -453,12 +461,12 @@ namespace DSWaylandServer { protected: - virtual Resource *input_panel_allocate(); + virtual Resource *zwp_input_panel_v1_allocate(); - virtual void input_panel_bind_resource(Resource *resource); - virtual void input_panel_destroy_resource(Resource *resource); + virtual void zwp_input_panel_v1_bind_resource(Resource *resource); + virtual void zwp_input_panel_v1_destroy_resource(Resource *resource); - virtual void input_panel_get_input_panel_surface(Resource *resource, uint32_t id, struct ::wl_resource *surface); + virtual void zwp_input_panel_v1_get_input_panel_surface(Resource *resource, uint32_t id, struct ::wl_resource *surface); private: static void bind_func(struct ::wl_client *client, void *data, uint32_t version, uint32_t id); @@ -468,7 +476,7 @@ namespace DSWaylandServer { Resource *bind(struct ::wl_client *client, uint32_t id, int version); Resource *bind(struct ::wl_resource *handle); - static const struct ::wl_input_panel_interface m_wl_input_panel_interface; + static const struct ::zwp_input_panel_v1_interface m_zwp_input_panel_v1_interface; static void handle_get_input_panel_surface( ::wl_client *client, @@ -481,30 +489,30 @@ namespace DSWaylandServer { struct ::wl_global *m_global; uint32_t m_globalVersion; struct DisplayDestroyedListener : ::wl_listener { - wl_input_panel *parent; + zwp_input_panel_v1 *parent; DisplayDestroyedListener(): parent(NULL) {} }; DisplayDestroyedListener m_displayDestroyedListener; }; - class wl_input_panel_surface + class zwp_input_panel_surface_v1 { public: - wl_input_panel_surface(struct ::wl_client *client, uint32_t id, int version); - wl_input_panel_surface(struct ::wl_display *display, int version); - wl_input_panel_surface(struct ::wl_resource *resource); - wl_input_panel_surface(); + zwp_input_panel_surface_v1(struct ::wl_client *client, uint32_t id, int version); + zwp_input_panel_surface_v1(struct ::wl_display *display, int version); + zwp_input_panel_surface_v1(struct ::wl_resource *resource); + zwp_input_panel_surface_v1(); - virtual ~wl_input_panel_surface(); + virtual ~zwp_input_panel_surface_v1(); class Resource { public: - Resource() : input_panel_surface_object(NULL), handle(NULL) {} + Resource() : zwp_input_panel_surface_v1_object(NULL), handle(NULL) {} virtual ~Resource() {} - wl_input_panel_surface *input_panel_surface_object; - wl_input_panel_surface *object() { return input_panel_surface_object; } + zwp_input_panel_surface_v1 *zwp_input_panel_surface_v1_object; + zwp_input_panel_surface_v1 *object() { return zwp_input_panel_surface_v1_object; } struct ::wl_resource *handle; struct ::wl_client *client() const { return wl_resource_get_client(handle); } @@ -540,14 +548,14 @@ namespace DSWaylandServer { }; protected: - virtual Resource *input_panel_surface_allocate(); + virtual Resource *zwp_input_panel_surface_v1_allocate(); - virtual void input_panel_surface_bind_resource(Resource *resource); - virtual void input_panel_surface_destroy_resource(Resource *resource); + virtual void zwp_input_panel_surface_v1_bind_resource(Resource *resource); + virtual void zwp_input_panel_surface_v1_destroy_resource(Resource *resource); - virtual void input_panel_surface_set_toplevel(Resource *resource, struct ::wl_resource *output, uint32_t position); - virtual void input_panel_surface_set_overlay_panel(Resource *resource); - virtual void input_panel_surface_set_ready(Resource *resource, uint32_t state); + virtual void zwp_input_panel_surface_v1_set_toplevel(Resource *resource, struct ::wl_resource *output, uint32_t position); + virtual void zwp_input_panel_surface_v1_set_overlay_panel(Resource *resource); + virtual void zwp_input_panel_surface_v1_set_ready(Resource *resource, uint32_t state); private: static void bind_func(struct ::wl_client *client, void *data, uint32_t version, uint32_t id); @@ -557,7 +565,7 @@ namespace DSWaylandServer { Resource *bind(struct ::wl_client *client, uint32_t id, int version); Resource *bind(struct ::wl_resource *handle); - static const struct ::wl_input_panel_surface_interface m_wl_input_panel_surface_interface; + static const struct ::zwp_input_panel_surface_v1_interface m_zwp_input_panel_surface_v1_interface; static void handle_set_toplevel( ::wl_client *client, @@ -577,30 +585,30 @@ namespace DSWaylandServer { struct ::wl_global *m_global; uint32_t m_globalVersion; struct DisplayDestroyedListener : ::wl_listener { - wl_input_panel_surface *parent; + zwp_input_panel_surface_v1 *parent; DisplayDestroyedListener(): parent(NULL) {} }; DisplayDestroyedListener m_displayDestroyedListener; }; - class wl_input_method_manager + class zwp_input_method_manager_v1 { public: - wl_input_method_manager(struct ::wl_client *client, uint32_t id, int version); - wl_input_method_manager(struct ::wl_display *display, int version); - wl_input_method_manager(struct ::wl_resource *resource); - wl_input_method_manager(); + zwp_input_method_manager_v1(struct ::wl_client *client, uint32_t id, int version); + zwp_input_method_manager_v1(struct ::wl_display *display, int version); + zwp_input_method_manager_v1(struct ::wl_resource *resource); + zwp_input_method_manager_v1(); - virtual ~wl_input_method_manager(); + virtual ~zwp_input_method_manager_v1(); class Resource { public: - Resource() : input_method_manager_object(NULL), handle(NULL) {} + Resource() : zwp_input_method_manager_v1_object(NULL), handle(NULL) {} virtual ~Resource() {} - wl_input_method_manager *input_method_manager_object; - wl_input_method_manager *object() { return input_method_manager_object; } + zwp_input_method_manager_v1 *zwp_input_method_manager_v1_object; + zwp_input_method_manager_v1 *object() { return zwp_input_method_manager_v1_object; } struct ::wl_resource *handle; struct ::wl_client *client() const { return wl_resource_get_client(handle); } @@ -632,12 +640,12 @@ namespace DSWaylandServer { protected: - virtual Resource *input_method_manager_allocate(); + virtual Resource *zwp_input_method_manager_v1_allocate(); - virtual void input_method_manager_bind_resource(Resource *resource); - virtual void input_method_manager_destroy_resource(Resource *resource); + virtual void zwp_input_method_manager_v1_bind_resource(Resource *resource); + virtual void zwp_input_method_manager_v1_destroy_resource(Resource *resource); - virtual void input_method_manager_set_transient_for(Resource *resource, uint32_t parent_pid, uint32_t child_pid); + virtual void zwp_input_method_manager_v1_set_transient_for(Resource *resource, uint32_t parent_pid, uint32_t child_pid); private: static void bind_func(struct ::wl_client *client, void *data, uint32_t version, uint32_t id); @@ -647,7 +655,7 @@ namespace DSWaylandServer { Resource *bind(struct ::wl_client *client, uint32_t id, int version); Resource *bind(struct ::wl_resource *handle); - static const struct ::wl_input_method_manager_interface m_wl_input_method_manager_interface; + static const struct ::zwp_input_method_manager_v1_interface m_zwp_input_method_manager_v1_interface; static void handle_set_transient_for( ::wl_client *client, @@ -660,7 +668,7 @@ namespace DSWaylandServer { struct ::wl_global *m_global; uint32_t m_globalVersion; struct DisplayDestroyedListener : ::wl_listener { - wl_input_method_manager *parent; + zwp_input_method_manager_v1 *parent; DisplayDestroyedListener(): parent(NULL) {} }; DisplayDestroyedListener m_displayDestroyedListener; @@ -668,4 +676,4 @@ namespace DSWaylandServer { } #endif -/*LCOV_EXCL_STOP*/ +/*LCOV_EXCL_STOP*/ \ No newline at end of file diff --git a/src/DSWaylandServer/dswayland-server-input-method.cpp b/src/DSWaylandServer/dswayland-server-input-method.cpp deleted file mode 100644 index 005ffd1..0000000 --- a/src/DSWaylandServer/dswayland-server-input-method.cpp +++ /dev/null @@ -1,1970 +0,0 @@ -/*LCOV_EXCL_START*/ -/* Protocol XML file : wayland-extension/input-method.xml */ - -#include "dswayland-server-input-method.h" - -#ifndef DS_UNLIKELY -#define DS_UNLIKELY(X) X -#endif -#ifndef DS_UNUSED -#define DS_UNUSED(X) (void)X -#endif -#ifndef DS_ASSERT -#define DS_ASSERT(COND) assert(COND) -#endif -#ifndef DS_ASSERT_X -#define DS_ASSERT_X(COND, ERR_TAG, ERR_MSG, X...) \ - do {\ - if (! (COND))\ - {\ - fprintf(stderr, "%s :: "#ERR_MSG, ERR_TAG, ##X);\ - assert(COND);\ - }\ - } while(0) -#endif -#ifndef WRN -#define WRN(X...) fprintf(stderr,##X) -#endif - -namespace DSWaylandServer { - wl_input_method_context::wl_input_method_context(struct ::wl_client *client, uint32_t id, int version) - : m_resource_map() - , m_resource(NULL) - , m_global(NULL) - , m_globalVersion(0) - , m_displayDestroyedListener() - { - init(client, id, version); - } - - wl_input_method_context::wl_input_method_context(struct ::wl_display *display, int version) - : m_resource_map() - , m_resource(NULL) - , m_global(NULL) - , m_globalVersion(0) - , m_displayDestroyedListener() - { - init(display, version); - } - - wl_input_method_context::wl_input_method_context(struct ::wl_resource *resource) - : m_resource_map() - , m_resource(NULL) - , m_global(NULL) - , m_globalVersion(0) - , m_displayDestroyedListener() - { - init(resource); - } - - wl_input_method_context::wl_input_method_context() - : m_resource_map() - , m_resource(NULL) - , m_global(NULL) - , m_globalVersion(0) - , m_displayDestroyedListener() - { - } - - wl_input_method_context::~wl_input_method_context() - { - std::multimap::iterator it; - for (it = m_resource_map.begin() ; it != m_resource_map.end() ; it++) { - wl_input_method_context::Resource *resource = (*it).second; - wl_resource_set_implementation(resource->handle, NULL, NULL, NULL); - } - - if (m_global) { - wl_global_destroy(m_global); - wl_list_remove(&m_displayDestroyedListener.link); - } - } - - void wl_input_method_context::init(struct ::wl_client *client, uint32_t id, int version) - { - m_resource = bind(client, id, version); - } - - void wl_input_method_context::init(struct ::wl_resource *resource) - { - m_resource = bind(resource); - } - - wl_input_method_context::Resource *wl_input_method_context::add(struct ::wl_client *client, int version) - { - Resource *resource = bind(client, 0, version); - m_resource_map.insert(std::pair(client, resource)); - return resource; - } - - wl_input_method_context::Resource *wl_input_method_context::add(struct ::wl_client *client, uint32_t id, int version) - { - Resource *resource = bind(client, id, version); - m_resource_map.insert(std::pair(client, resource)); - return resource; - } - - void wl_input_method_context::init(struct ::wl_display *display, int version) - { - m_global = wl_global_create(display, &::wl_input_method_context_interface, version, this, bind_func); - m_globalVersion = version; - m_displayDestroyedListener.notify = wl_input_method_context::display_destroy_func; - m_displayDestroyedListener.parent = this; - wl_display_add_destroy_listener(display, &m_displayDestroyedListener); - } - - const struct wl_interface *wl_input_method_context::interface() - { - return &::wl_input_method_context_interface; - } - - wl_input_method_context::Resource *wl_input_method_context::input_method_context_allocate() - { - return new Resource; - } - - void wl_input_method_context::input_method_context_bind_resource(Resource *) - { - } - - void wl_input_method_context::input_method_context_destroy_resource(Resource *) - { - } - - void wl_input_method_context::bind_func(struct ::wl_client *client, void *data, uint32_t version, uint32_t id) - { - wl_input_method_context *that = static_cast(data); - that->add(client, id, std::min(that->m_globalVersion, version)); - } - - void wl_input_method_context::display_destroy_func(struct ::wl_listener *listener, void *data) - { - DS_UNUSED(data); - wl_input_method_context *that = static_cast(listener)->parent; - that->m_global = NULL; - } - - void wl_input_method_context::destroy_func(struct ::wl_resource *client_resource) - { - Resource *resource = Resource::fromResource(client_resource); - DS_ASSERT(resource); - wl_input_method_context *that = resource->input_method_context_object; - that->m_resource_map.erase(resource->client()); - that->input_method_context_destroy_resource(resource); - delete resource; - } - - wl_input_method_context::Resource *wl_input_method_context::bind(struct ::wl_client *client, uint32_t id, int version) - { - DS_ASSERT_X(!wl_client_get_object(client, id), "DSWaylandObject bind", "binding to object %u more than once", id); - struct ::wl_resource *handle = wl_resource_create(client, &::wl_input_method_context_interface, version, id); - return bind(handle); - } - - wl_input_method_context::Resource *wl_input_method_context::bind(struct ::wl_resource *handle) - { - Resource *resource = input_method_context_allocate(); - resource->input_method_context_object = this; - - wl_resource_set_implementation(handle, &m_wl_input_method_context_interface, resource, destroy_func); - resource->handle = handle; - input_method_context_bind_resource(resource); - return resource; - } - wl_input_method_context::Resource *wl_input_method_context::Resource::fromResource(struct ::wl_resource *resource) - { - if (DS_UNLIKELY(!resource)) - return NULL; - if (wl_resource_instance_of(resource, &::wl_input_method_context_interface, &m_wl_input_method_context_interface)) - return static_cast(wl_resource_get_user_data(resource)); - return NULL; - } - - const struct ::wl_input_method_context_interface wl_input_method_context::m_wl_input_method_context_interface = { - wl_input_method_context::handle_destroy, - wl_input_method_context::handle_commit_string, - wl_input_method_context::handle_preedit_string, - wl_input_method_context::handle_preedit_styling, - wl_input_method_context::handle_preedit_cursor, - wl_input_method_context::handle_delete_surrounding_text, - wl_input_method_context::handle_cursor_position, - wl_input_method_context::handle_modifiers_map, - wl_input_method_context::handle_keysym, - wl_input_method_context::handle_grab_keyboard, - wl_input_method_context::handle_key, - wl_input_method_context::handle_modifiers, - wl_input_method_context::handle_language, - wl_input_method_context::handle_text_direction, - wl_input_method_context::handle_selection_region, - wl_input_method_context::handle_private_command, - wl_input_method_context::handle_update_input_panel_data, - wl_input_method_context::handle_hide_input_panel, - wl_input_method_context::handle_get_selection_text, - wl_input_method_context::handle_get_surrounding_text, - wl_input_method_context::handle_filter_key_event_done, - wl_input_method_context::handle_update_ise_geometry, - wl_input_method_context::handle_recapture_string, - wl_input_method_context::handle_input_panel_event, - wl_input_method_context::handle_commit_content, - wl_input_method_context::handle_update_candidate_state, - wl_input_method_context::handle_reshow_input_panel, - wl_input_method_context::handle_set_floating_panel, - wl_input_method_context::handle_set_floating_drag_enabled - }; - - void wl_input_method_context::input_method_context_destroy(Resource *) - { - } - - void wl_input_method_context::input_method_context_commit_string(Resource *, uint32_t , const std::string &) - { - } - - void wl_input_method_context::input_method_context_preedit_string(Resource *, uint32_t , const std::string &, const std::string &) - { - } - - void wl_input_method_context::input_method_context_preedit_styling(Resource *, uint32_t , uint32_t , uint32_t ) - { - } - - void wl_input_method_context::input_method_context_preedit_cursor(Resource *, int32_t ) - { - } - - void wl_input_method_context::input_method_context_delete_surrounding_text(Resource *, int32_t , uint32_t ) - { - } - - void wl_input_method_context::input_method_context_cursor_position(Resource *, int32_t , int32_t ) - { - } - - void wl_input_method_context::input_method_context_modifiers_map(Resource *, struct ::wl_array *) - { - } - - void wl_input_method_context::input_method_context_keysym(Resource *, uint32_t , uint32_t , uint32_t , uint32_t , uint32_t ) - { - } - - void wl_input_method_context::input_method_context_grab_keyboard(Resource *, uint32_t) - { - } - - void wl_input_method_context::input_method_context_key(Resource *, uint32_t , uint32_t , uint32_t , uint32_t ) - { - } - - void wl_input_method_context::input_method_context_modifiers(Resource *, uint32_t , uint32_t , uint32_t , uint32_t , uint32_t ) - { - } - - void wl_input_method_context::input_method_context_language(Resource *, uint32_t , const std::string &) - { - } - - void wl_input_method_context::input_method_context_text_direction(Resource *, uint32_t , uint32_t ) - { - } - - void wl_input_method_context::input_method_context_selection_region(Resource *, uint32_t , int32_t , int32_t ) - { - } - - void wl_input_method_context::input_method_context_private_command(Resource *, uint32_t , const std::string &) - { - } - - void wl_input_method_context::input_method_context_update_input_panel_data(Resource *, uint32_t , const std::string &, uint32_t ) - { - } - - void wl_input_method_context::input_method_context_hide_input_panel(Resource *, uint32_t ) - { - } - - void wl_input_method_context::input_method_context_get_selection_text(Resource *, int32_t ) - { - } - - void wl_input_method_context::input_method_context_get_surrounding_text(Resource *, uint32_t , uint32_t , int32_t ) - { - } - - void wl_input_method_context::input_method_context_filter_key_event_done(Resource *, uint32_t , uint32_t ) - { - } - - void wl_input_method_context::input_method_context_update_ise_geometry(Resource *, uint32_t , uint32_t , uint32_t , uint32_t , uint32_t ) - { - } - - void wl_input_method_context::input_method_context_recapture_string(Resource *, uint32_t , int32_t , uint32_t , const std::string &, const std::string &, const std::string &) - { - } - - void wl_input_method_context::input_method_context_input_panel_event(Resource *, uint32_t , uint32_t , uint32_t ) - { - } - - void wl_input_method_context::input_method_context_commit_content(Resource *, uint32_t , const std::string &, const std::string &, const std::string &) - { - } - - void wl_input_method_context::input_method_context_update_candidate_state(Resource *, uint32_t ) - { - } - - void wl_input_method_context::input_method_context_reshow_input_panel(Resource *) - { - } - - void wl_input_method_context::input_method_context_set_floating_panel(Resource *, uint32_t ) - { - } - - void wl_input_method_context::input_method_context_set_floating_drag_enabled(Resource *, uint32_t ) - { - } - - - void wl_input_method_context::handle_destroy( - ::wl_client *client, - struct wl_resource *resource) - { - DS_UNUSED(client); - Resource *r = Resource::fromResource(resource); - static_cast(r->input_method_context_object)->input_method_context_destroy( - r); - } - - void wl_input_method_context::handle_commit_string( - ::wl_client *client, - struct wl_resource *resource, - uint32_t serial, - const char *text) - { - DS_UNUSED(client); - Resource *r = Resource::fromResource(resource); - static_cast(r->input_method_context_object)->input_method_context_commit_string( - r, - serial, - std::string(text)); - } - - void wl_input_method_context::handle_preedit_string( - ::wl_client *client, - struct wl_resource *resource, - uint32_t serial, - const char *text, - const char *commit) - { - DS_UNUSED(client); - Resource *r = Resource::fromResource(resource); - static_cast(r->input_method_context_object)->input_method_context_preedit_string( - r, - serial, - std::string(text), - std::string(commit)); - } - - void wl_input_method_context::handle_preedit_styling( - ::wl_client *client, - struct wl_resource *resource, - uint32_t index, - uint32_t length, - uint32_t style) - { - DS_UNUSED(client); - Resource *r = Resource::fromResource(resource); - static_cast(r->input_method_context_object)->input_method_context_preedit_styling( - r, - index, - length, - style); - } - - void wl_input_method_context::handle_preedit_cursor( - ::wl_client *client, - struct wl_resource *resource, - int32_t index) - { - DS_UNUSED(client); - Resource *r = Resource::fromResource(resource); - static_cast(r->input_method_context_object)->input_method_context_preedit_cursor( - r, - index); - } - - void wl_input_method_context::handle_delete_surrounding_text( - ::wl_client *client, - struct wl_resource *resource, - int32_t index, - uint32_t length) - { - DS_UNUSED(client); - Resource *r = Resource::fromResource(resource); - static_cast(r->input_method_context_object)->input_method_context_delete_surrounding_text( - r, - index, - length); - } - - void wl_input_method_context::handle_cursor_position( - ::wl_client *client, - struct wl_resource *resource, - int32_t index, - int32_t anchor) - { - DS_UNUSED(client); - Resource *r = Resource::fromResource(resource); - static_cast(r->input_method_context_object)->input_method_context_cursor_position( - r, - index, - anchor); - } - - void wl_input_method_context::handle_modifiers_map( - ::wl_client *client, - struct wl_resource *resource, - struct ::wl_array *map) - { - DS_UNUSED(client); - Resource *r = Resource::fromResource(resource); - static_cast(r->input_method_context_object)->input_method_context_modifiers_map( - r, - map); - } - - void wl_input_method_context::handle_keysym( - ::wl_client *client, - struct wl_resource *resource, - uint32_t serial, - uint32_t time, - uint32_t sym, - uint32_t state, - uint32_t modifiers) - { - DS_UNUSED(client); - Resource *r = Resource::fromResource(resource); - static_cast(r->input_method_context_object)->input_method_context_keysym( - r, - serial, - time, - sym, - state, - modifiers); - } - - void wl_input_method_context::handle_grab_keyboard( - ::wl_client *client, - struct wl_resource *resource, - uint32_t keyboard) - { - DS_UNUSED(client); - Resource *r = Resource::fromResource(resource); - static_cast(r->input_method_context_object)->input_method_context_grab_keyboard( - r, - keyboard); - } - - void wl_input_method_context::handle_key( - ::wl_client *client, - struct wl_resource *resource, - uint32_t serial, - uint32_t time, - uint32_t key, - uint32_t state) - { - DS_UNUSED(client); - Resource *r = Resource::fromResource(resource); - static_cast(r->input_method_context_object)->input_method_context_key( - r, - serial, - time, - key, - state); - } - - void wl_input_method_context::handle_modifiers( - ::wl_client *client, - struct wl_resource *resource, - uint32_t serial, - uint32_t mods_depressed, - uint32_t mods_latched, - uint32_t mods_locked, - uint32_t group) - { - DS_UNUSED(client); - Resource *r = Resource::fromResource(resource); - static_cast(r->input_method_context_object)->input_method_context_modifiers( - r, - serial, - mods_depressed, - mods_latched, - mods_locked, - group); - } - - void wl_input_method_context::handle_language( - ::wl_client *client, - struct wl_resource *resource, - uint32_t serial, - const char *language) - { - DS_UNUSED(client); - Resource *r = Resource::fromResource(resource); - static_cast(r->input_method_context_object)->input_method_context_language( - r, - serial, - std::string(language)); - } - - void wl_input_method_context::handle_text_direction( - ::wl_client *client, - struct wl_resource *resource, - uint32_t serial, - uint32_t direction) - { - DS_UNUSED(client); - Resource *r = Resource::fromResource(resource); - static_cast(r->input_method_context_object)->input_method_context_text_direction( - r, - serial, - direction); - } - - void wl_input_method_context::handle_selection_region( - ::wl_client *client, - struct wl_resource *resource, - uint32_t serial, - int32_t start, - int32_t end) - { - DS_UNUSED(client); - Resource *r = Resource::fromResource(resource); - static_cast(r->input_method_context_object)->input_method_context_selection_region( - r, - serial, - start, - end); - } - - void wl_input_method_context::handle_private_command( - ::wl_client *client, - struct wl_resource *resource, - uint32_t serial, - const char *command) - { - DS_UNUSED(client); - Resource *r = Resource::fromResource(resource); - static_cast(r->input_method_context_object)->input_method_context_private_command( - r, - serial, - std::string(command)); - } - - void wl_input_method_context::handle_update_input_panel_data( - ::wl_client *client, - struct wl_resource *resource, - uint32_t serial, - const char *input_panel_data, - uint32_t input_panel_data_length) - { - DS_UNUSED(client); - Resource *r = Resource::fromResource(resource); - static_cast(r->input_method_context_object)->input_method_context_update_input_panel_data( - r, - serial, - std::string(input_panel_data), - input_panel_data_length); - } - - void wl_input_method_context::handle_hide_input_panel( - ::wl_client *client, - struct wl_resource *resource, - uint32_t serial) - { - DS_UNUSED(client); - Resource *r = Resource::fromResource(resource); - static_cast(r->input_method_context_object)->input_method_context_hide_input_panel( - r, - serial); - } - - void wl_input_method_context::handle_get_selection_text( - ::wl_client *client, - struct wl_resource *resource, - int32_t fd) - { - DS_UNUSED(client); - Resource *r = Resource::fromResource(resource); - static_cast(r->input_method_context_object)->input_method_context_get_selection_text( - r, - fd); - } - - void wl_input_method_context::handle_get_surrounding_text( - ::wl_client *client, - struct wl_resource *resource, - uint32_t maxlen_before, - uint32_t maxlen_after, - int32_t fd) - { - DS_UNUSED(client); - Resource *r = Resource::fromResource(resource); - static_cast(r->input_method_context_object)->input_method_context_get_surrounding_text( - r, - maxlen_before, - maxlen_after, - fd); - } - - void wl_input_method_context::handle_filter_key_event_done( - ::wl_client *client, - struct wl_resource *resource, - uint32_t serial, - uint32_t state) - { - DS_UNUSED(client); - Resource *r = Resource::fromResource(resource); - static_cast(r->input_method_context_object)->input_method_context_filter_key_event_done( - r, - serial, - state); - } - - void wl_input_method_context::handle_update_ise_geometry( - ::wl_client *client, - struct wl_resource *resource, - uint32_t serial, - uint32_t x, - uint32_t y, - uint32_t width, - uint32_t height) - { - DS_UNUSED(client); - Resource *r = Resource::fromResource(resource); - static_cast(r->input_method_context_object)->input_method_context_update_ise_geometry( - r, - serial, - x, - y, - width, - height); - } - - void wl_input_method_context::handle_recapture_string( - ::wl_client *client, - struct wl_resource *resource, - uint32_t serial, - int32_t index, - uint32_t length, - const char *preedit, - const char *preedit_commit, - const char *commit) - { - DS_UNUSED(client); - Resource *r = Resource::fromResource(resource); - static_cast(r->input_method_context_object)->input_method_context_recapture_string( - r, - serial, - index, - length, - std::string(preedit), - std::string(preedit_commit), - std::string(commit)); - } - - void wl_input_method_context::handle_input_panel_event( - ::wl_client *client, - struct wl_resource *resource, - uint32_t serial, - uint32_t event_type, - uint32_t value) - { - DS_UNUSED(client); - Resource *r = Resource::fromResource(resource); - static_cast(r->input_method_context_object)->input_method_context_input_panel_event( - r, - serial, - event_type, - value); - } - - void wl_input_method_context::handle_commit_content( - ::wl_client *client, - struct wl_resource *resource, - uint32_t serial, - const char *content, - const char *description, - const char *mime_types) - { - DS_UNUSED(client); - Resource *r = Resource::fromResource(resource); - static_cast(r->input_method_context_object)->input_method_context_commit_content( - r, - serial, - std::string(content), - std::string(description), - std::string(mime_types)); - } - - void wl_input_method_context::handle_update_candidate_state( - ::wl_client *client, - struct wl_resource *resource, - uint32_t state) - { - DS_UNUSED(client); - Resource *r = Resource::fromResource(resource); - static_cast(r->input_method_context_object)->input_method_context_update_candidate_state( - r, - state); - } - - void wl_input_method_context::handle_reshow_input_panel( - ::wl_client *client, - struct wl_resource *resource) - { - DS_UNUSED(client); - Resource *r = Resource::fromResource(resource); - static_cast(r->input_method_context_object)->input_method_context_reshow_input_panel( - r); - } - - void wl_input_method_context::handle_set_floating_panel( - ::wl_client *client, - struct wl_resource *resource, - uint32_t state) - { - DS_UNUSED(client); - Resource *r = Resource::fromResource(resource); - static_cast(r->input_method_context_object)->input_method_context_set_floating_panel( - r, - state); - } - - void wl_input_method_context::handle_set_floating_drag_enabled( - ::wl_client *client, - struct wl_resource *resource, - uint32_t enabled) - { - DS_UNUSED(client); - Resource *r = Resource::fromResource(resource); - static_cast(r->input_method_context_object)->input_method_context_set_floating_drag_enabled( - r, - enabled); - } - - void wl_input_method_context::send_reset() - { - DS_ASSERT_X(m_resource, "wl_input_method_context::reset", "Uninitialised resource"); - if (DS_UNLIKELY(!m_resource)) { - WRN("could not call wl_input_method_context::reset as it's not initialised"); - return; - } - send_reset( - m_resource->handle); - } - - void wl_input_method_context::send_reset(struct ::wl_resource *resource) - { - wl_input_method_context_send_reset( - resource); - } - - - void wl_input_method_context::send_content_type(uint32_t hint, uint32_t purpose) - { - DS_ASSERT_X(m_resource, "wl_input_method_context::content_type", "Uninitialised resource"); - if (DS_UNLIKELY(!m_resource)) { - WRN("could not call wl_input_method_context::content_type as it's not initialised"); - return; - } - send_content_type( - m_resource->handle, - hint, - purpose); - } - - void wl_input_method_context::send_content_type(struct ::wl_resource *resource, uint32_t hint, uint32_t purpose) - { - wl_input_method_context_send_content_type( - resource, - hint, - purpose); - } - - - void wl_input_method_context::send_invoke_action(uint32_t button, uint32_t index) - { - DS_ASSERT_X(m_resource, "wl_input_method_context::invoke_action", "Uninitialised resource"); - if (DS_UNLIKELY(!m_resource)) { - WRN("could not call wl_input_method_context::invoke_action as it's not initialised"); - return; - } - send_invoke_action( - m_resource->handle, - button, - index); - } - - void wl_input_method_context::send_invoke_action(struct ::wl_resource *resource, uint32_t button, uint32_t index) - { - wl_input_method_context_send_invoke_action( - resource, - button, - index); - } - - - void wl_input_method_context::send_commit_state(uint32_t serial) - { - DS_ASSERT_X(m_resource, "wl_input_method_context::commit_state", "Uninitialised resource"); - if (DS_UNLIKELY(!m_resource)) { - WRN("could not call wl_input_method_context::commit_state as it's not initialised"); - return; - } - send_commit_state( - m_resource->handle, - serial); - } - - void wl_input_method_context::send_commit_state(struct ::wl_resource *resource, uint32_t serial) - { - wl_input_method_context_send_commit_state( - resource, - serial); - } - - - void wl_input_method_context::send_preferred_language(const std::string &language) - { - DS_ASSERT_X(m_resource, "wl_input_method_context::preferred_language", "Uninitialised resource"); - if (DS_UNLIKELY(!m_resource)) { - WRN("could not call wl_input_method_context::preferred_language as it's not initialised"); - return; - } - send_preferred_language( - m_resource->handle, - language); - } - - void wl_input_method_context::send_preferred_language(struct ::wl_resource *resource, const std::string &language) - { - wl_input_method_context_send_preferred_language( - resource, - language.c_str()); - } - - - void wl_input_method_context::send_return_key_type(uint32_t return_key_type) - { - DS_ASSERT_X(m_resource, "wl_input_method_context::return_key_type", "Uninitialised resource"); - if (DS_UNLIKELY(!m_resource)) { - WRN("could not call wl_input_method_context::return_key_type as it's not initialised"); - return; - } - send_return_key_type( - m_resource->handle, - return_key_type); - } - - void wl_input_method_context::send_return_key_type(struct ::wl_resource *resource, uint32_t return_key_type) - { - wl_input_method_context_send_return_key_type( - resource, - return_key_type); - } - - - void wl_input_method_context::send_return_key_disabled(uint32_t return_key_disabled) - { - DS_ASSERT_X(m_resource, "wl_input_method_context::return_key_disabled", "Uninitialised resource"); - if (DS_UNLIKELY(!m_resource)) { - WRN("could not call wl_input_method_context::return_key_disabled as it's not initialised"); - return; - } - send_return_key_disabled( - m_resource->handle, - return_key_disabled); - } - - void wl_input_method_context::send_return_key_disabled(struct ::wl_resource *resource, uint32_t return_key_disabled) - { - wl_input_method_context_send_return_key_disabled( - resource, - return_key_disabled); - } - - - void wl_input_method_context::send_input_panel_data(const std::string &input_panel_data, uint32_t input_panel_data_length) - { - DS_ASSERT_X(m_resource, "wl_input_method_context::input_panel_data", "Uninitialised resource"); - if (DS_UNLIKELY(!m_resource)) { - WRN("could not call wl_input_method_context::input_panel_data as it's not initialised"); - return; - } - send_input_panel_data( - m_resource->handle, - input_panel_data, - input_panel_data_length); - } - - void wl_input_method_context::send_input_panel_data(struct ::wl_resource *resource, const std::string &input_panel_data, uint32_t input_panel_data_length) - { - wl_input_method_context_send_input_panel_data( - resource, - input_panel_data.c_str(), - input_panel_data_length); - } - - - void wl_input_method_context::send_bidi_direction(uint32_t direction) - { - DS_ASSERT_X(m_resource, "wl_input_method_context::bidi_direction", "Uninitialised resource"); - if (DS_UNLIKELY(!m_resource)) { - WRN("could not call wl_input_method_context::bidi_direction as it's not initialised"); - return; - } - send_bidi_direction( - m_resource->handle, - direction); - } - - void wl_input_method_context::send_bidi_direction(struct ::wl_resource *resource, uint32_t direction) - { - wl_input_method_context_send_bidi_direction( - resource, - direction); - } - - - void wl_input_method_context::send_cursor_position(uint32_t cursor_position) - { - DS_ASSERT_X(m_resource, "wl_input_method_context::cursor_position", "Uninitialised resource"); - if (DS_UNLIKELY(!m_resource)) { - WRN("could not call wl_input_method_context::cursor_position as it's not initialised"); - return; - } - send_cursor_position( - m_resource->handle, - cursor_position); - } - - void wl_input_method_context::send_cursor_position(struct ::wl_resource *resource, uint32_t cursor_position) - { - wl_input_method_context_send_cursor_position( - resource, - cursor_position); - } - - - void wl_input_method_context::send_process_input_device_event(uint32_t event_type, const std::string &event_data, uint32_t event_length) - { - DS_ASSERT_X(m_resource, "wl_input_method_context::process_input_device_event", "Uninitialised resource"); - if (DS_UNLIKELY(!m_resource)) { - WRN("could not call wl_input_method_context::process_input_device_event as it's not initialised"); - return; - } - send_process_input_device_event( - m_resource->handle, - event_type, - event_data, - event_length); - } - - void wl_input_method_context::send_process_input_device_event(struct ::wl_resource *resource, uint32_t event_type, const std::string &event_data, uint32_t event_length) - { - wl_input_method_context_send_process_input_device_event( - resource, - event_type, - event_data.c_str(), - event_length); - } - - - void wl_input_method_context::send_filter_key_event(uint32_t serial, uint32_t time, const std::string &keyname, uint32_t state, uint32_t modifiers, const std::string &dev_name, uint32_t dev_class, uint32_t dev_subclass, uint32_t keycode) - { - DS_ASSERT_X(m_resource, "wl_input_method_context::filter_key_event", "Uninitialised resource"); - if (DS_UNLIKELY(!m_resource)) { - WRN("could not call wl_input_method_context::filter_key_event as it's not initialised"); - return; - } - send_filter_key_event( - m_resource->handle, - serial, - time, - keyname, - state, - modifiers, - dev_name, - dev_class, - dev_subclass, - keycode); - } - - void wl_input_method_context::send_filter_key_event(struct ::wl_resource *resource, uint32_t serial, uint32_t time, const std::string &keyname, uint32_t state, uint32_t modifiers, const std::string &dev_name, uint32_t dev_class, uint32_t dev_subclass, uint32_t keycode) - { - wl_input_method_context_send_filter_key_event( - resource, - serial, - time, - keyname.c_str(), - state, - modifiers, - dev_name.c_str(), - dev_class, - dev_subclass, - keycode); - } - - - void wl_input_method_context::send_capital_mode(uint32_t mode) - { - DS_ASSERT_X(m_resource, "wl_input_method_context::capital_mode", "Uninitialised resource"); - if (DS_UNLIKELY(!m_resource)) { - WRN("could not call wl_input_method_context::capital_mode as it's not initialised"); - return; - } - send_capital_mode( - m_resource->handle, - mode); - } - - void wl_input_method_context::send_capital_mode(struct ::wl_resource *resource, uint32_t mode) - { - wl_input_method_context_send_capital_mode( - resource, - mode); - } - - - void wl_input_method_context::send_prediction_hint(const std::string &text) - { - DS_ASSERT_X(m_resource, "wl_input_method_context::prediction_hint", "Uninitialised resource"); - if (DS_UNLIKELY(!m_resource)) { - WRN("could not call wl_input_method_context::prediction_hint as it's not initialised"); - return; - } - send_prediction_hint( - m_resource->handle, - text); - } - - void wl_input_method_context::send_prediction_hint(struct ::wl_resource *resource, const std::string &text) - { - wl_input_method_context_send_prediction_hint( - resource, - text.c_str()); - } - - - void wl_input_method_context::send_mime_type(const std::string &type) - { - DS_ASSERT_X(m_resource, "wl_input_method_context::mime_type", "Uninitialised resource"); - if (DS_UNLIKELY(!m_resource)) { - WRN("could not call wl_input_method_context::mime_type as it's not initialised"); - return; - } - send_mime_type( - m_resource->handle, - type); - } - - void wl_input_method_context::send_mime_type(struct ::wl_resource *resource, const std::string &type) - { - wl_input_method_context_send_mime_type( - resource, - type.c_str()); - } - - - void wl_input_method_context::send_finalized_content(const std::string &text, uint32_t cursor_position) - { - DS_ASSERT_X(m_resource, "wl_input_method_context::finalized_content", "Uninitialised resource"); - if (DS_UNLIKELY(!m_resource)) { - WRN("could not call wl_input_method_context::finalized_content as it's not initialised"); - return; - } - send_finalized_content( - m_resource->handle, - text, - cursor_position); - } - - void wl_input_method_context::send_finalized_content(struct ::wl_resource *resource, const std::string &text, uint32_t cursor_position) - { - wl_input_method_context_send_finalized_content( - resource, - text.c_str(), - cursor_position); - } - - - void wl_input_method_context::send_prediction_hint_data(const std::string &key, const std::string &value) - { - DS_ASSERT_X(m_resource, "wl_input_method_context::prediction_hint_data", "Uninitialised resource"); - if (DS_UNLIKELY(!m_resource)) { - WRN("could not call wl_input_method_context::prediction_hint_data as it's not initialised"); - return; - } - send_prediction_hint_data( - m_resource->handle, - key, - value); - } - - void wl_input_method_context::send_prediction_hint_data(struct ::wl_resource *resource, const std::string &key, const std::string &value) - { - wl_input_method_context_send_prediction_hint_data( - resource, - key.c_str(), - value.c_str()); - } - - - void wl_input_method_context::send_input_panel_enabled(uint32_t enabled) - { - DS_ASSERT_X(m_resource, "wl_input_method_context::input_panel_enabled", "Uninitialised resource"); - if (DS_UNLIKELY(!m_resource)) { - WRN("could not call wl_input_method_context::input_panel_enabled as it's not initialised"); - return; - } - send_input_panel_enabled( - m_resource->handle, - enabled); - } - - void wl_input_method_context::send_input_panel_enabled(struct ::wl_resource *resource, uint32_t enabled) - { - wl_input_method_context_send_input_panel_enabled( - resource, - enabled); - } - - - wl_input_method::wl_input_method(struct ::wl_client *client, uint32_t id, int version) - : m_resource_map() - , m_resource(NULL) - , m_global(NULL) - , m_globalVersion(0) - , m_displayDestroyedListener() - { - init(client, id, version); - } - - wl_input_method::wl_input_method(struct ::wl_display *display, int version) - : m_resource_map() - , m_resource(NULL) - , m_global(NULL) - , m_globalVersion(0) - , m_displayDestroyedListener() - { - init(display, version); - } - - wl_input_method::wl_input_method(struct ::wl_resource *resource) - : m_resource_map() - , m_resource(NULL) - , m_global(NULL) - , m_globalVersion(0) - , m_displayDestroyedListener() - { - init(resource); - } - - wl_input_method::wl_input_method() - : m_resource_map() - , m_resource(NULL) - , m_global(NULL) - , m_globalVersion(0) - , m_displayDestroyedListener() - { - } - - wl_input_method::~wl_input_method() - { - std::multimap::iterator it; - for (it = m_resource_map.begin() ; it != m_resource_map.end() ; it++) { - wl_input_method::Resource *resource = (*it).second; - wl_resource_set_implementation(resource->handle, NULL, NULL, NULL); - } - - if (m_global) { - wl_global_destroy(m_global); - wl_list_remove(&m_displayDestroyedListener.link); - } - } - - void wl_input_method::init(struct ::wl_client *client, uint32_t id, int version) - { - m_resource = bind(client, id, version); - } - - void wl_input_method::init(struct ::wl_resource *resource) - { - m_resource = bind(resource); - } - - wl_input_method::Resource *wl_input_method::add(struct ::wl_client *client, int version) - { - Resource *resource = bind(client, 0, version); - m_resource_map.insert(std::pair(client, resource)); - return resource; - } - - wl_input_method::Resource *wl_input_method::add(struct ::wl_client *client, uint32_t id, int version) - { - Resource *resource = bind(client, id, version); - m_resource_map.insert(std::pair(client, resource)); - return resource; - } - - void wl_input_method::init(struct ::wl_display *display, int version) - { - m_global = wl_global_create(display, &::wl_input_method_interface, version, this, bind_func); - m_globalVersion = version; - m_displayDestroyedListener.notify = wl_input_method::display_destroy_func; - m_displayDestroyedListener.parent = this; - wl_display_add_destroy_listener(display, &m_displayDestroyedListener); - } - - const struct wl_interface *wl_input_method::interface() - { - return &::wl_input_method_interface; - } - - wl_input_method::Resource *wl_input_method::input_method_allocate() - { - return new Resource; - } - - void wl_input_method::input_method_bind_resource(Resource *) - { - } - - void wl_input_method::input_method_destroy_resource(Resource *) - { - } - - void wl_input_method::bind_func(struct ::wl_client *client, void *data, uint32_t version, uint32_t id) - { - wl_input_method *that = static_cast(data); - that->add(client, id, std::min(that->m_globalVersion, version)); - } - - void wl_input_method::display_destroy_func(struct ::wl_listener *listener, void *data) - { - DS_UNUSED(data); - wl_input_method *that = static_cast(listener)->parent; - that->m_global = NULL; - } - - void wl_input_method::destroy_func(struct ::wl_resource *client_resource) - { - Resource *resource = Resource::fromResource(client_resource); - DS_ASSERT(resource); - wl_input_method *that = resource->input_method_object; - that->m_resource_map.erase(resource->client()); - that->input_method_destroy_resource(resource); - delete resource; - } - - wl_input_method::Resource *wl_input_method::bind(struct ::wl_client *client, uint32_t id, int version) - { - DS_ASSERT_X(!wl_client_get_object(client, id), "DSWaylandObject bind", "binding to object %u more than once", id); - struct ::wl_resource *handle = wl_resource_create(client, &::wl_input_method_interface, version, id); - return bind(handle); - } - - wl_input_method::Resource *wl_input_method::bind(struct ::wl_resource *handle) - { - Resource *resource = input_method_allocate(); - resource->input_method_object = this; - - wl_resource_set_implementation(handle, NULL, resource, destroy_func); - resource->handle = handle; - input_method_bind_resource(resource); - return resource; - } - wl_input_method::Resource *wl_input_method::Resource::fromResource(struct ::wl_resource *resource) - { - if (DS_UNLIKELY(!resource)) - return NULL; - if (wl_resource_instance_of(resource, &::wl_input_method_interface, NULL)) - return static_cast(wl_resource_get_user_data(resource)); - return NULL; - } - - void wl_input_method::send_activate(struct ::wl_resource *id, uint32_t text_input_id, uint32_t focus_in_event) - { - DS_ASSERT_X(m_resource, "wl_input_method::activate", "Uninitialised resource"); - if (DS_UNLIKELY(!m_resource)) { - WRN("could not call wl_input_method::activate as it's not initialised"); - return; - } - send_activate( - m_resource->handle, - id, - text_input_id, - focus_in_event); - } - - void wl_input_method::send_activate(struct ::wl_resource *resource, struct ::wl_resource *id, uint32_t text_input_id, uint32_t focus_in_event) - { - wl_input_method_send_activate( - resource, - id, - text_input_id, - focus_in_event); - } - - - void wl_input_method::send_deactivate(struct ::wl_resource *context, uint32_t focus_out_event) - { - DS_ASSERT_X(m_resource, "wl_input_method::deactivate", "Uninitialised resource"); - if (DS_UNLIKELY(!m_resource)) { - WRN("could not call wl_input_method::deactivate as it's not initialised"); - return; - } - send_deactivate( - m_resource->handle, - context, - focus_out_event); - } - - void wl_input_method::send_deactivate(struct ::wl_resource *resource, struct ::wl_resource *context, uint32_t focus_out_event) - { - wl_input_method_send_deactivate( - resource, - context, - focus_out_event); - } - - - void wl_input_method::send_destroy(struct ::wl_resource *context) - { - DS_ASSERT_X(m_resource, "wl_input_method::destroy", "Uninitialised resource"); - if (DS_UNLIKELY(!m_resource)) { - WRN("could not call wl_input_method::destroy as it's not initialised"); - return; - } - send_destroy( - m_resource->handle, - context); - } - - void wl_input_method::send_destroy(struct ::wl_resource *resource, struct ::wl_resource *context) - { - wl_input_method_send_destroy( - resource, - context); - } - - - void wl_input_method::send_show_input_panel(struct ::wl_resource *context, uint32_t degree) - { - DS_ASSERT_X(m_resource, "wl_input_method::show_input_panel", "Uninitialised resource"); - if (DS_UNLIKELY(!m_resource)) { - WRN("could not call wl_input_method::show_input_panel as it's not initialised"); - return; - } - send_show_input_panel( - m_resource->handle, - context, - degree); - } - - void wl_input_method::send_show_input_panel(struct ::wl_resource *resource, struct ::wl_resource *context, uint32_t degree) - { - wl_input_method_send_show_input_panel( - resource, - context, - degree); - } - - - void wl_input_method::send_hide_input_panel(struct ::wl_resource *context) - { - DS_ASSERT_X(m_resource, "wl_input_method::hide_input_panel", "Uninitialised resource"); - if (DS_UNLIKELY(!m_resource)) { - WRN("could not call wl_input_method::hide_input_panel as it's not initialised"); - return; - } - send_hide_input_panel( - m_resource->handle, - context); - } - - void wl_input_method::send_hide_input_panel(struct ::wl_resource *resource, struct ::wl_resource *context) - { - wl_input_method_send_hide_input_panel( - resource, - context); - } - - - wl_input_panel::wl_input_panel(struct ::wl_client *client, uint32_t id, int version) - : m_resource_map() - , m_resource(NULL) - , m_global(NULL) - , m_globalVersion(0) - , m_displayDestroyedListener() - { - init(client, id, version); - } - - wl_input_panel::wl_input_panel(struct ::wl_display *display, int version) - : m_resource_map() - , m_resource(NULL) - , m_global(NULL) - , m_globalVersion(0) - , m_displayDestroyedListener() - { - init(display, version); - } - - wl_input_panel::wl_input_panel(struct ::wl_resource *resource) - : m_resource_map() - , m_resource(NULL) - , m_global(NULL) - , m_globalVersion(0) - , m_displayDestroyedListener() - { - init(resource); - } - - wl_input_panel::wl_input_panel() - : m_resource_map() - , m_resource(NULL) - , m_global(NULL) - , m_globalVersion(0) - , m_displayDestroyedListener() - { - } - - wl_input_panel::~wl_input_panel() - { - std::multimap::iterator it; - for (it = m_resource_map.begin() ; it != m_resource_map.end() ; it++) { - wl_input_panel::Resource *resource = (*it).second; - wl_resource_set_implementation(resource->handle, NULL, NULL, NULL); - } - - if (m_global) { - wl_global_destroy(m_global); - wl_list_remove(&m_displayDestroyedListener.link); - } - } - - void wl_input_panel::init(struct ::wl_client *client, uint32_t id, int version) - { - m_resource = bind(client, id, version); - } - - void wl_input_panel::init(struct ::wl_resource *resource) - { - m_resource = bind(resource); - } - - wl_input_panel::Resource *wl_input_panel::add(struct ::wl_client *client, int version) - { - Resource *resource = bind(client, 0, version); - m_resource_map.insert(std::pair(client, resource)); - return resource; - } - - wl_input_panel::Resource *wl_input_panel::add(struct ::wl_client *client, uint32_t id, int version) - { - Resource *resource = bind(client, id, version); - m_resource_map.insert(std::pair(client, resource)); - return resource; - } - - void wl_input_panel::init(struct ::wl_display *display, int version) - { - m_global = wl_global_create(display, &::wl_input_panel_interface, version, this, bind_func); - m_globalVersion = version; - m_displayDestroyedListener.notify = wl_input_panel::display_destroy_func; - m_displayDestroyedListener.parent = this; - wl_display_add_destroy_listener(display, &m_displayDestroyedListener); - } - - const struct wl_interface *wl_input_panel::interface() - { - return &::wl_input_panel_interface; - } - - wl_input_panel::Resource *wl_input_panel::input_panel_allocate() - { - return new Resource; - } - - void wl_input_panel::input_panel_bind_resource(Resource *) - { - } - - void wl_input_panel::input_panel_destroy_resource(Resource *) - { - } - - void wl_input_panel::bind_func(struct ::wl_client *client, void *data, uint32_t version, uint32_t id) - { - wl_input_panel *that = static_cast(data); - that->add(client, id, std::min(that->m_globalVersion, version)); - } - - void wl_input_panel::display_destroy_func(struct ::wl_listener *listener, void *data) - { - DS_UNUSED(data); - wl_input_panel *that = static_cast(listener)->parent; - that->m_global = NULL; - } - - void wl_input_panel::destroy_func(struct ::wl_resource *client_resource) - { - Resource *resource = Resource::fromResource(client_resource); - DS_ASSERT(resource); - wl_input_panel *that = resource->input_panel_object; - that->m_resource_map.erase(resource->client()); - that->input_panel_destroy_resource(resource); - delete resource; - } - - wl_input_panel::Resource *wl_input_panel::bind(struct ::wl_client *client, uint32_t id, int version) - { - DS_ASSERT_X(!wl_client_get_object(client, id), "DSWaylandObject bind", "binding to object %u more than once", id); - struct ::wl_resource *handle = wl_resource_create(client, &::wl_input_panel_interface, version, id); - return bind(handle); - } - - wl_input_panel::Resource *wl_input_panel::bind(struct ::wl_resource *handle) - { - Resource *resource = input_panel_allocate(); - resource->input_panel_object = this; - - wl_resource_set_implementation(handle, &m_wl_input_panel_interface, resource, destroy_func); - resource->handle = handle; - input_panel_bind_resource(resource); - return resource; - } - wl_input_panel::Resource *wl_input_panel::Resource::fromResource(struct ::wl_resource *resource) - { - if (DS_UNLIKELY(!resource)) - return NULL; - if (wl_resource_instance_of(resource, &::wl_input_panel_interface, &m_wl_input_panel_interface)) - return static_cast(wl_resource_get_user_data(resource)); - return NULL; - } - - const struct ::wl_input_panel_interface wl_input_panel::m_wl_input_panel_interface = { - wl_input_panel::handle_get_input_panel_surface - }; - - void wl_input_panel::input_panel_get_input_panel_surface(Resource *, uint32_t, struct ::wl_resource *) - { - } - - - void wl_input_panel::handle_get_input_panel_surface( - ::wl_client *client, - struct wl_resource *resource, - uint32_t id, - struct ::wl_resource *surface) - { - DS_UNUSED(client); - Resource *r = Resource::fromResource(resource); - static_cast(r->input_panel_object)->input_panel_get_input_panel_surface( - r, - id, - surface); - } - - wl_input_panel_surface::wl_input_panel_surface(struct ::wl_client *client, uint32_t id, int version) - : m_resource_map() - , m_resource(NULL) - , m_global(NULL) - , m_globalVersion(0) - , m_displayDestroyedListener() - { - init(client, id, version); - } - - wl_input_panel_surface::wl_input_panel_surface(struct ::wl_display *display, int version) - : m_resource_map() - , m_resource(NULL) - , m_global(NULL) - , m_globalVersion(0) - , m_displayDestroyedListener() - { - init(display, version); - } - - wl_input_panel_surface::wl_input_panel_surface(struct ::wl_resource *resource) - : m_resource_map() - , m_resource(NULL) - , m_global(NULL) - , m_globalVersion(0) - , m_displayDestroyedListener() - { - init(resource); - } - - wl_input_panel_surface::wl_input_panel_surface() - : m_resource_map() - , m_resource(NULL) - , m_global(NULL) - , m_globalVersion(0) - , m_displayDestroyedListener() - { - } - - wl_input_panel_surface::~wl_input_panel_surface() - { - std::multimap::iterator it; - for (it = m_resource_map.begin() ; it != m_resource_map.end() ; it++) { - wl_input_panel_surface::Resource *resource = (*it).second; - wl_resource_set_implementation(resource->handle, NULL, NULL, NULL); - } - - if (m_global) { - wl_global_destroy(m_global); - wl_list_remove(&m_displayDestroyedListener.link); - } - } - - void wl_input_panel_surface::init(struct ::wl_client *client, uint32_t id, int version) - { - m_resource = bind(client, id, version); - } - - void wl_input_panel_surface::init(struct ::wl_resource *resource) - { - m_resource = bind(resource); - } - - wl_input_panel_surface::Resource *wl_input_panel_surface::add(struct ::wl_client *client, int version) - { - Resource *resource = bind(client, 0, version); - m_resource_map.insert(std::pair(client, resource)); - return resource; - } - - wl_input_panel_surface::Resource *wl_input_panel_surface::add(struct ::wl_client *client, uint32_t id, int version) - { - Resource *resource = bind(client, id, version); - m_resource_map.insert(std::pair(client, resource)); - return resource; - } - - void wl_input_panel_surface::init(struct ::wl_display *display, int version) - { - m_global = wl_global_create(display, &::wl_input_panel_surface_interface, version, this, bind_func); - m_globalVersion = version; - m_displayDestroyedListener.notify = wl_input_panel_surface::display_destroy_func; - m_displayDestroyedListener.parent = this; - wl_display_add_destroy_listener(display, &m_displayDestroyedListener); - } - - const struct wl_interface *wl_input_panel_surface::interface() - { - return &::wl_input_panel_surface_interface; - } - - wl_input_panel_surface::Resource *wl_input_panel_surface::input_panel_surface_allocate() - { - return new Resource; - } - - void wl_input_panel_surface::input_panel_surface_bind_resource(Resource *) - { - } - - void wl_input_panel_surface::input_panel_surface_destroy_resource(Resource *) - { - } - - void wl_input_panel_surface::bind_func(struct ::wl_client *client, void *data, uint32_t version, uint32_t id) - { - wl_input_panel_surface *that = static_cast(data); - that->add(client, id, std::min(that->m_globalVersion, version)); - } - - void wl_input_panel_surface::display_destroy_func(struct ::wl_listener *listener, void *data) - { - DS_UNUSED(data); - wl_input_panel_surface *that = static_cast(listener)->parent; - that->m_global = NULL; - } - - void wl_input_panel_surface::destroy_func(struct ::wl_resource *client_resource) - { - Resource *resource = Resource::fromResource(client_resource); - DS_ASSERT(resource); - wl_input_panel_surface *that = resource->input_panel_surface_object; - that->m_resource_map.erase(resource->client()); - that->input_panel_surface_destroy_resource(resource); - delete resource; - } - - wl_input_panel_surface::Resource *wl_input_panel_surface::bind(struct ::wl_client *client, uint32_t id, int version) - { - DS_ASSERT_X(!wl_client_get_object(client, id), "DSWaylandObject bind", "binding to object %u more than once", id); - struct ::wl_resource *handle = wl_resource_create(client, &::wl_input_panel_surface_interface, version, id); - return bind(handle); - } - - wl_input_panel_surface::Resource *wl_input_panel_surface::bind(struct ::wl_resource *handle) - { - Resource *resource = input_panel_surface_allocate(); - resource->input_panel_surface_object = this; - - wl_resource_set_implementation(handle, &m_wl_input_panel_surface_interface, resource, destroy_func); - resource->handle = handle; - input_panel_surface_bind_resource(resource); - return resource; - } - wl_input_panel_surface::Resource *wl_input_panel_surface::Resource::fromResource(struct ::wl_resource *resource) - { - if (DS_UNLIKELY(!resource)) - return NULL; - if (wl_resource_instance_of(resource, &::wl_input_panel_surface_interface, &m_wl_input_panel_surface_interface)) - return static_cast(wl_resource_get_user_data(resource)); - return NULL; - } - - const struct ::wl_input_panel_surface_interface wl_input_panel_surface::m_wl_input_panel_surface_interface = { - wl_input_panel_surface::handle_set_toplevel, - wl_input_panel_surface::handle_set_overlay_panel, - wl_input_panel_surface::handle_set_ready - }; - - void wl_input_panel_surface::input_panel_surface_set_toplevel(Resource *, struct ::wl_resource *, uint32_t ) - { - } - - void wl_input_panel_surface::input_panel_surface_set_overlay_panel(Resource *) - { - } - - void wl_input_panel_surface::input_panel_surface_set_ready(Resource *, uint32_t ) - { - } - - - void wl_input_panel_surface::handle_set_toplevel( - ::wl_client *client, - struct wl_resource *resource, - struct ::wl_resource *output, - uint32_t position) - { - DS_UNUSED(client); - Resource *r = Resource::fromResource(resource); - static_cast(r->input_panel_surface_object)->input_panel_surface_set_toplevel( - r, - output, - position); - } - - void wl_input_panel_surface::handle_set_overlay_panel( - ::wl_client *client, - struct wl_resource *resource) - { - DS_UNUSED(client); - Resource *r = Resource::fromResource(resource); - static_cast(r->input_panel_surface_object)->input_panel_surface_set_overlay_panel( - r); - } - - void wl_input_panel_surface::handle_set_ready( - ::wl_client *client, - struct wl_resource *resource, - uint32_t state) - { - DS_UNUSED(client); - Resource *r = Resource::fromResource(resource); - static_cast(r->input_panel_surface_object)->input_panel_surface_set_ready( - r, - state); - } - - wl_input_method_manager::wl_input_method_manager(struct ::wl_client *client, uint32_t id, int version) - : m_resource_map() - , m_resource(NULL) - , m_global(NULL) - , m_globalVersion(0) - , m_displayDestroyedListener() - { - init(client, id, version); - } - - wl_input_method_manager::wl_input_method_manager(struct ::wl_display *display, int version) - : m_resource_map() - , m_resource(NULL) - , m_global(NULL) - , m_globalVersion(0) - , m_displayDestroyedListener() - { - init(display, version); - } - - wl_input_method_manager::wl_input_method_manager(struct ::wl_resource *resource) - : m_resource_map() - , m_resource(NULL) - , m_global(NULL) - , m_globalVersion(0) - , m_displayDestroyedListener() - { - init(resource); - } - - wl_input_method_manager::wl_input_method_manager() - : m_resource_map() - , m_resource(NULL) - , m_global(NULL) - , m_globalVersion(0) - , m_displayDestroyedListener() - { - } - - wl_input_method_manager::~wl_input_method_manager() - { - std::multimap::iterator it; - for (it = m_resource_map.begin() ; it != m_resource_map.end() ; it++) { - wl_input_method_manager::Resource *resource = (*it).second; - wl_resource_set_implementation(resource->handle, NULL, NULL, NULL); - } - - if (m_global) { - wl_global_destroy(m_global); - wl_list_remove(&m_displayDestroyedListener.link); - } - } - - void wl_input_method_manager::init(struct ::wl_client *client, uint32_t id, int version) - { - m_resource = bind(client, id, version); - } - - void wl_input_method_manager::init(struct ::wl_resource *resource) - { - m_resource = bind(resource); - } - - wl_input_method_manager::Resource *wl_input_method_manager::add(struct ::wl_client *client, int version) - { - Resource *resource = bind(client, 0, version); - m_resource_map.insert(std::pair(client, resource)); - return resource; - } - - wl_input_method_manager::Resource *wl_input_method_manager::add(struct ::wl_client *client, uint32_t id, int version) - { - Resource *resource = bind(client, id, version); - m_resource_map.insert(std::pair(client, resource)); - return resource; - } - - void wl_input_method_manager::init(struct ::wl_display *display, int version) - { - m_global = wl_global_create(display, &::wl_input_method_manager_interface, version, this, bind_func); - m_globalVersion = version; - m_displayDestroyedListener.notify = wl_input_method_manager::display_destroy_func; - m_displayDestroyedListener.parent = this; - wl_display_add_destroy_listener(display, &m_displayDestroyedListener); - } - - const struct wl_interface *wl_input_method_manager::interface() - { - return &::wl_input_method_manager_interface; - } - - wl_input_method_manager::Resource *wl_input_method_manager::input_method_manager_allocate() - { - return new Resource; - } - - void wl_input_method_manager::input_method_manager_bind_resource(Resource *) - { - } - - void wl_input_method_manager::input_method_manager_destroy_resource(Resource *) - { - } - - void wl_input_method_manager::bind_func(struct ::wl_client *client, void *data, uint32_t version, uint32_t id) - { - wl_input_method_manager *that = static_cast(data); - that->add(client, id, std::min(that->m_globalVersion, version)); - } - - void wl_input_method_manager::display_destroy_func(struct ::wl_listener *listener, void *data) - { - DS_UNUSED(data); - wl_input_method_manager *that = static_cast(listener)->parent; - that->m_global = NULL; - } - - void wl_input_method_manager::destroy_func(struct ::wl_resource *client_resource) - { - Resource *resource = Resource::fromResource(client_resource); - DS_ASSERT(resource); - wl_input_method_manager *that = resource->input_method_manager_object; - that->m_resource_map.erase(resource->client()); - that->input_method_manager_destroy_resource(resource); - delete resource; - } - - wl_input_method_manager::Resource *wl_input_method_manager::bind(struct ::wl_client *client, uint32_t id, int version) - { - DS_ASSERT_X(!wl_client_get_object(client, id), "DSWaylandObject bind", "binding to object %u more than once", id); - struct ::wl_resource *handle = wl_resource_create(client, &::wl_input_method_manager_interface, version, id); - return bind(handle); - } - - wl_input_method_manager::Resource *wl_input_method_manager::bind(struct ::wl_resource *handle) - { - Resource *resource = input_method_manager_allocate(); - resource->input_method_manager_object = this; - - wl_resource_set_implementation(handle, &m_wl_input_method_manager_interface, resource, destroy_func); - resource->handle = handle; - input_method_manager_bind_resource(resource); - return resource; - } - wl_input_method_manager::Resource *wl_input_method_manager::Resource::fromResource(struct ::wl_resource *resource) - { - if (DS_UNLIKELY(!resource)) - return NULL; - if (wl_resource_instance_of(resource, &::wl_input_method_manager_interface, &m_wl_input_method_manager_interface)) - return static_cast(wl_resource_get_user_data(resource)); - return NULL; - } - - const struct ::wl_input_method_manager_interface wl_input_method_manager::m_wl_input_method_manager_interface = { - wl_input_method_manager::handle_set_transient_for - }; - - void wl_input_method_manager::input_method_manager_set_transient_for(Resource *, uint32_t , uint32_t ) - { - } - - - void wl_input_method_manager::handle_set_transient_for( - ::wl_client *client, - struct wl_resource *resource, - uint32_t parent_pid, - uint32_t child_pid) - { - DS_UNUSED(client); - Resource *r = Resource::fromResource(resource); - static_cast(r->input_method_manager_object)->input_method_manager_set_transient_for( - r, - parent_pid, - child_pid); - } -} - -/*LCOV_EXCL_STOP*/ diff --git a/src/DSWaylandServer/dswayland-server-tizen-extension.cpp b/src/DSWaylandServer/dswayland-server-tizen-extension.cpp index 3236c91..499087a 100644 --- a/src/DSWaylandServer/dswayland-server-tizen-extension.cpp +++ b/src/DSWaylandServer/dswayland-server-tizen-extension.cpp @@ -605,7 +605,9 @@ namespace DSWaylandServer { tizen_policy::handle_has_video, tizen_policy::handle_set_appid, tizen_policy::handle_show, - tizen_policy::handle_hide + tizen_policy::handle_hide, + tizen_policy::handle_set_transient_for_below, + tizen_policy::handle_set_parent_with_below }; void tizen_policy::tizen_policy_get_visibility(Resource *, uint32_t, struct ::wl_resource *) @@ -776,6 +778,14 @@ namespace DSWaylandServer { { } + void tizen_policy::tizen_policy_set_transient_for_below(Resource *, uint32_t , uint32_t ) + { + } + + void tizen_policy::tizen_policy_set_parent_with_below(Resource *, struct ::wl_resource *, struct ::wl_resource *) + { + } + void tizen_policy::handle_get_visibility( ::wl_client *client, @@ -1327,6 +1337,34 @@ namespace DSWaylandServer { surface); } + void tizen_policy::handle_set_transient_for_below( + ::wl_client *client, + struct wl_resource *resource, + uint32_t child_id, + uint32_t parent_id) + { + DS_UNUSED(client); + Resource *r = Resource::fromResource(resource); + static_cast(r->tizen_policy_object)->tizen_policy_set_transient_for_below( + r, + child_id, + parent_id); + } + + void tizen_policy::handle_set_parent_with_below( + ::wl_client *client, + struct wl_resource *resource, + struct ::wl_resource *child, + struct ::wl_resource *parent) + { + DS_UNUSED(client); + Resource *r = Resource::fromResource(resource); + static_cast(r->tizen_policy_object)->tizen_policy_set_parent_with_below( + r, + child, + parent); + } + void tizen_policy::send_conformant(struct ::wl_resource *surface, uint32_t is_conformant) { DS_ASSERT_X(m_resource, "tizen_policy::conformant", "Uninitialised resource"); @@ -1579,6 +1617,62 @@ namespace DSWaylandServer { } + void tizen_policy::send_interactive_move_done(struct ::wl_resource *surface, int32_t x, int32_t y, uint32_t w, uint32_t h) + { + DS_ASSERT_X(m_resource, "tizen_policy::interactive_move_done", "Uninitialised resource"); + if (DS_UNLIKELY(!m_resource)) { + WRN("could not call tizen_policy::interactive_move_done as it's not initialised"); + return; + } + send_interactive_move_done( + m_resource->handle, + surface, + x, + y, + w, + h); + } + + void tizen_policy::send_interactive_move_done(struct ::wl_resource *resource, struct ::wl_resource *surface, int32_t x, int32_t y, uint32_t w, uint32_t h) + { + tizen_policy_send_interactive_move_done( + resource, + surface, + x, + y, + w, + h); + } + + + void tizen_policy::send_interactive_resize_done(struct ::wl_resource *surface, int32_t x, int32_t y, uint32_t w, uint32_t h) + { + DS_ASSERT_X(m_resource, "tizen_policy::interactive_resize_done", "Uninitialised resource"); + if (DS_UNLIKELY(!m_resource)) { + WRN("could not call tizen_policy::interactive_resize_done as it's not initialised"); + return; + } + send_interactive_resize_done( + m_resource->handle, + surface, + x, + y, + w, + h); + } + + void tizen_policy::send_interactive_resize_done(struct ::wl_resource *resource, struct ::wl_resource *surface, int32_t x, int32_t y, uint32_t w, uint32_t h) + { + tizen_policy_send_interactive_resize_done( + resource, + surface, + x, + y, + w, + h); + } + + tizen_visibility::tizen_visibility(struct ::wl_client *client, uint32_t id, int version) : m_resource_map() , m_resource(NULL) @@ -3802,7 +3896,8 @@ namespace DSWaylandServer { tizen_screenmirror::handle_queue, tizen_screenmirror::handle_dequeue, tizen_screenmirror::handle_start, - tizen_screenmirror::handle_stop + tizen_screenmirror::handle_stop, + tizen_screenmirror::handle_set_auto_rotation }; void tizen_screenmirror::tizen_screenmirror_destroy(Resource *) @@ -3829,6 +3924,10 @@ namespace DSWaylandServer { { } + void tizen_screenmirror::tizen_screenmirror_set_auto_rotation(Resource *, uint32_t ) + { + } + void tizen_screenmirror::handle_destroy( ::wl_client *client, @@ -3896,6 +3995,18 @@ namespace DSWaylandServer { r); } + void tizen_screenmirror::handle_set_auto_rotation( + ::wl_client *client, + struct wl_resource *resource, + uint32_t set) + { + DS_UNUSED(client); + Resource *r = Resource::fromResource(resource); + static_cast(r->tizen_screenmirror_object)->tizen_screenmirror_set_auto_rotation( + r, + set); + } + void tizen_screenmirror::send_dequeued(struct ::wl_resource *buffer) { DS_ASSERT_X(m_resource, "tizen_screenmirror::dequeued", "Uninitialised resource"); @@ -8285,4 +8396,4 @@ namespace DSWaylandServer { } } -/*LCOV_EXCL_STOP*/ +/*LCOV_EXCL_STOP*/ \ No newline at end of file diff --git a/src/DSWaylandServer/dswayland-server-tizen-extension.h b/src/DSWaylandServer/dswayland-server-tizen-extension.h index 26b8301..5dd83e3 100644 --- a/src/DSWaylandServer/dswayland-server-tizen-extension.h +++ b/src/DSWaylandServer/dswayland-server-tizen-extension.h @@ -309,6 +309,10 @@ namespace DSWaylandServer { void send_aux_message(struct ::wl_resource *resource, struct ::wl_resource *surface, const std::string &key, const std::string &value, struct ::wl_array *options); void send_conformant_region(struct ::wl_resource *surface, uint32_t conformant_part, uint32_t state, int32_t x, int32_t y, int32_t w, int32_t h, uint32_t serial); void send_conformant_region(struct ::wl_resource *resource, struct ::wl_resource *surface, uint32_t conformant_part, uint32_t state, int32_t x, int32_t y, int32_t w, int32_t h, uint32_t serial); + void send_interactive_move_done(struct ::wl_resource *surface, int32_t x, int32_t y, uint32_t w, uint32_t h); + void send_interactive_move_done(struct ::wl_resource *resource, struct ::wl_resource *surface, int32_t x, int32_t y, uint32_t w, uint32_t h); + void send_interactive_resize_done(struct ::wl_resource *surface, int32_t x, int32_t y, uint32_t w, uint32_t h); + void send_interactive_resize_done(struct ::wl_resource *resource, struct ::wl_resource *surface, int32_t x, int32_t y, uint32_t w, uint32_t h); protected: virtual Resource *tizen_policy_allocate(); @@ -358,6 +362,8 @@ namespace DSWaylandServer { virtual void tizen_policy_set_appid(Resource *resource, int32_t pid, const std::string &appid); virtual void tizen_policy_show(Resource *resource, struct ::wl_resource *surface); virtual void tizen_policy_hide(Resource *resource, struct ::wl_resource *surface); + virtual void tizen_policy_set_transient_for_below(Resource *resource, uint32_t child_id, uint32_t parent_id); + virtual void tizen_policy_set_parent_with_below(Resource *resource, struct ::wl_resource *child, struct ::wl_resource *parent); private: static void bind_func(struct ::wl_client *client, void *data, uint32_t version, uint32_t id); @@ -560,6 +566,16 @@ namespace DSWaylandServer { ::wl_client *client, struct wl_resource *resource, struct ::wl_resource *surface); + static void handle_set_transient_for_below( + ::wl_client *client, + struct wl_resource *resource, + uint32_t child_id, + uint32_t parent_id); + static void handle_set_parent_with_below( + ::wl_client *client, + struct wl_resource *resource, + struct ::wl_resource *child, + struct ::wl_resource *parent); std::multimap m_resource_map; Resource *m_resource; @@ -1421,6 +1437,7 @@ namespace DSWaylandServer { virtual void tizen_screenmirror_dequeue(Resource *resource, struct ::wl_resource *buffer); virtual void tizen_screenmirror_start(Resource *resource); virtual void tizen_screenmirror_stop(Resource *resource); + virtual void tizen_screenmirror_set_auto_rotation(Resource *resource, uint32_t set); private: static void bind_func(struct ::wl_client *client, void *data, uint32_t version, uint32_t id); @@ -1453,6 +1470,10 @@ namespace DSWaylandServer { static void handle_stop( ::wl_client *client, struct wl_resource *resource); + static void handle_set_auto_rotation( + ::wl_client *client, + struct wl_resource *resource, + uint32_t set); std::multimap m_resource_map; Resource *m_resource; @@ -3306,4 +3327,4 @@ namespace DSWaylandServer { } /*LCOV_EXCL_STOP*/ -#endif +#endif \ No newline at end of file diff --git a/src/DSWaylandServer/dswayland-server-tizen-hwc.cpp b/src/DSWaylandServer/dswayland-server-tizen-hwc.cpp index 67b13b6..f4edebf 100644 --- a/src/DSWaylandServer/dswayland-server-tizen-hwc.cpp +++ b/src/DSWaylandServer/dswayland-server-tizen-hwc.cpp @@ -182,14 +182,14 @@ namespace DSWaylandServer { const struct ::tizen_hwc_interface tizen_hwc::m_tizen_hwc_interface = { tizen_hwc::handle_destroy, - tizen_hwc::handle_commit_feedback + tizen_hwc::handle_create_commit_feedback }; void tizen_hwc::tizen_hwc_destroy(Resource *) { } - void tizen_hwc::tizen_hwc_commit_feedback(Resource *, struct ::wl_resource *, uint32_t, uint32_t ) + void tizen_hwc::tizen_hwc_create_commit_feedback(Resource *, struct ::wl_resource *, uint32_t, uint32_t ) { } @@ -204,7 +204,7 @@ namespace DSWaylandServer { r); } - void tizen_hwc::handle_commit_feedback( + void tizen_hwc::handle_create_commit_feedback( ::wl_client *client, struct wl_resource *resource, struct ::wl_resource *surface, @@ -213,7 +213,7 @@ namespace DSWaylandServer { { DS_UNUSED(client); Resource *r = Resource::fromResource(resource); - static_cast(r->tizen_hwc_object)->tizen_hwc_commit_feedback( + static_cast(r->tizen_hwc_object)->tizen_hwc_create_commit_feedback( r, surface, id, @@ -414,4 +414,4 @@ namespace DSWaylandServer { } -/*LCOV_EXCL_STOP*/ +/*LCOV_EXCL_STOP*/ \ No newline at end of file diff --git a/src/DSWaylandServer/dswayland-server-tizen-hwc.h b/src/DSWaylandServer/dswayland-server-tizen-hwc.h index c763bac..56d196c 100644 --- a/src/DSWaylandServer/dswayland-server-tizen-hwc.h +++ b/src/DSWaylandServer/dswayland-server-tizen-hwc.h @@ -76,7 +76,7 @@ namespace DSWaylandServer { virtual void tizen_hwc_destroy_resource(Resource *resource); virtual void tizen_hwc_destroy(Resource *resource); - virtual void tizen_hwc_commit_feedback(Resource *resource, struct ::wl_resource *surface, uint32_t id, uint32_t serial); + virtual void tizen_hwc_create_commit_feedback(Resource *resource, struct ::wl_resource *surface, uint32_t id, uint32_t serial); private: static void bind_func(struct ::wl_client *client, void *data, uint32_t version, uint32_t id); @@ -91,7 +91,7 @@ namespace DSWaylandServer { static void handle_destroy( ::wl_client *client, struct wl_resource *resource); - static void handle_commit_feedback( + static void handle_create_commit_feedback( ::wl_client *client, struct wl_resource *resource, struct ::wl_resource *surface, @@ -189,4 +189,4 @@ namespace DSWaylandServer { } #endif -/*LCOV_EXCL_STOP*/ +/*LCOV_EXCL_STOP*/ \ No newline at end of file diff --git a/src/meson.build b/src/meson.build index 5b39ed4..06c2d12 100644 --- a/src/meson.build +++ b/src/meson.build @@ -98,8 +98,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/dswayland-server-input-method-unstable-v1.cpp', + 'DSWaylandServer/dswayland-server-input-method-unstable-v1.h', 'DSWaylandServer/dswayland-server-tizen-policy-ext.cpp', 'DSWaylandServer/dswayland-server-tizen-policy-ext.h', 'DSWaylandServer/DSWaylandCallback.cpp', -- 2.7.4