libyui-gtk  2.49.0
ygtkfixed.h
1 /********************************************************************
2  * YaST2-GTK - http://en.opensuse.org/YaST2-GTK *
3  ********************************************************************/
4 
5 /* GtkFixed just doesn't cut it... gtk_fixed_move_child() does a queue_resize
6  and the all thing is just not quite appropriate... */
7 
8 #ifndef YGTK_FIXED_H
9 #define YGTK_FIXED_H
10 
11 #include <gtk/gtk.h>
12 G_BEGIN_DECLS
13 
14 #define YGTK_TYPE_FIXED (ygtk_fixed_get_type ())
15 #define YGTK_FIXED(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
16  YGTK_TYPE_FIXED, YGtkFixed))
17 #define YGTK_FIXED_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), \
18  YGTK_TYPE_FIXED, YGtkFixedClass))
19 #define YGTK_IS_FIXED(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
20  YGTK_TYPE_FIXED))
21 #define YGTK_IS_FIXED_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \
22  YGTK_TYPE_FIXED))
23 #define YGTK_FIXED_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), \
24  YGTK_TYPE_FIXED, YGtkFixedClass))
25 
26 typedef struct _YGtkFixed YGtkFixed;
27 typedef struct _YGtkFixedClass YGtkFixedClass;
28 
29 typedef gint (*YGtkPreferredWidth) (YGtkFixed *, gpointer);
30 typedef gint (*YGtkPreferredHeight) (YGtkFixed *, gpointer);
31 typedef void (*YGtkSetSize) (YGtkFixed *, gint, gint, gpointer);
32 
33 struct _YGtkFixed
34 {
35  GtkContainer parent;
36  // private (read-only):
37  GSList *children;
38  YGtkPreferredWidth preferred_width_cb;
39  YGtkPreferredHeight preferred_height_cb;
40  YGtkSetSize set_size_cb;
41  gpointer data;
42 };
43 
45 {
46  GtkContainerClass parent_class;
47 };
48 
49 typedef struct _YGtkFixedChild
50 {
51  GtkWidget *widget;
52  // members
53  // post-pone all position and size setting, to avoid unnecessary work
54  gint x, y, width, height;
56 
57 GType ygtk_fixed_get_type (void) G_GNUC_CONST;
58 
59 void ygtk_fixed_setup (YGtkFixed *fixed, YGtkPreferredWidth cb1, YGtkPreferredHeight cb2, YGtkSetSize cb3, gpointer data);
60 
61 void ygtk_fixed_set_child_pos (YGtkFixed *fixed, GtkWidget *widget, gint x, gint y);
62 void ygtk_fixed_set_child_size (YGtkFixed *fixed, GtkWidget *widget, gint width, gint height);
63 
64 G_END_DECLS
65 #endif /*YGTK_FIXED_H*/
66 
_YGtkFixedChild
Definition: ygtkfixed.h:49
_YGtkFixed
Definition: ygtkfixed.h:33
_YGtkFixedClass
Definition: ygtkfixed.h:44