From: Thibault Saunier Date: Tue, 13 Dec 2022 11:23:56 +0000 (+0100) Subject: base:navigation: Cleanup navigation key modifiers enum X-Git-Tag: 1.22.0~162 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f7b342f1dd73eb4d513f344c6e99e6686425bcc4;p=platform%2Fupstream%2Fgstreamer.git base:navigation: Cleanup navigation key modifiers enum We were exposing the 'ALT' modifier as if we were guaranteeing its accuracy but truth is we were only exposing configuration dependent values. Make the API simpler for now, the same way as Gtk3 was exposing it, and when we have time to guarantee more values by making them take backends configuration into account, we will expose those values in a accurate way. Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1402 Part-of: --- diff --git a/subprojects/gst-docs/symbols/symbol_index.json b/subprojects/gst-docs/symbols/symbol_index.json index 1201c5b..ee44bd8 100644 --- a/subprojects/gst-docs/symbols/symbol_index.json +++ b/subprojects/gst-docs/symbols/symbol_index.json @@ -3345,7 +3345,11 @@ "GST_NAVIGATION_MESSAGE_EVENT", "GST_NAVIGATION_MESSAGE_INVALID", "GST_NAVIGATION_MESSAGE_MOUSE_OVER", - "GST_NAVIGATION_MODIFIER_ALT_MASK", + "GST_NAVIGATION_MODIFIER_MOD1_MASK", + "GST_NAVIGATION_MODIFIER_MOD2_MASK", + "GST_NAVIGATION_MODIFIER_MOD3_MASK", + "GST_NAVIGATION_MODIFIER_MOD4_MASK", + "GST_NAVIGATION_MODIFIER_MOD5_MASK", "GST_NAVIGATION_MODIFIER_BUTTON1_MASK", "GST_NAVIGATION_MODIFIER_BUTTON2_MASK", "GST_NAVIGATION_MODIFIER_BUTTON3_MASK", diff --git a/subprojects/gst-plugins-bad/ext/wpe/gstwpevideosrc.cpp b/subprojects/gst-plugins-bad/ext/wpe/gstwpevideosrc.cpp index 812b032..48fbe88 100644 --- a/subprojects/gst-plugins-bad/ext/wpe/gstwpevideosrc.cpp +++ b/subprojects/gst-plugins-bad/ext/wpe/gstwpevideosrc.cpp @@ -578,7 +578,7 @@ _gst_modifiers_to_wpe (GstEvent * ev) modifiers |= wpe_input_keyboard_modifier_control; if (modifier_state & GST_NAVIGATION_MODIFIER_SHIFT_MASK) modifiers |= wpe_input_keyboard_modifier_shift; - if (modifier_state & GST_NAVIGATION_MODIFIER_ALT_MASK) + if (modifier_state & GST_NAVIGATION_MODIFIER_MOD1_MASK) modifiers |= wpe_input_keyboard_modifier_alt; if (modifier_state & GST_NAVIGATION_MODIFIER_META_MASK) modifiers |= wpe_input_keyboard_modifier_meta; diff --git a/subprojects/gst-plugins-base/gst-libs/gst/video/navigation.h b/subprojects/gst-plugins-base/gst-libs/gst/video/navigation.h index ebe16a7..650f582 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/video/navigation.h +++ b/subprojects/gst-plugins-base/gst-libs/gst/video/navigation.h @@ -44,7 +44,11 @@ typedef struct _GstNavigationInterface GstNavigationInterface; * GstNavigationModifierType: * @GST_NAVIGATION_MODIFIER_SHIFT_MASK: the Shift key. * @GST_NAVIGATION_MODIFIER_CONTROL_MASK: the Control key. - * @GST_NAVIGATION_MODIFIER_ALT_MASK: the fourth modifier key + * @GST_NAVIGATION_MODIFIER_MOD1_MASK: the third modifier key + * @GST_NAVIGATION_MODIFIER_MOD2_MASK: the fourth modifier key + * @GST_NAVIGATION_MODIFIER_MOD3_MASK: the fifth modifier key + * @GST_NAVIGATION_MODIFIER_MOD4_MASK: the sixth modifier key + * @GST_NAVIGATION_MODIFIER_MOD5_MASK: the seventh modifier key * @GST_NAVIGATION_MODIFIER_BUTTON1_MASK: the first mouse button (usually the left button). * @GST_NAVIGATION_MODIFIER_BUTTON2_MASK: the second mouse button (usually the right button). * @GST_NAVIGATION_MODIFIER_BUTTON3_MASK: the third mouse button (usually the mouse wheel button or middle button). @@ -69,7 +73,12 @@ typedef enum GST_NAVIGATION_MODIFIER_SHIFT_MASK = 1 << 0, GST_NAVIGATION_MODIFIER_LOCK_MASK = 1 << 1, GST_NAVIGATION_MODIFIER_CONTROL_MASK = 1 << 2, - GST_NAVIGATION_MODIFIER_ALT_MASK = 1 << 3, + + GST_NAVIGATION_MODIFIER_MOD1_MASK = 1 << 3, + GST_NAVIGATION_MODIFIER_MOD2_MASK = 1 << 4, + GST_NAVIGATION_MODIFIER_MOD3_MASK = 1 << 5, + GST_NAVIGATION_MODIFIER_MOD4_MASK = 1 << 6, + GST_NAVIGATION_MODIFIER_MOD5_MASK = 1 << 7, GST_NAVIGATION_MODIFIER_BUTTON1_MASK = 1 << 8, GST_NAVIGATION_MODIFIER_BUTTON2_MASK = 1 << 9, @@ -86,7 +95,11 @@ typedef enum GST_NAVIGATION_MODIFIER_SHIFT_MASK | GST_NAVIGATION_MODIFIER_LOCK_MASK | GST_NAVIGATION_MODIFIER_CONTROL_MASK | - GST_NAVIGATION_MODIFIER_ALT_MASK | + GST_NAVIGATION_MODIFIER_MOD1_MASK | + GST_NAVIGATION_MODIFIER_MOD2_MASK | + GST_NAVIGATION_MODIFIER_MOD3_MASK | + GST_NAVIGATION_MODIFIER_MOD4_MASK | + GST_NAVIGATION_MODIFIER_MOD5_MASK | GST_NAVIGATION_MODIFIER_BUTTON1_MASK | GST_NAVIGATION_MODIFIER_BUTTON2_MASK | GST_NAVIGATION_MODIFIER_BUTTON3_MASK | diff --git a/subprojects/gst-plugins-good/ext/qt/qtitem.cc b/subprojects/gst-plugins-good/ext/qt/qtitem.cc index a8a3aca..70370dd 100644 --- a/subprojects/gst-plugins-good/ext/qt/qtitem.cc +++ b/subprojects/gst-plugins-good/ext/qt/qtitem.cc @@ -436,7 +436,7 @@ translateModifiers(Qt::KeyboardModifiers modifiers) return (GstNavigationModifierType)( ((modifiers & Qt::KeyboardModifier::ShiftModifier) ? GST_NAVIGATION_MODIFIER_SHIFT_MASK : 0) | ((modifiers & Qt::KeyboardModifier::ControlModifier) ? GST_NAVIGATION_MODIFIER_CONTROL_MASK : 0) | - ((modifiers & Qt::KeyboardModifier::AltModifier) ? GST_NAVIGATION_MODIFIER_ALT_MASK : 0) | + ((modifiers & Qt::KeyboardModifier::AltModifier) ? GST_NAVIGATION_MODIFIER_MOD1_MASK : 0) | ((modifiers & Qt::KeyboardModifier::MetaModifier) ? GST_NAVIGATION_MODIFIER_META_MASK : 0)); } diff --git a/subprojects/gst-plugins-good/ext/qt6/qt6glitem.cc b/subprojects/gst-plugins-good/ext/qt6/qt6glitem.cc index dc0abed..a88d212 100644 --- a/subprojects/gst-plugins-good/ext/qt6/qt6glitem.cc +++ b/subprojects/gst-plugins-good/ext/qt6/qt6glitem.cc @@ -419,7 +419,7 @@ translateModifiers(Qt::KeyboardModifiers modifiers) return (GstNavigationModifierType)( ((modifiers & Qt::KeyboardModifier::ShiftModifier) ? GST_NAVIGATION_MODIFIER_SHIFT_MASK : 0) | ((modifiers & Qt::KeyboardModifier::ControlModifier) ? GST_NAVIGATION_MODIFIER_CONTROL_MASK : 0) | - ((modifiers & Qt::KeyboardModifier::AltModifier) ? GST_NAVIGATION_MODIFIER_ALT_MASK : 0) | + ((modifiers & Qt::KeyboardModifier::AltModifier) ? GST_NAVIGATION_MODIFIER_MOD1_MASK : 0) | ((modifiers & Qt::KeyboardModifier::MetaModifier) ? GST_NAVIGATION_MODIFIER_META_MASK : 0)); }