mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-13 04:10:13 +00:00
gizmo: Add a way to set accessible role
This will be used for some of the gizmo used inside GtkNotebook.
This commit is contained in:
parent
512387afcc
commit
984e8ac5e3
@ -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;
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user