Fix build against melted and mvcp.
[rugen] / src / page.c
1 /*
2 * page.c -- Page handling
3 * Copyright (C) 2002-2003 Charles Yates <charles.yates@pandora.be>
4 * Copyright (C) 2010 Dan Dennedy <dan@dennedy.org>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 */
20
21 #include <page.h>
22 #include <gtk/gtk.h>
23
24 GtkWidget *page_get_widget( page this )
25 {
26 return this->get_widget( this );
27 }
28
29 void page_get_toolbar_info( page this, GtkIconSize size, GtkWidget **icon, char **label )
30 {
31 if ( this->get_toolbar_info )
32 {
33 this->get_toolbar_info( this, size, icon, label );
34 }
35 else
36 {
37 *icon = gtk_image_new_from_stock( "gtk-execute", size );
38 *label = "_Unknown";
39 }
40 }
41
42 /** Called on connection being established to a server.
43 */
44
45 void page_on_connect( page this )
46 {
47 if ( this->on_connect )
48 this->on_connect( this );
49 }
50
51 /** Called on a disconnection from a server.
52 */
53
54 void page_on_disconnect( page this )
55 {
56 if ( this->on_disconnect )
57 this->on_disconnect( this );
58 }
59
60 /** Called when the user changes the selected unit.
61 */
62
63 void page_on_unit_change( page this, int unit )
64 {
65 if ( this->on_unit_change )
66 this->on_unit_change( this, unit );
67 }
68
69 /** Called to propogate status information to any page that's interested.
70 */
71
72 void page_show_status( page this, mvcp_status status )
73 {
74 if ( this->show_status )
75 this->show_status( this, status );
76 }
77
78 /** Called on close.
79 */
80
81 void page_close( page this )
82 {
83 if ( this->close )
84 this->close( this );
85 }
86