Skip to content

Commit

Permalink
quartz+mask
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://svn.gna.org/svn/lablgtk/trunk@1452 9e25d42d-7a03-43f2-900d-8c2168964d28
  • Loading branch information
garrigue committed May 8, 2009
1 parent 86867dd commit a20ad88
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 4 deletions.
4 changes: 2 additions & 2 deletions examples/testgtk.ml
Original file line number Diff line number Diff line change
Expand Up @@ -448,8 +448,8 @@ let create_scrolled_windows =

let make_toolbar (toolbar : GButton.toolbar) window =
let icon =
let info = GDraw.pixmap_from_xpm ~file:"test.xpm" ~window () in
fun () -> (GMisc.pixmap info ())#coerce
let pb = GdkPixbuf.from_file "test.xpm" in
fun () -> (GMisc.image ~pixbuf:pb ())#coerce
in

toolbar #insert_button ~text:"Horizontal"
Expand Down
5 changes: 5 additions & 0 deletions src/gdk.ml
Original file line number Diff line number Diff line change
Expand Up @@ -780,3 +780,8 @@ module Display = struct
(match display with None -> default ()
| Some disp -> disp)
end

module Windowing = struct
external get : unit -> [`QUARTZ | `WIN32 | `X11] = "ml_gdk_get_platform"
let platform = get ()
end
5 changes: 5 additions & 0 deletions src/gdk.mli
Original file line number Diff line number Diff line change
Expand Up @@ -511,9 +511,14 @@ module Cursor : sig
val get_image : cursor -> [`pixbuf] obj (** @since GTK 2.8 *)
(* val destroy : cursor -> unit -- done by GC *)
end

module Display : sig
(** @since Gtk+-2.2 *)

val default : unit -> display
val window_at_pointer : ?display:display -> unit -> (window * int * int) option
end

module Windowing : sig
val platform : [`QUARTZ | `WIN32 | `X11]
end
2 changes: 2 additions & 0 deletions src/gdk_tags.var
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

package "gdk"

type noconv platform = [ `X11 | `WIN32 | `QUARTZ ]

type event_type = "GDK_"
[ `NOTHING | `DELETE | `DESTROY | `EXPOSE | `MOTION_NOTIFY
| `BUTTON_PRESS | `TWO_BUTTON_PRESS "GDK_2BUTTON_PRESS"
Expand Down
13 changes: 13 additions & 0 deletions src/ml_gdk.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,19 @@ CAMLprim value ml_test_##conv (value mask, value test) \
Make_test(GdkModifier_val)
Make_test(GdkWindowState_val)

/* Platform */

value ml_gdk_get_platform()
{
#ifdef GDK_WINDOWING_WIN32
return MLTAG_WIN32;
#elif defined(GDK_WINDOWING_QUARTZ)
return MLTAG_QUARTZ;
#else
return MLTAG_X11;
#endif
}

/* Colormap */

ML_0 (gdk_colormap_get_system, Val_GdkColormap)
Expand Down
4 changes: 2 additions & 2 deletions src/ml_gtklist.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ CAMLprim value ml_gtk_clist_get_text (value clist, value row, value column)
return Val_optstring(text);
}
ML_5 (gtk_clist_set_pixmap, GtkCList_val, Int_val, Int_val, GdkPixmap_val,
GdkBitmap_val, Unit)
(GdkBitmap*)Pointer_val, Unit)
CAMLprim value ml_gtk_clist_get_pixmap (value clist, value row, value column)
{
CAMLparam0 ();
Expand All @@ -153,7 +153,7 @@ CAMLprim value ml_gtk_clist_get_pixmap (value clist, value row, value column)
CAMLreturn(ret);
}
ML_7 (gtk_clist_set_pixtext, GtkCList_val, Int_val, Int_val, String_val,
(guint8)Long_val, GdkPixmap_val, GdkBitmap_val, Unit)
(guint8)Long_val, GdkPixmap_val, (GdkBitmap*)Pointer_val, Unit)
ML_bc7 (ml_gtk_clist_set_pixtext)
ML_3 (gtk_clist_set_foreground, GtkCList_val, Int_val, GdkColor_val, Unit)
ML_3 (gtk_clist_set_background, GtkCList_val, Int_val, GdkColor_val, Unit)
Expand Down

0 comments on commit a20ad88

Please sign in to comment.