gtkbutton.h 5.88 KB
Newer Older
Cody Russell's avatar
Cody Russell committed
1
/* GTK - The GIMP Toolkit
Elliot Lee's avatar
Elliot Lee committed
2 3 4
 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
 *
 * This library is free software; you can redistribute it and/or
5
 * modify it under the terms of the GNU Lesser General Public
Elliot Lee's avatar
Elliot Lee committed
6 7 8 9 10 11
 * License as published by the Free Software Foundation; either
 * version 2 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
12
 * Lesser General Public License for more details.
Elliot Lee's avatar
Elliot Lee committed
13
 *
14
 * You should have received a copy of the GNU Lesser General Public
Javier Jardón's avatar
Javier Jardón committed
15
 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
Elliot Lee's avatar
Elliot Lee committed
16
 */
17 18

/*
19
 * Modified by the GTK+ Team and others 1997-2001.  See the AUTHORS
20 21
 * file for a list of people on the GTK+ Team.  See the ChangeLog
 * files for a list of changes.  These files are distributed with
22
 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
23 24
 */

Elliot Lee's avatar
Elliot Lee committed
25 26 27 28
#ifndef __GTK_BUTTON_H__
#define __GTK_BUTTON_H__


29 30 31 32
#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <gtk/gtk.h> can be included directly."
#endif

33
#include <gtk/gtkbin.h>
34
#include <gtk/gtkimage.h>
Elliot Lee's avatar
Elliot Lee committed
35 36


37
G_BEGIN_DECLS
Elliot Lee's avatar
Elliot Lee committed
38

Tim Janik's avatar
Tim Janik committed
39
#define GTK_TYPE_BUTTON                 (gtk_button_get_type ())
Manish Singh's avatar
Manish Singh committed
40 41 42 43 44
#define GTK_BUTTON(obj)                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_BUTTON, GtkButton))
#define GTK_BUTTON_CLASS(klass)         (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_BUTTON, GtkButtonClass))
#define GTK_IS_BUTTON(obj)              (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_BUTTON))
#define GTK_IS_BUTTON_CLASS(klass)      (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_BUTTON))
#define GTK_BUTTON_GET_CLASS(obj)       (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_BUTTON, GtkButtonClass))
Elliot Lee's avatar
Elliot Lee committed
45

46 47 48
typedef struct _GtkButton             GtkButton;
typedef struct _GtkButtonPrivate      GtkButtonPrivate;
typedef struct _GtkButtonClass        GtkButtonClass;
Elliot Lee's avatar
Elliot Lee committed
49 50 51

struct _GtkButton
{
52
  /*< private >*/
53
  GtkBin bin;
Elliot Lee's avatar
Elliot Lee committed
54

55
  GtkButtonPrivate *priv;
Elliot Lee's avatar
Elliot Lee committed
56 57 58 59
};

struct _GtkButtonClass
{
60
  GtkBinClass        parent_class;
61
  
62 63 64 65 66
  void (* pressed)  (GtkButton *button);
  void (* released) (GtkButton *button);
  void (* clicked)  (GtkButton *button);
  void (* enter)    (GtkButton *button);
  void (* leave)    (GtkButton *button);
67
  void (* activate) (GtkButton *button);
68 69 70 71 72 73
  
  /* Padding for future expansion */
  void (*_gtk_reserved1) (void);
  void (*_gtk_reserved2) (void);
  void (*_gtk_reserved3) (void);
  void (*_gtk_reserved4) (void);
Elliot Lee's avatar
Elliot Lee committed
74 75 76
};


77
GDK_AVAILABLE_IN_ALL
Manish Singh's avatar
Manish Singh committed
78
GType          gtk_button_get_type          (void) G_GNUC_CONST;
79
GDK_AVAILABLE_IN_ALL
80
GtkWidget*     gtk_button_new               (void);
81
GDK_AVAILABLE_IN_ALL
82
GtkWidget*     gtk_button_new_with_label    (const gchar    *label);
83 84 85
GDK_AVAILABLE_IN_3_10
GtkWidget*     gtk_button_new_from_icon_name (const gchar    *icon_name,
					      GtkIconSize     size);
