25 #include <glib/gi18n.h>
55 if (!gtk_toggle_tool_button_get_active (GTK_TOGGLE_TOOL_BUTTON (button))) {
60 if (button == toolbar->text_button) {
62 gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (toolbar->highlight_button),
FALSE);
63 }
else if (button == toolbar->highlight_button) {
65 gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (toolbar->text_button),
FALSE);
67 g_assert_not_reached ();
75 GtkToggleToolButton *button)
77 if (!gtk_toggle_tool_button_get_active (button))
80 g_signal_handlers_block_by_func (button,
83 gtk_toggle_tool_button_set_active (button,
FALSE);
84 g_signal_handlers_unblock_by_func (button,
93 const gchar *icon_name,
96 GtkWidget *button = GTK_WIDGET (gtk_toggle_tool_button_new ());
98 gtk_widget_set_tooltip_text (button, tooltip);
99 gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (button), icon_name);
101 gtk_style_context_add_class (gtk_widget_get_style_context (gtk_bin_get_child (GTK_BIN (button))),
"text-button");
102 g_signal_connect (button,
"toggled",
112 gtk_orientable_set_orientation (GTK_ORIENTABLE (toolbar), GTK_ORIENTATION_HORIZONTAL);
114 gtk_toolbar_set_icon_size (GTK_TOOLBAR (toolbar), GTK_ICON_SIZE_MENU);
115 gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (toolbar)),
116 GTK_STYLE_CLASS_INLINE_TOOLBAR);
119 "document-new-symbolic",
120 _(
"Add text annotation"));
121 gtk_container_add (GTK_CONTAINER(toolbar), toolbar->
text_button);
126 "edit-select-all-symbolic",
127 _(
"Add highlight annotation"));
135 GObjectClass *g_object_class = G_OBJECT_CLASS (klass);
138 g_signal_new (
"begin-add-annot",
139 G_TYPE_FROM_CLASS (g_object_class),
143 g_cclosure_marshal_VOID__ENUM,
145 EV_TYPE_ANNOTATION_TYPE);
148 g_signal_new (
"cancel-add-annot",
149 G_TYPE_FROM_CLASS (g_object_class),
153 g_cclosure_marshal_VOID__VOID,