/*
 * DO NOT EDIT THIS FILE - it is generated by Glade.
 */

#ifdef HAVE_CONFIG_H
#  include <config.h>
#endif

#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <string.h>
#include <stdio.h>

#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>

#include "callbacks.h"
#include "interface.h"
#include "support.h"

#define GLADE_HOOKUP_OBJECT(component,widget,name) \
  g_object_set_data_full (G_OBJECT (component), name, \
    gtk_widget_ref (widget), (GDestroyNotify) gtk_widget_unref)

#define GLADE_HOOKUP_OBJECT_NO_REF(component,widget,name) \
  g_object_set_data (G_OBJECT (component), name, widget)

GtkWidget*
create_main_window (void)
{
  GtkWidget *main_window;
  GtkWidget *vbox;
  GtkWidget *titlelabel;
  GtkWidget *menubar;
  GtkWidget *file;
  GtkWidget *file_menu;
  GtkWidget *quit;
  GtkWidget *view;
  GtkWidget *view_menu;
  GtkWidget *viewset;
  GtkWidget *function;
  GtkWidget *function_menu;
  GtkWidget *send;
  GtkWidget *lock;
  GtkWidget *help;
  GtkWidget *help_menu;
  GtkWidget *version;
  GtkWidget *scrolledwindow;
  GtkWidget *main_window_viewport;

  main_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_window_set_title (GTK_WINDOW (main_window), _("MultiVNC"));

  vbox = gtk_vbox_new (FALSE, 0);
  gtk_widget_show (vbox);
  gtk_container_add (GTK_CONTAINER (main_window), vbox);

  titlelabel = gtk_label_new (_("MultiVNC"));
  gtk_widget_show (titlelabel);
  gtk_box_pack_start (GTK_BOX (vbox), titlelabel, FALSE, FALSE, 0);
  gtk_widget_set_size_request (titlelabel, -1, 25);

  menubar = gtk_menu_bar_new ();
  gtk_widget_show (menubar);
  gtk_box_pack_start (GTK_BOX (vbox), menubar, FALSE, FALSE, 0);

  file = gtk_menu_item_new_with_mnemonic (_("File"));
  gtk_widget_show (file);
  gtk_container_add (GTK_CONTAINER (menubar), file);

  file_menu = gtk_menu_new ();
  gtk_menu_item_set_submenu (GTK_MENU_ITEM (file), file_menu);

  quit = gtk_menu_item_new_with_mnemonic (_("Quit"));
  gtk_widget_show (quit);
  gtk_container_add (GTK_CONTAINER (file_menu), quit);

  view = gtk_menu_item_new_with_mnemonic (_("View"));
  gtk_widget_show (view);
  gtk_container_add (GTK_CONTAINER (menubar), view);

  view_menu = gtk_menu_new ();
  gtk_menu_item_set_submenu (GTK_MENU_ITEM (view), view_menu);

  viewset = gtk_menu_item_new_with_mnemonic (_("Preferences"));
  gtk_widget_show (viewset);
  gtk_container_add (GTK_CONTAINER (view_menu), viewset);

  function = gtk_menu_item_new_with_mnemonic (_("Function"));
  gtk_widget_show (function);
  gtk_container_add (GTK_CONTAINER (menubar), function);

  function_menu = gtk_menu_new ();
  gtk_menu_item_set_submenu (GTK_MENU_ITEM (function), function_menu);

  send = gtk_menu_item_new_with_mnemonic (_("Send screen"));
  gtk_widget_show (send);
  gtk_container_add (GTK_CONTAINER (function_menu), send);

  lock = gtk_menu_item_new_with_mnemonic (_("Lock"));
  gtk_widget_show (lock);
  gtk_container_add (GTK_CONTAINER (function_menu), lock);

  help = gtk_menu_item_new_with_mnemonic (_("Help"));
  gtk_widget_show (help);
  gtk_container_add (GTK_CONTAINER (menubar), help);

  help_menu = gtk_menu_new ();
  gtk_menu_item_set_submenu (GTK_MENU_ITEM (help), help_menu);

  version = gtk_menu_item_new_with_mnemonic (_("About"));
  gtk_widget_show (version);
  gtk_container_add (GTK_CONTAINER (help_menu), version);

  scrolledwindow = gtk_scrolled_window_new (NULL, NULL);
  gtk_widget_show (scrolledwindow);
  gtk_box_pack_start (GTK_BOX (vbox), scrolledwindow, TRUE, TRUE, 0);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow), GTK_POLICY_AUTOMATIC, GTK_POLICY_NEVER);

  main_window_viewport = gtk_viewport_new (NULL, NULL);
  gtk_widget_show (main_window_viewport);
  gtk_container_add (GTK_CONTAINER (scrolledwindow), main_window_viewport);

  g_signal_connect ((gpointer) main_window, "delete_event",
                    G_CALLBACK (on_main_window_delete_event),
                    NULL);
  g_signal_connect ((gpointer) quit, "activate",
                    G_CALLBACK (on_quit_activate),
                    NULL);
  g_signal_connect ((gpointer) viewset, "activate",
                    G_CALLBACK (on_viewset_activate),
                    NULL);
  g_signal_connect ((gpointer) send, "activate",
                    G_CALLBACK (on_send_activate),
                    NULL);
  g_signal_connect ((gpointer) lock, "activate",
                    G_CALLBACK (on_lock_activate),
                    NULL);
  g_signal_connect ((gpointer) version, "activate",
                    G_CALLBACK (on_version_activate),
                    NULL);

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (main_window, main_window, "main_window");
  GLADE_HOOKUP_OBJECT (main_window, vbox, "vbox");
  GLADE_HOOKUP_OBJECT (main_window, titlelabel, "titlelabel");
  GLADE_HOOKUP_OBJECT (main_window, menubar, "menubar");
  GLADE_HOOKUP_OBJECT (main_window, file, "file");
  GLADE_HOOKUP_OBJECT (main_window, file_menu, "file_menu");
  GLADE_HOOKUP_OBJECT (main_window, quit, "quit");
  GLADE_HOOKUP_OBJECT (main_window, view, "view");
  GLADE_HOOKUP_OBJECT (main_window, view_menu, "view_menu");
  GLADE_HOOKUP_OBJECT (main_window, viewset, "viewset");
  GLADE_HOOKUP_OBJECT (main_window, function, "function");
  GLADE_HOOKUP_OBJECT (main_window, function_menu, "function_menu");
  GLADE_HOOKUP_OBJECT (main_window, send, "send");
  GLADE_HOOKUP_OBJECT (main_window, lock, "lock");
  GLADE_HOOKUP_OBJECT (main_window, help, "help");
  GLADE_HOOKUP_OBJECT (main_window, help_menu, "help_menu");
  GLADE_HOOKUP_OBJECT (main_window, version, "version");
  GLADE_HOOKUP_OBJECT (main_window, scrolledwindow, "scrolledwindow");
  GLADE_HOOKUP_OBJECT (main_window, main_window_viewport, "main_window_viewport");

  return main_window;
}

