+
+void
+on_toolsHand_activate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ if (GTK_OBJECT_TYPE(menuitem) == GTK_TYPE_RADIO_MENU_ITEM) {
+ if (!gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM (menuitem)))
+ return;
+ } else {
+ if (!gtk_toggle_tool_button_get_active(GTK_TOGGLE_TOOL_BUTTON (menuitem)))
+ return;
+ }
+
+ if (ui.cur_mapping != 0 && !ui.button_switch_mapping) return;
+ if (ui.toolno[ui.cur_mapping] == TOOL_HAND) return;
+
+ ui.cur_mapping = 0;
+ end_text();
+ reset_selection();
+ ui.toolno[ui.cur_mapping] = TOOL_HAND;
+ update_mapping_linkings(-1);
+ update_tool_buttons();
+ update_tool_menu();
+ update_color_menu();
+ update_cursor();
+}
+
+
+void
+on_button2Hand_activate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ process_mapping_activate(menuitem, 1, TOOL_HAND);
+}
+
+
+void
+on_button3Hand_activate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ process_mapping_activate(menuitem, 2, TOOL_HAND);
+}
+
+
+void
+on_optionsPrintRuling_activate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ end_text();
+ ui.print_ruling = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM (menuitem));
+}
+
+void
+on_optionsAutoloadPdfXoj_activate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ end_text();
+ ui.autoload_pdf_xoj = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM (menuitem));
+}
+
+void
+on_fontButton_font_set (GtkFontButton *fontbutton,
+ gpointer user_data)
+{
+ gchar *str;
+
+ str = g_strdup(gtk_font_button_get_font_name(fontbutton));
+ process_font_sel(str);
+}
+
+void
+on_optionsLeftHanded_activate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ end_text();
+ ui.left_handed = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM (menuitem));
+ gtk_scrolled_window_set_placement(GTK_SCROLLED_WINDOW(GET_COMPONENT("scrolledwindowMain")),
+ ui.left_handed?GTK_CORNER_TOP_RIGHT:GTK_CORNER_TOP_LEFT);
+}
+
+void
+on_optionsShortenMenus_activate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ gchar *item, *nextptr;
+ GtkWidget *w;
+
+ end_text();
+ ui.shorten_menus = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM (menuitem));
+
+ /* go over the item list */
+ item = ui.shorten_menu_items;
+ while (*item==' ') item++;
+ while (*item) {
+ nextptr = strchr(item, ' ');
+ if (nextptr!=NULL) *nextptr = 0;
+ // hide or show the item
+ w = GET_COMPONENT(item);
+ if (w != NULL) {
+ if (ui.shorten_menus) gtk_widget_hide(w);
+ else gtk_widget_show(w);
+ }
+ // next item
+ if (nextptr==NULL) break;
+ *nextptr = ' ';
+ item = nextptr;
+ while (*item==' ') item++;
+ }
+
+ // just in case someone tried to unhide stuff they shouldn't be seeing
+ hide_unimplemented();
+ // maybe we should also make sure the drawing area stays visible ?
+}
+
+void
+on_optionsAutoSavePrefs_activate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ end_text();
+ ui.auto_save_prefs = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM (menuitem));
+}
+
+void
+on_optionsPressureSensitive_activate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ int i;
+ end_text();
+ ui.pressure_sensitivity =
+ gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM (menuitem));
+ for (i=0; i<=NUM_BUTTONS; i++)
+ ui.brushes[i][TOOL_PEN].variable_width = ui.pressure_sensitivity;
+ update_mappings_menu();
+}
+
+
+void
+on_buttonColorChooser_set (GtkColorButton *colorbutton,
+ gpointer user_data)
+{
+ GdkColor gdkcolor;
+ guint16 alpha;
+
+ gtk_color_button_get_color(colorbutton, &gdkcolor);
+ alpha = gtk_color_button_get_alpha(colorbutton);
+ process_color_activate((GtkMenuItem*)colorbutton, COLOR_OTHER, gdkcolor_to_rgba(gdkcolor, alpha));
+}
+
+
+void
+on_optionsButtonsSwitchMappings_activate(GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ end_text();
+ switch_mapping(0);
+ ui.button_switch_mapping = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM (menuitem));
+}
+