[vala/0.48] gtk4-unix-print: Switch to gir
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/0.48] gtk4-unix-print: Switch to gir
- Date: Thu, 18 Mar 2021 09:34:56 +0000 (UTC)
commit 3d6b7cbe2268f3008845e67796408661edf02039
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Mon Mar 15 16:02:29 2021 +0100
gtk4-unix-print: Switch to gir
Use a temporary symlink to Gtk-4.0.gir which includes the required
symbol defintions.
vapi/Makefile.am | 4 +-
vapi/gtk4-unix-print.vapi | 31 +-
vapi/metadata/GtkUnixPrint-4.0-custom.vala | 17 +
vapi/metadata/GtkUnixPrint-4.0.metadata | 12 +
.../gtk4-unix-print/gtk4-unix-print-custom.vala | 7 -
.../gtk4-unix-print/gtk4-unix-print.defines | 3 -
vapi/packages/gtk4-unix-print/gtk4-unix-print.deps | 2 -
.../gtk4-unix-print/gtk4-unix-print.excludes | 0
.../packages/gtk4-unix-print/gtk4-unix-print.files | 2 -
vapi/packages/gtk4-unix-print/gtk4-unix-print.gi | 639 ---------------------
.../gtk4-unix-print/gtk4-unix-print.metadata | 29 -
.../gtk4-unix-print/gtk4-unix-print.namespace | 1 -
12 files changed, 48 insertions(+), 699 deletions(-)
---
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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]