GtkWidget*
create_dialog_viewset (void)
{
  GtkWidget *dialog_viewset;
  GtkWidget *largevbox;
  GtkWidget *frame;
  GtkWidget *alignment;
  GtkWidget *hbox;
  GtkWidget *scrolledwindow;
  GtkWidget *dialog_viewset_viewport;
  GtkWidget *vseparator;
  GtkWidget *vbox;
  GtkWidget *buttonAddTab;
  GtkWidget *labelMoveUser;
  GtkWidget *vbuttonbox;
  GtkWidget *buttonMoveupgrp;
  GtkWidget *buttonMoveup;
  GtkWidget *buttonmovedown;
  GtkWidget *buttonMovedowngrp;
  GtkWidget *labelUserlist;
  GtkWidget *dialog_action_area;
  GtkWidget *buttonOK;
  GtkWidget *buttonCancel;

  dialog_viewset = gtk_dialog_new ();
  gtk_widget_set_size_request (dialog_viewset, 500, 400);
  gtk_window_set_title (GTK_WINDOW (dialog_viewset), _("MultiVNC View Setting"));
  gtk_window_set_position (GTK_WINDOW (dialog_viewset), GTK_WIN_POS_CENTER);
  gtk_window_set_type_hint (GTK_WINDOW (dialog_viewset), GDK_WINDOW_TYPE_HINT_DIALOG);

  largevbox = GTK_DIALOG (dialog_viewset)->vbox;
  gtk_widget_show (largevbox);

  frame = gtk_frame_new (NULL);
  gtk_widget_show (frame);
  gtk_box_pack_start (GTK_BOX (largevbox), frame, TRUE, TRUE, 0);
  gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_NONE);

  alignment = gtk_alignment_new (0.5, 0.5, 1, 1);
  gtk_widget_show (alignment);
  gtk_container_add (GTK_CONTAINER (frame), alignment);
  gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 0, 0, 12, 0);

  hbox = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox);
  gtk_container_add (GTK_CONTAINER (alignment), hbox);
  gtk_container_set_border_width (GTK_CONTAINER (hbox), 2);

  scrolledwindow = gtk_scrolled_window_new (NULL, NULL);
  gtk_widget_show (scrolledwindow);
  gtk_box_pack_start (GTK_BOX (hbox), scrolledwindow, TRUE, TRUE, 0);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);

  dialog_viewset_viewport = gtk_viewport_new (NULL, NULL);
  gtk_widget_show (dialog_viewset_viewport);
  gtk_container_add (GTK_CONTAINER (scrolledwindow), dialog_viewset_viewport);

  vseparator = gtk_vseparator_new ();
  gtk_widget_show (vseparator);
  gtk_box_pack_start (GTK_BOX (hbox), vseparator, TRUE, TRUE, 0);

  vbox = gtk_vbox_new (FALSE, 0);
  gtk_widget_show (vbox);
  gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);

  buttonAddTab = gtk_button_new_with_mnemonic (_("Add Tab"));
  gtk_widget_show (buttonAddTab);
  gtk_box_pack_start (GTK_BOX (vbox), buttonAddTab, FALSE, FALSE, 20);

  labelMoveUser = gtk_label_new (_("Move User"));
  gtk_widget_show (labelMoveUser);
  gtk_box_pack_start (GTK_BOX (vbox), labelMoveUser, FALSE, FALSE, 0);

  vbuttonbox = gtk_vbutton_box_new ();
  gtk_widget_show (vbuttonbox);
  gtk_box_pack_start (GTK_BOX (vbox), vbuttonbox, TRUE, TRUE, 0);
  gtk_button_box_set_layout (GTK_BUTTON_BOX (vbuttonbox), GTK_BUTTONBOX_START);
  gtk_box_set_spacing (GTK_BOX (vbuttonbox), 5);

  buttonMoveupgrp = gtk_button_new_with_mnemonic (_("Previous Tab"));
  gtk_widget_show (buttonMoveupgrp);
  gtk_container_add (GTK_CONTAINER (vbuttonbox), buttonMoveupgrp);
  GTK_WIDGET_SET_FLAGS (buttonMoveupgrp, GTK_CAN_DEFAULT);

  buttonMoveup = gtk_button_new_with_mnemonic (_("Up"));
  gtk_widget_show (buttonMoveup);
  gtk_container_add (GTK_CONTAINER (vbuttonbox), buttonMoveup);
  GTK_WIDGET_SET_FLAGS (buttonMoveup, GTK_CAN_DEFAULT);

  buttonmovedown = gtk_button_new_with_mnemonic (_("Down"));
  gtk_widget_show (buttonmovedown);
  gtk_container_add (GTK_CONTAINER (vbuttonbox), buttonmovedown);
  GTK_WIDGET_SET_FLAGS (buttonmovedown, GTK_CAN_DEFAULT);

  buttonMovedowngrp = gtk_button_new_with_mnemonic (_("Next Tab"));
  gtk_widget_show (buttonMovedowngrp);
  gtk_container_add (GTK_CONTAINER (vbuttonbox), buttonMovedowngrp);
  GTK_WIDGET_SET_FLAGS (buttonMovedowngrp, GTK_CAN_DEFAULT);

  labelUserlist = gtk_label_new (_("<b>List of User</b>"));
  gtk_widget_show (labelUserlist);
  gtk_frame_set_label_widget (GTK_FRAME (frame), labelUserlist);
  gtk_label_set_use_markup (GTK_LABEL (labelUserlist), TRUE);

  dialog_action_area = GTK_DIALOG (dialog_viewset)->action_area;
  gtk_widget_show (dialog_action_area);
  gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area), GTK_BUTTONBOX_END);

  buttonOK = gtk_button_new_from_stock ("gtk-ok");
  gtk_widget_show (buttonOK);
  gtk_dialog_add_action_widget (GTK_DIALOG (dialog_viewset), buttonOK, GTK_RESPONSE_OK);
  GTK_WIDGET_SET_FLAGS (buttonOK, GTK_CAN_DEFAULT);

  buttonCancel = gtk_button_new_from_stock ("gtk-cancel");
  gtk_widget_show (buttonCancel);
  gtk_dialog_add_action_widget (GTK_DIALOG (dialog_viewset), buttonCancel, GTK_RESPONSE_CANCEL);
  GTK_WIDGET_SET_FLAGS (buttonCancel, GTK_CAN_DEFAULT);

  g_signal_connect ((gpointer) dialog_viewset, "delete_event",
                    G_CALLBACK (on_dialog_viewset_delete_event),
                    NULL);
  g_signal_connect ((gpointer) buttonAddTab, "clicked",
                    G_CALLBACK (on_dialog_viewset_button_tab_clicked),
                    NULL);
  g_signal_connect ((gpointer) buttonMoveupgrp, "clicked",
                    G_CALLBACK (on_dialog_viewset_button_moveupg_clicked),
                    NULL);
  g_signal_connect ((gpointer) buttonMoveup, "clicked",
                    G_CALLBACK (on_dialog_viewset_button_moveup_clicked),
                    NULL);
  g_signal_connect ((gpointer) buttonmovedown, "clicked",
                    G_CALLBACK (on_dialog_viewset_button_movedown_clicked),
                    NULL);
  g_signal_connect ((gpointer) buttonMovedowngrp, "clicked",
                    G_CALLBACK (on_dialog_viewset_button_movedowng_clicked),
                    NULL);
  g_signal_connect ((gpointer) buttonOK, "clicked",
                    G_CALLBACK (on_dialog_viewset_buttonOK_clicked),
                    NULL);
  g_signal_connect ((gpointer) buttonCancel, "clicked",
                    G_CALLBACK (on_dialog_viewset_buttonCancel_clicked),
                    NULL);

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (dialog_viewset, dialog_viewset, "dialog_viewset");
  GLADE_HOOKUP_OBJECT_NO_REF (dialog_viewset, largevbox, "largevbox");
  GLADE_HOOKUP_OBJECT (dialog_viewset, frame, "frame");
  GLADE_HOOKUP_OBJECT (dialog_viewset, alignment, "alignment");
  GLADE_HOOKUP_OBJECT (dialog_viewset, hbox, "hbox");
  GLADE_HOOKUP_OBJECT (dialog_viewset, scrolledwindow, "scrolledwindow");
  GLADE_HOOKUP_OBJECT (dialog_viewset, dialog_viewset_viewport, "dialog_viewset_viewport");
  GLADE_HOOKUP_OBJECT (dialog_viewset, vseparator, "vseparator");
  GLADE_HOOKUP_OBJECT (dialog_viewset, vbox, "vbox");
  GLADE_HOOKUP_OBJECT (dialog_viewset, buttonAddTab, "buttonAddTab");
  GLADE_HOOKUP_OBJECT (dialog_viewset, labelMoveUser, "labelMoveUser");
  GLADE_HOOKUP_OBJECT (dialog_viewset, vbuttonbox, "vbuttonbox");
  GLADE_HOOKUP_OBJECT (dialog_viewset, buttonMoveupgrp, "buttonMoveupgrp");
  GLADE_HOOKUP_OBJECT (dialog_viewset, buttonMoveup, "buttonMoveup");
  GLADE_HOOKUP_OBJECT (dialog_viewset, buttonmovedown, "buttonmovedown");
  GLADE_HOOKUP_OBJECT (dialog_viewset, buttonMovedowngrp, "buttonMovedowngrp");
  GLADE_HOOKUP_OBJECT (dialog_viewset, labelUserlist, "labelUserlist");
  GLADE_HOOKUP_OBJECT_NO_REF (dialog_viewset, dialog_action_area, "dialog_action_area");
  GLADE_HOOKUP_OBJECT (dialog_viewset, buttonOK, "buttonOK");
  GLADE_HOOKUP_OBJECT (dialog_viewset, buttonCancel, "buttonCancel");

  return dialog_viewset;
}

