1164 lines
40 KiB
C
1164 lines
40 KiB
C
/* gui.c generated by valac 0.11.2.14-5f971, the Vala compiler
|
|
* generated from gui.vala, do not modify */
|
|
|
|
|
|
#include <glib.h>
|
|
#include <glib-object.h>
|
|
#include <gtk/gtk.h>
|
|
#include <squeue.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <glib/gstdio.h>
|
|
#include <stdio.h>
|
|
#include <float.h>
|
|
#include <math.h>
|
|
#include <gdk/gdk.h>
|
|
|
|
|
|
#define TYPE_MAIN_WINDOW (main_window_get_type ())
|
|
#define MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MAIN_WINDOW, MainWindow))
|
|
#define MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MAIN_WINDOW, MainWindowClass))
|
|
#define IS_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MAIN_WINDOW))
|
|
#define IS_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MAIN_WINDOW))
|
|
#define MAIN_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MAIN_WINDOW, MainWindowClass))
|
|
|
|
typedef struct _MainWindow MainWindow;
|
|
typedef struct _MainWindowClass MainWindowClass;
|
|
typedef struct _MainWindowPrivate MainWindowPrivate;
|
|
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
|
|
#define _g_free0(var) (var = (g_free (var), NULL))
|
|
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
|
|
|
|
struct _MainWindow {
|
|
GtkWindow parent_instance;
|
|
MainWindowPrivate * priv;
|
|
};
|
|
|
|
struct _MainWindowClass {
|
|
GtkWindowClass parent_class;
|
|
};
|
|
|
|
struct _MainWindowPrivate {
|
|
GtkTreeView* tv;
|
|
GtkProgressBar* pb;
|
|
GtkAboutDialog* aboutdialog1;
|
|
};
|
|
|
|
|
|
static gpointer main_window_parent_class = NULL;
|
|
static struct squeue_t* main_window_q;
|
|
static struct squeue_t* main_window_q = NULL;
|
|
static struct squeue_t* main_window_p;
|
|
static struct squeue_t* main_window_p = NULL;
|
|
static MainWindow* main_window_viewer;
|
|
static MainWindow* main_window_viewer = NULL;
|
|
|
|
GType main_window_get_type (void) G_GNUC_CONST;
|
|
#define MAIN_WINDOW_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_MAIN_WINDOW, MainWindowPrivate))
|
|
enum {
|
|
MAIN_WINDOW_DUMMY_PROPERTY
|
|
};
|
|
static void main_window_doCloseApplication (MainWindow* self);
|
|
static void main_window_OnReset (MainWindow* self);
|
|
static void main_window_OnFileFlashEvent (MainWindow* self);
|
|
gboolean main_window_showYesNo (MainWindow* self, const gchar* s);
|
|
void main_window_showMessage (MainWindow* self, const gchar* s, GtkMessageType mt);
|
|
static void main_window_OnFileOpenEvent (MainWindow* self);
|
|
void main_window_add_file (MainWindow* self, const gchar* type, const gchar* size, const gchar* file);
|
|
gboolean main_window_loadFile (MainWindow* self, const gchar* filename);
|
|
void main_window_showError (MainWindow* self, const gchar* s);
|
|
static void main_window_OnMenuHelpAboutActivatedEvent (MainWindow* self);
|
|
static void _lambda0_ (gint x, MainWindow* self);
|
|
static void __lambda0__gtk_dialog_response (GtkDialog* _sender, gint response_id, gpointer self);
|
|
static void main_window_OnFileNewEvent (MainWindow* self);
|
|
void main_window_list_clear (MainWindow* self);
|
|
static void main_window_OnQuitEvent (MainWindow* self);
|
|
void main_window_list_del (MainWindow* self);
|
|
void main_window_setup_treeview (GtkTreeView* view);
|
|
gboolean main_window_readFunc (void);
|
|
static void main_window_OnGetInformation (MainWindow* self);
|
|
void main_window_msg (MainWindow* self, const gchar* str);
|
|
static void main_window_OnConnect (MainWindow* self);
|
|
static void main_window_OnStop (MainWindow* self);
|
|
static gboolean main_window_chk_queues (MainWindow* self);
|
|
static gint main_window_main (gchar** args, int args_length1);
|
|
MainWindow* main_window_new (void);
|
|
MainWindow* main_window_construct (GType object_type);
|
|
static gboolean _lambda1_ (GtkWidget* x, GdkEvent* y);
|
|
static gboolean __lambda1__gtk_widget_delete_event (GtkWidget* _sender, GdkEvent* event, gpointer self);
|
|
static GObject * main_window_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
|
|
static void _main_window_OnFileNewEvent_gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self);
|
|
static void _main_window_OnFileOpenEvent_gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self);
|
|
static void _main_window_OnQuitEvent_gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self);
|
|
static void _main_window_OnConnect_gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self);
|
|
static void _main_window_OnStop_gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self);
|
|
static void _main_window_OnGetInformation_gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self);
|
|
static void _main_window_OnReset_gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self);
|
|
static void _main_window_OnMenuHelpAboutActivatedEvent_gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self);
|
|
static void _main_window_OnConnect_gtk_button_clicked (GtkButton* _sender, gpointer self);
|
|
static void _main_window_OnStop_gtk_button_clicked (GtkButton* _sender, gpointer self);
|
|
static void _main_window_OnGetInformation_gtk_button_clicked (GtkButton* _sender, gpointer self);
|
|
static void _main_window_OnFileOpenEvent_gtk_button_clicked (GtkButton* _sender, gpointer self);
|
|
static void _main_window_list_del_gtk_button_clicked (GtkButton* _sender, gpointer self);
|
|
static void _main_window_OnFileFlashEvent_gtk_button_clicked (GtkButton* _sender, gpointer self);
|
|
static gboolean _gtk_widget_hide_on_delete_gtk_widget_delete_event (GtkWidget* _sender, GdkEvent* event, gpointer self);
|
|
static void main_window_finalize (GObject* obj);
|
|
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
|
|
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
|
|
static gint _vala_array_length (gpointer array);
|
|
|
|
|
|
static void main_window_doCloseApplication (MainWindow* self) {
|
|
g_return_if_fail (self != NULL);
|
|
gtk_main_quit ();
|
|
}
|
|
|
|
|
|
static void main_window_OnReset (MainWindow* self) {
|
|
g_return_if_fail (self != NULL);
|
|
squeue_push (main_window_q, "reset:device", 1);
|
|
}
|
|
|
|
|
|
static gpointer _g_object_ref0 (gpointer self) {
|
|
return self ? g_object_ref (self) : NULL;
|
|
}
|
|
|
|
|
|
static void main_window_OnFileFlashEvent (MainWindow* self) {
|
|
GtkTreeModel* _tmp0_ = NULL;
|
|
GtkListStore* _tmp1_;
|
|
GtkListStore* ls;
|
|
const gchar* str;
|
|
GtkTreeIter iter = {0};
|
|
gint _tmp2_;
|
|
gint n;
|
|
g_return_if_fail (self != NULL);
|
|
_tmp0_ = gtk_tree_view_get_model (self->priv->tv);
|
|
_tmp1_ = _g_object_ref0 (GTK_LIST_STORE (_tmp0_));
|
|
ls = _tmp1_;
|
|
str = NULL;
|
|
_tmp2_ = gtk_tree_model_iter_n_children ((GtkTreeModel*) ls, NULL);
|
|
n = _tmp2_;
|
|
if (n > 0) {
|
|
gboolean _tmp3_;
|
|
_tmp3_ = main_window_showYesNo (self, "Do you want to flash these files?");
|
|
if (_tmp3_) {
|
|
GtkTreeIter _tmp4_ = {0};
|
|
gtk_tree_model_get_iter_first ((GtkTreeModel*) ls, &_tmp4_);
|
|
iter = _tmp4_;
|
|
{
|
|
gboolean _tmp5_;
|
|
_tmp5_ = TRUE;
|
|
while (TRUE) {
|
|
if (!_tmp5_) {
|
|
gboolean _tmp6_;
|
|
_tmp6_ = gtk_tree_model_iter_next ((GtkTreeModel*) ls, &iter);
|
|
if (!_tmp6_) {
|
|
break;
|
|
}
|
|
}
|
|
_tmp5_ = FALSE;
|
|
gtk_tree_model_get ((GtkTreeModel*) ls, &iter, 2, &str, -1, -1);
|
|
squeue_push2 (main_window_q, "flash", str, 1);
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
main_window_showMessage (self, "No files selected", GTK_MESSAGE_ERROR);
|
|
}
|
|
_g_object_unref0 (ls);
|
|
}
|
|
|
|
|
|
static void main_window_OnFileOpenEvent (MainWindow* self) {
|
|
GtkFileChooserDialog* _tmp0_ = NULL;
|
|
GtkFileChooserDialog* fc;
|
|
gint _tmp1_;
|
|
gint resp;
|
|
g_return_if_fail (self != NULL);
|
|
_tmp0_ = (GtkFileChooserDialog*) gtk_file_chooser_dialog_new ("Select file to open", (GtkWindow*) self, GTK_FILE_CHOOSER_ACTION_OPEN, "gtk-cancel", GTK_RESPONSE_CANCEL, "gtk-open", GTK_RESPONSE_ACCEPT, NULL);
|
|
fc = g_object_ref_sink (_tmp0_);
|
|
_tmp1_ = gtk_dialog_run ((GtkDialog*) fc);
|
|
resp = _tmp1_;
|
|
gtk_widget_hide ((GtkWidget*) fc);
|
|
if (resp == GTK_RESPONSE_ACCEPT) {
|
|
gchar* _tmp2_ = NULL;
|
|
gchar* file;
|
|
gchar* _tmp3_ = NULL;
|
|
const gchar* type;
|
|
glong _tmp4_;
|
|
gchar* _tmp5_ = NULL;
|
|
gchar* size;
|
|
_tmp2_ = gtk_file_chooser_get_filename ((GtkFileChooser*) fc);
|
|
file = _tmp2_;
|
|
_tmp3_ = fpid_file (file);
|
|
type = _tmp3_;
|
|
_tmp4_ = fpid_size (file);
|
|
_tmp5_ = g_strdup_printf ("%ld", _tmp4_);
|
|
size = _tmp5_;
|
|
if (type == NULL) {
|
|
main_window_showMessage (self, "Invalid file type", GTK_MESSAGE_ERROR);
|
|
} else {
|
|
main_window_add_file (self, type, size, file);
|
|
}
|
|
_g_free0 (size);
|
|
_g_free0 (file);
|
|
}
|
|
gtk_object_destroy ((GtkObject*) fc);
|
|
_g_object_unref0 (fc);
|
|
}
|
|
|
|
|
|
gboolean main_window_loadFile (MainWindow* self, const gchar* filename) {
|
|
gboolean result = FALSE;
|
|
gint err;
|
|
gchar* contents;
|
|
gsize length = 0UL;
|
|
gchar* _tmp0_ = NULL;
|
|
gsize _tmp1_;
|
|
GError * _inner_error_ = NULL;
|
|
g_return_val_if_fail (self != NULL, FALSE);
|
|
g_return_val_if_fail (filename != NULL, FALSE);
|
|
err = 0;
|
|
contents = NULL;
|
|
g_file_get_contents (filename, &_tmp0_, &_tmp1_, &_inner_error_);
|
|
_g_free0 (contents);
|
|
contents = _tmp0_;
|
|
length = _tmp1_;
|
|
if (_inner_error_ != NULL) {
|
|
_g_free0 (contents);
|
|
goto __catch0_g_error;
|
|
}
|
|
_g_free0 (contents);
|
|
goto __finally0;
|
|
__catch0_g_error:
|
|
{
|
|
GError * e;
|
|
gchar* _tmp2_;
|
|
e = _inner_error_;
|
|
_inner_error_ = NULL;
|
|
_tmp2_ = g_strconcat ("Unexpected error while loading the file, please contact the author wit" \
|
|
"h the following information:\n" \
|
|
"\n", e->message, NULL);
|
|
main_window_showError (self, _tmp2_);
|
|
_g_free0 (_tmp2_);
|
|
err++;
|
|
_g_error_free0 (e);
|
|
}
|
|
__finally0:
|
|
if (_inner_error_ != NULL) {
|
|
g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
|
|
g_clear_error (&_inner_error_);
|
|
return FALSE;
|
|
}
|
|
result = err == 0;
|
|
return result;
|
|
}
|
|
|
|
|
|
gboolean main_window_showYesNo (MainWindow* self, const gchar* s) {
|
|
gboolean result = FALSE;
|
|
GtkMessageDialog* _tmp0_ = NULL;
|
|
GtkMessageDialog* md;
|
|
gint _tmp1_;
|
|
gint ret;
|
|
g_return_val_if_fail (self != NULL, FALSE);
|
|
g_return_val_if_fail (s != NULL, FALSE);
|
|
_tmp0_ = (GtkMessageDialog*) gtk_message_dialog_new ((GtkWindow*) self, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO, s);
|
|
md = g_object_ref_sink (_tmp0_);
|
|
_tmp1_ = gtk_dialog_run ((GtkDialog*) md);
|
|
ret = _tmp1_;
|
|
gtk_object_destroy ((GtkObject*) md);
|
|
result = ret == GTK_RESPONSE_YES;
|
|
_g_object_unref0 (md);
|
|
return result;
|
|
}
|
|
|
|
|
|
void main_window_showMessage (MainWindow* self, const gchar* s, GtkMessageType mt) {
|
|
GtkMessageDialog* _tmp0_ = NULL;
|
|
GtkMessageDialog* md;
|
|
g_return_if_fail (self != NULL);
|
|
g_return_if_fail (s != NULL);
|
|
_tmp0_ = (GtkMessageDialog*) gtk_message_dialog_new ((GtkWindow*) self, GTK_DIALOG_DESTROY_WITH_PARENT, mt, GTK_BUTTONS_CLOSE, s);
|
|
md = g_object_ref_sink (_tmp0_);
|
|
gtk_dialog_run ((GtkDialog*) md);
|
|
gtk_object_destroy ((GtkObject*) md);
|
|
_g_object_unref0 (md);
|
|
}
|
|
|
|
|
|
static void _lambda0_ (gint x, MainWindow* self) {
|
|
gtk_widget_hide ((GtkWidget*) self->priv->aboutdialog1);
|
|
}
|
|
|
|
|
|
static void __lambda0__gtk_dialog_response (GtkDialog* _sender, gint response_id, gpointer self) {
|
|
_lambda0_ (response_id, self);
|
|
}
|
|
|
|
|
|
static void main_window_OnMenuHelpAboutActivatedEvent (MainWindow* self) {
|
|
g_return_if_fail (self != NULL);
|
|
gtk_window_set_transient_for ((GtkWindow*) self->priv->aboutdialog1, (GtkWindow*) self);
|
|
g_signal_connect_object ((GtkDialog*) self->priv->aboutdialog1, "response", (GCallback) __lambda0__gtk_dialog_response, self, 0);
|
|
gtk_dialog_run ((GtkDialog*) self->priv->aboutdialog1);
|
|
}
|
|
|
|
|
|
void main_window_showError (MainWindow* self, const gchar* s) {
|
|
GtkMessageDialog* _tmp0_ = NULL;
|
|
GtkMessageDialog* md;
|
|
g_return_if_fail (self != NULL);
|
|
g_return_if_fail (s != NULL);
|
|
_tmp0_ = (GtkMessageDialog*) gtk_message_dialog_new ((GtkWindow*) self, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, s);
|
|
md = g_object_ref_sink (_tmp0_);
|
|
gtk_dialog_run ((GtkDialog*) md);
|
|
gtk_object_destroy ((GtkObject*) md);
|
|
_g_object_unref0 (md);
|
|
}
|
|
|
|
|
|
static void main_window_OnFileNewEvent (MainWindow* self) {
|
|
g_return_if_fail (self != NULL);
|
|
main_window_list_clear (self);
|
|
}
|
|
|
|
|
|
static void main_window_OnQuitEvent (MainWindow* self) {
|
|
g_return_if_fail (self != NULL);
|
|
main_window_doCloseApplication (self);
|
|
}
|
|
|
|
|
|
void main_window_list_clear (MainWindow* self) {
|
|
GtkTreeModel* _tmp0_ = NULL;
|
|
g_return_if_fail (self != NULL);
|
|
_tmp0_ = gtk_tree_view_get_model (self->priv->tv);
|
|
gtk_list_store_clear (GTK_LIST_STORE (_tmp0_));
|
|
}
|
|
|
|
|
|
void main_window_list_del (MainWindow* self) {
|
|
GtkTreeIter iter = {0};
|
|
GtkTreeModel* model;
|
|
GtkTreeSelection* _tmp0_ = NULL;
|
|
GtkTreeSelection* _tmp1_;
|
|
GtkTreeSelection* sel;
|
|
gint _tmp2_;
|
|
g_return_if_fail (self != NULL);
|
|
model = NULL;
|
|
_tmp0_ = gtk_tree_view_get_selection (self->priv->tv);
|
|
_tmp1_ = _g_object_ref0 (_tmp0_);
|
|
sel = _tmp1_;
|
|
_tmp2_ = gtk_tree_selection_count_selected_rows (sel);
|
|
if (_tmp2_ == 1) {
|
|
GtkTreeModel* _tmp3_ = NULL;
|
|
GtkTreeIter _tmp4_ = {0};
|
|
GtkTreeModel* _tmp5_;
|
|
GtkTreeModel* _tmp6_ = NULL;
|
|
gtk_tree_selection_get_selected (sel, &_tmp3_, &_tmp4_);
|
|
_g_object_unref0 (model);
|
|
_tmp5_ = _g_object_ref0 (_tmp3_);
|
|
model = _tmp5_;
|
|
iter = _tmp4_;
|
|
_tmp6_ = gtk_tree_view_get_model (self->priv->tv);
|
|
gtk_list_store_remove (GTK_LIST_STORE (_tmp6_), &iter);
|
|
}
|
|
_g_object_unref0 (sel);
|
|
_g_object_unref0 (model);
|
|
}
|
|
|
|
|
|
void main_window_add_file (MainWindow* self, const gchar* type, const gchar* size, const gchar* file) {
|
|
GtkTreeModel* _tmp0_ = NULL;
|
|
GtkListStore* _tmp1_;
|
|
GtkListStore* listmodel;
|
|
GtkTreeIter iter = {0};
|
|
GtkTreeIter _tmp2_ = {0};
|
|
g_return_if_fail (self != NULL);
|
|
g_return_if_fail (type != NULL);
|
|
g_return_if_fail (size != NULL);
|
|
g_return_if_fail (file != NULL);
|
|
_tmp0_ = gtk_tree_view_get_model (self->priv->tv);
|
|
_tmp1_ = _g_object_ref0 (GTK_LIST_STORE (_tmp0_));
|
|
listmodel = _tmp1_;
|
|
gtk_list_store_append (listmodel, &_tmp2_);
|
|
iter = _tmp2_;
|
|
gtk_list_store_set (listmodel, &iter, 0, type, 1, size, 2, file, -1, -1);
|
|
_g_object_unref0 (listmodel);
|
|
}
|
|
|
|
|
|
void main_window_setup_treeview (GtkTreeView* view) {
|
|
GtkListStore* _tmp0_ = NULL;
|
|
GtkListStore* listmodel;
|
|
GtkCellRendererText* _tmp1_ = NULL;
|
|
GtkCellRendererText* _tmp2_;
|
|
GtkCellRendererText* _tmp3_ = NULL;
|
|
GtkCellRendererText* _tmp4_;
|
|
GtkCellRendererText* _tmp5_ = NULL;
|
|
GtkCellRendererText* cell;
|
|
g_return_if_fail (view != NULL);
|
|
_tmp0_ = gtk_list_store_new (4, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING);
|
|
listmodel = _tmp0_;
|
|
gtk_tree_view_set_model (view, (GtkTreeModel*) listmodel);
|
|
_tmp1_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
|
|
_tmp2_ = g_object_ref_sink (_tmp1_);
|
|
gtk_tree_view_insert_column_with_attributes (view, -1, "Type", (GtkCellRenderer*) _tmp2_, "text", 0, NULL, NULL);
|
|
_g_object_unref0 (_tmp2_);
|
|
_tmp3_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
|
|
_tmp4_ = g_object_ref_sink (_tmp3_);
|
|
gtk_tree_view_insert_column_with_attributes (view, -1, "Size", (GtkCellRenderer*) _tmp4_, "text", 1, NULL, NULL);
|
|
_g_object_unref0 (_tmp4_);
|
|
_tmp5_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
|
|
cell = g_object_ref_sink (_tmp5_);
|
|
g_object_set ((GObject*) cell, "foreground_set", TRUE, NULL, NULL);
|
|
gtk_tree_view_insert_column_with_attributes (view, -1, "Name", (GtkCellRenderer*) cell, "text", 2, "foreground", 3, NULL, NULL);
|
|
_g_object_unref0 (cell);
|
|
_g_object_unref0 (listmodel);
|
|
}
|
|
|
|
|
|
static gchar string_get (const gchar* self, glong index) {
|
|
gchar result = '\0';
|
|
g_return_val_if_fail (self != NULL, '\0');
|
|
result = ((gchar*) self)[index];
|
|
return result;
|
|
}
|
|
|
|
|
|
gboolean main_window_readFunc (void) {
|
|
gboolean result = FALSE;
|
|
const gchar* _tmp0_ = NULL;
|
|
const gchar* msg;
|
|
gboolean _tmp1_ = FALSE;
|
|
_tmp0_ = squeue_get (main_window_p, 0);
|
|
msg = _tmp0_;
|
|
if (msg != NULL) {
|
|
gchar _tmp2_;
|
|
_tmp2_ = string_get (msg, (glong) 0);
|
|
_tmp1_ = _tmp2_ != '\0';
|
|
} else {
|
|
_tmp1_ = FALSE;
|
|
}
|
|
if (_tmp1_) {
|
|
gchar** _tmp3_;
|
|
gchar** _tmp4_ = NULL;
|
|
gint foo_length1;
|
|
gint _foo_size_;
|
|
gchar** _tmp5_;
|
|
gchar** foo;
|
|
fprintf (stdout, "[<] msg received: %s\n", msg);
|
|
_tmp4_ = _tmp3_ = g_strsplit (msg, ":", 2);
|
|
_tmp5_ = _tmp4_;
|
|
foo_length1 = _vala_array_length (_tmp3_);
|
|
_foo_size_ = foo_length1;
|
|
foo = _tmp5_;
|
|
if (foo[1] != NULL) {
|
|
const gchar* _tmp6_;
|
|
GQuark _tmp7_;
|
|
static GQuark _tmp7__label0 = 0;
|
|
static GQuark _tmp7__label1 = 0;
|
|
static GQuark _tmp7__label2 = 0;
|
|
_tmp6_ = foo[0];
|
|
_tmp7_ = (NULL == _tmp6_) ? 0 : g_quark_from_string (_tmp6_);
|
|
if (_tmp7_ == ((0 != _tmp7__label0) ? _tmp7__label0 : (_tmp7__label0 = g_quark_from_static_string ("bar")))) {
|
|
switch (0) {
|
|
default:
|
|
{
|
|
gint _tmp8_;
|
|
gchar* _tmp9_;
|
|
_tmp8_ = atoi (foo[1]);
|
|
gtk_progress_bar_set_fraction (main_window_viewer->priv->pb, (gdouble) (_tmp8_ / 100));
|
|
_tmp9_ = g_strconcat (foo[1], "%", NULL);
|
|
gtk_progress_bar_set_text (main_window_viewer->priv->pb, _tmp9_);
|
|
_g_free0 (_tmp9_);
|
|
break;
|
|
}
|
|
}
|
|
} else if (_tmp7_ == ((0 != _tmp7__label1) ? _tmp7__label1 : (_tmp7__label1 = g_quark_from_static_string ("error")))) {
|
|
switch (0) {
|
|
default:
|
|
{
|
|
main_window_showMessage (main_window_viewer, foo[1], GTK_MESSAGE_ERROR);
|
|
break;
|
|
}
|
|
}
|
|
} else if (_tmp7_ == ((0 != _tmp7__label2) ? _tmp7__label2 : (_tmp7__label2 = g_quark_from_static_string ("info")))) {
|
|
switch (0) {
|
|
default:
|
|
{
|
|
main_window_showMessage (main_window_viewer, foo[1], GTK_MESSAGE_INFO);
|
|
break;
|
|
}
|
|
}
|
|
} else {
|
|
switch (0) {
|
|
default:
|
|
{
|
|
fprintf (stderr, "[E] Unknown message type\n");
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
squeue_pop (main_window_p);
|
|
foo = (_vala_array_free (foo, foo_length1, (GDestroyNotify) g_free), NULL);
|
|
}
|
|
result = TRUE;
|
|
return result;
|
|
}
|
|
|
|
|
|
static void main_window_OnGetInformation (MainWindow* self) {
|
|
g_return_if_fail (self != NULL);
|
|
main_window_msg (self, "info:device");
|
|
}
|
|
|
|
|
|
static void main_window_OnConnect (MainWindow* self) {
|
|
g_return_if_fail (self != NULL);
|
|
main_window_OnStop (self);
|
|
system ("sudo 0xFFFF -Q &");
|
|
squeue_close (main_window_p);
|
|
squeue_close (main_window_q);
|
|
main_window_q = NULL;
|
|
main_window_p = main_window_q;
|
|
}
|
|
|
|
|
|
static void main_window_OnStop (MainWindow* self) {
|
|
g_return_if_fail (self != NULL);
|
|
system ("sudo pkill 0xFFFF");
|
|
}
|
|
|
|
|
|
static gboolean main_window_chk_queues (MainWindow* self) {
|
|
gboolean result = FALSE;
|
|
gboolean _tmp2_ = FALSE;
|
|
g_return_val_if_fail (self != NULL, FALSE);
|
|
if (main_window_p == NULL) {
|
|
struct squeue_t* _tmp0_ = NULL;
|
|
_tmp0_ = squeue_open ("/tmp/0xFFFF.1", (gint) Q_OPEN);
|
|
main_window_p = _tmp0_;
|
|
}
|
|
if (main_window_q == NULL) {
|
|
struct squeue_t* _tmp1_ = NULL;
|
|
_tmp1_ = squeue_open ("/tmp/0xFFFF.2", (gint) Q_OPEN);
|
|
main_window_q = _tmp1_;
|
|
}
|
|
if (main_window_p == NULL) {
|
|
_tmp2_ = TRUE;
|
|
} else {
|
|
_tmp2_ = main_window_q == NULL;
|
|
}
|
|
if (_tmp2_) {
|
|
main_window_showMessage (self, "Cannot connect to queues", GTK_MESSAGE_ERROR);
|
|
result = FALSE;
|
|
return result;
|
|
}
|
|
result = TRUE;
|
|
return result;
|
|
}
|
|
|
|
|
|
void main_window_msg (MainWindow* self, const gchar* str) {
|
|
gboolean _tmp0_;
|
|
gint _tmp1_;
|
|
g_return_if_fail (self != NULL);
|
|
g_return_if_fail (str != NULL);
|
|
_tmp0_ = main_window_chk_queues (self);
|
|
if (!_tmp0_) {
|
|
return;
|
|
}
|
|
_tmp1_ = squeue_push (main_window_q, str, 0);
|
|
if (_tmp1_ < 1) {
|
|
fprintf (stderr, "Oops on push\n");
|
|
squeue_free (main_window_q);
|
|
main_window_q = NULL;
|
|
squeue_free (main_window_p);
|
|
main_window_p = NULL;
|
|
}
|
|
}
|
|
|
|
|
|
static gboolean _lambda1_ (GtkWidget* x, GdkEvent* y) {
|
|
gboolean result = FALSE;
|
|
g_return_val_if_fail (x != NULL, FALSE);
|
|
g_return_val_if_fail (y != NULL, FALSE);
|
|
gtk_main_quit ();
|
|
result = FALSE;
|
|
return result;
|
|
}
|
|
|
|
|
|
static gboolean __lambda1__gtk_widget_delete_event (GtkWidget* _sender, GdkEvent* event, gpointer self) {
|
|
gboolean result;
|
|
result = _lambda1_ (_sender, event);
|
|
return result;
|
|
}
|
|
|
|
|
|
static gint main_window_main (gchar** args, int args_length1) {
|
|
gint result = 0;
|
|
MainWindow* _tmp0_ = NULL;
|
|
MainWindow* _tmp1_;
|
|
GSourceFunc _tmp2_;
|
|
gtk_init (&args_length1, &args);
|
|
_tmp0_ = main_window_new ();
|
|
_tmp1_ = g_object_ref_sink (_tmp0_);
|
|
_g_object_unref0 (main_window_viewer);
|
|
main_window_viewer = _tmp1_;
|
|
if (args_length1 > 1) {
|
|
main_window_loadFile (main_window_viewer, args[1]);
|
|
}
|
|
gtk_window_resize ((GtkWindow*) main_window_viewer, 600, 400);
|
|
gtk_window_set_position ((GtkWindow*) main_window_viewer, GTK_WIN_POS_CENTER);
|
|
g_signal_connect ((GtkWidget*) main_window_viewer, "delete-event", (GCallback) __lambda1__gtk_widget_delete_event, NULL);
|
|
main_window_setup_treeview (main_window_viewer->priv->tv);
|
|
gtk_widget_show_all ((GtkWidget*) main_window_viewer);
|
|
_tmp2_ = (GSourceFunc) main_window_readFunc;
|
|
g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 200, _tmp2_, NULL, NULL);
|
|
gtk_main ();
|
|
result = 0;
|
|
return result;
|
|
}
|
|
|
|
|
|
int main (int argc, char ** argv) {
|
|
g_type_init ();
|
|
return main_window_main (argv, argc);
|
|
}
|
|
|
|
|
|
MainWindow* main_window_construct (GType object_type) {
|
|
MainWindow * self = NULL;
|
|
self = (MainWindow*) g_object_new (object_type, NULL);
|
|
return self;
|
|
}
|
|
|
|
|
|
MainWindow* main_window_new (void) {
|
|
return main_window_construct (TYPE_MAIN_WINDOW);
|
|
}
|
|
|
|
|
|
static void _main_window_OnFileNewEvent_gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) {
|
|
main_window_OnFileNewEvent (self);
|
|
}
|
|
|
|
|
|
static void _main_window_OnFileOpenEvent_gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) {
|
|
main_window_OnFileOpenEvent (self);
|
|
}
|
|
|
|
|
|
static void _main_window_OnQuitEvent_gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) {
|
|
main_window_OnQuitEvent (self);
|
|
}
|
|
|
|
|
|
static void _main_window_OnConnect_gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) {
|
|
main_window_OnConnect (self);
|
|
}
|
|
|
|
|
|
static void _main_window_OnStop_gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) {
|
|
main_window_OnStop (self);
|
|
}
|
|
|
|
|
|
static void _main_window_OnGetInformation_gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) {
|
|
main_window_OnGetInformation (self);
|
|
}
|
|
|
|
|
|
static void _main_window_OnReset_gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) {
|
|
main_window_OnReset (self);
|
|
}
|
|
|
|
|
|
static void _main_window_OnMenuHelpAboutActivatedEvent_gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) {
|
|
main_window_OnMenuHelpAboutActivatedEvent (self);
|
|
}
|
|
|
|
|
|
static void _main_window_OnConnect_gtk_button_clicked (GtkButton* _sender, gpointer self) {
|
|
main_window_OnConnect (self);
|
|
}
|
|
|
|
|
|
static void _main_window_OnStop_gtk_button_clicked (GtkButton* _sender, gpointer self) {
|
|
main_window_OnStop (self);
|
|
}
|
|
|
|
|
|
static void _main_window_OnGetInformation_gtk_button_clicked (GtkButton* _sender, gpointer self) {
|
|
main_window_OnGetInformation (self);
|
|
}
|
|
|
|
|
|
static void _main_window_OnFileOpenEvent_gtk_button_clicked (GtkButton* _sender, gpointer self) {
|
|
main_window_OnFileOpenEvent (self);
|
|
}
|
|
|
|
|
|
static void _main_window_list_del_gtk_button_clicked (GtkButton* _sender, gpointer self) {
|
|
main_window_list_del (self);
|
|
}
|
|
|
|
|
|
static void _main_window_OnFileFlashEvent_gtk_button_clicked (GtkButton* _sender, gpointer self) {
|
|
main_window_OnFileFlashEvent (self);
|
|
}
|
|
|
|
|
|
static gboolean _gtk_widget_hide_on_delete_gtk_widget_delete_event (GtkWidget* _sender, GdkEvent* event, gpointer self) {
|
|
gboolean result;
|
|
result = gtk_widget_hide_on_delete (self);
|
|
return result;
|
|
}
|
|
|
|
|
|
static GObject * main_window_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
|
|
GObject * obj;
|
|
GObjectClass * parent_class;
|
|
MainWindow * self;
|
|
GtkVBox* _vbox0;
|
|
GtkMenuBar* _menubar0;
|
|
GtkMenuItem* _menuitem0;
|
|
GtkMenu* _menu0;
|
|
GtkImageMenuItem* _imagemenuitem0;
|
|
GtkImageMenuItem* _imagemenuitem1;
|
|
GtkSeparatorMenuItem* _separatormenuitem0;
|
|
GtkImageMenuItem* _imagemenuitem2;
|
|
GtkMenuItem* _menuitem1;
|
|
GtkMenu* _menu1;
|
|
GtkImageMenuItem* _imagemenuitem3;
|
|
GtkImageMenuItem* _imagemenuitem4;
|
|
GtkImageMenuItem* _imagemenuitem5;
|
|
GtkImageMenuItem* _imagemenuitem6;
|
|
GtkMenuItem* _menuitem2;
|
|
GtkMenu* _menu2;
|
|
GtkImageMenuItem* _imagemenuitem7;
|
|
GtkHBox* _hbox0;
|
|
GtkVBox* _vbox1;
|
|
GtkScrolledWindow* _scrolledwindow0;
|
|
GtkVBox* _vbox2;
|
|
GtkButton* _button0;
|
|
GtkButton* _button1;
|
|
GtkButton* _button2;
|
|
GtkLabel* _label0;
|
|
GtkButton* _button3;
|
|
GtkButton* _button4;
|
|
GtkLabel* _label1;
|
|
GtkButton* _button5;
|
|
GtkVBox* _tmp0_ = NULL;
|
|
GtkVBox* _tmp1_;
|
|
GtkMenuBar* _tmp2_ = NULL;
|
|
GtkMenuBar* _tmp3_;
|
|
GtkMenu* _tmp4_ = NULL;
|
|
GtkMenu* _tmp5_;
|
|
GtkImageMenuItem* _tmp6_ = NULL;
|
|
GtkImageMenuItem* _tmp7_;
|
|
GtkImageMenuItem* _tmp8_ = NULL;
|
|
GtkImageMenuItem* _tmp9_;
|
|
GtkSeparatorMenuItem* _tmp10_ = NULL;
|
|
GtkSeparatorMenuItem* _tmp11_;
|
|
GtkImageMenuItem* _tmp12_ = NULL;
|
|
GtkImageMenuItem* _tmp13_;
|
|
GtkMenuItem* _tmp14_ = NULL;
|
|
GtkMenuItem* _tmp15_;
|
|
GtkMenu* _tmp16_ = NULL;
|
|
GtkMenu* _tmp17_;
|
|
GtkImageMenuItem* _tmp18_ = NULL;
|
|
GtkImageMenuItem* _tmp19_;
|
|
GtkImageMenuItem* _tmp20_ = NULL;
|
|
GtkImageMenuItem* _tmp21_;
|
|
GtkImageMenuItem* _tmp22_ = NULL;
|
|
GtkImageMenuItem* _tmp23_;
|
|
GtkImageMenuItem* _tmp24_ = NULL;
|
|
GtkImageMenuItem* _tmp25_;
|
|
GtkMenuItem* _tmp26_ = NULL;
|
|
GtkMenuItem* _tmp27_;
|
|
GtkMenu* _tmp28_ = NULL;
|
|
GtkMenu* _tmp29_;
|
|
GtkImageMenuItem* _tmp30_ = NULL;
|
|
GtkImageMenuItem* _tmp31_;
|
|
GtkMenuItem* _tmp32_ = NULL;
|
|
GtkMenuItem* _tmp33_;
|
|
GtkHBox* _tmp34_ = NULL;
|
|
GtkHBox* _tmp35_;
|
|
GtkVBox* _tmp36_ = NULL;
|
|
GtkVBox* _tmp37_;
|
|
GtkScrolledWindow* _tmp38_ = NULL;
|
|
GtkScrolledWindow* _tmp39_;
|
|
GtkTreeView* _tmp40_ = NULL;
|
|
GtkTreeView* _tmp41_;
|
|
GtkVBox* _tmp42_ = NULL;
|
|
GtkVBox* _tmp43_;
|
|
GtkButton* _tmp44_ = NULL;
|
|
GtkButton* _tmp45_;
|
|
GtkButton* _tmp46_ = NULL;
|
|
GtkButton* _tmp47_;
|
|
GtkButton* _tmp48_ = NULL;
|
|
GtkButton* _tmp49_;
|
|
GtkLabel* _tmp50_ = NULL;
|
|
GtkLabel* _tmp51_;
|
|
GtkButton* _tmp52_ = NULL;
|
|
GtkButton* _tmp53_;
|
|
GtkButton* _tmp54_ = NULL;
|
|
GtkButton* _tmp55_;
|
|
GtkLabel* _tmp56_ = NULL;
|
|
GtkLabel* _tmp57_;
|
|
GtkButton* _tmp58_ = NULL;
|
|
GtkButton* _tmp59_;
|
|
GtkProgressBar* _tmp60_ = NULL;
|
|
GtkProgressBar* _tmp61_;
|
|
GtkAboutDialog* _tmp62_ = NULL;
|
|
GtkAboutDialog* _tmp63_;
|
|
gchar* _tmp64_;
|
|
gchar** _tmp65_ = NULL;
|
|
gchar** _tmp66_;
|
|
gint _tmp66__length1;
|
|
parent_class = G_OBJECT_CLASS (main_window_parent_class);
|
|
obj = parent_class->constructor (type, n_construct_properties, construct_properties);
|
|
self = MAIN_WINDOW (obj);
|
|
_vbox0 = NULL;
|
|
_menubar0 = NULL;
|
|
_menuitem0 = NULL;
|
|
_menu0 = NULL;
|
|
_imagemenuitem0 = NULL;
|
|
_imagemenuitem1 = NULL;
|
|
_separatormenuitem0 = NULL;
|
|
_imagemenuitem2 = NULL;
|
|
_menuitem1 = NULL;
|
|
_menu1 = NULL;
|
|
_imagemenuitem3 = NULL;
|
|
_imagemenuitem4 = NULL;
|
|
_imagemenuitem5 = NULL;
|
|
_imagemenuitem6 = NULL;
|
|
_menuitem2 = NULL;
|
|
_menu2 = NULL;
|
|
_imagemenuitem7 = NULL;
|
|
_hbox0 = NULL;
|
|
_vbox1 = NULL;
|
|
_scrolledwindow0 = NULL;
|
|
_vbox2 = NULL;
|
|
_button0 = NULL;
|
|
_button1 = NULL;
|
|
_button2 = NULL;
|
|
_label0 = NULL;
|
|
_button3 = NULL;
|
|
_button4 = NULL;
|
|
_label1 = NULL;
|
|
_button5 = NULL;
|
|
_tmp0_ = (GtkVBox*) gtk_vbox_new (FALSE, 0);
|
|
_tmp1_ = g_object_ref_sink (_tmp0_);
|
|
_g_object_unref0 (_vbox0);
|
|
_vbox0 = _tmp1_;
|
|
_tmp2_ = (GtkMenuBar*) gtk_menu_bar_new ();
|
|
_tmp3_ = g_object_ref_sink (_tmp2_);
|
|
_g_object_unref0 (_menubar0);
|
|
_menubar0 = _tmp3_;
|
|
_tmp4_ = (GtkMenu*) gtk_menu_new ();
|
|
_tmp5_ = g_object_ref_sink (_tmp4_);
|
|
_g_object_unref0 (_menu0);
|
|
_menu0 = _tmp5_;
|
|
_tmp6_ = (GtkImageMenuItem*) gtk_image_menu_item_new_from_stock ("gtk-new", NULL);
|
|
_tmp7_ = g_object_ref_sink (_tmp6_);
|
|
_g_object_unref0 (_imagemenuitem0);
|
|
_imagemenuitem0 = _tmp7_;
|
|
_tmp8_ = (GtkImageMenuItem*) gtk_image_menu_item_new_from_stock ("gtk-open", NULL);
|
|
_tmp9_ = g_object_ref_sink (_tmp8_);
|
|
_g_object_unref0 (_imagemenuitem1);
|
|
_imagemenuitem1 = _tmp9_;
|
|
_tmp10_ = (GtkSeparatorMenuItem*) gtk_separator_menu_item_new ();
|
|
_tmp11_ = g_object_ref_sink (_tmp10_);
|
|
_g_object_unref0 (_separatormenuitem0);
|
|
_separatormenuitem0 = _tmp11_;
|
|
_tmp12_ = (GtkImageMenuItem*) gtk_image_menu_item_new_from_stock ("gtk-quit", NULL);
|
|
_tmp13_ = g_object_ref_sink (_tmp12_);
|
|
_g_object_unref0 (_imagemenuitem2);
|
|
_imagemenuitem2 = _tmp13_;
|
|
_tmp14_ = (GtkMenuItem*) gtk_menu_item_new_with_mnemonic ("_File");
|
|
_tmp15_ = g_object_ref_sink (_tmp14_);
|
|
_g_object_unref0 (_menuitem0);
|
|
_menuitem0 = _tmp15_;
|
|
_tmp16_ = (GtkMenu*) gtk_menu_new ();
|
|
_tmp17_ = g_object_ref_sink (_tmp16_);
|
|
_g_object_unref0 (_menu1);
|
|
_menu1 = _tmp17_;
|
|
_tmp18_ = (GtkImageMenuItem*) gtk_image_menu_item_new_from_stock ("gtk-connect", NULL);
|
|
_tmp19_ = g_object_ref_sink (_tmp18_);
|
|
_g_object_unref0 (_imagemenuitem3);
|
|
_imagemenuitem3 = _tmp19_;
|
|
_tmp20_ = (GtkImageMenuItem*) gtk_image_menu_item_new_from_stock ("gtk-stop", NULL);
|
|
_tmp21_ = g_object_ref_sink (_tmp20_);
|
|
_g_object_unref0 (_imagemenuitem4);
|
|
_imagemenuitem4 = _tmp21_;
|
|
_tmp22_ = (GtkImageMenuItem*) gtk_image_menu_item_new_from_stock ("gtk-info", NULL);
|
|
_tmp23_ = g_object_ref_sink (_tmp22_);
|
|
_g_object_unref0 (_imagemenuitem5);
|
|
_imagemenuitem5 = _tmp23_;
|
|
_tmp24_ = (GtkImageMenuItem*) gtk_image_menu_item_new_with_label ("Reset");
|
|
_tmp25_ = g_object_ref_sink (_tmp24_);
|
|
_g_object_unref0 (_imagemenuitem6);
|
|
_imagemenuitem6 = _tmp25_;
|
|
_tmp26_ = (GtkMenuItem*) gtk_menu_item_new_with_mnemonic ("_Target");
|
|
_tmp27_ = g_object_ref_sink (_tmp26_);
|
|
_g_object_unref0 (_menuitem1);
|
|
_menuitem1 = _tmp27_;
|
|
_tmp28_ = (GtkMenu*) gtk_menu_new ();
|
|
_tmp29_ = g_object_ref_sink (_tmp28_);
|
|
_g_object_unref0 (_menu2);
|
|
_menu2 = _tmp29_;
|
|
_tmp30_ = (GtkImageMenuItem*) gtk_image_menu_item_new_from_stock ("gtk-about", NULL);
|
|
_tmp31_ = g_object_ref_sink (_tmp30_);
|
|
_g_object_unref0 (_imagemenuitem7);
|
|
_imagemenuitem7 = _tmp31_;
|
|
_tmp32_ = (GtkMenuItem*) gtk_menu_item_new_with_mnemonic ("_Help");
|
|
_tmp33_ = g_object_ref_sink (_tmp32_);
|
|
_g_object_unref0 (_menuitem2);
|
|
_menuitem2 = _tmp33_;
|
|
_tmp34_ = (GtkHBox*) gtk_hbox_new (FALSE, 0);
|
|
_tmp35_ = g_object_ref_sink (_tmp34_);
|
|
_g_object_unref0 (_hbox0);
|
|
_hbox0 = _tmp35_;
|
|
_tmp36_ = (GtkVBox*) gtk_vbox_new (FALSE, 3);
|
|
_tmp37_ = g_object_ref_sink (_tmp36_);
|
|
_g_object_unref0 (_vbox1);
|
|
_vbox1 = _tmp37_;
|
|
_tmp38_ = (GtkScrolledWindow*) gtk_scrolled_window_new (NULL, NULL);
|
|
_tmp39_ = g_object_ref_sink (_tmp38_);
|
|
_g_object_unref0 (_scrolledwindow0);
|
|
_scrolledwindow0 = _tmp39_;
|
|
_tmp40_ = (GtkTreeView*) gtk_tree_view_new ();
|
|
_tmp41_ = g_object_ref_sink (_tmp40_);
|
|
_g_object_unref0 (self->priv->tv);
|
|
self->priv->tv = _tmp41_;
|
|
_tmp42_ = (GtkVBox*) gtk_vbox_new (FALSE, 3);
|
|
_tmp43_ = g_object_ref_sink (_tmp42_);
|
|
_g_object_unref0 (_vbox2);
|
|
_vbox2 = _tmp43_;
|
|
_tmp44_ = (GtkButton*) gtk_button_new_with_label ("gtk-connect");
|
|
_tmp45_ = g_object_ref_sink (_tmp44_);
|
|
_g_object_unref0 (_button0);
|
|
_button0 = _tmp45_;
|
|
_tmp46_ = (GtkButton*) gtk_button_new_with_label ("gtk-stop");
|
|
_tmp47_ = g_object_ref_sink (_tmp46_);
|
|
_g_object_unref0 (_button1);
|
|
_button1 = _tmp47_;
|
|
_tmp48_ = (GtkButton*) gtk_button_new_with_label ("gtk-info");
|
|
_tmp49_ = g_object_ref_sink (_tmp48_);
|
|
_g_object_unref0 (_button2);
|
|
_button2 = _tmp49_;
|
|
_tmp50_ = (GtkLabel*) gtk_label_new ("");
|
|
_tmp51_ = g_object_ref_sink (_tmp50_);
|
|
_g_object_unref0 (_label0);
|
|
_label0 = _tmp51_;
|
|
_tmp52_ = (GtkButton*) gtk_button_new_with_label ("gtk-add");
|
|
_tmp53_ = g_object_ref_sink (_tmp52_);
|
|
_g_object_unref0 (_button3);
|
|
_button3 = _tmp53_;
|
|
_tmp54_ = (GtkButton*) gtk_button_new_with_label ("gtk-remove");
|
|
_tmp55_ = g_object_ref_sink (_tmp54_);
|
|
_g_object_unref0 (_button4);
|
|
_button4 = _tmp55_;
|
|
_tmp56_ = (GtkLabel*) gtk_label_new ("");
|
|
_tmp57_ = g_object_ref_sink (_tmp56_);
|
|
_g_object_unref0 (_label1);
|
|
_label1 = _tmp57_;
|
|
_tmp58_ = (GtkButton*) gtk_button_new_with_label ("gtk-media-record");
|
|
_tmp59_ = g_object_ref_sink (_tmp58_);
|
|
_g_object_unref0 (_button5);
|
|
_button5 = _tmp59_;
|
|
_tmp60_ = (GtkProgressBar*) gtk_progress_bar_new ();
|
|
_tmp61_ = g_object_ref_sink (_tmp60_);
|
|
_g_object_unref0 (self->priv->pb);
|
|
self->priv->pb = _tmp61_;
|
|
_tmp62_ = (GtkAboutDialog*) gtk_about_dialog_new ();
|
|
_tmp63_ = g_object_ref_sink (_tmp62_);
|
|
_g_object_unref0 (self->priv->aboutdialog1);
|
|
self->priv->aboutdialog1 = _tmp63_;
|
|
g_object_set ((GtkWindow*) self, "type", GTK_WINDOW_TOPLEVEL, NULL);
|
|
gtk_window_set_title ((GtkWindow*) self, "0xFFFF GUI");
|
|
g_signal_connect_object ((GtkMenuItem*) _imagemenuitem0, "activate", (GCallback) _main_window_OnFileNewEvent_gtk_menu_item_activate, self, 0);
|
|
gtk_menu_shell_append ((GtkMenuShell*) _menu0, (GtkWidget*) ((GtkMenuItem*) _imagemenuitem0));
|
|
g_signal_connect_object ((GtkMenuItem*) _imagemenuitem1, "activate", (GCallback) _main_window_OnFileOpenEvent_gtk_menu_item_activate, self, 0);
|
|
gtk_menu_shell_append ((GtkMenuShell*) _menu0, (GtkWidget*) ((GtkMenuItem*) _imagemenuitem1));
|
|
gtk_menu_shell_append ((GtkMenuShell*) _menu0, (GtkWidget*) ((GtkMenuItem*) _separatormenuitem0));
|
|
g_signal_connect_object ((GtkMenuItem*) _imagemenuitem2, "activate", (GCallback) _main_window_OnQuitEvent_gtk_menu_item_activate, self, 0);
|
|
gtk_menu_shell_append ((GtkMenuShell*) _menu0, (GtkWidget*) ((GtkMenuItem*) _imagemenuitem2));
|
|
gtk_menu_item_set_submenu (_menuitem0, _menu0);
|
|
gtk_menu_shell_append ((GtkMenuShell*) _menubar0, (GtkWidget*) _menuitem0);
|
|
g_signal_connect_object ((GtkMenuItem*) _imagemenuitem3, "activate", (GCallback) _main_window_OnConnect_gtk_menu_item_activate, self, 0);
|
|
gtk_menu_shell_append ((GtkMenuShell*) _menu1, (GtkWidget*) ((GtkMenuItem*) _imagemenuitem3));
|
|
g_signal_connect_object ((GtkMenuItem*) _imagemenuitem4, "activate", (GCallback) _main_window_OnStop_gtk_menu_item_activate, self, 0);
|
|
gtk_menu_shell_append ((GtkMenuShell*) _menu1, (GtkWidget*) ((GtkMenuItem*) _imagemenuitem4));
|
|
g_signal_connect_object ((GtkMenuItem*) _imagemenuitem5, "activate", (GCallback) _main_window_OnGetInformation_gtk_menu_item_activate, self, 0);
|
|
gtk_menu_shell_append ((GtkMenuShell*) _menu1, (GtkWidget*) ((GtkMenuItem*) _imagemenuitem5));
|
|
g_signal_connect_object ((GtkMenuItem*) _imagemenuitem6, "activate", (GCallback) _main_window_OnReset_gtk_menu_item_activate, self, 0);
|
|
gtk_menu_shell_append ((GtkMenuShell*) _menu1, (GtkWidget*) ((GtkMenuItem*) _imagemenuitem6));
|
|
gtk_menu_item_set_submenu (_menuitem1, _menu1);
|
|
gtk_menu_shell_append ((GtkMenuShell*) _menubar0, (GtkWidget*) _menuitem1);
|
|
g_signal_connect_object ((GtkMenuItem*) _imagemenuitem7, "activate", (GCallback) _main_window_OnMenuHelpAboutActivatedEvent_gtk_menu_item_activate, self, 0);
|
|
gtk_menu_shell_append ((GtkMenuShell*) _menu2, (GtkWidget*) ((GtkMenuItem*) _imagemenuitem7));
|
|
gtk_menu_item_set_submenu (_menuitem2, _menu2);
|
|
gtk_menu_shell_append ((GtkMenuShell*) _menubar0, (GtkWidget*) _menuitem2);
|
|
gtk_box_pack_start ((GtkBox*) _vbox0, (GtkWidget*) _menubar0, FALSE, TRUE, (guint) 0);
|
|
gtk_container_set_border_width ((GtkContainer*) _hbox0, (guint) 5);
|
|
gtk_container_set_border_width ((GtkContainer*) _vbox1, (guint) 3);
|
|
g_object_set ((GtkWidget*) _scrolledwindow0, "can-focus", TRUE, NULL);
|
|
g_object_set (_scrolledwindow0, "hscrollbar-policy", GTK_POLICY_AUTOMATIC, NULL);
|
|
g_object_set (_scrolledwindow0, "vscrollbar-policy", GTK_POLICY_AUTOMATIC, NULL);
|
|
gtk_container_add ((GtkContainer*) _scrolledwindow0, (GtkWidget*) self->priv->tv);
|
|
gtk_container_add ((GtkContainer*) _vbox1, (GtkWidget*) _scrolledwindow0);
|
|
gtk_container_add ((GtkContainer*) _hbox0, (GtkWidget*) _vbox1);
|
|
gtk_container_set_border_width ((GtkContainer*) _vbox2, (guint) 3);
|
|
gtk_button_set_use_stock (_button0, TRUE);
|
|
g_signal_connect_object (_button0, "clicked", (GCallback) _main_window_OnConnect_gtk_button_clicked, self, 0);
|
|
gtk_box_pack_start ((GtkBox*) _vbox2, (GtkWidget*) _button0, FALSE, TRUE, (guint) 0);
|
|
gtk_button_set_use_stock (_button1, TRUE);
|
|
g_signal_connect_object (_button1, "clicked", (GCallback) _main_window_OnStop_gtk_button_clicked, self, 0);
|
|
gtk_box_pack_start ((GtkBox*) _vbox2, (GtkWidget*) _button1, FALSE, TRUE, (guint) 0);
|
|
gtk_button_set_use_stock (_button2, TRUE);
|
|
g_signal_connect_object (_button2, "clicked", (GCallback) _main_window_OnGetInformation_gtk_button_clicked, self, 0);
|
|
gtk_box_pack_start ((GtkBox*) _vbox2, (GtkWidget*) _button2, FALSE, TRUE, (guint) 0);
|
|
gtk_container_add ((GtkContainer*) _vbox2, (GtkWidget*) _label0);
|
|
gtk_button_set_use_stock (_button3, TRUE);
|
|
g_signal_connect_object (_button3, "clicked", (GCallback) _main_window_OnFileOpenEvent_gtk_button_clicked, self, 0);
|
|
gtk_box_pack_start ((GtkBox*) _vbox2, (GtkWidget*) _button3, FALSE, TRUE, (guint) 0);
|
|
gtk_button_set_use_stock (_button4, TRUE);
|
|
g_signal_connect_object (_button4, "clicked", (GCallback) _main_window_list_del_gtk_button_clicked, self, 0);
|
|
gtk_box_pack_start ((GtkBox*) _vbox2, (GtkWidget*) _button4, FALSE, TRUE, (guint) 0);
|
|
gtk_container_add ((GtkContainer*) _vbox2, (GtkWidget*) _label1);
|
|
gtk_button_set_use_stock (_button5, TRUE);
|
|
g_signal_connect_object (_button5, "clicked", (GCallback) _main_window_OnFileFlashEvent_gtk_button_clicked, self, 0);
|
|
gtk_box_pack_start ((GtkBox*) _vbox2, (GtkWidget*) _button5, FALSE, TRUE, (guint) 0);
|
|
gtk_box_pack_start ((GtkBox*) _hbox0, (GtkWidget*) _vbox2, FALSE, TRUE, (guint) 0);
|
|
gtk_container_add ((GtkContainer*) _vbox0, (GtkWidget*) _hbox0);
|
|
gtk_box_pack_start ((GtkBox*) _vbox0, (GtkWidget*) self->priv->pb, FALSE, TRUE, (guint) 0);
|
|
gtk_container_add ((GtkContainer*) self, (GtkWidget*) _vbox0);
|
|
g_signal_connect_object ((GtkWidget*) self->priv->aboutdialog1, "delete-event", (GCallback) _gtk_widget_hide_on_delete_gtk_widget_delete_event, (GtkWidget*) self->priv->aboutdialog1, 0);
|
|
gtk_container_set_border_width ((GtkContainer*) self->priv->aboutdialog1, (guint) 5);
|
|
gtk_window_set_title ((GtkWindow*) self->priv->aboutdialog1, "About 0xFFFF gui");
|
|
gtk_window_set_resizable ((GtkWindow*) self->priv->aboutdialog1, FALSE);
|
|
gtk_window_set_modal ((GtkWindow*) self->priv->aboutdialog1, TRUE);
|
|
g_object_set ((GtkWindow*) self->priv->aboutdialog1, "window-position", GTK_WIN_POS_CENTER_ON_PARENT, NULL);
|
|
gtk_dialog_set_has_separator ((GtkDialog*) self->priv->aboutdialog1, FALSE);
|
|
gtk_about_dialog_set_program_name (self->priv->aboutdialog1, "0xFFFF");
|
|
gtk_about_dialog_set_version (self->priv->aboutdialog1, "0.5");
|
|
gtk_about_dialog_set_copyright (self->priv->aboutdialog1, "Copyright (c) 2007-2009 pancake");
|
|
gtk_about_dialog_set_comments (self->priv->aboutdialog1, "The Free Nokia Internet Tablet flasher");
|
|
gtk_about_dialog_set_website (self->priv->aboutdialog1, "http://www.nopcode.org/0xFFFF/");
|
|
_tmp64_ = g_strdup ("pancake (pancake@youterm.com)");
|
|
_tmp65_ = g_new0 (gchar*, 2 + 1);
|
|
_tmp65_[0] = _tmp64_;
|
|
_tmp65_[1] = NULL;
|
|
_tmp66_ = _tmp65_;
|
|
_tmp66__length1 = 2;
|
|
gtk_about_dialog_set_authors (self->priv->aboutdialog1, _tmp66_);
|
|
_tmp66_ = (_vala_array_free (_tmp66_, _tmp66__length1, (GDestroyNotify) g_free), NULL);
|
|
_g_object_unref0 (_button5);
|
|
_g_object_unref0 (_label1);
|
|
_g_object_unref0 (_button4);
|
|
_g_object_unref0 (_button3);
|
|
_g_object_unref0 (_label0);
|
|
_g_object_unref0 (_button2);
|
|
_g_object_unref0 (_button1);
|
|
_g_object_unref0 (_button0);
|
|
_g_object_unref0 (_vbox2);
|
|
_g_object_unref0 (_scrolledwindow0);
|
|
_g_object_unref0 (_vbox1);
|
|
_g_object_unref0 (_hbox0);
|
|
_g_object_unref0 (_imagemenuitem7);
|
|
_g_object_unref0 (_menu2);
|
|
_g_object_unref0 (_menuitem2);
|
|
_g_object_unref0 (_imagemenuitem6);
|
|
_g_object_unref0 (_imagemenuitem5);
|
|
_g_object_unref0 (_imagemenuitem4);
|
|
_g_object_unref0 (_imagemenuitem3);
|
|
_g_object_unref0 (_menu1);
|
|
_g_object_unref0 (_menuitem1);
|
|
_g_object_unref0 (_imagemenuitem2);
|
|
_g_object_unref0 (_separatormenuitem0);
|
|
_g_object_unref0 (_imagemenuitem1);
|
|
_g_object_unref0 (_imagemenuitem0);
|
|
_g_object_unref0 (_menu0);
|
|
_g_object_unref0 (_menuitem0);
|
|
_g_object_unref0 (_menubar0);
|
|
_g_object_unref0 (_vbox0);
|
|
return obj;
|
|
}
|
|
|
|
|
|
static void main_window_class_init (MainWindowClass * klass) {
|
|
main_window_parent_class = g_type_class_peek_parent (klass);
|
|
g_type_class_add_private (klass, sizeof (MainWindowPrivate));
|
|
G_OBJECT_CLASS (klass)->constructor = main_window_constructor;
|
|
G_OBJECT_CLASS (klass)->finalize = main_window_finalize;
|
|
}
|
|
|
|
|
|
static void main_window_instance_init (MainWindow * self) {
|
|
self->priv = MAIN_WINDOW_GET_PRIVATE (self);
|
|
}
|
|
|
|
|
|
static void main_window_finalize (GObject* obj) {
|
|
MainWindow * self;
|
|
self = MAIN_WINDOW (obj);
|
|
_g_object_unref0 (self->priv->tv);
|
|
_g_object_unref0 (self->priv->pb);
|
|
_g_object_unref0 (self->priv->aboutdialog1);
|
|
G_OBJECT_CLASS (main_window_parent_class)->finalize (obj);
|
|
}
|
|
|
|
|
|
GType main_window_get_type (void) {
|
|
static volatile gsize main_window_type_id__volatile = 0;
|
|
if (g_once_init_enter (&main_window_type_id__volatile)) {
|
|
static const GTypeInfo g_define_type_info = { sizeof (MainWindowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) main_window_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MainWindow), 0, (GInstanceInitFunc) main_window_instance_init, NULL };
|
|
GType main_window_type_id;
|
|
main_window_type_id = g_type_register_static (GTK_TYPE_WINDOW, "MainWindow", &g_define_type_info, 0);
|
|
g_once_init_leave (&main_window_type_id__volatile, main_window_type_id);
|
|
}
|
|
return main_window_type_id__volatile;
|
|
}
|
|
|
|
|
|
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
|
|
if ((array != NULL) && (destroy_func != NULL)) {
|
|
int i;
|
|
for (i = 0; i < array_length; i = i + 1) {
|
|
if (((gpointer*) array)[i] != NULL) {
|
|
destroy_func (((gpointer*) array)[i]);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
|
|
_vala_array_destroy (array, array_length, destroy_func);
|
|
g_free (array);
|
|
}
|
|
|
|
|
|
static gint _vala_array_length (gpointer array) {
|
|
int length;
|
|
length = 0;
|
|
if (array) {
|
|
while (((gpointer*) array)[length]) {
|
|
length++;
|
|
}
|
|
}
|
|
return length;
|
|
}
|
|
|
|
|
|
|