| 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 | |
| 37 | G_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 | |
| 46 | typedef struct _GtkButton GtkButton; |
| 47 | typedef struct _GtkButtonPrivate GtkButtonPrivate; |
| 48 | typedef struct _GtkButtonClass GtkButtonClass; |
| 49 | |
| 50 | struct _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 | */ |
| 70 | struct _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 | |
| 93 | GDK_AVAILABLE_IN_ALL |
| 94 | GType gtk_button_get_type (void) G_GNUC_CONST; |
| 95 | GDK_AVAILABLE_IN_ALL |
| 96 | GtkWidget* gtk_button_new (void); |
| 97 | GDK_AVAILABLE_IN_ALL |
| 98 | GtkWidget* gtk_button_new_with_label (const gchar *label); |
| 99 | GDK_AVAILABLE_IN_3_10 |
| 100 | GtkWidget* gtk_button_new_from_icon_name (const gchar *icon_name, |
| 101 | GtkIconSize size); |
| 102 | GDK_DEPRECATED_IN_3_10_FOR(gtk_button_new_with_label) |
| 103 | GtkWidget* gtk_button_new_from_stock (const gchar *stock_id); |
| 104 | GDK_AVAILABLE_IN_ALL |
| 105 | GtkWidget* gtk_button_new_with_mnemonic (const gchar *label); |
| 106 | GDK_AVAILABLE_IN_ALL |
| 107 | void gtk_button_clicked (GtkButton *button); |
| 108 | GDK_DEPRECATED |
| 109 | void gtk_button_pressed (GtkButton *button); |
| 110 | GDK_DEPRECATED |
| 111 | void gtk_button_released (GtkButton *button); |
| 112 | GDK_DEPRECATED |
| 113 | void gtk_button_enter (GtkButton *button); |
| 114 | GDK_DEPRECATED |
| 115 | void gtk_button_leave (GtkButton *button); |
| 116 | |
| 117 | GDK_AVAILABLE_IN_ALL |
| 118 | void gtk_button_set_relief (GtkButton *button, |
| 119 | GtkReliefStyle relief); |
| 120 | GDK_AVAILABLE_IN_ALL |
| 121 | GtkReliefStyle gtk_button_get_relief (GtkButton *button); |
| 122 | GDK_AVAILABLE_IN_ALL |
| 123 | void gtk_button_set_label (GtkButton *button, |
| 124 | const gchar *label); |
| 125 | GDK_AVAILABLE_IN_ALL |
| 126 | const gchar * gtk_button_get_label (GtkButton *button); |
| 127 | GDK_AVAILABLE_IN_ALL |
| 128 | void gtk_button_set_use_underline (GtkButton *button, |
| 129 | gboolean use_underline); |
| 130 | GDK_AVAILABLE_IN_ALL |
| 131 | gboolean gtk_button_get_use_underline (GtkButton *button); |
| 132 | GDK_DEPRECATED_IN_3_10 |
| 133 | void gtk_button_set_use_stock (GtkButton *button, |
| 134 | gboolean use_stock); |
| 135 | GDK_DEPRECATED_IN_3_10 |
| 136 | gboolean gtk_button_get_use_stock (GtkButton *button); |
| 137 | GDK_DEPRECATED_IN_3_20_FOR(gtk_widget_set_focus_on_click) |
| 138 | void gtk_button_set_focus_on_click (GtkButton *button, |
| 139 | gboolean focus_on_click); |
| 140 | GDK_DEPRECATED_IN_3_20_FOR(gtk_widget_get_focus_on_click) |
| 141 | gboolean gtk_button_get_focus_on_click (GtkButton *button); |
| 142 | GDK_DEPRECATED_IN_3_14 |
| 143 | void gtk_button_set_alignment (GtkButton *button, |
| 144 | gfloat xalign, |
| 145 | gfloat yalign); |
| 146 | GDK_DEPRECATED_IN_3_14 |
| 147 | void gtk_button_get_alignment (GtkButton *button, |
| 148 | gfloat *xalign, |
| 149 | gfloat *yalign); |
| 150 | GDK_AVAILABLE_IN_ALL |
| 151 | void gtk_button_set_image (GtkButton *button, |
| 152 | GtkWidget *image); |
| 153 | GDK_AVAILABLE_IN_ALL |
| 154 | GtkWidget* gtk_button_get_image (GtkButton *button); |
| 155 | GDK_AVAILABLE_IN_ALL |
| 156 | void gtk_button_set_image_position (GtkButton *button, |
| 157 | GtkPositionType position); |
| 158 | GDK_AVAILABLE_IN_ALL |
| 159 | GtkPositionType gtk_button_get_image_position (GtkButton *button); |
| 160 | GDK_AVAILABLE_IN_3_6 |
| 161 | void gtk_button_set_always_show_image (GtkButton *button, |
| 162 | gboolean always_show); |
| 163 | GDK_AVAILABLE_IN_3_6 |
| 164 | gboolean gtk_button_get_always_show_image (GtkButton *button); |
| 165 | |
| 166 | GDK_AVAILABLE_IN_ALL |
| 167 | GdkWindow* gtk_button_get_event_window (GtkButton *button); |
| 168 | |
| 169 | |
| 170 | G_END_DECLS |
| 171 | |
| 172 | #endif /* __GTK_BUTTON_H__ */ |
| 173 | |