Move common panel code from shell/ to panel/common

This creates a new static library called libwidget which the shell links
against.
This commit is contained in:
Benjamin Berg 2018-04-06 13:38:40 +02:00
parent e1593b3c02
commit c2f601a9d4
51 changed files with 88 additions and 73 deletions

View file

@ -26,7 +26,7 @@
#include <gdk/gdkx.h>
#include <libsoup/soup.h>
#include "shell/list-box-helper.h"
#include "list-box-helper.h"
#include "cc-color-calibrate.h"
#include "cc-color-cell-renderer-text.h"
#include "cc-color-panel.h"

View file

@ -55,7 +55,7 @@ cflags += [
panels_libs += static_library(
cappletname,
sources: sources,
include_directories: top_inc,
include_directories: [ top_inc, common_inc ],
dependencies: deps,
c_args: cflags
)

View file

@ -29,7 +29,7 @@
#include <gio/gio.h>
#include <gtk/gtk.h>
#include "shell/list-box-helper.h"
#include "list-box-helper.h"
#include "cc-common-language.h"
#include "cc-util.h"

View file

@ -24,6 +24,23 @@ common_sources += gnome.mkenums(
vtail: ' { 0, NULL, NULL }\n };\n etype = g_@type@_register_static ("@EnumName@", values);\n }\n return etype;\n}\n'
)
sources = files(
'cc-hostname-entry.c',
'hostname-helper.c',
'list-box-helper.c',
)
libwidgets = static_library(
'widgets',
sources: sources,
include_directories: top_inc,
dependencies: common_deps + [ polkit_gobject_dep ]
)
libwidgets_dep = declare_dependency(
include_directories: common_inc,
link_with: libwidgets
)
sources = common_sources + files(
'cc-common-language.c',
'cc-language-chooser.c',
@ -121,3 +138,26 @@ run_target(
script_name,
command: script
)
test_unit = 'test-hostname'
sources = files(
'hostname-helper.c',
test_unit + '.c'
)
cflags = [
'-DTEST_SRCDIR="@0@"'.format(meson.current_source_dir()),
'-DTEST_TOPSRCDIR="@0@"'.format(meson.source_root())
]
exe = executable(
test_unit,
sources,
include_directories: top_inc,
dependencies: [ common_deps, libwidgets_dep ],
c_args: cflags
)
test(test_unit, exe)

View file

@ -129,8 +129,8 @@ int main (int argc, char **argv)
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/shell/hostname", test_hostname);
g_test_add_func ("/shell/ssid", test_ssid);
g_test_add_func ("/common/hostname", test_hostname);
g_test_add_func ("/common/ssid", test_ssid);
return g_test_run ();
}

View file

@ -25,7 +25,7 @@
#include <langinfo.h>
#include <sys/time.h>
#include "shell/list-box-helper.h"
#include "list-box-helper.h"
#include "cc-timezone-map.h"
#include "timedated.h"
#include "date-endian.h"

View file

@ -186,7 +186,7 @@ cflags += [
panels_libs += static_library(
cappletname,
sources: sources + resources,
include_directories: top_inc,
include_directories: [ top_inc, common_inc ],
dependencies: deps,
c_args: cflags
)

View file

@ -30,7 +30,7 @@
#include <math.h>
#include "shell/cc-object-storage.h"
#include "shell/list-box-helper.h"
#include "list-box-helper.h"
#include <libupower-glib/upower.h>
#include "cc-display-config-manager-dbus.h"

View file

@ -58,7 +58,7 @@ cflags += [
panels_libs += static_library(
cappletname,
sources: sources,
include_directories: top_inc,
include_directories: [ top_inc, common_inc ],
dependencies: deps,
c_args: cflags
)

View file

@ -21,8 +21,8 @@
#include <config.h>
#include "shell/cc-hostname-entry.h"
#include "shell/cc-object-storage.h"
#include "cc-hostname-entry.h"
#include "cc-info-resources.h"
#include "info-cleanup.h"

View file

@ -67,7 +67,7 @@ deps = common_deps + [
panels_libs += static_library(
cappletname,
sources: sources,
include_directories: top_inc,
include_directories: [ top_inc, common_inc ],
dependencies: deps,
c_args: cflags
)

View file

@ -35,7 +35,7 @@
#include "gnome-mouse-properties.h"
#include "gsd-input-helper.h"
#include "gsd-device-manager.h"
#include "shell/list-box-helper.h"
#include "list-box-helper.h"
#include "cc-mouse-caps-helper.h"
#include <sys/types.h>

View file

@ -24,7 +24,7 @@
#include "network-dialogs.h"
#include "shell/cc-object-storage.h"
#include "shell/list-box-helper.h"
#include "list-box-helper.h"
#include <glib/gi18n.h>
#include <NetworkManager.h>

View file

@ -28,7 +28,7 @@
#include <glib/gi18n.h>
#include <NetworkManager.h>
#include "shell/list-box-helper.h"
#include "list-box-helper.h"
#include "ce-page-ip4.h"
#include "ui-helpers.h"

View file

@ -28,7 +28,7 @@
#include <glib/gi18n.h>
#include <NetworkManager.h>
#include "shell/list-box-helper.h"
#include "list-box-helper.h"
#include "ce-page-ip6.h"
#include "ui-helpers.h"

View file

@ -40,7 +40,7 @@ sources += gnome.compile_resources(
libconnection_editor = static_library(
name,
sources: sources,
include_directories: [top_inc, wireless_security_inc],
include_directories: [top_inc, common_inc, wireless_security_inc],
dependencies: deps,
c_args: cflags,
link_with: libwireless_security

View file

@ -26,7 +26,7 @@
#include <NetworkManager.h>
#include "shell/list-box-helper.h"
#include "list-box-helper.h"
#include "net-connection-editor.h"
#include "net-connection-editor-resources.h"
#include "ce-page-details.h"

View file

@ -72,7 +72,7 @@ cflags += '-DGNOMELOCALEDIR="@0@"'.format(control_center_localedir)
panels_libs += static_library(
cappletname,
sources: sources,
include_directories: top_inc,
include_directories: [top_inc, common_inc],
dependencies: deps,
c_args: cflags,
link_with: libconnection_editor

View file

@ -28,7 +28,7 @@
#include "panel-common.h"
#include "shell/list-box-helper.h"
#include "list-box-helper.h"
#include "connection-editor/net-connection-editor.h"
#include "connection-editor/ce-page.h"

View file

@ -29,8 +29,8 @@
#include <NetworkManager.h>
#include <polkit/polkit.h>
#include "shell/list-box-helper.h"
#include "shell/hostname-helper.h"
#include "list-box-helper.h"
#include "hostname-helper.h"
#include "network-dialogs.h"
#include "panel-common.h"

View file

@ -26,7 +26,7 @@
#include <gio/gio.h>
#include <gio/gdesktopappinfo.h>
#include "shell/list-box-helper.h"
#include "list-box-helper.h"
#include "cc-notifications-panel.h"
#include "cc-edit-dialog.h"

View file

@ -26,7 +26,7 @@
#include <gio/gdesktopappinfo.h>
#include "shell/cc-object-storage.h"
#include "shell/list-box-helper.h"
#include "list-box-helper.h"
#include "cc-notifications-panel.h"
#include "cc-notifications-resources.h"
#include "cc-edit-dialog.h"

View file

@ -40,7 +40,7 @@ cflags += '-DGNOMELOCALEDIR="@0@"'.format(control_center_localedir)
panels_libs += static_library(
cappletname,
sources: sources,
include_directories: top_inc,
include_directories: [ top_inc, common_inc ],
dependencies: common_deps,
c_args: cflags
)

View file

@ -32,7 +32,7 @@
#include "cc-online-accounts-panel.h"
#include "cc-online-accounts-resources.h"
#include "shell/list-box-helper.h"
#include "list-box-helper.h"
struct _CcGoaPanel
{

View file

@ -39,7 +39,7 @@ cflags += '-DGNOMELOCALEDIR="@0@"'.format(control_center_localedir)
panels_libs += static_library(
cappletname,
sources: sources,
include_directories: top_inc,
include_directories: [ top_inc, common_inc ],
dependencies: deps,
c_args: cflags
)

View file

@ -30,7 +30,7 @@
#endif
#include "shell/cc-object-storage.h"
#include "shell/list-box-helper.h"
#include "list-box-helper.h"
#include "cc-power-panel.h"
#include "cc-power-resources.h"

View file

@ -47,7 +47,7 @@ endif
panels_libs += static_library(
cappletname,
sources: sources,
include_directories: top_inc,
include_directories: [ top_inc, common_inc ],
dependencies: deps,
c_args: cflags
)

View file

@ -31,7 +31,7 @@
#include <cups/cups.h>
#include "shell/list-box-helper.h"
#include "list-box-helper.h"
#include "pp-jobs-dialog.h"
#include "pp-utils.h"
#include "pp-job.h"

View file

@ -19,7 +19,7 @@
*/
#include "shell/cc-object-storage.h"
#include "shell/list-box-helper.h"
#include "list-box-helper.h"
#include "cc-privacy-panel.h"
#include "cc-privacy-resources.h"
#include "cc-util.h"

View file

@ -27,7 +27,7 @@
#include <string.h>
#include <glib/gi18n.h>
#include "shell/list-box-helper.h"
#include "list-box-helper.h"
#include "cc-common-language.h"
#include "cc-util.h"

View file

@ -22,7 +22,7 @@
#define GNOME_DESKTOP_USE_UNSTABLE_API
#include <libgnome-desktop/gnome-languages.h>
#include "shell/list-box-helper.h"
#include "list-box-helper.h"
#include "cc-common-language.h"
#include "cc-util.h"
#include "cc-input-chooser.h"

View file

@ -27,7 +27,7 @@
#include <polkit/polkit.h>
#include "shell/cc-object-storage.h"
#include "shell/list-box-helper.h"
#include "list-box-helper.h"
#include "cc-region-panel.h"
#include "cc-region-resources.h"
#include "cc-language-chooser.h"

View file

@ -19,7 +19,7 @@
*/
#include "cc-search-locations-dialog.h"
#include "shell/list-box-helper.h"
#include "list-box-helper.h"
#include <glib/gi18n.h>

View file

@ -21,7 +21,7 @@
#include "cc-search-panel.h"
#include "cc-search-locations-dialog.h"
#include "cc-search-resources.h"
#include "shell/list-box-helper.h"
#include "list-box-helper.h"
#include <gio/gdesktopappinfo.h>
#include <glib/gi18n.h>

View file

@ -43,7 +43,7 @@ cflags += [
panels_libs += static_library(
cappletname,
sources: sources,
include_directories: top_inc,
include_directories: [ top_inc, common_inc ],
dependencies: common_deps,
c_args: cflags
)

View file

@ -26,7 +26,7 @@
#include "cc-sharing-networks.h"
#include "org.gnome.SettingsDaemon.Sharing.h"
#include "gsd-sharing-enums.h"
#include "shell/list-box-helper.h"
#include "list-box-helper.h"
struct _CcSharingNetworksPrivate {
GtkWidget *listbox;

View file

@ -20,9 +20,9 @@
*/
#include "cc-sharing-panel.h"
#include "shell/cc-hostname-entry.h"
#include "cc-hostname-entry.h"
#include "shell/list-box-helper.h"
#include "list-box-helper.h"
#include "cc-sharing-resources.h"
#include "vino-preferences.h"
#include "cc-remote-login.h"

View file

@ -78,7 +78,7 @@ cflags += [
panels_libs += static_library(
cappletname,
sources: sources,
include_directories: top_inc,
include_directories: [ top_inc, common_inc ],
dependencies: common_deps,
c_args: cflags
)

View file

@ -20,7 +20,7 @@
#include <config.h>
#include <shell/cc-panel.h>
#include <shell/list-box-helper.h>
#include <list-box-helper.h>
#include <glib/gi18n.h>
#include <polkit/polkit.h>

View file

@ -68,7 +68,7 @@ cflags += [
panels_libs += static_library(
cappletname,
sources: sources,
include_directories: top_inc,
include_directories: [top_inc, common_inc],
dependencies: deps,
c_args: cflags
)

View file

@ -27,7 +27,7 @@
#include <glib/gi18n-lib.h>
#include <gdesktop-enums.h>
#include "shell/list-box-helper.h"
#include "list-box-helper.h"
#include "cc-ua-panel.h"
#include "cc-ua-resources.h"

View file

@ -47,7 +47,7 @@ cflags += '-DGNOMELOCALEDIR="@0@"'.format(control_center_localedir)
panels_libs += static_library(
cappletname,
sources: sources,
include_directories: top_inc,
include_directories: [ top_inc, common_inc ],
dependencies: deps,
c_args: cflags
)

View file

@ -42,9 +42,8 @@ libshell = static_library(
c_args: cflags
)
common_sources = files(
sources = files(
'cc-application.c',
'cc-hostname-entry.c',
'cc-log.c',
'cc-object-storage.c',
'cc-panel-loader.c',
@ -52,8 +51,6 @@ common_sources = files(
'cc-shell-category-view.c',
'cc-shell-item-view.c',
'cc-shell.c',
'hostname-helper.c',
'list-box-helper.c',
'main.c'
)
@ -63,14 +60,14 @@ resource_data = files(
'window.ui'
)
common_sources += gnome.compile_resources(
sources += gnome.compile_resources(
'resources',
meson.project_name() + '.gresource.xml',
dependencies: resource_data,
export: true
)
sources = common_sources + files(
sources += files(
'cc-panel-list.c',
'cc-window.c'
)
@ -78,7 +75,7 @@ sources = common_sources + files(
shell_deps = common_deps + [
libdevice_dep,
liblanguage_dep,
polkit_gobject_dep,
libwidgets_dep,
x11_dep
]
@ -122,27 +119,5 @@ libpanel_loader = static_library(
c_args: cflags + ['-DCC_PANEL_LOADER_NO_GTYPES']
)
test_unit = 'test-hostname'
sources = files(
'hostname-helper.c',
test_unit + '.c'
)
cflags += [
'-DTEST_SRCDIR="@0@"'.format(meson.current_source_dir()),
'-DTEST_TOPSRCDIR="@0@"'.format(meson.source_root())
]
exe = executable(
test_unit,
sources,
include_directories: top_inc,
dependencies: common_deps,
c_args: cflags
)
test(test_unit, exe)
install_data ('org.gnome.ControlCenter.gschema.xml',
install_dir: control_center_schemadir)