From: Rico Tzschichholz Date: Mon, 15 Mar 2021 15:02:29 +0000 (+0100) Subject: gtk4-unix-print: Switch to gir X-Git-Tag: 0.50.5~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa9ce43f437e35f61173146674eb2ba76f99781d;p=thirdparty%2Fvala.git gtk4-unix-print: Switch to gir Use a temporary symlink to Gtk-4.0.gir which includes the required symbol defintions. --- diff --git a/vapi/Makefile.am b/vapi/Makefile.am index 5127e65ec..854ba8642 100644 --- a/vapi/Makefile.am +++ b/vapi/Makefile.am @@ -599,7 +599,9 @@ gtk+-unix-print-3.0: $(GENVAPI) --library $(srcdir)/gtk+-unix-print-3.0 $(PACKAGESDIR)/gtk+-unix-print-3.0/gtk+-unix-print-3.0-custom.vala $(PACKAGESDIR)/gtk+-unix-print-3.0/gtk+-unix-print-3.0.gi gtk4-unix-print: - $(GENVAPI) --library $(srcdir)/gtk4-unix-print $(PACKAGESDIR)/gtk4-unix-print/gtk4-unix-print-custom.vala $(PACKAGESDIR)/gtk4-unix-print/gtk4-unix-print.gi + ln -s $(GIRDIR)/Gtk-4.0.gir GtkUnixPrint-4.0.gir; \ + $(GENVAPI) --library $(srcdir)/gtk4-unix-print --pkg gtk4 --pkg pangocairo --metadatadir $(METADATADIR) $(METADATADIR)/GtkUnixPrint-4.0-custom.vala GtkUnixPrint-4.0.gir; \ + rm -f GtkUnixPrint-4.0.gir gtksourceview-2.0: $(GENVAPI) --library $(srcdir)/gtksourceview-2.0 $(PACKAGESDIR)/gtksourceview-2.0/gtksourceview-2.0.gi diff --git a/vapi/gtk4-unix-print.vapi b/vapi/gtk4-unix-print.vapi index 38a742e01..6885b50ae 100644 --- a/vapi/gtk4-unix-print.vapi +++ b/vapi/gtk4-unix-print.vapi @@ -2,10 +2,10 @@ [CCode (cprefix = "Gtk", gir_namespace = "Gtk", gir_version = "4.0", lower_case_cprefix = "gtk_")] namespace Gtk { - [CCode (cheader_filename = "gtk/gtkunixprint.h")] - public class PageSetupUnixDialog : Gtk.Dialog, Gtk.Accessible, Gtk.Buildable, Gtk.ConstraintTarget, Gtk.Native, Gtk.ShortcutManager, Gtk.Root { + [CCode (cheader_filename = "gtk/gtkunixprint.h", type_id = "gtk_page_setup_unix_dialog_get_type ()")] + public class PageSetupUnixDialog : Gtk.Dialog, Gtk.Accessible, Gtk.Buildable, Gtk.ConstraintTarget, Gtk.Native, Gtk.Root, Gtk.ShortcutManager { [CCode (has_construct_function = false, type = "GtkWidget*")] - public PageSetupUnixDialog (string title, Gtk.Window parent); + public PageSetupUnixDialog (string? title, Gtk.Window? parent); public unowned Gtk.PageSetup get_page_setup (); public unowned Gtk.PrintSettings get_print_settings (); public void set_page_setup (Gtk.PageSetup page_setup); @@ -14,7 +14,7 @@ namespace Gtk { [CCode (cheader_filename = "gtk/gtkunixprint.h")] public abstract class PrintBackend : GLib.Object { } - [CCode (cheader_filename = "gtk/gtkunixprint.h")] + [CCode (cheader_filename = "gtk/gtkunixprint.h", type_id = "gtk_print_job_get_type ()")] public class PrintJob : GLib.Object { [CCode (has_construct_function = false)] public PrintJob (string title, Gtk.Printer printer, Gtk.PrintSettings settings, Gtk.PageSetup page_setup); @@ -22,6 +22,7 @@ namespace Gtk { public uint get_n_up (); public Gtk.NumberUpLayout get_n_up_layout (); public int get_num_copies (); + [CCode (array_length_pos = 0.1)] public unowned Gtk.PageRange[] get_page_ranges (); public Gtk.PageSet get_page_set (); public Gtk.PrintPages get_pages (); @@ -39,7 +40,7 @@ namespace Gtk { public void set_n_up (uint n_up); public void set_n_up_layout (Gtk.NumberUpLayout layout); public void set_num_copies (int num_copies); - public void set_page_ranges (Gtk.PageRange[] ranges); + public void set_page_ranges ([CCode (array_length_cname = "n_ranges", array_length_pos = 1.1)] owned Gtk.PageRange[] ranges); public void set_page_set (Gtk.PageSet page_set); public void set_pages (Gtk.PrintPages pages); public void set_reverse (bool reverse); @@ -54,12 +55,12 @@ namespace Gtk { public Gtk.PrintSettings settings { get; construct; } public string title { get; construct; } public bool track_print_status { get; set; } - public virtual signal void status_changed (); + public signal void status_changed (); } - [CCode (cheader_filename = "gtk/gtkunixprint.h")] - public class PrintUnixDialog : Gtk.Dialog, Gtk.Accessible, Gtk.Buildable, Gtk.ConstraintTarget, Gtk.Native, Gtk.ShortcutManager, Gtk.Root { + [CCode (cheader_filename = "gtk/gtkunixprint.h", type_id = "gtk_print_unix_dialog_get_type ()")] + public class PrintUnixDialog : Gtk.Dialog, Gtk.Accessible, Gtk.Buildable, Gtk.ConstraintTarget, Gtk.Native, Gtk.Root, Gtk.ShortcutManager { [CCode (has_construct_function = false, type = "GtkWidget*")] - public PrintUnixDialog (string title, Gtk.Window parent); + public PrintUnixDialog (string? title, Gtk.Window? parent); public void add_custom_tab (Gtk.Widget child, Gtk.Widget tab_label); public int get_current_page (); public bool get_embed_page_setup (); @@ -75,7 +76,7 @@ namespace Gtk { public void set_has_selection (bool has_selection); public void set_manual_capabilities (Gtk.PrintCapabilities capabilities); public void set_page_setup (Gtk.PageSetup page_setup); - public void set_settings (Gtk.PrintSettings settings); + public void set_settings (Gtk.PrintSettings? settings); public void set_support_selection (bool support_selection); public int current_page { get; set; } public bool embed_page_setup { get; set; } @@ -87,7 +88,7 @@ namespace Gtk { public Gtk.Printer selected_printer { get; } public bool support_selection { get; set; } } - [CCode (cheader_filename = "gtk/gtkunixprint.h")] + [CCode (cheader_filename = "gtk/gtkunixprint.h", type_id = "gtk_printer_get_type ()")] public class Printer : GLib.Object { [CCode (has_construct_function = false)] public Printer (string name, Gtk.PrintBackend backend, bool virtual_); @@ -132,9 +133,9 @@ namespace Gtk { [NoAccessorMethod] public bool paused { get; } public string state_message { get; } - public virtual signal void details_acquired (bool p0); + public signal void details_acquired (bool success); } - [CCode (cheader_filename = "gtk/gtkunixprint.h", cprefix = "GTK_PRINT_CAPABILITY_")] + [CCode (cheader_filename = "gtk/gtkunixprint.h", cprefix = "GTK_PRINT_CAPABILITY_", type_id = "gtk_print_capabilities_get_type ()")] [Flags] public enum PrintCapabilities { PAGE_SET, @@ -150,8 +151,8 @@ namespace Gtk { } [CCode (cheader_filename = "gtk/gtkunixprint.h", instance_pos = 1.9)] public delegate void PrintJobCompleteFunc (Gtk.PrintJob print_job) throws GLib.Error; - [CCode (cheader_filename = "gtk/gtkunixprint.h")] + [CCode (cheader_filename = "gtk/gtkunixprint.h", instance_pos = 1.9)] public delegate bool PrinterFunc (Gtk.Printer printer); [CCode (cheader_filename = "gtk/gtkunixprint.h")] - public static void enumerate_printers (owned Gtk.PrinterFunc func, bool wait); + public static void enumerate_printers ([CCode (delegate_target_pos = 1.33333, destroy_notify_pos = 1.66667)] owned Gtk.PrinterFunc func, bool wait); } diff --git a/vapi/metadata/GtkUnixPrint-4.0-custom.vala b/vapi/metadata/GtkUnixPrint-4.0-custom.vala new file mode 100644 index 000000000..88fb76f6b --- /dev/null +++ b/vapi/metadata/GtkUnixPrint-4.0-custom.vala @@ -0,0 +1,17 @@ +namespace Gtk { + [CCode (cheader_filename = "gtk/gtkunixprint.h")] + public class Printer : GLib.Object { + [CCode (cname = "gtk_printer_accepts_pdf")] + public bool get_accepts_pdf (); + [CCode (cname = "gtk_printer_accepts_ps")] + public bool get_accepts_ps (); + [CCode (cname = "gtk_printer_is_virtual")] + public bool get_is_virtual (); + public Gtk.PrintBackend backend { get; construct; } + } + [CCode (cheader_filename = "gtk/gtkunixprint.h")] + public abstract class PrintBackend : GLib.Object { + } + [CCode (cheader_filename = "gtk/gtkunixprint.h", instance_pos = 1.9)] + public delegate void PrintJobCompleteFunc (Gtk.PrintJob print_job) throws GLib.Error; +} diff --git a/vapi/metadata/GtkUnixPrint-4.0.metadata b/vapi/metadata/GtkUnixPrint-4.0.metadata new file mode 100644 index 000000000..c595b6bde --- /dev/null +++ b/vapi/metadata/GtkUnixPrint-4.0.metadata @@ -0,0 +1,12 @@ +* cheader_filename="gtk/gtkunixprint.h" +* skip + +PageSetupUnixDialog skip=false +Printer skip=false +PrinterFunc skip=false +//PrintBackend skip=false +PrintCapabilities skip=false +PrintJob skip=false +//PrintJobCompleteFunc skip=false +PrintUnixDialog skip=false +enumerate_printers skip=false diff --git a/vapi/packages/gtk4-unix-print/gtk4-unix-print-custom.vala b/vapi/packages/gtk4-unix-print/gtk4-unix-print-custom.vala deleted file mode 100644 index cab400660..000000000 --- a/vapi/packages/gtk4-unix-print/gtk4-unix-print-custom.vala +++ /dev/null @@ -1,7 +0,0 @@ -namespace Gtk { - [CCode (cheader_filename = "gtk/gtkunixprint.h")] - public abstract class PrintBackend : GLib.Object { - } - [CCode (cheader_filename = "gtk/gtkunixprint.h", instance_pos = 1.9)] - public delegate void PrintJobCompleteFunc (Gtk.PrintJob print_job) throws GLib.Error; -} diff --git a/vapi/packages/gtk4-unix-print/gtk4-unix-print.defines b/vapi/packages/gtk4-unix-print/gtk4-unix-print.defines deleted file mode 100644 index f73e1233e..000000000 --- a/vapi/packages/gtk4-unix-print/gtk4-unix-print.defines +++ /dev/null @@ -1,3 +0,0 @@ --DGTK_COMPILATION --DGSEAL_ENABLE --D__GNUC__ diff --git a/vapi/packages/gtk4-unix-print/gtk4-unix-print.deps b/vapi/packages/gtk4-unix-print/gtk4-unix-print.deps deleted file mode 100644 index 18af01f95..000000000 --- a/vapi/packages/gtk4-unix-print/gtk4-unix-print.deps +++ /dev/null @@ -1,2 +0,0 @@ -cairo -gtk4 diff --git a/vapi/packages/gtk4-unix-print/gtk4-unix-print.excludes b/vapi/packages/gtk4-unix-print/gtk4-unix-print.excludes deleted file mode 100644 index e69de29bb..000000000 diff --git a/vapi/packages/gtk4-unix-print/gtk4-unix-print.files b/vapi/packages/gtk4-unix-print/gtk4-unix-print.files deleted file mode 100644 index 0319925ca..000000000 --- a/vapi/packages/gtk4-unix-print/gtk4-unix-print.files +++ /dev/null @@ -1,2 +0,0 @@ -include/gtk-4.0/unix-print/gtk -lib/libgtk-4.so diff --git a/vapi/packages/gtk4-unix-print/gtk4-unix-print.gi b/vapi/packages/gtk4-unix-print/gtk4-unix-print.gi deleted file mode 100644 index 6cb638b9a..000000000 --- a/vapi/packages/gtk4-unix-print/gtk4-unix-print.gi +++ /dev/null @@ -1,639 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vapi/packages/gtk4-unix-print/gtk4-unix-print.metadata b/vapi/packages/gtk4-unix-print/gtk4-unix-print.metadata deleted file mode 100644 index 248829ff6..000000000 --- a/vapi/packages/gtk4-unix-print/gtk4-unix-print.metadata +++ /dev/null @@ -1,29 +0,0 @@ -Gtk cheader_filename="gtk/gtkunixprint.h" gir_namespace="Gtk" gir_version="4.0" cprefix="Gtk" lower_case_cprefix="gtk_" - -gtk_print_job_get_page_ranges is_array="1" -gtk_print_job_get_page_ranges.n_ranges hidden="1" -gtk_print_job_send.callback transfer_ownership="1" -gtk_print_job_send.dnotify hidden="1" -gtk_print_unix_dialog_get_settings transfer_ownership="1" -gtk_printer_accepts_pdf name="get_accepts_pdf" -gtk_printer_accepts_ps name="get_accepts_ps" -gtk_printer_get_default_page_size transfer_ownership="1" -gtk_printer_get_hard_margins.top is_out="1" -gtk_printer_get_hard_margins.bottom is_out="1" -gtk_printer_get_hard_margins.left is_out="1" -gtk_printer_get_hard_margins.right is_out="1" -gtk_printer_get_hard_margins_for_paper_size.top is_out="1" -gtk_printer_get_hard_margins_for_paper_size.bottom is_out="1" -gtk_printer_get_hard_margins_for_paper_size.left is_out="1" -gtk_printer_get_hard_margins_for_paper_size.right is_out="1" -gtk_printer_is_virtual name="get_is_virtual" -gtk_printer_list_papers transfer_ownership="1" type_name="GLib.List" -GtkPrintJobCompleteFunc hidden="1" -gtk_enumerate_printers.func transfer_ownership="1" -gtk_enumerate_printers.data hidden="1" -gtk_enumerate_printers.destroy hidden="1" - -*.dummy* hidden="1" -*_reserved* hidden="1" -*_gtk_recent* hidden="1" -*autoptr hidden="1" diff --git a/vapi/packages/gtk4-unix-print/gtk4-unix-print.namespace b/vapi/packages/gtk4-unix-print/gtk4-unix-print.namespace deleted file mode 100644 index 0be6e7e3d..000000000 --- a/vapi/packages/gtk4-unix-print/gtk4-unix-print.namespace +++ /dev/null @@ -1 +0,0 @@ -Gtk