GtkWidget*
create_dialog_send (void)
{
  GtkWidget *dialog_send;
  GtkWidget *largevbox;
  GtkWidget *notebook;
  GtkWidget *vbox1;
  GtkWidget *frame1;
  GtkWidget *alignment1;
  GtkWidget *dialog_send_hbox;
  GtkWidget *label_groupname;
  GtkWidget *label_source;
  GtkWidget *hseparator1;
  GtkWidget *frame2;
  GtkWidget *alignment2;
  GtkWidget *hbox1;
  GtkWidget *checkbutton0;
  GtkWidget *scrolledwindow1;
  GtkWidget *dialog_send_viewport1;
  GtkWidget *label_destination;
  GtkWidget *hseparator2;
  GtkWidget *frame3;
  GtkWidget *alignment3;
  GtkWidget *vbox3;
  GtkWidget *radiobutton1;
  GSList *radiobutton1_group = NULL;
  GtkWidget *radiobutton2;
  GtkWidget *label1;
  GtkWidget *label_setup;
  GtkWidget *vbox2;
  GtkWidget *hbox2;
  GtkWidget *label_src;
  GtkWidget *label_dst;
  GtkWidget *scrolledwindow2;
  GtkWidget *dialog_send_viewport2;
  GtkWidget *label_state;
  GtkWidget *dialog_action_area;
  GtkWidget *buttonOK;
  GtkWidget *buttonCancel;
  GtkWidget *buttonApply;

  dialog_send = gtk_dialog_new ();
  gtk_window_set_title (GTK_WINDOW (dialog_send), _("MultiVNC Send Screen Setting"));
  gtk_window_set_position (GTK_WINDOW (dialog_send), GTK_WIN_POS_CENTER);
  gtk_window_set_type_hint (GTK_WINDOW (dialog_send), GDK_WINDOW_TYPE_HINT_DIALOG);

  largevbox = GTK_DIALOG (dialog_send)->vbox;
  gtk_widget_show (largevbox);

  notebook = gtk_notebook_new ();
  gtk_widget_show (notebook);
  gtk_box_pack_start (GTK_BOX (largevbox), notebook, TRUE, TRUE, 0);

  vbox1 = gtk_vbox_new (FALSE, 0);
  gtk_widget_show (vbox1);
  gtk_container_add (GTK_CONTAINER (notebook), vbox1);

  frame1 = gtk_frame_new (NULL);
  gtk_widget_show (frame1);
  gtk_box_pack_start (GTK_BOX (vbox1), frame1, TRUE, TRUE, 0);
  gtk_frame_set_shadow_type (GTK_FRAME (frame1), GTK_SHADOW_NONE);

  alignment1 = gtk_alignment_new (0.5, 0.5, 1, 1);
  gtk_widget_show (alignment1);
  gtk_container_add (GTK_CONTAINER (frame1), alignment1);
  gtk_alignment_set_padding (GTK_ALIGNMENT (alignment1), 0, 0, 12, 0);

  dialog_send_hbox = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (dialog_send_hbox);
  gtk_container_add (GTK_CONTAINER (alignment1), dialog_send_hbox);

  label_groupname = gtk_label_new (_("Group Name"));
  gtk_widget_show (label_groupname);
  gtk_box_pack_start (GTK_BOX (dialog_send_hbox), label_groupname, FALSE, FALSE, 0);

  label_source = gtk_label_new (_("<b>Source</b>"));
  gtk_widget_show (label_source);
  gtk_frame_set_label_widget (GTK_FRAME (frame1), label_source);
  gtk_label_set_use_markup (GTK_LABEL (label_source), TRUE);

  hseparator1 = gtk_hseparator_new ();
  gtk_widget_show (hseparator1);
  gtk_box_pack_start (GTK_BOX (vbox1), hseparator1, TRUE, TRUE, 0);

  frame2 = gtk_frame_new (NULL);
  gtk_widget_show (frame2);
  gtk_box_pack_start (GTK_BOX (vbox1), frame2, TRUE, TRUE, 0);
  gtk_widget_set_size_request (frame2, -1, 150);
  gtk_frame_set_shadow_type (GTK_FRAME (frame2), GTK_SHADOW_NONE);

  alignment2 = gtk_alignment_new (0.5, 0.5, 1, 1);
  gtk_widget_show (alignment2);
  gtk_container_add (GTK_CONTAINER (frame2), alignment2);
  gtk_alignment_set_padding (GTK_ALIGNMENT (alignment2), 0, 0, 12, 0);

  hbox1 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox1);
  gtk_container_add (GTK_CONTAINER (alignment2), hbox1);

  checkbutton0 = gtk_check_button_new_with_mnemonic (_("Send All"));
  gtk_widget_show (checkbutton0);
  gtk_box_pack_start (GTK_BOX (hbox1), checkbutton0, FALSE, FALSE, 0);

  scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL);
  gtk_widget_show (scrolledwindow1);
  gtk_box_pack_start (GTK_BOX (hbox1), scrolledwindow1, TRUE, TRUE, 0);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow1), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);

  dialog_send_viewport1 = gtk_viewport_new (NULL, NULL);
  gtk_widget_show (dialog_send_viewport1);
  gtk_container_add (GTK_CONTAINER (scrolledwindow1), dialog_send_viewport1);

  label_destination = gtk_label_new (_("<b>Destination</b>"));
  gtk_widget_show (label_destination);
  gtk_frame_set_label_widget (GTK_FRAME (frame2), label_destination);
  gtk_label_set_use_markup (GTK_LABEL (label_destination), TRUE);

  hseparator2 = gtk_hseparator_new ();
  gtk_widget_show (hseparator2);
  gtk_box_pack_start (GTK_BOX (vbox1), hseparator2, TRUE, TRUE, 0);

  frame3 = gtk_frame_new (NULL);
  gtk_widget_show (frame3);
  gtk_box_pack_start (GTK_BOX (vbox1), frame3, TRUE, TRUE, 0);
  gtk_frame_set_shadow_type (GTK_FRAME (frame3), GTK_SHADOW_NONE);

  alignment3 = gtk_alignment_new (0.5, 0.5, 1, 1);
  gtk_widget_show (alignment3);
  gtk_container_add (GTK_CONTAINER (frame3), alignment3);
  gtk_alignment_set_padding (GTK_ALIGNMENT (alignment3), 0, 0, 12, 0);

  vbox3 = gtk_vbox_new (FALSE, 0);
  gtk_widget_show (vbox3);
  gtk_container_add (GTK_CONTAINER (alignment3), vbox3);

  radiobutton1 = gtk_radio_button_new_with_mnemonic (NULL, _("Full Screen"));
  gtk_widget_show (radiobutton1);
  gtk_box_pack_start (GTK_BOX (vbox3), radiobutton1, FALSE, FALSE, 0);
  gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton1), radiobutton1_group);
  radiobutton1_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton1));

  radiobutton2 = gtk_radio_button_new_with_mnemonic (NULL, _("Normal Window"));
  gtk_widget_show (radiobutton2);
  gtk_box_pack_start (GTK_BOX (vbox3), radiobutton2, FALSE, FALSE, 0);
  gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton2), radiobutton1_group);
  radiobutton1_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton2));
  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radiobutton2), TRUE);

  label1 = gtk_label_new (_("<b> Screen Type</b>"));
  gtk_widget_show (label1);
  gtk_frame_set_label_widget (GTK_FRAME (frame3), label1);
  gtk_label_set_use_markup (GTK_LABEL (label1), TRUE);

  label_setup = gtk_label_new (_("Sending Setup"));
  gtk_widget_show (label_setup);
  gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), 0), label_setup);

  vbox2 = gtk_vbox_new (FALSE, 0);
  gtk_widget_show (vbox2);
  gtk_container_add (GTK_CONTAINER (notebook), vbox2);

  hbox2 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox2);
  gtk_box_pack_start (GTK_BOX (vbox2), hbox2, TRUE, TRUE, 0);

  label_src = gtk_label_new (_("Source"));
  gtk_widget_show (label_src);
  gtk_box_pack_start (GTK_BOX (hbox2), label_src, TRUE, FALSE, 0);

  label_dst = gtk_label_new (_("Destination"));
  gtk_widget_show (label_dst);
  gtk_box_pack_start (GTK_BOX (hbox2), label_dst, TRUE, FALSE, 0);

  scrolledwindow2 = gtk_scrolled_window_new (NULL, NULL);
  gtk_widget_show (scrolledwindow2);
  gtk_box_pack_start (GTK_BOX (vbox2), scrolledwindow2, TRUE, TRUE, 0);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow2), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);

  dialog_send_viewport2 = gtk_viewport_new (NULL, NULL);
  gtk_widget_show (dialog_send_viewport2);
  gtk_container_add (GTK_CONTAINER (scrolledwindow2), dialog_send_viewport2);

  label_state = gtk_label_new (_("Sending State"));
  gtk_widget_show (label_state);
  gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), 1), label_state);

  dialog_action_area = GTK_DIALOG (dialog_send)->action_area;
  gtk_widget_show (dialog_action_area);
  gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area), GTK_BUTTONBOX_END);

  buttonOK = gtk_button_new_from_stock ("gtk-ok");
  gtk_widget_show (buttonOK);
  gtk_dialog_add_action_widget (GTK_DIALOG (dialog_send), buttonOK, GTK_RESPONSE_OK);
  GTK_WIDGET_SET_FLAGS (buttonOK, GTK_CAN_DEFAULT);

  buttonCancel = gtk_button_new_from_stock ("gtk-cancel");
  gtk_widget_show (buttonCancel);
  gtk_dialog_add_action_widget (GTK_DIALOG (dialog_send), buttonCancel, GTK_RESPONSE_CANCEL);
  GTK_WIDGET_SET_FLAGS (buttonCancel, GTK_CAN_DEFAULT);

  buttonApply = gtk_button_new_from_stock ("gtk-apply");
  gtk_widget_show (buttonApply);
  gtk_dialog_add_action_widget (GTK_DIALOG (dialog_send), buttonApply, GTK_RESPONSE_APPLY);
  GTK_WIDGET_SET_FLAGS (buttonApply, GTK_CAN_DEFAULT);

  g_signal_connect ((gpointer) dialog_send, "delete_event",
                    G_CALLBACK (on_dialog_send_delete_event),
                    NULL);
  g_signal_connect ((gpointer) checkbutton0, "toggled",
                    G_CALLBACK (on_dialog_send_checkbutton0_toggled),
                    NULL);
  g_signal_connect ((gpointer) radiobutton1, "toggled",
                    G_CALLBACK (on_dialog_send_fullscreen_radiobutton_toggled),
                    NULL);
  g_signal_connect ((gpointer) radiobutton2, "toggled",
                    G_CALLBACK (on_dialog_send_window_radiobutton_toggled),
                    NULL);
  g_signal_connect ((gpointer) buttonOK, "clicked",
                    G_CALLBACK (on_dialog_send_buttonOK_clicked),
                    NULL);
  g_signal_connect ((gpointer) buttonCancel, "clicked",
                    G_CALLBACK (on_dialog_send_buttonCancel_clicked),
                    NULL);
  g_signal_connect ((gpointer) buttonApply, "clicked",
                    G_CALLBACK (on_dialog_send_buttonApply_clicked),
                    NULL);

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (dialog_send, dialog_send, "dialog_send");
  GLADE_HOOKUP_OBJECT_NO_REF (dialog_send, largevbox, "largevbox");
  GLADE_HOOKUP_OBJECT (dialog_send, notebook, "notebook");
  GLADE_HOOKUP_OBJECT (dialog_send, vbox1, "vbox1");
  GLADE_HOOKUP_OBJECT (dialog_send, frame1, "frame1");
  GLADE_HOOKUP_OBJECT (dialog_send, alignment1, "alignment1");
  GLADE_HOOKUP_OBJECT (dialog_send, dialog_send_hbox, "dialog_send_hbox");
  GLADE_HOOKUP_OBJECT (dialog_send, label_groupname, "label_groupname");
  GLADE_HOOKUP_OBJECT (dialog_send, label_source, "label_source");
  GLADE_HOOKUP_OBJECT (dialog_send, hseparator1, "hseparator1");
  GLADE_HOOKUP_OBJECT (dialog_send, frame2, "frame2");
  GLADE_HOOKUP_OBJECT (dialog_send, alignment2, "alignment2");
  GLADE_HOOKUP_OBJECT (dialog_send, hbox1, "hbox1");
  GLADE_HOOKUP_OBJECT (dialog_send, checkbutton0, "checkbutton0");
  GLADE_HOOKUP_OBJECT (dialog_send, scrolledwindow1, "scrolledwindow1");
  GLADE_HOOKUP_OBJECT (dialog_send, dialog_send_viewport1, "dialog_send_viewport1");
  GLADE_HOOKUP_OBJECT (dialog_send, label_destination, "label_destination");
  GLADE_HOOKUP_OBJECT (dialog_send, hseparator2, "hseparator2");
  GLADE_HOOKUP_OBJECT (dialog_send, frame3, "frame3");
  GLADE_HOOKUP_OBJECT (dialog_send, alignment3, "alignment3");
  GLADE_HOOKUP_OBJECT (dialog_send, vbox3, "vbox3");
  GLADE_HOOKUP_OBJECT (dialog_send, radiobutton1, "radiobutton1");
  GLADE_HOOKUP_OBJECT (dialog_send, radiobutton2, "radiobutton2");
  GLADE_HOOKUP_OBJECT (dialog_send, label1, "label1");
  GLADE_HOOKUP_OBJECT (dialog_send, label_setup, "label_setup");
  GLADE_HOOKUP_OBJECT (dialog_send, vbox2, "vbox2");
  GLADE_HOOKUP_OBJECT (dialog_send, hbox2, "hbox2");
  GLADE_HOOKUP_OBJECT (dialog_send, label_src, "label_src");
  GLADE_HOOKUP_OBJECT (dialog_send, label_dst, "label_dst");
  GLADE_HOOKUP_OBJECT (dialog_send, scrolledwindow2, "scrolledwindow2");
  GLADE_HOOKUP_OBJECT (dialog_send, dialog_send_viewport2, "dialog_send_viewport2");
  GLADE_HOOKUP_OBJECT (dialog_send, label_state, "label_state");
  GLADE_HOOKUP_OBJECT_NO_REF (dialog_send, dialog_action_area, "dialog_action_area");
  GLADE_HOOKUP_OBJECT (dialog_send, buttonOK, "buttonOK");
  GLADE_HOOKUP_OBJECT (dialog_send, buttonCancel, "buttonCancel");
  GLADE_HOOKUP_OBJECT (dialog_send, buttonApply, "buttonApply");

  return dialog_send;
}

