page_command.c \
page_status.c \
page_units.c \
+ page_operate.c \
gtkenhancedscale.c gtkenhancedscale.h
rugen_CFLAGS = `pkg-config --cflags gthread-2.0 mlt-melted mlt-mvcp`
// gtk_signal_connect( GTK_OBJECT( widget ), "clicked", GTK_SIGNAL_FUNC( on_item_quit_activate ), this );
/* Initialise the pages. */
- dv1394app_register_page( this, page_status_init( this ) );
- dv1394app_register_page( this, page_clips_init( this ) );
+ dv1394app_register_page( this, page_operate_init( this ) );
dv1394app_register_page( this, page_command_init( this ) );
this->guard = 1;
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( this->page_buttons[ 0 ] ), TRUE );
}
GtkWidget*
-create_page_status (void)
-{
- GtkWidget *page_status;
-
- page_status = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_title (GTK_WINDOW (page_status), _("page_status"));
- GLADE_HOOKUP_OBJECT_NO_REF (page_status, page_status, "page_status");
-
- create_pane_status (page_status, page_status);
-
- return page_status;
-}
-
-GtkWidget*
-create_page_clips (void)
+create_page_operate (void)
{
GtkWidget *page_clips;
GtkWidget *vbox8;
GtkWidget *frame1, *frame2;
page_clips = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_title (GTK_WINDOW (page_clips), _("page_clips"));
+ gtk_window_set_title (GTK_WINDOW (page_clips), _("page_operate"));
+ GLADE_HOOKUP_OBJECT_NO_REF (page_clips, page_clips, "page_operate");
hpaned0 = gtk_hpaned_new ();
gtk_widget_show (hpaned0);
gtk_frame_set_shadow_type (GTK_FRAME (frame1), GTK_SHADOW_IN);
gtk_frame_set_shadow_type (GTK_FRAME (frame2), GTK_SHADOW_IN);
gtk_widget_show(frame1);
+ GLADE_HOOKUP_OBJECT (page_clips, frame1, "page_clips");
gtk_widget_show(frame2);
+ GLADE_HOOKUP_OBJECT (page_clips, frame2, "page_status");
gtk_widget_set_size_request (hpaned0, 200 , -1);
gtk_paned_pack1 (GTK_PANED (hpaned0), frame1, TRUE, FALSE);
gtk_paned_pack2 (GTK_PANED (hpaned0), frame2, FALSE, FALSE);
gtk_widget_set_size_request (frame2, 250, -1);
-// create_pane_status (page_clips, frame2);
-// GLADE_HOOKUP_OBJECT_NO_REF (page_status, page_status, "page_status");
+ create_pane_status (frame2, page_clips);
vbox8 = gtk_vbox_new (FALSE, 0);
gtk_widget_show (vbox8);
gtk_label_set_justify (GTK_LABEL (label45), GTK_JUSTIFY_LEFT);
/* Store pointers to all widgets, for use by lookup_widget(). */
- GLADE_HOOKUP_OBJECT_NO_REF (page_clips, page_clips, "page_clips");
GLADE_HOOKUP_OBJECT (page_clips, vbox8, "vbox8");
GLADE_HOOKUP_OBJECT (page_clips, hbox26, "hbox26");
GLADE_HOOKUP_OBJECT (page_clips, label_directory, "label_directory");
GtkWidget* create_gdv1394d (void);
GtkWidget* create_window_connection (void);
-GtkWidget* create_page_status (void);
-GtkWidget* create_page_clips (void);
+GtkWidget* create_page_operate (void);
GtkWidget* create_page_shell (void);
extern void page_close( page );
/* page factories */
-extern page page_clips_init( dv1394app );
+extern page page_clips_init( dv1394app, struct page_t* );
extern page page_command_init( dv1394app );
-extern page page_status_init( dv1394app );
+extern page page_status_init( dv1394app, struct page_t* );
extern page page_units_init( dv1394app );
+extern page page_operate_init( dv1394app );
#endif
// TODO: This comes out later
int mode;
GtkWidget *modes[ 4 ];
+
+ struct page_t *parent_page;
}
*page_clips, page_clips_t;
static GtkWidget *this_page_get_widget( page_clips this )
{
if ( this->widget == NULL )
- this->widget = create_page_clips( );
+ this->widget = this->parent_page->get_widget(this->parent_page);
return this->widget;
}
free( this );
}
-page page_clips_init( dv1394app app )
+page page_clips_init( dv1394app app, struct page_t *parent_page)
{
page_clips this = calloc( 1, sizeof( page_clips_t ) );
GtkWidget *widget;
int index = 0;
+ this->parent_page = parent_page;
this->parent.get_widget = ( GtkWidget *(*)( page ) )this_page_get_widget;
this->parent.get_toolbar_info = this_page_get_toolbar_info;
this->parent.on_connect = ( void (*)( page ) )this_page_on_connect;
--- /dev/null
+/*
+ * page_status.c -- Status Page Handling
+ * Copyright (C) 2002-2003 Charles Yates <charles.yates@pandora.be>
+ * Copyright (C) 2010 Dan Dennedy <dan@dennedy.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <gtk/gtk.h>
+
+#include "interface.h"
+#include "support.h"
+#include "dv1394app.h"
+#include "page.h"
+
+typedef struct
+{
+ struct page_t parent;
+ dv1394app app;
+ GtkWidget *widget;
+ page status;
+ page clips;
+}
+*page_operate, page_operate_t;
+
+static GtkWidget *this_page_get_widget( page super )
+{
+ page_operate this = ( page_operate )super;
+ if ( this->widget == NULL )
+ this->widget = create_page_operate( );
+ return this->widget;
+}
+
+static void this_page_get_toolbar_info( page super, GtkIconSize size, GtkWidget **icon, char **label )
+{
+ page_operate this = ( page_operate )super;
+
+ if ( this != NULL )
+ {
+ *icon = gtk_image_new_from_stock( "gtk-justify-fill", size );
+ *label = _("_Operate");
+ }
+}
+
+static void this_page_on_connect( page super )
+{
+ page_operate this = ( page_operate )super;
+
+ if ( this != NULL )
+ {
+ this->clips->on_connect(this->clips);
+ this->status->on_connect(this->status);
+ }
+}
+
+static void this_page_on_disconnect( page super )
+{
+ page_operate this = ( page_operate )super;
+
+ if ( this != NULL )
+ {
+ this->clips->on_disconnect(this->clips);
+ this->status->on_disconnect(this->status);
+ }
+}
+
+static void this_page_close( page super )
+{
+ page_operate this = ( page_operate )super;
+
+ if ( this != NULL )
+ {
+ this->clips->close(this->clips);
+ this->status->close(this->status);
+ free( this );
+ }
+}
+
+static void this_page_show_status( page super, mvcp_status status )
+{
+ page_operate this = ( page_operate )super;
+
+ if ( this != NULL )
+ this->clips->show_status(this->clips, status);
+}
+
+
+page page_operate_init( dv1394app app )
+{
+ page_operate this = calloc( 1, sizeof( page_operate_t ) );
+
+ this->parent.get_widget = this_page_get_widget;
+ this->parent.get_toolbar_info = this_page_get_toolbar_info;
+ this->parent.on_connect = this_page_on_connect;
+ this->parent.on_disconnect = this_page_on_disconnect;
+ this->parent.close = this_page_close;
+ this->parent.show_status = this_page_show_status;
+
+ this->clips = page_clips_init( app, (page)this);
+ this->status = page_status_init( app, (page)this );
+
+ return ( page )this;
+}
guint context;
int unit;
int count;
+ struct page_t *parent_page;
}
*page_status, page_status_t;
{
page_status this = ( page_status )super;
if ( this->widget == NULL )
- this->widget = create_page_status( );
+ this->widget = this->parent_page->get_widget(this->parent_page);
return this->widget;
}
free( this );
}
-page page_status_init( dv1394app app )
+page page_status_init( dv1394app app, struct page_t *parent_page )
{
page_status this = calloc( 1, sizeof( page_status_t ) );
int index = 0;
GtkWidget *widget;
-
+
+ this->parent_page = parent_page;
this->parent.get_widget = this_page_get_widget;
this->parent.get_toolbar_info = this_page_get_toolbar_info;
this->parent.on_connect = this_page_on_connect;