1/* GTK - The GIMP Toolkit
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18/*
19 * Modified by the GTK+ Team and others 1997-2001. See the AUTHORS
20 * file for a list of people on the GTK+ Team. See the ChangeLog
21 * files for a list of changes. These files are distributed with
22 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
23 */
24
25#ifndef __GTK_BUTTON_H__
26#define __GTK_BUTTON_H__
27
28
29#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
30#error "Only <gtk/gtk.h> can be included directly."
31#endif
32
33#include <gtk/gtkbin.h>
34#include <gtk/gtkimage.h>
35
36
37G_BEGIN_DECLS
38
39#define GTK_TYPE_BUTTON (gtk_button_get_type ())
40#define GTK_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_BUTTON, GtkButton))
41#define GTK_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_BUTTON, GtkButtonClass))
42#define GTK_IS_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_BUTTON))
43#define GTK_IS_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_BUTTON))
44#define GTK_BUTTON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_BUTTON, GtkButtonClass))
45
46typedef struct _GtkButton GtkButton;
47typedef struct _GtkButtonPrivate GtkButtonPrivate;
48typedef struct _GtkButtonClass GtkButtonClass;
49
50struct _GtkButton
51{
52 /*< private >*/
53 GtkBin bin;
54
55 GtkButtonPrivate *priv;
56};
57
58/**
59 * GtkButtonClass:
60 * @parent_class: The parent class.
61 * @pressed: Signal emitted when the button is pressed. Deprecated: 2.8.
62 * @released: Signal emitted when the button is released. Deprecated: 2.8.
63 * @clicked: Signal emitted when the button has been activated (pressed and released).
64 * @enter: Signal emitted when the pointer enters the button. Deprecated: 2.8.
65 * @leave: Signal emitted when the pointer leaves the button. Deprecated: 2.8.
66 * @activate: Signal that causes the button to animate press then
67 * release. Applications should never connect to this signal, but use
68 * the @clicked signal.
69 */
70struct _GtkButtonClass
71{
72 GtkBinClass parent_class;
73
74 /*< public >*/
75
76 void (* pressed) (GtkButton *button);
77 void (* released) (GtkButton *button);
78 void (* clicked) (GtkButton *button);
79 void (* enter) (GtkButton *button);
80 void (* leave) (GtkButton *button);
81 void (* activate) (GtkButton *button);
82
83 /*< private >*/
84
85 /* Padding for future expansion */
86 void (*_gtk_reserved1) (void);
87 void (*_gtk_reserved2) (void);
88 void (*_gtk_reserved3) (void);
89 void (*_gtk_reserved4) (void);
90};
91
92
93GDK_AVAILABLE_IN_ALL
94GType gtk_button_get_type (void) G_GNUC_CONST;
95GDK_AVAILABLE_IN_ALL
96GtkWidget* gtk_button_new (void);
97GDK_AVAILABLE_IN_ALL
98GtkWidget* gtk_button_new_with_label (const gchar *label);
99GDK_AVAILABLE_IN_3_10
100GtkWidget* gtk_button_new_from_icon_name (const gchar *icon_name,
101 GtkIconSize size);
102GDK_DEPRECATED_IN_3_10_FOR(gtk_button_new_with_label)
103GtkWidget* gtk_button_new_from_stock (const gchar *stock_id);
104GDK_AVAILABLE_IN_ALL
105GtkWidget* gtk_button_new_with_mnemonic (const gchar *label);
106GDK_AVAILABLE_IN_ALL
107void gtk_button_clicked (GtkButton *button);
108GDK_DEPRECATED
109void gtk_button_pressed (GtkButton *button);
110GDK_DEPRECATED
111void gtk_button_released (GtkButton *button);
112GDK_DEPRECATED
113void gtk_button_enter (GtkButton *button);
114GDK_DEPRECATED
115void gtk_button_leave (GtkButton *button);
116
117GDK_AVAILABLE_IN_ALL
118void gtk_button_set_relief (GtkButton *button,
119 GtkReliefStyle relief);
120GDK_AVAILABLE_IN_ALL
121GtkReliefStyle gtk_button_get_relief (GtkButton *button);
122GDK_AVAILABLE_IN_ALL
123void gtk_button_set_label (GtkButton *button,
124 const gchar *label);
125GDK_AVAILABLE_IN_ALL
126const gchar * gtk_button_get_label (GtkButton *button);
127GDK_AVAILABLE_IN_ALL
128void gtk_button_set_use_underline (GtkButton *button,
129 gboolean use_underline);
130GDK_AVAILABLE_IN_ALL
131gboolean gtk_button_get_use_underline (GtkButton *button);
132GDK_DEPRECATED_IN_3_10
133void gtk_button_set_use_stock (GtkButton *button,
134 gboolean use_stock);
135GDK_DEPRECATED_IN_3_10
136gboolean gtk_button_get_use_stock (GtkButton *button);
137GDK_DEPRECATED_IN_3_20_FOR(gtk_widget_set_focus_on_click)
138void gtk_button_set_focus_on_click (GtkButton *button,
139 gboolean focus_on_click);
140GDK_DEPRECATED_IN_3_20_FOR(gtk_widget_get_focus_on_click)
141gboolean gtk_button_get_focus_on_click (GtkButton *button);
142GDK_DEPRECATED_IN_3_14
143void gtk_button_set_alignment (GtkButton *button,
144 gfloat xalign,
145 gfloat yalign);
146GDK_DEPRECATED_IN_3_14
147void gtk_button_get_alignment (GtkButton *button,
148 gfloat *xalign,
149 gfloat *yalign);
150GDK_AVAILABLE_IN_ALL
151void gtk_button_set_image (GtkButton *button,
152 GtkWidget *image);
153GDK_AVAILABLE_IN_ALL
154GtkWidget* gtk_button_get_image (GtkButton *button);
155GDK_AVAILABLE_IN_ALL
156void gtk_button_set_image_position (GtkButton *button,
157 GtkPositionType position);
158GDK_AVAILABLE_IN_ALL
159GtkPositionType gtk_button_get_image_position (GtkButton *button);
160GDK_AVAILABLE_IN_3_6
161void gtk_button_set_always_show_image (GtkButton *button,
162 gboolean always_show);
163GDK_AVAILABLE_IN_3_6
164gboolean gtk_button_get_always_show_image (GtkButton *button);
165
166GDK_AVAILABLE_IN_ALL
167GdkWindow* gtk_button_get_event_window (GtkButton *button);
168
169
170G_END_DECLS
171
172#endif /* __GTK_BUTTON_H__ */
173