GtkWidget*
create_dialog_IDinput (void)
{
  GtkWidget *dialog_IDinput;
  GtkWidget *largevbox;
  GtkWidget *vbox;
  GtkWidget *labelMsg;
  GtkWidget *entry;
  GtkWidget *hbuttonbox;
  GtkWidget *buttonOK;
  GtkWidget *buttonCancel;
  GtkAccelGroup *accel_group;

  accel_group = gtk_accel_group_new ();

  dialog_IDinput = gtk_dialog_new ();
  gtk_window_set_title (GTK_WINDOW (dialog_IDinput), _("MultiVNC Input ID"));
  gtk_window_set_position (GTK_WINDOW (dialog_IDinput), GTK_WIN_POS_CENTER);
  gtk_window_set_type_hint (GTK_WINDOW (dialog_IDinput), GDK_WINDOW_TYPE_HINT_DIALOG);

  largevbox = GTK_DIALOG (dialog_IDinput)->vbox;
  gtk_widget_show (largevbox);

  vbox = gtk_vbox_new (FALSE, 0);
  gtk_widget_show (vbox);
  gtk_box_pack_start (GTK_BOX (largevbox), vbox, TRUE, TRUE, 0);

  labelMsg = gtk_label_new (_("Please input your ID."));
  gtk_widget_show (labelMsg);
  gtk_box_pack_start (GTK_BOX (vbox), labelMsg, FALSE, FALSE, 0);
  gtk_widget_set_size_request (labelMsg, -1, 32);

  entry = gtk_entry_new ();
  gtk_widget_show (entry);
  gtk_box_pack_start (GTK_BOX (vbox), entry, FALSE, FALSE, 0);
  gtk_widget_set_size_request (entry, 150, -1);
  GTK_WIDGET_SET_FLAGS (entry, GTK_CAN_DEFAULT);
  gtk_entry_set_max_length (GTK_ENTRY (entry), 8);

  hbuttonbox = GTK_DIALOG (dialog_IDinput)->action_area;
  gtk_widget_show (hbuttonbox);
  gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox), GTK_BUTTONBOX_END);

  buttonOK = gtk_button_new_from_stock ("gtk-ok");
  gtk_widget_show (buttonOK);
  gtk_dialog_add_action_widget (GTK_DIALOG (dialog_IDinput), buttonOK, GTK_RESPONSE_OK);
  GTK_WIDGET_SET_FLAGS (buttonOK, GTK_CAN_DEFAULT);
  gtk_widget_add_accelerator (buttonOK, "clicked", accel_group,
                              GDK_Return, (GdkModifierType) 0,
                              GTK_ACCEL_VISIBLE);

  buttonCancel = gtk_button_new_from_stock ("gtk-cancel");
  gtk_widget_show (buttonCancel);
  gtk_dialog_add_action_widget (GTK_DIALOG (dialog_IDinput), buttonCancel, GTK_RESPONSE_CANCEL);
  GTK_WIDGET_SET_FLAGS (buttonCancel, GTK_CAN_DEFAULT);

  g_signal_connect ((gpointer) dialog_IDinput, "delete_event",
                    G_CALLBACK (on_dialog_IDinput_delete_event),
                    NULL);
  g_signal_connect ((gpointer) entry, "changed",
                    G_CALLBACK (on_dialog_IDinput_entry_changed),
                    NULL);
  g_signal_connect ((gpointer) buttonOK, "clicked",
                    G_CALLBACK (on_dialog_IDinput_buttonOK_clicked),
                    NULL);
  g_signal_connect ((gpointer) buttonCancel, "clicked",
                    G_CALLBACK (on_dialog_IDinput_buttonCancel_clicked),
                    NULL);

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (dialog_IDinput, dialog_IDinput, "dialog_IDinput");
  GLADE_HOOKUP_OBJECT_NO_REF (dialog_IDinput, largevbox, "largevbox");
  GLADE_HOOKUP_OBJECT (dialog_IDinput, vbox, "vbox");
  GLADE_HOOKUP_OBJECT (dialog_IDinput, labelMsg, "labelMsg");
  GLADE_HOOKUP_OBJECT (dialog_IDinput, entry, "entry");
  GLADE_HOOKUP_OBJECT_NO_REF (dialog_IDinput, hbuttonbox, "hbuttonbox");
  GLADE_HOOKUP_OBJECT (dialog_IDinput, buttonOK, "buttonOK");
  GLADE_HOOKUP_OBJECT (dialog_IDinput, buttonCancel, "buttonCancel");

  gtk_widget_grab_focus (entry);
  gtk_widget_grab_default (entry);
  gtk_window_add_accel_group (GTK_WINDOW (dialog_IDinput), accel_group);

  return dialog_IDinput;
}

