diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2023-09-21 11:21:11 -0700 |
---|---|---|
committer | Eli Schwartz <eschwartz93@gmail.com> | 2023-10-09 17:33:48 -0400 |
commit | cbca1919481902efbd5dadda3cc80db84fd75f0c (patch) | |
tree | 706d343996e1f76481171e7457ed28752552616c /manual tests | |
parent | 8490eaa29dd9b5a7fd36bf9c2f871008139ede7a (diff) | |
download | meson-cbca1919481902efbd5dadda3cc80db84fd75f0c.zip meson-cbca1919481902efbd5dadda3cc80db84fd75f0c.tar.gz meson-cbca1919481902efbd5dadda3cc80db84fd75f0c.tar.bz2 |
interpreter: Handle BuildTarget.vala_args as Files in the interpreter
Way back in Meson 0.25, support was added to `vala_args` for Files.
Strangely, this was never added to any other language, though it's been
discussed before. For type safety, it makes more sense to handle this in
the interpreter level, and pass only strings into the build IR.
This is accomplished by adding a `depend_files` field to the
`BuildTarget` class (which is not exposed to the user), and adding the
depend files into that field, while converting the arguments to relative
string paths. This ensures both the proper build dependencies happen, as
well as that the arguments are always strings.
Diffstat (limited to 'manual tests')
4 files changed, 0 insertions, 138 deletions
diff --git a/manual tests/7 vala composite widgets/meson.build b/manual tests/7 vala composite widgets/meson.build deleted file mode 100644 index 579ca51..0000000 --- a/manual tests/7 vala composite widgets/meson.build +++ /dev/null @@ -1,21 +0,0 @@ -project('composite', 'vala', 'c') -gnome = import('gnome') -deps = [ - dependency('glib-2.0', version : '>=2.38'), - dependency('gobject-2.0'), - dependency('gtk+-3.0'), -] -res = files('my-resources.xml') -gres = gnome.compile_resources( - 'my', res, - source_dir : '.', -) -executable( - 'demo', - sources : [ - 'mywidget.vala', - gres, - ], - dependencies : deps, - vala_args : ['--gresources', res], -) diff --git a/manual tests/7 vala composite widgets/my-resources.xml b/manual tests/7 vala composite widgets/my-resources.xml deleted file mode 100644 index b5743c1..0000000 --- a/manual tests/7 vala composite widgets/my-resources.xml +++ /dev/null @@ -1,6 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<gresources> - <gresource prefix="/org/foo/my"> - <file compressed="true" preprocess="xml-stripblanks">mywidget.ui</file> - </gresource> -</gresources> diff --git a/manual tests/7 vala composite widgets/mywidget.ui b/manual tests/7 vala composite widgets/mywidget.ui deleted file mode 100644 index 2d6286c..0000000 --- a/manual tests/7 vala composite widgets/mywidget.ui +++ /dev/null @@ -1,70 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<interface> - <!-- interface-requires gtk+ 3.8 --> - <template class="MyWidget" parent="GtkBox"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="orientation">vertical</property> - <property name="spacing">4</property> - <child> - <object class="GtkLabel" id="label1"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="halign">start</property> - <property name="valign">start</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">This widget is defined with composite GtkBuilder script</property> - <property name="wrap">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkEntry" id="entry"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="invisible_char">•</property> - <signal name="changed" handler="on_entry_changed" object="MyWidget" swapped="no"/> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="label2"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="halign">start</property> - <property name="valign">start</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">Press the button to fetch the internal entry text</property> - <property name="wrap">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">2</property> - </packing> - </child> - <child> - <object class="GtkButton" id="button"> - <property name="label" translatable="yes">The Button</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="halign">end</property> - <signal name="clicked" handler="on_button_clicked" swapped="no"/> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">3</property> - </packing> - </child> - </template> -</interface> diff --git a/manual tests/7 vala composite widgets/mywidget.vala b/manual tests/7 vala composite widgets/mywidget.vala deleted file mode 100644 index 68eaecc..0000000 --- a/manual tests/7 vala composite widgets/mywidget.vala +++ /dev/null @@ -1,41 +0,0 @@ -using Gtk; - -[GtkTemplate (ui = "/org/foo/my/mywidget.ui")] -public class MyWidget : Box { - public string text { - get { return entry.text; } - set { entry.text = value; } - } - - [GtkChild] - private Entry entry; - - public MyWidget (string text) { - this.text = text; - } - - [GtkCallback] - private void on_button_clicked (Button button) { - print ("The button was clicked with entry text: %s\n", entry.text); - } - - [GtkCallback] - private void on_entry_changed (Editable editable) { - print ("The entry text changed: %s\n", entry.text); - - notify_property ("text"); - } -} - -void main(string[] args) { - Gtk.init (ref args); - var win = new Window(); - win.destroy.connect (Gtk.main_quit); - - var widget = new MyWidget ("The entry text!"); - - win.add (widget); - win.show_all (); - - Gtk.main (); -} |