/*
 * 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_daliclock (void)
{
  GtkWidget *daliclock;
  GtkWidget *drawingarea;

  daliclock = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_window_set_title (GTK_WINDOW (daliclock), _("Dali Clock"));

  drawingarea = gtk_drawing_area_new ();
  gtk_widget_show (drawingarea);
  gtk_container_add (GTK_CONTAINER (daliclock), drawingarea);
  GTK_WIDGET_SET_FLAGS (drawingarea, GTK_CAN_FOCUS);
  GTK_WIDGET_SET_FLAGS (drawingarea, GTK_CAN_DEFAULT);
  gtk_widget_set_events (drawingarea, GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK);

  g_signal_connect ((gpointer) drawingarea, "button_press_event",
                    G_CALLBACK (on_drawingarea_button_press_event),
                    NULL);
  g_signal_connect ((gpointer) drawingarea, "button_release_event",
                    G_CALLBACK (on_drawingarea_button_release_event),
                    NULL);
  g_signal_connect ((gpointer) drawingarea, "expose_event",
                    G_CALLBACK (on_drawingarea_expose_event),
                    NULL);
  g_signal_connect ((gpointer) drawingarea, "key_press_event",
                    G_CALLBACK (on_drawingarea_key_press_event),
                    NULL);

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (daliclock, daliclock, "daliclock");
  GLADE_HOOKUP_OBJECT (daliclock, drawingarea, "drawingarea");

  gtk_widget_grab_focus (drawingarea);
  gtk_widget_grab_default (drawingarea);
  return daliclock;
}

GtkWidget*
create_dali_config (void)
{
  GtkWidget *dali_config;
  GtkWidget *dialog_vbox1;
  GtkWidget *vbox1;
  GtkWidget *hour_optionmenu;
  GtkWidget *menu1;
  GtkWidget *_12_hour_time;
  GtkWidget *_24_hour_time;
  GtkWidget *seconds_optionmenu;
  GtkWidget *menu2;
  GtkWidget *hms_menuitem;
  GtkWidget *hm_menuitem;
  GtkWidget *s_menuitem;
  GtkWidget *date_optionmenu;
  GtkWidget *menu3;
  GtkWidget *mm_dd_yy;
  GtkWidget *dd_mm_yy;
  GtkWidget *yy_mm_dd;
  GtkWidget *cycle_checkbutton;
  GtkWidget *transparent_checkbutton;
  GtkWidget *dialog_action_area1;
  GtkWidget *cancelbutton1;
  GtkWidget *okbutton1;

  dali_config = gtk_dialog_new ();
  gtk_window_set_title (GTK_WINDOW (dali_config), _("Dali Clock Configuration"));
  gtk_window_set_modal (GTK_WINDOW (dali_config), TRUE);
  gtk_window_set_type_hint (GTK_WINDOW (dali_config), GDK_WINDOW_TYPE_HINT_DIALOG);

  dialog_vbox1 = GTK_DIALOG (dali_config)->vbox;
  gtk_widget_show (dialog_vbox1);

  vbox1 = gtk_vbox_new (FALSE, 0);
  gtk_widget_show (vbox1);
  gtk_box_pack_start (GTK_BOX (dialog_vbox1), vbox1, TRUE, TRUE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (vbox1), 8);

  hour_optionmenu = gtk_option_menu_new ();
  gtk_widget_show (hour_optionmenu);
  gtk_box_pack_start (GTK_BOX (vbox1), hour_optionmenu, FALSE, FALSE, 0);

  menu1 = gtk_menu_new ();

  _12_hour_time = gtk_menu_item_new_with_mnemonic (_("12 Hour Time"));
  gtk_widget_show (_12_hour_time);
  gtk_container_add (GTK_CONTAINER (menu1), _12_hour_time);

  _24_hour_time = gtk_menu_item_new_with_mnemonic (_("24 Hour Time"));
  gtk_widget_show (_24_hour_time);
  gtk_container_add (GTK_CONTAINER (menu1), _24_hour_time);

  gtk_option_menu_set_menu (GTK_OPTION_MENU (hour_optionmenu), menu1);

  seconds_optionmenu = gtk_option_menu_new ();
  gtk_widget_show (seconds_optionmenu);
  gtk_box_pack_start (GTK_BOX (vbox1), seconds_optionmenu, FALSE, FALSE, 0);

  menu2 = gtk_menu_new ();

  hms_menuitem = gtk_menu_item_new_with_mnemonic (_("Hours, Minutes, and Seconds"));
  gtk_widget_show (hms_menuitem);
  gtk_container_add (GTK_CONTAINER (menu2), hms_menuitem);

  hm_menuitem = gtk_menu_item_new_with_mnemonic (_("Hours and Minutes"));
  gtk_widget_show (hm_menuitem);
  gtk_container_add (GTK_CONTAINER (menu2), hm_menuitem);

  s_menuitem = gtk_menu_item_new_with_mnemonic (_("Seconds Only"));
  gtk_widget_show (s_menuitem);
  gtk_container_add (GTK_CONTAINER (menu2), s_menuitem);

  gtk_option_menu_set_menu (GTK_OPTION_MENU (seconds_optionmenu), menu2);

  date_optionmenu = gtk_option_menu_new ();
  gtk_widget_show (date_optionmenu);
  gtk_box_pack_start (GTK_BOX (vbox1), date_optionmenu, FALSE, FALSE, 0);

  menu3 = gtk_menu_new ();

  mm_dd_yy = gtk_menu_item_new_with_mnemonic (_("MM-DD-YY"));
  gtk_widget_show (mm_dd_yy);
  gtk_container_add (GTK_CONTAINER (menu3), mm_dd_yy);

  dd_mm_yy = gtk_menu_item_new_with_mnemonic (_("DD-MM-YY"));
  gtk_widget_show (dd_mm_yy);
  gtk_container_add (GTK_CONTAINER (menu3), dd_mm_yy);

  yy_mm_dd = gtk_menu_item_new_with_mnemonic (_("YY-MM-DD"));
  gtk_widget_show (yy_mm_dd);
  gtk_container_add (GTK_CONTAINER (menu3), yy_mm_dd);

  gtk_option_menu_set_menu (GTK_OPTION_MENU (date_optionmenu), menu3);

  cycle_checkbutton = gtk_check_button_new_with_mnemonic (_("Cycle Colors"));
  gtk_widget_show (cycle_checkbutton);
  gtk_box_pack_start (GTK_BOX (vbox1), cycle_checkbutton, FALSE, FALSE, 0);

  transparent_checkbutton = gtk_check_button_new_with_mnemonic (_("Transparent Background"));
  gtk_widget_show (transparent_checkbutton);
  gtk_box_pack_start (GTK_BOX (vbox1), transparent_checkbutton, FALSE, FALSE, 0);

  dialog_action_area1 = GTK_DIALOG (dali_config)->action_area;
  gtk_widget_show (dialog_action_area1);
  gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area1), GTK_BUTTONBOX_END);

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

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

  g_signal_connect ((gpointer) dali_config, "response",
                    G_CALLBACK (on_dali_config_response),
                    NULL);
  g_signal_connect ((gpointer) _12_hour_time, "activate",
                    G_CALLBACK (on_12_activate),
                    NULL);
  g_signal_connect ((gpointer) _24_hour_time, "activate",
                    G_CALLBACK (on_24_activate),
                    NULL);
  g_signal_connect ((gpointer) hms_menuitem, "activate",
                    G_CALLBACK (on_hms_activate),
                    NULL);
  g_signal_connect ((gpointer) hm_menuitem, "activate",
                    G_CALLBACK (on_hm_activate),
                    NULL);
  g_signal_connect ((gpointer) s_menuitem, "activate",
                    G_CALLBACK (on_s_activate),
                    NULL);
  g_signal_connect ((gpointer) mm_dd_yy, "activate",
                    G_CALLBACK (on_mmddyy_activate),
                    NULL);
  g_signal_connect ((gpointer) dd_mm_yy, "activate",
                    G_CALLBACK (on_ddmmyy_activate),
                    NULL);
  g_signal_connect ((gpointer) yy_mm_dd, "activate",
                    G_CALLBACK (on_yymmdd_activate),
                    NULL);
  g_signal_connect ((gpointer) cycle_checkbutton, "toggled",
                    G_CALLBACK (on_cycle_checkbutton_toggled),
                    NULL);
  g_signal_connect ((gpointer) transparent_checkbutton, "toggled",
                    G_CALLBACK (on_transparent_checkbutton_toggled),
                    NULL);

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (dali_config, dali_config, "dali_config");
  GLADE_HOOKUP_OBJECT_NO_REF (dali_config, dialog_vbox1, "dialog_vbox1");
  GLADE_HOOKUP_OBJECT (dali_config, vbox1, "vbox1");
  GLADE_HOOKUP_OBJECT (dali_config, hour_optionmenu, "hour_optionmenu");
  GLADE_HOOKUP_OBJECT (dali_config, menu1, "menu1");
  GLADE_HOOKUP_OBJECT (dali_config, _12_hour_time, "_12_hour_time");
  GLADE_HOOKUP_OBJECT (dali_config, _24_hour_time, "_24_hour_time");
  GLADE_HOOKUP_OBJECT (dali_config, seconds_optionmenu, "seconds_optionmenu");
  GLADE_HOOKUP_OBJECT (dali_config, menu2, "menu2");
  GLADE_HOOKUP_OBJECT (dali_config, hms_menuitem, "hms_menuitem");
  GLADE_HOOKUP_OBJECT (dali_config, hm_menuitem, "hm_menuitem");
  GLADE_HOOKUP_OBJECT (dali_config, s_menuitem, "s_menuitem");
  GLADE_HOOKUP_OBJECT (dali_config, date_optionmenu, "date_optionmenu");
  GLADE_HOOKUP_OBJECT (dali_config, menu3, "menu3");
  GLADE_HOOKUP_OBJECT (dali_config, mm_dd_yy, "mm_dd_yy");
  GLADE_HOOKUP_OBJECT (dali_config, dd_mm_yy, "dd_mm_yy");
  GLADE_HOOKUP_OBJECT (dali_config, yy_mm_dd, "yy_mm_dd");
  GLADE_HOOKUP_OBJECT (dali_config, cycle_checkbutton, "cycle_checkbutton");
  GLADE_HOOKUP_OBJECT (dali_config, transparent_checkbutton, "transparent_checkbutton");
  GLADE_HOOKUP_OBJECT_NO_REF (dali_config, dialog_action_area1, "dialog_action_area1");
  GLADE_HOOKUP_OBJECT (dali_config, cancelbutton1, "cancelbutton1");
  GLADE_HOOKUP_OBJECT (dali_config, okbutton1, "okbutton1");

  return dali_config;
}