GtkWidget*
create_dialog_lock (void)
{
  GtkWidget *dialog_lock;
  GtkWidget *largevbox;
  GtkWidget *frame;
  GtkWidget *alignment;
  GtkWidget *hbox;
  GtkWidget *dialog_lock_checkbutton0;
  GtkWidget *scrolledwindow;
  GtkWidget *dialog_lock_viewport;
  GtkWidget *label_userList;
  GtkWidget *dialog_action_area;
  GtkWidget *buttonOK;
  GtkWidget *buttonCancel;
  GtkWidget *buttonApply;

  dialog_lock = gtk_dialog_new ();
  gtk_widget_set_size_request (dialog_lock, 500, 300);
  gtk_window_set_title (GTK_WINDOW (dialog_lock), _("MultiVNC Lock Setting"));
  gtk_window_set_type_hint (GTK_WINDOW (dialog_lock), GDK_WINDOW_TYPE_HINT_DIALOG);

  largevbox = GTK_DIALOG (dialog_lock)->vbox;
  gtk_widget_show (largevbox);

  frame = gtk_frame_new (NULL);
  gtk_widget_show (frame);
  gtk_box_pack_start (GTK_BOX (largevbox), frame, TRUE, TRUE, 0);
  gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_NONE);

  alignment = gtk_alignment_new (0.5, 0.5, 1, 1);
  gtk_widget_show (alignment);
  gtk_container_add (GTK_CONTAINER (frame), alignment);
  gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 0, 0, 12, 0);

  hbox = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox);
  gtk_container_add (GTK_CONTAINER (alignment), hbox);

  dialog_lock_checkbutton0 = gtk_check_button_new_with_mnemonic (_("Lock All"));
  gtk_widget_show (dialog_lock_checkbutton0);
  gtk_box_pack_start (GTK_BOX (hbox), dialog_lock_checkbutton0, FALSE, FALSE, 0);

  scrolledwindow = gtk_scrolled_window_new (NULL, NULL);
  gtk_widget_show (scrolledwindow);
  gtk_box_pack_start (GTK_BOX (hbox), scrolledwindow, TRUE, TRUE, 0);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);

  dialog_lock_viewport = gtk_viewport_new (NULL, NULL);
  gtk_widget_show (dialog_lock_viewport);
  gtk_container_add (GTK_CONTAINER (scrolledwindow), dialog_lock_viewport);

  label_userList = gtk_label_new (_("<b>List of User</b>"));
  gtk_widget_show (label_userList);
  gtk_frame_set_label_widget (GTK_FRAME (frame), label_userList);
  gtk_label_set_use_markup (GTK_LABEL (label_userList), TRUE);

  dialog_action_area = GTK_DIALOG (dialog_lock)->action_area;
  gtk_widget_show (dialog_action_area);
  gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area), GTK_BUTTONBOX_END);

  buttonOK = gtk_button_new_from_stock ("gtk-ok");
  gtk_widget_show (buttonOK);
  gtk_dialog_add_action_widget (GTK_DIALOG (dialog_lock), buttonOK, GTK_RESPONSE_OK);
  GTK_WIDGET_SET_FLAGS (buttonOK, GTK_CAN_DEFAULT);

  buttonCancel = gtk_button_new_from_stock ("gtk-cancel");
  gtk_widget_show (buttonCancel);
  gtk_dialog_add_action_widget (GTK_DIALOG (dialog_lock), buttonCancel, GTK_RESPONSE_CANCEL);
  GTK_WIDGET_SET_FLAGS (buttonCancel, GTK_CAN_DEFAULT);

  buttonApply = gtk_button_new_from_stock ("gtk-apply");
  gtk_widget_show (buttonApply);
  gtk_dialog_add_action_widget (GTK_DIALOG (dialog_lock), buttonApply, GTK_RESPONSE_APPLY);
  GTK_WIDGET_SET_FLAGS (buttonApply, GTK_CAN_DEFAULT);

  g_signal_connect ((gpointer) dialog_lock, "delete_event",
                    G_CALLBACK (on_dialog_lock_delete_event),
                    NULL);
  g_signal_connect ((gpointer) dialog_lock_checkbutton0, "toggled",
                    G_CALLBACK (on_dialog_lock_checkbutton0_toggled),
                    NULL);
  g_signal_connect ((gpointer) buttonOK, "clicked",
                    G_CALLBACK (on_dialog_lock_buttonOK_clicked),
                    NULL);
  g_signal_connect ((gpointer) buttonCancel, "clicked",
                    G_CALLBACK (on_dialog_lock_buttonCancel_clicked),
                    NULL);
  g_signal_connect ((gpointer) buttonApply, "clicked",
                    G_CALLBACK (on_dialog_lock_buttonApply_clicked),
                    NULL);

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (dialog_lock, dialog_lock, "dialog_lock");
  GLADE_HOOKUP_OBJECT_NO_REF (dialog_lock, largevbox, "largevbox");
  GLADE_HOOKUP_OBJECT (dialog_lock, frame, "frame");
  GLADE_HOOKUP_OBJECT (dialog_lock, alignment, "alignment");
  GLADE_HOOKUP_OBJECT (dialog_lock, hbox, "hbox");
  GLADE_HOOKUP_OBJECT (dialog_lock, dialog_lock_checkbutton0, "dialog_lock_checkbutton0");
  GLADE_HOOKUP_OBJECT (dialog_lock, scrolledwindow, "scrolledwindow");
  GLADE_HOOKUP_OBJECT (dialog_lock, dialog_lock_viewport, "dialog_lock_viewport");
  GLADE_HOOKUP_OBJECT (dialog_lock, label_userList, "label_userList");
  GLADE_HOOKUP_OBJECT_NO_REF (dialog_lock, dialog_action_area, "dialog_action_area");
  GLADE_HOOKUP_OBJECT (dialog_lock, buttonOK, "buttonOK");
  GLADE_HOOKUP_OBJECT (dialog_lock, buttonCancel, "buttonCancel");
  GLADE_HOOKUP_OBJECT (dialog_lock, buttonApply, "buttonApply");

  return dialog_lock;
}

