From ae1c76ff830d146d41e88d6fba724c0a54bce868 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 19:45:20 +0200 Subject: Adding upstream version 1:43.6. Signed-off-by: Daniel Baumann --- .../applications/gtp-dynamic-panel.desktop.in | 11 +++ .../applications/gtp-header-widget.desktop.in | 11 +++ .../applications/gtp-sidebar-widget.desktop.in | 11 +++ .../applications/gtp-static-init.desktop.in | 11 +++ .../gtp-toplevel-sidebar-widget.desktop.in | 11 +++ tests/interactive-panels/applications/meson.build | 22 ++++++ tests/interactive-panels/gtp-dynamic-panel.c | 85 ++++++++++++++++++++++ tests/interactive-panels/gtp-dynamic-panel.h | 30 ++++++++ tests/interactive-panels/gtp-dynamic-panel.ui | 27 +++++++ tests/interactive-panels/gtp-header-widget.c | 42 +++++++++++ tests/interactive-panels/gtp-header-widget.h | 30 ++++++++ tests/interactive-panels/gtp-header-widget.ui | 20 +++++ tests/interactive-panels/gtp-sidebar-widget.c | 56 ++++++++++++++ tests/interactive-panels/gtp-sidebar-widget.h | 30 ++++++++ tests/interactive-panels/gtp-sidebar-widget.ui | 19 +++++ tests/interactive-panels/gtp-static-init.c | 49 +++++++++++++ tests/interactive-panels/gtp-static-init.h | 32 ++++++++ tests/interactive-panels/gtp-static-init.ui | 15 ++++ tests/interactive-panels/main.c | 80 ++++++++++++++++++++ tests/interactive-panels/meson.build | 49 +++++++++++++ tests/interactive-panels/panels.gresource.xml | 10 +++ 21 files changed, 651 insertions(+) create mode 100644 tests/interactive-panels/applications/gtp-dynamic-panel.desktop.in create mode 100644 tests/interactive-panels/applications/gtp-header-widget.desktop.in create mode 100644 tests/interactive-panels/applications/gtp-sidebar-widget.desktop.in create mode 100644 tests/interactive-panels/applications/gtp-static-init.desktop.in create mode 100644 tests/interactive-panels/applications/gtp-toplevel-sidebar-widget.desktop.in create mode 100644 tests/interactive-panels/applications/meson.build create mode 100644 tests/interactive-panels/gtp-dynamic-panel.c create mode 100644 tests/interactive-panels/gtp-dynamic-panel.h create mode 100644 tests/interactive-panels/gtp-dynamic-panel.ui create mode 100644 tests/interactive-panels/gtp-header-widget.c create mode 100644 tests/interactive-panels/gtp-header-widget.h create mode 100644 tests/interactive-panels/gtp-header-widget.ui create mode 100644 tests/interactive-panels/gtp-sidebar-widget.c create mode 100644 tests/interactive-panels/gtp-sidebar-widget.h create mode 100644 tests/interactive-panels/gtp-sidebar-widget.ui create mode 100644 tests/interactive-panels/gtp-static-init.c create mode 100644 tests/interactive-panels/gtp-static-init.h create mode 100644 tests/interactive-panels/gtp-static-init.ui create mode 100644 tests/interactive-panels/main.c create mode 100644 tests/interactive-panels/meson.build create mode 100644 tests/interactive-panels/panels.gresource.xml (limited to 'tests/interactive-panels') diff --git a/tests/interactive-panels/applications/gtp-dynamic-panel.desktop.in b/tests/interactive-panels/applications/gtp-dynamic-panel.desktop.in new file mode 100644 index 0000000..8a550ba --- /dev/null +++ b/tests/interactive-panels/applications/gtp-dynamic-panel.desktop.in @@ -0,0 +1,11 @@ +[Desktop Entry] +Name=Dynamic Panel +Comment=Panel that can be hidden from the sidebar +Exec=gnome-control-center dynamic-panels +Icon=weather-clear-night +Terminal=false +Type=Application +NoDisplay=true +StartupNotify=true +Categories=GNOME;GTK;Settings;X-GNOME-Settings-Panel;X-GNOME-ConnectivitySettings; +OnlyShowIn=GNOME;Unity; \ No newline at end of file diff --git a/tests/interactive-panels/applications/gtp-header-widget.desktop.in b/tests/interactive-panels/applications/gtp-header-widget.desktop.in new file mode 100644 index 0000000..4ffbf20 --- /dev/null +++ b/tests/interactive-panels/applications/gtp-header-widget.desktop.in @@ -0,0 +1,11 @@ +[Desktop Entry] +Name=Header +Comment=Panel that embeds a widget at the header bar +Exec=gnome-control-center thunderbolt +Icon=view-sort-descending +Terminal=false +Type=Application +NoDisplay=true +StartupNotify=true +Categories=GNOME;GTK;Settings;X-GNOME-Settings-Panel;X-GNOME-ConnectivitySettings; +OnlyShowIn=GNOME;Unity; \ No newline at end of file diff --git a/tests/interactive-panels/applications/gtp-sidebar-widget.desktop.in b/tests/interactive-panels/applications/gtp-sidebar-widget.desktop.in new file mode 100644 index 0000000..6c96c2d --- /dev/null +++ b/tests/interactive-panels/applications/gtp-sidebar-widget.desktop.in @@ -0,0 +1,11 @@ +[Desktop Entry] +Name=Another Sidebar Widget +Comment=Panel that embeds a widget at the sidebar +Exec=gnome-control-center sidebar-widget +Icon=go-first-symbolic +Terminal=false +Type=Application +NoDisplay=true +StartupNotify=true +Categories=GNOME;GTK;Settings;X-GNOME-Settings-Panel;X-GNOME-DetailsSettings; +OnlyShowIn=GNOME;Unity; diff --git a/tests/interactive-panels/applications/gtp-static-init.desktop.in b/tests/interactive-panels/applications/gtp-static-init.desktop.in new file mode 100644 index 0000000..e8ccdf5 --- /dev/null +++ b/tests/interactive-panels/applications/gtp-static-init.desktop.in @@ -0,0 +1,11 @@ +[Desktop Entry] +Name=Static Initializer +Comment=Panel with a static initializer function +Exec=gnome-control-center static-init +Icon=view-continuous +Terminal=false +Type=Application +NoDisplay=true +StartupNotify=true +Categories=GNOME;GTK;Settings;X-GNOME-Settings-Panel;X-GNOME-ConnectivitySettings; +OnlyShowIn=GNOME;Unity; \ No newline at end of file diff --git a/tests/interactive-panels/applications/gtp-toplevel-sidebar-widget.desktop.in b/tests/interactive-panels/applications/gtp-toplevel-sidebar-widget.desktop.in new file mode 100644 index 0000000..a6d4aa8 --- /dev/null +++ b/tests/interactive-panels/applications/gtp-toplevel-sidebar-widget.desktop.in @@ -0,0 +1,11 @@ +[Desktop Entry] +Name=Sidebar Widget +Comment=Panel that embeds a widget at the sidebar +Exec=gnome-control-center sidebar-widget +Icon=go-first-symbolic +Terminal=false +Type=Application +NoDisplay=true +StartupNotify=true +Categories=GNOME;GTK;Settings;X-GNOME-Settings-Panel;X-GNOME-ConnectivitySettings; +OnlyShowIn=GNOME;Unity; \ No newline at end of file diff --git a/tests/interactive-panels/applications/meson.build b/tests/interactive-panels/applications/meson.build new file mode 100644 index 0000000..82eed4d --- /dev/null +++ b/tests/interactive-panels/applications/meson.build @@ -0,0 +1,22 @@ +################# +# Desktop files # +################# + +desktop_files = [ + 'dynamic-panel', + 'header-widget', + 'sidebar-widget', + 'static-init', + 'toplevel-sidebar-widget', +] + +foreach desktop_file : desktop_files + i18n.merge_file( + type : 'desktop', + input : 'gtp-@0@.desktop.in'.format(desktop_file), + output : 'gnome-@0@-panel.desktop'.format(desktop_file), + po_dir : po_dir, + build_by_default : true, + install : false, + ) +endforeach diff --git a/tests/interactive-panels/gtp-dynamic-panel.c b/tests/interactive-panels/gtp-dynamic-panel.c new file mode 100644 index 0000000..31efa30 --- /dev/null +++ b/tests/interactive-panels/gtp-dynamic-panel.c @@ -0,0 +1,85 @@ +/* gtp-dynamic-panel.c + * + * Copyright 2018 Georges Basile Stavracas Neto + * + * 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 . + * + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +#define G_LOG_DOMAIN "gtp-dynamic-panel" + +#include "gtp-dynamic-panel.h" + +#include "shell/cc-application.h" +#include "shell/cc-shell-model.h" + +struct _GtpDynamicPanel +{ + CcPanel parent; +}; + +G_DEFINE_TYPE (GtpDynamicPanel, gtp_dynamic_panel, CC_TYPE_PANEL) + +/* Auxiliary methods */ + +static void +set_visibility (CcPanelVisibility visibility) +{ + GApplication *application; + CcShellModel *model; + + application = g_application_get_default (); + model = cc_application_get_model (CC_APPLICATION (application)); + + cc_shell_model_set_panel_visibility (model, "dynamic-panel", visibility); +} + +/* Callbacks */ + +static gboolean +show_panel_cb (gpointer data) +{ + g_debug ("Showing panel"); + + set_visibility (CC_PANEL_VISIBLE); + + return G_SOURCE_REMOVE; +} + +static void +on_button_clicked_cb (GtkButton *button, + GtpDynamicPanel *self) +{ + g_debug ("Hiding panel"); + + set_visibility (CC_PANEL_HIDDEN); + g_timeout_add_seconds (3, show_panel_cb, self); +} + +static void +gtp_dynamic_panel_class_init (GtpDynamicPanelClass *klass) +{ + GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); + + gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/control-center/tests/panels/gtp-dynamic-panel.ui"); + + gtk_widget_class_bind_template_callback (widget_class, on_button_clicked_cb); +} + +static void +gtp_dynamic_panel_init (GtpDynamicPanel *self) +{ + gtk_widget_init_template (GTK_WIDGET (self)); +} diff --git a/tests/interactive-panels/gtp-dynamic-panel.h b/tests/interactive-panels/gtp-dynamic-panel.h new file mode 100644 index 0000000..84ad5cc --- /dev/null +++ b/tests/interactive-panels/gtp-dynamic-panel.h @@ -0,0 +1,30 @@ +/* gtp-dynamic-panel.h + * + * Copyright 2018 Georges Basile Stavracas Neto + * + * 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 . + * + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +#pragma once + +#include + +G_BEGIN_DECLS + +#define GTP_TYPE_DYNAMIC_PANEL (gtp_dynamic_panel_get_type()) +G_DECLARE_FINAL_TYPE (GtpDynamicPanel, gtp_dynamic_panel, GTP, DYNAMIC_PANEL, CcPanel) + +G_END_DECLS diff --git a/tests/interactive-panels/gtp-dynamic-panel.ui b/tests/interactive-panels/gtp-dynamic-panel.ui new file mode 100644 index 0000000..30e1bdd --- /dev/null +++ b/tests/interactive-panels/gtp-dynamic-panel.ui @@ -0,0 +1,27 @@ + + + + + + diff --git a/tests/interactive-panels/gtp-header-widget.c b/tests/interactive-panels/gtp-header-widget.c new file mode 100644 index 0000000..b27327a --- /dev/null +++ b/tests/interactive-panels/gtp-header-widget.c @@ -0,0 +1,42 @@ +/* gtp-header-widget.c + * + * Copyright 2018 Georges Basile Stavracas Neto + * + * 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 . + * + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +#include "gtp-header-widget.h" + +struct _GtpHeaderWidget +{ + CcPanel parent; +}; + +G_DEFINE_TYPE (GtpHeaderWidget, gtp_header_widget, CC_TYPE_PANEL) + +static void +gtp_header_widget_class_init (GtpHeaderWidgetClass *klass) +{ + GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); + + gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/control-center/tests/panels/gtp-header-widget.ui"); +} + +static void +gtp_header_widget_init (GtpHeaderWidget *self) +{ + gtk_widget_init_template (GTK_WIDGET (self)); +} diff --git a/tests/interactive-panels/gtp-header-widget.h b/tests/interactive-panels/gtp-header-widget.h new file mode 100644 index 0000000..99f7ce0 --- /dev/null +++ b/tests/interactive-panels/gtp-header-widget.h @@ -0,0 +1,30 @@ +/* gtp-header-widget.h + * + * Copyright 2018 Georges Basile Stavracas Neto + * + * 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 . + * + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +#pragma once + +#include + +G_BEGIN_DECLS + +#define GTP_TYPE_HEADER_WIDGET (gtp_header_widget_get_type()) +G_DECLARE_FINAL_TYPE (GtpHeaderWidget, gtp_header_widget, GTP, HEADER_WIDGET, CcPanel) + +G_END_DECLS diff --git a/tests/interactive-panels/gtp-header-widget.ui b/tests/interactive-panels/gtp-header-widget.ui new file mode 100644 index 0000000..8eb9b88 --- /dev/null +++ b/tests/interactive-panels/gtp-header-widget.ui @@ -0,0 +1,20 @@ + + + + + diff --git a/tests/interactive-panels/gtp-sidebar-widget.c b/tests/interactive-panels/gtp-sidebar-widget.c new file mode 100644 index 0000000..1395724 --- /dev/null +++ b/tests/interactive-panels/gtp-sidebar-widget.c @@ -0,0 +1,56 @@ +/* gtp-sidebar-widget.c + * + * Copyright 2018 Georges Basile Stavracas Neto + * + * 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 . + * + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +#include "gtp-sidebar-widget.h" + +struct _GtpSidebarWidget +{ + CcPanel parent; + + GtkWidget *sidebar_widget; +}; + +G_DEFINE_TYPE (GtpSidebarWidget, gtp_sidebar_widget, CC_TYPE_PANEL) + +static GtkWidget* +gtp_sidebar_widget_get_sidebar_widget (CcPanel *panel) +{ + GtpSidebarWidget *self = GTP_SIDEBAR_WIDGET (panel); + return self->sidebar_widget; +} + +static void +gtp_sidebar_widget_class_init (GtpSidebarWidgetClass *klass) +{ + CcPanelClass *panel_class = CC_PANEL_CLASS (klass); + GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); + + panel_class->get_sidebar_widget = gtp_sidebar_widget_get_sidebar_widget; + + gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/control-center/tests/panels/gtp-sidebar-widget.ui"); + + gtk_widget_class_bind_template_child (widget_class, GtpSidebarWidget, sidebar_widget); +} + +static void +gtp_sidebar_widget_init (GtpSidebarWidget *self) +{ + gtk_widget_init_template (GTK_WIDGET (self)); +} diff --git a/tests/interactive-panels/gtp-sidebar-widget.h b/tests/interactive-panels/gtp-sidebar-widget.h new file mode 100644 index 0000000..3bf8dfe --- /dev/null +++ b/tests/interactive-panels/gtp-sidebar-widget.h @@ -0,0 +1,30 @@ +/* gtp-sidebar-widget.h + * + * Copyright 2018 Georges Basile Stavracas Neto + * + * 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 . + * + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +#pragma once + +#include + +G_BEGIN_DECLS + +#define GTP_TYPE_SIDEBAR_WIDGET (gtp_sidebar_widget_get_type()) +G_DECLARE_FINAL_TYPE (GtpSidebarWidget, gtp_sidebar_widget, GTP, SIDEBAR_WIDGET, CcPanel) + +G_END_DECLS diff --git a/tests/interactive-panels/gtp-sidebar-widget.ui b/tests/interactive-panels/gtp-sidebar-widget.ui new file mode 100644 index 0000000..cba80fc --- /dev/null +++ b/tests/interactive-panels/gtp-sidebar-widget.ui @@ -0,0 +1,19 @@ + + + + + + I'm a sidebar widget + + + diff --git a/tests/interactive-panels/gtp-static-init.c b/tests/interactive-panels/gtp-static-init.c new file mode 100644 index 0000000..c6b7a4f --- /dev/null +++ b/tests/interactive-panels/gtp-static-init.c @@ -0,0 +1,49 @@ +/* gtp-static-init.c + * + * Copyright 2018 Georges Basile Stavracas Neto + * + * 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 . + * + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +#include "gtp-static-init.h" + +struct _GtpStaticInit +{ + CcPanel parent; +}; + +G_DEFINE_TYPE (GtpStaticInit, gtp_static_init, CC_TYPE_PANEL) + +void +gtp_static_init_func (void) +{ + g_message ("GtpStaticInit: running outside the panel instance"); +} + +static void +gtp_static_init_class_init (GtpStaticInitClass *klass) +{ + GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); + + gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/control-center/tests/panels/gtp-static-init.ui"); + +} + +static void +gtp_static_init_init (GtpStaticInit *self) +{ + gtk_widget_init_template (GTK_WIDGET (self)); +} diff --git a/tests/interactive-panels/gtp-static-init.h b/tests/interactive-panels/gtp-static-init.h new file mode 100644 index 0000000..1dbbea2 --- /dev/null +++ b/tests/interactive-panels/gtp-static-init.h @@ -0,0 +1,32 @@ +/* gtp-static-init.h + * + * Copyright 2018 Georges Basile Stavracas Neto + * + * 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 . + * + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +#pragma once + +#include + +G_BEGIN_DECLS + +#define GTP_TYPE_STATIC_INIT (gtp_static_init_get_type()) +G_DECLARE_FINAL_TYPE (GtpStaticInit, gtp_static_init, GTP, STATIC_INIT, CcPanel) + +void gtp_static_init_func (void); + +G_END_DECLS diff --git a/tests/interactive-panels/gtp-static-init.ui b/tests/interactive-panels/gtp-static-init.ui new file mode 100644 index 0000000..32b02a9 --- /dev/null +++ b/tests/interactive-panels/gtp-static-init.ui @@ -0,0 +1,15 @@ + + + + + diff --git a/tests/interactive-panels/main.c b/tests/interactive-panels/main.c new file mode 100644 index 0000000..0b0faaa --- /dev/null +++ b/tests/interactive-panels/main.c @@ -0,0 +1,80 @@ +/* main.c + * + * Copyright 2018 Georges Basile Stavracas Neto + * + * 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 . + * + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +#include "config.h" + +#include +#include +#include + +#include "shell/cc-application.h" +#include "shell/cc-panel-loader.h" +#include "shell/resources.h" +#include "test-panels-resources.h" + +#include "gtp-dynamic-panel.h" +#include "gtp-header-widget.h" +#include "gtp-sidebar-widget.h" +#include "gtp-static-init.h" + +/* Test panels */ +static CcPanelLoaderVtable test_panels[] = { + { "dynamic-panel", gtp_dynamic_panel_get_type, NULL }, + { "header-widget", gtp_header_widget_get_type, NULL }, + { "sidebar-widget", gtp_sidebar_widget_get_type, NULL }, + { "static-init", gtp_static_init_get_type, gtp_static_init_func }, + { "toplevel-sidebar-widget", gtp_sidebar_widget_get_type, NULL }, +}; + +static void +override_xdg_data_dirs (void) +{ + g_autoptr(GString) extended_xdg_data_dirs = NULL; + const gchar *xdg_data_dirs; + + extended_xdg_data_dirs = g_string_new ("."); + xdg_data_dirs = g_getenv ("XDG_DATA_DIRS"); + + if (xdg_data_dirs) + g_string_append_printf (extended_xdg_data_dirs, ":%s", xdg_data_dirs); + + g_setenv ("XDG_DATA_DIRS", extended_xdg_data_dirs->str, TRUE); +} + +gint +main (gint argc, + gchar *argv[]) +{ + g_autoptr(GtkApplication) application = NULL; + + /* Manually register GResources */ + g_resources_register (gnome_control_center_get_resource ()); + g_resources_register (test_panels_get_resource ()); + + /* Override the panels vtable with the test panels */ + cc_panel_loader_override_vtable (test_panels, G_N_ELEMENTS (test_panels)); + + /* Override XDG_DATA_DIRS */ + override_xdg_data_dirs (); + + application = cc_application_new (); + + return g_application_run (G_APPLICATION (application), argc, argv); +} diff --git a/tests/interactive-panels/meson.build b/tests/interactive-panels/meson.build new file mode 100644 index 0000000..04856ee --- /dev/null +++ b/tests/interactive-panels/meson.build @@ -0,0 +1,49 @@ +subdir('applications') + +########### +# Sources # +########### + +sources = files( + 'gtp-dynamic-panel.c', + 'gtp-header-widget.c', + 'gtp-sidebar-widget.c', + 'gtp-static-init.c', + 'main.c', +) + + +############## +# GResources # +############## + +resource_data = files( + 'gtp-dynamic-panel.ui', + 'gtp-header-widget.ui', + 'gtp-sidebar-widget.ui', + 'gtp-static-init.ui', +) + +sources += gnome.compile_resources( + 'test-panels-resources', + 'panels.gresource.xml', + source_dir : '.', + c_name : 'test_panels', + dependencies : resource_data, + export : true, +) + + +###################### +# interactive-panels # +###################### + +includes = [top_inc] + +exe = executable( + 'test-interactive-panels', + sources, + include_directories : includes, + dependencies : shell_deps + [libtestshell_dep], + c_args : cflags +) diff --git a/tests/interactive-panels/panels.gresource.xml b/tests/interactive-panels/panels.gresource.xml new file mode 100644 index 0000000..9fc6605 --- /dev/null +++ b/tests/interactive-panels/panels.gresource.xml @@ -0,0 +1,10 @@ + + + + gtp-dynamic-panel.ui + gtp-header-widget.ui + gtp-sidebar-widget.ui + gtp-static-init.ui + + + -- cgit v1.2.3