]> matita.cs.unibo.it Git - helm.git/blob - helm/DEVEL/lablgtk/lablgtk_20001129-0.1.0/ml_gtkbin.c
updated the binding so that it works well with lablgtk-1.00,
[helm.git] / helm / DEVEL / lablgtk / lablgtk_20001129-0.1.0 / ml_gtkbin.c
1 /* $Id$ */
2
3 #include <string.h>
4 #include <gtk/gtk.h>
5 #include <caml/mlvalues.h>
6 #include <caml/alloc.h>
7 #include <caml/memory.h>
8 #include <caml/callback.h>
9 #include <caml/fail.h>
10
11 #include "wrappers.h"
12 #include "ml_glib.h"
13 #include "ml_gdk.h"
14 #include "ml_gtk.h"
15 #include "gtk_tags.h"
16
17 /* gtkalignment.h */
18
19 #define GtkAlignment_val(val) check_cast(GTK_ALIGNMENT,val)
20 ML_4 (gtk_alignment_new, Float_val, Float_val, Float_val, Float_val,
21       Val_GtkWidget_sink)
22 value ml_gtk_alignment_set (value x, value y,
23                            value xscale, value yscale, value val)
24 {
25     GtkAlignment *alignment = GtkAlignment_val(val);
26     gtk_alignment_set (alignment,
27                        Option_val(x, Float_val, alignment->xalign),
28                        Option_val(y, Float_val, alignment->yalign),
29                        Option_val(xscale, Float_val, alignment->xscale),
30                        Option_val(yscale, Float_val, alignment->xscale));
31     return Val_unit;
32 }
33
34 /* gtkeventbox.h */
35
36 ML_0 (gtk_event_box_new, Val_GtkWidget_sink)
37
38 /* gtkframe.h */
39
40 #define GtkFrame_val(val) check_cast(GTK_FRAME,val)
41 ML_1 (gtk_frame_new, Optstring_val, Val_GtkWidget_sink)
42 ML_2 (gtk_frame_set_label, GtkFrame_val, Optstring_val, Unit)
43 ML_3 (gtk_frame_set_label_align, GtkFrame_val, Float_val, Float_val, Unit)
44 ML_2 (gtk_frame_set_shadow_type, GtkFrame_val, Shadow_type_val, Unit)
45 Make_Extractor (gtk_frame_get, GtkFrame_val, label_xalign, copy_double)
46 Make_Extractor (gtk_frame_get, GtkFrame_val, label_yalign, copy_double)
47
48 /* gtkaspectframe.h */
49
50 #define GtkAspectFrame_val(val) check_cast(GTK_ASPECT_FRAME,val)
51 ML_5 (gtk_aspect_frame_new, Optstring_val,
52       Float_val, Float_val, Float_val, Bool_val, Val_GtkWidget_sink)
53 ML_5 (gtk_aspect_frame_set, GtkAspectFrame_val, Float_val, Float_val,
54       Float_val, Bool_val, Unit)
55 Make_Extractor (gtk_aspect_frame_get, GtkAspectFrame_val, xalign, copy_double)
56 Make_Extractor (gtk_aspect_frame_get, GtkAspectFrame_val, yalign, copy_double)
57 Make_Extractor (gtk_aspect_frame_get, GtkAspectFrame_val, ratio, copy_double)
58 Make_Extractor (gtk_aspect_frame_get, GtkAspectFrame_val, obey_child, Val_bool)
59
60 /* gtkhandlebox.h */
61
62 #define GtkHandleBox_val(val) check_cast(GTK_HANDLE_BOX,val)
63 ML_0 (gtk_handle_box_new, Val_GtkWidget_sink)
64 ML_2 (gtk_handle_box_set_shadow_type, GtkHandleBox_val, Shadow_type_val, Unit)
65 ML_2 (gtk_handle_box_set_handle_position, GtkHandleBox_val, Position_val, Unit)
66 ML_2 (gtk_handle_box_set_snap_edge, GtkHandleBox_val, Position_val, Unit)
67
68 /* gtkinvisible.h */
69 /* private class
70 ML_0 (gtk_invisible_new, Val_GtkWidget_sink)
71 */
72
73 /* gtkitem.h */
74
75 ML_1 (gtk_item_select, GtkItem_val, Unit)
76 ML_1 (gtk_item_deselect, GtkItem_val, Unit)
77 ML_1 (gtk_item_toggle, GtkItem_val, Unit)
78
79 /* gtkviewport.h */
80
81 #define GtkViewport_val(val) check_cast(GTK_VIEWPORT,val)
82 ML_2 (gtk_viewport_new, GtkAdjustment_val, GtkAdjustment_val,
83       Val_GtkWidget_sink)
84 ML_1 (gtk_viewport_get_hadjustment, GtkViewport_val, Val_GtkWidget_sink)
85 ML_1 (gtk_viewport_get_vadjustment, GtkViewport_val, Val_GtkWidget)
86 ML_2 (gtk_viewport_set_hadjustment, GtkViewport_val, GtkAdjustment_val, Unit)
87 ML_2 (gtk_viewport_set_vadjustment, GtkViewport_val, GtkAdjustment_val, Unit)
88 ML_2 (gtk_viewport_set_shadow_type, GtkViewport_val, Shadow_type_val, Unit)
89
90 /* gtkscrolledwindow.h */
91
92 #define GtkScrolledWindow_val(val) check_cast(GTK_SCROLLED_WINDOW,val)
93 ML_2 (gtk_scrolled_window_new, GtkAdjustment_val ,GtkAdjustment_val,
94       Val_GtkWidget_sink)
95 ML_2 (gtk_scrolled_window_set_hadjustment, GtkScrolledWindow_val ,
96       GtkAdjustment_val, Unit)
97 ML_2 (gtk_scrolled_window_set_vadjustment, GtkScrolledWindow_val ,
98       GtkAdjustment_val, Unit)
99 ML_1 (gtk_scrolled_window_get_hadjustment, GtkScrolledWindow_val,
100       Val_GtkWidget)
101 ML_1 (gtk_scrolled_window_get_vadjustment, GtkScrolledWindow_val,
102       Val_GtkWidget)
103 ML_3 (gtk_scrolled_window_set_policy, GtkScrolledWindow_val,
104       Policy_type_val, Policy_type_val, Unit)
105 Make_Extractor (gtk_scrolled_window_get, GtkScrolledWindow_val,
106                 hscrollbar_policy, Val_policy_type)
107 Make_Extractor (gtk_scrolled_window_get, GtkScrolledWindow_val,
108                 vscrollbar_policy, Val_policy_type)
109 ML_2 (gtk_scrolled_window_set_placement, GtkScrolledWindow_val,
110       Corner_type_val, Unit)
111 ML_2 (gtk_scrolled_window_add_with_viewport, GtkScrolledWindow_val,
112       GtkWidget_val, Unit)
113
114 /* gtksocket.h */
115
116 #define GtkSocket_val(val) check_cast(GTK_SOCKET,val)
117 ML_0 (gtk_socket_new, Val_GtkWidget_sink)
118 ML_2 (gtk_socket_steal, GtkSocket_val, XID_val, Unit)