Commit 3686cf7e authored by Bastien Nocera's avatar Bastien Nocera
Browse files

shell: Make all control-center plugins static

This makes loading faster, with less I/O, avoids unnecessary
code duplication (around 1k lines shaved), and ensures that
all the panels link and work appropriately.

By the same token, it will stop external panels from being
created, and loaded.

https://bugzilla.gnome.org/show_bug.cgi?id=690036
parent 80dc7c83
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
SUBDIRS = po egg-list-box shell panels
SUBDIRS = po egg-list-box panels shell
if BUILD_DOCUMENTATION
SUBDIRS += man
endif
DIST_SUBDIRS = po shell panels man
DIST_SUBDIRS = po panels shell man
MAINTAINERCLEANFILES = \
$(srcdir)/INSTALL \
......
......@@ -176,12 +176,17 @@ PKG_CHECK_MODULES(NETWORK_MANAGER, NetworkManager >= $NETWORK_MANAGER_REQUIRED_V
[have_networkmanager=yes], have_networkmanager=no)
if test "x$have_networkmanager" = xno ; then
AC_MSG_WARN(*** Network panel will not be built (NetworkManager ~0.9 or newer not found) ***)
else
AC_DEFINE(BUILD_NETWORK, 1, [Define to 1 to build the Network panel])
fi
AM_CONDITIONAL(BUILD_NETWORK, [test x$have_networkmanager = xyes])
# Check for gnome-bluetooth
PKG_CHECK_MODULES(BLUETOOTH, $COMMON_MODULES gnome-bluetooth-1.0 >= 3.5.5,
[have_bluetooth=yes], have_bluetooth=no)
if test "x$have_bluetooth" = xyes ; then
AC_DEFINE(BUILD_BLUETOOTH, 1, [Define to 1 to build the Network panel])
fi
AM_CONDITIONAL(BUILD_BLUETOOTH, [test x$have_bluetooth = xyes])
# Check for CUPS 1.4 or newer
......@@ -210,6 +215,8 @@ if test x"$enable_cups" != x"no" ; then
AC_MSG_ERROR([CUPS 1.4 or newer not found, but CUPS support requested])
fi
AC_DEFINE(BUILD_PRINTERS, 1, [Define to 1 to build the Printers panel])
CUPS_CFLAGS=`$CUPS_CONFIG --cflags | $SED -e 's/-O\w*//g' -e 's/-m\w*//g'`
CUPS_LIBS=`$CUPS_CONFIG --libs`
AC_SUBST(CUPS_CFLAGS)
......@@ -246,6 +253,7 @@ case $host_os in
gnome-settings-daemon >= $GSD_REQUIRED_VERSION
xi >= 1.2 x11 libwacom >= $LIBWACOM_REQUIRED_VERSION
gnome-desktop-3.0 >= $GNOME_DESKTOP_REQUIRED_VERSION)
AC_DEFINE(BUILD_WACOM, 1, [Define to 1 to build the Wacom panel])
have_wacom=yes
fi
;;
......@@ -294,18 +302,12 @@ dnl =======================================
dnl Panels
dnl =======================================
PANELS_DIR="${libdir}/control-center-1/panels"
AC_SUBST(PANELS_DIR)
PANEL_CFLAGS="-I\$(top_srcdir)/ -DG_LOG_DOMAIN=\"\\\"\$(cappletname)-cc-panel\\\"\""
PANEL_CFLAGS="-I\$(top_srcdir)/ -DG_LOG_DOMAIN=\"\\\"\$(cappletname)-cc-panel\\\"\" -DPANEL_ID=\"\\\"\$(cappletname)\\\"\""
AC_SUBST(PANEL_CFLAGS)
PANEL_LIBS=""
AC_SUBST(PANEL_LIBS)
PANEL_LDFLAGS="-export_dynamic -avoid-version -module -no-undefined -export-symbols-regex '^g_io_module_(load|unload)'"
AC_SUBST(PANEL_LDFLAGS)
dnl ==============================================
dnl libsocialweb
dnl ==============================================
......
......@@ -22,8 +22,7 @@ INCLUDES = \
-DPIXMAP_DIR=\""$(datadir)/gnome-control-center/pixmaps"\" \
$(NULL)
ccpanelsdir = $(PANELS_DIR)
ccpanels_LTLIBRARIES = libbackground.la
noinst_LTLIBRARIES = libbackground.la
BUILT_SOURCES = \
gdesktop-enums-types.c \
......@@ -31,7 +30,6 @@ BUILT_SOURCES = \
libbackground_la_SOURCES = \
$(BUILT_SOURCES) \
background-module.c \
cc-background-chooser-dialog.c \
cc-background-chooser-dialog.h \
cc-background-panel.c \
......@@ -51,7 +49,6 @@ libbackground_la_SOURCES = \
libbackground_la_LIBADD = $(PANEL_LIBS) $(BACKGROUND_PANEL_LIBS)
libbackground_la_LDFLAGS = $(PANEL_LDFLAGS)
if WITH_LIBSOCIALWEB
libbackground_la_SOURCES += bg-flickr-source.c bg-flickr-source.h
......
/*
* Copyright (C) 2010 Intel, Inc
*
* 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 2 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, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* Author: Thomas Wood <thomas.wood@intel.com>
*
*/
#include <config.h>
#include "cc-background-panel.h"
#include <glib/gi18n.h>
void
g_io_module_load (GIOModule *module)
{
bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
/* register the panel */
cc_background_panel_register (module);
}
void
g_io_module_unload (GIOModule *module)
{
}
......@@ -774,13 +774,3 @@ cc_background_panel_init (CcBackgroundPanel *self)
widget = WID ("background-set-button");
g_signal_connect (widget, "clicked", G_CALLBACK (on_background_button_clicked), self);
}
void
cc_background_panel_register (GIOModule *module)
{
cc_background_panel_register_type (G_TYPE_MODULE (module));
g_io_extension_point_implement (CC_SHELL_PANEL_EXTENSION_POINT,
CC_TYPE_BACKGROUND_PANEL,
"background", 0);
}
......@@ -67,8 +67,6 @@ struct _CcBackgroundPanelClass
GType cc_background_panel_get_type (void) G_GNUC_CONST;
void cc_background_panel_register (GIOModule *module);
G_END_DECLS
#endif /* _CC_BACKGROUND_PANEL_H */
# This is used in PANEL_CFLAGS
cappletname = bluetooth
ccpanelsdir = $(PANELS_DIR)
ccpanels_LTLIBRARIES = libbluetooth.la
noinst_LTLIBRARIES = libbluetooth.la
INCLUDES = \
$(PANEL_CFLAGS) \
......@@ -16,7 +15,6 @@ libbluetooth_la_SOURCES = \
cc-bluetooth-panel.h
libbluetooth_la_LIBADD = $(PANEL_LIBS) $(BLUETOOTH_LIBS)
libbluetooth_la_LDFLAGS = $(PANEL_LDFLAGS)
desktopdir = $(datadir)/applications
desktop_in_in_files = bluetooth-properties.desktop.in.in
......
......@@ -864,29 +864,3 @@ cc_bluetooth_panel_init (CcBluetoothPanel *self)
gtk_widget_show_all (GTK_WIDGET (self));
}
void
cc_bluetooth_panel_register (GIOModule *module)
{
cc_bluetooth_panel_register_type (G_TYPE_MODULE (module));
g_io_extension_point_implement (CC_SHELL_PANEL_EXTENSION_POINT,
CC_TYPE_BLUETOOTH_PANEL,
"bluetooth", 0);
}
/* GIO extension stuff */
void
g_io_module_load (GIOModule *module)
{
bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
/* register the panel */
cc_bluetooth_panel_register (module);
}
void
g_io_module_unload (GIOModule *module)
{
}
......@@ -51,8 +51,6 @@ struct CcBluetoothPanelClass {
GType cc_bluetooth_panel_get_type (void) G_GNUC_CONST;
void cc_bluetooth_panel_register (GIOModule *module);
G_END_DECLS
#endif /* _CC_BLUETOOTH_PANEL_H */
......
......@@ -11,16 +11,13 @@ INCLUDES = \
-DGNOMECC_DATA_DIR="\"$(pkgdatadir)\"" \
$(NULL)
ccpanelsdir = $(PANELS_DIR)
ccpanels_LTLIBRARIES = libcolor.la
noinst_LTLIBRARIES = libcolor.la
libcolor_la_SOURCES = \
color-module.c \
cc-color-panel.c \
cc-color-panel.h
libcolor_la_LIBADD = $(PANEL_LIBS) $(COLOR_PANEL_LIBS)
libcolor_la_LDFLAGS = $(PANEL_LDFLAGS)
uidir = $(pkgdatadir)/ui
dist_ui_DATA = color.ui
......
......@@ -2600,13 +2600,3 @@ cc_color_panel_init (CcColorPanel *prefs)
G_CALLBACK (gcm_prefs_window_realize_cb),
prefs);
}
void
cc_color_panel_register (GIOModule *module)
{
cc_color_panel_register_type (G_TYPE_MODULE (module));
g_io_extension_point_implement (CC_SHELL_PANEL_EXTENSION_POINT,
CC_TYPE_COLOR_PANEL,
"color", 0);
}
......@@ -67,8 +67,6 @@ struct _CcColorPanelClass
GType cc_color_panel_get_type (void) G_GNUC_CONST;
void cc_color_panel_register (GIOModule *module);
G_END_DECLS
#endif /* _CC_COLOR_PANEL_H */
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
*
* Copyright (C) 2010 Red Hat, Inc
* Copyright (C) 2011 Richard Hughes <richard@hughsie.com>
*
* 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 2 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, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*
*/
#include <config.h>
#include "cc-color-panel.h"
#include <glib/gi18n-lib.h>
void
g_io_module_load (GIOModule *module)
{
bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
/* register the panel */
cc_color_panel_register (module);
}
void
g_io_module_unload (GIOModule *module)
{
}
......@@ -25,8 +25,6 @@ liblanguage_la_SOURCES = \
liblanguage_la_LIBADD = \
$(LIBLANGUAGE_LIBS)
liblanguage_la_LDFLAGS = -export_dynamic -avoid-version -module -no-undefined
list_languages_SOURCES = list-languages.c
list_languages_LDADD = liblanguage.la
list_languages_CFLAGS = $(LIBLANGUAGE_CFLAGS)
......
......@@ -136,8 +136,7 @@ check-local: test-timezone-gfx test-endianess test-timezone
$(builddir)/test-endianess
# $(builddir)/test-timezone
ccpanelsdir = $(PANELS_DIR)
ccpanels_LTLIBRARIES = libdate_time.la
noinst_LTLIBRARIES = libdate_time.la
# This requires running d-bus session and accessible timedate1 daemon
......@@ -159,7 +158,6 @@ timedated.h: Makefile.am timedated1-interface.xml
$(srcdir)/timedated1-interface.xml
libdate_time_la_SOURCES = \
datetime-module.c \
cc-datetime-panel.c \
cc-datetime-panel.h \
cc-timezone-map.c \
......@@ -171,8 +169,6 @@ libdate_time_la_SOURCES = \
$(NULL)
libdate_time_la_LIBADD = $(PANEL_LIBS) $(DATETIME_PANEL_LIBS)
libdate_time_la_LDFLAGS = $(PANEL_LDFLAGS)
polkitdir = $(datadir)/polkit-1/actions
polkit_in_files = org.gnome.controlcenter.datetime.policy.in
......
......@@ -1135,15 +1135,3 @@ cc_date_time_panel_init (CcDateTimePanel *self)
G_CALLBACK (on_permission_changed), self);
on_permission_changed (priv->permission, NULL, self);
}
void
cc_date_time_panel_register (GIOModule *module)
{
bind_textdomain_codeset (GETTEXT_PACKAGE_TIMEZONES, "UTF-8");
cc_date_time_panel_register_type (G_TYPE_MODULE (module));
g_io_extension_point_implement (CC_SHELL_PANEL_EXTENSION_POINT,
CC_TYPE_DATE_TIME_PANEL,
"datetime", 0);
}
......@@ -67,8 +67,6 @@ struct _CcDateTimePanelClass
GType cc_date_time_panel_get_type (void) G_GNUC_CONST;
void cc_date_time_panel_register (GIOModule *module);
G_END_DECLS
#endif /* _CC_DATE_TIME_PANEL_H */
/*
* Copyright (C) 2010 Intel, Inc
*
* 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 2 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, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* Author: Thomas Wood <thomas.wood@intel.com>
*
*/
#include <config.h>
#include "cc-datetime-panel.h"
#include <glib/gi18n-lib.h>
#define GETTEXT_PACKAGE_TIMEZONES GETTEXT_PACKAGE "-timezones"
void
g_io_module_load (GIOModule *module)
{
bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
bindtextdomain (GETTEXT_PACKAGE_TIMEZONES, GNOMELOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE_TIMEZONES, "UTF-8");
/* register the panel */
cc_date_time_panel_register (module);
}
void
g_io_module_unload (GIOModule *module)
{
}
......@@ -12,11 +12,9 @@ foo-marshal.c: foo-marshal.h
foo-marshal.h: foo-marshal.list
$(AM_V_GEN) ( $(GLIB_GENMARSHAL) --prefix=foo_marshal $(srcdir)/foo-marshal.list --header > foo-marshal.h )
ccpanelsdir = $(PANELS_DIR)
ccpanels_LTLIBRARIES = libdisplay.la
noinst_LTLIBRARIES = libdisplay.la
libdisplay_la_SOURCES = \
display-module.c \
cc-display-panel.c \
cc-display-panel.h \
cc-rr-labeler.c \
......@@ -26,7 +24,6 @@ libdisplay_la_SOURCES = \
$(MARSHALFILES)
libdisplay_la_LIBADD = $(PANEL_LIBS) $(DISPLAY_PANEL_LIBS)
libdisplay_la_LDFLAGS = $(PANEL_LDFLAGS)
# You will need a recent intltool or the patch from this bug
# http://bugzilla.gnome.org/show_bug.cgi?id=462312
......
......@@ -2679,13 +2679,3 @@ cc_display_panel_constructor (GType gtype,
return obj;
}
void
cc_display_panel_register (GIOModule *module)
{
cc_display_panel_register_type (G_TYPE_MODULE (module));
g_io_extension_point_implement (CC_SHELL_PANEL_EXTENSION_POINT,
CC_TYPE_DISPLAY_PANEL,
"display", 0);
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment