/*
 * 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_drawing_window (void)
{
  GtkWidget *drawing_window;
  GtkWidget *vbox;
  GtkWidget *screen_label;
  GtkWidget *client_drawingarea;

  drawing_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_window_set_title (GTK_WINDOW (drawing_window), _("MultiVNC Recieving data"));

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

  screen_label = gtk_label_new (_("label1"));
  gtk_widget_show (screen_label);
  gtk_box_pack_start (GTK_BOX (vbox), screen_label, FALSE, FALSE, 0);

  client_drawingarea = gtk_drawing_area_new ();
  gtk_widget_show (client_drawingarea);
  gtk_box_pack_start (GTK_BOX (vbox), client_drawingarea, TRUE, TRUE, 0);
  gtk_widget_set_events (client_drawingarea, GDK_EXPOSURE_MASK | GDK_STRUCTURE_MASK);

  g_signal_connect ((gpointer) drawing_window, "delete_event",
                    G_CALLBACK (on_drawing_window_delete_event),
                    NULL);
  g_signal_connect ((gpointer) client_drawingarea, "configure_event",
                    G_CALLBACK (on_drawingarea_configure_event),
                    NULL);
  g_signal_connect ((gpointer) client_drawingarea, "expose_event",
                    G_CALLBACK (on_drawingarea_expose_event),
                    NULL);

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (drawing_window, drawing_window, "drawing_window");
  GLADE_HOOKUP_OBJECT (drawing_window, vbox, "vbox");
  GLADE_HOOKUP_OBJECT (drawing_window, screen_label, "screen_label");
  GLADE_HOOKUP_OBJECT (drawing_window, client_drawingarea, "client_drawingarea");

  return drawing_window;
}

GtkWidget*
create_dialog_IDinput (void)
{
  GtkWidget *dialog_IDinput;
  GtkWidget *large_vbox;
  GtkWidget *vbox;
  GtkWidget *label_ID;
  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 Authentication"));
  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);

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

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

  label_ID = gtk_label_new (_("Please input your ID."));
  gtk_widget_show (label_ID);
  gtk_box_pack_start (GTK_BOX (vbox), label_ID, FALSE, FALSE, 0);
  gtk_widget_set_size_request (label_ID, -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_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, "editing_done",
                    G_CALLBACK (on_dialog_IDinput_entry_editing_done),
                    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, large_vbox, "large_vbox");
  GLADE_HOOKUP_OBJECT (dialog_IDinput, vbox, "vbox");
  GLADE_HOOKUP_OBJECT (dialog_IDinput, label_ID, "label_ID");
  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_window_add_accel_group (GTK_WINDOW (dialog_IDinput), accel_group);

  return dialog_IDinput;
}

GtkWidget*
create_dialog_wait (void)
{
  GtkWidget *dialog_wait;
  GtkWidget *dialog_vbox;
  GtkWidget *label_msg;
  GtkWidget *dialog_action_area;
  GtkWidget *buttonStop;

  dialog_wait = gtk_dialog_new ();
  gtk_window_set_title (GTK_WINDOW (dialog_wait), _("MultiVNC Wait Connection..."));
  gtk_window_set_position (GTK_WINDOW (dialog_wait), GTK_WIN_POS_CENTER);
  gtk_window_set_type_hint (GTK_WINDOW (dialog_wait), GDK_WINDOW_TYPE_HINT_DIALOG);

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

  label_msg = gtk_label_new (_("Please wait..."));
  gtk_widget_show (label_msg);
  gtk_box_pack_start (GTK_BOX (dialog_vbox), label_msg, TRUE, TRUE, 0);
  gtk_widget_set_size_request (label_msg, 120, 50);

  dialog_action_area = GTK_DIALOG (dialog_wait)->action_area;
  gtk_widget_show (dialog_action_area);

  buttonStop = gtk_button_new_from_stock ("gtk-stop");
  gtk_widget_show (buttonStop);
  gtk_dialog_add_action_widget (GTK_DIALOG (dialog_wait), buttonStop, 0);
  GTK_WIDGET_SET_FLAGS (buttonStop, GTK_CAN_DEFAULT);

  g_signal_connect ((gpointer) dialog_wait, "delete_event",
                    G_CALLBACK (on_dialog_wait_delete_event),
                    NULL);
  g_signal_connect ((gpointer) buttonStop, "clicked",
                    G_CALLBACK (on_dialog_wait_buttonStop_clicked),
                    NULL);

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (dialog_wait, dialog_wait, "dialog_wait");
  GLADE_HOOKUP_OBJECT_NO_REF (dialog_wait, dialog_vbox, "dialog_vbox");
  GLADE_HOOKUP_OBJECT (dialog_wait, label_msg, "label_msg");
  GLADE_HOOKUP_OBJECT_NO_REF (dialog_wait, dialog_action_area, "dialog_action_area");
  GLADE_HOOKUP_OBJECT (dialog_wait, buttonStop, "buttonStop");

  return dialog_wait;
}

GtkWidget*
create_dialog_recvAdv (void)
{
  GtkWidget *dialog_recvAdv;
  GtkWidget *dialog_vbox;
  GtkWidget *recvAdv_label;
  GtkWidget *dialog_action_area;
  GtkWidget *buttonOK;
  GtkWidget *buttonCancel;

  dialog_recvAdv = gtk_dialog_new ();
  gtk_window_set_title (GTK_WINDOW (dialog_recvAdv), _("MultiVNC Recieve Advertisement"));
  gtk_window_set_position (GTK_WINDOW (dialog_recvAdv), GTK_WIN_POS_CENTER);
  gtk_window_set_type_hint (GTK_WINDOW (dialog_recvAdv), GDK_WINDOW_TYPE_HINT_DIALOG);

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

  recvAdv_label = gtk_label_new (_("Server Name : teacher\n\nDo you connect to this server?"));
  gtk_widget_show (recvAdv_label);
  gtk_box_pack_start (GTK_BOX (dialog_vbox), recvAdv_label, TRUE, TRUE, 0);

  dialog_action_area = GTK_DIALOG (dialog_recvAdv)->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_recvAdv), 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_recvAdv), buttonCancel, GTK_RESPONSE_CANCEL);
  GTK_WIDGET_SET_FLAGS (buttonCancel, GTK_CAN_DEFAULT);

  g_signal_connect ((gpointer) dialog_recvAdv, "delete_event",
                    G_CALLBACK (on_dialog_recvAdv_delete_event),
                    NULL);
  g_signal_connect ((gpointer) buttonOK, "clicked",
                    G_CALLBACK (on_dialog_recvAdv_buttonOK_clicked),
                    NULL);
  g_signal_connect ((gpointer) buttonOK, "activate",
                    G_CALLBACK (on_dialog_recvAdv_buttonOK_clicked),
                    NULL);
  g_signal_connect ((gpointer) buttonCancel, "clicked",
                    G_CALLBACK (on_dialog_recvAdv_buttonCancel_clicked),
                    NULL);

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

  return dialog_recvAdv;
}

GtkWidget*
create_dialog_inputmiss (void)
{
  GtkWidget *dialog_inputmiss;
  GtkWidget *dialog_vbox;
  GtkWidget *label_msg;
  GtkWidget *dialog_action_area;
  GtkWidget *buttonOK;

  dialog_inputmiss = gtk_dialog_new ();
  gtk_widget_set_size_request (dialog_inputmiss, 200, 120);
  gtk_window_set_title (GTK_WINDOW (dialog_inputmiss), _("MultiVNC Miss Input"));
  gtk_window_set_position (GTK_WINDOW (dialog_inputmiss), GTK_WIN_POS_CENTER);
  gtk_window_set_type_hint (GTK_WINDOW (dialog_inputmiss), GDK_WINDOW_TYPE_HINT_DIALOG);

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

  label_msg = gtk_label_new (_("The mistake was found in the input of ID. \nPlease input your ID again."));
  gtk_widget_show (label_msg);
  gtk_box_pack_start (GTK_BOX (dialog_vbox), label_msg, TRUE, TRUE, 0);

  dialog_action_area = GTK_DIALOG (dialog_inputmiss)->action_area;
  gtk_widget_show (dialog_action_area);

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

  g_signal_connect ((gpointer) dialog_inputmiss, "delete_event",
                    G_CALLBACK (on_dialog_inputmiss_delete_event),
                    NULL);
  g_signal_connect ((gpointer) buttonOK, "clicked",
                    G_CALLBACK (on_dialog_inputmiss_buttonOK_clicked),
                    NULL);
  g_signal_connect ((gpointer) buttonOK, "activate",
                    G_CALLBACK (on_dialog_inputmiss_buttonOK_clicked),
                    NULL);

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

  return dialog_inputmiss;
}

GtkWidget*
create_dialog_exit (void)
{
  GtkWidget *dialog_exit;
  GtkWidget *dialog_vbox;
  GtkWidget *label_msg;
  GtkWidget *dialog_action_area;
  GtkWidget *buttonOK;
  GtkWidget *buttonCancel;

  dialog_exit = gtk_dialog_new ();
  gtk_widget_set_size_request (dialog_exit, 280, 100);
  gtk_window_set_title (GTK_WINDOW (dialog_exit), _("MultiVNC Quit"));
  gtk_window_set_position (GTK_WINDOW (dialog_exit), GTK_WIN_POS_CENTER);
  gtk_window_set_type_hint (GTK_WINDOW (dialog_exit), GDK_WINDOW_TYPE_HINT_DIALOG);

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

  label_msg = gtk_label_new (_("Are you sure you want to quit MultiVNC client?\n"));
  gtk_widget_show (label_msg);
  gtk_box_pack_start (GTK_BOX (dialog_vbox), label_msg, FALSE, FALSE, 0);

  dialog_action_area = GTK_DIALOG (dialog_exit)->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_exit), 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_exit), buttonCancel, GTK_RESPONSE_CANCEL);
  GTK_WIDGET_SET_FLAGS (buttonCancel, GTK_CAN_DEFAULT);

  g_signal_connect ((gpointer) dialog_exit, "delete_event",
                    G_CALLBACK (on_dialog_exit_delete_event),
                    NULL);
  g_signal_connect ((gpointer) buttonOK, "clicked",
                    G_CALLBACK (on_dialog_exit_buttonOK_clicked),
                    NULL);
  g_signal_connect ((gpointer) buttonCancel, "clicked",
                    G_CALLBACK (on_dialog_exit_buttonCancel_clicked),
                    NULL);

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

  return dialog_exit;
}

