File: GtkAccelMap.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 (187 lines) | stat: -rw-r--r-- 5,142 bytes parent folder | download | duplicates (7)
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
/*
 * Copyright (c) 2003-2005 by the gtk2-perl team (see the file AUTHORS)
 *
 * Licensed under the LGPL, see LICENSE file for more information.
 *
 * $Id$
 */

#include "gtk2perl.h"

static void
gtk2perl_gtk_accel_map_foreach (GPerlCallback *callback, 
				const gchar *accel_path, guint accel_key, 
				GdkModifierType accel_mods, gboolean changed)
{
	gperl_callback_invoke (callback, NULL, accel_path, accel_key, 
			       accel_mods, changed);
}

MODULE = Gtk2::AccelMap PACKAGE = Gtk2::AccelMap PREFIX = gtk_accel_map_

=for position post_methods

=head1 FOREACH CALLBACK

The foreach callbacks ignore any returned values and the following parameters
are passed to the callback any modifications are ignored.

  accel_path (string)
  accel_key (integer)
  GdkModifierType accel_mods (Gtk2::Gdk::ModifierType)
  changed (boolean)
  user_date (scalar)

=cut

##  void gtk_accel_map_add_entry (const gchar *accel_path, guint accel_key, GdkModifierType accel_mods)
void
gtk_accel_map_add_entry (class, accel_path, accel_key, accel_mods)
	const gchar     * accel_path
	guint             accel_key
	GdkModifierType   accel_mods
    C_ARGS:
	accel_path, accel_key, accel_mods

##  gboolean gtk_accel_map_lookup_entry (const gchar *accel_path, GtkAccelKey *key)
=for apidoc
=for signature (accel_key, accel_mods, accel_flags) = Gtk2::AccelMap->lookup_entry ($accel_path)
Returns empty if no accelerator is found for the given path, accel_key
(integer), accel_mods (Gtk2::Gdk::ModifierType), and accel_flags (integer)
otherwise.
=cut
void
gtk_accel_map_lookup_entry (class, accel_path)
	const gchar * accel_path
    PREINIT:
	GtkAccelKey key;
    PPCODE:
	if (gtk_accel_map_lookup_entry (accel_path, &key))
	{
		EXTEND (SP, 3);
		PUSHs (sv_2mortal (newSViv (key.accel_key)));
		PUSHs (sv_2mortal (newSVGdkModifierType (key.accel_mods)));
		PUSHs (sv_2mortal (newSViv (key.accel_flags)));
	}
	else
		XSRETURN_EMPTY;

##  gboolean gtk_accel_map_change_entry (const gchar *accel_path, guint accel_key, GdkModifierType accel_mods, gboolean replace)
gboolean
gtk_accel_map_change_entry (class, accel_path, accel_key, accel_mods, replace)
	const gchar     * accel_path
	guint             accel_key
	GdkModifierType   accel_mods
	gboolean          replace
    C_ARGS:
	accel_path, accel_key, accel_mods, replace

##  void gtk_accel_map_load (const gchar *file_name)
void
gtk_accel_map_load (class, file_name)
	const gchar * file_name
    C_ARGS:
	file_name

##  void gtk_accel_map_save (const gchar *file_name)
void
gtk_accel_map_save (class, file_name)
	const gchar * file_name
    C_ARGS:
	file_name


##  void gtk_accel_map_load_fd (gint fd)
void
gtk_accel_map_load_fd (class, fd)
	gint fd
    C_ARGS:
	fd

## TODO: GScanner ...
##  void gtk_accel_map_load_scanner (GScanner *scanner)
##void
##gtk_accel_map_load_scanner (scanner)
##	GScanner *scanner

##  void gtk_accel_map_save_fd (gint fd)
void
gtk_accel_map_save_fd (class, fd)
	gint fd
    C_ARGS:
	fd

##  void gtk_accel_map_add_filter (const gchar *filter_pattern)
void
gtk_accel_map_add_filter (class, filter_pattern)
	const gchar * filter_pattern
    C_ARGS:
	filter_pattern

##void        (*GtkAccelMapForeach)           (gpointer data,
##                                             const gchar *accel_path,
##                                             guint accel_key,
##                                             GdkModifierType accel_mods,
##                                             gboolean changed);

##  void gtk_accel_map_foreach (gpointer data, GtkAccelMapForeach foreach_func)
void
gtk_accel_map_foreach (class, data, foreach_func)
	SV * data
	SV * foreach_func
    PREINIT:
	GPerlCallback * callback = NULL;
	GType types[4];
    CODE:
    	types[0] = G_TYPE_STRING;
    	types[1] = G_TYPE_UINT;
    	types[2] = GDK_TYPE_MODIFIER_TYPE;
    	types[3] = G_TYPE_BOOLEAN;
	callback = gperl_callback_new (foreach_func, data, 4, types, 
				       G_TYPE_NONE);
	gtk_accel_map_foreach 
		(callback, (GtkAccelMapForeach)gtk2perl_gtk_accel_map_foreach);
	gperl_callback_destroy (callback);

##  void gtk_accel_map_foreach_unfiltered (gpointer data, GtkAccelMapForeach foreach_func)
void
gtk_accel_map_foreach_unfiltered (class, data, foreach_func)
	SV * data
	SV * foreach_func
    PREINIT:
	GPerlCallback * callback = NULL;
	GType types[4];
    CODE:
    	types[0] = G_TYPE_STRING;
    	types[1] = G_TYPE_UINT;
    	types[2] = GDK_TYPE_MODIFIER_TYPE;
    	types[3] = G_TYPE_BOOLEAN;
	callback = gperl_callback_new (foreach_func, data, 4, types, 
				       G_TYPE_NONE);
	gtk_accel_map_foreach_unfiltered
		(callback, (GtkAccelMapForeach)gtk2perl_gtk_accel_map_foreach);
	gperl_callback_destroy (callback);

#if GTK_CHECK_VERSION (2, 4, 0)

## GtkAccelMap* gtk_accel_map_get (void);
GtkAccelMap *
gtk_accel_map_get (class)
    C_ARGS:
	/* void */

##  void gtk_accel_map_lock_path (const gchar *accel_path);
void
gtk_accel_map_lock_path (class, accel_path)
	const gchar *accel_path
    C_ARGS:
	accel_path

##  void gtk_accel_map_unlock_path (const gchar *accel_path);
void
gtk_accel_map_unlock_path (class, accel_path)
	const gchar *accel_path
    C_ARGS:
	accel_path

#endif