mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-14 14:20:21 +00:00
inspector: Show a11y information
Show a tab for accessibility information. This shows the role and the accessible attributes (states, properties, relations). For now, changing the values is not possible, and we only show the explicitly set values. In the future, we want to show the attributes that are relevant for the role, regardless of whether they are set or not, and allow changing some of the attributes (the ones that are not fully managed by GTK itself).
This commit is contained in:
parent
ecc329fa2a
commit
42a4940671
464
gtk/inspector/a11y.c
Normal file
464
gtk/inspector/a11y.c
Normal file
@ -0,0 +1,464 @@
|
||||
/*
|
||||
* Copyright (c) 2020 Red Hat, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include <glib/gi18n-lib.h>
|
||||
|
||||
#include "a11y.h"
|
||||
#include "window.h"
|
||||
|
||||
#include "gtktypebuiltins.h"
|
||||
#include "gtklabel.h"
|
||||
#include "gtkstack.h"
|
||||
#include "gtkbinlayout.h"
|
||||
#include "gtkaccessibleprivate.h"
|
||||
#include "gtkaccessiblevalueprivate.h"
|
||||
#include "gtkatcontextprivate.h"
|
||||
#include "gtkcolumnview.h"
|
||||
#include "gtksignallistitemfactory.h"
|
||||
#include "gtklistitem.h"
|
||||
#include "gtknoselection.h"
|
||||
#include "gtkfilterlistmodel.h"
|
||||
#include "gtkboolfilter.h"
|
||||
|
||||
typedef enum {
|
||||
STATE,
|
||||
PROPERTY,
|
||||
RELATION
|
||||
} AttributeKind;
|
||||
|
||||
typedef struct _AccessibleAttribute AccessibleAttribute;
|
||||
typedef struct _AccessibleAttributeClass AccessibleAttributeClass;
|
||||
|
||||
struct _AccessibleAttribute
|
||||
{
|
||||
GObject parent_instance;
|
||||
AttributeKind kind;
|
||||
int attribute;
|
||||
char *name;
|
||||
gboolean is_default;
|
||||
GtkAccessibleValue *value;
|
||||
};
|
||||
|
||||
struct _AccessibleAttributeClass
|
||||
{
|
||||
GObjectClass parent_class;
|
||||
};
|
||||
|
||||
enum {
|
||||
PROP_KIND = 1,
|
||||
PROP_ATTRIBUTE,
|
||||
PROP_NAME,
|
||||
PROP_IS_DEFAULT,
|
||||
PROP_VALUE
|
||||
};
|
||||
|
||||
static GType accessible_attribute_get_type (void);
|
||||
|
||||
G_DEFINE_TYPE (AccessibleAttribute, accessible_attribute, G_TYPE_OBJECT);
|
||||
|
||||
static void
|
||||
accessible_attribute_init (AccessibleAttribute *object)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
accessible_attribute_finalize (GObject *object)
|
||||
{
|
||||
AccessibleAttribute *self = (AccessibleAttribute *)object;
|
||||
|
||||
g_free (self->name);
|
||||
gtk_accessible_value_unref (self->value);
|
||||
|
||||
G_OBJECT_CLASS (accessible_attribute_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
accessible_attribute_set_property (GObject *object,
|
||||
guint prop_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
AccessibleAttribute *self = (AccessibleAttribute *)object;
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_KIND:
|
||||
self->kind = g_value_get_uint (value);
|
||||
break;
|
||||
|
||||
case PROP_ATTRIBUTE:
|
||||
self->attribute = g_value_get_uint (value);
|
||||
break;
|
||||
|
||||
case PROP_NAME:
|
||||
g_clear_pointer (&self->name, g_free);
|
||||
self->name = g_value_dup_string (value);
|
||||
break;
|
||||
|
||||
case PROP_IS_DEFAULT:
|
||||
self->is_default = g_value_get_boolean (value);
|
||||
break;
|
||||
|
||||
case PROP_VALUE:
|
||||
g_clear_pointer (&self->value, gtk_accessible_value_unref);
|
||||
self->value = g_value_dup_boxed (value);
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
accessible_attribute_get_property (GObject *object,
|
||||
guint prop_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
AccessibleAttribute *self = (AccessibleAttribute *)object;
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_KIND:
|
||||
g_value_set_uint (value, self->kind);
|
||||
break;
|
||||
|
||||
case PROP_ATTRIBUTE:
|
||||
g_value_set_uint (value, self->attribute);
|
||||
break;
|
||||
|
||||
case PROP_NAME:
|
||||
g_value_set_string (value, self->name);
|
||||
break;
|
||||
|
||||
case PROP_IS_DEFAULT:
|
||||
g_value_set_boolean (value, self->is_default);
|
||||
break;
|
||||
|
||||
case PROP_VALUE:
|
||||
g_value_set_boxed (value, self->value);
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
accessible_attribute_class_init (AccessibleAttributeClass *class)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (class);
|
||||
|
||||
object_class->finalize = accessible_attribute_finalize;
|
||||
object_class->set_property = accessible_attribute_set_property;
|
||||
object_class->get_property = accessible_attribute_get_property;
|
||||
|
||||
g_object_class_install_property (object_class, PROP_KIND,
|
||||
g_param_spec_uint ("kind", "kind", "kind",
|
||||
0, 2, 0,
|
||||
G_PARAM_READWRITE));
|
||||
g_object_class_install_property (object_class, PROP_ATTRIBUTE,
|
||||
g_param_spec_uint ("attribute", "attribute", "attribute",
|
||||
0, G_MAXUINT, 0,
|
||||
G_PARAM_READWRITE));
|
||||
g_object_class_install_property (object_class, PROP_NAME,
|
||||
g_param_spec_string ("name", "name", "name",
|
||||
NULL,
|
||||
G_PARAM_READWRITE));
|
||||
g_object_class_install_property (object_class, PROP_IS_DEFAULT,
|
||||
g_param_spec_boolean ("is-default", "is-default", "is-default",
|
||||
FALSE,
|
||||
G_PARAM_READWRITE));
|
||||
g_object_class_install_property (object_class, PROP_VALUE,
|
||||
g_param_spec_boxed ("value", "value", "value",
|
||||
GTK_TYPE_ACCESSIBLE_VALUE,
|
||||
G_PARAM_READWRITE));
|
||||
}
|
||||
|
||||
struct _GtkInspectorA11y
|
||||
{
|
||||
GtkWidget parent;
|
||||
|
||||
GObject *object;
|
||||
|
||||
GtkWidget *box;
|
||||
GtkWidget *role;
|
||||
GtkWidget *attributes;
|
||||
};
|
||||
|
||||
typedef struct _GtkInspectorA11yClass
|
||||
{
|
||||
GtkWidgetClass parent_class;
|
||||
} GtkInspectorA11yClass;
|
||||
|
||||
G_DEFINE_TYPE (GtkInspectorA11y, gtk_inspector_a11y, GTK_TYPE_WIDGET)
|
||||
|
||||
static void
|
||||
update_role (GtkInspectorA11y *sl)
|
||||
{
|
||||
GtkAccessibleRole role;
|
||||
GEnumClass *eclass;
|
||||
GEnumValue *value;
|
||||
|
||||
role = gtk_accessible_get_accessible_role (GTK_ACCESSIBLE (sl->object));
|
||||
|
||||
eclass = g_type_class_ref (GTK_TYPE_ACCESSIBLE_ROLE);
|
||||
value = g_enum_get_value (eclass, role);
|
||||
gtk_label_set_label (GTK_LABEL (sl->role), value->value_nick);
|
||||
g_type_class_unref (eclass);
|
||||
}
|
||||
|
||||
extern GType gtk_string_pair_get_type (void);
|
||||
|
||||
static void
|
||||
update_attributes (GtkInspectorA11y *sl)
|
||||
{
|
||||
GtkATContext *context;
|
||||
GListStore *store;
|
||||
GtkFilter *filter;
|
||||
GtkFilterListModel *filter_model;
|
||||
GtkNoSelection *selection;
|
||||
GObject *obj;
|
||||
GEnumClass *eclass;
|
||||
guint i;
|
||||
const char *name;
|
||||
GtkAccessibleState state;
|
||||
GtkAccessibleProperty prop;
|
||||
GtkAccessibleRelation rel;
|
||||
GtkAccessibleValue *value;
|
||||
gboolean has_value;
|
||||
|
||||
context = gtk_accessible_get_at_context (GTK_ACCESSIBLE (sl->object));
|
||||
|
||||
store = g_list_store_new (G_TYPE_OBJECT);
|
||||
|
||||
eclass = g_type_class_ref (GTK_TYPE_ACCESSIBLE_STATE);
|
||||
|
||||
for (i = 0; i < eclass->n_values; i++)
|
||||
{
|
||||
state = eclass->values[i].value;
|
||||
name = eclass->values[i].value_nick;
|
||||
has_value = gtk_at_context_has_accessible_state (context, state);
|
||||
value = gtk_at_context_get_accessible_state (context, state);
|
||||
obj = g_object_new (accessible_attribute_get_type (),
|
||||
"kind", STATE,
|
||||
"attribute", state,
|
||||
"name", name,
|
||||
"is-default", !has_value,
|
||||
"value", value,
|
||||
NULL);
|
||||
g_list_store_append (store, obj);
|
||||
g_object_unref (obj);
|
||||
}
|
||||
|
||||
g_type_class_unref (eclass);
|
||||
|
||||
eclass = g_type_class_ref (GTK_TYPE_ACCESSIBLE_PROPERTY);
|
||||
|
||||
for (i = 0; i < eclass->n_values; i++)
|
||||
{
|
||||
prop = eclass->values[i].value;
|
||||
name = eclass->values[i].value_nick;
|
||||
has_value = gtk_at_context_has_accessible_property (context, prop);
|
||||
value = gtk_at_context_get_accessible_property (context, prop);
|
||||
obj = g_object_new (accessible_attribute_get_type (),
|
||||
"kind", PROPERTY,
|
||||
"attribute", prop,
|
||||
"name", name,
|
||||
"is-default", !has_value,
|
||||
"value", value,
|
||||
NULL);
|
||||
g_list_store_append (store, obj);
|
||||
g_object_unref (obj);
|
||||
}
|
||||
|
||||
g_type_class_unref (eclass);
|
||||
|
||||
eclass = g_type_class_ref (GTK_TYPE_ACCESSIBLE_RELATION);
|
||||
|
||||
for (i = 0; i < eclass->n_values; i++)
|
||||
{
|
||||
rel = eclass->values[i].value;
|
||||
name = eclass->values[i].value_nick;
|
||||
has_value = gtk_at_context_has_accessible_relation (context, rel);
|
||||
value = gtk_at_context_get_accessible_relation (context, rel);
|
||||
obj = g_object_new (accessible_attribute_get_type (),
|
||||
"kind", RELATION,
|
||||
"attribute", rel,
|
||||
"name", name,
|
||||
"is-default", !has_value,
|
||||
"value", value,
|
||||
NULL);
|
||||
g_list_store_append (store, obj);
|
||||
g_object_unref (obj);
|
||||
}
|
||||
|
||||
g_type_class_unref (eclass);
|
||||
|
||||
filter = gtk_bool_filter_new (gtk_property_expression_new (accessible_attribute_get_type (), NULL, "is-default"));
|
||||
gtk_bool_filter_set_invert (GTK_BOOL_FILTER (filter), TRUE);
|
||||
|
||||
filter_model = gtk_filter_list_model_new (G_LIST_MODEL (store), filter);
|
||||
selection = gtk_no_selection_new (G_LIST_MODEL (filter_model));
|
||||
gtk_column_view_set_model (GTK_COLUMN_VIEW (sl->attributes), G_LIST_MODEL (selection));
|
||||
g_object_unref (selection);
|
||||
|
||||
if (g_list_model_get_n_items (G_LIST_MODEL (filter_model)) > 0)
|
||||
gtk_widget_show (sl->attributes);
|
||||
else
|
||||
gtk_widget_hide (sl->attributes);
|
||||
}
|
||||
|
||||
static void
|
||||
setup_cell_cb (GtkSignalListItemFactory *factory,
|
||||
GtkListItem *list_item)
|
||||
{
|
||||
GtkWidget *label;
|
||||
|
||||
label = gtk_label_new (NULL);
|
||||
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
|
||||
gtk_widget_set_margin_start (label, 6);
|
||||
gtk_widget_set_margin_end (label, 6);
|
||||
gtk_list_item_set_child (list_item, label);
|
||||
}
|
||||
|
||||
static void
|
||||
bind_name_cb (GtkSignalListItemFactory *factory,
|
||||
GtkListItem *list_item)
|
||||
{
|
||||
AccessibleAttribute *item;
|
||||
GtkWidget *label;
|
||||
|
||||
item = gtk_list_item_get_item (list_item);
|
||||
label = gtk_list_item_get_child (list_item);
|
||||
|
||||
if (item->is_default)
|
||||
gtk_widget_add_css_class (label, "dim-label");
|
||||
else
|
||||
gtk_widget_remove_css_class (label, "dim-label");
|
||||
|
||||
gtk_label_set_label (GTK_LABEL (label), item->name);
|
||||
}
|
||||
|
||||
static void
|
||||
bind_value_cb (GtkSignalListItemFactory *factory,
|
||||
GtkListItem *list_item)
|
||||
{
|
||||
AccessibleAttribute *item;
|
||||
GtkWidget *label;
|
||||
char *string;
|
||||
|
||||
item = gtk_list_item_get_item (list_item);
|
||||
label = gtk_list_item_get_child (list_item);
|
||||
|
||||
if (item->is_default)
|
||||
gtk_widget_add_css_class (label, "dim-label");
|
||||
else
|
||||
gtk_widget_remove_css_class (label, "dim-label");
|
||||
|
||||
string = gtk_accessible_value_to_string (item->value);
|
||||
gtk_label_set_label (GTK_LABEL (label), string);
|
||||
g_free (string);
|
||||
}
|
||||
|
||||
static void
|
||||
refresh_all (GtkInspectorA11y *sl)
|
||||
{
|
||||
update_role (sl);
|
||||
update_attributes (sl);
|
||||
}
|
||||
|
||||
void
|
||||
gtk_inspector_a11y_set_object (GtkInspectorA11y *sl,
|
||||
GObject *object)
|
||||
{
|
||||
GtkWidget *stack;
|
||||
GtkStackPage *page;
|
||||
GtkATContext *context;
|
||||
if (sl->object)
|
||||
{
|
||||
context = gtk_accessible_get_at_context (GTK_ACCESSIBLE (sl->object));
|
||||
g_signal_handlers_disconnect_by_func (context, refresh_all, sl);
|
||||
}
|
||||
|
||||
g_set_object (&sl->object, object);
|
||||
|
||||
stack = gtk_widget_get_parent (GTK_WIDGET (sl));
|
||||
page = gtk_stack_get_page (GTK_STACK (stack), GTK_WIDGET (sl));
|
||||
|
||||
if (GTK_IS_ACCESSIBLE (object))
|
||||
{
|
||||
context = gtk_accessible_get_at_context (GTK_ACCESSIBLE (sl->object));
|
||||
g_signal_connect_swapped (context, "state-change", G_CALLBACK (refresh_all), sl);
|
||||
gtk_stack_page_set_visible (page, TRUE);
|
||||
update_role (sl);
|
||||
update_attributes (sl);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_stack_page_set_visible (page, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_inspector_a11y_init (GtkInspectorA11y *sl)
|
||||
{
|
||||
gtk_widget_init_template (GTK_WIDGET (sl));
|
||||
}
|
||||
|
||||
static void
|
||||
dispose (GObject *o)
|
||||
{
|
||||
GtkInspectorA11y *sl = GTK_INSPECTOR_A11Y (o);
|
||||
|
||||
if (sl->object)
|
||||
{
|
||||
GtkATContext *context;
|
||||
|
||||
context = gtk_accessible_get_at_context (GTK_ACCESSIBLE (sl->object));
|
||||
g_signal_handlers_disconnect_by_func (context, refresh_all, sl);
|
||||
}
|
||||
|
||||
g_clear_object (&sl->object);
|
||||
|
||||
g_clear_pointer (&sl->box, gtk_widget_unparent);
|
||||
|
||||
G_OBJECT_CLASS (gtk_inspector_a11y_parent_class)->dispose (o);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_inspector_a11y_class_init (GtkInspectorA11yClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
|
||||
|
||||
object_class->dispose = dispose;
|
||||
|
||||
gtk_widget_class_set_template_from_resource (widget_class, "/org/gtk/libgtk/inspector/a11y.ui");
|
||||
gtk_widget_class_bind_template_child (widget_class, GtkInspectorA11y, box);
|
||||
gtk_widget_class_bind_template_child (widget_class, GtkInspectorA11y, role);
|
||||
gtk_widget_class_bind_template_child (widget_class, GtkInspectorA11y, attributes);
|
||||
|
||||
gtk_widget_class_bind_template_callback (widget_class, setup_cell_cb);
|
||||
gtk_widget_class_bind_template_callback (widget_class, bind_name_cb);
|
||||
gtk_widget_class_bind_template_callback (widget_class, bind_value_cb);
|
||||
|
||||
gtk_widget_class_set_layout_manager_type (widget_class, GTK_TYPE_BIN_LAYOUT);
|
||||
}
|
||||
|
||||
// vim: set et sw=2 ts=2:
|
39
gtk/inspector/a11y.h
Normal file
39
gtk/inspector/a11y.h
Normal file
@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Copyright (c) 2020 Red Hat, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef _GTK_INSPECTOR_A11Y_H_
|
||||
#define _GTK_INSPECTOR_A11Y_H_
|
||||
|
||||
#include "gtkscrolledwindow.h"
|
||||
|
||||
#define GTK_TYPE_INSPECTOR_A11Y (gtk_inspector_a11y_get_type())
|
||||
#define GTK_INSPECTOR_A11Y(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GTK_TYPE_INSPECTOR_A11Y, GtkInspectorA11y))
|
||||
#define GTK_INSPECTOR_IS_A11Y(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GTK_TYPE_INSPECTOR_A11Y))
|
||||
|
||||
typedef struct _GtkInspectorA11y GtkInspectorA11y;
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
GType gtk_inspector_a11y_get_type (void);
|
||||
void gtk_inspector_a11y_set_object (GtkInspectorA11y *sl,
|
||||
GObject *object);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif // _GTK_INSPECTOR_A11Y_H_
|
||||
|
||||
// vim: set et sw=2 ts=2:
|
71
gtk/inspector/a11y.ui
Normal file
71
gtk/inspector/a11y.ui
Normal file
@ -0,0 +1,71 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface domain="gtk40">
|
||||
<template class="GtkInspectorA11y" parent="GtkWidget">
|
||||
<child>
|
||||
<object class="GtkBox" id="box">
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="margin-start">10</property>
|
||||
<property name="margin-end">10</property>
|
||||
<property name="margin-top">10</property>
|
||||
<property name="margin-bottom">10</property>
|
||||
<property name="spacing">40</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Role</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="xalign">0.0</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="role">
|
||||
<property name="selectable">1</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">baseline</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow">
|
||||
<property name="vexpand">1</property>
|
||||
<child>
|
||||
<object class="GtkColumnView" id="attributes">
|
||||
<property name="show-column-separators">1</property>
|
||||
<style>
|
||||
<class name="frame"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkColumnViewColumn">
|
||||
<property name="title" translatable="yes">Attribute</property>
|
||||
<property name="expand">1</property>
|
||||
<property name="factory">
|
||||
<object class="GtkSignalListItemFactory">
|
||||
<signal name="setup" handler="setup_cell_cb"/>
|
||||
<signal name="bind" handler="bind_name_cb"/>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColumnViewColumn">
|
||||
<property name="title" translatable="yes">Value</property>
|
||||
<property name="expand">1</property>
|
||||
<property name="factory">
|
||||
<object class="GtkSignalListItemFactory">
|
||||
<signal name="setup" handler="setup_cell_cb"/>
|
||||
<signal name="bind" handler="bind_value_cb"/>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</template>
|
||||
</interface>
|
@ -24,6 +24,7 @@
|
||||
|
||||
#include "init.h"
|
||||
|
||||
#include "a11y.h"
|
||||
#include "actions.h"
|
||||
#include "cellrenderergraph.h"
|
||||
#include "controllers.h"
|
||||
@ -61,6 +62,7 @@ gtk_inspector_init (void)
|
||||
|
||||
g_type_ensure (GTK_TYPE_CELL_RENDERER_GRAPH);
|
||||
g_type_ensure (GTK_TYPE_GRAPH_DATA);
|
||||
g_type_ensure (GTK_TYPE_INSPECTOR_A11Y);
|
||||
g_type_ensure (GTK_TYPE_INSPECTOR_ACTIONS);
|
||||
g_type_ensure (GTK_TYPE_INSPECTOR_CONTROLLERS);
|
||||
g_type_ensure (GTK_TYPE_INSPECTOR_CSS_EDITOR);
|
||||
|
@ -1,4 +1,5 @@
|
||||
inspector_sources = files(
|
||||
'a11y.c',
|
||||
'action-editor.c',
|
||||
'actions.c',
|
||||
'baselineoverlay.c',
|
||||
|
@ -35,6 +35,7 @@
|
||||
#include "css-node-tree.h"
|
||||
#include "object-tree.h"
|
||||
#include "size-groups.h"
|
||||
#include "a11y.h"
|
||||
#include "actions.h"
|
||||
#include "shortcuts.h"
|
||||
#include "list-data.h"
|
||||
@ -108,6 +109,7 @@ set_selected_object (GtkInspectorWindow *iw,
|
||||
gtk_inspector_menu_set_object (GTK_INSPECTOR_MENU (iw->menu), selected);
|
||||
gtk_inspector_controllers_set_object (GTK_INSPECTOR_CONTROLLERS (iw->controllers), selected);
|
||||
gtk_inspector_magnifier_set_object (GTK_INSPECTOR_MAGNIFIER (iw->magnifier), selected);
|
||||
gtk_inspector_a11y_set_object (GTK_INSPECTOR_A11Y (iw->a11y), selected);
|
||||
|
||||
for (l = iw->extra_pages; l != NULL; l = l->next)
|
||||
g_object_set (l->data, "object", selected, NULL);
|
||||
@ -638,6 +640,7 @@ gtk_inspector_window_class_init (GtkInspectorWindowClass *klass)
|
||||
gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, misc_info);
|
||||
gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, controllers);
|
||||
gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, magnifier);
|
||||
gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, a11y);
|
||||
gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, sidebar_revealer);
|
||||
gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, css_editor);
|
||||
gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, visual);
|
||||
|
@ -72,6 +72,7 @@ typedef struct
|
||||
GtkWidget *misc_info;
|
||||
GtkWidget *controllers;
|
||||
GtkWidget *magnifier;
|
||||
GtkWidget *a11y;
|
||||
GtkWidget *sidebar_revealer;
|
||||
GtkWidget *css_editor;
|
||||
GtkWidget *visual;
|
||||
|
@ -524,6 +524,16 @@
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkStackPage">
|
||||
<property name="name">a11y</property>
|
||||
<property name="title" translatable="yes">Accessibility</property>
|
||||
<property name="child">
|
||||
<object class="GtkInspectorA11y" id="a11y">
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
Loading…
Reference in New Issue
Block a user