|
Packit Service |
1d8f1c |
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
|
|
Packit Service |
1d8f1c |
/* vim:set et sts=4: */
|
|
Packit Service |
1d8f1c |
/* bus - The Input Bus
|
|
Packit Service |
1d8f1c |
* Copyright (C) 2013 Peng Huang <shawn.p.huang@gmail.com>
|
|
Packit Service |
1d8f1c |
* Copyright (C) 2013 Takao Fujiwara <takao.fujiwara1@gmail.com>
|
|
Packit Service |
1d8f1c |
* Copyright (C) 2013 Red Hat, Inc.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* This library is free software; you can redistribute it and/or
|
|
Packit Service |
1d8f1c |
* modify it under the terms of the GNU Lesser General Public
|
|
Packit Service |
1d8f1c |
* License as published by the Free Software Foundation; either
|
|
Packit Service |
1d8f1c |
* version 2.1 of the License, or (at your option) any later version.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* This library is distributed in the hope that it will be useful,
|
|
Packit Service |
1d8f1c |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
1d8f1c |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit Service |
1d8f1c |
* Lesser General Public License for more details.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* You should have received a copy of the GNU Lesser General Public
|
|
Packit Service |
1d8f1c |
* License along with this library; if not, write to the Free Software
|
|
Packit Service |
1d8f1c |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
|
|
Packit Service |
1d8f1c |
* USA
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
#if !defined (__IBUS_H_INSIDE__) && !defined (IBUS_COMPILATION)
|
|
Packit Service |
1d8f1c |
#error "Only <ibus.h> can be included directly"
|
|
Packit Service |
1d8f1c |
#endif
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
#ifndef __IBUS_REGISTRY_H_
|
|
Packit Service |
1d8f1c |
#define __IBUS_REGISTRY_H_
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* SECTION: ibusregistry
|
|
Packit Service |
1d8f1c |
* @short_description: Registry cache handling.
|
|
Packit Service |
1d8f1c |
* @title: IBusRegistry
|
|
Packit Service |
1d8f1c |
* @stability: Stable
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* An #IBusRegistry loads IBus component files and generates the cache files.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* see_also: #IBusComponent
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
#include "ibuscomponent.h"
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/*
|
|
Packit Service |
1d8f1c |
* Type macros.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/* define GOBJECT macros */
|
|
Packit Service |
1d8f1c |
#define IBUS_TYPE_REGISTRY \
|
|
Packit Service |
1d8f1c |
(ibus_registry_get_type ())
|
|
Packit Service |
1d8f1c |
#define IBUS_REGISTRY(obj) \
|
|
Packit Service |
1d8f1c |
(G_TYPE_CHECK_INSTANCE_CAST ((obj), IBUS_TYPE_REGISTRY, IBusRegistry))
|
|
Packit Service |
1d8f1c |
#define IBUS_REGISTRY_CLASS(klass) \
|
|
Packit Service |
1d8f1c |
(G_TYPE_CHECK_CLASS_CAST ((klass), IBUS_TYPE_REGISTRY, IBusRegistryClass))
|
|
Packit Service |
1d8f1c |
#define IBUS_IS_REGISTRY(obj) \
|
|
Packit Service |
1d8f1c |
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), IBUS_TYPE_REGISTRY))
|
|
Packit Service |
1d8f1c |
#define IBUS_IS_REGISTRY_CLASS(klass) \
|
|
Packit Service |
1d8f1c |
(G_TYPE_CHECK_CLASS_TYPE ((klass), IBUS_TYPE_REGISTRY))
|
|
Packit Service |
1d8f1c |
#define IBUS_REGISTRY_GET_CLASS(obj) \
|
|
Packit Service |
1d8f1c |
(G_TYPE_INSTANCE_GET_CLASS ((obj), IBUS_TYPE_REGISTRY, IBusRegistryClass))
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
G_BEGIN_DECLS
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
typedef struct _IBusRegistry IBusRegistry;
|
|
Packit Service |
1d8f1c |
typedef struct _IBusRegistryPrivate IBusRegistryPrivate;
|
|
Packit Service |
1d8f1c |
typedef struct _IBusRegistryClass IBusRegistryClass;
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* IBusRegistry:
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Registry cache handling.
|
|
Packit Service |
1d8f1c |
* You can load the registry from compose files or a cache file.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
struct _IBusRegistry {
|
|
Packit Service |
1d8f1c |
/* instance members */
|
|
Packit Service |
1d8f1c |
/*< private >*/
|
|
Packit Service |
1d8f1c |
IBusSerializable parent;
|
|
Packit Service |
1d8f1c |
IBusRegistryPrivate *priv;
|
|
Packit Service |
1d8f1c |
};
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
struct _IBusRegistryClass {
|
|
Packit Service |
1d8f1c |
/* class members */
|
|
Packit Service |
1d8f1c |
/*< private >*/
|
|
Packit Service |
1d8f1c |
IBusSerializableClass parent;
|
|
Packit Service |
1d8f1c |
};
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
GType ibus_registry_get_type (void);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* ibus_registry_new:
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Creates a new #IBusRegistry
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Returns: A newly allocated #IBusRegistry.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
IBusRegistry *ibus_registry_new (void);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* ibus_registry_load:
|
|
Packit Service |
1d8f1c |
* @registry: An #IBusRegistry.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Read all XML files in a IBus component directory (typically
|
|
Packit Service |
1d8f1c |
* /usr/share/ibus/component/ *.xml) and update the registry object.
|
|
Packit Service |
1d8f1c |
* IBUS_COMPONENT_PATH environment valuable is also available for
|
|
Packit Service |
1d8f1c |
* the custom component directories, whose delimiter is ':'.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
void ibus_registry_load (IBusRegistry *registry);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* ibus_registry_load_in_dir:
|
|
Packit Service |
1d8f1c |
* @registry: An #IBusRegistry.
|
|
Packit Service |
1d8f1c |
* @dirname: IBus component directory which includes XML files.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Read all XML files in @dirname, create a #IBusComponent object for each file,
|
|
Packit Service |
1d8f1c |
* and add the component objects to the registry.
|
|
Packit Service |
1d8f1c |
* If @dirname is "/usr/share/ibus/component", this API and
|
|
Packit Service |
1d8f1c |
* ibus_registry_load() are same.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
void ibus_registry_load_in_dir (IBusRegistry *registry,
|
|
Packit Service |
1d8f1c |
const gchar *dirname);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* ibus_registry_load_cache:
|
|
Packit Service |
1d8f1c |
* @registry: An #IBusRegistry.
|
|
Packit Service |
1d8f1c |
* @is_user: %TRUE if the registry cache is loaded in the user directory.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Load the user or system registry cache.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Returns: %TRUE if the cache exists and is loaded successfully,
|
|
Packit Service |
1d8f1c |
* %FALSE otherwise.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
gboolean ibus_registry_load_cache (IBusRegistry *registry,
|
|
Packit Service |
1d8f1c |
gboolean is_user);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* ibus_registry_load_cache_file:
|
|
Packit Service |
1d8f1c |
* @registry: An #IBusRegistry.
|
|
Packit Service |
1d8f1c |
* @filename: The file path of the registry cache
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Load the registry cache @filename.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Returns: %TRUE if the cache exists and is loaded successfully,
|
|
Packit Service |
1d8f1c |
* %FALSE otherwise.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
gboolean ibus_registry_load_cache_file (IBusRegistry *registry,
|
|
Packit Service |
1d8f1c |
const gchar *filename);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* ibus_registry_save_cache:
|
|
Packit Service |
1d8f1c |
* @registry: An #IBusRegistry.
|
|
Packit Service |
1d8f1c |
* @is_user: %TRUE if the registry cache is saved in the user directory.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Save the registry in a user directory or system directory.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Returns: %TRUE if the cache is saved successfully, %FALSE otherwise.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
gboolean ibus_registry_save_cache (IBusRegistry *registry,
|
|
Packit Service |
1d8f1c |
gboolean is_user);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* ibus_registry_save_cache_file:
|
|
Packit Service |
1d8f1c |
* @registry: An #IBusRegistry.
|
|
Packit Service |
1d8f1c |
* @filename: The file path of the registry cache
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Save the registry cache @filename.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Returns: %TRUE if the cache is saved successfully, %FALSE otherwise.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
gboolean ibus_registry_save_cache_file (IBusRegistry *registry,
|
|
Packit Service |
1d8f1c |
const gchar *filename);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* ibus_registry_output:
|
|
Packit Service |
1d8f1c |
* @registry: An #IBusRegistry.
|
|
Packit Service |
1d8f1c |
* @output: GString that holds the result.
|
|
Packit Service |
1d8f1c |
* @indent: level of indent.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Output #IBusRegistry as an XML-formatted string.
|
|
Packit Service |
1d8f1c |
* The output string can be then shown on the screen or written to file.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
void ibus_registry_output (IBusRegistry *registry,
|
|
Packit Service |
1d8f1c |
GString *output,
|
|
Packit Service |
1d8f1c |
int indent);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* ibus_registry_check_modification:
|
|
Packit Service |
1d8f1c |
* @registry: An #IBusRegistry.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Check if the registry is updated.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Returns: %TRUE if mtime is changed; %FALSE otherwise.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
gboolean ibus_registry_check_modification
|
|
Packit Service |
1d8f1c |
(IBusRegistry *registry);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* ibus_registry_get_components:
|
|
Packit Service |
1d8f1c |
* @registry: An #IBusRegistry.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* List components.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Returns: (transfer container) (element-type IBusComponent):
|
|
Packit Service |
1d8f1c |
* a list of #IBusComponent objects.
|
|
Packit Service |
1d8f1c |
* The caller has to call g_list_free() for the returned list.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
GList *ibus_registry_get_components (IBusRegistry *registry);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* ibus_registry_get_observed_paths:
|
|
Packit Service |
1d8f1c |
* @registry: An #IBusRegistry.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* List observed paths.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Returns: (transfer container) (element-type IBusObservedPath):
|
|
Packit Service |
1d8f1c |
* a list of #IBusObservedPath objects.
|
|
Packit Service |
1d8f1c |
* The caller has to call g_list_free() for the returned list.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
GList *ibus_registry_get_observed_paths
|
|
Packit Service |
1d8f1c |
(IBusRegistry *registry);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* ibus_registry_start_monitor_changes:
|
|
Packit Service |
1d8f1c |
* @registry: An #IBusRegistry.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Start to monitor observed paths.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
void ibus_registry_start_monitor_changes
|
|
Packit Service |
1d8f1c |
(IBusRegistry *registry);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
G_END_DECLS
|
|
Packit Service |
1d8f1c |
#endif
|