1 /* GIMP - The GNU Image Manipulation Program
2  * Copyright (C) 1995 Spencer Kimball and Peter Mattis
3  *
4  * gimpviewablebutton.h
5  * Copyright (C) 2003-2005 Michael Natterer <mitch@gimp.org>
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef __GIMP_VIEWABLE_BUTTON_H__
22 #define __GIMP_VIEWABLE_BUTTON_H__
23 
24 
25 #define GIMP_TYPE_VIEWABLE_BUTTON            (gimp_viewable_button_get_type ())
26 #define GIMP_VIEWABLE_BUTTON(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_VIEWABLE_BUTTON, GimpViewableButton))
27 #define GIMP_VIEWABLE_BUTTON_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_VIEWABLE_BUTTON, GimpViewableButtonClass))
28 #define GIMP_IS_VIEWABLE_BUTTON(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_VIEWABLE_BUTTON))
29 #define GIMP_IS_VIEWABLE_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_VIEWABLE_BUTTON))
30 #define GIMP_VIEWABLE_BUTTON_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_VIEWABLE_BUTTON, GimpViewableButtonClass))
31 
32 
33 typedef struct _GimpViewableButtonClass GimpViewableButtonClass;
34 
35 struct _GimpViewableButton
36 {
37   GimpButton         parent_instance;
38 
39   GimpContainer     *container;
40   GimpContext       *context;
41 
42   GimpViewType       popup_view_type;
43   gint               popup_view_size;
44 
45   gint               button_view_size;
46   gint               view_border_width;
47 
48   GimpDialogFactory *dialog_factory;
49   gchar             *dialog_identifier;
50   gchar             *dialog_icon_name;
51   gchar             *dialog_tooltip;
52 
53   GtkWidget         *view;
54 };
55 
56 struct _GimpViewableButtonClass
57 {
58   GimpButtonClass  parent_class;
59 };
60 
61 
62 GType       gimp_viewable_button_get_type (void) G_GNUC_CONST;
63 
64 GtkWidget * gimp_viewable_button_new      (GimpContainer      *container,
65                                            GimpContext        *context,
66                                            GimpViewType        view_type,
67                                            gint                button_view_size,
68                                            gint                view_size,
69                                            gint                view_border_width,
70                                            GimpDialogFactory  *dialog_factory,
71                                            const gchar        *dialog_identifier,
72                                            const gchar        *dialog_icon_name,
73                                            const gchar        *dialog_tooltip);
74 
75 GimpViewType gimp_viewable_button_get_view_type (GimpViewableButton *button);
76 void         gimp_viewable_button_set_view_type (GimpViewableButton *button,
77                                                  GimpViewType        view_type);
78 
79 gint         gimp_viewable_button_get_view_size (GimpViewableButton *button);
80 void         gimp_viewable_button_set_view_size (GimpViewableButton *button,
81                                                  gint                view_size);
82 
83 
84 #endif /* __GIMP_VIEWABLE_BUTTON_H__ */
85