Flutter Engine
The Flutter Engine
|
#include "flutter/shell/platform/linux/fl_keyboard_manager.h"
#include <array>
#include <cinttypes>
#include <memory>
#include <string>
#include "flutter/shell/platform/linux/fl_key_channel_responder.h"
#include "flutter/shell/platform/linux/fl_key_embedder_responder.h"
#include "flutter/shell/platform/linux/key_mapping.h"
#include "flutter/shell/platform/linux/public/flutter_linux/fl_method_channel.h"
#include "flutter/shell/platform/linux/public/flutter_linux/fl_standard_method_codec.h"
Go to the source code of this file.
Classes | |
struct | _FlKeyboardPendingEvent |
struct | _FlKeyboardManagerUserData |
struct | _FlKeyboardManager |
Macros | |
#define | DEBUG_PRINT_LAYOUT |
#define | FL_TYPE_KEYBOARD_MANAGER_USER_DATA fl_keyboard_manager_user_data_get_type() |
Functions | |
G_DECLARE_FINAL_TYPE (FlKeyboardPendingEvent, fl_keyboard_pending_event, FL, KEYBOARD_PENDING_EVENT, GObject) | |
G_DECLARE_FINAL_TYPE (FlKeyboardManagerUserData, fl_keyboard_manager_user_data, FL, KEYBOARD_MANAGER_USER_DATA, GObject) | |
static uint64_t | get_logical_key_from_layout (const FlKeyEvent *event, const DerivedLayout &layout) |
static void | fl_keyboard_pending_event_dispose (GObject *object) |
static void | fl_keyboard_pending_event_class_init (FlKeyboardPendingEventClass *klass) |
static void | fl_keyboard_pending_event_init (FlKeyboardPendingEvent *self) |
static uint64_t | fl_keyboard_manager_get_event_hash (FlKeyEvent *event) |
static FlKeyboardPendingEvent * | fl_keyboard_pending_event_new (std::unique_ptr< FlKeyEvent > event, uint64_t sequence_id, size_t to_reply) |
G_DEFINE_TYPE (FlKeyboardManagerUserData, fl_keyboard_manager_user_data, G_TYPE_OBJECT) static void fl_keyboard_manager_user_data_dispose(GObject *object) | |
static void | fl_keyboard_manager_user_data_class_init (FlKeyboardManagerUserDataClass *klass) |
static void | fl_keyboard_manager_user_data_init (FlKeyboardManagerUserData *self) |
static FlKeyboardManagerUserData * | fl_keyboard_manager_user_data_new (FlKeyboardManager *manager, uint64_t sequence_id) |
G_DEFINE_TYPE (FlKeyboardManager, fl_keyboard_manager, G_TYPE_OBJECT) | |
static void | fl_keyboard_manager_dispose (GObject *object) |
static void | fl_keyboard_manager_class_init (FlKeyboardManagerClass *klass) |
static void | fl_keyboard_manager_init (FlKeyboardManager *self) |
static gboolean | g_ptr_array_find_with_equal_func1 (GPtrArray *haystack, gconstpointer needle, GEqualFunc equal_func, guint *index_) |
static gboolean | compare_pending_by_sequence_id (gconstpointer pending, gconstpointer needle_sequence_id) |
static gboolean | compare_pending_by_hash (gconstpointer pending, gconstpointer needle_hash) |
static bool | fl_keyboard_manager_remove_redispatched (FlKeyboardManager *self, uint64_t hash) |
static void | responder_handle_event_callback (bool handled, gpointer user_data_ptr) |
static uint16_t | convert_key_to_char (FlKeyboardViewDelegate *view_delegate, guint keycode, gint group, gint level) |
static void | guarantee_layout (FlKeyboardManager *self, FlKeyEvent *event) |
FlMethodResponse * | get_keyboard_state (FlKeyboardManager *self) |
static void | method_call_handler (FlMethodChannel *channel, FlMethodCall *method_call, gpointer user_data) |
FlKeyboardManager * | fl_keyboard_manager_new (FlBinaryMessenger *messenger, FlKeyboardViewDelegate *view_delegate) |
static void | dispatch_to_responder (gpointer responder_data, gpointer foreach_data_ptr) |
gboolean | fl_keyboard_manager_handle_event (FlKeyboardManager *self, FlKeyEvent *event) |
gboolean | fl_keyboard_manager_is_state_clear (FlKeyboardManager *self) |
void | fl_keyboard_manager_sync_modifier_if_needed (FlKeyboardManager *self, guint state, double event_time) |
GHashTable * | fl_keyboard_manager_get_pressed_state (FlKeyboardManager *self) |
Variables | |
static constexpr char | kChannelName [] = "flutter/keyboard" |
static constexpr char | kGetKeyboardStateMethod [] = "getKeyboardState" |
#define DEBUG_PRINT_LAYOUT |
Definition at line 20 of file fl_keyboard_manager.cc.
#define FL_TYPE_KEYBOARD_MANAGER_USER_DATA fl_keyboard_manager_user_data_get_type() |
Definition at line 33 of file fl_keyboard_manager.cc.
|
static |
Definition at line 392 of file fl_keyboard_manager.cc.
|
static |
Definition at line 382 of file fl_keyboard_manager.cc.
|
static |
Definition at line 456 of file fl_keyboard_manager.cc.
|
static |
Definition at line 628 of file fl_keyboard_manager.cc.
|
static |
Definition at line 304 of file fl_keyboard_manager.cc.
|
static |
Definition at line 330 of file fl_keyboard_manager.cc.
|
static |
Definition at line 168 of file fl_keyboard_manager.cc.
GHashTable * fl_keyboard_manager_get_pressed_state | ( | FlKeyboardManager * | manager | ) |
fl_keyboard_manager_get_pressed_state: @manager: the FlKeyboardManager self.
Returns the keyboard pressed state. The hash table contains one entry per pressed keys, mapping from the logical key to the physical key.*
Definition at line 688 of file fl_keyboard_manager.cc.
gboolean fl_keyboard_manager_handle_event | ( | FlKeyboardManager * | manager, |
FlKeyEvent * | event | ||
) |
fl_keyboard_manager_handle_event: @manager: the FlKeyboardManager self. @event: the event to be dispatched. It is usually a wrap of a GdkEventKey. This event will be managed and released by FlKeyboardManager.
Make the manager process a system key event. This might eventually send messages to the framework, trigger text input effects, or redispatch the event back to the system.
Definition at line 638 of file fl_keyboard_manager.cc.
|
static |
Definition at line 308 of file fl_keyboard_manager.cc.
gboolean fl_keyboard_manager_is_state_clear | ( | FlKeyboardManager * | manager | ) |
fl_keyboard_manager_is_state_clear: @manager: the FlKeyboardManager self.
A debug-only method that queries whether the manager's various states are cleared, i.e. no pending events for redispatching or for responding.
Returns: true if the manager's various states are cleared.
Definition at line 669 of file fl_keyboard_manager.cc.
FlKeyboardManager * fl_keyboard_manager_new | ( | FlBinaryMessenger * | messenger, |
FlKeyboardViewDelegate * | view_delegate | ||
) |
FlKeyboardManager:
Processes keyboard events and cooperate with TextInputPlugin
.
A keyboard event goes through a few sections, each can choose to handle the event, and only unhandled events can move to the next section:
TextInputPlugin
) and are handled synchronously.Create a new FlKeyboardManager.
Returns: a new FlKeyboardManager.
Definition at line 585 of file fl_keyboard_manager.cc.
|
static |
Definition at line 402 of file fl_keyboard_manager.cc.
void fl_keyboard_manager_sync_modifier_if_needed | ( | FlKeyboardManager * | manager, |
guint | state, | ||
double | event_time | ||
) |
fl_keyboard_manager_sync_modifier_if_needed: @manager: the FlKeyboardManager self. @state: the state of the modifiers mask. @event_time: the time attribute of the incoming GDK event.
If needed, synthesize modifier keys up and down event by comparing their current pressing states with the given modifiers mask.
Definition at line 675 of file fl_keyboard_manager.cc.
|
static |
Definition at line 229 of file fl_keyboard_manager.cc.
|
static |
Definition at line 234 of file fl_keyboard_manager.cc.
|
static |
Definition at line 238 of file fl_keyboard_manager.cc.
|
static |
Definition at line 159 of file fl_keyboard_manager.cc.
|
static |
Definition at line 147 of file fl_keyboard_manager.cc.
|
static |
Definition at line 164 of file fl_keyboard_manager.cc.
|
static |
Definition at line 184 of file fl_keyboard_manager.cc.
G_DECLARE_FINAL_TYPE | ( | FlKeyboardManagerUserData | , |
fl_keyboard_manager_user_data | , | ||
FL | , | ||
KEYBOARD_MANAGER_USER_DATA | , | ||
GObject | |||
) |
G_DECLARE_FINAL_TYPE | ( | FlKeyboardPendingEvent | , |
fl_keyboard_pending_event | , | ||
FL | , | ||
KEYBOARD_PENDING_EVENT | , | ||
GObject | |||
) |
G_DEFINE_TYPE | ( | FlKeyboardManager | , |
fl_keyboard_manager | , | ||
G_TYPE_OBJECT | |||
) |
G_DEFINE_TYPE | ( | FlKeyboardManagerUserData | , |
fl_keyboard_manager_user_data | , | ||
G_TYPE_OBJECT | |||
) |
Definition at line 215 of file fl_keyboard_manager.cc.
|
static |
Definition at line 359 of file fl_keyboard_manager.cc.
FlMethodResponse * get_keyboard_state | ( | FlKeyboardManager * | self | ) |
Definition at line 544 of file fl_keyboard_manager.cc.
|
static |
Definition at line 97 of file fl_keyboard_manager.cc.
|
static |
Definition at line 468 of file fl_keyboard_manager.cc.
|
static |
Definition at line 565 of file fl_keyboard_manager.cc.
|
static |
Definition at line 418 of file fl_keyboard_manager.cc.
|
staticconstexpr |
Definition at line 22 of file fl_keyboard_manager.cc.
|
staticconstexpr |
Definition at line 23 of file fl_keyboard_manager.cc.