Logo Search packages:      
Sourcecode: xdemorse version File versions  Download package

interface.c

/*
 * 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 *vbox1;
  GtkWidget *frame2;
  GtkWidget *rx_scrolledwindow;
  GtkWidget *rx_textview;
  GtkWidget *hbox4;
  GtkWidget *rx_togglebutton;
  GtkWidget *alignment3;
  GtkWidget *hbox5;
  GtkWidget *image2;
  GtkWidget *label9;
  GtkWidget *clear;
  GtkWidget *alignment4;
  GtkWidget *hbox6;
  GtkWidget *image3;
  GtkWidget *label10;
  GtkWidget *hbox1;
  GtkWidget *frame1;
  GtkWidget *alignment2;
  GtkWidget *scope;
  GtkWidget *label1;
  GtkWidget *hbox2;
  GtkWidget *vbox2;
  GtkWidget *frame4;
  GtkObject *speed_adj;
  GtkWidget *speed;
  GtkWidget *wpm;
  GtkWidget *frame5;
  GtkObject *squelch_adj;
  GtkWidget *squelch;
  GtkWidget *label8;
  GtkWidget *frame7;
  GtkWidget *alignment1;
  GtkWidget *waterfall;
  GtkWidget *label7;

  main_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_container_set_border_width (GTK_CONTAINER (main_window), 4);
  gtk_window_set_title (GTK_WINDOW (main_window), _("Xdemorse"));
  gtk_window_set_position (GTK_WINDOW (main_window), GTK_WIN_POS_CENTER);
  gtk_window_set_resizable (GTK_WINDOW (main_window), FALSE);

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

  frame2 = gtk_frame_new (NULL);
  gtk_widget_show (frame2);
  gtk_box_pack_start (GTK_BOX (vbox1), frame2, TRUE, TRUE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (frame2), 4);

  rx_scrolledwindow = gtk_scrolled_window_new (NULL, NULL);
  gtk_widget_show (rx_scrolledwindow);
  gtk_container_add (GTK_CONTAINER (frame2), rx_scrolledwindow);
  gtk_container_set_border_width (GTK_CONTAINER (rx_scrolledwindow), 4);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (rx_scrolledwindow), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
  gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (rx_scrolledwindow), GTK_SHADOW_IN);

  rx_textview = gtk_text_view_new ();
  gtk_widget_show (rx_textview);
  gtk_container_add (GTK_CONTAINER (rx_scrolledwindow), rx_textview);
  gtk_widget_set_size_request (rx_textview, 600, 256);
  gtk_text_view_set_editable (GTK_TEXT_VIEW (rx_textview), FALSE);
  gtk_text_view_set_accepts_tab (GTK_TEXT_VIEW (rx_textview), FALSE);
  gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (rx_textview), GTK_WRAP_WORD);

  hbox4 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox4);
  gtk_frame_set_label_widget (GTK_FRAME (frame2), hbox4);

  rx_togglebutton = gtk_toggle_button_new ();
  gtk_widget_show (rx_togglebutton);
  gtk_box_pack_start (GTK_BOX (hbox4), rx_togglebutton, TRUE, TRUE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (rx_togglebutton), 2);

  alignment3 = gtk_alignment_new (0.5, 0.5, 0, 0);
  gtk_widget_show (alignment3);
  gtk_container_add (GTK_CONTAINER (rx_togglebutton), alignment3);
  gtk_alignment_set_padding (GTK_ALIGNMENT (alignment3), 2, 2, 2, 2);

  hbox5 = gtk_hbox_new (FALSE, 2);
  gtk_widget_show (hbox5);
  gtk_container_add (GTK_CONTAINER (alignment3), hbox5);

  image2 = gtk_image_new_from_stock ("gtk-apply", GTK_ICON_SIZE_BUTTON);
  gtk_widget_show (image2);
  gtk_box_pack_start (GTK_BOX (hbox5), image2, FALSE, FALSE, 0);

  label9 = gtk_label_new_with_mnemonic (_("Receive"));
  gtk_widget_show (label9);
  gtk_box_pack_start (GTK_BOX (hbox5), label9, FALSE, FALSE, 0);

  clear = gtk_button_new ();
  gtk_widget_show (clear);
  gtk_box_pack_start (GTK_BOX (hbox4), clear, TRUE, TRUE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (clear), 2);

  alignment4 = gtk_alignment_new (0.5, 0.5, 0, 0);
  gtk_widget_show (alignment4);
  gtk_container_add (GTK_CONTAINER (clear), alignment4);
  gtk_alignment_set_padding (GTK_ALIGNMENT (alignment4), 2, 2, 2, 2);

  hbox6 = gtk_hbox_new (FALSE, 2);
  gtk_widget_show (hbox6);
  gtk_container_add (GTK_CONTAINER (alignment4), hbox6);

  image3 = gtk_image_new_from_stock ("gtk-clear", GTK_ICON_SIZE_BUTTON);
  gtk_widget_show (image3);
  gtk_box_pack_start (GTK_BOX (hbox6), image3, FALSE, FALSE, 0);

  label10 = gtk_label_new_with_mnemonic (_("Clear window"));
  gtk_widget_show (label10);
  gtk_box_pack_start (GTK_BOX (hbox6), label10, FALSE, FALSE, 0);

  hbox1 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox1);
  gtk_box_pack_start (GTK_BOX (vbox1), hbox1, TRUE, TRUE, 0);

  frame1 = gtk_frame_new (NULL);
  gtk_widget_show (frame1);
  gtk_box_pack_start (GTK_BOX (hbox1), frame1, TRUE, TRUE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (frame1), 4);

  alignment2 = gtk_alignment_new (0.5, 0.5, 1, 1);
  gtk_widget_show (alignment2);
  gtk_container_add (GTK_CONTAINER (frame1), alignment2);
  gtk_alignment_set_padding (GTK_ALIGNMENT (alignment2), 2, 2, 2, 2);

  scope = gtk_drawing_area_new ();
  gtk_widget_show (scope);
  gtk_container_add (GTK_CONTAINER (alignment2), scope);
  gtk_widget_set_size_request (scope, 264, 89);
  gtk_widget_set_events (scope, GDK_BUTTON_PRESS_MASK);

  label1 = gtk_label_new (_("Scope"));
  gtk_widget_show (label1);
  gtk_frame_set_label_widget (GTK_FRAME (frame1), label1);

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

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

  frame4 = gtk_frame_new (NULL);
  gtk_widget_show (frame4);
  gtk_box_pack_start (GTK_BOX (vbox2), frame4, TRUE, TRUE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (frame4), 4);

  speed_adj = gtk_adjustment_new (20, 10, 60, 1, 10, 0);
  speed = gtk_spin_button_new (GTK_ADJUSTMENT (speed_adj), 1, 0);
  gtk_widget_show (speed);
  gtk_container_add (GTK_CONTAINER (frame4), speed);

  wpm = gtk_check_button_new_with_mnemonic (_("Auto wpm"));
  gtk_widget_show (wpm);
  gtk_frame_set_label_widget (GTK_FRAME (frame4), wpm);
  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (wpm), TRUE);

  frame5 = gtk_frame_new (NULL);
  gtk_widget_show (frame5);
  gtk_box_pack_start (GTK_BOX (vbox2), frame5, TRUE, TRUE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (frame5), 4);

  squelch_adj = gtk_adjustment_new (50, 0, 100, 1, 10, 0);
  squelch = gtk_spin_button_new (GTK_ADJUSTMENT (squelch_adj), 1, 0);
  gtk_widget_show (squelch);
  gtk_container_add (GTK_CONTAINER (frame5), squelch);

  label8 = gtk_label_new (_("Threshold"));
  gtk_widget_show (label8);
  gtk_frame_set_label_widget (GTK_FRAME (frame5), label8);

  frame7 = gtk_frame_new (NULL);
  gtk_widget_show (frame7);
  gtk_box_pack_start (GTK_BOX (hbox2), frame7, TRUE, TRUE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (frame7), 4);

  alignment1 = gtk_alignment_new (0.5, 0.5, 1, 1);
  gtk_widget_show (alignment1);
  gtk_container_add (GTK_CONTAINER (frame7), alignment1);
  gtk_alignment_set_padding (GTK_ALIGNMENT (alignment1), 2, 2, 2, 2);

  waterfall = gtk_drawing_area_new ();
  gtk_widget_show (waterfall);
  gtk_container_add (GTK_CONTAINER (alignment1), waterfall);
  gtk_widget_set_size_request (waterfall, 258, 89);
  gtk_widget_set_events (waterfall, GDK_BUTTON_PRESS_MASK);

  label7 = gtk_label_new (_("Waterfall"));
  gtk_widget_show (label7);
  gtk_frame_set_label_widget (GTK_FRAME (frame7), label7);

  g_signal_connect ((gpointer) main_window, "destroy",
                    G_CALLBACK (on_main_window_destroy),
                    NULL);
  g_signal_connect ((gpointer) main_window, "delete_event",
                    G_CALLBACK (on_main_window_delete_event),
                    NULL);
  g_signal_connect ((gpointer) rx_togglebutton, "toggled",
                    G_CALLBACK (on_rx_togglebutton_toggled),
                    NULL);
  g_signal_connect ((gpointer) clear, "clicked",
                    G_CALLBACK (on_clear_clicked),
                    NULL);
  g_signal_connect ((gpointer) scope, "expose_event",
                    G_CALLBACK (on_scope_expose_event),
                    NULL);
  g_signal_connect ((gpointer) scope, "button_press_event",
                    G_CALLBACK (on_scope_button_press_event),
                    NULL);
  g_signal_connect ((gpointer) speed, "changed",
                    G_CALLBACK (on_speed_changed),
                    NULL);
  g_signal_connect ((gpointer) wpm, "toggled",
                    G_CALLBACK (on_wpm_toggled),
                    NULL);
  g_signal_connect ((gpointer) squelch, "changed",
                    G_CALLBACK (on_squelch_changed),
                    NULL);
  g_signal_connect ((gpointer) waterfall, "expose_event",
                    G_CALLBACK (on_waterfall_expose_event),
                    NULL);
  g_signal_connect ((gpointer) waterfall, "button_press_event",
                    G_CALLBACK (on_waterfall_button_press_event),
                    NULL);
  g_signal_connect ((gpointer) waterfall, "size_allocate",
                    G_CALLBACK (on_waterfall_size_allocate),
                    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, vbox1, "vbox1");
  GLADE_HOOKUP_OBJECT (main_window, frame2, "frame2");
  GLADE_HOOKUP_OBJECT (main_window, rx_scrolledwindow, "rx_scrolledwindow");
  GLADE_HOOKUP_OBJECT (main_window, rx_textview, "rx_textview");
  GLADE_HOOKUP_OBJECT (main_window, hbox4, "hbox4");
  GLADE_HOOKUP_OBJECT (main_window, rx_togglebutton, "rx_togglebutton");
  GLADE_HOOKUP_OBJECT (main_window, alignment3, "alignment3");
  GLADE_HOOKUP_OBJECT (main_window, hbox5, "hbox5");
  GLADE_HOOKUP_OBJECT (main_window, image2, "image2");
  GLADE_HOOKUP_OBJECT (main_window, label9, "label9");
  GLADE_HOOKUP_OBJECT (main_window, clear, "clear");
  GLADE_HOOKUP_OBJECT (main_window, alignment4, "alignment4");
  GLADE_HOOKUP_OBJECT (main_window, hbox6, "hbox6");
  GLADE_HOOKUP_OBJECT (main_window, image3, "image3");
  GLADE_HOOKUP_OBJECT (main_window, label10, "label10");
  GLADE_HOOKUP_OBJECT (main_window, hbox1, "hbox1");
  GLADE_HOOKUP_OBJECT (main_window, frame1, "frame1");
  GLADE_HOOKUP_OBJECT (main_window, alignment2, "alignment2");
  GLADE_HOOKUP_OBJECT (main_window, scope, "scope");
  GLADE_HOOKUP_OBJECT (main_window, label1, "label1");
  GLADE_HOOKUP_OBJECT (main_window, hbox2, "hbox2");
  GLADE_HOOKUP_OBJECT (main_window, vbox2, "vbox2");
  GLADE_HOOKUP_OBJECT (main_window, frame4, "frame4");
  GLADE_HOOKUP_OBJECT (main_window, speed, "speed");
  GLADE_HOOKUP_OBJECT (main_window, wpm, "wpm");
  GLADE_HOOKUP_OBJECT (main_window, frame5, "frame5");
  GLADE_HOOKUP_OBJECT (main_window, squelch, "squelch");
  GLADE_HOOKUP_OBJECT (main_window, label8, "label8");
  GLADE_HOOKUP_OBJECT (main_window, frame7, "frame7");
  GLADE_HOOKUP_OBJECT (main_window, alignment1, "alignment1");
  GLADE_HOOKUP_OBJECT (main_window, waterfall, "waterfall");
  GLADE_HOOKUP_OBJECT (main_window, label7, "label7");

  return main_window;
}

GtkWidget*
create_error_dialog (void)
{
  GtkWidget *error_dialog;
  GtkWidget *dialog_vbox1;
  GtkWidget *frame6;
  GtkWidget *hbox3;
  GtkWidget *image1;
  GtkWidget *error_message;
  GtkWidget *label6;
  GtkWidget *dialog_action_area1;
  GtkWidget *err_quit_button;
  GtkWidget *err_ok_button;

  error_dialog = gtk_dialog_new ();
  gtk_container_set_border_width (GTK_CONTAINER (error_dialog), 4);
  gtk_window_set_title (GTK_WINDOW (error_dialog), _("Xdemorse"));
  gtk_window_set_position (GTK_WINDOW (error_dialog), GTK_WIN_POS_MOUSE);
  gtk_window_set_modal (GTK_WINDOW (error_dialog), TRUE);
  gtk_window_set_type_hint (GTK_WINDOW (error_dialog), GDK_WINDOW_TYPE_HINT_DIALOG);

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

  frame6 = gtk_frame_new (NULL);
  gtk_widget_show (frame6);
  gtk_box_pack_start (GTK_BOX (dialog_vbox1), frame6, TRUE, TRUE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (frame6), 4);

  hbox3 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox3);
  gtk_container_add (GTK_CONTAINER (frame6), hbox3);

  image1 = gtk_image_new_from_stock ("gtk-dialog-error", GTK_ICON_SIZE_DIALOG);
  gtk_widget_show (image1);
  gtk_box_pack_start (GTK_BOX (hbox3), image1, FALSE, FALSE, 0);

  error_message = gtk_label_new (_("Generic Error Message pop-up"));
  gtk_widget_show (error_message);
  gtk_box_pack_start (GTK_BOX (hbox3), error_message, FALSE, FALSE, 0);
  gtk_misc_set_padding (GTK_MISC (error_message), 4, 0);

  label6 = gtk_label_new (_("Error!"));
  gtk_widget_show (label6);
  gtk_frame_set_label_widget (GTK_FRAME (frame6), label6);

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

  err_quit_button = gtk_button_new_from_stock ("gtk-quit");
  gtk_widget_show (err_quit_button);
  gtk_dialog_add_action_widget (GTK_DIALOG (error_dialog), err_quit_button, 0);
  gtk_container_set_border_width (GTK_CONTAINER (err_quit_button), 2);
  GTK_WIDGET_SET_FLAGS (err_quit_button, GTK_CAN_DEFAULT);

  err_ok_button = gtk_button_new_from_stock ("gtk-ok");
  gtk_widget_show (err_ok_button);
  gtk_dialog_add_action_widget (GTK_DIALOG (error_dialog), err_ok_button, GTK_RESPONSE_OK);
  gtk_container_set_border_width (GTK_CONTAINER (err_ok_button), 2);
  GTK_WIDGET_SET_FLAGS (err_ok_button, GTK_CAN_DEFAULT);

  g_signal_connect ((gpointer) error_dialog, "destroy",
                    G_CALLBACK (on_error_dialog_destroy),
                    NULL);
  g_signal_connect ((gpointer) error_dialog, "delete_event",
                    G_CALLBACK (on_error_dialog_delete_event),
                    NULL);
  g_signal_connect ((gpointer) err_quit_button, "clicked",
                    G_CALLBACK (on_err_quit_clicked),
                    NULL);
  g_signal_connect ((gpointer) err_ok_button, "clicked",
                    G_CALLBACK (on_err_ok_button_clicked),
                    NULL);

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (error_dialog, error_dialog, "error_dialog");
  GLADE_HOOKUP_OBJECT_NO_REF (error_dialog, dialog_vbox1, "dialog_vbox1");
  GLADE_HOOKUP_OBJECT (error_dialog, frame6, "frame6");
  GLADE_HOOKUP_OBJECT (error_dialog, hbox3, "hbox3");
  GLADE_HOOKUP_OBJECT (error_dialog, image1, "image1");
  GLADE_HOOKUP_OBJECT (error_dialog, error_message, "error_message");
  GLADE_HOOKUP_OBJECT (error_dialog, label6, "label6");
  GLADE_HOOKUP_OBJECT_NO_REF (error_dialog, dialog_action_area1, "dialog_action_area1");
  GLADE_HOOKUP_OBJECT (error_dialog, err_quit_button, "err_quit_button");
  GLADE_HOOKUP_OBJECT (error_dialog, err_ok_button, "err_ok_button");

  return error_dialog;
}


Generated by  Doxygen 1.6.0   Back to index