File: GdkVisual.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 (201 lines) | stat: -rw-r--r-- 4,622 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
/*
 * Copyright (c) 2004 by the gtk2-perl team (see the file AUTHORS)
 *
 * Licensed under the LGPL, see LICENSE file for more information.
 *
 * $Id$
 */

#include "gtk2perl.h"

MODULE = Gtk2::Gdk::Visual	PACKAGE = Gtk2::Gdk	PREFIX = gdk_

=for apidoc
Returns a list of depths.
=cut
## void gdk_query_depths (gint **depths, gint *count)
void
gdk_query_depths (class)
    PREINIT:
	gint *depths = NULL;
	gint i, count = 0;
    PPCODE:
	gdk_query_depths (&depths, &count);

	if (count <= 0 || depths == NULL)
		XSRETURN_EMPTY;

	EXTEND (sp, count);

	for (i = 0; i < count; i++)
		PUSHs (sv_2mortal (newSViv (depths[i])));

## void gdk_query_visual_types (GdkVisualType **visual_types, gint *count)
void
gdk_query_visual_types (class)
    PREINIT:
	GdkVisualType *visual_types = NULL;
	gint i, count = 0;
    PPCODE:
	gdk_query_visual_types (&visual_types, &count);

	if (count <= 0 || visual_types == NULL)
		XSRETURN_EMPTY;

	EXTEND (sp, count);

	for (i = 0; i < count; i++)
		PUSHs (sv_2mortal (newSVGdkVisualType (visual_types[i])));

## GList* gdk_list_visuals (void)
void
gdk_list_visuals (class)
    PREINIT:
	GList *i, *visuals = NULL;
    PPCODE:
	PERL_UNUSED_VAR (ax);
	visuals = gdk_list_visuals ();
	for (i = visuals; i != NULL; i = i->next)
		XPUSHs (sv_2mortal (newSVGdkVisual (i->data)));
	g_list_free (visuals);

MODULE = Gtk2::Gdk::Visual	PACKAGE = Gtk2::Gdk::Visual	PREFIX = gdk_visual_

## gint gdk_visual_get_best_depth (void)
gint
gdk_visual_get_best_depth (class)
    C_ARGS:
	/* void */

## GdkVisualType gdk_visual_get_best_type (void)
GdkVisualType
gdk_visual_get_best_type (class)
    C_ARGS:
	/* void */

## GdkVisual* gdk_visual_get_system (void)
GdkVisual*
gdk_visual_get_system (class)
    C_ARGS:
	/* void */

## GdkVisual* gdk_visual_get_best (void)
GdkVisual*
gdk_visual_get_best (class)
    C_ARGS:
	/* void */

## GdkVisual* gdk_visual_get_best_with_depth (gint depth)
GdkVisual_ornull*
gdk_visual_get_best_with_depth (class, depth)
	gint depth
    C_ARGS:
	depth

## GdkVisual* gdk_visual_get_best_with_type (GdkVisualType visual_type)
GdkVisual_ornull*
gdk_visual_get_best_with_type (class, visual_type)
	GdkVisualType visual_type
    C_ARGS:
	visual_type

## GdkVisual* gdk_visual_get_best_with_both (gint depth, GdkVisualType visual_type)
GdkVisual_ornull*
gdk_visual_get_best_with_both (class, depth, visual_type)
	gint depth
	GdkVisualType visual_type
    C_ARGS:
	depth, visual_type

#if GTK_CHECK_VERSION(2, 2, 0)

## GdkScreen* gdk_visual_get_screen (GdkVisual *visual)
GdkScreen*
gdk_visual_get_screen (visual)
	GdkVisual *visual

#endif

# --------------------------------------------------------------------------- #

GdkVisualType
type (visual)
	GdkVisual *visual
    CODE:
	RETVAL = visual->type;
    OUTPUT:
	RETVAL

GdkByteOrder
byte_order (visual)
	GdkVisual *visual
    CODE:
	RETVAL = visual->byte_order;
    OUTPUT:
	RETVAL

gint
depth (visual)
	GdkVisual *visual
    ALIAS:
	colormap_size = 1
	bits_per_rgb = 2
	red_shift = 3
	red_prec = 4
	green_shift = 5
	green_prec = 6
	blue_shift = 7
	blue_prec = 8
    CODE:
	RETVAL = 0; /* -W */
	switch (ix) {
		case 0: RETVAL = visual->depth; break;
		case 1: RETVAL = visual->colormap_size; break;
		case 2: RETVAL = visual->bits_per_rgb; break;
		case 3: RETVAL = visual->red_shift; break;
		case 4: RETVAL = visual->red_prec; break;
		case 5: RETVAL = visual->green_shift; break;
		case 6: RETVAL = visual->green_prec; break;
		case 7: RETVAL = visual->blue_shift; break;
		case 8: RETVAL = visual->blue_prec; break;
		default: g_assert_not_reached ();
	}
    OUTPUT:
	RETVAL

guint32
red_mask (visual)
	GdkVisual *visual
    ALIAS:
	green_mask = 1
	blue_mask = 2
    CODE:
	RETVAL = 0; /* -W */
	switch (ix) {
		case 0: RETVAL = visual->red_mask; break;
		case 1: RETVAL = visual->green_mask; break;
		case 2: RETVAL = visual->blue_mask; break;
		default: g_assert_not_reached();
	}
    OUTPUT:
	RETVAL

#if GTK_CHECK_VERSION (2, 22, 0)

void gdk_visual_get_blue_pixel_details (GdkVisual *visual, OUTLIST guint32 mask, OUTLIST gint shift, OUTLIST gint precision);

void gdk_visual_get_green_pixel_details (GdkVisual *visual, OUTLIST guint32 mask, OUTLIST gint shift, OUTLIST gint precision);

void gdk_visual_get_red_pixel_details (GdkVisual *visual, OUTLIST guint32 mask, OUTLIST gint shift, OUTLIST gint precision);

gint gdk_visual_get_bits_per_rgb (GdkVisual *visual);

GdkByteOrder gdk_visual_get_byte_order (GdkVisual *visual);

gint gdk_visual_get_colormap_size (GdkVisual *visual);

gint gdk_visual_get_depth (GdkVisual *visual);

GdkVisualType gdk_visual_get_visual_type (GdkVisual *visual);

#endif /* 2.22 */