Commit 02d900dc authored by Alberts Muktupāvels's avatar Alberts Muktupāvels

modules: add builtin library

parent 65426d2b
......@@ -151,6 +151,10 @@ PKG_CHECK_MODULES([LIBPANEL_APPLET], [
x11
])
PKG_CHECK_MODULES([BUILTIN], [
gio-2.0 >= $GLIB_REQUIRED
])
PKG_CHECK_MODULES(FISH, gtk+-3.0 >= $GTK_REQUIRED cairo >= $CAIRO_REQUIRED)
AC_SUBST(FISH_CFLAGS)
AC_SUBST(FISH_LIBS)
......@@ -275,6 +279,7 @@ AC_CONFIG_FILES([
man/Makefile
modules/Makefile
modules/builtin/Makefile
modules/external/Makefile
modules/external/clock/Makefile
modules/external/clock/pixmaps/Makefile
......
......@@ -36,6 +36,7 @@ libpanel_applet_private_la_SOURCES = \
libpanel_applet_private_la_LIBADD = \
$(top_builddir)/libgnome-panel/libgnome-panel.la \
$(top_builddir)/modules/builtin/libbuiltin.la \
$(NULL)
libpanel_applet_private_la_LDFLAGS = \
......
......@@ -23,6 +23,7 @@
#include "gp-applet-manager.h"
#include "gp-module-private.h"
#include "libgnome-panel/gp-applet-info-private.h"
#include "modules/builtin/gp-builtin.h"
struct _GpAppletManager
{
......@@ -73,7 +74,29 @@ get_applet_infos (GpAppletManager *manager,
}
static void
load_modules (GpAppletManager *manager)
load_builtin_modules (GpAppletManager *manager)
{
guint i;
for (i = 0; builtin[i] != NULL; i++)
{
GpModule *module;
const gchar *id;
module = gp_module_new_from_vtable (builtin[i]);
if (module == NULL)
continue;
id = gp_module_get_id (module);
g_hash_table_insert (manager->modules, g_strdup (id), module);
get_applet_infos (manager, id, module);
}
}
static void
load_external_modules (GpAppletManager *manager)
{
GDir *dir;
const gchar *name;
......@@ -339,5 +362,6 @@ gp_applet_manager_init (GpAppletManager *manager)
manager->infos = g_hash_table_new_full (g_str_hash, g_str_equal,
g_free, applet_info_free);
load_modules (manager);
load_builtin_modules (manager);
load_external_modules (manager);
}
NULL =
SUBDIRS = \
builtin \
external \
$(NULL)
......
NULL =
noinst_LTLIBRARIES = libbuiltin.la
libbuiltin_la_SOURCES = \
gp-builtin.c \
gp-builtin.h \
$(NULL)
libbuiltin_la_CPPFLAGS = \
-DG_LOG_DOMAIN=\"libbuiltin\" \
-DG_LOG_USE_STRUCTURED=1 \
-I$(top_srcdir) \
$(AM_CPPFLAGS) \
$(NULL)
libbuiltin_la_CFLAGS = \
$(LIBGNOME_PANEL_CFLAGS) \
$(BUILTIN_CFLAGS) \
$(AM_CFLAGS) \
$(NULL)
libbuiltin_la_LDFLAGS = \
$(WARN_LDFLAGS) \
$(AM_LDFLAGS) \
$(NULL)
libbuiltin_la_LIBADD = \
$(top_builddir)/libgnome-panel/libgnome-panel.la \
$(LIBGNOME_PANEL_LIBS) \
$(BUILTIN_LIBS) \
$(NULL)
-include $(top_srcdir)/git.mk
/*
* Copyright (C) 2016 Alberts Muktupāvels
*
* 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, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include "gp-builtin.h"
const GpModuleVTable *builtin[] =
{
NULL
};
/*
* Copyright (C) 2016 Alberts Muktupāvels
*
* 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, see <http://www.gnu.org/licenses/>.
*/
#ifndef GP_BUILTIN_H
#define GP_BUILTIN_H
#include <libgnome-panel/gp-module.h>
G_BEGIN_DECLS
extern const GpModuleVTable *builtin[];
G_END_DECLS
#endif
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