diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cc95b7e3e..b35af735c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: - name: Install Dependencies run: | apt update - apt install -y desktop-file-utils gettext libdistinst-dev libgtk-3-dev libgee-0.8-dev libgranite-dev libhandy-1-dev libxml2-dev libjson-glib-dev libgnomekbd-dev libpwquality-dev libxml2-utils meson valac + apt install -y desktop-file-utils gettext libdistinst-dev libgtk-3-dev libgee-0.8-dev libgranite-dev libhandy-1-dev libxml2-dev libjson-glib-dev libpwquality-dev libxml2-utils meson valac - name: Build run: | meson build diff --git a/meson.build b/meson.build index ef9254f97..0eaf4bad7 100644 --- a/meson.build +++ b/meson.build @@ -22,8 +22,6 @@ granite_dep = dependency('granite', version: '>=0.5') handy_dep = dependency('libhandy-1', version: '>=0.90.0') json_glib_dep = dependency('json-glib-1.0') xml2_dep = dependency('libxml-2.0') -gnome_keyboard_dep = dependency('libgnomekbd') -gnome_keyboard_ui_dep = meson.get_compiler('c').find_library('gnomekbdui') pwquality_dep = dependency('pwquality') systemd_dep = dependency('systemd') diff --git a/po/POTFILES b/po/POTFILES index 258982ba0..c84aa9638 100644 --- a/po/POTFILES +++ b/po/POTFILES @@ -22,7 +22,6 @@ src/Widgets/DecryptMenu.vala src/Widgets/DiskBar.vala src/Widgets/DiskGrid.vala src/Widgets/InstallTypeGrid.vala -src/Widgets/LayoutWidget.vala src/Widgets/PartitionBar.vala src/Widgets/PartitionMenu.vala src/Widgets/VariantWidget.vala diff --git a/src/Views/KeyboardLayoutView.vala b/src/Views/KeyboardLayoutView.vala index dc82bce06..a7da33e50 100644 --- a/src/Views/KeyboardLayoutView.vala +++ b/src/Views/KeyboardLayoutView.vala @@ -157,8 +157,6 @@ public class KeyboardLayoutView : AbstractInstallerView { }); keyboard_test_entry.icon_release.connect (() => { - var layout = new LayoutWidget (); - string layout_string; unowned Gtk.ListBoxRow row = input_variant_widget.main_listbox.get_selected_row (); if (row != null) { @@ -173,11 +171,12 @@ public class KeyboardLayoutView : AbstractInstallerView { layout_string = "us"; } - layout.set_layout (layout_string); - - var popover = new Gtk.Popover (keyboard_test_entry); - popover.add (layout); - popover.show_all (); + string command = "gkbd-keyboard-display --layout=%s".printf (layout_string); + try { + AppInfo.create_from_commandline (command, null, NONE).launch (null, null); + } catch (Error e) { + warning ("Error launching keyboard layout display: %s", e.message); + } }); foreach (var layout in KeyboardLayoutHelper.get_layouts ()) { diff --git a/src/Widgets/LayoutWidget.vala b/src/Widgets/LayoutWidget.vala deleted file mode 100644 index eff0c7de6..000000000 --- a/src/Widgets/LayoutWidget.vala +++ /dev/null @@ -1,52 +0,0 @@ -// -*- Mode: vala; indent-tabs-mode: nil; tab-width: 4 -*- -/*- - * Copyright (c) 2017 elementary LLC. (https://elementary.io) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -public class LayoutWidget : Gtk.Grid { - private Gkbd.KeyboardDrawing gkbd_drawing; - - static Gkbd.KeyboardDrawingGroupLevel top_left = { 0, 1 }; - static Gkbd.KeyboardDrawingGroupLevel top_right = { 0, 3 }; - static Gkbd.KeyboardDrawingGroupLevel bottom_left = { 0, 0 }; - static Gkbd.KeyboardDrawingGroupLevel bottom_right = { 0, 2 }; - static Gkbd.KeyboardDrawingGroupLevel*[] group = { &top_left, &top_right, &bottom_left, &bottom_right }; - - construct { - gkbd_drawing = new Gkbd.KeyboardDrawing (); - gkbd_drawing.parent = this; - width_request = 600; - height_request = 230; - gkbd_drawing.set_groups_levels (((unowned Gkbd.KeyboardDrawingGroupLevel)[])group); - set_layout ("gb\tcolemak"); - gkbd_drawing.show_all (); - } - - public void set_layout (string layout_id) { - gkbd_drawing.set_layout (layout_id); - } - - public override bool draw (Cairo.Context cr) { - gkbd_drawing.render (cr, - Pango.cairo_create_layout (cr), 0, 0, - get_allocated_width (), - get_allocated_height (), - 50, - 50 - ); - return true; - } -} diff --git a/src/meson.build b/src/meson.build index 39dbd5913..e03557d41 100644 --- a/src/meson.build +++ b/src/meson.build @@ -24,7 +24,6 @@ vala_files = [ 'Widgets/DiskBar.vala', 'Widgets/DiskGrid.vala', 'Widgets/InstallTypeGrid.vala', - 'Widgets/LayoutWidget.vala', 'Widgets/PartitionBar.vala', 'Widgets/PartitionMenu.vala', 'Widgets/Terminal.vala', @@ -57,8 +56,6 @@ gui_dependencies = [ distinst_dep, gee_dep, glib_dep, - gnome_keyboard_dep, - gnome_keyboard_ui_dep, gobject_dep, granite_dep, gtk_dep, diff --git a/vapi/libgnomekbd.deps b/vapi/libgnomekbd.deps deleted file mode 100644 index 235732ca8..000000000 --- a/vapi/libgnomekbd.deps +++ /dev/null @@ -1,3 +0,0 @@ -libxklavier -gtk+-3.0 -gobject-2.0 diff --git a/vapi/libgnomekbd.vapi b/vapi/libgnomekbd.vapi deleted file mode 100644 index d9d38f84c..000000000 --- a/vapi/libgnomekbd.vapi +++ /dev/null @@ -1,214 +0,0 @@ -/* libgnomekbd.vapi generated by vapigen, do not modify. */ - -[CCode (cprefix = "Gkbd", gir_namespace = "Gkbd", gir_version = "3.0", lower_case_cprefix = "gkbd_")] -namespace Gkbd { - [CCode (cheader_filename = "libgnomekbd/gkbd-configuration.h", type_id = "gkbd_configuration_get_type ()")] - public class Configuration : GLib.Object { - [CCode (has_construct_function = false)] - protected Configuration (); - public void append_object (GLib.Object obj); - public static string create_label_title (int group, GLib.HashTable ln2cnt_map, string layout_name); - public string extract_layout_name (int group); - public void free_images (GLib.SList images); - public static Gkbd.Configuration @get (); - public unowned GLib.SList get_all_objects (); - public bool get_caps_lock_state (); - public uint get_current_group (); - public string get_current_tooltip (); - public string get_group_name (uint group); - [CCode (array_length = false, array_null_terminated = true)] - public unowned string[] get_group_names (); - public string get_image_filename (uint group); - public unowned Gkbd.IndicatorConfig? get_indicator_config (); - public unowned Gkbd.KeyboardConfig? get_keyboard_config (); - public bool get_num_lock_state (); - public bool get_scroll_lock_state (); - [CCode (array_length = false, array_null_terminated = true)] - public unowned string[] get_short_group_names (); - public unowned Xkl.Engine get_xkl_engine (); - public bool if_any_object_exists (); - public bool if_flags_shown (); - public GLib.SList load_images (); - public void lock_group (uint group); - public void lock_next_group (); - public void remove_object (GLib.Object obj); - public void start_listen (); - public void stop_listen (); - public signal void changed (); - public signal void group_changed (int object); - public signal void indicators_changed (); - } - [CCode (cheader_filename = "libgnomekbd/gkbd-indicator.h", type_id = "gkbd_indicator_get_type ()")] - public class Indicator : Gtk.Notebook, Atk.Implementor, Gtk.Buildable { - [CCode (has_construct_function = false, type = "GtkWidget*")] - public Indicator (); - [CCode (array_length = false, array_null_terminated = true)] - public static unowned string[] get_group_names (); - public static string get_image_filename (uint group); - public static double get_max_width_height_ratio (); - public static unowned Xkl.Engine get_xkl_engine (); - public void set_angle (double angle); - public void set_parent_tooltips (bool ifset); - [HasEmitter] - public virtual signal void reinit_ui (); - } - [CCode (cheader_filename = "libgnomekbd/gkbd-keyboard-drawing.h", type_id = "gkbd_keyboard_drawing_get_type ()")] - public class KeyboardDrawing : Gtk.DrawingArea, Atk.Implementor, Gtk.Buildable { - [CCode (has_construct_function = false, type = "GtkWidget*")] - public KeyboardDrawing (); - [CCode (cname = "gkbd_keyboard_drawing_dialog_new", has_construct_function = false, type = "GtkWidget*")] - public KeyboardDrawing.dialog_new (); - public static void dialog_set_group (Gtk.Widget dialog, Xkl.ConfigRegistry registry, int group); - public static void dialog_set_layout (Gtk.Widget dialog, Xkl.ConfigRegistry registry, string layout); - public unowned string get_compat (); - public unowned string get_geometry (); - public unowned string get_keycodes (); - public unowned string get_symbols (); - public unowned string get_types (); - public void print (Gtk.Window parent_window, string description); - public bool render (Cairo.Context cr, Pango.Layout layout, double x, double y, double width, double height, double dpi_x, double dpi_y); - public void set_groups_levels ([CCode (array_length = false)] (unowned Gkbd.KeyboardDrawingGroupLevel)[] groupLevels); - public void set_layout (string id); - public void set_track_config (bool enable); - public void set_track_modifiers (bool enable); - public virtual signal void bad_keycode (uint keycode); - } - [CCode (cheader_filename = "libgnomekbd/gkbd-status.h", type_id = "gkbd_status_get_type ()")] - public class Status : Gtk.StatusIcon { - [CCode (has_construct_function = false, type = "GtkStatusIcon*")] - public Status (); - [CCode (array_length = false, array_null_terminated = true)] - public static unowned string[] get_group_names (); - public static string get_image_filename (uint group); - public static unowned Xkl.Engine get_xkl_engine (); - public void reinit_ui (); - } - [CCode (cheader_filename = "libgnomekbd/gkbd-desktop-config.h", has_type_id = false)] - public struct DesktopConfig { - public int default_group; - public bool group_per_app; - public bool handle_indicators; - public bool layout_names_as_group_names; - public bool load_extra_items; - public weak GLib.Settings settings; - public int config_listener_id; - public weak Xkl.Engine engine; - public bool activate (); - public void init (Xkl.Engine engine); - public void load (); - public bool load_group_descriptions (Xkl.ConfigRegistry registry, string layout_ids, string variant_ids, string short_group_names, string full_group_names); - public void lock_next_group (); - public void lock_prev_group (); - public void restore_group (); - public void save (); - public void start_listen (GLib.Callback func); - public void stop_listen (); - public void term (); - } - [CCode (cheader_filename = "libgnomekbd/gkbd-indicator-config.h", has_type_id = false)] - public struct IndicatorConfig { - public int secondary_groups_mask; - public bool show_flags; - public weak string font_family; - public int font_size; - public weak string foreground_color; - public weak string background_color; - public weak GLib.Settings settings; - public weak GLib.SList image_filenames; - public weak Gtk.IconTheme icon_theme; - public int config_listener_id; - public weak Xkl.Engine engine; - public void activate (); - public void free_image_filenames (); - public string get_fg_color_for_widget (Gtk.Widget widget); - public void get_font_for_widget (Gtk.Widget widget, string font_family, int font_size); - public string get_images_file (Gkbd.KeyboardConfig kbd_config, int group); - public void init (Xkl.Engine engine); - public void load (); - public void load_image_filenames (Gkbd.KeyboardConfig kbd_config); - public void refresh_style (); - public void save (); - public void start_listen (GLib.Callback func); - public void stop_listen (); - public void term (); - } - [CCode (cheader_filename = "libgnomekbd/gkbd-keyboard-config.h", has_type_id = false)] - public struct KeyboardConfig { - public weak string model; - public weak string layouts_variants; - public weak string options; - public weak GLib.Settings settings; - public int config_listener_id; - public weak Xkl.Engine engine; - public bool activate (); - [CCode (array_length = false, array_null_terminated = true)] - public static string[] add_default_switch_option_if_necessary (string layouts_list, string options_list, bool was_appended); - public bool equals (Gkbd.KeyboardConfig kbd_config2); - public static unowned string format_full_description (string layout_descr, string variant_descr); - public static bool get_descriptions (Xkl.ConfigRegistry config_registry, string name, string layout_short_descr, string layout_descr, string variant_short_descr, string variant_descr); - public void init (Xkl.Engine engine); - public void load (Gkbd.KeyboardConfig kbd_config_default); - public void load_from_x_current (Xkl.ConfigRec buf); - public void load_from_x_initial (Xkl.ConfigRec buf); - public static unowned string merge_items (string parent, string child); - public void save (); - public static bool split_items (string merged, string parent, string child); - public void start_listen (GLib.Callback func); - public void stop_listen (); - public void term (); - public string to_string (); - } - [CCode (cheader_filename = "libgnomekbd/gkbd-keyboard-drawing.h", has_type_id = false)] - public struct KeyboardDrawingDoodad { - } - [CCode (cheader_filename = "libgnomekbd/gkbd-keyboard-drawing.h", has_type_id = false)] - public struct KeyboardDrawingGroupLevel { - public int group; - public int level; - } - [CCode (cheader_filename = "libgnomekbd/gkbd-keyboard-drawing.h", has_type_id = false)] - public struct KeyboardDrawingItem { - } - [CCode (cheader_filename = "libgnomekbd/gkbd-keyboard-drawing.h", has_type_id = false)] - public struct KeyboardDrawingKey { - } - [CCode (cheader_filename = "libgnomekbd/gkbd-keyboard-drawing.h", has_type_id = false)] - public struct KeyboardDrawingRenderContext { - public weak Cairo.Context cr; - public int angle; - public weak Pango.Layout layout; - public weak Pango.FontDescription font_desc; - public int scale_numerator; - public int scale_denominator; - public Gdk.RGBA dark_color; - } - [CCode (cheader_filename = "libgnomekbd/gkbd-keyboard-drawing.h", cprefix = "GKBD_KEYBOARD_DRAWING_POS_", has_type_id = false)] - public enum KeyboardDrawingGroupLevelPosition { - TOPLEFT, - TOPRIGHT, - BOTTOMLEFT, - BOTTOMRIGHT, - TOTAL, - FIRST, - LAST - } - [CCode (cheader_filename = "libgnomekbd/gkbd-keyboard-drawing.h", cprefix = "GKBD_KEYBOARD_DRAWING_ITEM_TYPE_", has_type_id = false)] - public enum KeyboardDrawingItemType { - INVALID, - KEY, - KEY_EXTRA, - DOODAD - } - [CCode (cheader_filename = "libgnomekbd/gkbd-util.h")] - public static void install_glib_log_appender (); - [CCode (cheader_filename = "libgnomekbd/gkbd-util.h")] - public static Gdk.Rectangle? preview_load_position (); - [CCode (cheader_filename = "libgnomekbd/gkbd-util.h")] - public static void preview_save_position (Gdk.Rectangle rect); - [CCode (array_length = false, array_null_terminated = true, cheader_filename = "libgnomekbd/gkbd-util.h")] - public static string[] strv_append (string arr, string element); - [CCode (cheader_filename = "libgnomekbd/gkbd-util.h")] - public static void strv_behead (string arr); - [CCode (cheader_filename = "libgnomekbd/gkbd-util.h")] - public static bool strv_remove (string arr, string element); -}