GtkWidget*
create_dialog_quit (void)
{
  GtkWidget *dialog_quit;
  GtkWidget *dialog_vbox;
  GtkWidget *label;
  GtkWidget *dialog_action_area;
  GtkWidget *buttonOK;
  GtkWidget *buttonCancel;
  GtkAccelGroup *accel_group;

  accel_group = gtk_accel_group_new ();

  dialog_quit = gtk_dialog_new ();
  gtk_window_set_title (GTK_WINDOW (dialog_quit), _("MultiVNC Quit"));
  gtk_window_set_position (GTK_WINDOW (dialog_quit), GTK_WIN_POS_CENTER);
  gtk_window_set_type_hint (GTK_WINDOW (dialog_quit), GDK_WINDOW_TYPE_HINT_DIALOG);

  dialog_vbox = GTK_DIALOG (dialog_quit)->vbox;
  gtk_widget_show (dialog_vbox);
  gtk_widget_set_size_request (dialog_vbox, 300, 100);

  label = gtk_label_new (_("Are you sure you want to quit?"));
  gtk_widget_show (label);
  gtk_box_pack_start (GTK_BOX (dialog_vbox), label, TRUE, TRUE, 0);

  dialog_action_area = GTK_DIALOG (dialog_quit)->action_area;
  gtk_widget_show (dialog_action_area);
  gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area), GTK_BUTTONBOX_END);

  buttonOK = gtk_button_new_from_stock ("gtk-ok");
  gtk_widget_show (buttonOK);
  gtk_dialog_add_action_widget (GTK_DIALOG (dialog_quit), buttonOK, GTK_RESPONSE_OK);
  GTK_WIDGET_SET_FLAGS (buttonOK, GTK_CAN_DEFAULT);
  gtk_widget_add_accelerator (buttonOK, "clicked", accel_group,
                              GDK_Return, (GdkModifierType) 0,
                              GTK_ACCEL_VISIBLE);

  buttonCancel = gtk_button_new_from_stock ("gtk-cancel");
  gtk_widget_show (buttonCancel);
  gtk_dialog_add_action_widget (GTK_DIALOG (dialog_quit), buttonCancel, GTK_RESPONSE_CANCEL);
  GTK_WIDGET_SET_FLAGS (buttonCancel, GTK_CAN_DEFAULT);

  g_signal_connect ((gpointer) dialog_quit, "delete_event",
                    G_CALLBACK (on_dialog_quit_delete_event),
                    NULL);
  g_signal_connect ((gpointer) buttonOK, "clicked",
                    G_CALLBACK (on_dialog_quit_buttonOK_clicked),
                    NULL);
  g_signal_connect ((gpointer) buttonCancel, "clicked",
                    G_CALLBACK (on_dialog_quit_buttonCancel_clicked),
                    NULL);

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (dialog_quit, dialog_quit, "dialog_quit");
  GLADE_HOOKUP_OBJECT_NO_REF (dialog_quit, dialog_vbox, "dialog_vbox");
  GLADE_HOOKUP_OBJECT (dialog_quit, label, "label");
  GLADE_HOOKUP_OBJECT_NO_REF (dialog_quit, dialog_action_area, "dialog_action_area");
  GLADE_HOOKUP_OBJECT (dialog_quit, buttonOK, "buttonOK");
  GLADE_HOOKUP_OBJECT (dialog_quit, buttonCancel, "buttonCancel");

  gtk_window_add_accel_group (GTK_WINDOW (dialog_quit), accel_group);

  return dialog_quit;
}

