File: GtkTooltips.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 (107 lines) | stat: -rw-r--r-- 3,572 bytes parent folder | download | duplicates (2)
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
/*
 * Copyright (c) 2003, 2013 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"

MODULE = Gtk2::Tooltips	PACKAGE = Gtk2::Tooltips	PREFIX = gtk_tooltips_

## GtkTooltips* gtk_tooltips_new (void)
GtkTooltips *
gtk_tooltips_new (class)
    C_ARGS:
	/* void */

## void gtk_tooltips_enable (GtkTooltips *tooltips)
void
gtk_tooltips_enable (tooltips)
	GtkTooltips * tooltips

## void gtk_tooltips_disable (GtkTooltips *tooltips)
void
gtk_tooltips_disable (tooltips)
	GtkTooltips * tooltips

## void gtk_tooltips_set_tip (GtkTooltips *tooltips, GtkWidget *widget, const gchar *tip_text, const gchar *tip_private)
void
gtk_tooltips_set_tip (tooltips, widget, tip_text, tip_private=NULL)
	GtkTooltips * tooltips
	GtkWidget   * widget
	const gchar * tip_text
	SV * tip_private
    PREINIT:
	const gchar * real_tip_private = NULL;
    CODE:
	if (gperl_sv_is_defined (tip_private))
		real_tip_private = SvGChar (tip_private);
	gtk_tooltips_set_tip (tooltips, widget, tip_text, real_tip_private);
	/* gtk+'s widgets do not hold a reference on the tooltips object,
	 * as you might expect; in fact, it's the other way around.
	 * let's use a weakref on the widget to keep the tooltips object
	 * alive as long as the widget is alive. */
	g_object_ref (G_OBJECT (tooltips));
	g_object_weak_ref (G_OBJECT (widget),
	                   (GWeakNotify)g_object_unref, tooltips);

## GtkTooltipsData* gtk_tooltips_data_get (GtkWidget *widget)
=for apidoc
=for signature hash_ref = $tooltips->data_get ($widget)
Returns a hash reference with the keys: tooptips, widget, tip_text, and
tip_private.

tooltips is the GtkTooltips group that this tooltip belongs to. widget is the
GtkWidget that this tooltip data is associated with. tip_text is a string
containing the tooltip message itself.

tip_private is a string that is not shown as the default tooltip. Instead, this
message may be more informative and go towards forming a context-sensitive help
system for your application.
=cut
void
gtk_tooltips_data_get (class, widget)
	GtkWidget * widget
    PREINIT:
	GtkTooltipsData * ret = NULL;
	HV              * hv;
    PPCODE:
	ret = gtk_tooltips_data_get(widget);
	if( !ret )
		XSRETURN_UNDEF;

	hv = newHV();

	if (ret->tooltips)
		gperl_hv_take_sv_s(hv, "tooltips", newSVGtkTooltips(ret->tooltips));
	if (ret->widget)
		gperl_hv_take_sv_s(hv, "widget", newSVGtkWidget(GTK_WIDGET(ret->widget)));
	if (ret->tip_text)
		gperl_hv_take_sv_s(hv, "tip_text", newSVpv(ret->tip_text, 0));
	if (ret->tip_private)
		gperl_hv_take_sv_s(hv, "tip_private", newSVpv(ret->tip_private, 0));

	XPUSHs(sv_2mortal(newRV_noinc((SV*)hv)));

## void gtk_tooltips_force_window (GtkTooltips *tooltips)
void
gtk_tooltips_force_window (tooltips)
	GtkTooltips * tooltips

## void _gtk_tooltips_toggle_keyboard_mode (GtkWidget *widget)