File: GtkAssistant.xs

package info (click to toggle)
libgtk2-perl 2:1.2499-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 4,668 kB
  • ctags: 594
  • sloc: perl: 22,100; ansic: 122; makefile: 17
file content (154 lines) | stat: -rw-r--r-- 4,868 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
/*
 * Copyright (c) 2006 by the gtk2-perl team (see the file AUTHORS)
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library 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
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the 
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 
 * Boston, MA  02111-1307  USA.
 *
 * $Id$
 */

#include "gtk2perl.h"


static GPerlCallback *
gtk2perl_assistant_page_func_create (SV * func,
                                     SV * data)
{
	GType param_types[1];
	param_types[0] = G_TYPE_INT;

	return gperl_callback_new (func, data, G_N_ELEMENTS (param_types),
	                           param_types, G_TYPE_INT);
}

static gint
gtk2perl_assistant_page_func (gint current_page,
                              gpointer data)
{
	GPerlCallback *callback = (GPerlCallback*) data;
	GValue value = {0, };
	gint retval;

	g_value_init (&value, G_TYPE_INT);
	retval = g_value_get_int (&value);
	gperl_callback_invoke (callback, &value, current_page);
	retval = g_value_get_int (&value);
	g_value_unset (&value);

	return retval;
}


MODULE = Gtk2::Assistant	PACKAGE = Gtk2::Assistant	PREFIX = gtk_assistant_

##struct _GtkAssistant
##{
##  GtkWindow  parent;
##
##  GtkWidget *cancel;
##  GtkWidget *forward;
##  GtkWidget *back;
##  GtkWidget *apply;
##  GtkWidget *close;
##  GtkWidget *last;
##
##  /*< private >*/
##  GtkAssistantPrivate *priv;
##};
GtkWidget_ornull *
get_cancel_button (GtkAssistant * assistant)
    ALIAS:
	get_forward_button = 1
	get_back_button = 2
	get_apply_button = 3
	get_close_button = 4
	get_last_button = 5
    CODE:
	switch (ix) {
	    case 0:	RETVAL = assistant->cancel;	break;
	    case 1:	RETVAL = assistant->forward;	break;
	    case 2:	RETVAL = assistant->back;	break;
	    case 3:	RETVAL = assistant->apply;	break;
	    case 4:	RETVAL = assistant->close;	break;
	    case 5:	RETVAL = assistant->last;	break;

	    default:
		RETVAL = NULL;
		g_assert_not_reached ();
	}
    OUTPUT:
	RETVAL


GtkWidget * gtk_assistant_new (class);
    C_ARGS:
        /*void*/

gint gtk_assistant_get_current_page (GtkAssistant *assistant);

void gtk_assistant_set_current_page (GtkAssistant *assistant, gint page_num);

gint gtk_assistant_get_n_pages (GtkAssistant *assistant);

GtkWidget *gtk_assistant_get_nth_page (GtkAssistant *assistant, gint page_num);

gint gtk_assistant_prepend_page (GtkAssistant *assistant, GtkWidget *page);

gint gtk_assistant_append_page (GtkAssistant *assistant, GtkWidget *page);

gint gtk_assistant_insert_page (GtkAssistant *assistant, GtkWidget *page, gint position);

## void gtk_assistant_set_forward_page_func (GtkAssistant *assistant, GtkAssistantPageFunc page_func, gpointer data, GDestroyNotify destroy);
void gtk_assistant_set_forward_page_func (GtkAssistant *assistant, SV * func, SV * data=NULL);
    PREINIT:
        GPerlCallback * callback;
    CODE:
        callback = gtk2perl_assistant_page_func_create (func, data);
	gtk_assistant_set_forward_page_func
		(assistant,
		 gtk2perl_assistant_page_func, callback,
		 (GDestroyNotify) gperl_callback_destroy);

void gtk_assistant_set_page_type (GtkAssistant *assistant, GtkWidget *page, GtkAssistantPageType type);

GtkAssistantPageType gtk_assistant_get_page_type (GtkAssistant *assistant, GtkWidget *page);

void gtk_assistant_set_page_title (GtkAssistant *assistant, GtkWidget *page, const gchar *title);

const gchar *gtk_assistant_get_page_title (GtkAssistant *assistant, GtkWidget *page);

void gtk_assistant_set_page_header_image (GtkAssistant *assistant, GtkWidget *page, GdkPixbuf *pixbuf);

GdkPixbuf *gtk_assistant_get_page_header_image (GtkAssistant *assistant, GtkWidget *page);

void gtk_assistant_set_page_side_image (GtkAssistant *assistant, GtkWidget *page, GdkPixbuf *pixbuf);

GdkPixbuf *gtk_assistant_get_page_side_image (GtkAssistant *assistant, GtkWidget *page);

void gtk_assistant_set_page_complete (GtkAssistant *assistant, GtkWidget *page, gboolean complete);

gboolean gtk_assistant_get_page_complete (GtkAssistant *assistant, GtkWidget *page);

void gtk_assistant_add_action_widget (GtkAssistant *assistant, GtkWidget *child);

void gtk_assistant_remove_action_widget (GtkAssistant *assistant, GtkWidget *child);

void gtk_assistant_update_buttons_state (GtkAssistant *assistant);

#if GTK_CHECK_VERSION (2, 22, 0)

void gtk_assistant_commit (GtkAssistant *assistant);

#endif /* 2.22 */