Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package ocaml-lablgtk3 for openSUSE:Factory checked in at 2026-07-17 01:38:19 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ocaml-lablgtk3 (Old) and /work/SRC/openSUSE:Factory/.ocaml-lablgtk3.new.24530 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ocaml-lablgtk3" Fri Jul 17 01:38:19 2026 rev:9 rq:1365554 version:3.1.5 Changes: -------- --- /work/SRC/openSUSE:Factory/ocaml-lablgtk3/ocaml-lablgtk3.changes 2025-03-04 18:32:13.301035252 +0100 +++ /work/SRC/openSUSE:Factory/.ocaml-lablgtk3.new.24530/ocaml-lablgtk3.changes 2026-07-17 01:40:15.826729654 +0200 @@ -1,0 +2,7 @@ +Tue Jul 7 07:07:07 UTC 2026 - [email protected] + +- Update to version 3.1.5 + see included CHANGES.md file for details +- Add ocaml-lablgtk3.patch + +------------------------------------------------------------------- Old: ---- ocaml-lablgtk3-3.1.3.tar.xz New: ---- ocaml-lablgtk3-3.1.5.tar.xz ocaml-lablgtk3.patch ----------(New B)---------- New: see included CHANGES.md file for details - Add ocaml-lablgtk3.patch ----------(New E)---------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ocaml-lablgtk3.spec ++++++ --- /var/tmp/diff_new_pack.mHJQvb/_old 2026-07-17 01:40:17.030770307 +0200 +++ /var/tmp/diff_new_pack.mHJQvb/_new 2026-07-17 01:40:17.030770307 +0200 @@ -1,7 +1,7 @@ # # spec file for package ocaml-lablgtk3 # -# Copyright (c) 2025 SUSE LLC +# Copyright (c) 2026 SUSE LLC and contributors # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,21 +16,23 @@ # %bcond_without ocaml_lablgtk3_gtksourceview3 +%bcond_without ocaml_lablgtk3_gtkrsvg2 %bcond_without ocaml_lablgtk3_gtkspell %global _buildshell /bin/bash Name: ocaml-lablgtk3 -Version: 3.1.3 +Version: 3.1.5 Release: 0 Summary: Binding to Cairo, a 2D Vector Graphics Library. License: LGPL-3.0-or-later -Group: Development/Languages/OCaml -URL: https://opam.ocaml.org/packages/lablgtk3 -Source: %name-%version.tar.xz +ExclusiveArch: aarch64 ppc64le riscv64 s390x x86_64 +URL: https://opam.ocaml.org/packages/lablgtk3/ +Source0: %name-%version.tar.xz +Patch0: %name.patch BuildRequires: bash BuildRequires: ocaml(ocaml_base_version) >= 4.09 BuildRequires: ocaml-dune -BuildRequires: ocaml-rpm-macros >= 20240909 +BuildRequires: ocaml-rpm-macros >= 20260707 BuildRequires: ocamlfind(cairo2) BuildRequires: ocamlfind(camlp-streams) BuildRequires: ocamlfind(camlp5) @@ -42,6 +44,9 @@ %if %{with ocaml_lablgtk3_gtksourceview3} BuildRequires: pkgconfig(gtksourceview-3.0) >= 3.18 %endif +%if %{with ocaml_lablgtk3_gtkrsvg2} +BuildRequires: pkgconfig(librsvg-2.0) >= 2.40 +%endif %if %{with ocaml_lablgtk3_gtkspell} BuildRequires: pkgconfig(gtkspell3-3.0) >= 3.0.4 %endif @@ -51,12 +56,14 @@ %package devel Summary: Development files for %name -Group: Development/Languages/OCaml -Requires: %name = %version +Requires: %name = %version-%release Requires: pkgconfig(gtk+-3.0) >= 3.18 %if %{with ocaml_lablgtk3_gtksourceview3} Requires: pkgconfig(gtksourceview-3.0) >= 3.18 %endif +%if %{with ocaml_lablgtk3_gtkrsvg2} +Requires: pkgconfig(librsvg-2.0) >= 2.40 +%endif %if %{with ocaml_lablgtk3_gtkspell} Requires: pkgconfig(gtkspell3-3.0) >= 3.0.4 %endif @@ -71,20 +78,13 @@ %build sed -i~ '/mode promote/d' tools/dune diff -u "$_"~ "$_" && exit 1 -read < <(camlp5 -version) -case "${REPLY}" in -7*) ;; -8.00.*) ;; -8.02.*) ;; -*) -sed -i~ 's@camlp5o pr_o.cmo -impl@camlp5o o_keywords.cmo pr_o.cmo -impl@' tools/dune -diff -u "$_"~ "$_" && exit 1 -;; -esac dune_release_pkgs='lablgtk3' %if %{with ocaml_lablgtk3_gtksourceview3} dune_release_pkgs="${dune_release_pkgs},lablgtk3-sourceview3" %endif +%if %{with ocaml_lablgtk3_gtkrsvg2} +dune_release_pkgs="${dune_release_pkgs},lablgtk3-rsvg2" +%endif %if %{with ocaml_lablgtk3_gtkspell} dune_release_pkgs="${dune_release_pkgs},lablgtk3-gtkspell3" %endif ++++++ _service ++++++ --- /var/tmp/diff_new_pack.mHJQvb/_old 2026-07-17 01:40:17.078771928 +0200 +++ /var/tmp/diff_new_pack.mHJQvb/_new 2026-07-17 01:40:17.086772198 +0200 @@ -15,7 +15,7 @@ <param name="exclude">tools/propcc.ml</param> <param name="exclude">tools/varcc.ml</param> <param name="filename">ocaml-lablgtk3</param> - <param name="revision">8a803575ded8107a063a8779c47ca79310de90bc</param> + <param name="revision">afbd6d2ee90b98cb0ea49cba34659e15b00cbfe3</param> <param name="scm">git</param> <param name="submodules">disable</param> <param name="url">https://github.com/garrigue/lablgtk.git</param> ++++++ ocaml-lablgtk3-3.1.3.tar.xz -> ocaml-lablgtk3-3.1.5.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-lablgtk3-3.1.3/.github/workflows/ci.yml new/ocaml-lablgtk3-3.1.5/.github/workflows/ci.yml --- old/ocaml-lablgtk3-3.1.3/.github/workflows/ci.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/ocaml-lablgtk3-3.1.5/.github/workflows/ci.yml 2024-06-10 05:22:38.000000000 +0200 @@ -0,0 +1,62 @@ +name: CI + +on: + push: + branches: + - lablgtk3 + pull_request: + branches: + - lablgtk3 + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# CI Notes: +# - depext for goocanvas2 is broken on windows and osx +# - depext for gtkspell is broken on windows + +# Base setup, run all opam and dev-all jobs in all the compilers, dev +# in all architectures for the latest compiler +jobs: + build: + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + ocaml-compiler: [4.09.x, 4.10.x, 4.11.x, 4.12.x, 4.13.x, 4.14.x] + test-packages: [lablgtk3 lablgtk3-sourceview3 lablgtk3-gtkspell3 lablgtk3-goocanvas2] + test-target: [opam, dev-all] + include: + - os: ubuntu-latest + ocaml-compiler: 4.14.x + test-packages: lablgtk3 lablgtk3-sourceview3 lablgtk3-gtkspell3 lablgtk3-goocanvas2 + test-target: dev + - os: macos-latest + ocaml-compiler: 4.14.x + test-packages: lablgtk3 lablgtk3-sourceview3 lablgtk3-gtkspell3 + test-target: dev-ci-osx + - os: windows-latest + ocaml-compiler: 4.14.x + test-packages: lablgtk3 lablgtk3-sourceview3 + test-target: dev-ci-windows + env: + OPAMJOBS: "2" + OPAMROOTISOK: "true" + OPAMYES: "true" + NJOBS: "2" + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v2 + - name: Set up OCaml ${{ matrix.ocaml-compiler }} + uses: avsm/setup-ocaml@v2 + with: + ocaml-compiler: ${{ matrix.ocaml-compiler }} + dune-cache: true + opam-depext: true + - name: Install deps + run: opam install ${{ matrix.test-packages }} --deps-only --with-test + - name: Display OPAM Setup + run: opam exec -- opam list + - name: Test LabLGTK + run: opam exec -- make ${{ matrix.test-target }} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-lablgtk3-3.1.3/CHANGES.md new/ocaml-lablgtk3-3.1.5/CHANGES.md --- old/ocaml-lablgtk3-3.1.3/CHANGES.md 2022-10-06 09:24:16.000000000 +0200 +++ new/ocaml-lablgtk3-3.1.5/CHANGES.md 2024-06-10 05:22:38.000000000 +0200 @@ -1,5 +1,29 @@ LablGTK changes log +## In Lablgtk-3.1.5 + +2024.06.10 [Jacques] + * Prepare for release + * Fix typos in README.md (#182) [Sylvain Chiron] + +2024.05.20 [Jacques] + * Typo in ml_gtk_text_buffer_get_iter_at_line_index. (#181) [Hugo Herbelin] + +2024.05.14 [Jacques] + * Support windows sockets in Glib.IO.channel_of_descr (#176) + [with Michael Soegtrop] + +2024.03.24 [Jacques] + * fix pointer incompatibility in ml_gtk_style_context_list_classes (#178) + +## In Lablgtk-3.1.4 + +2024.01.31 [Jacques] + * use Bytes rather than String + * Various missing bindings, including lablgtk3-rsvg2 (#128) + * GtkStyleContext: Add missing class and provider functions (#163) + * Add GdkEvent.Scroll.delta_{x,y} (#173) [Thomas Leonard] + ## In Lablgtk-3.1.3 2022.10.06 [Jacques] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-lablgtk3-3.1.3/README.md new/ocaml-lablgtk3-3.1.5/README.md --- old/ocaml-lablgtk3-3.1.3/README.md 2022-10-06 09:24:16.000000000 +0200 +++ new/ocaml-lablgtk3-3.1.5/README.md 2024-06-10 05:22:38.000000000 +0200 @@ -1,8 +1,8 @@ -# LablGTK3 3.1.3 : an interface to the GIMP Tool Kit +# LablGTK3 3.1.5 : an interface to the GIMP Tool Kit ## Dependencies -- ocaml >= 4.05.0 (including 5.0) +- ocaml >= 4.05.0 (including 5.0 and 5.1) - gtk+ >= 3.18 - dune >= 1.8 - camlp5 (for developer build only) @@ -198,13 +198,13 @@ Generally, this default value is defined by GTK, and you must refer to GTK's documentation. For ML defined defaults, usually default values are either `false`, `0`, `None` -or ```NONE``, according to the expected type. -Important exceptions are `~show`, which default to true in all widgets -except those in **GWindow**, and `~fill`, which defaults to true or ```BOTH``. +or `NONE`, according to the expected type. +Important exceptions are `~show`, which defaults to true in all widgets +except those in **GWindow**, and `~fill`, which defaults to true or `BOTH`. Note about unit as method argument: -O'Caml introduces no distinction between methods having side-effects +OCaml introduces no distinction between methods having side-effects and methods simply returning a value. In practice, this is confusing, and awkward when used as callbacks. For this reason all methods having noticeable side-effects should take arguments, and @@ -263,20 +263,28 @@ It requires libgtksourceview-3.x. See examples in examples/sourceview/*3.ml The executable must be linked with lablgtksourceview3.cma. -- GtkSpell 3 support: +- GtkSpell 3 support +- RSVG2 support: + This binding was contributed by Olivier Andrieu. + It requires librsvg-2.x (preferably 2.2.x). + See an example in examples/rsvg. + The executable must be linked with lablrsvg.cma. +- GooCanvas2 support: + This binding was contributed by Maxence Guesdon. + It requires libgoocanvas-2.x. + See examples in examples/goocanvas2. + The executable must be linked with lablgtk3_goocanvas2.cma. + #### Not available in Gtk3 - LibGlade support: not available in Gtk3 (replaced by GtkBuilder) - GL extension: not available in Gtk3 -- SVG support: not available in Gtk3 - GnomeCanvas support: not available in Gtk3 ### Running lablgtk3 in the toplevel -The X11 version of lablgt3 - -### Windows port +#### Windows port If you want to use threads, you must be aware of windows specific restrictions; see for instance: @@ -309,7 +317,7 @@ # b#connect#clicked (fun () -> prerr_endline "Hello");; ``` -### OSX/Quartz port +#### OSX/Quartz port Since Darwin is Unix, this port compiles as usual. Note however that Quartz imposes even stronger restrictions than diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-lablgtk3-3.1.3/dune-project new/ocaml-lablgtk3-3.1.5/dune-project --- old/ocaml-lablgtk3-3.1.3/dune-project 2022-10-06 09:24:16.000000000 +0200 +++ new/ocaml-lablgtk3-3.1.5/dune-project 2024-06-10 05:22:38.000000000 +0200 @@ -1,3 +1,3 @@ (lang dune 1.8) (name lablgtk3) -(version 3.1.2) +(version 3.1.5) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-lablgtk3-3.1.3/lablgtk3-goocanvas2.opam new/ocaml-lablgtk3-3.1.5/lablgtk3-goocanvas2.opam --- old/ocaml-lablgtk3-3.1.3/lablgtk3-goocanvas2.opam 2022-10-06 09:24:16.000000000 +0200 +++ new/ocaml-lablgtk3-3.1.5/lablgtk3-goocanvas2.opam 2024-06-10 05:22:38.000000000 +0200 @@ -13,7 +13,7 @@ bug-reports: "https://github.com/garrigue/lablgtk/issues" dev-repo: "git+https://github.com/garrigue/lablgtk.git" doc: "https://garrigue.github.io/lablgtk/lablgtk3/lablgtk3-goocanvas2" -license: "LGPL with linking exception" +license: "LGPL-2.1-or-later WITH OCaml-LGPL-linking-exception" depends: [ "ocaml" { >= "4.09.0" } @@ -24,6 +24,6 @@ ] build: [ - [ "dune" "subst" ] {pinned} + [ "dune" "subst" ] {dev} [ "dune" "build" "-p" name "-j" jobs ] ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-lablgtk3-3.1.3/lablgtk3-gtkspell3.opam new/ocaml-lablgtk3-3.1.5/lablgtk3-gtkspell3.opam --- old/ocaml-lablgtk3-3.1.3/lablgtk3-gtkspell3.opam 2022-10-06 09:24:16.000000000 +0200 +++ new/ocaml-lablgtk3-3.1.5/lablgtk3-gtkspell3.opam 2024-06-10 05:22:38.000000000 +0200 @@ -14,7 +14,7 @@ bug-reports: "https://github.com/garrigue/lablgtk/issues" dev-repo: "git+https://github.com/garrigue/lablgtk.git" doc: "https://garrigue.github.io/lablgtk/lablgtk3/lablgtk3-gtkspell3" -license: "LGPL with linking exception" +license: "LGPL-2.1-or-later WITH OCaml-LGPL-linking-exception" depends: [ "ocaml" { >= "4.09.0" } @@ -35,5 +35,6 @@ ] build: [ + [ "dune" "subst" ] {pinned} [ "dune" "build" "-p" name "-j" jobs ] ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-lablgtk3-3.1.3/lablgtk3-rsvg2.opam new/ocaml-lablgtk3-3.1.5/lablgtk3-rsvg2.opam --- old/ocaml-lablgtk3-3.1.3/lablgtk3-rsvg2.opam 1970-01-01 01:00:00.000000000 +0100 +++ new/ocaml-lablgtk3-3.1.5/lablgtk3-rsvg2.opam 2024-06-10 05:22:38.000000000 +0200 @@ -0,0 +1,28 @@ +opam-version: "2.0" + +synopsis: "OCaml interface to Gnome rsvg2 library" +description: """ +OCaml interface to Gnome rsvg2 library. + +See https://garrigue.github.io/lablgtk/ for more information. +""" + +maintainer: "[email protected]" +authors: ["Jacques Garrigue et al., Nagoya University"] +homepage: "https://github.com/garrigue/lablgtk" +bug-reports: "https://github.com/garrigue/lablgtk/issues" +dev-repo: "git+https://github.com/garrigue/lablgtk.git" +doc: "https://garrigue.github.io/lablgtk/lablgtk3/lablgtk3-rsvg2" +license: "LGPL-2.1-or-later WITH OCaml-LGPL-linking-exception" + +depends: [ + "ocaml" { >= "4.12.0" } + "dune" { >= "1.8.0" } + "lablgtk3" { = version } + "conf-librsvg2" { build & >= "0" } +] + +build: [ + [ "dune" "subst"] {pinned} + [ "dune" "build" "-p" name "-j" jobs ] +] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-lablgtk3-3.1.3/lablgtk3-sourceview3.opam new/ocaml-lablgtk3-3.1.5/lablgtk3-sourceview3.opam --- old/ocaml-lablgtk3-3.1.3/lablgtk3-sourceview3.opam 2022-10-06 09:24:16.000000000 +0200 +++ new/ocaml-lablgtk3-3.1.5/lablgtk3-sourceview3.opam 2024-06-10 05:22:38.000000000 +0200 @@ -13,7 +13,7 @@ bug-reports: "https://github.com/garrigue/lablgtk/issues" dev-repo: "git+https://github.com/garrigue/lablgtk.git" doc: "https://garrigue.github.io/lablgtk/lablgtk3/lablgtk3-sourceview3" -license: "LGPL with linking exception" +license: "LGPL-2.1-or-later WITH OCaml-LGPL-linking-exception" depends: [ "ocaml" { >= "4.09.0" } @@ -24,5 +24,6 @@ ] build: [ + [ "dune" "subst"] {pinned} [ "dune" "build" "-p" name "-j" jobs ] ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-lablgtk3-3.1.3/lablgtk3.opam new/ocaml-lablgtk3-3.1.5/lablgtk3.opam --- old/ocaml-lablgtk3-3.1.3/lablgtk3.opam 2022-10-06 09:24:16.000000000 +0200 +++ new/ocaml-lablgtk3-3.1.5/lablgtk3.opam 2024-06-10 05:22:38.000000000 +0200 @@ -12,20 +12,21 @@ homepage: "https://github.com/garrigue/lablgtk" bug-reports: "https://github.com/garrigue/lablgtk/issues" dev-repo: "git+https://github.com/garrigue/lablgtk.git" -license: "LGPL with linking exception" +license: "LGPL-2.1-or-later WITH OCaml-LGPL-linking-exception" doc: "https://garrigue.github.io/lablgtk/lablgtk3/lablgtk3" depends: [ "ocaml" { >= "4.09.0" } + "camlp-streams" { >= "5.0" & build } "dune" { >= "1.8.0" } "cairo2" { >= "0.6" } - "conf-gtk3" { build & >= "18" } - "camlp-streams" { build } + "conf-gtk3" { >= "18" } "ocamlfind" { dev } "camlp5" { dev } ] build: [ + [ "dune" "subst"] {pinned} [ "dune" "build" "-p" name "-j" jobs ] ] run-test: [ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-lablgtk3-3.1.3/src/gBin.ml new/ocaml-lablgtk3-3.1.5/src/gBin.ml --- old/ocaml-lablgtk3-3.1.3/src/gBin.ml 2022-10-06 09:24:16.000000000 +0200 +++ new/ocaml-lablgtk3-3.1.5/src/gBin.ml 2024-06-10 05:22:38.000000000 +0200 @@ -51,6 +51,7 @@ class event_box obj = object inherit bin obj + inherit OgtkBinProps.event_box_props method connect = new container_signals_impl obj method event = new GObj.event_ops (obj :> Gtk.event_box obj) end @@ -128,15 +129,15 @@ end let alignment ?padding = - let pl = match padding with - | None -> [] + let pl = match padding with + | None -> [] | Some (t, b, l, r) -> [ param Alignment.P.top_padding t ; param Alignment.P.bottom_padding b ; param Alignment.P.left_padding l ; param Alignment.P.right_padding r ] in Alignment.make_params pl ~cont:( pack_container ~create:(fun pl -> new alignment (Alignment.create pl))) - + let alignment_cast w = new alignment (Alignment.cast w#as_widget) class expander_signals obj = object diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-lablgtk3-3.1.3/src/gBin.mli new/ocaml-lablgtk3-3.1.5/src/gBin.mli --- old/ocaml-lablgtk3-3.1.3/src/gBin.mli 2022-10-06 09:24:16.000000000 +0200 +++ new/ocaml-lablgtk3-3.1.5/src/gBin.mli 2024-06-10 05:22:38.000000000 +0200 @@ -75,6 +75,10 @@ val obj : 'a obj method connect : container_signals method event : event_ops + method above_child : bool + method set_above_child : bool -> unit + method visible_window : bool + method set_visible_window : bool -> unit end (** @gtkdoc gtk GtkEventBox *) @@ -239,7 +243,7 @@ ?height:int -> ?packing:(widget -> unit) -> ?show:bool -> unit -> viewport -(** {3 GtkAlignment} +(** {3 GtkAlignment} A widget which controls the alignment and size of its child *) (** @gtkdoc gtk GtkAlignment *) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-lablgtk3-3.1.3/src/gMisc.ml new/ocaml-lablgtk3-3.1.5/src/gMisc.ml --- old/ocaml-lablgtk3-3.1.3/src/gMisc.ml 2022-10-06 09:24:16.000000000 +0200 +++ new/ocaml-lablgtk3-3.1.5/src/gMisc.ml 2024-06-10 05:22:38.000000000 +0200 @@ -42,6 +42,7 @@ method push text = Statusbar.push obj context ~text method pop () = Statusbar.pop obj context method remove = Statusbar.remove obj context + method remove_all () = Statusbar.remove_all obj context method flash ?(delay=1000) text = let msg = self#push text in Glib.Timeout.add delay (fun () -> self#remove msg; false); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-lablgtk3-3.1.3/src/gMisc.mli new/ocaml-lablgtk3-3.1.5/src/gMisc.mli --- old/ocaml-lablgtk3-3.1.3/src/gMisc.mli 2022-10-06 09:24:16.000000000 +0200 +++ new/ocaml-lablgtk3-3.1.5/src/gMisc.mli 2024-06-10 05:22:38.000000000 +0200 @@ -48,6 +48,7 @@ method pop : unit -> unit method push : string -> statusbar_message method remove : statusbar_message -> unit + method remove_all : unit -> unit end (** Report messages of minor importance to the user diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-lablgtk3-3.1.3/src/gObj.ml new/ocaml-lablgtk3-3.1.5/src/gObj.ml --- old/ocaml-lablgtk3-3.1.3/src/gObj.ml 2022-10-06 09:24:16.000000000 +0200 +++ new/ocaml-lablgtk3-3.1.5/src/gObj.ml 2024-06-10 05:22:38.000000000 +0200 @@ -148,8 +148,15 @@ class style_context ctxt = object val ctxt = ctxt - (** Does not cascade!! StyleContext.add_provider_for_screen does cascade. *) + method as_style_context = ctxt + (* Does not cascade!! StyleContext.add_provider_for_screen does cascade. *) method add_provider (provider: css_provider) = StyleContext.add_provider ctxt (provider#as_css_provider) + method remove_provider (provider: css_provider) = + StyleContext.remove_provider ctxt provider#as_css_provider + method add_class cls = StyleContext.add_class ctxt cls + method remove_class cls = StyleContext.remove_class ctxt cls + method has_class cls = StyleContext.has_class ctxt cls + method list_classes = StyleContext.list_classes ctxt end class selection_input (sel : Gtk.selection_data) = object @@ -257,7 +264,7 @@ end method selection_received ~callback = self#connect Signals.selection_received - ~callback:(fun data -> callback (new selection_data data)) + ~callback:(fun data -> callback (new selection_data data)) end and misc_ops obj = object (self) @@ -298,7 +305,7 @@ method set_size_request = Widget.size_params [] ~cont:(fun p () -> set_params obj p) method set_size_chars ?desc ?lang ?width ?height () = - let metrics = + let metrics = (self#pango_context : GPango.context)#get_metrics ?desc ?lang () in let width = may_map width ~f: (fun w -> w * GPango.to_pixels metrics#approx_digit_width) @@ -333,6 +340,8 @@ may_map (fun w -> new widget (unsafe_cast w)) (get P.parent obj) method allocation = Widget.allocation obj method pango_context = new GPango.context (Widget.get_pango_context obj) + method allocated_width = Widget.get_allocated_width obj + method allocated_height = Widget.get_allocated_height obj (* icon *) method render_icon ~size id = Widget.render_icon obj (GtkStock.convert_id id) size diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-lablgtk3-3.1.3/src/gObj.mli new/ocaml-lablgtk3-3.1.5/src/gObj.mli --- old/ocaml-lablgtk3-3.1.3/src/gObj.mli 2022-10-06 09:24:16.000000000 +0200 +++ new/ocaml-lablgtk3-3.1.5/src/gObj.mli 2024-06-10 05:22:38.000000000 +0200 @@ -172,7 +172,13 @@ class style_context: Gtk.style_context -> object val ctxt : Gtk.style_context + method as_style_context : Gtk.style_context method add_provider: css_provider -> int -> unit + method remove_provider : css_provider -> unit + method add_class : string -> unit + method remove_class : string -> unit + method has_class : string -> bool + method list_classes : string list end (** @gtkdoc gtk gtk-Selections *) @@ -228,6 +234,8 @@ method add_selection_target : target:string -> ?info:int -> Gdk.atom -> unit method allocation : rectangle + method allocated_width : int + method allocated_height : int method clear_selection_targets : Gdk.atom -> unit method connect : misc_signals method convert_selection : target:string -> ?time:int32 -> Gdk.atom -> bool @@ -410,7 +418,7 @@ val context : Gdk.drag_context method context : Gdk.drag_context method finish : success:bool -> del:bool -> time:int32 -> unit - method source_widget : widget + method source_widget : widget method set_icon_widget : widget -> hot_x:int -> hot_y:int -> unit method status : ?time:int32 -> Gdk.Tags.drag_action option -> unit method suggested_action : Gdk.Tags.drag_action diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-lablgtk3-3.1.3/src/gPango.mli new/ocaml-lablgtk3-3.1.5/src/gPango.mli --- old/ocaml-lablgtk3-3.1.3/src/gPango.mli 2022-10-06 09:24:16.000000000 +0200 +++ new/ocaml-lablgtk3-3.1.5/src/gPango.mli 2024-06-10 05:22:38.000000000 +0200 @@ -43,7 +43,9 @@ ?style:Pango.Tags.style -> ?variant:Pango.Tags.variant -> ?weight:Pango.Tags.weight -> - ?stretch:Pango.Tags.stretch -> ?size:int -> unit -> unit + ?stretch:Pango.Tags.stretch -> + ?size:int -> + ?absolute_size:float -> unit -> unit method size : int method stretch : Pango.Tags.stretch method style : Pango.Tags.style diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-lablgtk3-3.1.3/src/gWindow.ml new/ocaml-lablgtk3-3.1.5/src/gWindow.ml --- old/ocaml-lablgtk3-3.1.3/src/gWindow.ml 2022-10-06 09:24:16.000000000 +0200 +++ new/ocaml-lablgtk3-3.1.5/src/gWindow.ml 2024-06-10 05:22:38.000000000 +0200 @@ -64,6 +64,8 @@ method present () = Window.present obj method iconify () = Window.iconify obj method deiconify () = Window.deiconify obj + method get_size () = Window.get_size obj + end class window obj = object @@ -99,7 +101,7 @@ class ['a] dialog_signals (obj : [>Gtk.dialog] obj) ~decode = object (self) inherit container_signals_impl obj - method response ~(callback : 'a -> unit) = + method response ~(callback : 'a -> unit) = self#connect Dialog.S.response ~callback:(fun i -> callback (decode i)) method close = self#connect Dialog.S.close @@ -133,9 +135,9 @@ method response v = Dialog.response obj (self#encode v) method set_response_sensitive v s = Dialog.set_response_sensitive obj (self#encode v) s - method set_default_response v = + method set_default_response v = Dialog.set_default_response obj (self#encode v) - method run () = + method run () = let resp = Dialog.run obj in if resp = rnone then failwith "dialog destroyed" @@ -147,13 +149,13 @@ val mutable tbl = [rdelete, `DELETE_EVENT] val mutable id = 0 method private encode (v : 'a) = list_rassoc v tbl - method private decode r = - try - List.assoc r tbl - with Not_found -> - Format.eprintf + method private decode r = + try + List.assoc r tbl + with Not_found -> + Format.eprintf "Warning: unknown response id:%d in dialog. \ - Please report to lablgtk dev team.@." + Please report to lablgtk dev team.@." r; `DELETE_EVENT end @@ -190,7 +192,7 @@ method private encode = function `OTHER n -> n | #GtkEnums.response as v -> Dialog.std_response v - method private decode r = + method private decode r = try (Dialog.decode_response r : GtkEnums.response :> [>GtkEnums.response]) with Invalid_argument _ -> `OTHER r method connect : any_response dialog_signals = @@ -313,7 +315,7 @@ class ['a] file_chooser_dialog obj = object (self) inherit ['a] dialog_ext obj inherit GFile.chooser_impl - method connect : 'a file_chooser_dialog_signals = + method connect : 'a file_chooser_dialog_signals = new file_chooser_dialog_signals obj self#decode method add_select_button text v = tbl <- (raccept, v) :: tbl ; @@ -323,7 +325,7 @@ end let file_chooser_dialog ~action ?filename = - make_dialog + make_dialog [ Gobject.param GtkFile.FileChooser.P.action action ] ~create:(fun pl -> let w = GtkFile.FileChooser.dialog_create pl in diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-lablgtk3-3.1.3/src/gWindow.mli new/ocaml-lablgtk3-3.1.5/src/gWindow.mli --- old/ocaml-lablgtk3-3.1.3/src/gWindow.mli 2022-10-06 09:24:16.000000000 +0200 +++ new/ocaml-lablgtk3-3.1.5/src/gWindow.mli 2024-06-10 05:22:38.000000000 +0200 @@ -103,6 +103,7 @@ method type_hint : Gdk.Tags.window_type_hint method set_urgency_hint : bool -> unit (** since Gtk 2.8 *) method urgency_hint : bool (** since Gtk 2.8 *) + method get_size : unit -> int * int end @@ -283,7 +284,7 @@ (** {3 GtkAboutDialog} *) -(** @gtkdoc gtk GtkAboutDialog +(** @gtkdoc gtk GtkAboutDialog @since GTK 2.6 *) class about_dialog : ([> Gtk.about_dialog] as 'a) Gtk.obj -> @@ -326,12 +327,12 @@ end -(** Display information about an application. +(** Display information about an application. In GTK+ 2.6.x and 2.8.x, a default handler is already connected to the [response] signal. It simply hides the dialog. This is no longer the case since GTK+ 2.10.x though. - You could use it like this: + You could use it like this: {[let about_dialog = ref (fun () -> raise Not_found) let show_dialog () = try !about_dialog () @@ -340,8 +341,8 @@ about_dialog := dialog#present ; dialog#show () ]} - @gtkdoc gtk GtkAboutDialog - @since GTK 2.6 + @gtkdoc gtk GtkAboutDialog + @since GTK 2.6 *) val about_dialog : ?name:string -> @@ -389,7 +390,7 @@ (** @since GTK 2.4 @gtkdoc gtk GtkFileChooserDialog *) class ['a] file_chooser_dialog : - ([> Gtk.file_chooser|Gtk.dialog] as 'b) Gtk.obj -> + ([> Gtk.file_chooser|Gtk.dialog] as 'b) Gtk.obj -> object inherit ['a] dialog_ext inherit GFile.chooser @@ -438,7 +439,7 @@ method embedded : callback:(unit -> unit) -> GtkSignal.id end -(** Toplevel for embedding into other processes +(** Toplevel for embedding into other processes @gtkdoc gtk GtkPlug *) class plug : Gtk.plug obj -> object diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-lablgtk3-3.1.3/src/gdkEvent.ml new/ocaml-lablgtk3-3.1.5/src/gdkEvent.ml --- old/ocaml-lablgtk3-3.1.3/src/gdkEvent.ml 2022-10-06 09:24:16.000000000 +0200 +++ new/ocaml-lablgtk3-3.1.5/src/gdkEvent.ml 2024-06-10 05:22:38.000000000 +0200 @@ -121,6 +121,8 @@ external device : t -> device = "ml_GdkEventScroll_device" external x_root : t -> float = "ml_GdkEventScroll_x_root" external y_root : t -> float = "ml_GdkEventScroll_y_root" + external delta_x : t -> float = "ml_GdkEventScroll_delta_x" + external delta_y : t -> float = "ml_GdkEventScroll_delta_y" end module Key = struct diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-lablgtk3-3.1.3/src/gtkBase.ml new/ocaml-lablgtk3-3.1.5/src/gtkBase.ml --- old/ocaml-lablgtk3-3.1.3/src/gtkBase.ml 2022-10-06 09:24:16.000000000 +0200 +++ new/ocaml-lablgtk3-3.1.5/src/gtkBase.ml 2024-06-10 05:22:38.000000000 +0200 @@ -161,7 +161,12 @@ = "ml_gtk_widget_pop_colormap" external pop_visual : unit -> unit = "ml_gtk_widget_pop_visual" *) - + + external get_allocated_width : [>`widget] obj -> int + = "ml_gtk_widget_get_allocated_width" + external get_allocated_height : [>`widget] obj -> int + = "ml_gtk_widget_get_allocated_height" + (** @since GTK 2.12 *) module Tooltip = struct external get_markup : [>`widget] obj -> string @@ -338,7 +343,7 @@ module DnD = struct external dest_set : [>`widget] obj -> flags:dest_defaults list -> - targets:target_entry array -> actions:Gdk.Tags.drag_action list -> unit + targets:target_entry array -> actions:Gdk.Tags.drag_action list -> unit = "ml_gtk_drag_dest_set" external dest_unset : [>`widget] obj -> unit = "ml_gtk_drag_dest_unset" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-lablgtk3-3.1.3/src/gtkBin.props new/ocaml-lablgtk3-3.1.5/src/gtkBin.props --- old/ocaml-lablgtk3-3.1.3/src/gtkBin.props 2022-10-06 09:24:16.000000000 +0200 +++ new/ocaml-lablgtk3-3.1.5/src/gtkBin.props 2024-06-10 05:22:38.000000000 +0200 @@ -43,7 +43,10 @@ "yalign" gfloat : Read / Write } -class EventBox : Bin {} +class EventBox set wrap : Bin { + "above-child" gboolean : Read / Write + "visible-window" gboolean : Read / Write +} class Invisible : Bin { "screen" GdkScreen : Read / Write diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-lablgtk3-3.1.3/src/gtkData.ml new/ocaml-lablgtk3-3.1.5/src/gtkData.ml --- old/ocaml-lablgtk3-3.1.3/src/gtkData.ml 2022-10-06 09:24:16.000000000 +0200 +++ new/ocaml-lablgtk3-3.1.5/src/gtkData.ml 2024-06-10 05:22:38.000000000 +0200 @@ -167,9 +167,24 @@ let user : t = 800 end + external add_provider_for_screen : Gdk.screen -> css_provider -> ProviderPriority.t -> unit + = "ml_gtk_style_context_add_provider_for_screen" + external remove_provider_for_screen : Gdk.screen -> css_provider -> unit + = "ml_gtk_style_context_remove_provider_for_screen" + external reset_widgets : Gdk.screen -> unit + = "ml_gtk_style_context_reset_widgets" + (** Does not cascade!! *) external add_provider : style_context -> css_provider -> ProviderPriority.t -> unit = "ml_gtk_style_context_add_provider" - external add_provider_for_screen : Gdk.screen -> css_provider -> ProviderPriority.t -> unit - = "ml_gtk_style_context_add_provider_for_screen" + external remove_provider : style_context -> css_provider -> unit + = "ml_gtk_style_context_remove_provider" + external add_class : style_context -> string -> unit + = "ml_gtk_style_context_add_class" + external remove_class : style_context -> string -> unit + = "ml_gtk_style_context_remove_class" + external has_class : style_context -> string -> bool + = "ml_gtk_style_context_has_class" + external list_classes : style_context -> string list + = "ml_gtk_style_context_list_classes" end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-lablgtk3-3.1.3/src/gtkMisc.props new/ocaml-lablgtk3-3.1.5/src/gtkMisc.props --- old/ocaml-lablgtk3-3.1.3/src/gtkMisc.props 2022-10-06 09:24:16.000000000 +0200 +++ new/ocaml-lablgtk3-3.1.5/src/gtkMisc.props 2024-06-10 05:22:38.000000000 +0200 @@ -139,6 +139,7 @@ method push : "statusbar_context -> text:string -> statusbar_message" method pop : "statusbar_context -> unit" method remove : "statusbar_context -> statusbar_message -> unit" + method remove_all : "statusbar_context -> unit" signal text_popped : guint gchararray signal text_pushed : guint gchararray } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-lablgtk3-3.1.3/src/gtkWindow.ml new/ocaml-lablgtk3-3.1.5/src/gtkWindow.ml --- old/ocaml-lablgtk3-3.1.3/src/gtkWindow.ml 2022-10-06 09:24:16.000000000 +0200 +++ new/ocaml-lablgtk3-3.1.5/src/gtkWindow.ml 2024-06-10 05:22:38.000000000 +0200 @@ -70,6 +70,8 @@ = "ml_gtk_window_set_focus" external set_default : [>`window] obj -> [>`widget] obj -> unit = "ml_gtk_window_set_default" + external get_size : [>`window] obj -> int * int + = "ml_gtk_window_get_size" (* see gtk.props for others *) end @@ -79,7 +81,7 @@ = "ml_gtk_dialog_get_action_area" external vbox : [>`dialog] obj -> box obj = "ml_gtk_dialog_get_content_area" - external add_button : [>`dialog] obj -> string -> int -> unit + external add_button : [>`dialog] obj -> string -> int -> unit = "ml_gtk_dialog_add_button" external response : [>`dialog] obj -> int -> unit = "ml_gtk_dialog_response" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-lablgtk3-3.1.3/src/ml_gdk.c new/ocaml-lablgtk3-3.1.5/src/ml_gdk.c --- old/ocaml-lablgtk3-3.1.3/src/ml_gdk.c 2022-10-06 09:24:16.000000000 +0200 +++ new/ocaml-lablgtk3-3.1.5/src/ml_gdk.c 2024-06-10 05:22:38.000000000 +0200 @@ -548,6 +548,8 @@ Make_Extractor (GdkEventScroll, GdkEvent_arg(Scroll), device, Val_GdkDevice) Make_Extractor (GdkEventScroll, GdkEvent_arg(Scroll), x_root, copy_double) Make_Extractor (GdkEventScroll, GdkEvent_arg(Scroll), y_root, copy_double) +Make_Extractor (GdkEventScroll, GdkEvent_arg(Scroll), delta_x, copy_double) +Make_Extractor (GdkEventScroll, GdkEvent_arg(Scroll), delta_y, copy_double) Make_Extractor (GdkEventKey, GdkEvent_arg(Key), state, Val_int) Make_Extractor (GdkEventKey, GdkEvent_arg(Key), keyval, Val_int) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-lablgtk3-3.1.3/src/ml_glib.c new/ocaml-lablgtk3-3.1.5/src/ml_glib.c --- old/ocaml-lablgtk3-3.1.3/src/ml_glib.c 2022-10-06 09:24:16.000000000 +0200 +++ new/ocaml-lablgtk3-3.1.5/src/ml_glib.c 2024-06-10 05:22:38.000000000 +0200 @@ -25,6 +25,8 @@ #include <string.h> #include <locale.h> #ifdef _WIN32 +/* to kill a #warning: include winsock2.h before windows.h */ +#include <winsock2.h> #include "win32.h" #include <wtypes.h> #include <io.h> @@ -38,6 +40,11 @@ #include <caml/callback.h> #include <caml/threads.h> +#ifdef _WIN32 +/* for Socket_val */ +#include <caml/unixsupport.h> +#endif + #include "wrappers.h" #include "ml_glib.h" #include "glib_tags.h" @@ -330,13 +337,14 @@ #ifndef _WIN32 ML_1 (g_io_channel_unix_new, Int_val, Val_GIOChannel_noref) - #else CAMLprim value ml_g_io_channel_unix_new(value wh) { return Val_GIOChannel_noref - (g_io_channel_unix_new - (_open_osfhandle((long)*(HANDLE*)Data_custom_val(wh), O_BINARY))); + (Descr_kind_val(wh) == KIND_SOCKET ? + g_io_channel_win32_new_socket(Socket_val(wh)) : + g_io_channel_win32_new_fd + (_open_osfhandle((intptr_t)Handle_val(wh), O_BINARY))) ; } #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-lablgtk3-3.1.3/src/ml_gtk.c new/ocaml-lablgtk3-3.1.5/src/ml_gtk.c --- old/ocaml-lablgtk3-3.1.3/src/ml_gtk.c 2022-10-06 09:24:16.000000000 +0200 +++ new/ocaml-lablgtk3-3.1.5/src/ml_gtk.c 2024-06-10 05:22:38.000000000 +0200 @@ -72,7 +72,7 @@ GType t = gtk_message_dialog_get_type() + gtk_color_selection_dialog_get_type() + - gtk_font_selection_dialog_get_type() + gtk_font_selection_dialog_get_type() #if !defined(GDK_WINDOWING_WIN32) && !defined(GDK_WINDOWING_QUARTZ) + gtk_plug_get_type() + gtk_socket_get_type() @@ -222,8 +222,18 @@ if (err) ml_raise_gerror(err); return Val_unit; } -ML_3 (gtk_style_context_add_provider, GtkStyleContext_val, GtkStyleProvider_val, Int_val, Unit) + ML_3 (gtk_style_context_add_provider_for_screen, GdkScreen_val, GtkStyleProvider_val, Int_val, Unit) +ML_2 (gtk_style_context_remove_provider_for_screen, GdkScreen_val, GtkStyleProvider_val, Unit) +ML_1 (gtk_style_context_reset_widgets, GdkScreen_val, Unit) + +ML_3 (gtk_style_context_add_provider, GtkStyleContext_val, GtkStyleProvider_val, Int_val, Unit) +ML_2 (gtk_style_context_remove_provider, GtkStyleContext_val, GtkStyleProvider_val, Unit) +ML_2 (gtk_style_context_add_class, GtkStyleContext_val, String_val, Unit) +ML_2 (gtk_style_context_remove_class, GtkStyleContext_val, String_val, Unit) +ML_2 (gtk_style_context_has_class, GtkStyleContext_val, String_val, Val_bool) +CAMLprim value ml_gtk_style_context_list_classes(value ctx) +{ return Val_GList(gtk_style_context_list_classes(GtkStyleContext_val(ctx)), (value_in)Val_string); } /* gtkdata.h */ @@ -349,7 +359,7 @@ ML_4 (gtk_widget_remove_accelerator, GtkWidget_val, GtkAccelGroup_val, Char_val, OptFlags_GdkModifier_val, Unit) -ML_3 (gtk_widget_set_accel_path, +ML_3 (gtk_widget_set_accel_path, GtkWidget_val, String_val, GtkAccelGroup_val, Unit) /* deprecated since 2.0 (?) ML_1 (gtk_widget_lock_accelerators, GtkWidget_val, Unit) @@ -411,6 +421,9 @@ CAMLreturn (ret); } +ML_1 (gtk_widget_get_allocated_width, GtkWidget_val, Val_int) +ML_1 (gtk_widget_get_allocated_height, GtkWidget_val, Val_int) + #ifdef HASGTK212 ML_1 (gtk_widget_get_tooltip_markup, GtkWidget_val, Val_string) ML_2 (gtk_widget_set_tooltip_markup, GtkWidget_val, String_val, Unit) @@ -439,7 +452,7 @@ { GtkTargetEntry *targets = (GtkTargetEntry *)NULL; int n_targets, i; - + CAMLparam4 (w,f,t,a); n_targets = Wosize_val(t); if (n_targets) @@ -479,7 +492,7 @@ GtkTargetEntry *targets = (GtkTargetEntry *)Val_unit; int n_targets, i; CAMLparam4 (w,m,t,a); - + n_targets = Wosize_val(t); if (n_targets) targets = (GtkTargetEntry *) @@ -734,13 +747,13 @@ ML_1 (gtk_window_activate_focus, GtkWindow_val, Val_bool) ML_1 (gtk_window_activate_default, GtkWindow_val, Val_bool) CAMLprim value ml_gtk_window_set_geometry_hints ( - value win, value pos, value min_size, value max_size, value base_size, + value win, value pos, value min_size, value max_size, value base_size, value aspect, value resize_inc, value win_gravity, value user_pos, value user_size, value wid ) { GdkWindowHints hints = 0; GdkGeometry geom; - + if (pos != Val_unit && Field(pos,0) != Val_unit) hints |= GDK_HINT_POS; if (min_size != Val_unit) { hints |= GDK_HINT_MIN_SIZE; @@ -816,6 +829,18 @@ ML_2 (gtk_window_set_role, GtkWindow_val, String_val, Unit) ML_1 (gtk_window_get_role, GtkWindow_val, Val_optstring) +CAMLprim value ml_gtk_window_get_size(value window) +{ + CAMLparam0(); + CAMLlocal1(res) ; + res = alloc_tuple(2) ; + int w, h ; + gtk_window_get_size (GtkWindow_val(window), &w, &h); + Store_field(res, 0, Val_int(w)); + Store_field(res, 1, Val_int(h)); + CAMLreturn(res); +} + /* gtkmessagedialog.h */ #define GtkMessageDialog_val(v) check_cast(GTK_MESSAGE_DIALOG,v) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-lablgtk3-3.1.3/src/ml_gtkmisc.c new/ocaml-lablgtk3-3.1.5/src/ml_gtkmisc.c --- old/ocaml-lablgtk3-3.1.3/src/ml_gtkmisc.c 2022-10-06 09:24:16.000000000 +0200 +++ new/ocaml-lablgtk3-3.1.5/src/ml_gtkmisc.c 2024-06-10 05:22:38.000000000 +0200 @@ -67,6 +67,7 @@ ML_3 (gtk_statusbar_push, GtkStatusbar_val, Int_val, String_val, Val_int) ML_2 (gtk_statusbar_pop, GtkStatusbar_val, Int_val, Unit) ML_3 (gtk_statusbar_remove, GtkStatusbar_val, Int_val, Int_val, Unit) +ML_2 (gtk_statusbar_remove_all, GtkStatusbar_val, Int_val, Unit) /* not in 3 ML_1 (gtk_statusbar_get_has_resize_grip, GtkStatusbar_val, Val_bool) ML_2 (gtk_statusbar_set_has_resize_grip, GtkStatusbar_val, Bool_val, Unit) */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-lablgtk3-3.1.3/src/ml_gtktext.c new/ocaml-lablgtk3-3.1.5/src/ml_gtktext.c --- old/ocaml-lablgtk3-3.1.3/src/ml_gtktext.c 2022-10-06 09:24:16.000000000 +0200 +++ new/ocaml-lablgtk3-3.1.5/src/ml_gtktext.c 2024-06-10 05:22:38.000000000 +0200 @@ -366,7 +366,7 @@ { CAMLparam3(tb,l,c); GtkTextIter res; - gtk_text_buffer_get_iter_at_line_offset(GtkTextBuffer_val(tb), + gtk_text_buffer_get_iter_at_line_index(GtkTextBuffer_val(tb), &res, Int_val(l), Int_val(c)); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-lablgtk3-3.1.3/src/ml_pango.c new/ocaml-lablgtk3-3.1.5/src/ml_pango.c --- old/ocaml-lablgtk3-3.1.3/src/ml_pango.c 2022-10-06 09:24:16.000000000 +0200 +++ new/ocaml-lablgtk3-3.1.5/src/ml_pango.c 2024-06-10 05:22:38.000000000 +0200 @@ -88,6 +88,9 @@ Int_val, Unit) ML_1(pango_font_description_get_size, PangoFontDescription_val, Val_int) +ML_2(pango_font_description_set_absolute_size, PangoFontDescription_val, + Double_val, Unit) +ML_1(pango_font_description_get_size_is_absolute,PangoFontDescription_val, Val_bool) /* PangoFontMetrics */ @@ -126,7 +129,7 @@ /* This one uses the generated MLTAG but not the conversion functions because we have defined float values */ -CAMLprim value ml_Pango_scale_val (value val) +CAMLprim value ml_Pango_scale_val (value val) { double r; if (Is_block(val)) return Field(val,1); /* `CUSTOM */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-lablgtk3-3.1.3/src/pango.ml new/ocaml-lablgtk3-3.1.5/src/pango.ml --- old/ocaml-lablgtk3-3.1.3/src/pango.ml 2022-10-06 09:24:16.000000000 +0200 +++ new/ocaml-lablgtk3-3.1.5/src/pango.ml 2024-06-10 05:22:38.000000000 +0200 @@ -48,15 +48,15 @@ type variant = [ `NORMAL | `SMALL_CAPS ] - + type stretch = - [ `ULTRA_CONDENSED | `EXTRA_CONDENSED - | `CONDENSED | `SEMI_CONDENSED + [ `ULTRA_CONDENSED | `EXTRA_CONDENSED + | `CONDENSED | `SEMI_CONDENSED | `NORMAL | `SEMI_EXPANDED | `EXPANDED | `EXTRA_EXPANDED | `ULTRA_EXPANDED ] type scale = - [ `XX_SMALL | `X_SMALL | `SMALL | `MEDIUM + [ `XX_SMALL | `X_SMALL | `SMALL | `MEDIUM | `LARGE | `X_LARGE | `XX_LARGE | `CUSTOM of float ] external scale_to_float : scale -> float = "ml_Pango_scale_val" @@ -82,18 +82,18 @@ ellipsize_mode = _get_tables () let weight_to_int (w : weight) = - match w with - | `CUSTOM b -> b + match w with + | `CUSTOM b -> b | #weight_internal as w -> encode_variant weight w end module Font = struct open Tags - external from_string : string -> font_description = + external from_string : string -> font_description = "ml_pango_font_description_from_string" - external to_string : font_description -> string = + external to_string : font_description -> string = "ml_pango_font_description_to_string" - external copy : font_description -> font_description = + external copy : font_description -> font_description = "ml_pango_font_description_copy" external set_family : font_description -> string -> unit = "ml_pango_font_description_set_family" @@ -120,14 +120,20 @@ "ml_pango_font_description_set_size" external get_size : font_description -> int = "ml_pango_font_description_get_size" - let modify fd ?family ?style ?variant ?weight ?stretch ?size () = + external set_absolute_size : font_description -> float -> unit = + "ml_pango_font_description_set_absolute_size" + external get_size_is_absolute : font_description -> bool = + "ml_pango_font_description_get_size_is_absolute" + + let modify fd ?family ?style ?variant ?weight ?stretch ?size ?absolute_size () = let may_set set_x x = may x ~f:(set_x fd) in may_set set_family family; may_set set_style style; may_set set_stretch stretch; may_set set_variant variant; may_set set_weight weight; - may_set set_size size + may_set set_size size; + may_set set_absolute_size absolute_size external get_metrics : font -> language -> font_metrics = "ml_pango_font_get_metrics" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-lablgtk3-3.1.3/src-rsvg2/dune new/ocaml-lablgtk3-3.1.5/src-rsvg2/dune --- old/ocaml-lablgtk3-3.1.3/src-rsvg2/dune 1970-01-01 01:00:00.000000000 +0100 +++ new/ocaml-lablgtk3-3.1.5/src-rsvg2/dune 2024-06-10 05:22:38.000000000 +0200 @@ -0,0 +1,29 @@ +; Dune build file for lablgtk3 +; Written by EJGA, (c) 2018-2019 MINES ParisTech +; This file is in the public domain + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; lablgtk3-rsvg2 ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(rule + (targets + cflag-librsvg-2.0.sexp + clink-librsvg-2.0.sexp) + (action (run dune_config -pkg librsvg-2.0 -version 2.40))) + +(rule + (targets cflag-extraflags.sexp) + (action (with-outputs-to cflag-extraflags.sexp (echo "(%{env:LABLGTK_EXTRA_FLAGS=})")))) + +(library + (name lablgtk3_rsvg2) + (public_name lablgtk3-rsvg2) + (wrapped false) + (flags :standard -w -6-7-27-32-33-34-36) +; (modules_without_implementation librsvg2_types) + (c_names ml_rsvg2) + (c_flags (:include cflag-librsvg-2.0.sexp) (:include cflag-extraflags.sexp) -Wno-deprecated-declarations) + (c_library_flags (:include clink-librsvg-2.0.sexp)) + (libraries lablgtk3)) + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-lablgtk3-3.1.3/src-rsvg2/ml_rsvg2.c new/ocaml-lablgtk3-3.1.5/src-rsvg2/ml_rsvg2.c --- old/ocaml-lablgtk3-3.1.3/src-rsvg2/ml_rsvg2.c 1970-01-01 01:00:00.000000000 +0100 +++ new/ocaml-lablgtk3-3.1.5/src-rsvg2/ml_rsvg2.c 2024-06-10 05:22:38.000000000 +0200 @@ -0,0 +1,106 @@ +/**************************************************************************/ +/* Lablgtk */ +/* */ +/* This program is free software; you can redistribute it */ +/* and/or modify it under the terms of the GNU Library General */ +/* Public License as published by the Free Software Foundation */ +/* version 2, with the exception described in file COPYING which */ +/* comes with the library. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU Library General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU Library General */ +/* Public License along with this program; if not, write to the */ +/* Free Software Foundation, Inc., 59 Temple Place, Suite 330, */ +/* Boston, MA 02111-1307 USA */ +/* */ +/* */ +/**************************************************************************/ + +/* $Id$ */ +/* Author: Olivier Andrieu */ + +#include <gdk-pixbuf/gdk-pixbuf.h> +#include <librsvg/rsvg.h> +#include <caml/mlvalues.h> +#include <caml/alloc.h> +#include <caml/memory.h> +#include <caml/callback.h> +#include <caml/fail.h> + +#include "wrappers.h" +#include "ml_gdkpixbuf.h" +#include "ml_gobject.h" +#include "ml_glib.h" + +static +void ml_rsvg_size_callback(gint *w, gint *h, gpointer user_data) +{ + value *cb = user_data; + value r; + r = callback2_exn(*cb, Val_int(*w), Val_int(*h)); + if(Is_exception_result(r)) return; + *w = Int_val(Field(r, 0)); + *h = Int_val(Field(r, 1)); +} + +ML_0(rsvg_handle_new, Val_pointer) + +#define RsvgHandle_val(val) ((RsvgHandle *)Pointer_val(val)) + +CAMLprim value ml_rsvg_handle_set_size_callback(value vh, value cb) +{ + RsvgHandle *h = RsvgHandle_val(vh); + value *u_data = ml_global_root_new(cb); + rsvg_handle_set_size_callback(h, ml_rsvg_size_callback, u_data, ml_global_root_destroy); + return Val_unit; +} + +ML_1(rsvg_handle_free, RsvgHandle_val, Unit) + +CAMLprim value ml_rsvg_handle_close(value h) +{ + GError *err = NULL; + rsvg_handle_close(RsvgHandle_val(h), &err); + if (err != NULL) + ml_raise_gerror (err); + return Val_unit; +} + +static inline +void check_substring(value s, value o, value l) +{ + if(Int_val(o) < 0 || Int_val(l) < 0 || + Int_val(o) + Int_val(l) > string_length(s)) + invalid_argument("bad substring"); +} + +CAMLprim value ml_rsvg_handle_write(value h, value s, value off, value len) +{ + GError *err = NULL; + check_substring(s, off, len); + rsvg_handle_write(RsvgHandle_val(h), + (guchar *) String_val(s)+Int_val(off), Int_val(len), &err); + if (err != NULL) + ml_raise_gerror (err); + return Val_unit; +} + +ML_1(rsvg_handle_get_pixbuf, RsvgHandle_val, Val_GdkPixbuf_new) + +#if (LIBRSVG_MAJOR_VERSION == 2) && (LIBRSVG_MINOR_VERSION >= 2) +ML_2(rsvg_handle_set_dpi, RsvgHandle_val, Double_val, Unit) +ML_1(rsvg_set_default_dpi, Double_val, Unit) +#else +Unsupported(rsvg_handle_set_dpi) +Unsupported(rsvg_set_default_dpi) +#endif + +CAMLprim value ml_rsvg_init (value unit) +{ + ml_register_exn_map(RSVG_ERROR, "ml_rsvg_exn"); + return Val_unit; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-lablgtk3-3.1.3/src-rsvg2/rsvg2.ml new/ocaml-lablgtk3-3.1.5/src-rsvg2/rsvg2.ml --- old/ocaml-lablgtk3-3.1.3/src-rsvg2/rsvg2.ml 1970-01-01 01:00:00.000000000 +0100 +++ new/ocaml-lablgtk3-3.1.5/src-rsvg2/rsvg2.ml 2024-06-10 05:22:38.000000000 +0200 @@ -0,0 +1,125 @@ +(**************************************************************************) +(* Lablgtk *) +(* *) +(* This program is free software; you can redistribute it *) +(* and/or modify it under the terms of the GNU Library General *) +(* Public License as published by the Free Software Foundation *) +(* version 2, with the exception described in file COPYING which *) +(* comes with the library. *) +(* *) +(* This program is distributed in the hope that it will be useful, *) +(* but WITHOUT ANY WARRANTY; without even the implied warranty of *) +(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) +(* GNU Library General Public License for more details. *) +(* *) +(* You should have received a copy of the GNU Library General *) +(* Public License along with this program; if not, write to the *) +(* Free Software Foundation, Inc., 59 Temple Place, Suite 330, *) +(* Boston, MA 02111-1307 USA *) +(* *) +(* *) +(**************************************************************************) + +(* $Id$ *) + +type size_fun = int -> int -> int * int + +let round f = + int_of_float (if f < 0. then f -. 0.5 else f +. 0.5) + +let at_size rw rh w h = + (if rw < 0 then w else rw), (if rh < 0 then h else rh) +let at_zoom zx zy w h = + if w < 0 || h < 0 + then (w, h) + else + (round (float w *. zx)), (round (float h *. zy)) +let at_max_size mw mh w h = + if w < 0 || h < 0 + then (w, h) + else + let zx = float mw /. float w in + let zy = float mh /. float h in + let z = min zx zy in + (round (float w *. z)), (round (float h *. z)) + +let at_zoom_with_max zx zy mw mh w h = + if w < 0 || h < 0 + then (w, h) + else + let rw = round (float w *. zx) in + let rh = round (float h *. zy) in + if rw > mw || rh > mh + then + let zx = float mw /. float w in + let zy = float mh /. float h in + let z = min zx zy in + (round (float w *. z)), (round (float h *. z)) + else + (rw, rh) + +type error = Failed +exception Error of error * string +external _init : unit -> unit = "ml_rsvg_init" +let _ = + Callback.register_exception "ml_rsvg_exn" (Error (Failed, "")) ; + _init () + +type t +external new_handle : unit -> t + = "ml_rsvg_handle_new" +external set_size_callback : t -> size_fun -> unit + = "ml_rsvg_handle_set_size_callback" +external free_handle : t -> unit + = "ml_rsvg_handle_free" +external close : t -> unit = "ml_rsvg_handle_close" +external write : t -> string -> off:int -> len:int -> unit = "ml_rsvg_handle_write" +external get_pixbuf : t -> GdkPixbuf.pixbuf = "ml_rsvg_handle_get_pixbuf" +external set_dpi : t -> float -> unit = "ml_rsvg_handle_set_dpi" +external set_default_dpi : float -> unit = "ml_rsvg_set_default_dpi" + +type input = + | Rsvg_SubString of string * int * int + | Rsvg_Buffer of int * (bytes -> int) + +let render ?dpi ?size_cb input = + let h = new_handle () in + Gaux.may (set_size_callback h) size_cb ; + Gaux.may (set_dpi h) dpi ; + try + begin match input with + | Rsvg_SubString (s, off, len) -> + write h s ~off ~len + | Rsvg_Buffer (len, fill) -> + let buff = Bytes.create len in + let c = ref (fill buff) in + while !c > 0 do + write h (Bytes.unsafe_to_string buff) 0 !c ; + c := fill buff + done + end ; + close h ; + let pb = get_pixbuf h in + free_handle h ; + pb + with exn -> + free_handle h ; raise exn + +let render_from_string ?dpi ?size_cb ?pos ?len s = + let off = Gaux.default 0 ~opt:pos in + let len = Gaux.default (String.length s - off) ~opt:len in + render ?dpi ?size_cb + (Rsvg_SubString (s, off, len)) + +let render_from_file ?dpi ?size_cb fname = + let ic = open_in fname in + let pb = + try + render ?dpi ?size_cb + (Rsvg_Buffer (4096, (fun b -> input ic b 0 (Bytes.length b)))) + with exn -> + close_in ic ; raise exn + in + close_in ic ; + pb + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-lablgtk3-3.1.3/src-rsvg2/rsvg2.mli new/ocaml-lablgtk3-3.1.5/src-rsvg2/rsvg2.mli --- old/ocaml-lablgtk3-3.1.3/src-rsvg2/rsvg2.mli 1970-01-01 01:00:00.000000000 +0100 +++ new/ocaml-lablgtk3-3.1.5/src-rsvg2/rsvg2.mli 2024-06-10 05:22:38.000000000 +0200 @@ -0,0 +1,50 @@ +(**************************************************************************) +(* Lablgtk *) +(* *) +(* This program is free software; you can redistribute it *) +(* and/or modify it under the terms of the GNU Library General *) +(* Public License as published by the Free Software Foundation *) +(* version 2, with the exception described in file COPYING which *) +(* comes with the library. *) +(* *) +(* This program is distributed in the hope that it will be useful, *) +(* but WITHOUT ANY WARRANTY; without even the implied warranty of *) +(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) +(* GNU Library General Public License for more details. *) +(* *) +(* You should have received a copy of the GNU Library General *) +(* Public License along with this program; if not, write to the *) +(* Free Software Foundation, Inc., 59 Temple Place, Suite 330, *) +(* Boston, MA 02111-1307 USA *) +(* *) +(* *) +(**************************************************************************) + +(** librsvg bindings *) + +type size_fun = int -> int -> int * int + +val at_size : int -> int -> size_fun +val at_zoom : float -> float -> size_fun +val at_max_size : int -> int -> size_fun +val at_zoom_with_max : float -> float -> int -> int -> size_fun + +val set_default_dpi : float -> unit + +type error = Failed +exception Error of error * string + +(** @raise Error if an error occurs loading data. + @raise Sys_error if an error occurs while reading from the channel. *) +val render_from_string : + ?dpi:float -> + ?size_cb:size_fun -> + ?pos:int -> ?len:int -> + string -> GdkPixbuf.pixbuf + +(** @raise Error if an error occurs loading data. +* @raise Sys_error if an error occurs while reading from the file. *) +val render_from_file : + ?dpi:float -> + ?size_cb:size_fun -> + string -> GdkPixbuf.pixbuf diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-lablgtk3-3.1.3/tools/dune new/ocaml-lablgtk3-3.1.5/tools/dune --- old/ocaml-lablgtk3-3.1.3/tools/dune 2022-10-06 09:24:16.000000000 +0200 +++ new/ocaml-lablgtk3-3.1.5/tools/dune 2024-06-10 05:22:38.000000000 +0200 @@ -8,13 +8,13 @@ (targets varcc.ml) (deps (:source varcc.ml4)) (mode promote) - (action (bash "camlp5o pr_o.cmo -impl %{source} -o %{targets}"))) + (action (bash "camlp5o o_keywords.cmo pr_o.cmo -impl %{source} -o %{targets}"))) (rule (targets propcc.ml) (deps (:source propcc.ml4)) (mode promote) - (action (bash "camlp5o pr_o.cmo -impl %{source} -o %{targets}"))) + (action (bash "camlp5o o_keywords.cmo pr_o.cmo -impl %{source} -o %{targets}"))) (executables (names varcc propcc) ++++++ ocaml-lablgtk3.patch ++++++ --- a/tools/propcc.ml4 +++ b/tools/propcc.ml4 @@ -289,7 +289,7 @@ let ooutfile = ref "" let process_file f = - let base = Filename.chop_extension f in + let base = Filename.chop_extension (Filename.basename f) in (* #195 *) let baseM = String.capitalize_ascii base in prefix := baseM; (* Input *)
