Commit 6a10ec12 authored by Alberts Muktupāvels's avatar Alberts Muktupāvels

menu: new module for menu applets

parent 558cb397
......@@ -155,6 +155,11 @@ PKG_CHECK_MODULES(FISH, gtk+-3.0 >= $GTK_REQUIRED cairo >= $CAIRO_REQUIRED)
AC_SUBST(FISH_CFLAGS)
AC_SUBST(FISH_LIBS)
PKG_CHECK_MODULES([MENU], [
gtk+-3.0 >= $GTK_REQUIRED
libgnome-menu-3.0 >= $LIBGNOME_MENU_REQUIRED
])
PKG_CHECK_MODULES([NOTIFICATION_AREA], [
gtk+-3.0 >= $GTK_REQUIRED
x11
......@@ -282,6 +287,7 @@ AC_CONFIG_FILES([
modules/clock/Makefile
modules/clock/pixmaps/Makefile
modules/fish/Makefile
modules/menu/Makefile
modules/notification-area/Makefile
modules/separator/Makefile
modules/status-notifier/Makefile
......
......@@ -3,6 +3,7 @@ NULL =
SUBDIRS = \
clock \
fish \
menu \
notification-area \
separator \
status-notifier \
......
NULL =
menu_libdir = $(libdir)/gnome-panel/modules
menu_lib_LTLIBRARIES = menu.la
menu_la_CPPFLAGS = \
-DLOCALEDIR=\""$(localedir)"\" \
-DG_LOG_DOMAIN=\""menu"\" \
-DG_LOG_USE_STRUCTURED=1 \
-I$(top_srcdir) \
$(AM_CPPFLAGS) \
$(NULL)
menu_la_CFLAGS = \
$(LIBGNOME_PANEL_CFLAGS) \
$(MENU_CFLAGS) \
$(WARN_CFLAGS) \
$(AM_CFLAGS) \
$(NULL)
menu_la_SOURCES = \
main-menu-applet.c \
main-menu-applet.h \
menu-bar-applet.c \
menu-bar-applet.h \
menu-module.c \
user-menu-applet.c \
user-menu-applet.h \
$(NULL)
menu_la_LIBADD = \
$(top_builddir)/libgnome-panel/libgnome-panel.la \
$(LIBGNOME_PANEL_LIBS) \
$(MENU_LIBS) \
$(NULL)
menu_la_LDFLAGS = \
-module -avoid-version \
$(WARN_LDFLAGS) \
$(AM_LDFLAGS) \
$(NULL)
-include $(top_srcdir)/git.mk
/*
* Copyright (C) 2018 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 "main-menu-applet.h"
struct _MainMenuApplet
{
GpApplet parent;
};
G_DEFINE_TYPE (MainMenuApplet, main_menu_applet, GP_TYPE_APPLET)
static void
main_menu_applet_class_init (MainMenuAppletClass *main_menu_class)
{
}
static void
main_menu_applet_init (MainMenuApplet *main_menu)
{
}
/*
* Copyright (C) 2018 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 MAIN_MENU_APPLET_H
#define MAIN_MENU_APPLET_H
#include <libgnome-panel/gp-applet.h>
G_BEGIN_DECLS
#define MAIN_MENU_TYPE_APPLET (main_menu_applet_get_type ())
G_DECLARE_FINAL_TYPE (MainMenuApplet, main_menu_applet,
MAIN_MENU, APPLET, GpApplet)
G_END_DECLS
#endif
/*
* Copyright (C) 2018 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 "menu-bar-applet.h"
struct _MenuBarApplet
{
GpApplet parent;
};
G_DEFINE_TYPE (MenuBarApplet, menu_bar_applet, GP_TYPE_APPLET)
static void
menu_bar_applet_class_init (MenuBarAppletClass *menu_bar_class)
{
}
static void
menu_bar_applet_init (MenuBarApplet *menu_bar)
{
}
/*
* Copyright (C) 2018 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 MENU_BAR_APPLET_H
#define MENU_BAR_APPLET_H
#include <libgnome-panel/gp-applet.h>
G_BEGIN_DECLS
#define MENU_BAR_TYPE_APPLET (menu_bar_applet_get_type ())
G_DECLARE_FINAL_TYPE (MenuBarApplet, menu_bar_applet,
MENU_BAR, APPLET, GpApplet)
G_END_DECLS
#endif
/*
* Copyright (C) 2018 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 <glib/gi18n-lib.h>
#include <libgnome-panel/gp-module.h>
#include "main-menu-applet.h"
#include "menu-bar-applet.h"
#include "user-menu-applet.h"
static GpAppletInfo *
menu_get_applet_info (const gchar *id)
{
GpGetAppletTypeFunc type_func;
const gchar *name;
const gchar *description;
const gchar *icon;
GpAppletInfo *info;
if (g_strcmp0 (id, "main-menu") == 0)
{
type_func = main_menu_applet_get_type;
name = _("Main Menu");
description = _("The main GNOME menu");
icon = "start-here";
}
else if (g_strcmp0 (id, "menu-bar") == 0)
{
type_func = menu_bar_applet_get_type;
name = _("Menu Bar");
description = _("A custom menu bar");
icon = "start-here";
}
else if (g_strcmp0 (id, "user-menu") == 0)
{
type_func = user_menu_applet_get_type;
name = _("User menu");
description = _("Menu to change your settings and log out");
icon = "computer";
}
else
{
g_assert_not_reached ();
return NULL;
}
info = gp_applet_info_new (type_func, name, description, icon);
return info;
}
void
gp_module_load (GpModule *module)
{
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
gp_module_set_gettext_domain (module, GETTEXT_PACKAGE);
gp_module_set_abi_version (module, GP_MODULE_ABI_VERSION);
gp_module_set_id (module, "org.gnome.gnome-panel.menu");
gp_module_set_version (module, PACKAGE_VERSION);
gp_module_set_applet_ids (module, "main-menu", "menu-bar", "user-menu", NULL);
gp_module_set_get_applet_info (module, menu_get_applet_info);
}
/*
* Copyright (C) 2018 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 "user-menu-applet.h"
struct _UserMenuApplet
{
GpApplet parent;
};
G_DEFINE_TYPE (UserMenuApplet, user_menu_applet, GP_TYPE_APPLET)
static void
user_menu_applet_class_init (UserMenuAppletClass *user_menu_class)
{
}
static void
user_menu_applet_init (UserMenuApplet *user_menu)
{
}
/*
* Copyright (C) 2018 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 USER_MENU_APPLET_H
#define USER_MENU_APPLET_H
#include <libgnome-panel/gp-applet.h>
G_BEGIN_DECLS
#define USER_MENU_TYPE_APPLET (user_menu_applet_get_type ())
G_DECLARE_FINAL_TYPE (UserMenuApplet, user_menu_applet,
USER_MENU, APPLET, GpApplet)
G_END_DECLS
#endif
......@@ -59,6 +59,7 @@ modules/fish/fish-applet.c
modules/fish/fish-module.c
modules/fish/fish-menu.ui
modules/fish/fish.ui
modules/menu/menu-module.c
modules/notification-area/na-applet.c
modules/notification-area/na-module.c
modules/notification-area/na-tray-manager.c
......
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