File: GtkList.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 (262 lines) | stat: -rw-r--r-- 6,939 bytes parent folder | download | duplicates (5)
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
/*
 * Copyright (c) 2003 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$
 *
 * NOTE: GtkList and GtkListItem are deprecated and only included b/c GtkCombo
 * still makes use of them, they are subject to removal at any point so you
 * should not utilize them unless absolutly necessary.)
 *
 */

#include "gtk2perl.h"

MODULE = Gtk2::List	PACKAGE = Gtk2::List	PREFIX = gtk_list_

=for position DESCRIPTION

=head1 DESCRIPTION

Gtk2::List is deprecated; use Gtk2::TreeView and a Gtk2::ListStore instead.

Gtk2::List is included in Gtk2-Perl only because Gtk2::Combo still makes
use of it, and Gtk2::Combo's replacement, Gtk2::ComboBox, didn't appear in
gtk+ until 2.4.0.

=cut

#ifdef GTK_TYPE_LIST

##  GtkWidget* gtk_list_new (void) 
GtkWidget *
gtk_list_new (class)
    C_ARGS:
	/* void */

## parameter order flipped on this function so the item
## list soaks up the rest of the arg stack
##  void gtk_list_insert_items (GtkList *list, GList *items, gint position) 
=for apidoc
=for arg ... of Gtk2::ListItem's to be inserted
=cut
void
gtk_list_insert_items (list, position, ...)
	GtkList       * list
	gint            position
    PREINIT:
	GList * list_items = NULL;
    CODE:
	for( items--; items > 0; items-- )
		list_items = g_list_prepend(list_items, 
					SvGtkListItem(ST(items)));
	if( list_items )
	{
		gtk_list_insert_items(list, list_items, position);
		g_list_free(list_items);
	}

##  void gtk_list_append_items (GtkList *list, GList *items) 
=for apidoc
=for arg ... of Gtk2::ListItem's to be appended
=cut
void
gtk_list_append_items (list, ...)
	GtkList       * list
    PREINIT:
	GList * list_items = NULL;
    CODE:
	for( items--; items > 0; items-- )
		list_items = g_list_prepend(list_items, 
					SvGtkListItem(ST(items)));
	if( list_items )
	{
		gtk_list_append_items(list, list_items);
		g_list_free(list_items);
	}

##  void gtk_list_prepend_items (GtkList *list, GList *items) 
=for apidoc
=for arg list_item (GtkListItem)
=for arg ... of Gtk2::ListItem's to be prepended
=cut
void
gtk_list_prepend_items (list, ...)
	GtkList       * list
    PREINIT:
	GList * list_items = NULL;
    CODE:
	for( items--; items > 0; items-- )
		list_items = g_list_prepend(list_items, 
					SvGtkListItem(ST(items)));
	if( list_items )
	{
		gtk_list_prepend_items(list, list_items);
		g_list_free(list_items);
	}

##  void gtk_list_remove_items (GtkList *list, GList *items) 
=for apidoc
=for arg list_item (GtkListItem)
=for arg ... of Gtk2::ListItem's to be removed
=cut
void
gtk_list_remove_items (list, ...)
	GtkList       * list
    PREINIT:
	GList * list_items = NULL;
    CODE:
	for( items--; items > 0; items-- )
		list_items = g_list_prepend(list_items, 
					SvGtkListItem(ST(items)));
	if( list_items )
	{
		gtk_list_remove_items(list, list_items);
		g_list_free(list_items);
	}

## should this function be through since perl handles the ref counting, i'm
## going to go with no till i hear otherwise
##  void gtk_list_remove_items_no_unref (GtkList *list, GList *items) 
##void
##gtk_list_remove_items_no_unref (list, list_item, ...)
##	GtkList       * list
##	GtkListItem   * list_item
##    PREINIT:
##	GList * list_items = NULL;
##    CODE:
##	for( items--; items > 0; items-- )
##		list_items = g_list_prepend(list_items, 
##					SvGtkListItem(ST(items)));
##	if( list_items )
##	{
##		gtk_list_remove_items_no_unref(list, list_items);
##		g_list_free(list_items);
##	}

##  void gtk_list_clear_items (GtkList *list, gint start, gint end) 
void
gtk_list_clear_items (list, start, end)
	GtkList * list
	gint      start
	gint      end

##  void gtk_list_select_item (GtkList *list, gint item) 
void
gtk_list_select_item (list, item)
	GtkList * list
	gint      item

##  void gtk_list_unselect_item (GtkList *list, gint item) 
void
gtk_list_unselect_item (list, item)
	GtkList * list
	gint      item

##  void gtk_list_select_child (GtkList *list, GtkWidget *child) 
void
gtk_list_select_child (list, child)
	GtkList   * list
	GtkWidget * child

##  void gtk_list_unselect_child (GtkList *list, GtkWidget *child) 
void
gtk_list_unselect_child (list, child)
	GtkList   * list
	GtkWidget * child

##  gint gtk_list_child_position (GtkList *list, GtkWidget *child) 
gint
gtk_list_child_position (list, child)
	GtkList   * list
	GtkWidget * child

##  void gtk_list_set_selection_mode (GtkList *list, GtkSelectionMode mode) 
void
gtk_list_set_selection_mode (list, mode)
	GtkList          * list
	GtkSelectionMode   mode

##  void gtk_list_extend_selection (GtkList *list, GtkScrollType scroll_type, gfloat position, gboolean auto_start_selection) 
void
gtk_list_extend_selection (list, scroll_type, position, auto_start_selection)
	GtkList       * list
	GtkScrollType   scroll_type
	gfloat          position
	gboolean        auto_start_selection

##  void gtk_list_start_selection (GtkList *list) 
void
gtk_list_start_selection (list)
	GtkList * list

##  void gtk_list_end_selection (GtkList *list) 
void
gtk_list_end_selection (list)
	GtkList * list

##  void gtk_list_select_all (GtkList *list) 
void
gtk_list_select_all (list)
	GtkList *list

##  void gtk_list_unselect_all (GtkList *list) 
void
gtk_list_unselect_all (list)
	GtkList *list

##  void gtk_list_scroll_horizontal (GtkList *list, GtkScrollType scroll_type, gfloat position) 
void
gtk_list_scroll_horizontal (list, scroll_type, position)
	GtkList *list
	GtkScrollType scroll_type
	gfloat position

##  void gtk_list_scroll_vertical (GtkList *list, GtkScrollType scroll_type, gfloat position) 
void
gtk_list_scroll_vertical (list, scroll_type, position)
	GtkList *list
	GtkScrollType scroll_type
	gfloat position

##  void gtk_list_toggle_add_mode (GtkList *list) 
void
gtk_list_toggle_add_mode (list)
	GtkList *list

##  void gtk_list_toggle_focus_row (GtkList *list) 
void
gtk_list_toggle_focus_row (list)
	GtkList *list

##  void gtk_list_toggle_row (GtkList *list, GtkWidget *item) 
void
gtk_list_toggle_row (list, item)
	GtkList *list
	GtkWidget *item

##  void gtk_list_undo_selection (GtkList *list) 
void
gtk_list_undo_selection (list)
	GtkList *list

##  void gtk_list_end_drag_selection (GtkList *list) 
void
gtk_list_end_drag_selection (list)
	GtkList *list

#endif /* GTK_TYPE_LIST */