1 /*
2  * Copyright (c) 2007 by the gtk2-perl team (see the file AUTHORS)
3  *
4  * Licensed under the LGPL, see LICENSE file for more information.
5  *
6  * $Id$
7  */
8 
9 #include "gtk2perl.h"
10 
11 #define ICONS_FROM_STACK(offset, icons)					\
12 	if (items > offset) {						\
13 		int i;							\
14 		/* icons is supposed to be NULL-terminated */		\
15 		icons = g_new0 (gchar *, items - offset + 1);		\
16 		for (i = offset; i < items; i++) {			\
17 			icons[i - offset] = SvPV_nolen (ST (i));	\
18 		}							\
19 	}								\
20 
21 MODULE = Gtk2::ScaleButton	PACKAGE = Gtk2::ScaleButton	PREFIX = gtk_scale_button_
22 
23 # GtkWidget * gtk_scale_button_new (GtkIconSize size, gdouble min, gdouble max, gdouble step, const gchar **icons);
24 GtkWidget *
25 gtk_scale_button_new (class, GtkIconSize size, gdouble min, gdouble max, gdouble step, ...)
26     PREINIT:
27 	gchar **icons = NULL;
28     CODE:
29 	ICONS_FROM_STACK (5, icons);
30 	RETVAL = gtk_scale_button_new (size, min, max, step, (const gchar **) icons);
31 	g_free (icons); /* NULL-safe */
32     OUTPUT:
33 	RETVAL
34 
35 # void gtk_scale_button_set_icons (GtkScaleButton *button, const gchar **icons);
36 void
37 gtk_scale_button_set_icons (GtkScaleButton *button, ...)
38     PREINIT:
39 	gchar **icons = NULL;
40     CODE:
41 	ICONS_FROM_STACK (1, icons);
42 	gtk_scale_button_set_icons (button, (const gchar **) icons);
43 	g_free (icons); /* NULL-safe */
44 
45 gdouble gtk_scale_button_get_value (GtkScaleButton *button);
46 
47 void gtk_scale_button_set_value (GtkScaleButton *button, gdouble value);
48 
49 GtkAdjustment * gtk_scale_button_get_adjustment (GtkScaleButton *button);
50 
51 void gtk_scale_button_set_adjustment (GtkScaleButton *button, GtkAdjustment *adjustment);
52 
53 #if GTK_CHECK_VERSION (2, 14, 0)
54 
55 GtkWidget * gtk_scale_button_get_popup (GtkScaleButton *button);
56 
57 GtkWidget * gtk_scale_button_get_plus_button (GtkScaleButton *button);
58 
59 GtkWidget * gtk_scale_button_get_minus_button (GtkScaleButton *button);
60 
61 void gtk_scale_button_set_orientation (GtkScaleButton *button, GtkOrientation orientation);
62 
63 GtkOrientation gtk_scale_button_get_orientation (GtkScaleButton *button);
64 
65 #endif /* 2.14 */
66