Debian Codegraph @

src/legacy/gsm_color_button.h

raw symbols SCIP
1 /*
2 * Gnome system monitor colour pickers
3 * Copyright (C) 2007 Karl Lattimer <[email protected]>
4 * All rights reserved.
5 *
6 * This Library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public License as
8 * published by the Free Software Foundation; either version 2 of the
9 * License, or (at your option) any later version.
10 *
11 * This software 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 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public
17 * License along with the software; see the file COPYING. If not,
18 * see <http://www.gnu.org/licenses/>.
19 */
20
21 #ifndef _GSM_COLOR_BUTTON_H_
22 #define _GSM_COLOR_BUTTON_H_
23
24 #include <gtk/gtk.h>
25
26 G_BEGIN_DECLS
27
28 /* The GtkColorSelectionButton widget is a simple color picker in a button.
29 * The button displays a sample of the currently selected color. When
30 * the user clicks on the button, a color selection dialog pops up.
31 * The color picker emits the "color_set" signal when the color is set.
32 */
33 #define GSM_TYPE_COLOR_BUTTON (gsm_color_button_get_type ())
34 #define GSM_COLOR_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GSM_TYPE_COLOR_BUTTON, GsmColorButton))
35 #define GSM_COLOR_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GSM_TYPE_COLOR_BUTTON, GsmColorButtonClass))
36 #define GSM_IS_COLOR_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GSM_TYPE_COLOR_BUTTON))
37 #define GSM_IS_COLOR_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GSM_TYPE_COLOR_BUTTON))
38 #define GSM_COLOR_BUTTON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GSM_TYPE_COLOR_BUTTON, GsmColorButtonClass))
39
40 typedef struct _GsmColorButton GsmColorButton;
41 typedef struct _GsmColorButtonClass GsmColorButtonClass;
42
43 struct _GsmColorButton
44 {
45 GtkWidget parent_instance;
46 };
47
48 /* Widget types */
49 enum
50 {
51 GSMCP_TYPE_CPU,
52 GSMCP_TYPE_PIE,
53 GSMCP_TYPE_NETWORK_IN,
54 GSMCP_TYPE_NETWORK_OUT,
55 GSMCP_TYPE_DISK_READ,
56 GSMCP_TYPE_DISK_WRITE,
57 GSMCP_TYPES
58 };
59
60 struct _GsmColorButtonClass
61 {
62 GtkWidgetClass parent_class;
63 };
64
65 GType gsm_color_button_get_type (void);
66 GsmColorButton * gsm_color_button_new (const GdkRGBA *color,
67 guint type);
68 void gsm_color_button_set_color (GsmColorButton *color_button,
69 const GdkRGBA *color);
70 void gsm_color_button_set_fraction (GsmColorButton *color_button,
71 const gdouble fraction);
72 void gsm_color_button_set_cbtype (GsmColorButton *color_button,
73 guint type);
74 void gsm_color_button_get_color (GsmColorButton *color_button,
75 GdkRGBA *color);
76 gdouble gsm_color_button_get_fraction (GsmColorButton *color_button);
77 guint gsm_color_button_get_cbtype (GsmColorButton *color_button);
78 void gsm_color_button_set_title (GsmColorButton *color_button,
79 const gchar *title);
80 gchar * gsm_color_button_get_title (GsmColorButton *color_button);
81
82 G_END_DECLS
83
84 #endif /* _GSM_COLOR_BUTTON_H_ */