Skip to content
Snippets Groups Projects
Commit 16f4b0a5 authored by Jannis Pohlmann's avatar Jannis Pohlmann
Browse files

* libxfce4menu/libxfce4menu.c: Add missing source file.

	* docs/reference/: Try to get the damn docs right.
	* libxfce4menu/libxfce4menu.{c,h}, libxfce4menu/xfce-menu.c: Move
	  xfce_menu_init() and xfce_menu_shutdown() into libxfce4menu.{c,h}.
	  Fix #undef LIBXFCE4MENU_INSIDE_LIBXFCE4MENU_H.
	* libxfce4menu/xfce-menu-node.{c,h}: Make XfceMenuNodeType enum code
	  private.
parent ddc429f7
No related branches found
No related tags found
No related merge requests found
2009-02-24 Jannis Pohlmann <jannis@xfce.org>
* libxfce4menu/libxfce4menu.c: Add missing source file.
2009-02-24 Jannis Pohlmann <jannis@xfce.org>
* docs/reference/: Try to get the damn docs right.
* libxfce4menu/libxfce4menu.{c,h}, libxfce4menu/xfce-menu.c: Move
xfce_menu_init() and xfce_menu_shutdown() into libxfce4menu.{c,h}.
Fix #undef LIBXFCE4MENU_INSIDE_LIBXFCE4MENU_H.
* libxfce4menu/xfce-menu-node.{c,h}: Make XfceMenuNodeType enum code
private.
2009-02-24 Jannis Pohlmann <jannis@xfce.org>
* docs/reference/: Remove tmpl/ subdir.
......
/* vi:set et ai sw=2 sts=2 ts=2: */
/*-
* Copyright (c) 2009 Jannis Pohlmann <jannis@xfce.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <glib.h>
#include <libxfce4menu/libxfce4menu.h>
#include <libxfce4menu/xfce-menu-environment.h>
#include <libxfce4menu/xfce-menu-directory.h>
#include <libxfce4menu/xfce-menu-item-cache.h>
#include <libxfce4menu/xfce-menu-item-pool.h>
#include <libxfce4menu/xfce-menu-separator.h>
/**
* SECTION:xfce-menu-init-shutdown
* @title: Library Initialization and Shutdown
*
* Library Initialization and Shutdown
**/
static gint xfce_menu_ref_count = 0;
/**
* xfce_menu_init:
* @env : Name of the desktop environment (e.g. XFCE, GNOME, KDE) or %NULL.
*
* Initializes the libxfce4menu library and optionally defines the desktop
* environment for which menus will be generated. This means items belonging
* only to other desktop environments will be ignored.
**/
void
xfce_menu_init (const gchar *env)
{
if (g_atomic_int_exchange_and_add (&xfce_menu_ref_count, 1) == 0)
{
/* Initialize the GThread system */
if (!g_thread_supported ())
g_thread_init (NULL);
/* Initialize the GObject type system */
g_type_init ();
/* Set desktop environment */
xfce_menu_set_environment (env);
/* Initialize the menu item cache */
_xfce_menu_item_cache_init ();
/* Initialize the directory module */
_xfce_menu_directory_init ();
/* Initialize monitoring system */
_xfce_menu_monitor_init ();
/* Creates the menu separator */
_xfce_menu_separator_init ();
}
}
/**
* xfce_menu_shutdown:
*
* Shuts down the libxfce4menu library.
**/
void
xfce_menu_shutdown (void)
{
if (g_atomic_int_dec_and_test (&xfce_menu_ref_count))
{
/* Unset desktop environment */
xfce_menu_set_environment (NULL);
/* Destroys the menu separator */
_xfce_menu_separator_shutdown ();
/* Shutdown monitoring system */
_xfce_menu_monitor_shutdown ();
/* Shutdown the directory module */
_xfce_menu_directory_shutdown ();
/* Shutdown the menu item cache */
_xfce_menu_item_cache_shutdown ();
}
}
......@@ -170,7 +170,7 @@ xfce_menu_node_class_init (XfceMenuNodeClass *klass)
g_param_spec_enum ("node-type",
"node-type",
"node-type",
XFCE_MENU_NODE_TYPE,
xfce_menu_node_type_get_type (),
XFCE_MENU_NODE_TYPE_MENU,
G_PARAM_READABLE | G_PARAM_WRITABLE));
}
......
......@@ -66,7 +66,7 @@ typedef enum
XFCE_MENU_NODE_TYPE_DEFAULT_MERGE_DIRS,
} XfceMenuNodeType;
#define XFCE_MENU_NODE_TYPE (xfce_menu_node_type_get_type ())
typedef enum
{
......@@ -81,6 +81,8 @@ typedef enum
XFCE_MENU_MERGE_FILE_PARENT,
} XfceMenuMergeFileType;
typedef union _XfceMenuNodeData XfceMenuNodeData;
typedef struct _XfceMenuNodeClass XfceMenuNodeClass;
typedef struct _XfceMenuNode XfceMenuNode;
......@@ -92,8 +94,6 @@ typedef struct _XfceMenuNode XfceMenuNode;
#define XFCE_IS_MENU_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XFCE_TYPE_MENU_NODE)
#define XFCE_MENU_NODE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XFCE_TYPE_MENU_NODE, XfceMenuNodeClass))
GType xfce_menu_node_type_get_type (void) G_GNUC_CONST;
GType xfce_menu_node_get_type (void) G_GNUC_CONST;
XfceMenuNode *xfce_menu_node_new (XfceMenuNodeType node_type) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment