From c51ef797a707f4e2c6f9688d4378f2b0e9898a66 Mon Sep 17 00:00:00 2001 From: Perberos Date: Thu, 1 Dec 2011 22:56:10 -0300 Subject: moving from https://github.com/perberos/mate-desktop-environment --- mate-panel/mate-panel-applet-info.c | 113 ++++++++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 mate-panel/mate-panel-applet-info.c (limited to 'mate-panel/mate-panel-applet-info.c') diff --git a/mate-panel/mate-panel-applet-info.c b/mate-panel/mate-panel-applet-info.c new file mode 100644 index 00000000..123b0806 --- /dev/null +++ b/mate-panel/mate-panel-applet-info.c @@ -0,0 +1,113 @@ +/* + * mate-panel-applet-info.c + * + * Copyright (C) 2010 Carlos Garcia Campos + * Copyright (C) 2010 Vincent Untz + * + * 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 + +#include "mate-panel-applet-info.h" + +struct _MatePanelAppletInfo { + gchar *iid; + + gchar *name; + gchar *comment; + gchar *icon; + + gchar **old_ids; +}; + +MatePanelAppletInfo * +mate_panel_applet_info_new (const gchar *iid, + const gchar *name, + const gchar *comment, + const gchar *icon, + const gchar **old_ids) +{ + MatePanelAppletInfo *info; + int len; + + info = g_slice_new0 (MatePanelAppletInfo); + + info->iid = g_strdup (iid); + info->name = g_strdup (name); + info->comment = g_strdup (comment); + info->icon = g_strdup (icon); + + /* MateComponent compatibility */ + if (old_ids != NULL) { + len = g_strv_length ((gchar **) old_ids); + if (len > 0) { + int i; + + info->old_ids = g_new0 (gchar *, len + 1); + + for (i = 0; i < len; i++) + info->old_ids[i] = g_strdup (old_ids[i]); + } + } + + return info; +} + +void +mate_panel_applet_info_free (MatePanelAppletInfo *info) +{ + if (!info) + return; + + g_free (info->iid); + g_free (info->name); + g_free (info->comment); + g_free (info->icon); + g_strfreev (info->old_ids); + + g_slice_free (MatePanelAppletInfo, info); +} + +const gchar * +mate_panel_applet_info_get_iid (MatePanelAppletInfo *info) +{ + return info->iid; +} + +const gchar * +mate_panel_applet_info_get_name (MatePanelAppletInfo *info) +{ + return info->name; +} + +const gchar * +mate_panel_applet_info_get_description (MatePanelAppletInfo *info) +{ + return info->comment; +} + +const gchar * +mate_panel_applet_info_get_icon (MatePanelAppletInfo *info) +{ + return info->icon; +} + +const gchar * const * +mate_panel_applet_info_get_old_ids (MatePanelAppletInfo *info) +{ + return (const gchar * const *) info->old_ids; +} -- cgit v1.2.1