This is an automated email from the git hooks/post-receive script.

glondu pushed a commit to branch master
in repository lablgtk2.

commit 7dfe7690b59f4e382e13f820e9b8398ef52b3fec
Author: Stephane Glondu <st...@glondu.net>
Date:   Wed Jun 17 14:32:46 2015 +0200

    Imported Upstream version 2.18.3+dfsg
---
 .gitignore        | 10 ++++++++++
 CHANGES           | 14 ++++++++++++++
 README            |  4 ++--
 src/Makefile      |  1 +
 src/gWindow.mli   |  4 ++--
 src/gdk.ml        | 21 ++++++++++++++++-----
 src/gdk.mli       |  5 +++++
 src/gdkEvent.ml   |  2 +-
 src/gtkBase.props |  2 +-
 src/gtkWindow.ml  |  2 +-
 src/ml_gdk.c      | 10 ++++++----
 src/ml_gdk.h      |  8 +++-----
 src/ml_gobject.c  |  8 ++++----
 src/ml_gtk.c      | 11 ++++++-----
 src/ml_gtkfile.c  |  2 +-
 src/ml_gtkmenu.c  | 12 ++----------
 src/ml_gtktext.c  | 48 +++++++++---------------------------------------
 src/ml_rsvg.c     |  1 -
 src/wrappers.c    |  6 ++++--
 src/wrappers.h    |  1 +
 20 files changed, 89 insertions(+), 83 deletions(-)

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..dfee34b
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,10 @@
+config.make
+config.cache
+config.status
+config.log
+configure.lineno
+aclocal.m4
+autom4te.cache
+test_dynlink.*
+*~
+*.sw[po]
diff --git a/CHANGES b/CHANGES
index 4715934..69dd00e 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,19 @@
 LablGTK changes log
 
+In Lablgtk-2.18.3:
+
+2014.10.06 [Jacques]
+  * add Gdk.Window.create_foreign and set_transient_for functions (Tim 
Cuthbertson)
+
+2014.09.20 [Jacques]
+  * CAMLparam initializes with Val_unit rather than 0 since ocaml 4.02.
+    Fix a related problem in ml_gobject.
+    This caused random crashes with unison (Christopher Zimmermann, PR#1425)
+    
+  * Also factorize some code to use Val_option_*
+  * Replace XID by GdkNativeWindow where required.
+    You may need to insert calls to Gdk.Window.native_of_xid in some places.
+
 In Lablgtk-2.18.2:
 
 2014.09.17 [Jacques]
diff --git a/README b/README
index 1078304..7e67aa6 100755
--- a/README
+++ b/README
@@ -1,5 +1,5 @@
 
-             LablGTK2 2.18.2 : an interface to the GIMP Tool Kit
+             LablGTK2 2.18.3 : an interface to the GIMP Tool Kit
 
 Needed:
         ocaml-3.11 or more (4.02 is preferred)
@@ -312,7 +312,7 @@ GL extension:
 
   You can use lablgtk in combination with LablGL
 
-  * get and install lablGL 1.04 from
+  * get and install lablGL 1.05 from
       http://wwwfun.kurims.kyoto-u.ac.jp/soft/olabl/lablgl.html
   * get and install gtkglarea-1.99.0.tar.gz from
       ftp://ftp.gnome.org/pub/gnome/sources/gtkglarea/1.99/
diff --git a/src/Makefile b/src/Makefile
index c06dd3d..e4dbe7c 100755
--- a/src/Makefile
+++ b/src/Makefile
@@ -17,6 +17,7 @@ INSTALLDIR = $(LIBDIR)/lablgtk2
 DLLDIR = $(LIBDIR)/stublibs
 
 include $(CONFIG)
+#GTKCFLAGS += -Werror -Wno-error=deprecated-declarations
 
 TARGETS = varcc$(XE) lablgtktop$(XE) lablgtk2$(XB) gdk_pixbuf_mlsource$(XE) \
        $(THINITOBJS) build.ml
diff --git a/src/gWindow.mli b/src/gWindow.mli
index 4decee6..c826236 100644
--- a/src/gWindow.mli
+++ b/src/gWindow.mli
@@ -585,7 +585,7 @@ class plug : Gtk.plug obj ->
 
 (** @gtkdoc gtk GtkPlug *)
 val plug :
-  window:Gdk.xid ->
+  window:Gdk.native_window ->
   ?border_width:int ->
   ?width:int -> ?height:int -> ?show:bool -> unit -> plug
 
@@ -607,7 +607,7 @@ class socket : Gtk.socket obj ->
     inherit GContainer.container
     val obj : Gtk.socket obj
     method connect : socket_signals
-    method steal : Gdk.xid -> unit
+    method steal : Gdk.native_window -> unit
     (** @deprecated "inherently unreliable" *)
     method xwindow : Gdk.xid
   end
diff --git a/src/gdk.ml b/src/gdk.ml
index cb5759b..d92fb94 100644
--- a/src/gdk.ml
+++ b/src/gdk.ml
@@ -43,6 +43,7 @@ type +'a event
 type drag_context = [`dragcontext] Gobject.obj
 type cursor
 type xid = int32
+type native_window
 type device
 type display
 
@@ -295,8 +296,14 @@ module Drawable = struct
     = "ml_gdk_drawable_get_size"
 end
 
+module Windowing = struct
+  external get : unit -> [`QUARTZ | `WIN32 | `X11] = "ml_gdk_get_platform"
+  let platform = get ()
+end
+
 module Window = struct
   let cast w : window = Gobject.try_cast w "GdkWindow"
+  external create_foreign : native_window -> window = 
"ml_gdk_window_foreign_new"
   type background_pixmap = [ `NONE | `PARENT_RELATIVE | `PIXMAP of pixmap]
   external get_parent : window -> window = "ml_gdk_window_get_parent"
   external get_position : window -> int * int = "ml_gdk_window_get_position"
@@ -323,6 +330,15 @@ module Window = struct
 
   (* for backward compatibility for lablgtk1 programs *)         
   let get_visual = Drawable.get_visual
+
+  let xid_of_native (w : native_window) : xid =
+    if Windowing.platform = `X11 then Obj.magic w else
+    failwith "Gdk.Window.xid_of_native only allowed for X11"
+  let native_of_xid (id : xid) : native_window =
+    if Windowing.platform = `X11 then Obj.magic id else
+    failwith "Gdk.Window.native_of_xid only allowed for X11"
+
+  external set_transient_for : window -> window -> unit = 
"ml_gdk_window_set_transient_for"
 end
 
 module PointArray = struct
@@ -785,8 +801,3 @@ 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
diff --git a/src/gdk.mli b/src/gdk.mli
index f5509cc..2e9c787 100644
--- a/src/gdk.mli
+++ b/src/gdk.mli
@@ -41,6 +41,7 @@ type +'a event
 type drag_context = [`dragcontext] Gobject.obj
 type cursor
 type xid = int32
+type native_window
 type device
 type display
 
@@ -218,6 +219,7 @@ end
 module Window :
   sig
     val cast : 'a obj -> window
+    val create_foreign : native_window -> window
     val get_parent : window -> window
     val get_position : window -> int * int
     val get_pointer_location : window -> int * int
@@ -226,9 +228,12 @@ module Window :
     val clear_area :
         window -> x:int -> y:int -> width:int -> height:int -> unit
     val get_xwindow : [>`drawable] obj -> xid
+    val native_of_xid : xid -> native_window
+    val xid_of_native : native_window -> xid
     type background_pixmap = [ `NONE|`PARENT_RELATIVE|`PIXMAP of pixmap ]
     val set_back_pixmap : window -> background_pixmap -> unit
     val set_cursor : window -> cursor -> unit
+    val set_transient_for : window -> window -> unit
 
     (* for backward compatibility for lablgtk1 programs *)       
     val get_visual : window -> visual
diff --git a/src/gdkEvent.ml b/src/gdkEvent.ml
index d5fdf55..03cbd72 100644
--- a/src/gdkEvent.ml
+++ b/src/gdkEvent.ml
@@ -180,7 +180,7 @@ module Selection = struct
   external selection : t -> atom = "ml_GdkEventSelection_selection"
   external target : t -> atom = "ml_GdkEventSelection_target"
   external property : t -> atom = "ml_GdkEventSelection_property"
-  external requestor : t -> xid = "ml_GdkEventSelection_requestor"
+  external requestor : t -> native_window = "ml_GdkEventSelection_requestor"
   let time = get_time
 end
 
diff --git a/src/gtkBase.props b/src/gtkBase.props
index 030416c..cc7ca10 100644
--- a/src/gtkBase.props
+++ b/src/gtkBase.props
@@ -272,7 +272,7 @@ class Plug abstract wrapsig : Bin {
 }
 
 class Socket wrapsig : Container {
-  method steal : "Gdk.xid -> unit"
+  method steal : "Gdk.native_window -> unit"
   signal plug_added
   signal plug_removed
 }
diff --git a/src/gtkWindow.ml b/src/gtkWindow.ml
index 799bef4..05c1b18 100644
--- a/src/gtkWindow.ml
+++ b/src/gtkWindow.ml
@@ -163,7 +163,7 @@ end
 
 module Plug = struct
   include Plug
-  external create : Gdk.xid -> plug obj = "ml_gtk_plug_new"
+  external create : Gdk.native_window -> plug obj = "ml_gtk_plug_new"
 end
 
 module Socket = Socket
diff --git a/src/ml_gdk.c b/src/ml_gdk.c
index f823106..e4ed433 100644
--- a/src/ml_gdk.c
+++ b/src/ml_gdk.c
@@ -270,14 +270,15 @@ ML_5 (gdk_window_clear_area, GdkWindow_val, Int_val, 
Int_val, Int_val, Int_val,
       Unit)
 ML_0 (GDK_ROOT_PARENT, Val_GdkWindow)
 ML_1 (gdk_window_get_parent, GdkWindow_val, Val_GdkWindow)
+ML_2 (gdk_window_set_transient_for, GdkWindow_val, GdkWindow_val, Unit)
+ML_1 (gdk_window_foreign_new, GdkNativeWindow_val, Val_GdkWindow)
 
 #if defined(_WIN32) || defined(__CYGWIN__) || defined(HAS_GTKQUARTZ)
 CAMLprim value ml_GDK_WINDOW_XWINDOW(value v)
 {
- ml_raise_gdk ("Not available for Win32");
+ ml_raise_gdk ("ml_GDK_WINDOW_XWINDOW: only for X11");
  return Val_unit;
-} 
-
+}
 #else
 ML_1 (GDK_WINDOW_XWINDOW, GdkDrawable_val, Val_XID)
 #endif
@@ -878,7 +879,8 @@ Make_Extractor (GdkEventSelection, GdkEvent_arg(Selection), 
target,
                 Val_GdkAtom)
 Make_Extractor (GdkEventSelection, GdkEvent_arg(Selection), property,
                 Val_GdkAtom)
-Make_Extractor (GdkEventSelection, GdkEvent_arg(Selection), requestor, Val_XID)
+Make_Extractor (GdkEventSelection, GdkEvent_arg(Selection), requestor,
+                Val_GdkNativeWindow)
 
 Make_Extractor (GdkEventProximity, GdkEvent_arg(Proximity),
                 device, Val_GdkDevice)
diff --git a/src/ml_gdk.h b/src/ml_gdk.h
index 875555d..75d01d7 100644
--- a/src/ml_gdk.h
+++ b/src/ml_gdk.h
@@ -82,16 +82,14 @@ CAMLexport value Val_GdkEvent (GdkEvent *);
 #define GdkDevice_val(val) ((GdkDevice*) val)
 #define Val_GdkDevice(device) ((value) device)
 
-#if 0 
 // Future replacement for XID?
 #ifdef GDK_NATIVE_WINDOW_POINTER
-#define GdkNativeWindow_val (GdkNativeWindow*)
-#define Val_GdkNativeWindow(id) (value)
+#define GdkNativeWindow_val Pointer_val
+#define Val_GdkNativeWindow Val_pointer
 #else
-#define Val_GdkNativeWindow(id) copy_int32((long) id)
+#define Val_GdkNativeWindow copy_int32
 #define GdkNativeWindow_val Int32_val
 #endif
