X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fpage_operate.c;fp=src%2Fpage_operate.c;h=2cb9d6375d9b046778c326bf351b1d99701f1747;hb=348abadd910a29af82380c3b896f4eb4b2467483;hp=0000000000000000000000000000000000000000;hpb=0984db69a0f1bf22495be70aa06b96217d5fb0b8;p=rugen diff --git a/src/page_operate.c b/src/page_operate.c new file mode 100644 index 0000000..2cb9d63 --- /dev/null +++ b/src/page_operate.c @@ -0,0 +1,122 @@ +/* + * page_status.c -- Status Page Handling + * Copyright (C) 2002-2003 Charles Yates + * Copyright (C) 2010 Dan Dennedy + * + * 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 +#endif + +#include +#include +#include +#include + +#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; +}