86
GDK_DEPRECATED_IN_3_10_FOR(gtk_button_new_with_label)
87
GtkWidget*     gtk_button_new_from_stock    (const gchar    *stock_id);
88
GDK_AVAILABLE_IN_ALL
89
GtkWidget*     gtk_button_new_with_mnemonic (const gchar    *label);
90
GDK_AVAILABLE_IN_ALL
91 92
void           gtk_button_clicked           (GtkButton      *button);
GDK_DEPRECATED
93
void           gtk_button_pressed           (GtkButton      *button);
94
GDK_DEPRECATED
95
void           gtk_button_released          (GtkButton      *button);
96
GDK_DEPRECATED
97
void           gtk_button_enter             (GtkButton      *button);
98
GDK_DEPRECATED
99
void           gtk_button_leave             (GtkButton      *button);
100

101
GDK_AVAILABLE_IN_ALL
102 103
void                  gtk_button_set_relief         (GtkButton      *button,
						     GtkReliefStyle  newstyle);
104
GDK_AVAILABLE_IN_ALL
105
GtkReliefStyle        gtk_button_get_relief         (GtkButton      *button);
106
GDK_AVAILABLE_IN_ALL
107 108
void                  gtk_button_set_label          (GtkButton      *button,
						     const gchar    *label);
109
GDK_AVAILABLE_IN_ALL
110
const gchar *         gtk_button_get_label          (GtkButton      *button);
111
GDK_AVAILABLE_IN_ALL
112 113
void                  gtk_button_set_use_underline  (GtkButton      *button,
						     gboolean        use_underline);
114
GDK_AVAILABLE_IN_ALL
115
gboolean              gtk_button_get_use_underline  (GtkButton      *button);
116
GDK_DEPRECATED_IN_3_10
117 118
void                  gtk_button_set_use_stock      (GtkButton      *button,
						     gboolean        use_stock);
119
GDK_DEPRECATED_IN_3_10
120
gboolean              gtk_button_get_use_stock      (GtkButton      *button);
121
GDK_AVAILABLE_IN_ALL
122 123
void                  gtk_button_set_focus_on_click (GtkButton      *button,
						     gboolean        focus_on_click);
124
GDK_AVAILABLE_IN_ALL
125
gboolean              gtk_button_get_focus_on_click (GtkButton      *button);
126
GDK_AVAILABLE_IN_ALL
127 128 129
void                  gtk_button_set_alignment      (GtkButton      *button,
						     gfloat          xalign,
						     gfloat          yalign);
130
GDK_AVAILABLE_IN_ALL
131 132 133
void                  gtk_button_get_alignment      (GtkButton      *button,
						     gfloat         *xalign,
						     gfloat         *yalign);
134
GDK_AVAILABLE_IN_ALL
135 136
void                  gtk_button_set_image          (GtkButton      *button,
					             GtkWidget      *image);
137
GDK_AVAILABLE_IN_ALL
138
GtkWidget*            gtk_button_get_image          (GtkButton      *button);
139
GDK_AVAILABLE_IN_ALL
140 141
void                  gtk_button_set_image_position (GtkButton      *button,
						     GtkPositionType position);
142
GDK_AVAILABLE_IN_ALL
143
GtkPositionType       gtk_button_get_image_position (GtkButton      *button);
144
GDK_AVAILABLE_IN_3_6
145 146
void                  gtk_button_set_always_show_image (GtkButton   *button,
                                                        gboolean     always_show);
147
GDK_AVAILABLE_IN_3_6
148
gboolean              gtk_button_get_always_show_image (GtkButton   *button);
149

150
GDK_AVAILABLE_IN_ALL
151 152
GdkWindow*            gtk_button_get_event_window   (GtkButton      *button);

Elliot Lee's avatar
Elliot Lee committed
153

154
G_END_DECLS
Elliot Lee's avatar
Elliot Lee committed
155 156

#endif /* __GTK_BUTTON_H__ */