Flutter Linux Embedder
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 
6 
7 // This is a copy of GtkSocketAccessible, which requires GTK 3.24.30
8 
10  GtkContainerAccessible parent;
11  AtkObject* accessible_socket;
12 };
13 
14 G_DEFINE_TYPE(FlSocketAccessible,
15  fl_socket_accessible,
16  GTK_TYPE_CONTAINER_ACCESSIBLE)
17 
18 static 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 
23 static int fl_socket_accessible_get_n_children(AtkObject* object) {
24  return 1;
25 }
26 
27 static 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 
35 static 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 
43 static 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 
53 static void fl_socket_accessible_init(FlSocketAccessible* self) {}
54 
55 void fl_socket_accessible_embed(FlSocketAccessible* self, gchar* id) {
56  atk_socket_embed(ATK_SOCKET(self->accessible_socket), id);
57 }
fl_socket_accessible_get_n_children
static int fl_socket_accessible_get_n_children(AtkObject *object)
Definition: fl_socket_accessible.cc:23
_FlSocketAccessible
Definition: fl_socket_accessible.cc:9
fl_socket_accessible_finalize
static void fl_socket_accessible_finalize(GObject *object)
Definition: fl_socket_accessible.cc:27
_FlSocketAccessible::accessible_socket
AtkObject * accessible_socket
Definition: fl_socket_accessible.cc:11
fl_socket_accessible_init
static void fl_socket_accessible_init(FlSocketAccessible *self)
Definition: fl_socket_accessible.cc:53
_FlSocketAccessible::parent
GtkContainerAccessible parent
Definition: fl_socket_accessible.cc:10
i
int i
Definition: fl_socket_accessible.cc:18
fl_socket_accessible_class_init
static void fl_socket_accessible_class_init(FlSocketAccessibleClass *klass)
Definition: fl_socket_accessible.cc:43
fl_socket_accessible.h
fl_socket_accessible_initialize
static void fl_socket_accessible_initialize(AtkObject *object, gpointer data)
Definition: fl_socket_accessible.cc:35
G_DEFINE_TYPE
G_DEFINE_TYPE(FlSocketAccessible, fl_socket_accessible, GTK_TYPE_CONTAINER_ACCESSIBLE) static AtkObject *fl_socket_accessible_ref_child(AtkObject *object
fl_socket_accessible_embed
void fl_socket_accessible_embed(FlSocketAccessible *self, gchar *id)
Definition: fl_socket_accessible.cc:55