AsCategory

AsCategory — Description of an XDG Menu category

Synopsis

#define             AS_TYPE_CATEGORY
void                as_category_add_subcategory         (AsCategory *self,
                                                         AsCategory *cat);
void                as_category_remove_subcategory      (AsCategory *self,
                                                         AsCategory *cat);
gboolean            as_category_has_subcategory         (AsCategory *self);
AsCategory *        as_category_new                     (void);
const gchar *       as_category_get_name                (AsCategory *self);
const gchar *       as_category_get_summary             (AsCategory *self);
const gchar *       as_category_get_icon                (AsCategory *self);
const gchar *       as_category_get_directory           (AsCategory *self);
GList *             as_category_get_included            (AsCategory *self);
GList *             as_category_get_excluded            (AsCategory *self);
gint                as_category_get_level               (AsCategory *self);
GList *             as_category_get_subcategories       (AsCategory *self);
struct              AsCategory;
struct              AsCategoryClass;
#define             AS_TYPE_MENU_PARSER
GList *             as_menu_parser_parse                (AsMenuParser *self);
AsMenuParser *      as_menu_parser_new                  (void);
AsMenuParser *      as_menu_parser_new_from_file        (const gchar *menu_file);
gboolean            as_menu_parser_get_update_category_data
                                                        (AsMenuParser *self);
void                as_menu_parser_set_update_category_data
                                                        (AsMenuParser *self,
                                                         gboolean value);
struct              AsMenuParser;
gpointer            as_menu_parser_ref                  (gpointer instance);
void                as_menu_parser_unref                (gpointer instance);
GParamSpec *        as_param_spec_menu_parser           (const gchar *name,
                                                         const gchar *nick,
                                                         const gchar *blurb,
                                                         GType object_type,
                                                         GParamFlags flags);
void                as_value_set_menu_parser            (GValue *value,
                                                         gpointer v_object);
gpointer            as_value_get_menu_parser            (const GValue *value);
void                as_value_take_menu_parser           (GValue *value,
                                                         gpointer v_object);
struct              AsMenuParserClass;
GList *             as_get_system_categories            (void);

Description

Details

AS_TYPE_CATEGORY

#define AS_TYPE_CATEGORY (as_category_get_type ())

The type for AsCategory.


as_category_add_subcategory ()

void                as_category_add_subcategory         (AsCategory *self,
                                                         AsCategory *cat);

self :

the AsCategory instance

cat :

 

as_category_remove_subcategory ()

void                as_category_remove_subcategory      (AsCategory *self,
                                                         AsCategory *cat);

self :

the AsCategory instance

cat :

 

as_category_has_subcategory ()

gboolean            as_category_has_subcategory         (AsCategory *self);

self :

the AsCategory instance

Returns :

TRUE if this category has any subcategory

as_category_new ()

AsCategory *        as_category_new                     (void);

as_category_get_name ()

const gchar *       as_category_get_name                (AsCategory *self);

Get and return the current value of the "name" property.

self :

the AsCategory instance to query

Returns :

the value of the "name" property

as_category_get_summary ()

const gchar *       as_category_get_summary             (AsCategory *self);

Get and return the current value of the "summary" property.

self :

the AsCategory instance to query

Returns :

the value of the "summary" property

as_category_get_icon ()

const gchar *       as_category_get_icon                (AsCategory *self);

Get and return the current value of the "icon" property.

self :

the AsCategory instance to query

Returns :

the value of the "icon" property

as_category_get_directory ()

const gchar *       as_category_get_directory           (AsCategory *self);

Get and return the current value of the "directory" property.

self :

the AsCategory instance to query

Returns :

the value of the "directory" property

as_category_get_included ()

GList *             as_category_get_included            (AsCategory *self);

Get and return the current value of the "included" property.

self :

the AsCategory instance to query

Returns :

the value of the "included" property

as_category_get_excluded ()

GList *             as_category_get_excluded            (AsCategory *self);

Get and return the current value of the "excluded" property.

self :

the AsCategory instance to query

Returns :

the value of the "excluded" property

as_category_get_level ()

gint                as_category_get_level               (AsCategory *self);

Get and return the current value of the "level" property.

self :

the AsCategory instance to query

Returns :

the value of the "level" property

as_category_get_subcategories ()

GList *             as_category_get_subcategories       (AsCategory *self);

Get and return the current value of the "subcategories" property.

self :

the AsCategory instance to query

Returns :

the value of the "subcategories" property

struct AsCategory

struct AsCategory {
	GObject parent_instance;
	AsCategoryPrivate * priv;
};

Description of an XDG Menu category


struct AsCategoryClass