-#endif
 
 #ifdef _WIN32
 #define Val_XID(id) copy_int32((long) id)
diff --git a/src/ml_gobject.c b/src/ml_gobject.c
index f28a3f5..4159a28 100644
--- a/src/ml_gobject.c
+++ b/src/ml_gobject.c
@@ -643,8 +643,8 @@ ML_2 (g_signal_handler_is_connected, GObject_val, Long_val, 
Val_bool)
 ML_2 (g_signal_stop_emission_by_name, GObject_val, String_val, Unit)
 CAMLprim value ml_g_signal_emit_by_name (value obj, value sig, value params)
 {
-    CAMLparam3(obj,sig,params);
-    CAMLlocal1(ret);
+    value ret = Val_unit;
+    CAMLparam4(obj,sig,params,ret);
     GObject *instance = GObject_val(obj);
     GValue *iparams = (GValue*)calloc(1 + Wosize_val(params), sizeof(GValue));
     GQuark detail = 0;
@@ -671,11 +671,11 @@ CAMLprim value ml_g_signal_emit_by_name (value obj, value 
sig, value params)
                       query.param_types[i] & ~G_SIGNAL_TYPE_STATIC_SCOPE);
         g_value_set_mlvariant (&iparams[i+1], Field(params,i));
     }
-    g_signal_emitv (iparams, signal_id, detail, (ret ? GValue_val(ret) : 0));
+    g_signal_emitv (iparams, signal_id, detail,
+                    (ret == Val_unit ? 0 : GValue_val(ret)));
     for (i = 0; i < query.n_params + 1; i++)
         g_value_unset (iparams + i);
     free (iparams);
-    if (!ret) ret = Val_unit;
     CAMLreturn(ret);
 }
 
