]> Pileus Git - ~andy/gtk/blob - gtk/gtkswitch.h
Merge branch 'master' into open-with-dialog
[~andy/gtk] / gtk / gtkswitch.h
1 /* GTK - The GIMP Toolkit
2  *
3  * Copyright (C) 2010  Intel Corporation
4  * Copyright (C) 2010  RedHat, Inc.
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the
18  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19  * Boston, MA  02111-1307, USA.
20  *
21  * Author:
22  *      Emmanuele Bassi <ebassi@linux.intel.com>
23  *      Matthias Clasen <mclasen@redhat.com>
24  *
25  * Based on similar code from:
26  *      Thomas Wood <thos@linux.intel.com>
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 #ifndef __GTK_SWITCH_H__
34 #define __GTK_SWITCH_H__
35
36 #include <gtk/gtkwidget.h>
37
38 G_BEGIN_DECLS
39
40 #define GTK_TYPE_SWITCH                 (gtk_switch_get_type ())
41 #define GTK_SWITCH(obj)                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_SWITCH, GtkSwitch))
42 #define GTK_IS_SWITCH(obj)              (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_SWITCH))
43 #define GTK_SWITCH_CLASS(klass)         (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_SWITCH, GtkSwitchClass))
44 #define GTK_IS_SWITCH_CLASS(klass)      (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_SWITCH))
45 #define GTK_SWITCH_GET_CLASS(obj)       (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_SWITCH, GtkSwitchClass))
46
47 typedef struct _GtkSwitch               GtkSwitch;
48 typedef struct _GtkSwitchPrivate        GtkSwitchPrivate;
49 typedef struct _GtkSwitchClass          GtkSwitchClass;
50
51 /**
52  * GtkSwitch:
53  *
54  * The <structname>GtkSwitch</structname> structure contains private
55  * data and it should only be accessed using the provided API.
56  */
57 struct _GtkSwitch
58 {
59   /*< private >*/
60   GtkWidget parent_instance;
61
62   GtkSwitchPrivate *priv;
63 };
64
65 /**
66  * GtkSwitchClass:
67  *
68  * The <structname>GtkSwitchClass</structname> structure contains only
69  * private data.
70  */
71 struct _GtkSwitchClass
72 {
73   /*< private >*/
74   GtkWidgetClass parent_class;
75
76   void (* _switch_padding_1) (void);
77   void (* _switch_padding_2) (void);
78   void (* _switch_padding_3) (void);
79   void (* _switch_padding_4) (void);
80   void (* _switch_padding_5) (void);
81   void (* _switch_padding_6) (void);
82   void (* _switch_padding_7) (void);
83 };
84
85 GType gtk_switch_get_type (void) G_GNUC_CONST;
86
87 GtkWidget *     gtk_switch_new          (void);
88
89 void            gtk_switch_set_active   (GtkSwitch *sw,
90                                          gboolean   is_active);
91 gboolean        gtk_switch_get_active   (GtkSwitch *sw);
92
93 G_END_DECLS
94
95 #endif /* __GTK_SWITCH_H__ */