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

#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_lshw (void)
{
  GtkWidget *lshw;
  GtkWidget *vbox1;
  GtkWidget *menu;
  GtkWidget *menuitem4;
  GtkWidget *menuitem4_menu;
  GtkWidget *save;
  GtkWidget *quit1;
  GtkWidget *menuitem6;
  GtkWidget *menuitem6_menu;
  GtkWidget *refresh1;
  GtkWidget *menuitem7;
  GtkWidget *menuitem7_menu;
  GtkWidget *about1;
  GtkWidget *toolbar1;
  GtkIconSize tmp_toolbar_icon_size;
  GtkWidget *upbutton;
  GtkWidget *refreshbutton;
  GtkWidget *savebutton;
  GtkWidget *quitbutton;
  GtkWidget *scrolledwindow1;
  GtkWidget *viewport2;
  GtkWidget *hbox1;
  GtkWidget *hpaned1;
  GtkWidget *hbox3;
  GtkWidget *scrolledwindow10;
  GtkWidget *treeview1;
  GtkWidget *scrolledwindow11;
  GtkWidget *treeview2;
  GtkWidget *scrolledwindow12;
  GtkWidget *treeview3;
  GtkWidget *vbox2;
  GtkWidget *scrolledwindow13;
  GtkWidget *viewport3;
  GtkWidget *scrolledwindow14;
  GtkWidget *description;
  GtkWidget *statusbar;
  GtkAccelGroup *accel_group;
  GtkTooltips *tooltips;

  tooltips = gtk_tooltips_new ();

  accel_group = gtk_accel_group_new ();

  lshw = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_window_set_title (GTK_WINDOW (lshw), "lshw");
  gtk_window_set_default_size (GTK_WINDOW (lshw), 700, 480);

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

  menu = gtk_menu_bar_new ();
  gtk_widget_show (menu);
  gtk_box_pack_start (GTK_BOX (vbox1), menu, FALSE, FALSE, 0);

  menuitem4 = gtk_menu_item_new_with_mnemonic ("_File");
  gtk_widget_show (menuitem4);
  gtk_container_add (GTK_CONTAINER (menu), menuitem4);

  menuitem4_menu = gtk_menu_new ();
  gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem4), menuitem4_menu);

  save = gtk_image_menu_item_new_from_stock ("gtk-save", accel_group);
  gtk_widget_show (save);
  gtk_container_add (GTK_CONTAINER (menuitem4_menu), save);
  gtk_widget_set_sensitive (save, FALSE);

  quit1 = gtk_image_menu_item_new_from_stock ("gtk-quit", accel_group);
  gtk_widget_show (quit1);
  gtk_container_add (GTK_CONTAINER (menuitem4_menu), quit1);

  menuitem6 = gtk_menu_item_new_with_mnemonic ("_View");
  gtk_widget_show (menuitem6);
  gtk_container_add (GTK_CONTAINER (menu), menuitem6);

  menuitem6_menu = gtk_menu_new ();
  gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem6), menuitem6_menu);

  refresh1 = gtk_image_menu_item_new_from_stock ("gtk-refresh", accel_group);
  gtk_widget_show (refresh1);
  gtk_container_add (GTK_CONTAINER (menuitem6_menu), refresh1);
  gtk_widget_add_accelerator (refresh1, "activate", accel_group,
                              GDK_F5, (GdkModifierType) 0,
                              GTK_ACCEL_VISIBLE);

  menuitem7 = gtk_menu_item_new_with_mnemonic ("_Help");
  gtk_widget_show (menuitem7);
  gtk_container_add (GTK_CONTAINER (menu), menuitem7);

  menuitem7_menu = gtk_menu_new ();
  gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem7), menuitem7_menu);

  about1 = gtk_menu_item_new_with_mnemonic ("_About");
  gtk_widget_show (about1);
  gtk_container_add (GTK_CONTAINER (menuitem7_menu), about1);

  toolbar1 = gtk_toolbar_new ();
  gtk_widget_show (toolbar1);
  gtk_box_pack_start (GTK_BOX (vbox1), toolbar1, FALSE, FALSE, 0);
  gtk_toolbar_set_style (GTK_TOOLBAR (toolbar1), GTK_TOOLBAR_BOTH);
  tmp_toolbar_icon_size = gtk_toolbar_get_icon_size (GTK_TOOLBAR (toolbar1));

  upbutton = (GtkWidget*) gtk_tool_button_new_from_stock ("gtk-go-up");
  gtk_widget_show (upbutton);
  gtk_container_add (GTK_CONTAINER (toolbar1), upbutton);
  gtk_widget_set_sensitive (upbutton, FALSE);

  refreshbutton = (GtkWidget*) gtk_tool_button_new_from_stock ("gtk-refresh");
  gtk_widget_show (refreshbutton);
  gtk_container_add (GTK_CONTAINER (toolbar1), refreshbutton);
  gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (refreshbutton), tooltips, "Rescan the hardware", NULL);

  savebutton = (GtkWidget*) gtk_tool_button_new_from_stock ("gtk-save");
  gtk_widget_show (savebutton);
  gtk_container_add (GTK_CONTAINER (toolbar1), savebutton);
  gtk_widget_set_sensitive (savebutton, FALSE);

  quitbutton = (GtkWidget*) gtk_tool_button_new_from_stock ("gtk-quit");
  gtk_widget_show (quitbutton);
  gtk_container_add (GTK_CONTAINER (toolbar1), quitbutton);

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

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

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

  hpaned1 = gtk_hpaned_new ();
  gtk_widget_show (hpaned1);
  gtk_box_pack_start (GTK_BOX (hbox1), hpaned1, TRUE, TRUE, 0);

  hbox3 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox3);
  gtk_paned_pack1 (GTK_PANED (hpaned1), hbox3, FALSE, TRUE);

  scrolledwindow10 = gtk_scrolled_window_new (NULL, NULL);
  gtk_widget_show (scrolledwindow10);
  gtk_box_pack_start (GTK_BOX (hbox3), scrolledwindow10, TRUE, TRUE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (scrolledwindow10), 2);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow10), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
  gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow10), GTK_SHADOW_ETCHED_IN);

  treeview1 = gtk_tree_view_new ();
  gtk_widget_show (treeview1);
  gtk_container_add (GTK_CONTAINER (scrolledwindow10), treeview1);
  gtk_widget_set_size_request (treeview1, 128, -1);
  gtk_tooltips_set_tip (tooltips, treeview1, "Click to select and double-click to navigate", NULL);
  gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (treeview1), FALSE);

  scrolledwindow11 = gtk_scrolled_window_new (NULL, NULL);
  gtk_widget_show (scrolledwindow11);
  gtk_box_pack_start (GTK_BOX (hbox3), scrolledwindow11, TRUE, TRUE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (scrolledwindow11), 2);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow11), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
  gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow11), GTK_SHADOW_ETCHED_IN);

  treeview2 = gtk_tree_view_new ();
  gtk_widget_show (treeview2);
  gtk_container_add (GTK_CONTAINER (scrolledwindow11), treeview2);
  gtk_widget_set_size_request (treeview2, 128, -1);
  gtk_tooltips_set_tip (tooltips, treeview2, "Click to select and double-click to navigate", NULL);
  gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (treeview2), FALSE);

  scrolledwindow12 = gtk_scrolled_window_new (NULL, NULL);
  gtk_widget_show (scrolledwindow12);
  gtk_box_pack_start (GTK_BOX (hbox3), scrolledwindow12, TRUE, TRUE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (scrolledwindow12), 2);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow12), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
  gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow12), GTK_SHADOW_ETCHED_IN);

  treeview3 = gtk_tree_view_new ();
  gtk_widget_show (treeview3);
  gtk_container_add (GTK_CONTAINER (scrolledwindow12), treeview3);
  gtk_widget_set_size_request (treeview3, 128, -1);
  gtk_tooltips_set_tip (tooltips, treeview3, "Click to select and double-click to navigate", NULL);
  gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (treeview3), FALSE);

  vbox2 = gtk_vbox_new (FALSE, 0);
  gtk_widget_show (vbox2);
  gtk_paned_pack2 (GTK_PANED (hpaned1), vbox2, TRUE, TRUE);

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

  viewport3 = gtk_viewport_new (NULL, NULL);
  gtk_widget_show (viewport3);
  gtk_container_add (GTK_CONTAINER (scrolledwindow13), viewport3);
  gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport3), GTK_SHADOW_NONE);

  scrolledwindow14 = gtk_scrolled_window_new (NULL, NULL);
  gtk_widget_show (scrolledwindow14);
  gtk_container_add (GTK_CONTAINER (viewport3), scrolledwindow14);
  gtk_container_set_border_width (GTK_CONTAINER (scrolledwindow14), 2);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow14), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
  gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow14), GTK_SHADOW_ETCHED_IN);

  description = gtk_text_view_new ();
  gtk_widget_show (description);
  gtk_container_add (GTK_CONTAINER (scrolledwindow14), description);
  GTK_WIDGET_UNSET_FLAGS (description, GTK_CAN_FOCUS);
  gtk_tooltips_set_tip (tooltips, description, "This pane displays detailed information about the selected hardware node", NULL);
  gtk_text_view_set_editable (GTK_TEXT_VIEW (description), FALSE);
  gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (description), FALSE);
  gtk_text_view_set_left_margin (GTK_TEXT_VIEW (description), 10);
  gtk_text_view_set_right_margin (GTK_TEXT_VIEW (description), 10);
  gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (description)), "no information available.\n\nclick on Refresh to query hardware", -1);

  statusbar = gtk_statusbar_new ();
  gtk_widget_show (statusbar);
  gtk_box_pack_start (GTK_BOX (vbox1), statusbar, FALSE, FALSE, 0);
  gtk_statusbar_set_has_resize_grip (GTK_STATUSBAR (statusbar), FALSE);

  g_signal_connect ((gpointer) lshw, "delete_event",
                    G_CALLBACK (gtk_main_quit),
                    NULL);
  g_signal_connect_after ((gpointer) lshw, "map",
                          G_CALLBACK (on_lshw_map),
                          NULL);
  g_signal_connect ((gpointer) save, "activate",
                    G_CALLBACK (on_save_activate),
                    NULL);
  g_signal_connect ((gpointer) quit1, "activate",
                    G_CALLBACK (gtk_main_quit),
                    NULL);
  g_signal_connect ((gpointer) refresh1, "activate",
                    G_CALLBACK (refresh_display),
                    NULL);
  g_signal_connect ((gpointer) about1, "activate",
                    G_CALLBACK (on_about1_activate),
                    NULL);
  g_signal_connect ((gpointer) upbutton, "clicked",
                    G_CALLBACK (go_up),
                    NULL);
  g_signal_connect ((gpointer) refreshbutton, "clicked",
                    G_CALLBACK (refresh_display),
                    NULL);
  g_signal_connect ((gpointer) savebutton, "clicked",
                    G_CALLBACK (on_savebutton_clicked),
                    NULL);
  g_signal_connect ((gpointer) quitbutton, "clicked",
                    G_CALLBACK (gtk_main_quit),
                    NULL);
  g_signal_connect ((gpointer) treeview1, "row_activated",
                    G_CALLBACK (on_treeview1_row_activated),
                    NULL);
  g_signal_connect ((gpointer) treeview1, "cursor_changed",
                    G_CALLBACK (on_treeview1_cursor_changed),
                    NULL);
  g_signal_connect ((gpointer) treeview2, "row_activated",
                    G_CALLBACK (on_treeview2_row_activated),
                    NULL);
  g_signal_connect ((gpointer) treeview2, "cursor_changed",
                    G_CALLBACK (on_treeview2_cursor_changed),
                    NULL);
  g_signal_connect ((gpointer) treeview3, "row_activated",
                    G_CALLBACK (on_treeview3_row_activated),
                    NULL);
  g_signal_connect ((gpointer) treeview3, "cursor_changed",
                    G_CALLBACK (on_treeview3_cursor_changed),
                    NULL);

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (lshw, lshw, "lshw");
  GLADE_HOOKUP_OBJECT (lshw, vbox1, "vbox1");
  GLADE_HOOKUP_OBJECT (lshw, menu, "menu");
  GLADE_HOOKUP_OBJECT (lshw, menuitem4, "menuitem4");
  GLADE_HOOKUP_OBJECT (lshw, menuitem4_menu, "menuitem4_menu");
  GLADE_HOOKUP_OBJECT (lshw, save, "save");
  GLADE_HOOKUP_OBJECT (lshw, quit1, "quit1");
  GLADE_HOOKUP_OBJECT (lshw, menuitem6, "menuitem6");
  GLADE_HOOKUP_OBJECT (lshw, menuitem6_menu, "menuitem6_menu");
  GLADE_HOOKUP_OBJECT (lshw, refresh1, "refresh1");
  GLADE_HOOKUP_OBJECT (lshw, menuitem7, "menuitem7");
  GLADE_HOOKUP_OBJECT (lshw, menuitem7_menu, "menuitem7_menu");
  GLADE_HOOKUP_OBJECT (lshw, about1, "about1");
  GLADE_HOOKUP_OBJECT (lshw, toolbar1, "toolbar1");
  GLADE_HOOKUP_OBJECT (lshw, upbutton, "upbutton");
  GLADE_HOOKUP_OBJECT (lshw, refreshbutton, "refreshbutton");
  GLADE_HOOKUP_OBJECT (lshw, savebutton, "savebutton");
  GLADE_HOOKUP_OBJECT (lshw, quitbutton, "quitbutton");
  GLADE_HOOKUP_OBJECT (lshw, scrolledwindow1, "scrolledwindow1");
  GLADE_HOOKUP_OBJECT (lshw, viewport2, "viewport2");
  GLADE_HOOKUP_OBJECT (lshw, hbox1, "hbox1");
  GLADE_HOOKUP_OBJECT (lshw, hpaned1, "hpaned1");
  GLADE_HOOKUP_OBJECT (lshw, hbox3, "hbox3");
  GLADE_HOOKUP_OBJECT (lshw, scrolledwindow10, "scrolledwindow10");
  GLADE_HOOKUP_OBJECT (lshw, treeview1, "treeview1");
  GLADE_HOOKUP_OBJECT (lshw, scrolledwindow11, "scrolledwindow11");
  GLADE_HOOKUP_OBJECT (lshw, treeview2, "treeview2");
  GLADE_HOOKUP_OBJECT (lshw, scrolledwindow12, "scrolledwindow12");
  GLADE_HOOKUP_OBJECT (lshw, treeview3, "treeview3");
  GLADE_HOOKUP_OBJECT (lshw, vbox2, "vbox2");
  GLADE_HOOKUP_OBJECT (lshw, scrolledwindow13, "scrolledwindow13");
  GLADE_HOOKUP_OBJECT (lshw, viewport3, "viewport3");
  GLADE_HOOKUP_OBJECT (lshw, scrolledwindow14, "scrolledwindow14");
  GLADE_HOOKUP_OBJECT (lshw, description, "description");
  GLADE_HOOKUP_OBJECT (lshw, statusbar, "statusbar");
  GLADE_HOOKUP_OBJECT_NO_REF (lshw, tooltips, "tooltips");

  gtk_window_add_accel_group (GTK_WINDOW (lshw), accel_group);

  return lshw;
}

