Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vala: Adapt Vala demos to Meson #187

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ __pycache__
# Project files - sync with Makefile
src/*/settings
src/*/workbench.vala
src/*/meson.build
src/*/main.ui
src/*/libworkbenchcode.so
src/*/__pycache__
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ ci: setup test
clean:
rm -f src/*/settings
rm -f src/*/workbench.vala
rm -f src/*/meson.build
rm -f src/*/main.ui
rm -f src/*/libworkbenchcode.so
rm -f src/*/Cargo.toml
Expand Down
2 changes: 0 additions & 2 deletions src/About Dialog/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg gtk4 --pkg libadwaita-1

public void main () {
Gtk.init ();

Expand Down
2 changes: 0 additions & 2 deletions src/Accessibility/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg libadwaita-1

private Adw.Bin custom_button;

public void main () {
Expand Down
2 changes: 0 additions & 2 deletions src/Account/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg libadwaita-1 --pkg libportal-gtk4

private Gtk.Revealer revealer;
private Adw.EntryRow entry;
private Adw.Avatar avatar;
Expand Down
2 changes: 0 additions & 2 deletions src/Action Bar/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg libadwaita-1

public void main () {
var action_bar = (Gtk.ActionBar) workbench.builder.get_object ("action_bar");
var button = (Gtk.Button) workbench.builder.get_object ("button");
Expand Down
2 changes: 0 additions & 2 deletions src/Actions/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg libadwaita-1

public void main () {
var demo = (Adw.StatusPage) workbench.builder.get_object ("demo");

Expand Down
2 changes: 0 additions & 2 deletions src/Animation/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg libadwaita-1

private Adw.Bin ball;

public void main () {
Expand Down
2 changes: 0 additions & 2 deletions src/Audio/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg libadwaita-1

public void main () {
var controls = (Gtk.MediaControls) workbench.builder.get_object ("controls");

Expand Down
2 changes: 0 additions & 2 deletions src/Avatar/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg libadwaita-1

private Adw.Avatar avatar_image;
private Gtk.FileFilter file_filter;

Expand Down
2 changes: 0 additions & 2 deletions src/Banner/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg libadwaita-1

public void main () {
var banner = (Adw.Banner) workbench.builder.get_object ("banner");
var overlay = (Adw.ToastOverlay) workbench.builder.get_object ("overlay");
Expand Down
2 changes: 0 additions & 2 deletions src/Box/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg libadwaita-1

private Gtk.Box interactive_box;
private int count = 0;

Expand Down
2 changes: 0 additions & 2 deletions src/Breakpoints/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg libadwaita-1

public void main () {
var breakpoint = (Adw.Breakpoint) workbench.builder.get_object ("breakpoint");

Expand Down
2 changes: 0 additions & 2 deletions src/Button/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg gtk4 --pkg libadwaita-1

public void main () {
string[] button_ids = {
"regular",
Expand Down
2 changes: 0 additions & 2 deletions src/CSS Gradients/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg libadwaita-1 --pkg gtksourceview-5

private GtkSource.Buffer gtksource_buffer;
private Adw.ComboRow combo_row_gradient_type;
private Adw.SpinRow spin_row_angle;
Expand Down
2 changes: 0 additions & 2 deletions src/Calendar/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg libadwaita-1

public void main () {
var calendar = (Gtk.Calendar) workbench.builder.get_object ("calendar");
calendar.notify["day"].connect (() => {
Expand Down
2 changes: 0 additions & 2 deletions src/Carousel/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg gtk4 --pkg libadwaita-1

public void main() {
var root_box = workbench.builder.get_object("root_box") as Gtk.Box;
var carousel = workbench.builder.get_object("carousel") as Adw.Carousel;
Expand Down
2 changes: 0 additions & 2 deletions src/Checkboxes/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg libadwaita-1

public void main () {
var checkbox_1 = (Gtk.CheckButton) workbench.builder.get_object ("checkbox_1");
var checkbox_2 = (Gtk.CheckButton) workbench.builder.get_object ("checkbox_2");
Expand Down
2 changes: 0 additions & 2 deletions src/Clamp/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg libadwaita-1

private Gtk.Button button_increase;
private Gtk.Button button_decrease;
private Adw.Clamp clamp;
Expand Down
2 changes: 0 additions & 2 deletions src/Color Dialog/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg libadwaita-1

private Gtk.ColorDialogButton color_dialog_button;
private Gtk.Button custom_button;
private Gtk.ColorDialog dialog_custom;
Expand Down
2 changes: 0 additions & 2 deletions src/Color Picker/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg libadwaita-1 --pkg libportal-gtk4

private Xdp.Portal portal;
private Xdp.Parent parent;

Expand Down
2 changes: 0 additions & 2 deletions src/Column View/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg libadwaita-1

// Define our class for our custom model
public class Book : Object {
public string title { get; set; }
Expand Down
2 changes: 0 additions & 2 deletions src/Context Menu/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg gtk4 --pkg libadwaita-1

public void main() {
var box_menu_parent = (Gtk.Box) workbench.builder.get_object(
"box_menu_parent"
Expand Down
2 changes: 0 additions & 2 deletions src/Dialog/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg libadwaita-1 --pkg gio-2.0

public void main () {
var dialog = (Adw.Dialog) workbench.builder.get_object ("dialog");
var button = (Gtk.Button) workbench.builder.get_object ("button");
Expand Down
2 changes: 0 additions & 2 deletions src/Drag and Drop/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg gtk4 --pkg libadwaita-1

public void main() {
var list = workbench.builder.get_object("list") as Gtk.ListBox;
var drop_target = new Gtk.DropTarget(typeof (Adw.ActionRow), Gdk.DragAction.MOVE);
Expand Down
2 changes: 0 additions & 2 deletions src/Drawing Area/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg gtk4

double to_radians (double degrees) {
return degrees * (Math.PI / 180);
}
Expand Down
2 changes: 0 additions & 2 deletions src/Drop Down/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg gtk4 --pkg libadwaita-1 --pkg gio-2.0

using Gtk;
using GLib;

Expand Down
2 changes: 0 additions & 2 deletions src/Drop Zone/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg libadwaita-1

public void main () {
var bin = (Adw.Bin) workbench.builder.get_object ("bin");

Expand Down
2 changes: 0 additions & 2 deletions src/Email/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg libadwaita-1 --pkg libportal-gtk4

private Xdp.Portal portal;
private Xdp.Parent parent;
private Gtk.Entry entry;
Expand Down
2 changes: 0 additions & 2 deletions src/Emoji Chooser/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg gtk4

public void main () {
var emoji_chooser = (Gtk.EmojiChooser) workbench.builder.get_object ("emoji_chooser");
var button = (Gtk.MenuButton) workbench.builder.get_object ("button");
Expand Down
2 changes: 0 additions & 2 deletions src/Event Controllers/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg libadwaita-1

private bool ctrl_pressed = false;

public void main () {
Expand Down
2 changes: 0 additions & 2 deletions src/File Monitor/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg libadwaita-1 --pkg gio-2.0

private FileMonitor monitor_for_dir;
private FileMonitor monitor_for_file;
public void main () {
Expand Down
2 changes: 0 additions & 2 deletions src/Flow Box/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg libadwaita-1

private Gtk.FlowBox flowbox;

public void main () {
Expand Down
2 changes: 0 additions & 2 deletions src/Font Dialog/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg gtk4

async void on_clicked (Gtk.FontDialog dialog_custom) {
try {
Pango.FontFamily family = yield dialog_custom.choose_family (workbench.window, null, null);
Expand Down
2 changes: 0 additions & 2 deletions src/Frame/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg libadwaita-1

public void main () {

var pic_with_frame = (Gtk.Picture) workbench.builder.get_object ("with_frame");
Expand Down
2 changes: 0 additions & 2 deletions src/Grid View/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg libadwaita-1

private Gtk.GridView grid_view;
private Gtk.Button add;
private Gtk.Button remove_button;
Expand Down
2 changes: 0 additions & 2 deletions src/Grid/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg libadwaita-1

private int step_count = 1;

public void main () {
Expand Down
2 changes: 0 additions & 2 deletions src/HTTP Image/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg libadwaita-1 --pkg libsoup-3.0

public errordomain MessageError {
FAILED;
}
Expand Down
2 changes: 0 additions & 2 deletions src/HTTP Request/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg libadwaita-1 --pkg libsoup-3.0 --pkg json-glib-1.0

public errordomain FetchError {
FAILED_REQUEST,
FAILED_TO_PARSE
Expand Down
1 change: 0 additions & 1 deletion src/HTTP Server/main.vala
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg libadwaita-1 --pkg libsoup-3.0
private Gtk.Label label_greetings;
private Gtk.ToggleButton button_server;
private Gtk.LinkButton linkbutton;
Expand Down
2 changes: 0 additions & 2 deletions src/Image/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg libadwaita-1

public void main () {
var image_file = File.new_for_uri (workbench.resolve ("workbench.png"));
string path = image_file.get_path ();
Expand Down
2 changes: 0 additions & 2 deletions src/Label/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg libadwaita-1

public void main () {
var label = (Gtk.Label) workbench.builder.get_object ("label");
var justification_row = (Adw.ComboRow) workbench.builder.get_object ("justification_row");
Expand Down
2 changes: 0 additions & 2 deletions src/Launcher/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg libadwaita-1

private Gtk.FileLauncher file_launcher;
private Gtk.Entry uri_details;

Expand Down
2 changes: 0 additions & 2 deletions src/Level Bars/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg gtk4

Gtk.PasswordEntry entry;
Gtk.LevelBar bar_discrete;
Gtk.Label label_strength;
Expand Down
2 changes: 0 additions & 2 deletions src/Link Button/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg gtk4

public void main () {
var linkbutton = (Gtk.LinkButton) workbench.builder.get_object ("linkbutton");
linkbutton.notify["visited"].connect ((_) => message ("The link has been visited"));
Expand Down
2 changes: 0 additions & 2 deletions src/List Model/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg libadwaita-1

private Gtk.Stack stack;
private Gtk.ListBox list_box;
private Gtk.FlowBox flow_box;
Expand Down
2 changes: 0 additions & 2 deletions src/List View/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg libadwaita-1

private Gtk.ListView list_view;
private Gtk.Button add;
private Gtk.Button remove_button;
Expand Down
2 changes: 0 additions & 2 deletions src/Location/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg libadwaita-1 --pkg libportal-gtk4

private Xdp.Portal portal;
private Xdp.Parent parent;

Expand Down
2 changes: 0 additions & 2 deletions src/Map/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg libadwaita-1 --pkg shumate-1.0

private Shumate.SimpleMap map_widget;
private Shumate.Viewport viewport;
private Gtk.Entry entry_latitude;
Expand Down
2 changes: 0 additions & 2 deletions src/Memory Monitor/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg libadwaita-1

private HashTable<string, int?> cache;

public void main () {
Expand Down
2 changes: 0 additions & 2 deletions src/Menu Button/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg libadwaita-1

public void main () {
var circular_switch = (Adw.SwitchRow) workbench.builder.get_object ("circular_switch");
var secondary_button = (Gtk.MenuButton) workbench.builder.get_object ("secondary");
Expand Down
2 changes: 0 additions & 2 deletions src/Menu/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg libadwaita-1

public void main () {
var label = (Gtk.Label) workbench.builder.get_object ("label");

Expand Down
2 changes: 0 additions & 2 deletions src/Message Dialogs/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg gtk4 --pkg libadwaita-1

public void main () {
var button_confirmation = (Gtk.Button) workbench.builder.get_object ("button_confirmation");
var button_error = (Gtk.Button) workbench.builder.get_object ("button_error");
Expand Down
2 changes: 0 additions & 2 deletions src/Navigation View/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg libadwaita-1

public void main () {
var nav_view = (Adw.NavigationView) workbench.builder.get_object ("nav_view");
var nav_pageone = (Adw.NavigationPage) workbench.builder.get_object ("nav_pageone");
Expand Down
2 changes: 0 additions & 2 deletions src/Network Monitor/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg libadwaita-1

void set_network_status (Adw.Banner banner, NetworkMonitor network_monitor, Gtk.LevelBar level_bar) {
banner.revealed = network_monitor.network_metered;
level_bar.value = (double) network_monitor.connectivity;
Expand Down
2 changes: 0 additions & 2 deletions src/Open File/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg libadwaita-1

private Gtk.FileFilter file_filter_image;

public void main () {
Expand Down
2 changes: 0 additions & 2 deletions src/Overlay Split View/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg libadwaita-1

public void main () {
var split_view = (Adw.OverlaySplitView) workbench.builder.get_object ("split_view");
var start_toggle = (Gtk.ToggleButton) workbench.builder.get_object ("start_toggle");
Expand Down
2 changes: 0 additions & 2 deletions src/Overlay/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg gio-2.0 --pkg gtk4

public void main () {
var file = File.new_for_uri (workbench.resolve ("./image.png"));

Expand Down
2 changes: 0 additions & 2 deletions src/Picture/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg libadwaita-1

public void main () {
var picture_fill = (Gtk.Picture) workbench.builder.get_object ("picture_fill");
var picture_contain = (Gtk.Picture) workbench.builder.get_object ("picture_contain");
Expand Down
2 changes: 0 additions & 2 deletions src/Popovers/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg libadwaita-1

void on_closed (Gtk.Popover popover) {
message (@"$(popover.name) closed.");
}
Expand Down
2 changes: 0 additions & 2 deletions src/Power Profile Monitor/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg libadwaita-1

public void main () {
var overlay = (Adw.ToastOverlay) workbench.builder.get_object ("overlay");
var power_profile_monitor = PowerProfileMonitor.dup_default ();
Expand Down
2 changes: 0 additions & 2 deletions src/Preferences Dialog/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg gtk4 --pkg libadwaita-1

public void main () {
var dialog = (Adw.PreferencesDialog) workbench.builder.get_object ("dialog");
var dm_switch = (Adw.SwitchRow) workbench.builder.get_object ("dm_switch");
Expand Down
2 changes: 0 additions & 2 deletions src/Progress Bar/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg libadwaita-1

public void main () {

var first_bar = (Gtk.ProgressBar) workbench.builder.get_object ("first");
Expand Down
2 changes: 0 additions & 2 deletions src/Radio Buttons/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg gtk4

public void main() {
var radio_button_1 = (Gtk.CheckButton) workbench.builder.get_object("radio_button_1");
var radio_button_2 = (Gtk.CheckButton) workbench.builder.get_object("radio_button_2");
Expand Down
2 changes: 0 additions & 2 deletions src/Revealer/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg gtk4

public void main () {
var button_slide = (Gtk.ToggleButton) workbench.builder.get_object ("button_slide");
var button_crossfade = (Gtk.ToggleButton) workbench.builder.get_object ("button_crossfade");
Expand Down
2 changes: 0 additions & 2 deletions src/Save File/main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env -S vala workbench.vala --pkg gtk4

async void save_file () {
var file_dialog = new Gtk.FileDialog () {
initial_name = "Workbench.txt"
Expand Down
Loading
Loading