GtkWidget*
create_dialog_version (void)
{
  GtkWidget *dialog_version;
  GtkWidget *dialog_vbox;
  GtkWidget *label;
  GtkWidget *dialog_action_area;
  GtkWidget *buttonOK;

  dialog_version = gtk_dialog_new ();
  gtk_window_set_title (GTK_WINDOW (dialog_version), _("About MultiVNC"));
  gtk_window_set_position (GTK_WINDOW (dialog_version), GTK_WIN_POS_CENTER);
  gtk_window_set_type_hint (GTK_WINDOW (dialog_version), GDK_WINDOW_TYPE_HINT_DIALOG);

  dialog_vbox = GTK_DIALOG (dialog_version)->vbox;
  gtk_widget_show (dialog_vbox);
  gtk_widget_set_size_request (dialog_vbox, 300, 250);

  label = gtk_label_new (_("                     MultiVNC 1.4.2\n\nLtd.Alphasystems     http://www.alpha.co.jp\nMultiVNC URL         http://www.alpha.co.jp/multivnc\n\nTechnical Support    m-vnc@alpha.co.jp"));
  gtk_widget_show (label);
  gtk_box_pack_start (GTK_BOX (dialog_vbox), label, TRUE, FALSE, 0);

  dialog_action_area = GTK_DIALOG (dialog_version)->action_area;
  gtk_widget_show (dialog_action_area);
  gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area), GTK_BUTTONBOX_END);

  buttonOK = gtk_button_new_from_stock ("gtk-ok");
  gtk_widget_show (buttonOK);
  gtk_dialog_add_action_widget (GTK_DIALOG (dialog_version), buttonOK, GTK_RESPONSE_OK);
  GTK_WIDGET_SET_FLAGS (buttonOK, GTK_CAN_DEFAULT);

  g_signal_connect ((gpointer) dialog_version, "delete_event",
                    G_CALLBACK (on_dialog_version_delete_event),
                    NULL);
  g_signal_connect ((gpointer) buttonOK, "clicked",
                    G_CALLBACK (on_dialog_version_buttonOK_clicked),
                    NULL);

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (dialog_version, dialog_version, "dialog_version");
  GLADE_HOOKUP_OBJECT_NO_REF (dialog_version, dialog_vbox, "dialog_vbox");
  GLADE_HOOKUP_OBJECT (dialog_version, label, "label");
  GLADE_HOOKUP_OBJECT_NO_REF (dialog_version, dialog_action_area, "dialog_action_area");
  GLADE_HOOKUP_OBJECT (dialog_version, buttonOK, "buttonOK");

  return dialog_version;
}

