5 #include <caml/mlvalues.h>
6 #include <caml/alloc.h>
7 #include <caml/memory.h>
8 #include <caml/callback.h>
19 #define GtkGammaCurve_val(val) check_cast(GTK_GAMMA_CURVE,val)
20 ML_0 (gtk_gamma_curve_new, Val_GtkWidget_sink)
21 Make_Extractor (gtk_gamma_curve_get, GtkGammaCurve_val, gamma, copy_double)
25 #define GtkStatusbar_val(val) check_cast(GTK_STATUSBAR,val)
26 ML_0 (gtk_statusbar_new, Val_GtkWidget_sink)
27 ML_2 (gtk_statusbar_get_context_id, GtkStatusbar_val, String_val, Val_int)
28 ML_3 (gtk_statusbar_push, GtkStatusbar_val, Int_val, String_val, Val_int)
29 ML_2 (gtk_statusbar_pop, GtkStatusbar_val, Int_val, Unit)
30 ML_3 (gtk_statusbar_remove, GtkStatusbar_val, Int_val, Int_val, Unit)
34 #define GtkCalendar_val(val) check_cast(GTK_CALENDAR,val)
35 ML_0 (gtk_calendar_new, Val_GtkWidget_sink)
36 ML_3 (gtk_calendar_select_month, GtkCalendar_val, Int_val, Int_val, Unit)
37 ML_2 (gtk_calendar_select_day, GtkCalendar_val, Int_val, Unit)
38 ML_2 (gtk_calendar_mark_day, GtkCalendar_val, Int_val, Unit)
39 ML_2 (gtk_calendar_unmark_day, GtkCalendar_val, Int_val, Unit)
40 ML_1 (gtk_calendar_clear_marks, GtkCalendar_val, Unit)
41 Make_Flags_val (Calendar_display_options_val)
42 ML_2 (gtk_calendar_display_options, GtkCalendar_val,
43 Flags_Calendar_display_options_val, Unit)
44 value ml_gtk_calendar_get_date (value w)
46 guint year, month, day;
49 gtk_calendar_get_date (GtkCalendar_val(w), &year, &month, &day);
50 ret = alloc_small (3, 0);
51 Field(ret,0) = Val_int(year);
52 Field(ret,1) = Val_int(month);
53 Field(ret,2) = Val_int(day);
56 ML_1 (gtk_calendar_freeze, GtkCalendar_val, Unit)
57 ML_1 (gtk_calendar_thaw, GtkCalendar_val, Unit)
59 /* gtkdrawingarea.h */
61 #define GtkDrawingArea_val(val) check_cast(GTK_DRAWING_AREA,val)
62 ML_0 (gtk_drawing_area_new, Val_GtkWidget_sink)
63 ML_3 (gtk_drawing_area_size, GtkDrawingArea_val, Int_val, Int_val, Unit)
67 #define GtkMisc_val(val) check_cast(GTK_MISC,val)
68 ML_3 (gtk_misc_set_alignment, GtkMisc_val, Double_val, Double_val, Unit)
69 ML_3 (gtk_misc_set_padding, GtkMisc_val, Int_val, Int_val, Unit)
70 Make_Extractor (gtk_misc_get, GtkMisc_val, xalign, copy_double)
71 Make_Extractor (gtk_misc_get, GtkMisc_val, yalign, copy_double)
72 Make_Extractor (gtk_misc_get, GtkMisc_val, xpad, Val_int)
73 Make_Extractor (gtk_misc_get, GtkMisc_val, ypad, Val_int)
77 #define GtkArrow_val(val) check_cast(GTK_ARROW,val)
78 ML_2 (gtk_arrow_new, Arrow_type_val, Shadow_type_val, Val_GtkWidget_sink)
79 ML_3 (gtk_arrow_set, GtkArrow_val, Arrow_type_val, Shadow_type_val, Unit)
83 #define GtkImage_val(val) check_cast(GTK_IMAGE,val)
84 ML_2 (gtk_image_new, GdkImage_val,
85 Option_val (arg2, GdkBitmap_val, NULL) Ignore, Val_GtkWidget_sink)
86 ML_3 (gtk_image_set, GtkImage_val, GdkImage_val,
87 Option_val (arg2, GdkBitmap_val, NULL) Ignore, Unit)
91 #define GtkLabel_val(val) check_cast(GTK_LABEL,val)
92 ML_1 (gtk_label_new, String_val, Val_GtkWidget_sink)
93 ML_2 (gtk_label_set_text, GtkLabel_val, String_val, Unit)
94 ML_2 (gtk_label_set_pattern, GtkLabel_val, String_val, Unit)
95 ML_2 (gtk_label_set_justify, GtkLabel_val, Justification_val, Unit)
96 ML_2 (gtk_label_set_line_wrap, GtkLabel_val, Bool_val, Unit)
97 Make_Extractor (gtk_label_get, GtkLabel_val, label, Val_string)
101 #define GtkTipsQuery_val(val) check_cast(GTK_TIPS_QUERY,val)
102 ML_0 (gtk_tips_query_new, Val_GtkWidget_sink)
103 ML_1 (gtk_tips_query_start_query, GtkTipsQuery_val, Unit)
104 ML_1 (gtk_tips_query_stop_query, GtkTipsQuery_val, Unit)
105 ML_2 (gtk_tips_query_set_caller, GtkTipsQuery_val, GtkWidget_val, Unit)
106 ML_3 (gtk_tips_query_set_labels, GtkTipsQuery_val,
107 String_val, String_val, Unit)
108 value ml_gtk_tips_query_set_emit_always (value w, value arg)
110 GtkTipsQuery_val(w)->emit_always = Bool_val(arg);
113 Make_Extractor (gtk_tips_query_get, GtkTipsQuery_val, emit_always, Val_bool)
114 Make_Extractor (gtk_tips_query_get, GtkTipsQuery_val, caller, Val_GtkWidget)
115 Make_Extractor (gtk_tips_query_get, GtkTipsQuery_val, label_inactive,
117 Make_Extractor (gtk_tips_query_get, GtkTipsQuery_val, label_no_tip,
122 #define GtkPixmap_val(val) check_cast(GTK_PIXMAP,val)
123 ML_2 (gtk_pixmap_new, GdkPixmap_val,
124 Option_val (arg2, GdkBitmap_val, NULL) Ignore,
126 value ml_gtk_pixmap_set (value val, value pixmap, value mask)
128 GtkPixmap *w = GtkPixmap_val(val);
129 gtk_pixmap_set (w, Option_val(pixmap,GdkPixmap_val,w->pixmap),
130 Option_val(mask,GdkBitmap_val,w->mask));
133 Make_Extractor (GtkPixmap, GtkPixmap_val, pixmap, Val_GdkPixmap)
134 Make_Extractor (GtkPixmap, GtkPixmap_val, mask, Val_GdkBitmap)
136 /* gtk[hv]separator.h */
138 ML_0 (gtk_hseparator_new, Val_GtkWidget_sink)
139 ML_0 (gtk_vseparator_new, Val_GtkWidget_sink)