struct AsCategoryClass {
	GObjectClass parent_class;
};

The class structure for AS_TYPE_CATEGORY. All the fields in this structure are private and should never be accessed directly.

GObjectClass parent_class;

the parent class structure

AS_TYPE_MENU_PARSER

#define AS_TYPE_MENU_PARSER (as_menu_parser_get_type ())

The type for AsMenuParser.


as_menu_parser_parse ()

GList *             as_menu_parser_parse                (AsMenuParser *self);

Parse the menu file

self :

the AsMenuParser instance

Returns :

GList of Category objects found in the Menu, or NULL if there was an error

as_menu_parser_new ()

AsMenuParser *      as_menu_parser_new                  (void);

Create a new MenuParser for the generic AppStream categories list


as_menu_parser_new_from_file ()

AsMenuParser *      as_menu_parser_new_from_file        (const gchar *menu_file);

Create a new MenuParser for an arbitrary menu file

menu_file :

 

as_menu_parser_get_update_category_data ()

gboolean            as_menu_parser_get_update_category_data
                                                        (AsMenuParser *self);

Get and return the current value of the "update-category-data" property.

self :

the AsMenuParser instance to query

Returns :

the value of the "update-category-data" property

as_menu_parser_set_update_category_data ()

void                as_menu_parser_set_update_category_data
                                                        (AsMenuParser *self,
                                                         gboolean value);

Set the value of the "update-category-data" property to value.

self :

the AsMenuParser instance to modify

value :

the new value of the "update-category-data" property

struct AsMenuParser

struct AsMenuParser {
	GTypeInstance parent_instance;
	volatile int ref_count;
	AsMenuParserPrivate * priv;
};

Parser for XDG Menu files


as_menu_parser_ref ()

gpointer            as_menu_parser_ref                  (gpointer instance);

Increases the reference count of object.

instance :

a AsMenuParser.

Returns :

the same object

as_menu_parser_unref ()

void                as_menu_parser_unref                (gpointer instance);

Decreases the reference count of object. When its reference count drops to 0, the object is finalized (i.e. its memory is freed).

instance :

a AsMenuParser.

as_param_spec_menu_parser ()

GParamSpec *        as_param_spec_menu_parser           (const gchar *name,
                                                         const gchar *nick,
                                                         const gchar *blurb,
                                                         GType object_type,
                                                         GParamFlags flags);

Creates a new GParamSpecBoxed instance specifying a AS_TYPE_MENU_PARSER derived property.

See g_param_spec_internal() for details on property names.

name :

canonical name of the property specified

nick :

nick name for the property specified

blurb :

description of the property specified

object_type :

AS_TYPE_MENU_PARSER derived type of this property

flags :

flags for the property specified

as_value_set_menu_parser ()

void                as_value_set_menu_parser            (GValue *value,
                                                         gpointer v_object);

Set the contents of a AS_TYPE_MENU_PARSER derived GValue to v_object.

as_value_set_menu_parser() increases the reference count of v_object (the GValue holds a reference to v_object). If you do not wish to increase the reference count of the object (i.e. you wish to pass your current reference to the GValue because you no longer need it), use as_value_take_menu_parser() instead.

It is important that your GValue holds a reference to v_object (either its own, or one it has taken) to ensure that the object won't be destroyed while the GValue still exists).

value :

a valid GValue of AS_TYPE_MENU_PARSER derived type

v_object :

object value to be set

as_value_get_menu_parser ()

gpointer            as_value_get_menu_parser            (const GValue *value);

Get the contents of a AS_TYPE_MENU_PARSER derived GValue.

value :

a valid GValue of AS_TYPE_MENU_PARSER derived type

Returns :

object contents of value

as_value_take_menu_parser ()

void                as_value_take_menu_parser           (GValue *value,
                                                         gpointer v_object);

Sets the contents of a AS_TYPE_MENU_PARSER derived GValue to v_object and takes over the ownership of the callers reference to v_object; the caller doesn't have to unref it any more (i.e. the reference count of the object is not increased).

If you want the GValue to hold its own reference to v_object, use as_value_set_menu_parser() instead.

value :

a valid GValue of AS_TYPE_MENU_PARSER derived type

v_object :

object value to be set

struct AsMenuParserClass

struct AsMenuParserClass {
	GTypeClass parent_class;
	void (*finalize) (AsMenuParser *self);
};

The class structure for AS_TYPE_MENU_PARSER. All the fields in this structure are private and should never be accessed directly.

GTypeClass parent_class;

the parent class structure

finalize ()


as_get_system_categories ()

GList *             as_get_system_categories            (void);

Get a GList of the default AppStream categories

self :

the (null) instance