2 * Copyright 2012 Red Hat, Inc
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
21 #include "gtkcolorswatchaccessible.h"
23 static void atk_action_interface_init (AtkActionIface *iface);
25 G_DEFINE_TYPE_WITH_CODE (GtkColorSwatchAccessible, _gtk_color_swatch_accessible, GTK_TYPE_WIDGET_ACCESSIBLE,
26 G_IMPLEMENT_INTERFACE (ATK_TYPE_ACTION, atk_action_interface_init))
29 _gtk_color_swatch_accessible_class_init (GtkColorSwatchAccessibleClass *klass)
34 _gtk_color_swatch_accessible_init (GtkColorSwatchAccessible *scale)
39 gtk_color_swatch_accessible_get_n_actions (AtkAction *action)
45 gtk_color_swatch_accessible_get_keybinding (AtkAction *action,
52 gtk_color_swatch_accessible_get_name (AtkAction *action,
57 case 0: return "select";
58 case 1: return "activate";
59 case 2: return "customize";
65 gtk_color_swatch_accessible_do_action (AtkAction *action,
70 widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (action));
77 gtk_widget_set_state_flags (widget, GTK_STATE_FLAG_SELECTED, FALSE);
81 g_signal_emit_by_name (widget, "activate");
85 g_signal_emit_by_name (widget, "customize");
96 atk_action_interface_init (AtkActionIface *iface)
98 iface->do_action = gtk_color_swatch_accessible_do_action;
99 iface->get_n_actions = gtk_color_swatch_accessible_get_n_actions;
100 iface->get_keybinding = gtk_color_swatch_accessible_get_keybinding;
101 iface->get_name = gtk_color_swatch_accessible_get_name;