[gtk/a11y/atspi: 42/43] a11y: Add utility function for null refs
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/a11y/atspi: 42/43] a11y: Add utility function for null refs
- Date: Mon, 12 Oct 2020 15:06:46 +0000 (UTC)
commit 9677db56f64d0fd83cfcf8fb1109dd6ac27c4c81
Author: Emmanuele Bassi <ebassi gnome org>
Date: Sat Oct 10 12:51:03 2020 +0100
a11y: Add utility function for null refs
ATSPI was written for CORBA, which allows passing around "nil"
as valid object references.
gtk/a11y/gtkatspicontext.c | 2 +-
gtk/a11y/gtkatspiutils.c | 6 ++++++
gtk/a11y/gtkatspiutilsprivate.h | 3 +++
3 files changed, 10 insertions(+), 1 deletion(-)
---
diff --git a/gtk/a11y/gtkatspicontext.c b/gtk/a11y/gtkatspicontext.c
index b93373db5c..c1448b6e22 100644
--- a/gtk/a11y/gtkatspicontext.c
+++ b/gtk/a11y/gtkatspicontext.c
@@ -426,7 +426,7 @@ handle_accessible_get_property (GDBusConnection *connection,
}
if (res == NULL)
- res = g_variant_new ("(so)", "", "/org/a11y/atspi/null");
+ res = gtk_at_spi_null_ref ();
}
else if (g_strcmp0 (property_name, "ChildCount") == 0)
{
diff --git a/gtk/a11y/gtkatspiutils.c b/gtk/a11y/gtkatspiutils.c
index 4233904bb5..7a572ee41f 100644
--- a/gtk/a11y/gtkatspiutils.c
+++ b/gtk/a11y/gtkatspiutils.c
@@ -275,3 +275,9 @@ gtk_accessible_role_to_atspi_role (GtkAccessibleRole role)
return GTK_ACCESSIBLE_ROLE_WIDGET;
}
+
+GVariant *
+gtk_at_spi_null_ref (void)
+{
+ return g_variant_new ("(so)", "", "/org/a11y/atspi/null");
+}
diff --git a/gtk/a11y/gtkatspiutilsprivate.h b/gtk/a11y/gtkatspiutilsprivate.h
index b882585a01..6d4f661026 100644
--- a/gtk/a11y/gtkatspiutilsprivate.h
+++ b/gtk/a11y/gtkatspiutilsprivate.h
@@ -26,4 +26,7 @@ G_BEGIN_DECLS
AtspiRole
gtk_accessible_role_to_atspi_role (GtkAccessibleRole role);
+GVariant *
+gtk_at_spi_null_ref (void);
+
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]