summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoakim Sindholt <opensource@zhasha.com>2009-11-08 13:27:42 +0100
committerJoakim Sindholt <opensource@zhasha.com>2009-11-08 13:27:42 +0100
commit7450587a8d6034a94d7170a4472d7c2ce200d42f (patch)
tree96d61d28c1b77bf12429d5aafcd9bea8f2ea078b
parentff4d7bf23b044f548375955db38a16ac3e4fa81c (diff)
Hardcode paths and do minor fixups
-rw-r--r--src/main.c406
-rw-r--r--src/main.vala24
2 files changed, 174 insertions, 256 deletions
diff --git a/src/main.c b/src/main.c
index 821fa7e..786e593 100644
--- a/src/main.c
+++ b/src/main.c
@@ -29,7 +29,6 @@ typedef struct _GUICActionsPrivate GUICActionsPrivate;
typedef struct _GUICSImport GUICSImport;
typedef struct _GUICSImportClass GUICSImportClass;
-typedef struct _GUIParamSpecCActions GUIParamSpecCActions;
#define GUI_TYPE_CMENUS (gui_cmenus_get_type ())
#define GUI_CMENUS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GUI_TYPE_CMENUS, GUICMenus))
@@ -96,8 +95,7 @@ typedef struct _GUICSView GUICSView;
typedef struct _GUICSViewClass GUICSViewClass;
struct _GUICActions {
- GTypeInstance parent_instance;
- volatile int ref_count;
+ GObject parent_instance;
GUICActionsPrivate * priv;
GtkAction* New;
GtkAction* Open;
@@ -112,8 +110,7 @@ struct _GUICActions {
};
struct _GUICActionsClass {
- GTypeClass parent_class;
- void (*finalize) (GUICActions *self);
+ GObjectClass parent_class;
};
typedef enum {
@@ -121,10 +118,6 @@ typedef enum {
EMULATION_CHIP_R500
} EmulationChip;
-struct _GUIParamSpecCActions {
- GParamSpec parent_instance;
-};
-
struct _GUICMenus {
GTypeInstance parent_instance;
volatile int ref_count;
@@ -182,24 +175,20 @@ extern EmulationSpec* r300_registers;
EmulationSpec* r300_registers = NULL;
EmulationSpec* r500_registers = NULL;
-gpointer gui_cactions_ref (gpointer instance);
-void gui_cactions_unref (gpointer instance);
-GParamSpec* gui_param_spec_cactions (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
-void gui_value_set_cactions (GValue* value, gpointer v_object);
-gpointer gui_value_get_cactions (const GValue* value);
GType gui_cactions_get_type (void);
enum {
GUI_CACTIONS_DUMMY_PROPERTY
};
+GUICActions* gui_cactions_new (void);
+GUICActions* gui_cactions_construct (GType object_type);
GType emulation_chip_get_type (void);
GUICSImport* gui_cs_import_new (void);
GUICSImport* gui_cs_import_construct (GType object_type);
GType gui_cs_import_get_type (void);
static void _lambda10_ (GtkAction* source, GUICActions* self);
static void __lambda10__gtk_action_activate (GtkAction* _sender, gpointer self);
-GUICActions* gui_cactions_new (void);
-GUICActions* gui_cactions_construct (GType object_type);
-static void gui_cactions_finalize (GUICActions* obj);
+static GObject * gui_cactions_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
+static void gui_cactions_finalize (GObject* obj);
gpointer gui_cmenus_ref (gpointer instance);
void gui_cmenus_unref (gpointer instance);
GParamSpec* gui_param_spec_cmenus (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
@@ -229,7 +218,7 @@ GUICMain* gui_cmain_new (void);
GUICMain* gui_cmain_construct (GType object_type);
static void _gui_cmain_dwords_cellrenderer_gtk_tree_cell_data_func (GtkTreeViewColumn* tree_column, GtkCellRenderer* cell, GtkTreeModel* tree_model, GtkTreeIter* iter, gpointer self);
static void _gui_cmain_open_csview_gtk_tree_view_row_activated (GtkTreeView* _sender, const GtkTreePath* path, GtkTreeViewColumn* column, gpointer self);
-static void _gtk_main_quit_gtk_object_destroy (GUICMain* _sender, gpointer self);
+static void _gtk_main_quit_gtk_object_destroy (GtkObject* _sender, gpointer self);
static GObject * gui_cmain_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
static void gui_cmain_finalize (GObject* obj);
void gui_init (char*** args, int* args_length1);
@@ -240,56 +229,9 @@ gint _main (char** args, int args_length1);
-static void _lambda10_ (GtkAction* source, GUICActions* self) {
- GUICSImport* d;
- g_return_if_fail (source != NULL);
- d = g_object_ref_sink (gui_cs_import_new ());
- gtk_dialog_run ((GtkDialog*) d);
- (d == NULL) ? NULL : (d = (g_object_unref (d), NULL));
-}
-
-
-static void __lambda10__gtk_action_activate (GtkAction* _sender, gpointer self) {
- _lambda10_ (_sender, self);
-}
-
-
GUICActions* gui_cactions_construct (GType object_type) {
- GUICActions* self;
- GtkAction* _tmp0_;
- GtkAction* _tmp1_;
- GtkAction* _tmp2_;
- GtkAction* _tmp3_;
- GtkAction* _tmp4_;
- GtkAction* _tmp5_;
- GtkAction* _tmp6_;
- GtkAction* _tmp7_;
- GtkRadioAction* _tmp8_;
- GtkRadioAction* _tmp9_;
- self = (GUICActions*) g_type_create_instance (object_type);
- _tmp0_ = NULL;
- self->New = (_tmp0_ = gtk_action_new ("New", NULL, NULL, "gtk-new"), (self->New == NULL) ? NULL : (self->New = (g_object_unref (self->New), NULL)), _tmp0_);
- _tmp1_ = NULL;
- self->Open = (_tmp1_ = gtk_action_new ("Open", NULL, NULL, "gtk-open"), (self->Open == NULL) ? NULL : (self->Open = (g_object_unref (self->Open), NULL)), _tmp1_);
- _tmp2_ = NULL;
- self->Save = (_tmp2_ = gtk_action_new ("Save", NULL, NULL, "gtk-save"), (self->Save == NULL) ? NULL : (self->Save = (g_object_unref (self->Save), NULL)), _tmp2_);
- _tmp3_ = NULL;
- self->SaveAs = (_tmp3_ = gtk_action_new ("SaveAs", NULL, NULL, "gtk-save-as"), (self->SaveAs == NULL) ? NULL : (self->SaveAs = (g_object_unref (self->SaveAs), NULL)), _tmp3_);
- _tmp4_ = NULL;
- self->RemoveCS = (_tmp4_ = gtk_action_new ("RemoveCS", "Remove", "Remove selected CS' from the list", "gtk-remove"), (self->RemoveCS == NULL) ? NULL : (self->RemoveCS = (g_object_unref (self->RemoveCS), NULL)), _tmp4_);
- _tmp5_ = NULL;
- self->ImportCS = (_tmp5_ = gtk_action_new ("ImportCS", "Import", "Import a command stream to the list", "gtk-add"), (self->ImportCS == NULL) ? NULL : (self->ImportCS = (g_object_unref (self->ImportCS), NULL)), _tmp5_);
- _tmp6_ = NULL;
- self->ExportCS = (_tmp6_ = gtk_action_new ("ExportCS", "Export", "Export a CS to a file", "gtk-convert"), (self->ExportCS == NULL) ? NULL : (self->ExportCS = (g_object_unref (self->ExportCS), NULL)), _tmp6_);
- _tmp7_ = NULL;
- self->Quit = (_tmp7_ = gtk_action_new ("Quit", NULL, NULL, "gtk-quit"), (self->Quit == NULL) ? NULL : (self->Quit = (g_object_unref (self->Quit), NULL)), _tmp7_);
- _tmp8_ = NULL;
- self->EmulateR300 = (_tmp8_ = gtk_radio_action_new ("EmulateR300", "R300", "Emulate the R300 register space", NULL, (gint) EMULATION_CHIP_R300), (self->EmulateR300 == NULL) ? NULL : (self->EmulateR300 = (g_object_unref (self->EmulateR300), NULL)), _tmp8_);
- _tmp9_ = NULL;
- self->EmulateR500 = (_tmp9_ = gtk_radio_action_new ("EmulateR500", "R500", "Emulate the R500 register space", NULL, (gint) EMULATION_CHIP_R500), (self->EmulateR500 == NULL) ? NULL : (self->EmulateR500 = (g_object_unref (self->EmulateR500), NULL)), _tmp9_);
- gtk_radio_action_set_group (self->EmulateR500, gtk_radio_action_get_group (self->EmulateR300));
- gtk_radio_action_set_current_value (self->EmulateR300, (gint) EMULATION_CHIP_R300);
- g_signal_connect (self->ImportCS, "activate", (GCallback) __lambda10__gtk_action_activate, self);
+ GUICActions * self;
+ self = g_object_newv (object_type, 0, NULL);
return self;
}
@@ -299,111 +241,80 @@ GUICActions* gui_cactions_new (void) {
}
-static void gui_value_cactions_init (GValue* value) {
- value->data[0].v_pointer = NULL;
-}
-
-
-static void gui_value_cactions_free_value (GValue* value) {
- if (value->data[0].v_pointer) {
- gui_cactions_unref (value->data[0].v_pointer);
- }
-}
-
-
-static void gui_value_cactions_copy_value (const GValue* src_value, GValue* dest_value) {
- if (src_value->data[0].v_pointer) {
- dest_value->data[0].v_pointer = gui_cactions_ref (src_value->data[0].v_pointer);
- } else {
- dest_value->data[0].v_pointer = NULL;
- }
-}
-
-
-static gpointer gui_value_cactions_peek_pointer (const GValue* value) {
- return value->data[0].v_pointer;
-}
-
-
-static gchar* gui_value_cactions_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
- if (collect_values[0].v_pointer) {
- GUICActions* object;
- object = collect_values[0].v_pointer;
- if (object->parent_instance.g_class == NULL) {
- return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
- } else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
- return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
- }
- value->data[0].v_pointer = gui_cactions_ref (object);
- } else {
- value->data[0].v_pointer = NULL;
- }
- return NULL;
-}
-
-
-static gchar* gui_value_cactions_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
- GUICActions** object_p;
- object_p = collect_values[0].v_pointer;
- if (!object_p) {
- return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
- }
- if (!value->data[0].v_pointer) {
- *object_p = NULL;
- } else if (collect_flags && G_VALUE_NOCOPY_CONTENTS) {
- *object_p = value->data[0].v_pointer;
- } else {
- *object_p = gui_cactions_ref (value->data[0].v_pointer);
- }
- return NULL;
-}
-
-
-GParamSpec* gui_param_spec_cactions (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
- GUIParamSpecCActions* spec;
- g_return_val_if_fail (g_type_is_a (object_type, GUI_TYPE_CACTIONS), NULL);
- spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
- G_PARAM_SPEC (spec)->value_type = object_type;
- return G_PARAM_SPEC (spec);
+static void _lambda10_ (GtkAction* source, GUICActions* self) {
+ GUICSImport* d;
+ g_return_if_fail (source != NULL);
+ d = g_object_ref_sink (gui_cs_import_new ());
+ gtk_dialog_run ((GtkDialog*) d);
+ (d == NULL) ? NULL : (d = (g_object_unref (d), NULL));
}
-gpointer gui_value_get_cactions (const GValue* value) {
- g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GUI_TYPE_CACTIONS), NULL);
- return value->data[0].v_pointer;
+static void __lambda10__gtk_action_activate (GtkAction* _sender, gpointer self) {
+ _lambda10_ (_sender, self);
}
-void gui_value_set_cactions (GValue* value, gpointer v_object) {
- GUICActions* old;
- g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GUI_TYPE_CACTIONS));
- old = value->data[0].v_pointer;
- if (v_object) {
- g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, GUI_TYPE_CACTIONS));
- g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
- value->data[0].v_pointer = v_object;
- gui_cactions_ref (value->data[0].v_pointer);
- } else {
- value->data[0].v_pointer = NULL;
- }
- if (old) {
- gui_cactions_unref (old);
+static GObject * gui_cactions_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
+ GObject * obj;
+ GUICActionsClass * klass;
+ GObjectClass * parent_class;
+ GUICActions * self;
+ klass = GUI_CACTIONS_CLASS (g_type_class_peek (GUI_TYPE_CACTIONS));
+ parent_class = G_OBJECT_CLASS (g_type_class_peek_parent (klass));
+ obj = parent_class->constructor (type, n_construct_properties, construct_properties);
+ self = GUI_CACTIONS (obj);
+ {
+ GtkAction* _tmp0_;
+ GtkAction* _tmp1_;
+ GtkAction* _tmp2_;
+ GtkAction* _tmp3_;
+ GtkAction* _tmp4_;
+ GtkAction* _tmp5_;
+ GtkAction* _tmp6_;
+ GtkAction* _tmp7_;
+ GtkRadioAction* _tmp8_;
+ GtkRadioAction* _tmp9_;
+ _tmp0_ = NULL;
+ self->New = (_tmp0_ = gtk_action_new ("New", NULL, NULL, "gtk-new"), (self->New == NULL) ? NULL : (self->New = (g_object_unref (self->New), NULL)), _tmp0_);
+ _tmp1_ = NULL;
+ self->Open = (_tmp1_ = gtk_action_new ("Open", NULL, NULL, "gtk-open"), (self->Open == NULL) ? NULL : (self->Open = (g_object_unref (self->Open), NULL)), _tmp1_);
+ _tmp2_ = NULL;
+ self->Save = (_tmp2_ = gtk_action_new ("Save", NULL, NULL, "gtk-save"), (self->Save == NULL) ? NULL : (self->Save = (g_object_unref (self->Save), NULL)), _tmp2_);
+ _tmp3_ = NULL;
+ self->SaveAs = (_tmp3_ = gtk_action_new ("SaveAs", NULL, NULL, "gtk-save-as"), (self->SaveAs == NULL) ? NULL : (self->SaveAs = (g_object_unref (self->SaveAs), NULL)), _tmp3_);
+ _tmp4_ = NULL;
+ self->RemoveCS = (_tmp4_ = gtk_action_new ("RemoveCS", "Remove", "Remove selected CS' from the list", "gtk-remove"), (self->RemoveCS == NULL) ? NULL : (self->RemoveCS = (g_object_unref (self->RemoveCS), NULL)), _tmp4_);
+ _tmp5_ = NULL;
+ self->ImportCS = (_tmp5_ = gtk_action_new ("ImportCS", "Import", "Import a command stream to the list", "gtk-add"), (self->ImportCS == NULL) ? NULL : (self->ImportCS = (g_object_unref (self->ImportCS), NULL)), _tmp5_);
+ _tmp6_ = NULL;
+ self->ExportCS = (_tmp6_ = gtk_action_new ("ExportCS", "Export", "Export a CS to a file", "gtk-convert"), (self->ExportCS == NULL) ? NULL : (self->ExportCS = (g_object_unref (self->ExportCS), NULL)), _tmp6_);
+ _tmp7_ = NULL;
+ self->Quit = (_tmp7_ = gtk_action_new ("Quit", NULL, NULL, "gtk-quit"), (self->Quit == NULL) ? NULL : (self->Quit = (g_object_unref (self->Quit), NULL)), _tmp7_);
+ _tmp8_ = NULL;
+ self->EmulateR300 = (_tmp8_ = gtk_radio_action_new ("EmulateR300", "R300", "Emulate the R300 register space", NULL, (gint) EMULATION_CHIP_R300), (self->EmulateR300 == NULL) ? NULL : (self->EmulateR300 = (g_object_unref (self->EmulateR300), NULL)), _tmp8_);
+ _tmp9_ = NULL;
+ self->EmulateR500 = (_tmp9_ = gtk_radio_action_new ("EmulateR500", "R500", "Emulate the R500 register space", NULL, (gint) EMULATION_CHIP_R500), (self->EmulateR500 == NULL) ? NULL : (self->EmulateR500 = (g_object_unref (self->EmulateR500), NULL)), _tmp9_);
+ gtk_radio_action_set_group (self->EmulateR500, gtk_radio_action_get_group (self->EmulateR300));
+ gtk_radio_action_set_current_value (self->EmulateR300, (gint) EMULATION_CHIP_R300);
+ g_signal_connect (self->ImportCS, "activate", (GCallback) __lambda10__gtk_action_activate, self);
}
+ return obj;
}
static void gui_cactions_class_init (GUICActionsClass * klass) {
gui_cactions_parent_class = g_type_class_peek_parent (klass);
- GUI_CACTIONS_CLASS (klass)->finalize = gui_cactions_finalize;
+ G_OBJECT_CLASS (klass)->constructor = gui_cactions_constructor;
+ G_OBJECT_CLASS (klass)->finalize = gui_cactions_finalize;
}
static void gui_cactions_instance_init (GUICActions * self) {
- self->ref_count = 1;
}
-static void gui_cactions_finalize (GUICActions* obj) {
+static void gui_cactions_finalize (GObject* obj) {
GUICActions * self;
self = GUI_CACTIONS (obj);
(self->New == NULL) ? NULL : (self->New = (g_object_unref (self->New), NULL));
@@ -416,39 +327,20 @@ static void gui_cactions_finalize (GUICActions* obj) {
(self->Quit == NULL) ? NULL : (self->Quit = (g_object_unref (self->Quit), NULL));
(self->EmulateR300 == NULL) ? NULL : (self->EmulateR300 = (g_object_unref (self->EmulateR300), NULL));
(self->EmulateR500 == NULL) ? NULL : (self->EmulateR500 = (g_object_unref (self->EmulateR500), NULL));
+ G_OBJECT_CLASS (gui_cactions_parent_class)->finalize (obj);
}
GType gui_cactions_get_type (void) {
static GType gui_cactions_type_id = 0;
if (gui_cactions_type_id == 0) {
- static const GTypeValueTable g_define_type_value_table = { gui_value_cactions_init, gui_value_cactions_free_value, gui_value_cactions_copy_value, gui_value_cactions_peek_pointer, "p", gui_value_cactions_collect_value, "p", gui_value_cactions_lcopy_value };
- static const GTypeInfo g_define_type_info = { sizeof (GUICActionsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gui_cactions_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GUICActions), 0, (GInstanceInitFunc) gui_cactions_instance_init, &g_define_type_value_table };
- static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
- gui_cactions_type_id = g_type_register_fundamental (g_type_fundamental_next (), "GUICActions", &g_define_type_info, &g_define_type_fundamental_info, 0);
+ static const GTypeInfo g_define_type_info = { sizeof (GUICActionsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gui_cactions_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GUICActions), 0, (GInstanceInitFunc) gui_cactions_instance_init, NULL };
+ gui_cactions_type_id = g_type_register_static (G_TYPE_OBJECT, "GUICActions", &g_define_type_info, 0);
}
return gui_cactions_type_id;
}
-gpointer gui_cactions_ref (gpointer instance) {
- GUICActions* self;
- self = instance;
- g_atomic_int_inc (&self->ref_count);
- return instance;
-}
-
-
-void gui_cactions_unref (gpointer instance) {
- GUICActions* self;
- self = instance;
- if (g_atomic_int_dec_and_test (&self->ref_count)) {
- GUI_CACTIONS_GET_CLASS (self)->finalize (self);
- g_type_free_instance ((GTypeInstance *) self);
- }
-}
-
-
GUICMenus* gui_cmenus_construct (GType object_type) {
GUICMenus* self;
self = (GUICMenus*) g_type_create_instance (object_type);
@@ -677,7 +569,7 @@ static void _gui_cmain_open_csview_gtk_tree_view_row_activated (GtkTreeView* _se
}
-static void _gtk_main_quit_gtk_object_destroy (GUICMain* _sender, gpointer self) {
+static void _gtk_main_quit_gtk_object_destroy (GtkObject* _sender, gpointer self) {
gtk_main_quit ();
}
@@ -687,104 +579,106 @@ static GObject * gui_cmain_constructor (GType type, guint n_construct_properties
GUICMainClass * klass;
GObjectClass * parent_class;
GUICMain * self;
+ GError * _inner_error_;
klass = GUI_CMAIN_CLASS (g_type_class_peek (GUI_TYPE_CMAIN));
parent_class = G_OBJECT_CLASS (g_type_class_peek_parent (klass));
obj = parent_class->constructor (type, n_construct_properties, construct_properties);
self = GUI_CMAIN (obj);
+ _inner_error_ = NULL;
{
- GUICMenus* _tmp0_;
- GtkToolbar* _tmp1_;
- GtkToolItem* _tmp3_;
- GtkSeparatorToolItem* _tmp2_;
- GtkMenu* _tmp4_;
- GtkWidget* _tmp5_;
- GtkWidget* _tmp6_;
- GtkWidget* _tmp7_;
- GtkWidget* _tmp8_;
- GtkMenuItem* _tmp10_;
- GtkSeparatorMenuItem* _tmp9_;
- GtkWidget* _tmp11_;
- GtkMenuItem* menu_file_item;
- GtkMenu* _tmp12_;
- GtkWidget* _tmp13_;
- GtkWidget* _tmp14_;
+ GUICMenus* _tmp10_;
+ GtkToolbar* _tmp11_;
+ GtkToolItem* _tmp13_;
+ GtkSeparatorToolItem* _tmp12_;
+ GtkMenu* _tmp14_;
GtkWidget* _tmp15_;
- GtkMenuItem* menu_edit_item;
- GtkMenu* _tmp16_;
+ GtkWidget* _tmp16_;
GtkWidget* _tmp17_;
GtkWidget* _tmp18_;
+ GtkMenuItem* _tmp20_;
+ GtkSeparatorMenuItem* _tmp19_;
+ GtkWidget* _tmp21_;
+ GtkMenuItem* menu_file_item;
+ GtkMenu* _tmp22_;
+ GtkWidget* _tmp23_;
+ GtkWidget* _tmp24_;
+ GtkWidget* _tmp25_;
+ GtkMenuItem* menu_edit_item;
+ GtkMenu* _tmp26_;
+ GtkWidget* _tmp27_;
+ GtkWidget* _tmp28_;
GtkMenuItem* menu_emulation_item;
- GtkMenuBar* _tmp19_;
- GtkListStore* _tmp20_;
+ GtkMenuBar* _tmp29_;
+ GtkListStore* _tmp30_;
GtkTreeView* cslist;
- GtkCellRendererText* _tmp21_;
- GtkCellRendererText* _tmp22_;
+ GtkCellRendererText* _tmp31_;
+ GtkCellRendererText* _tmp32_;
GtkScrolledWindow* sw;
GtkVBox* mainbox;
- _tmp0_ = NULL;
- self->menu = (_tmp0_ = gui_cmenus_new (), (self->menu == NULL) ? NULL : (self->menu = (gui_cmenus_unref (self->menu), NULL)), _tmp0_);
- _tmp1_ = NULL;
- self->toolbar = (_tmp1_ = g_object_ref_sink ((GtkToolbar*) gtk_toolbar_new ()), (self->toolbar == NULL) ? NULL : (self->toolbar = (g_object_unref (self->toolbar), NULL)), _tmp1_);
+ _tmp10_ = NULL;
+ self->menu = (_tmp10_ = gui_cmenus_new (), (self->menu == NULL) ? NULL : (self->menu = (gui_cmenus_unref (self->menu), NULL)), _tmp10_);
+ _tmp11_ = NULL;
+ self->toolbar = (_tmp11_ = g_object_ref_sink ((GtkToolbar*) gtk_toolbar_new ()), (self->toolbar == NULL) ? NULL : (self->toolbar = (g_object_unref (self->toolbar), NULL)), _tmp11_);
gui_cmain_add_toolitem (self, gui_actions->New);
gui_cmain_add_toolitem (self, gui_actions->Open);
gui_cmain_add_toolitem (self, gui_actions->Save);
- _tmp3_ = NULL;
- _tmp2_ = NULL;
- gtk_toolbar_insert (self->toolbar, _tmp3_ = (_tmp2_ = g_object_ref_sink ((GtkSeparatorToolItem*) gtk_separator_tool_item_new ()), GTK_IS_TOOL_ITEM (_tmp2_) ? ((GtkToolItem*) _tmp2_) : NULL), -1);
- (_tmp3_ == NULL) ? NULL : (_tmp3_ = (g_object_unref (_tmp3_), NULL));
+ _tmp13_ = NULL;
+ _tmp12_ = NULL;
+ gtk_toolbar_insert (self->toolbar, _tmp13_ = (_tmp12_ = g_object_ref_sink ((GtkSeparatorToolItem*) gtk_separator_tool_item_new ()), GTK_IS_TOOL_ITEM (_tmp12_) ? ((GtkToolItem*) _tmp12_) : NULL), -1);
+ (_tmp13_ == NULL) ? NULL : (_tmp13_ = (g_object_unref (_tmp13_), NULL));
gui_cmain_add_toolitem (self, gui_actions->RemoveCS);
gui_cmain_add_toolitem (self, gui_actions->ImportCS);
gui_cmain_add_toolitem (self, gui_actions->ExportCS);
- _tmp4_ = NULL;
- self->menu->file = (_tmp4_ = g_object_ref_sink ((GtkMenu*) gtk_menu_new ()), (self->menu->file == NULL) ? NULL : (self->menu->file = (g_object_unref (self->menu->file), NULL)), _tmp4_);
- _tmp5_ = NULL;
- gtk_menu_shell_append ((GtkMenuShell*) self->menu->file, (GtkWidget*) (_tmp5_ = gtk_action_create_menu_item (gui_actions->New), GTK_IS_MENU_ITEM (_tmp5_) ? ((GtkMenuItem*) _tmp5_) : NULL));
- _tmp6_ = NULL;
- gtk_menu_shell_append ((GtkMenuShell*) self->menu->file, (GtkWidget*) (_tmp6_ = gtk_action_create_menu_item (gui_actions->Open), GTK_IS_MENU_ITEM (_tmp6_) ? ((GtkMenuItem*) _tmp6_) : NULL));
- _tmp7_ = NULL;
- gtk_menu_shell_append ((GtkMenuShell*) self->menu->file, (GtkWidget*) (_tmp7_ = gtk_action_create_menu_item (gui_actions->Save), GTK_IS_MENU_ITEM (_tmp7_) ? ((GtkMenuItem*) _tmp7_) : NULL));
- _tmp8_ = NULL;
- gtk_menu_shell_append ((GtkMenuShell*) self->menu->file, (GtkWidget*) (_tmp8_ = gtk_action_create_menu_item (gui_actions->SaveAs), GTK_IS_MENU_ITEM (_tmp8_) ? ((GtkMenuItem*) _tmp8_) : NULL));
- _tmp10_ = NULL;
- _tmp9_ = NULL;
- gtk_menu_shell_append ((GtkMenuShell*) self->menu->file, (GtkWidget*) (_tmp10_ = (_tmp9_ = g_object_ref_sink ((GtkSeparatorMenuItem*) gtk_separator_menu_item_new ()), GTK_IS_MENU_ITEM (_tmp9_) ? ((GtkMenuItem*) _tmp9_) : NULL)));
- (_tmp10_ == NULL) ? NULL : (_tmp10_ = (g_object_unref (_tmp10_), NULL));
- _tmp11_ = NULL;
- gtk_menu_shell_append ((GtkMenuShell*) self->menu->file, (GtkWidget*) (_tmp11_ = gtk_action_create_menu_item (gui_actions->Quit), GTK_IS_MENU_ITEM (_tmp11_) ? ((GtkMenuItem*) _tmp11_) : NULL));
- menu_file_item = g_object_ref_sink ((GtkMenuItem*) gtk_menu_item_new_with_label ("File"));
- gtk_menu_item_set_submenu (menu_file_item, self->menu->file);
- _tmp12_ = NULL;
- self->menu->edit = (_tmp12_ = g_object_ref_sink ((GtkMenu*) gtk_menu_new ()), (self->menu->edit == NULL) ? NULL : (self->menu->edit = (g_object_unref (self->menu->edit), NULL)), _tmp12_);
- _tmp13_ = NULL;
- gtk_menu_shell_append ((GtkMenuShell*) self->menu->edit, (GtkWidget*) (_tmp13_ = gtk_action_create_menu_item (gui_actions->RemoveCS), GTK_IS_MENU_ITEM (_tmp13_) ? ((GtkMenuItem*) _tmp13_) : NULL));
_tmp14_ = NULL;
- gtk_menu_shell_append ((GtkMenuShell*) self->menu->edit, (GtkWidget*) (_tmp14_ = gtk_action_create_menu_item (gui_actions->ImportCS), GTK_IS_MENU_ITEM (_tmp14_) ? ((GtkMenuItem*) _tmp14_) : NULL));
+ self->menu->file = (_tmp14_ = g_object_ref_sink ((GtkMenu*) gtk_menu_new ()), (self->menu->file == NULL) ? NULL : (self->menu->file = (g_object_unref (self->menu->file), NULL)), _tmp14_);
_tmp15_ = NULL;
- gtk_menu_shell_append ((GtkMenuShell*) self->menu->edit, (GtkWidget*) (_tmp15_ = gtk_action_create_menu_item (gui_actions->ExportCS), GTK_IS_MENU_ITEM (_tmp15_) ? ((GtkMenuItem*) _tmp15_) : NULL));
- menu_edit_item = g_object_ref_sink ((GtkMenuItem*) gtk_menu_item_new_with_label ("Edit"));
- gtk_menu_item_set_submenu (menu_edit_item, self->menu->edit);
+ gtk_menu_shell_append ((GtkMenuShell*) self->menu->file, (GtkWidget*) (_tmp15_ = gtk_action_create_menu_item (gui_actions->New), GTK_IS_MENU_ITEM (_tmp15_) ? ((GtkMenuItem*) _tmp15_) : NULL));
_tmp16_ = NULL;
- self->menu->emulation = (_tmp16_ = g_object_ref_sink ((GtkMenu*) gtk_menu_new ()), (self->menu->emulation == NULL) ? NULL : (self->menu->emulation = (g_object_unref (self->menu->emulation), NULL)), _tmp16_);
+ gtk_menu_shell_append ((GtkMenuShell*) self->menu->file, (GtkWidget*) (_tmp16_ = gtk_action_create_menu_item (gui_actions->Open), GTK_IS_MENU_ITEM (_tmp16_) ? ((GtkMenuItem*) _tmp16_) : NULL));
_tmp17_ = NULL;
- gtk_menu_shell_append ((GtkMenuShell*) self->menu->emulation, (GtkWidget*) (_tmp17_ = gtk_action_create_menu_item ((GtkAction*) gui_actions->EmulateR300), GTK_IS_MENU_ITEM (_tmp17_) ? ((GtkMenuItem*) _tmp17_) : NULL));
+ gtk_menu_shell_append ((GtkMenuShell*) self->menu->file, (GtkWidget*) (_tmp17_ = gtk_action_create_menu_item (gui_actions->Save), GTK_IS_MENU_ITEM (_tmp17_) ? ((GtkMenuItem*) _tmp17_) : NULL));
_tmp18_ = NULL;
- gtk_menu_shell_append ((GtkMenuShell*) self->menu->emulation, (GtkWidget*) (_tmp18_ = gtk_action_create_menu_item ((GtkAction*) gui_actions->EmulateR500), GTK_IS_MENU_ITEM (_tmp18_) ? ((GtkMenuItem*) _tmp18_) : NULL));
+ gtk_menu_shell_append ((GtkMenuShell*) self->menu->file, (GtkWidget*) (_tmp18_ = gtk_action_create_menu_item (gui_actions->SaveAs), GTK_IS_MENU_ITEM (_tmp18_) ? ((GtkMenuItem*) _tmp18_) : NULL));
+ _tmp20_ = NULL;
+ _tmp19_ = NULL;
+ gtk_menu_shell_append ((GtkMenuShell*) self->menu->file, (GtkWidget*) (_tmp20_ = (_tmp19_ = g_object_ref_sink ((GtkSeparatorMenuItem*) gtk_separator_menu_item_new ()), GTK_IS_MENU_ITEM (_tmp19_) ? ((GtkMenuItem*) _tmp19_) : NULL)));
+ (_tmp20_ == NULL) ? NULL : (_tmp20_ = (g_object_unref (_tmp20_), NULL));
+ _tmp21_ = NULL;
+ gtk_menu_shell_append ((GtkMenuShell*) self->menu->file, (GtkWidget*) (_tmp21_ = gtk_action_create_menu_item (gui_actions->Quit), GTK_IS_MENU_ITEM (_tmp21_) ? ((GtkMenuItem*) _tmp21_) : NULL));
+ menu_file_item = g_object_ref_sink ((GtkMenuItem*) gtk_menu_item_new_with_label ("File"));
+ gtk_menu_item_set_submenu (menu_file_item, self->menu->file);
+ _tmp22_ = NULL;
+ self->menu->edit = (_tmp22_ = g_object_ref_sink ((GtkMenu*) gtk_menu_new ()), (self->menu->edit == NULL) ? NULL : (self->menu->edit = (g_object_unref (self->menu->edit), NULL)), _tmp22_);
+ _tmp23_ = NULL;
+ gtk_menu_shell_append ((GtkMenuShell*) self->menu->edit, (GtkWidget*) (_tmp23_ = gtk_action_create_menu_item (gui_actions->RemoveCS), GTK_IS_MENU_ITEM (_tmp23_) ? ((GtkMenuItem*) _tmp23_) : NULL));
+ _tmp24_ = NULL;
+ gtk_menu_shell_append ((GtkMenuShell*) self->menu->edit, (GtkWidget*) (_tmp24_ = gtk_action_create_menu_item (gui_actions->ImportCS), GTK_IS_MENU_ITEM (_tmp24_) ? ((GtkMenuItem*) _tmp24_) : NULL));
+ _tmp25_ = NULL;
+ gtk_menu_shell_append ((GtkMenuShell*) self->menu->edit, (GtkWidget*) (_tmp25_ = gtk_action_create_menu_item (gui_actions->ExportCS), GTK_IS_MENU_ITEM (_tmp25_) ? ((GtkMenuItem*) _tmp25_) : NULL));
+ menu_edit_item = g_object_ref_sink ((GtkMenuItem*) gtk_menu_item_new_with_label ("Edit"));
+ gtk_menu_item_set_submenu (menu_edit_item, self->menu->edit);
+ _tmp26_ = NULL;
+ self->menu->emulation = (_tmp26_ = g_object_ref_sink ((GtkMenu*) gtk_menu_new ()), (self->menu->emulation == NULL) ? NULL : (self->menu->emulation = (g_object_unref (self->menu->emulation), NULL)), _tmp26_);
+ _tmp27_ = NULL;
+ gtk_menu_shell_append ((GtkMenuShell*) self->menu->emulation, (GtkWidget*) (_tmp27_ = gtk_action_create_menu_item ((GtkAction*) gui_actions->EmulateR300), GTK_IS_MENU_ITEM (_tmp27_) ? ((GtkMenuItem*) _tmp27_) : NULL));
+ _tmp28_ = NULL;
+ gtk_menu_shell_append ((GtkMenuShell*) self->menu->emulation, (GtkWidget*) (_tmp28_ = gtk_action_create_menu_item ((GtkAction*) gui_actions->EmulateR500), GTK_IS_MENU_ITEM (_tmp28_) ? ((GtkMenuItem*) _tmp28_) : NULL));
menu_emulation_item = g_object_ref_sink ((GtkMenuItem*) gtk_menu_item_new_with_label ("Emulation"));
gtk_menu_item_set_submenu (menu_emulation_item, self->menu->emulation);
- _tmp19_ = NULL;
- self->menubar = (_tmp19_ = g_object_ref_sink ((GtkMenuBar*) gtk_menu_bar_new ()), (self->menubar == NULL) ? NULL : (self->menubar = (g_object_unref (self->menubar), NULL)), _tmp19_);
+ _tmp29_ = NULL;
+ self->menubar = (_tmp29_ = g_object_ref_sink ((GtkMenuBar*) gtk_menu_bar_new ()), (self->menubar == NULL) ? NULL : (self->menubar = (g_object_unref (self->menubar), NULL)), _tmp29_);
gtk_menu_shell_append ((GtkMenuShell*) self->menubar, (GtkWidget*) menu_file_item);
gtk_menu_shell_append ((GtkMenuShell*) self->menubar, (GtkWidget*) menu_edit_item);
gtk_menu_shell_append ((GtkMenuShell*) self->menubar, (GtkWidget*) menu_emulation_item);
- _tmp20_ = NULL;
- self->cs_store = (_tmp20_ = gtk_list_store_new (2, G_TYPE_STRING, EMULATION_TYPE_CS, NULL), (self->cs_store == NULL) ? NULL : (self->cs_store = (g_object_unref (self->cs_store), NULL)), _tmp20_);
+ _tmp30_ = NULL;
+ self->cs_store = (_tmp30_ = gtk_list_store_new (2, G_TYPE_STRING, EMULATION_TYPE_CS, NULL), (self->cs_store == NULL) ? NULL : (self->cs_store = (g_object_unref (self->cs_store), NULL)), _tmp30_);
cslist = g_object_ref_sink ((GtkTreeView*) gtk_tree_view_new ());
- _tmp21_ = NULL;
- gtk_tree_view_insert_column_with_data_func (cslist, -1, "DWORDs", (GtkCellRenderer*) (_tmp21_ = g_object_ref_sink ((GtkCellRendererText*) gtk_cell_renderer_text_new ())), _gui_cmain_dwords_cellrenderer_gtk_tree_cell_data_func, g_object_ref (self), g_object_unref);
- (_tmp21_ == NULL) ? NULL : (_tmp21_ = (g_object_unref (_tmp21_), NULL));
- _tmp22_ = NULL;
- gtk_tree_view_insert_column_with_attributes (cslist, -1, "Name", (GtkCellRenderer*) (_tmp22_ = g_object_ref_sink ((GtkCellRendererText*) gtk_cell_renderer_text_new ())), "text", 0, NULL, NULL);
- (_tmp22_ == NULL) ? NULL : (_tmp22_ = (g_object_unref (_tmp22_), NULL));
+ _tmp31_ = NULL;
+ gtk_tree_view_insert_column_with_data_func (cslist, -1, "DWORDs", (GtkCellRenderer*) (_tmp31_ = g_object_ref_sink ((GtkCellRendererText*) gtk_cell_renderer_text_new ())), _gui_cmain_dwords_cellrenderer_gtk_tree_cell_data_func, g_object_ref (self), g_object_unref);
+ (_tmp31_ == NULL) ? NULL : (_tmp31_ = (g_object_unref (_tmp31_), NULL));
+ _tmp32_ = NULL;
+ gtk_tree_view_insert_column_with_attributes (cslist, -1, "Name", (GtkCellRenderer*) (_tmp32_ = g_object_ref_sink ((GtkCellRendererText*) gtk_cell_renderer_text_new ())), "text", 0, NULL, NULL);
+ (_tmp32_ == NULL) ? NULL : (_tmp32_ = (g_object_unref (_tmp32_), NULL));
gtk_tree_view_set_model (cslist, (GtkTreeModel*) self->cs_store);
g_signal_connect_object (cslist, "row-activated", (GCallback) _gui_cmain_open_csview_gtk_tree_view_row_activated, self, 0);
sw = g_object_ref_sink ((GtkScrolledWindow*) gtk_scrolled_window_new (NULL, NULL));
@@ -799,6 +693,18 @@ static GObject * gui_cmain_constructor (GType type, guint n_construct_properties
gtk_window_set_title ((GtkWindow*) self, "Radeon Simulator");
gtk_container_add ((GtkContainer*) self, (GtkWidget*) mainbox);
g_signal_connect ((GtkObject*) self, "destroy", (GCallback) _gtk_main_quit_gtk_object_destroy, NULL);
+ /* XXX This shouldn't be hardcoded */
+ gtk_window_set_icon_from_file ((GtkWindow*) self, "/usr/share/pixmaps/rsim.png", &_inner_error_);
+ if (_inner_error_ != NULL) {
+ (menu_file_item == NULL) ? NULL : (menu_file_item = (g_object_unref (menu_file_item), NULL));
+ (menu_edit_item == NULL) ? NULL : (menu_edit_item = (g_object_unref (menu_edit_item), NULL));
+ (menu_emulation_item == NULL) ? NULL : (menu_emulation_item = (g_object_unref (menu_emulation_item), NULL));
+ (cslist == NULL) ? NULL : (cslist = (g_object_unref (cslist), NULL));
+ (sw == NULL) ? NULL : (sw = (g_object_unref (sw), NULL));
+ (mainbox == NULL) ? NULL : (mainbox = (g_object_unref (mainbox), NULL));
+ g_critical ("file %s: line %d: uncaught error: %s", __FILE__, __LINE__, _inner_error_->message);
+ g_clear_error (&_inner_error_);
+ }
gtk_widget_show_all ((GtkWidget*) self);
(menu_file_item == NULL) ? NULL : (menu_file_item = (g_object_unref (menu_file_item), NULL));
(menu_edit_item == NULL) ? NULL : (menu_edit_item = (g_object_unref (menu_edit_item), NULL));
@@ -848,7 +754,7 @@ void gui_init (char*** args, int* args_length1) {
GUICMain* _tmp1_;
gtk_init (&(*args_length1), &(*args));
_tmp0_ = NULL;
- gui_actions = (_tmp0_ = gui_cactions_new (), (gui_actions == NULL) ? NULL : (gui_actions = (gui_cactions_unref (gui_actions), NULL)), _tmp0_);
+ gui_actions = (_tmp0_ = gui_cactions_new (), (gui_actions == NULL) ? NULL : (gui_actions = (g_object_unref (gui_actions), NULL)), _tmp0_);
_tmp1_ = NULL;
gui_main = (_tmp1_ = g_object_ref_sink (gui_cmain_new ()), (gui_main == NULL) ? NULL : (gui_main = (g_object_unref (gui_main), NULL)), _tmp1_);
gtk_main ();
@@ -863,11 +769,15 @@ gint _main (char** args, int args_length1) {
r300_registers = (_tmp0_ = emulation_spec_new (), (r300_registers == NULL) ? NULL : (r300_registers = (g_object_unref (r300_registers), NULL)), _tmp0_);
_tmp1_ = NULL;
r500_registers = (_tmp1_ = emulation_spec_new (), (r500_registers == NULL) ? NULL : (r500_registers = (g_object_unref (r500_registers), NULL)), _tmp1_);
- emulation_spec_load_xml (r300_registers, "r300reg.xml", "r300");
- emulation_spec_load_xml (r500_registers, "r300reg.xml", "r500");
+ /* XXX This shouldn't be hardcoded */
+ emulation_spec_load_xml (r300_registers, "/usr/share/rsim/r300reg.xml", "r300");
+ emulation_spec_load_xml (r500_registers, "/usr/share/rsim/r300reg.xml", "r500");
gui_init (&args, &args_length1);
+ /* vala doesn't unref globals */
g_object_unref ((GObject*) r300_registers);
g_object_unref ((GObject*) r500_registers);
+ g_object_unref ((GObject*) gui_actions);
+ g_object_unref ((GObject*) gui_main);
result = 0;
return result;
}
diff --git a/src/main.vala b/src/main.vala
index 4a55e92..b9d707c 100644
--- a/src/main.vala
+++ b/src/main.vala
@@ -3,7 +3,7 @@ using Gtk;
namespace GUI
{
- public class CActions
+ public class CActions : GLib.Object
{
public Action New;
public Action Open;
@@ -17,8 +17,7 @@ namespace GUI
public RadioAction EmulateR300;
public RadioAction EmulateR500;
- public CActions()
- {
+ construct {
New = new Action("New", null, null, "gtk-new");
Open = new Action("Open", null, null, "gtk-open");
Save = new Action("Save", null, null, "gtk-save");
@@ -33,7 +32,7 @@ namespace GUI
EmulateR500.set_group(EmulateR300.get_group());
EmulateR300.set_current_value(Chip.R300);
- ImportCS.activate += ((source) => { var d = new CSImport(); d.run(); });
+ ImportCS.activate.connect((source) => { var d = new CSImport(); d.run(); });
}
}
@@ -96,7 +95,7 @@ namespace GUI
cslist.insert_column_with_data_func(-1, "DWORDs", new CellRendererText(), dwords_cellrenderer);
cslist.insert_column_with_attributes(-1, "Name", new CellRendererText(), "text", 0, null);
cslist.set_model(cs_store);
- cslist.row_activated += open_csview;
+ cslist.row_activated.connect(open_csview);
var sw = new ScrolledWindow(null, null);
sw.hscrollbar_policy = PolicyType.AUTOMATIC;
@@ -111,7 +110,9 @@ namespace GUI
set_size_request(400, 200);
title = "Radeon Simulator";
add(mainbox);
- destroy += main_quit;
+ destroy.connect(main_quit);
+ /* XXX This shouldn't be hardcoded */
+ set_icon_from_file("/usr/share/pixmaps/rsim.png");
show_all();
}
@@ -162,10 +163,17 @@ public static int main(string[] args)
{
r300_registers = new Spec();
r500_registers = new Spec();
- r300_registers.load_xml("r300reg.xml", "r300");
- r500_registers.load_xml("r300reg.xml", "r500");
+
+ /* XXX This shouldn't be hardcoded */
+ r300_registers.load_xml("/usr/share/rsim/r300reg.xml", "r300");
+ r500_registers.load_xml("/usr/share/rsim/r300reg.xml", "r500");
GUI.init(ref args);
+
+ /* vala doesn't unref globals */
r300_registers.unref();
r500_registers.unref();
+ GUI.actions.unref();
+ GUI.main.unref();
+
return 0;
}