[gtk/a11y/stackswitcher-tabs] gizmo: Add a way to set accessible role
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/a11y/stackswitcher-tabs] gizmo: Add a way to set accessible role
- Date: Thu, 15 Oct 2020 00:54:16 +0000 (UTC)
commit 144f549cc620bfe7a01f6f5c835c6bc30fc13ca8
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Oct 14 18:37:14 2020 -0400
gizmo: Add a way to set accessible role
This will be used for some of the gizmo used
inside GtkNotebook.
gtk/gtkgizmo.c | 21 +++++++++++++++++++++
gtk/gtkgizmoprivate.h | 10 ++++++++++
2 files changed, 31 insertions(+)
---
diff --git a/gtk/gtkgizmo.c b/gtk/gtkgizmo.c
index a929248a5c..00162645b3 100644
--- a/gtk/gtkgizmo.c
+++ b/gtk/gtkgizmo.c
@@ -130,9 +130,30 @@ gtk_gizmo_new (const char *css_name,
GtkGizmoContainsFunc contains_func,
GtkGizmoFocusFunc focus_func,
GtkGizmoGrabFocusFunc grab_focus_func)
+{
+ return gtk_gizmo_new_with_role (css_name,
+ GTK_ACCESSIBLE_ROLE_WIDGET,
+ measure_func,
+ allocate_func,
+ snapshot_func,
+ contains_func,
+ focus_func,
+ grab_focus_func);
+}
+
+GtkWidget *
+gtk_gizmo_new_with_role (const char *css_name,
+ GtkAccessibleRole role,
+ GtkGizmoMeasureFunc measure_func,
+ GtkGizmoAllocateFunc allocate_func,
+ GtkGizmoSnapshotFunc snapshot_func,
+ GtkGizmoContainsFunc contains_func,
+ GtkGizmoFocusFunc focus_func,
+ GtkGizmoGrabFocusFunc grab_focus_func)
{
GtkGizmo *gizmo = GTK_GIZMO (g_object_new (GTK_TYPE_GIZMO,
"css-name", css_name,
+ "accessible-role", role,
NULL));
gizmo->measure_func = measure_func;
diff --git a/gtk/gtkgizmoprivate.h b/gtk/gtkgizmoprivate.h
index 478af19971..9257201a59 100644
--- a/gtk/gtkgizmoprivate.h
+++ b/gtk/gtkgizmoprivate.h
@@ -3,6 +3,7 @@
#define __GTK_GIZMO_H__
#include "gtkwidget.h"
+#include "gtkenums.h"
#define GTK_TYPE_GIZMO (gtk_gizmo_get_type ())
#define GTK_GIZMO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_GIZMO, GtkGizmo))
@@ -61,5 +62,14 @@ GtkWidget *gtk_gizmo_new (const char *css_name,
GtkGizmoFocusFunc focus_func,
GtkGizmoGrabFocusFunc grab_focus_func);
+GtkWidget *gtk_gizmo_new_with_role (const char *css_name,
+ GtkAccessibleRole role,
+ GtkGizmoMeasureFunc measure_func,
+ GtkGizmoAllocateFunc allocate_func,
+ GtkGizmoSnapshotFunc snapshot_func,
+ GtkGizmoContainsFunc contains_func,
+ GtkGizmoFocusFunc focus_func,
+ GtkGizmoGrabFocusFunc grab_focus_func);
+
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]