GtkWidget*
create_aboutlshw (void)
{
  GtkWidget *aboutlshw;
  GtkWidget *dialog_vbox1;
  GtkWidget *aboutext;
  GtkWidget *version;
  GtkWidget *dialog_action_area1;
  GtkWidget *closebutton1;

  aboutlshw = gtk_dialog_new ();
  gtk_window_set_title (GTK_WINDOW (aboutlshw), "About");
  gtk_window_set_position (GTK_WINDOW (aboutlshw), GTK_WIN_POS_CENTER_ON_PARENT);
  gtk_window_set_resizable (GTK_WINDOW (aboutlshw), FALSE);
  gtk_window_set_destroy_with_parent (GTK_WINDOW (aboutlshw), TRUE);
  gtk_window_set_skip_taskbar_hint (GTK_WINDOW (aboutlshw), TRUE);
  gtk_window_set_skip_pager_hint (GTK_WINDOW (aboutlshw), TRUE);
  gtk_window_set_type_hint (GTK_WINDOW (aboutlshw), GDK_WINDOW_TYPE_HINT_DIALOG);

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

  aboutext = gtk_label_new ("<big><b>GTK+ front-end for <tt>lshw</tt></b></big>\n\n\302\251 2004-2009 Lyonel Vincent\n<tt>lyonel@ezix.org</tt>\n\n<span foreground=\"blue\"><u>http://www.ezix.org/</u></span>");
  gtk_widget_show (aboutext);
  gtk_box_pack_start (GTK_BOX (dialog_vbox1), aboutext, FALSE, FALSE, 0);
  gtk_label_set_use_markup (GTK_LABEL (aboutext), TRUE);
  gtk_label_set_justify (GTK_LABEL (aboutext), GTK_JUSTIFY_CENTER);
  gtk_misc_set_padding (GTK_MISC (aboutext), 20, 20);

  version = gtk_label_new ("VERSION");
  gtk_widget_show (version);
  gtk_box_pack_start (GTK_BOX (dialog_vbox1), version, FALSE, FALSE, 0);
  gtk_label_set_justify (GTK_LABEL (version), GTK_JUSTIFY_CENTER);

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

  closebutton1 = gtk_button_new_from_stock ("gtk-close");
  gtk_widget_show (closebutton1);
  gtk_dialog_add_action_widget (GTK_DIALOG (aboutlshw), closebutton1, GTK_RESPONSE_CLOSE);
  GTK_WIDGET_SET_FLAGS (closebutton1, GTK_CAN_DEFAULT);

  g_signal_connect ((gpointer) version, "realize",
                    G_CALLBACK (on_version_realize),
                    NULL);
  g_signal_connect ((gpointer) closebutton1, "activate",
                    G_CALLBACK (on_aboutclose_activate),
                    NULL);
  g_signal_connect ((gpointer) closebutton1, "clicked",
                    G_CALLBACK (on_aboutclose_activate),
                    NULL);

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (aboutlshw, aboutlshw, "aboutlshw");
  GLADE_HOOKUP_OBJECT_NO_REF (aboutlshw, dialog_vbox1, "dialog_vbox1");
  GLADE_HOOKUP_OBJECT (aboutlshw, aboutext, "aboutext");
  GLADE_HOOKUP_OBJECT (aboutlshw, version, "version");
  GLADE_HOOKUP_OBJECT_NO_REF (aboutlshw, dialog_action_area1, "dialog_action_area1");
  GLADE_HOOKUP_OBJECT (aboutlshw, closebutton1, "closebutton1");

  return aboutlshw;
}