GtkWidget*
create_window_ex (void)
{
  GtkWidget *window_ex;
  GtkWidget *vbox;
  GtkWidget *hbox;
  GtkWidget *label_ex;
  GtkWidget *window_ex_togglebutton;
  GtkWidget *aspectframe;
  GtkWidget *alignment5;
  GtkWidget *drawingarea_ex;

  window_ex = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_window_set_title (GTK_WINDOW (window_ex), _("Expanded screen"));

  vbox = gtk_vbox_new (FALSE, 0);
  gtk_widget_show (vbox);
  gtk_container_add (GTK_CONTAINER (window_ex), vbox);

  hbox = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox);
  gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, TRUE, 0);

  label_ex = gtk_label_new (_("ID"));
  gtk_widget_show (label_ex);
  gtk_box_pack_start (GTK_BOX (hbox), label_ex, TRUE, FALSE, 0);
  gtk_label_set_justify (GTK_LABEL (label_ex), GTK_JUSTIFY_CENTER);

  window_ex_togglebutton = gtk_toggle_button_new_with_mnemonic (_("Operation ON/OFF"));
  gtk_widget_show (window_ex_togglebutton);
  gtk_box_pack_start (GTK_BOX (hbox), window_ex_togglebutton, FALSE, FALSE, 0);

  aspectframe = gtk_aspect_frame_new (NULL, 0.5, 0.5, 1, TRUE);
  gtk_widget_show (aspectframe);
  gtk_box_pack_start (GTK_BOX (vbox), aspectframe, TRUE, TRUE, 0);
  gtk_frame_set_label_align (GTK_FRAME (aspectframe), 0, 0.5);
  gtk_frame_set_shadow_type (GTK_FRAME (aspectframe), GTK_SHADOW_NONE);

  alignment5 = gtk_alignment_new (0.5, 0.5, 1, 1);
  gtk_widget_show (alignment5);
  gtk_container_add (GTK_CONTAINER (aspectframe), alignment5);

  drawingarea_ex = gtk_drawing_area_new ();
  gtk_widget_show (drawingarea_ex);
  gtk_container_add (GTK_CONTAINER (alignment5), drawingarea_ex);

  g_signal_connect ((gpointer) window_ex, "delete_event",
                    G_CALLBACK (on_window_ex_delete_event),
                    NULL);
  g_signal_connect ((gpointer) window_ex, "key_press_event",
                    G_CALLBACK (on_window_ex_key_press_event),
                    NULL);
  g_signal_connect ((gpointer) window_ex, "key_release_event",
                    G_CALLBACK (on_window_ex_key_release_event),
                    NULL);
  g_signal_connect ((gpointer) window_ex, "focus_out_event",
                    G_CALLBACK (on_window_ex_focus_out_event),
                    NULL);
  g_signal_connect ((gpointer) window_ex_togglebutton, "toggled",
                    G_CALLBACK (on_window_ex_togglebutton_toggled),
                    NULL);
  g_signal_connect ((gpointer) aspectframe, "configure_event",
                    G_CALLBACK (on_aspectframe_configure_event),
                    NULL);
  g_signal_connect ((gpointer) aspectframe, "expose_event",
                    G_CALLBACK (on_aspectframe_expose_event),
                    NULL);
  g_signal_connect ((gpointer) drawingarea_ex, "button_press_event",
                    G_CALLBACK (on_drawingarea_ex_button_press_event),
                    NULL);
  g_signal_connect ((gpointer) drawingarea_ex, "button_release_event",
                    G_CALLBACK (on_drawingarea_ex_button_release_event),
                    NULL);
  g_signal_connect ((gpointer) drawingarea_ex, "configure_event",
                    G_CALLBACK (on_drawingarea_ex_configure_event),
                    NULL);
  g_signal_connect ((gpointer) drawingarea_ex, "expose_event",
                    G_CALLBACK (on_drawingarea_ex_expose_event),
                    NULL);
  g_signal_connect ((gpointer) drawingarea_ex, "motion_notify_event",
                    G_CALLBACK (on_drawingarea_ex_motion_notify_event),
                    NULL);

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (window_ex, window_ex, "window_ex");
  GLADE_HOOKUP_OBJECT (window_ex, vbox, "vbox");
  GLADE_HOOKUP_OBJECT (window_ex, hbox, "hbox");
  GLADE_HOOKUP_OBJECT (window_ex, label_ex, "label_ex");
  GLADE_HOOKUP_OBJECT (window_ex, window_ex_togglebutton, "window_ex_togglebutton");
  GLADE_HOOKUP_OBJECT (window_ex, aspectframe, "aspectframe");
  GLADE_HOOKUP_OBJECT (window_ex, alignment5, "alignment5");
  GLADE_HOOKUP_OBJECT (window_ex, drawingarea_ex, "drawingarea_ex");

  return window_ex;
}

GtkWidget*
create_dialog_notice (void)
{
  GtkWidget *dialog_notice;
  GtkWidget *dialog_vbox;
  GtkWidget *label_notice;
  GtkWidget *dialog_action_area;
  GtkWidget *dialog_notify_okbutton;

  dialog_notice = gtk_dialog_new ();
  gtk_window_set_title (GTK_WINDOW (dialog_notice), _("Notice"));
  gtk_window_set_type_hint (GTK_WINDOW (dialog_notice), GDK_WINDOW_TYPE_HINT_DIALOG);

  dialog_vbox = GTK_DIALOG (dialog_notice)->vbox;
  gtk_widget_show (dialog_vbox);

  label_notice = gtk_label_new (_("notice"));
  gtk_widget_show (label_notice);
  gtk_box_pack_start (GTK_BOX (dialog_vbox), label_notice, FALSE, FALSE, 0);

  dialog_action_area = GTK_DIALOG (dialog_notice)->action_area;
  gtk_widget_show (dialog_action_area);
  gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area), GTK_BUTTONBOX_END);

  dialog_notify_okbutton = gtk_button_new_from_stock ("gtk-ok");
  gtk_widget_show (dialog_notify_okbutton);
  gtk_dialog_add_action_widget (GTK_DIALOG (dialog_notice), dialog_notify_okbutton, GTK_RESPONSE_OK);
  GTK_WIDGET_SET_FLAGS (dialog_notify_okbutton, GTK_CAN_DEFAULT);

  g_signal_connect ((gpointer) dialog_notice, "delete_event",
                    G_CALLBACK (on_dialog_notice_delete_event),
                    NULL);
  g_signal_connect ((gpointer) dialog_notify_okbutton, "clicked",
                    G_CALLBACK (on_dialog_notify_okbutton_clicked),
                    NULL);

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (dialog_notice, dialog_notice, "dialog_notice");
  GLADE_HOOKUP_OBJECT_NO_REF (dialog_notice, dialog_vbox, "dialog_vbox");
  GLADE_HOOKUP_OBJECT (dialog_notice, label_notice, "label_notice");
  GLADE_HOOKUP_OBJECT_NO_REF (dialog_notice, dialog_action_area, "dialog_action_area");
  GLADE_HOOKUP_OBJECT (dialog_notice, dialog_notify_okbutton, "dialog_notify_okbutton");

  return dialog_notice;
}

