Flutter Engine
The Flutter Engine
fl_socket_accessible.cc
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "flutter/shell/platform/linux/fl_socket_accessible.h"
6
7// This is a copy of GtkSocketAccessible, which requires GTK 3.24.30
8
10 GtkContainerAccessible parent;
12};
13
14G_DEFINE_TYPE(FlSocketAccessible,
15 fl_socket_accessible,
16 GTK_TYPE_CONTAINER_ACCESSIBLE)
17
18static AtkObject* fl_socket_accessible_ref_child(AtkObject* object, int i) {
19 FlSocketAccessible* self = FL_SOCKET_ACCESSIBLE(object);
20 return i == 0 ? ATK_OBJECT(g_object_ref(self->accessible_socket)) : nullptr;
21}
22
23static int fl_socket_accessible_get_n_children(AtkObject* object) {
24 return 1;
25}
26
27static void fl_socket_accessible_finalize(GObject* object) {
28 FlSocketAccessible* self = FL_SOCKET_ACCESSIBLE(object);
29
30 g_clear_object(&self->accessible_socket);
31
32 G_OBJECT_CLASS(fl_socket_accessible_parent_class)->finalize(object);
33}
34
35static void fl_socket_accessible_initialize(AtkObject* object, gpointer data) {
36 FlSocketAccessible* self = FL_SOCKET_ACCESSIBLE(object);
37
38 ATK_OBJECT_CLASS(fl_socket_accessible_parent_class)->initialize(object, data);
39
40 self->accessible_socket = atk_socket_new();
41}
42
43static void fl_socket_accessible_class_init(FlSocketAccessibleClass* klass) {
44 GObjectClass* object_class = G_OBJECT_CLASS(klass);
45 object_class->finalize = fl_socket_accessible_finalize;
46
47 AtkObjectClass* atk_class = ATK_OBJECT_CLASS(klass);
48 atk_class->initialize = fl_socket_accessible_initialize;
49 atk_class->get_n_children = fl_socket_accessible_get_n_children;
50 atk_class->ref_child = fl_socket_accessible_ref_child;
51}
52
53static void fl_socket_accessible_init(FlSocketAccessible* self) {}
54
55void fl_socket_accessible_embed(FlSocketAccessible* self, gchar* id) {
56 atk_socket_embed(ATK_SOCKET(self->accessible_socket), id);
57}
void fl_socket_accessible_embed(FlSocketAccessible *self, gchar *id)
static int fl_socket_accessible_get_n_children(AtkObject *object)
static void fl_socket_accessible_init(FlSocketAccessible *self)
static void fl_socket_accessible_class_init(FlSocketAccessibleClass *klass)
static void fl_socket_accessible_initialize(AtkObject *object, gpointer data)
G_DEFINE_TYPE(FlSocketAccessible, fl_socket_accessible, GTK_TYPE_CONTAINER_ACCESSIBLE) static AtkObject *fl_socket_accessible_ref_child(AtkObject *object
static void fl_socket_accessible_finalize(GObject *object)
GtkContainerAccessible parent
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:63