diff --git a/src/ml_gtk.c b/src/ml_gtk.c
index 3bc8589..23385cd 100644
--- a/src/ml_gtk.c
+++ b/src/ml_gtk.c
@@ -402,7 +402,7 @@ CAMLprim value ml_gtk_widget_style_get_property (value w, 
value n)
     pspec = gtk_widget_class_find_style_property
                (GTK_WIDGET_GET_CLASS (widget), name);
     if (pspec) {
-        value ret = ml_g_value_new ();
+        ret = ml_g_value_new ();
         GValue *gv = GValueptr_val (ret);
         g_value_init (gv, G_PARAM_SPEC_VALUE_TYPE (pspec));
         gtk_widget_style_get_property (widget, name, gv);
@@ -737,8 +737,9 @@ CAMLprim value ml_gtk_file_selection_get_selections (value 
sel)
   gchar** selections =
     gtk_file_selection_get_selections(GtkFileSelection_val(sel));
   gchar** orig = selections;
-  CAMLparam0();
-  CAMLlocal3(ret,prev,next);
+  value ret = Val_unit;
+  CAMLparam1(ret);
+  CAMLlocal2(prev,next);
   for (prev = (value)((&ret)-1); *selections != NULL; selections++) {
     next = alloc(2,0);
     Store_field(prev, 1, next);
@@ -967,7 +968,7 @@ Make_Extractor (gtk_font_selection_dialog, 
GtkFontSelectionDialog_val,
 #ifdef _WIN32
 Unsupported(gtk_plug_new)
 #else
-ML_1 (gtk_plug_new, XID_val, Val_GtkWidget_window)
+ML_1 (gtk_plug_new, GdkNativeWindow_val, Val_GtkWidget_window)
 #endif
 
 /* gtksocket.h */
@@ -975,7 +976,7 @@ ML_1 (gtk_plug_new, XID_val, Val_GtkWidget_window)
 Unsupported(gtk_socket_steal)
 #else
 #define GtkSocket_val(val) check_cast(GTK_SOCKET,val)
-ML_2 (gtk_socket_steal, GtkSocket_val, XID_val, Unit)
+ML_2 (gtk_socket_steal, GtkSocket_val, GdkNativeWindow_val, Unit)
 #endif
 
 /* gtkmain.h */
diff --git a/src/ml_gtkfile.c b/src/ml_gtkfile.c
index 2f5dbce..7503f4f 100644
--- a/src/ml_gtkfile.c
+++ b/src/ml_gtkfile.c
@@ -99,7 +99,7 @@ static gboolean ml_gtk_file_filter_func (const 
GtkFileFilterInfo *filter_info,
 {
   value *cb = data;
   CAMLparam0();
-  CAMLlocal5(r, l, v, t, s);
+  CAMLlocal4(r, l, v, s);
   l = Val_emptylist;
 #define CONS_MEMBER(memb, flag) \
   if (filter_info->contains & GTK_FILE_FILTER_##flag) {        \
diff --git a/src/ml_gtkmenu.c b/src/ml_gtkmenu.c
index 9f6d4ff..197df66 100644
--- a/src/ml_gtkmenu.c
+++ b/src/ml_gtkmenu.c
@@ -62,16 +62,8 @@ ML_0 (gtk_tearoff_menu_item_new, Val_GtkWidget_sink)
 ML_1 (gtk_menu_item_new_with_label, String_val, Val_GtkWidget_sink)
 ML_1 (gtk_menu_item_new_with_mnemonic, String_val, Val_GtkWidget_sink)
 ML_2 (gtk_menu_item_set_submenu, GtkMenuItem_val, GtkWidget_val, Unit)
-
-CAMLprim value ml_gtk_menu_item_get_submenu(value sm)
-{
-  CAMLparam1(sm);
-  CAMLlocal1(res);
-  res = Val_option(gtk_menu_item_get_submenu(GtkMenuItem_val(sm)),
-                  Val_GtkWidget);
-  CAMLreturn(res);
-}
-
+Make_Val_option(GtkWidget)
+ML_1 (gtk_menu_item_get_submenu, GtkMenuItem_val, Val_option_GtkWidget)
 ML_1 (gtk_menu_item_remove_submenu, GtkMenuItem_val, Unit)
 ML_2 (gtk_menu_item_set_accel_path, GtkMenuItem_val, String_val, Unit)
 ML_1 (gtk_menu_item_activate, GtkMenuItem_val, Unit)
diff --git a/src/ml_gtktext.c b/src/ml_gtktext.c
index 83690ad..4fbc4db 100644
--- a/src/ml_gtktext.c
+++ b/src/ml_gtktext.c
@@ -121,25 +121,9 @@ CAMLprim value ml_gtk_text_iter_assign (value it1, value 
it2) {
 ML_2(gtk_text_mark_set_visible, GtkTextMark_val, Bool_val, Unit)
 ML_1(gtk_text_mark_get_visible, GtkTextMark_val, Val_bool)
 ML_1(gtk_text_mark_get_deleted, GtkTextMark_val, Val_bool)
-CAMLprim value ml_gtk_text_mark_get_name (value tm)
-{
-  CAMLparam1(tm);
-  CAMLlocal1(res);
-  const gchar* tmp;
-  tmp = gtk_text_mark_get_name(GtkTextMark_val(tm));
-  res = Val_option(tmp,Val_string);
-  CAMLreturn(res);
-}
-CAMLprim value ml_gtk_text_mark_get_buffer (value tm)
-{
-  CAMLparam1(tm);
-  CAMLlocal1(res);
-  GtkTextBuffer* tmp;
-  tmp = gtk_text_mark_get_buffer(GtkTextMark_val(tm));
-  res = Val_option(tmp,Val_GtkTextBuffer);
-  CAMLreturn(res);
-}
-
+ML_1(gtk_text_mark_get_name, GtkTextMark_val, Val_option_string)
+Make_Val_option(GtkTextBuffer)
+ML_1(gtk_text_mark_get_buffer, GtkTextMark_val, Val_option_GtkTextBuffer)
 ML_1(gtk_text_mark_get_left_gravity, GtkTextMark_val, Val_bool)
 
 /* gtktexttag */
@@ -157,17 +141,9 @@ ML_1(Wrap_mode_val, (value), Val_int)
 ML_0(gtk_text_tag_table_new, Val_GtkTextTagTable_new)
 ML_2(gtk_text_tag_table_add, GtkTextTagTable_val, GtkTextTag_val,Unit)
 ML_2(gtk_text_tag_table_remove, GtkTextTagTable_val, GtkTextTag_val,Unit)
-
-CAMLprim value ml_gtk_text_tag_table_lookup (value tv, value s)
-{
-  CAMLparam2(tv,s);
-  CAMLlocal1(res);
-  GtkTextTag* tmp;
-  tmp = gtk_text_tag_table_lookup(GtkTextTagTable_val(tv), String_val(s));
-  res = Val_option(tmp,Val_GtkTextTag);
-  CAMLreturn(res);
-}
-
+Make_Val_option(GtkTextTag)
+ML_2(gtk_text_tag_table_lookup, GtkTextTagTable_val, String_val,
+     Val_option_GtkTextTag)
 ML_1(gtk_text_tag_table_get_size, GtkTextTagTable_val, Val_int)
 
 static void tag_foreach_func (GtkTextTag* t, gpointer user_data)
@@ -625,15 +601,9 @@ CAMLprim value ml_gtk_text_view_window_to_buffer_coords 
(value tv,
   CAMLreturn(res);
 }
 
-CAMLprim value ml_gtk_text_view_get_window (value tv, value tt)
-{
-  CAMLparam2(tv,tt);
-  CAMLlocal1(res);
-  GdkWindow* tmp;
-  tmp = gtk_text_view_get_window(GtkTextView_val(tv), 
Text_window_type_val(tt));
-  res = Val_option(tmp,Val_GdkWindow);
-  CAMLreturn(res);
-}
+Make_Val_option(GdkWindow)
+ML_2(gtk_text_view_get_window, GtkTextView_val, Text_window_type_val,
+     Val_option_GdkWindow)
 
 ML_2(gtk_text_view_get_window_type,GtkTextView_val,GdkWindow_val,
      Val_text_window_type)
diff --git a/src/ml_rsvg.c b/src/ml_rsvg.c
index b670c5f..a89327f 100644
--- a/src/ml_rsvg.c
+++ b/src/ml_rsvg.c
@@ -25,7 +25,6 @@
 
 #include <gdk-pixbuf/gdk-pixbuf.h>
 #include <librsvg/rsvg.h>
-#include <librsvg/librsvg-features.h>
 #include <caml/mlvalues.h>
 #include <caml/alloc.h>
 #include <caml/memory.h>
diff --git a/src/wrappers.c b/src/wrappers.c
index 0236f1c..0a5d8b9 100644
--- a/src/wrappers.c
+++ b/src/wrappers.c
@@ -61,8 +61,7 @@ CAMLprim value ml_some (value v)
 value ml_cons (value v, value l)
 {
   CAMLparam2(v, l);
-  CAMLlocal1(cell);
-  cell = alloc_small(2, Tag_cons);
+  value cell = alloc_small(2, Tag_cons);
   Field(cell, 0) = v;
   Field(cell, 1) = l;
   CAMLreturn(cell);
@@ -95,6 +94,9 @@ value copy_string_or_null (const char*str)
     return copy_string (str ? (char*) str : "");
 }
 
+value Val_option_string (const char *s)
+{ return Val_option (s, Val_string); }
+
 CAMLprim value *ml_global_root_new (value v)
 {
     value *p = stat_alloc(sizeof(value));
diff --git a/src/wrappers.h b/src/wrappers.h
index 7a87c83..f7fb02d 100644
--- a/src/wrappers.h
+++ b/src/wrappers.h
@@ -43,6 +43,7 @@ CAMLexport void ml_raise_null_pointer (void) Noreturn;
 CAMLexport value Val_pointer (void *);
 CAMLprim value copy_string_check (const char*);
 value copy_string_or_null (const char *);
+value Val_option_string (const char *s);
 
 value string_list_of_strv (const char * const *v);
 value string_list_of_strv2 (char **v);

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-ocaml-maint/packages/lablgtk2.git

_______________________________________________
Pkg-ocaml-maint-commits mailing list
Pkg-ocaml-maint-commits@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-ocaml-maint-commits

Reply via email to