Initial commit
[fillmore] / src / fillmore / fillmore / trackinformation.c
diff --git a/src/fillmore/fillmore/trackinformation.c b/src/fillmore/fillmore/trackinformation.c
new file mode 100644 (file)
index 0000000..730e6b4
--- /dev/null
@@ -0,0 +1,243 @@
+/* trackinformation.c generated by valac, the Vala compiler
+ * generated from trackinformation.vala, do not modify */
+
+/* Copyright 2009 Yorba Foundation
+ *
+ * This software is licensed under the GNU Lesser General Public License
+ * (version 2.1 or later).  See the COPYING file in this distribution. 
+ */
+
+#include <glib.h>
+#include <glib-object.h>
+#include <hildon/hildon.h>
+#include <gtk/gtk.h>
+#include <stdlib.h>
+#include <string.h>
+
+
+#define UI_TYPE_TRACK_INFORMATION (ui_track_information_get_type ())
+#define UI_TRACK_INFORMATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UI_TYPE_TRACK_INFORMATION, UITrackInformation))
+#define UI_TRACK_INFORMATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UI_TYPE_TRACK_INFORMATION, UITrackInformationClass))
+#define UI_IS_TRACK_INFORMATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UI_TYPE_TRACK_INFORMATION))
+#define UI_IS_TRACK_INFORMATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UI_TYPE_TRACK_INFORMATION))
+#define UI_TRACK_INFORMATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UI_TYPE_TRACK_INFORMATION, UITrackInformationClass))
+
+typedef struct _UITrackInformation UITrackInformation;
+typedef struct _UITrackInformationClass UITrackInformationClass;
+typedef struct _UITrackInformationPrivate UITrackInformationPrivate;
+#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
+#define _g_free0(var) (var = (g_free (var), NULL))
+
+struct _UITrackInformation {
+       HildonDialog parent_instance;
+       UITrackInformationPrivate * priv;
+};
+
+struct _UITrackInformationClass {
+       HildonDialogClass parent_class;
+};
+
+struct _UITrackInformationPrivate {
+       HildonEntry* entry;
+};
+
+
+static gpointer ui_track_information_parent_class = NULL;
+
+GType ui_track_information_get_type (void);
+#define UI_TRACK_INFORMATION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UI_TYPE_TRACK_INFORMATION, UITrackInformationPrivate))
+enum  {
+       UI_TRACK_INFORMATION_DUMMY_PROPERTY
+};
+void ui_track_information_set_track_name (UITrackInformation* self, const char* new_name);
+char* ui_track_information_get_track_name (UITrackInformation* self);
+static void ui_track_information_on_entry_changed (UITrackInformation* self);
+UITrackInformation* ui_track_information_new (void);
+UITrackInformation* ui_track_information_construct (GType object_type);
+static void _ui_track_information_on_entry_changed_gtk_editable_changed (GtkEditable* _sender, gpointer self);
+static GObject * ui_track_information_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
+static void ui_track_information_finalize (GObject* obj);
+
+
+
+#line 34 "trackinformation.vala"
+void ui_track_information_set_track_name (UITrackInformation* self, const char* new_name) {
+#line 34 "trackinformation.vala"
+       g_return_if_fail (UI_IS_TRACK_INFORMATION (self));
+#line 34 "trackinformation.vala"
+       g_return_if_fail (new_name != NULL);
+#line 35 "trackinformation.vala"
+       hildon_entry_set_text (self->priv->entry, new_name);
+#line 36 "trackinformation.vala"
+       gtk_editable_select_region (GTK_EDITABLE (self->priv->entry), 0, -1);
+#line 74 "trackinformation.c"
+}
+
+
+#line 1018 "glib-2.0.vapi"
+static char* string_strip (const char* self) {
+#line 80 "trackinformation.c"
+       char* result = NULL;
+       char* _result_;
+#line 1018 "glib-2.0.vapi"
+       g_return_val_if_fail (self != NULL, NULL);
+#line 1019 "glib-2.0.vapi"
+       _result_ = g_strdup (self);
+#line 1020 "glib-2.0.vapi"
+       g_strstrip (_result_);
+#line 89 "trackinformation.c"
+       result = _result_;
+#line 1021 "glib-2.0.vapi"
+       return result;
+#line 93 "trackinformation.c"
+}
+
+
+#line 39 "trackinformation.vala"
+char* ui_track_information_get_track_name (UITrackInformation* self) {
+#line 99 "trackinformation.c"
+       char* result = NULL;
+#line 39 "trackinformation.vala"
+       g_return_val_if_fail (UI_IS_TRACK_INFORMATION (self), NULL);
+#line 103 "trackinformation.c"
+       result = string_strip (hildon_entry_get_text (self->priv->entry));
+#line 40 "trackinformation.vala"
+       return result;
+#line 107 "trackinformation.c"
+}
+
+
+static glong string_get_length (const char* self) {
+       glong result;
+       g_return_val_if_fail (self != NULL, 0L);
+       result = g_utf8_strlen (self, -1);
+#line 1158 "glib-2.0.vapi"
+       return result;
+#line 117 "trackinformation.c"
+}
+
+
+#line 43 "trackinformation.vala"
+static void ui_track_information_on_entry_changed (UITrackInformation* self) {
+#line 123 "trackinformation.c"
+       char* _tmp0_;
+       gboolean _tmp1_;
+       gboolean is_valid;
+#line 43 "trackinformation.vala"
+       g_return_if_fail (UI_IS_TRACK_INFORMATION (self));
+#line 44 "trackinformation.vala"
+       is_valid = (_tmp1_ = string_get_length (_tmp0_ = ui_track_information_get_track_name (self)) > 0, _g_free0 (_tmp0_), _tmp1_);
+#line 45 "trackinformation.vala"
+       gtk_dialog_set_response_sensitive (GTK_DIALOG (self), (gint) GTK_RESPONSE_OK, is_valid);
+#line 133 "trackinformation.c"
+}
+
+
+#line 8 "trackinformation.vala"
+UITrackInformation* ui_track_information_construct (GType object_type) {
+#line 139 "trackinformation.c"
+       UITrackInformation * self;
+       self = g_object_newv (object_type, 0, NULL);
+       return self;
+}
+
+
+#line 8 "trackinformation.vala"
+UITrackInformation* ui_track_information_new (void) {
+#line 8 "trackinformation.vala"
+       return ui_track_information_construct (UI_TYPE_TRACK_INFORMATION);
+#line 150 "trackinformation.c"
+}
+
+
+#line 43 "trackinformation.vala"
+static void _ui_track_information_on_entry_changed_gtk_editable_changed (GtkEditable* _sender, gpointer self) {
+#line 156 "trackinformation.c"
+       ui_track_information_on_entry_changed (self);
+}
+
+
+static GObject * ui_track_information_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
+       GObject * obj;
+       GObjectClass * parent_class;
+       UITrackInformation * self;
+       parent_class = G_OBJECT_CLASS (ui_track_information_parent_class);
+       obj = parent_class->constructor (type, n_construct_properties, construct_properties);
+       self = UI_TRACK_INFORMATION (obj);
+       {
+               GtkLabel* label;
+               HildonEntry* _tmp0_;
+               GtkTable* table;
+#line 13 "trackinformation.vala"
+               gtk_window_set_title (GTK_WINDOW (self), "New Track");
+#line 14 "trackinformation.vala"
+               gtk_window_set_modal (GTK_WINDOW (self), TRUE);
+#line 15 "trackinformation.vala"
+               hildon_dialog_add_buttons (HILDON_DIALOG (self), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OK, GTK_RESPONSE_OK, NULL, NULL);
+#line 18 "trackinformation.vala"
+               label = g_object_ref_sink ((GtkLabel*) gtk_label_new ("Track name:"));
+#line 19 "trackinformation.vala"
+               self->priv->entry = (_tmp0_ = g_object_ref_sink ((HildonEntry*) hildon_entry_new (HILDON_SIZE_HALFSCREEN_WIDTH | HILDON_SIZE_FINGER_HEIGHT)), _g_object_unref0 (self->priv->entry), _tmp0_);
+#line 20 "trackinformation.vala"
+               gtk_entry_set_activates_default (GTK_ENTRY (self->priv->entry), TRUE);
+#line 21 "trackinformation.vala"
+               g_signal_connect_object (GTK_EDITABLE (self->priv->entry), "changed", (GCallback) _ui_track_information_on_entry_changed_gtk_editable_changed, self, 0);
+#line 23 "trackinformation.vala"
+               table = g_object_ref_sink ((GtkTable*) gtk_table_new ((guint) 1, (guint) 2, FALSE));
+#line 24 "trackinformation.vala"
+               gtk_table_attach_defaults (table, GTK_WIDGET (label), (guint) 0, (guint) 1, (guint) 0, (guint) 1);
+#line 25 "trackinformation.vala"
+               gtk_table_attach_defaults (table, GTK_WIDGET (self->priv->entry), (guint) 1, (guint) 2, (guint) 0, (guint) 1);
+#line 26 "trackinformation.vala"
+               gtk_table_set_col_spacing (table, (guint) 0, (guint) 12);
+#line 27 "trackinformation.vala"
+               gtk_container_set_border_width (GTK_CONTAINER (table), (guint) 12);
+#line 29 "trackinformation.vala"
+               gtk_box_pack_start (GTK_BOX (GTK_DIALOG (self)->vbox), GTK_WIDGET (table), TRUE, TRUE, (guint) 0);
+#line 30 "trackinformation.vala"
+               gtk_widget_show_all (GTK_WIDGET (self));
+#line 31 "trackinformation.vala"
+               gtk_dialog_set_default_response (GTK_DIALOG (self), (gint) GTK_RESPONSE_OK);
+#line 202 "trackinformation.c"
+               _g_object_unref0 (label);
+               _g_object_unref0 (table);
+       }
+       return obj;
+}
+
+
+static void ui_track_information_class_init (UITrackInformationClass * klass) {
+       ui_track_information_parent_class = g_type_class_peek_parent (klass);
+       g_type_class_add_private (klass, sizeof (UITrackInformationPrivate));
+       G_OBJECT_CLASS (klass)->constructor = ui_track_information_constructor;
+       G_OBJECT_CLASS (klass)->finalize = ui_track_information_finalize;
+}
+
+
+static void ui_track_information_instance_init (UITrackInformation * self) {
+       self->priv = UI_TRACK_INFORMATION_GET_PRIVATE (self);
+}
+
+
+static void ui_track_information_finalize (GObject* obj) {
+       UITrackInformation * self;
+       self = UI_TRACK_INFORMATION (obj);
+       _g_object_unref0 (self->priv->entry);
+       G_OBJECT_CLASS (ui_track_information_parent_class)->finalize (obj);
+}
+
+
+GType ui_track_information_get_type (void) {
+       static volatile gsize ui_track_information_type_id__volatile = 0;
+       if (g_once_init_enter (&ui_track_information_type_id__volatile)) {
+               static const GTypeInfo g_define_type_info = { sizeof (UITrackInformationClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) ui_track_information_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UITrackInformation), 0, (GInstanceInitFunc) ui_track_information_instance_init, NULL };
+               GType ui_track_information_type_id;
+               ui_track_information_type_id = g_type_register_static (HILDON_TYPE_DIALOG, "UITrackInformation", &g_define_type_info, 0);
+               g_once_init_leave (&ui_track_information_type_id__volatile, ui_track_information_type_id);
+       }
+       return ui_track_information_type_id__volatile;
+}
+
+
+
+