File: GtkStatusIcon.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 (170 lines) | stat: -rw-r--r-- 5,449 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
/*
 * Copyright (c) 2006 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::StatusIcon	PACKAGE = Gtk2::StatusIcon	PREFIX = gtk_status_icon_

GtkStatusIcon_noinc *gtk_status_icon_new (class);
    C_ARGS:
        /*void*/

GtkStatusIcon_noinc *gtk_status_icon_new_from_pixbuf (class, GdkPixbuf *pixbuf);
    C_ARGS:
        pixbuf

GtkStatusIcon_noinc *gtk_status_icon_new_from_file (class, GPerlFilename_const filename);
    C_ARGS:
        filename

GtkStatusIcon_noinc *gtk_status_icon_new_from_stock (class, const gchar *stock_id);
    C_ARGS:
        stock_id

GtkStatusIcon_noinc *gtk_status_icon_new_from_icon_name (class, const gchar *icon_name);
    C_ARGS:
        icon_name

void gtk_status_icon_set_from_pixbuf (GtkStatusIcon *status_icon, GdkPixbuf_ornull *pixbuf);

##void gtk_status_icon_set_from_file (GtkStatusIcon *status_icon, const gchar *filename);
void gtk_status_icon_set_from_file (GtkStatusIcon *status_icon, GPerlFilename_const filename);

void gtk_status_icon_set_from_stock (GtkStatusIcon *status_icon, const gchar *stock_id);

void gtk_status_icon_set_from_icon_name (GtkStatusIcon *status_icon, const gchar *icon_name);

GtkImageType gtk_status_icon_get_storage_type (GtkStatusIcon *status_icon);

GdkPixbuf_ornull *gtk_status_icon_get_pixbuf (GtkStatusIcon *status_icon);

const gchar_ornull *gtk_status_icon_get_stock (GtkStatusIcon *status_icon);

const gchar_ornull *gtk_status_icon_get_icon_name (GtkStatusIcon *status_icon);

gint gtk_status_icon_get_size (GtkStatusIcon *status_icon);

void gtk_status_icon_set_tooltip (GtkStatusIcon *status_icon, const gchar_ornull *tooltip_text);

void gtk_status_icon_set_visible (GtkStatusIcon *status_icon, gboolean visible);

gboolean gtk_status_icon_get_visible (GtkStatusIcon *status_icon);

void gtk_status_icon_set_blinking (GtkStatusIcon *status_icon, gboolean blinking);

gboolean gtk_status_icon_get_blinking (GtkStatusIcon *status_icon);

gboolean gtk_status_icon_is_embedded (GtkStatusIcon *status_icon);

=for apidoc

=for signature (x, y, push_in) = Gtk2::StatusIcon::position_menu (menu, icon)
=for signature (x, y, push_in) = Gtk2::StatusIcon::position_menu (menu, x, y, icon)

=for arg menu (Gtk2::Menu)
=for arg x (integer)
=for arg y (integer)
=for arg icon (Gtk2::StatusIcon)

This function takes four arguments so that it may be passed directly as the
menu position callback to Gtk2::Menu::popup(), which passes in initial x and y
values for historical reasons.  Otherwise, you need only pass two arguments.

This function can be used as the I<menu_pos_func> argument to
I<Gtk2::Menu::popup>.

=cut
void
gtk_status_icon_position_menu (GtkMenu *menu, ...)
     PREINIT:
	gboolean push_in;
	gint x, y;
	GtkStatusIcon *icon;
     PPCODE:
	if (items == 4) {
		/* Compatibility mode */
		x = SvIV (ST (1));
		y = SvIV (ST (2));
		icon = SvGtkStatusIcon (ST (3));
	} else
		icon = SvGtkStatusIcon (ST (1));
	/* PUTBACK/SPAGAIN because gtk_status_icon_position_menu() calls out
	   to menu->size_request, which may be a perl class closure */
	PUTBACK;
	gtk_status_icon_position_menu (menu, &x, &y, &push_in, icon);
	SPAGAIN;
	EXTEND (sp, 3);
	PUSHs (sv_2mortal (newSViv (x)));
	PUSHs (sv_2mortal (newSViv (y)));
	PUSHs (sv_2mortal (newSVuv (push_in)));

# gboolean gtk_status_icon_get_geometry (GtkStatusIcon *status_icon, GdkScreen **screen, GdkRectangle *area, GtkOrientation *orientation);
void
gtk_status_icon_get_geometry (GtkStatusIcon *status_icon)
    PREINIT:
	GdkScreen *screen;
	GdkRectangle area;
	GtkOrientation orientation;
    PPCODE:
	if (!gtk_status_icon_get_geometry (status_icon, &screen, &area,
	                                   &orientation))
		XSRETURN_EMPTY;

	EXTEND (sp, 3);
	PUSHs (sv_2mortal (newSVGdkScreen (screen)));
	PUSHs (sv_2mortal (newSVGdkRectangle_copy (&area)));
	PUSHs (sv_2mortal (newSVGtkOrientation (orientation)));

#if GTK_CHECK_VERSION (2, 12, 0)

void gtk_status_icon_set_screen (GtkStatusIcon *status_icon, GdkScreen *screen);

GdkScreen *gtk_status_icon_get_screen (GtkStatusIcon *status_icon);

#endif

#if GTK_CHECK_VERSION (2, 14, 0)

guint32 gtk_status_icon_get_x11_window_id (GtkStatusIcon *status_icon);

#endif /* 2.14 */

#if GTK_CHECK_VERSION (2, 16, 0)

void gtk_status_icon_set_has_tooltip (GtkStatusIcon *status_icon, gboolean has_tooltip);

gboolean gtk_status_icon_get_has_tooltip (GtkStatusIcon *status_icon);

gchar_own_ornull *gtk_status_icon_get_tooltip_markup (GtkStatusIcon *status_icon);

gchar_own_ornull *gtk_status_icon_get_tooltip_text (GtkStatusIcon *status_icon);

#Unlike the corresponding methods in GtkWidget, these setters use plain char instead of gchar.
#However I expect that is an error or oversight and the char and gchar types are supposedly
#equivalent anyway. Also using gchar lets me use the _ornull.

void gtk_status_icon_set_tooltip_text (GtkStatusIcon *status_icon,  const gchar_ornull *text);

void gtk_status_icon_set_tooltip_markup (GtkStatusIcon *status_icon, const gchar_ornull *markup);

#endif /* 2.16 */

#if GTK_CHECK_VERSION (2, 18, 0)

void gtk_status_icon_set_title (GtkStatusIcon *status_icon, const gchar *title);

const gchar * gtk_status_icon_get_title (GtkStatusIcon *status_icon);

#endif /* 2.18 */

#if GTK_CHECK_VERSION (2, 20, 0)

void gtk_status_icon_set_name (GtkStatusIcon *status_icon, const gchar *name);

#endif /* 2.20 */