summaryrefslogtreecommitdiff
path: root/gtk/gtkgizmoprivate.h
blob: f5b81ccfb3abef3a20dfad1ae7fb751f0a245516 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73

#pragma once

#include "gtkwidget.h"
#include "gtkenums.h"

#define GTK_TYPE_GIZMO                 (gtk_gizmo_get_type ())
#define GTK_GIZMO(obj)                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_GIZMO, GtkGizmo))
#define GTK_GIZMO_CLASS(klass)         (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_GIZMO, GtkGizmoClass))
#define GTK_IS_GIZMO(obj)              (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_GIZMO))
#define GTK_IS_GIZMO_CLASS(klass)      (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_GIZMO))
#define GTK_GIZMO_GET_CLASS(obj)       (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_GIZMO, GtkGizmoClass))

typedef struct _GtkGizmo             GtkGizmo;
typedef struct _GtkGizmoClass        GtkGizmoClass;

typedef void    (* GtkGizmoMeasureFunc)   (GtkGizmo       *gizmo,
                                           GtkOrientation  orientation,
                                           int             for_size,
                                           int            *minimum,
                                           int            *natural,
                                           int            *minimum_baseline,
                                           int            *natural_baseline);
typedef void    (* GtkGizmoAllocateFunc)  (GtkGizmo *gizmo,
                                           int       width,
                                           int       height,
                                           int       baseline);
typedef void    (* GtkGizmoSnapshotFunc)  (GtkGizmo    *gizmo,
                                           GtkSnapshot *snapshot);
typedef gboolean (* GtkGizmoContainsFunc) (GtkGizmo  *gizmo,
                                           double     x,
                                           double     y);
typedef gboolean (* GtkGizmoFocusFunc)    (GtkGizmo         *gizmo,
                                           GtkDirectionType  direction);
typedef gboolean (* GtkGizmoGrabFocusFunc)(GtkGizmo         *gizmo);

struct _GtkGizmo
{
  GtkWidget parent_instance;

  GtkGizmoMeasureFunc   measure_func;
  GtkGizmoAllocateFunc  allocate_func;
  GtkGizmoSnapshotFunc  snapshot_func;
  GtkGizmoContainsFunc  contains_func;
  GtkGizmoFocusFunc     focus_func;
  GtkGizmoGrabFocusFunc grab_focus_func;
};

struct _GtkGizmoClass
{
  GtkWidgetClass parent_class;
};

GType      gtk_gizmo_get_type (void) G_GNUC_CONST;

GtkWidget *gtk_gizmo_new (const char            *css_name,
                          GtkGizmoMeasureFunc    measure_func,
                          GtkGizmoAllocateFunc   allocate_func,
                          GtkGizmoSnapshotFunc   snapshot_func,
                          GtkGizmoContainsFunc   contains_func,
                          GtkGizmoFocusFunc      focus_func,
                          GtkGizmoGrabFocusFunc  grab_focus_func);

GtkWidget *gtk_gizmo_new_with_role (const char            *css_name,
                                    GtkAccessibleRole      role,
                                    GtkGizmoMeasureFunc    measure_func,
                                    GtkGizmoAllocateFunc   allocate_func,
                                    GtkGizmoSnapshotFunc   snapshot_func,
                                    GtkGizmoContainsFunc   contains_func,
                                    GtkGizmoFocusFunc      focus_func,
                                    GtkGizmoGrabFocusFunc  grab_focus_func);