libyui-gtk  2.42.2
 All Classes
ygtkbargraph.h
1 /********************************************************************
2  * YaST2-GTK - http://en.opensuse.org/YaST2-GTK *
3  ********************************************************************/
4 
5 /* YGtkBarGraph is just a simple graph of bars that may be
6  changed during run-time (see ygtk_bar_graph_setup_entry()).
7 */
8 
9 #ifndef YGTK_BAR_GRAPH_H
10 #define YGTK_BAR_GRAPH_H
11 
12 #include <gtk/gtk.h>
13 G_BEGIN_DECLS
14 
15 #define YGTK_TYPE_BAR_GRAPH (ygtk_bar_graph_get_type ())
16 #define YGTK_BAR_GRAPH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
17  YGTK_TYPE_BAR_GRAPH, YGtkBarGraph))
18 #define YGTK_BAR_GRAPH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), \
19  YGTK_TYPE_BAR_GRAPH, YGtkBarGraphClass))
20 #define YGTK_IS_BAR_GRAPH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
21  YGTK_TYPE_BAR_GRAPH))
22 #define YGTK_IS_BAR_GRAPH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \
23  YGTK_TYPE_BAR_GRAPH))
24 #define YGTK_BAR_GRAPH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), \
25  YGTK_TYPE_BAR_GRAPH, YGtkBarGraphClass))
26 
27 typedef struct _YGtkBarGraph YGtkBarGraph;
29 
31 {
32  GtkFrame parent;
33  // members:
34  guint flat : 2;
35 };
36 
38 {
39  GtkFrameClass parent_class;
40 };
41 
42 GtkWidget *ygtk_bar_graph_new (void);
43 GType ygtk_bar_graph_get_type (void) G_GNUC_CONST;
44 
45 void ygtk_bar_graph_create_entries (YGtkBarGraph *bar, guint entries);
46 void ygtk_bar_graph_setup_entry (YGtkBarGraph *bar, int index, const gchar *label_entry, int value);
47 
48 void ygtk_bar_graph_set_style (YGtkBarGraph *bar, gboolean flat);
49 void ygtk_bar_graph_customize_bg (YGtkBarGraph *bar, int index, GdkRGBA *color);
50 void ygtk_bar_graph_customize_fg (YGtkBarGraph *bar, int index, GdkRGBA *color);
51 
52 G_END_DECLS
53 #endif /*YGTK_BAR_GRAPH_H*/
54 
55 #ifndef YGTK_COLORED_LABEL_H
56 #define YGTK_COLORED_LABEL_H
57 
58 G_BEGIN_DECLS
59 
60 /* YGtkColoredLabel is a GtkLabel where gtk_modify_bg() can be used. It also
61  allows a frame around it. */
62 
63 #define YGTK_TYPE_COLORED_LABEL (ygtk_colored_label_get_type ())
64 #define YGTK_COLORED_LABEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
65  YGTK_TYPE_COLORED_LABEL, YGtkColoredLabel))
66 #define YGTK_COLORED_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), \
67  YGTK_TYPE_COLORED_LABEL, YGtkColoredLabelClass))
68 #define YGTK_IS_COLORED_LABEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
69  YGTK_TYPE_COLORED_LABEL))
70 #define YGTK_IS_COLORED_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \
71  YGTK_TYPE_COLORED_LABEL))
72 #define YGTK_COLORED_LABEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), \
73  YGTK_TYPE_COLORED_LABEL, YGtkColoredLabelClass))
74 
75 typedef struct _YGtkColoredLabel
76 {
77  GtkLabel parent;
79 
80 typedef struct _YGtkColoredLabelClass
81 {
82  GtkLabelClass parent_class;
84 
85 GtkWidget *ygtk_colored_label_new (void);
86 GType ygtk_colored_label_get_type (void) G_GNUC_CONST;
87 
88 // A convenience function (you may use gtk_widget_modify_fg() and
89 // gtk_widget_modify_bg() instead), where colors range is [0, 255]
90 void ygtk_colored_label_set_foreground (YGtkColoredLabel *label, GdkRGBA *color);
91 void ygtk_colored_label_set_background (YGtkColoredLabel *label, GdkRGBA *color);
92 
93 G_END_DECLS
94 #endif /*YGTK_COLORED_LABEL*/
95