ibusattribute.h | ibusattribute.h | |||
---|---|---|---|---|
skipping to change at line 51 | skipping to change at line 51 | |||
#define IBUS_ATTRIBUTE_CLASS(klass) \ | #define IBUS_ATTRIBUTE_CLASS(klass) \ | |||
(G_TYPE_CHECK_CLASS_CAST ((klass), IBUS_TYPE_ATTRIBUTE, IBusAttributeCl ass)) | (G_TYPE_CHECK_CLASS_CAST ((klass), IBUS_TYPE_ATTRIBUTE, IBusAttributeCl ass)) | |||
#define IBUS_IS_ATTRIBUTE(obj) \ | #define IBUS_IS_ATTRIBUTE(obj) \ | |||
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), IBUS_TYPE_ATTRIBUTE)) | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), IBUS_TYPE_ATTRIBUTE)) | |||
#define IBUS_IS_ATTRIBUTE_CLASS(klass) \ | #define IBUS_IS_ATTRIBUTE_CLASS(klass) \ | |||
(G_TYPE_CHECK_CLASS_TYPE ((klass), IBUS_TYPE_ATTRIBUTE)) | (G_TYPE_CHECK_CLASS_TYPE ((klass), IBUS_TYPE_ATTRIBUTE)) | |||
#define IBUS_ATTRIBUTE_GET_CLASS(obj) \ | #define IBUS_ATTRIBUTE_GET_CLASS(obj) \ | |||
(G_TYPE_INSTANCE_GET_CLASS ((obj), IBUS_TYPE_ATTRIBUTE, IBusAttributeCl ass)) | (G_TYPE_INSTANCE_GET_CLASS ((obj), IBUS_TYPE_ATTRIBUTE, IBusAttributeCl ass)) | |||
/* define IBusAttrList macros */ | /* define IBusAttrList macros */ | |||
/** | ||||
* IBUS_TYPE_ATTR_LIST: | ||||
* | ||||
* Return GType of IBus attribute list. | ||||
*/ | ||||
#define IBUS_TYPE_ATTR_LIST \ | #define IBUS_TYPE_ATTR_LIST \ | |||
(ibus_attr_list_get_type ()) | (ibus_attr_list_get_type ()) | |||
/** | ||||
* IBUS_ATTR_LIST: | ||||
* @obj: An object which is subject to casting. | ||||
* | ||||
* Casts an IBUS_ATTR_LIST or derived pointer into a (IBusAttrList*) pointe | ||||
r. | ||||
* Depending on the current debugging level, this function may invoke | ||||
* certain runtime checks to identify invalid casts. | ||||
*/ | ||||
#define IBUS_ATTR_LIST(obj) \ | #define IBUS_ATTR_LIST(obj) \ | |||
(G_TYPE_CHECK_INSTANCE_CAST ((obj), IBUS_TYPE_ATTR_LIST, IBusAttrList)) | (G_TYPE_CHECK_INSTANCE_CAST ((obj), IBUS_TYPE_ATTR_LIST, IBusAttrList)) | |||
/** | ||||
* IBUS_ATTR_LIST_CLASS: | ||||
* @klass: A class to be casted. | ||||
* | ||||
* Casts a derived IBusAttrListClass structure into a IBusAttrListClass str | ||||
ucture. | ||||
*/ | ||||
#define IBUS_ATTR_LIST_CLASS(klass) \ | #define IBUS_ATTR_LIST_CLASS(klass) \ | |||
(G_TYPE_CHECK_CLASS_CAST ((klass), IBUS_TYPE_ATTR_LIST, IBusAttrListCla ss)) | (G_TYPE_CHECK_CLASS_CAST ((klass), IBUS_TYPE_ATTR_LIST, IBusAttrListCla ss)) | |||
/** | ||||
* IBUS_IS_ATTR_LIST: | ||||
* @obj: Instance to check for being a IBUS_ATTR_LIST. | ||||
* | ||||
* Checks whether a valid GTypeInstance pointer is of type IBUS_ATTR_LIST. | ||||
*/ | ||||
#define IBUS_IS_ATTR_LIST(obj) \ | #define IBUS_IS_ATTR_LIST(obj) \ | |||
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), IBUS_TYPE_ATTR_LIST)) | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), IBUS_TYPE_ATTR_LIST)) | |||
/** | ||||
* IBUS_IS_ATTR_LIST_CLASS: | ||||
* @klass: A class to be checked. | ||||
* | ||||
* Checks whether class "is a" valid IBusAttrListClass structure of type IB | ||||
US_ATTR_LIST or derived. | ||||
*/ | ||||
#define IBUS_IS_ATTR_LIST_CLASS(klass) \ | #define IBUS_IS_ATTR_LIST_CLASS(klass) \ | |||
(G_TYPE_CHECK_CLASS_TYPE ((klass), IBUS_TYPE_ATTR_LIST)) | (G_TYPE_CHECK_CLASS_TYPE ((klass), IBUS_TYPE_ATTR_LIST)) | |||
/** | ||||
* IBUS_ATTR_LIST_GET_CLASS: | ||||
* @obj: An object. | ||||
* | ||||
* Get the class of a given object and cast the class to IBusAttrListClass. | ||||
*/ | ||||
#define IBUS_ATTR_LIST_GET_CLASS(obj) \ | #define IBUS_ATTR_LIST_GET_CLASS(obj) \ | |||
(G_TYPE_INSTANCE_GET_CLASS ((obj), IBUS_TYPE_ATTR_LIST, IBusAttrListCla ss)) | (G_TYPE_INSTANCE_GET_CLASS ((obj), IBUS_TYPE_ATTR_LIST, IBusAttrListCla ss)) | |||
/** | /** | |||
* IBusAttrType: | * IBusAttrType: | |||
* @IBUS_ATTR_TYPE_UNDERLINE: Decorate with underline. | * @IBUS_ATTR_TYPE_UNDERLINE: Decorate with underline. | |||
* @IBUS_ATTR_TYPE_FOREGROUND: Foreground color. | * @IBUS_ATTR_TYPE_FOREGROUND: Foreground color. | |||
* @IBUS_ATTR_TYPE_BACKGROUND: Background color. | * @IBUS_ATTR_TYPE_BACKGROUND: Background color. | |||
* | * | |||
* Type of IBusText attribute. | * Type enumeration of IBusText attribute. | |||
*/ | */ | |||
typedef enum { | typedef enum { | |||
IBUS_ATTR_TYPE_UNDERLINE = 1, | IBUS_ATTR_TYPE_UNDERLINE = 1, | |||
IBUS_ATTR_TYPE_FOREGROUND = 2, | IBUS_ATTR_TYPE_FOREGROUND = 2, | |||
IBUS_ATTR_TYPE_BACKGROUND = 3, | IBUS_ATTR_TYPE_BACKGROUND = 3, | |||
} IBusAttrType; | } IBusAttrType; | |||
/** | /** | |||
* IBusAttrUnderline: | * IBusAttrUnderline: | |||
* @IBUS_ATTR_UNDERLINE_NONE: No underline. | * @IBUS_ATTR_UNDERLINE_NONE: No underline. | |||
End of changes. 7 change blocks. | ||||
1 lines changed or deleted | 46 lines changed or added | |||
ibusfactory.h | ibusfactory.h | |||
---|---|---|---|---|
skipping to change at line 55 | skipping to change at line 55 | |||
(G_TYPE_CHECK_INSTANCE_CAST ((obj), IBUS_TYPE_FACTORY, IBusFactory)) | (G_TYPE_CHECK_INSTANCE_CAST ((obj), IBUS_TYPE_FACTORY, IBusFactory)) | |||
#define IBUS_FACTORY_CLASS(klass) \ | #define IBUS_FACTORY_CLASS(klass) \ | |||
(G_TYPE_CHECK_CLASS_CAST ((klass), IBUS_TYPE_FACTORY, IBusFactoryClass) ) | (G_TYPE_CHECK_CLASS_CAST ((klass), IBUS_TYPE_FACTORY, IBusFactoryClass) ) | |||
#define IBUS_IS_FACTORY(obj) \ | #define IBUS_IS_FACTORY(obj) \ | |||
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), IBUS_TYPE_FACTORY)) | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), IBUS_TYPE_FACTORY)) | |||
#define IBUS_IS_FACTORY_CLASS(klass) \ | #define IBUS_IS_FACTORY_CLASS(klass) \ | |||
(G_TYPE_CHECK_CLASS_TYPE ((klass), IBUS_TYPE_FACTORY)) | (G_TYPE_CHECK_CLASS_TYPE ((klass), IBUS_TYPE_FACTORY)) | |||
#define IBUS_FACTORY_GET_CLASS(obj) \ | #define IBUS_FACTORY_GET_CLASS(obj) \ | |||
(G_TYPE_INSTANCE_GET_CLASS ((obj), IBUS_TYPE_FACTORY, IBusFactoryClass) ) | (G_TYPE_INSTANCE_GET_CLASS ((obj), IBUS_TYPE_FACTORY, IBusFactoryClass) ) | |||
/** | ||||
* IBUS_TYPE_FACTORY_INFO: | ||||
* | ||||
* Return GType of IBus factory information. | ||||
*/ | ||||
#define IBUS_TYPE_FACTORY_INFO \ | #define IBUS_TYPE_FACTORY_INFO \ | |||
(ibus_factory_info_get_type ()) | (ibus_factory_info_get_type ()) | |||
/** | ||||
* IBUS_FACTORY_INFO: | ||||
* @obj: An object which is subject to casting. | ||||
* | ||||
* Casts an IBUS_FACTORY_INFO or derived pointer into a (IBusFactoryInfo*) | ||||
pointer. | ||||
* Depending on the current debugging level, this function may invoke | ||||
* certain runtime checks to identify invalid casts. | ||||
*/ | ||||
#define IBUS_FACTORY_INFO(obj) \ | #define IBUS_FACTORY_INFO(obj) \ | |||
(G_TYPE_CHECK_INSTANCE_CAST ((obj), IBUS_TYPE_FACTORY_INFO, IBusFactory Info)) | (G_TYPE_CHECK_INSTANCE_CAST ((obj), IBUS_TYPE_FACTORY_INFO, IBusFactory Info)) | |||
/** | ||||
* IBUS_FACTORY_INFO_CLASS: | ||||
* @klass: A class to be casted. | ||||
* | ||||
* Casts a derived IBusFactoryInfoClass structure into a IBusFactoryInfoCla | ||||
ss structure. | ||||
*/ | ||||
#define IBUS_FACTORY_INFO_CLASS(klass) \ | #define IBUS_FACTORY_INFO_CLASS(klass) \ | |||
(G_TYPE_CHECK_CLASS_CAST ((klass), IBUS_TYPE_FACTORY_INFO, IBusFactoryI nfoClass)) | (G_TYPE_CHECK_CLASS_CAST ((klass), IBUS_TYPE_FACTORY_INFO, IBusFactoryI nfoClass)) | |||
/** | ||||
* IBUS_IS_FACTORY_INFO: | ||||
* @obj: Instance to check for being a IBUS_FACTORY_INFO. | ||||
* | ||||
* Checks whether a valid GTypeInstance pointer is of type IBUS_FACTORY_INF | ||||
O. | ||||
*/ | ||||
#define IBUS_IS_FACTORY_INFO(obj) \ | #define IBUS_IS_FACTORY_INFO(obj) \ | |||
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), IBUS_TYPE_FACTORY_INFO)) | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), IBUS_TYPE_FACTORY_INFO)) | |||
/** | ||||
* IBUS_IS_FACTORY_INFO_CLASS: | ||||
* @klass: A class to be checked. | ||||
* | ||||
* Checks whether class "is a" valid IBusFactoryInfoClass structure of type | ||||
IBUS_FACTORY_INFO or derived. | ||||
*/ | ||||
#define IBUS_IS_FACTORY_INFO_CLASS(klass) \ | #define IBUS_IS_FACTORY_INFO_CLASS(klass) \ | |||
(G_TYPE_CHECK_CLASS_TYPE ((klass), IBUS_TYPE_FACTORY_INFO)) | (G_TYPE_CHECK_CLASS_TYPE ((klass), IBUS_TYPE_FACTORY_INFO)) | |||
/** | ||||
* IBUS_FACTORY_INFO_GET_CLASS: | ||||
* @obj: An object. | ||||
* | ||||
* Get the class of a given object and cast the class to IBusFactoryInfoCla | ||||
ss. | ||||
*/ | ||||
#define IBUS_FACTORY_INFO_GET_CLASS(obj) \ | #define IBUS_FACTORY_INFO_GET_CLASS(obj) \ | |||
(G_TYPE_INSTANCE_GET_CLASS ((obj), IBUS_TYPE_FACTORY_INFO, IBusFactoryI nfoClass)) | (G_TYPE_INSTANCE_GET_CLASS ((obj), IBUS_TYPE_FACTORY_INFO, IBusFactoryI nfoClass)) | |||
G_BEGIN_DECLS | G_BEGIN_DECLS | |||
typedef struct _IBusFactory IBusFactory; | typedef struct _IBusFactory IBusFactory; | |||
typedef struct _IBusFactoryClass IBusFactoryClass; | typedef struct _IBusFactoryClass IBusFactoryClass; | |||
typedef struct _IBusFactoryInfo IBusFactoryInfo; | typedef struct _IBusFactoryInfo IBusFactoryInfo; | |||
typedef struct _IBusFactoryInfoClass IBusFactoryInfoClass; | typedef struct _IBusFactoryInfoClass IBusFactoryInfoClass; | |||
End of changes. 6 change blocks. | ||||
0 lines changed or deleted | 47 lines changed or added | |||
ibusobject.h | ibusobject.h | |||
---|---|---|---|---|
skipping to change at line 22 | skipping to change at line 22 | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* Lesser General Public License for more details. | * Lesser General Public License for more details. | |||
* | * | |||
* You should have received a copy of the GNU Lesser General Public | * You should have received a copy of the GNU Lesser General Public | |||
* License along with this library; if not, write to the | * License along with this library; if not, write to the | |||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330, | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |||
* Boston, MA 02111-1307, USA. | * Boston, MA 02111-1307, USA. | |||
*/ | */ | |||
/** | /** | |||
* SECTION: ibusobject | * SECTION: ibusobject | |||
* @short_description: Base Object of IBus. | * @short_description: Base object of IBus. | |||
* @stability: Stable | * @stability: Stable | |||
* | * | |||
* IBus Object is the base object for all objects in IBus. | * IBusObject is the base object for all objects in IBus. | |||
*/ | */ | |||
#ifndef __IBUS_OBJECT_H_ | #ifndef __IBUS_OBJECT_H_ | |||
#define __IBUS_OBJECT_H_ | #define __IBUS_OBJECT_H_ | |||
/** | /** | |||
* SECTION: IBusObject | * SECTION: IBusObject | |||
* @short_description: Base object of IBus. | * @short_description: Base object of IBus. | |||
* | * | |||
* | * | |||
* This module provides essential definition and functions for manipulating | * This module provides essential definition and functions for manipulating | |||
skipping to change at line 81 | skipping to change at line 81 | |||
#define IBUS_OBJECT_DESTROYED(obj) (IBUS_OBJECT_FLAGS (obj) & IBUS_ DESTROYED) | #define IBUS_OBJECT_DESTROYED(obj) (IBUS_OBJECT_FLAGS (obj) & IBUS_ DESTROYED) | |||
G_BEGIN_DECLS | G_BEGIN_DECLS | |||
typedef struct _IBusObject IBusObject; | typedef struct _IBusObject IBusObject; | |||
typedef struct _IBusObjectClass IBusObjectClass; | typedef struct _IBusObjectClass IBusObjectClass; | |||
/** | /** | |||
* IBusObject: | * IBusObject: | |||
* | * | |||
* All the fields in the <structname>IBusObject</structname> structure are | * All the fields in the <structname>IBusObject</structname> structure are | |||
* prtivate to the #IBusObject and should never be accessed directly. | * private to the #IBusObject and should never be accessed directly. | |||
*/ | */ | |||
struct _IBusObject { | struct _IBusObject { | |||
GObject parent; | GObject parent; | |||
/* instance members */ | /* instance members */ | |||
guint32 flags; | guint32 flags; | |||
}; | }; | |||
typedef void ( *IBusObjectDestroyFunc) (IBusObject *); | typedef void ( *IBusObjectDestroyFunc) (IBusObject *); | |||
struct _IBusObjectClass { | struct _IBusObjectClass { | |||
skipping to change at line 103 | skipping to change at line 103 | |||
/* signals */ | /* signals */ | |||
void (* destroy) (IBusObject *object); | void (* destroy) (IBusObject *object); | |||
/*< private >*/ | /*< private >*/ | |||
/* padding */ | /* padding */ | |||
gpointer pdummy[7]; | gpointer pdummy[7]; | |||
}; | }; | |||
GType ibus_object_get_type (void); | GType ibus_object_get_type (void); | |||
/** | ||||
* ibus_object_new: | ||||
* @returns: A newly allocated IBusObject | ||||
* | ||||
* New an IBusObject. | ||||
*/ | ||||
IBusObject *ibus_object_new (void); | IBusObject *ibus_object_new (void); | |||
/** | ||||
* ibus_object_destroy: | ||||
* @object: an #IBusObject to destroy. | ||||
* | ||||
* Emit the "destory" signal notifying all reference holders that they shou | ||||
ld | ||||
* release the #IBusObject. | ||||
* | ||||
* The memory for the object itself won't be deleted until its reference co | ||||
unt | ||||
* actually drops to 0; ibus_object_destroy merely asks reference holders t | ||||
o | ||||
* release their references. It does not free the object. | ||||
*/ | ||||
void ibus_object_destroy (IBusObject *object); | void ibus_object_destroy (IBusObject *object); | |||
G_END_DECLS | G_END_DECLS | |||
#endif | #endif | |||
End of changes. 5 change blocks. | ||||
3 lines changed or deleted | 25 lines changed or added | |||
ibusobservedpath.h | ibusobservedpath.h | |||
---|---|---|---|---|
skipping to change at line 20 | skipping to change at line 20 | |||
* This library is distributed in the hope that it will be useful, | * This library is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* Lesser General Public License for more details. | * Lesser General Public License for more details. | |||
* | * | |||
* You should have received a copy of the GNU Lesser General Public | * You should have received a copy of the GNU Lesser General Public | |||
* License along with this library; if not, write to the | * License along with this library; if not, write to the | |||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330, | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |||
* Boston, MA 02111-1307, USA. | * Boston, MA 02111-1307, USA. | |||
*/ | */ | |||
/** | ||||
* SECTION: ibusobservedpath | ||||
* @short_description: Path object of IBus. | ||||
* @stability: Stable | ||||
* | ||||
* IBusObservedPath provides methods for file path manipulation, | ||||
* such as monitor modification, directory tree traversal. | ||||
*/ | ||||
#ifndef __IBUS_OBSERVED_PATH_H_ | #ifndef __IBUS_OBSERVED_PATH_H_ | |||
#define __IBUS_OBSERVED_PATH_H_ | #define __IBUS_OBSERVED_PATH_H_ | |||
#include "ibusserializable.h" | #include "ibusserializable.h" | |||
#include "ibusxml.h" | #include "ibusxml.h" | |||
/* | /* | |||
* Type macros. | * Type macros. | |||
*/ | */ | |||
skipping to change at line 49 | skipping to change at line 58 | |||
#define IBUS_IS_OBSERVED_PATH_CLASS(klass) \ | #define IBUS_IS_OBSERVED_PATH_CLASS(klass) \ | |||
(G_TYPE_CHECK_CLASS_TYPE ((klass), IBUS_TYPE_OBSERVED_PATH)) | (G_TYPE_CHECK_CLASS_TYPE ((klass), IBUS_TYPE_OBSERVED_PATH)) | |||
#define IBUS_OBSERVED_PATH_GET_CLASS(obj) \ | #define IBUS_OBSERVED_PATH_GET_CLASS(obj) \ | |||
(G_TYPE_INSTANCE_GET_CLASS ((obj), IBUS_TYPE_OBSERVED_PATH, IBusObserve dPathClass)) | (G_TYPE_INSTANCE_GET_CLASS ((obj), IBUS_TYPE_OBSERVED_PATH, IBusObserve dPathClass)) | |||
G_BEGIN_DECLS | G_BEGIN_DECLS | |||
typedef struct _IBusObservedPath IBusObservedPath; | typedef struct _IBusObservedPath IBusObservedPath; | |||
typedef struct _IBusObservedPathClass IBusObservedPathClass; | typedef struct _IBusObservedPathClass IBusObservedPathClass; | |||
/** | ||||
* IBusObservedPath: | ||||
* @path: Path to be handled. | ||||
* @mtime: Modified time. | ||||
* @is_dir: Whether the file is the path directory. | ||||
* @is_exist: Whether the file exists. | ||||
* | ||||
* Data structure of IBusObservedPath. | ||||
*/ | ||||
struct _IBusObservedPath { | struct _IBusObservedPath { | |||
IBusSerializable parent; | IBusSerializable parent; | |||
/* instance members */ | /* instance members */ | |||
gchar *path; | gchar *path; | |||
glong mtime; | glong mtime; | |||
gboolean is_dir; | gboolean is_dir; | |||
gboolean is_exist; | gboolean is_exist; | |||
}; | }; | |||
struct _IBusObservedPathClass { | struct _IBusObservedPathClass { | |||
IBusSerializableClass parent; | IBusSerializableClass parent; | |||
/* class members */ | /* class members */ | |||
}; | }; | |||
GType ibus_observed_path_get_type (void); | GType ibus_observed_path_get_type (void); | |||
/** | ||||
* ibus_observed_path_new_from_xml_node: | ||||
* @node: An XML node that contain path. | ||||
* @fill_stat: Auto-fill the path status. | ||||
* @returns: A newly allocated IBusObservedPath. | ||||
* | ||||
* New an IBusObservedPath from an XML node. | ||||
*/ | ||||
IBusObservedPath *ibus_observed_path_new_from_xml_node (XMLNode *node, | IBusObservedPath *ibus_observed_path_new_from_xml_node (XMLNode *node, | |||
gboolean fill_stat); | gboolean fill_stat); | |||
/** | ||||
* ibus_observed_path_new: | ||||
* @path: The path string. | ||||
* @fill_stat: Auto-fill the path status. | ||||
* @returns: A newly allocated IBusObservedPath. | ||||
* | ||||
* New an IBusObservedPath from an XML node. | ||||
*/ | ||||
IBusObservedPath *ibus_observed_path_new (const gchar *path, | IBusObservedPath *ibus_observed_path_new (const gchar *path, | |||
gboolean fill_stat); | gboolean fill_stat); | |||
/** | ||||
* ibus_observed_path_traverse: | ||||
* @path: An IBusObservedPath. | ||||
* @returns: A newly allocate GList which holds content in path; NULL if @p | ||||
ath is not directory. | ||||
* | ||||
* Recursively traverse the path and put the files and subdirectory in to a | ||||
newly allocated | ||||
* GLists, if the @path is a directory. Otherwise returns NULL. | ||||
*/ | ||||
GList *ibus_observed_path_traverse (IBusObservedPa th *path); | GList *ibus_observed_path_traverse (IBusObservedPa th *path); | |||
/** | ||||
* ibus_observed_path_check_modification: | ||||
* @path: An IBusObservedPath. | ||||
* @returns: TRUE if mtime is changed; FALSE otherwise. | ||||
* | ||||
* Checks whether the path is modified by comparing the mtime in object and | ||||
mtime in file system. | ||||
* Returns TRUE if imtime is changed, otherwise FALSE. | ||||
*/ | ||||
gboolean ibus_observed_path_check_modification (IBusObservedPa th *path); | gboolean ibus_observed_path_check_modification (IBusObservedPa th *path); | |||
/** | ||||
* ibus_observed_path_output: | ||||
* @path: An IBusObservedPath. | ||||
* @output: Path is appended to. | ||||
* @indent: number of indent. | ||||
* | ||||
* Append the observed path to a string with following format: | ||||
* <path mtime="<i>modified time</i>" ><i>path</ | ||||
i></path> | ||||
*/ | ||||
void ibus_observed_path_output (IBusObservedPa th *path, | void ibus_observed_path_output (IBusObservedPa th *path, | |||
GString *output, | GString *output, | |||
gint indent); | gint indent); | |||
G_END_DECLS | G_END_DECLS | |||
#endif | #endif | |||
End of changes. 7 change blocks. | ||||
0 lines changed or deleted | 68 lines changed or added | |||
ibuspendingcall.h | ibuspendingcall.h | |||
---|---|---|---|---|
skipping to change at line 20 | skipping to change at line 20 | |||
* This library is distributed in the hope that it will be useful, | * This library is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* Lesser General Public License for more details. | * Lesser General Public License for more details. | |||
* | * | |||
* You should have received a copy of the GNU Lesser General Public | * You should have received a copy of the GNU Lesser General Public | |||
* License along with this library; if not, write to the | * License along with this library; if not, write to the | |||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330, | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |||
* Boston, MA 02111-1307, USA. | * Boston, MA 02111-1307, USA. | |||
*/ | */ | |||
/** | ||||
* SECTION: ibuspendingcall | ||||
* @short_description: A DBusPendingCall in IBus. | ||||
* @stability: Stable | ||||
* | ||||
* An IBusPendingCall is essentially a DBusPendingCall, which representing | ||||
an expected reply. | ||||
* A IBusPendingCall can be created when you send a message that should hav | ||||
e a reply. | ||||
* | ||||
* Besides DBusPendingCall functions, An IBusPendingCall can be manipulated | ||||
* with its own specific functions, which are defined in this section. | ||||
*/ | ||||
#ifndef __IBUS_PENDING_CALL_H_ | #ifndef __IBUS_PENDING_CALL_H_ | |||
#define __IBUS_PENDING_CALL_H_ | #define __IBUS_PENDING_CALL_H_ | |||
#include <glib.h> | #include <glib.h> | |||
#include <dbus/dbus.h> | #include <dbus/dbus.h> | |||
#include "ibusmessage.h" | #include "ibusmessage.h" | |||
G_BEGIN_DECLS | G_BEGIN_DECLS | |||
/** | ||||
* IBusPendingCall: | ||||
* | ||||
* An opaque data structure that represents IBusPendingCall. | ||||
*/ | ||||
typedef DBusPendingCall IBusPendingCall; | typedef DBusPendingCall IBusPendingCall; | |||
/** | ||||
* IBusPendingCallNotifyFunction: | ||||
* @pending: An IBusPendingCall. | ||||
* @user_data: User data for the callback function. | ||||
* | ||||
* Callback prototype of pending call notify function. | ||||
*/ | ||||
typedef void (* IBusPendingCallNotifyFunction)(IBusPendingCall *pending, gp ointer user_data); | typedef void (* IBusPendingCallNotifyFunction)(IBusPendingCall *pending, gp ointer user_data); | |||
/** | ||||
* ibus_pending_call_ref: | ||||
* @pending: An IBusPendingCall. | ||||
* @returns: A reference of IBusPendingCall. | ||||
* | ||||
* Increases the reference count on a pending call. | ||||
*/ | ||||
IBusPendingCall* ibus_pending_call_ref (IBusPendingCall *pending); | IBusPendingCall* ibus_pending_call_ref (IBusPendingCall *pending); | |||
/** | ||||
* ibus_pending_call_unref: | ||||
* @pending: An IBusPendingCall. | ||||
* | ||||
* Decreases the reference count on a pending call. | ||||
*/ | ||||
void ibus_pending_call_unref (IBusPendingCall *pending); | void ibus_pending_call_unref (IBusPendingCall *pending); | |||
/** | ||||
* ibus_pending_call_set_notify: | ||||
* @pending: An IBusPendingCall. | ||||
* @function: An pending call notify callback function. | ||||
* @user_data: User data for the callback function. | ||||
* @free_user_data: Callback to free the user_data. | ||||
* @returns: TRUE if succeed; FALSE if not enough memory. | ||||
* | ||||
* Sets a notification function to be called when the reply is received or | ||||
the pending call times out. | ||||
*/ | ||||
gboolean ibus_pending_call_set_notify (IBusPendingCall *pending, | gboolean ibus_pending_call_set_notify (IBusPendingCall *pending, | |||
IBusPendingCallNotifyF unction function, | IBusPendingCallNotifyF unction function, | |||
gpointer user_data, | gpointer user_data, | |||
GDestroyNotify free_user_data); | GDestroyNotify free_user_data); | |||
/** | ||||
* ibus_pending_call_cancel: | ||||
* @pending: An IBusPendingCall. | ||||
* | ||||
* Cancels the pending call, such that any reply or error received will jus | ||||
t be ignored. | ||||
* | ||||
* Drops the dbus library's internal reference to the DBusPendingCall so wi | ||||
ll free the call | ||||
* if nobody else is holding a reference. | ||||
* But usually application owns a reference from dbus_connection_send_with_ | ||||
reply(). | ||||
* | ||||
* Note that canceling a pending call will not simulate a timed-out call; | ||||
* if a call times out, then a timeout error reply is received. | ||||
* If you cancel the call, no reply is received unless the reply was alread | ||||
y received before you canceled. | ||||
*/ | ||||
void ibus_pending_call_cancel (IBusPendingCall *pending); | void ibus_pending_call_cancel (IBusPendingCall *pending); | |||
/** | ||||
* ibus_pending_call_get_completed: | ||||
* @pending: An IBusPendingCall. | ||||
* @returns: TRUE if pending call has received a reply; FALSE otherwise. | ||||
* | ||||
* Whether the pending call has received a reply or not. | ||||
*/ | ||||
gboolean ibus_pending_call_get_completed (IBusPendingCall *pending); | gboolean ibus_pending_call_get_completed (IBusPendingCall *pending); | |||
/** | ||||
* ibus_pending_call_steal_reply: | ||||
* @pending: An IBusPendingCall. | ||||
* @returns: Replied message; NULL if none has been received yet. | ||||
* | ||||
* Gets the reply, or returns NULL if none has been received yet. | ||||
* | ||||
* Ownership of the reply message passes to the caller. | ||||
* This function can only be called once per pending call, | ||||
* since the reply message is transferred to the caller. | ||||
*/ | ||||
IBusMessage* ibus_pending_call_steal_reply (IBusPendingCall *pending); | IBusMessage* ibus_pending_call_steal_reply (IBusPendingCall *pending); | |||
/** | ||||
* ibus_pending_call_block: | ||||
* @pending: An IBusPendingCall. | ||||
* | ||||
* Block until the pending call is completed. | ||||
* The blocking is as with ibus_connection_send_with_reply_and_block(); | ||||
* it does not enter the main loop or process other messages, | ||||
* it simply waits for the reply in question. | ||||
* | ||||
* If the pending call is already completed, this function returns immediat | ||||
ely. | ||||
*/ | ||||
void ibus_pending_call_block (IBusPendingCall *pending); | void ibus_pending_call_block (IBusPendingCall *pending); | |||
/** | ||||
* ibus_pending_call_wait: | ||||
* @pending: An IBusPendingCall. | ||||
* | ||||
* Wait until the pending call is completed. | ||||
* | ||||
* See also: ibus_pending_call_get_completed(). | ||||
*/ | ||||
void ibus_pending_call_wait (IBusPendingCall *pending); | void ibus_pending_call_wait (IBusPendingCall *pending); | |||
/** | ||||
* ibus_pending_call_allocate_data_slot: | ||||
* @slot_p: Address of a global variable storing the slot. | ||||
* @returns: TRUE if succeed; FALSE if insufficient memory. | ||||
* | ||||
* Allocates an integer ID to be used for storing application-specific data | ||||
on any IBusPendingCall. | ||||
* | ||||
* The allocated ID may then be used with ibus_pending_call_set_data() and | ||||
ibus_pending_call_get_data(). | ||||
* The passed-in slot must be initialized to -1, and is filled in with the | ||||
slot ID. | ||||
* If the passed-in slot is not -1, it's assumed to be already allocated, a | ||||
nd | ||||
* its reference count is increased. | ||||
* | ||||
* The allocated slot is global, i.e. all DBusPendingCall objects | ||||
* will have a slot with the given integer ID reserved. | ||||
*/ | ||||
gboolean ibus_pending_call_allocate_data_slot | gboolean ibus_pending_call_allocate_data_slot | |||
(gint *slot_p); | (gint *slot_p); | |||
/** | ||||
* ibus_pending_call_free_data_slot: | ||||
* @slot_p: Address of a global variable storing the slot. | ||||
* | ||||
* Deallocates a global ID for IBusPendingCall data slots. | ||||
* | ||||
* ibus_pending_call_get_data() and ibus_pending_call_set_data() may no lon | ||||
ger be used with this slot. | ||||
* Existing data stored on existing IBusPendingCall objects will be freed w | ||||
hen | ||||
* the IBusPendingCall is finalized, but may not be retrieved | ||||
* (and may only be replaced if someone else reallocates the slot). | ||||
* When the reference count on the passed-in slot reaches 0, it is set to - | ||||
1. | ||||
*/ | ||||
void ibus_pending_call_free_data_slot | void ibus_pending_call_free_data_slot | |||
(gint *slot_p); | (gint *slot_p); | |||
/** | ||||
* ibus_pending_call_set_data: | ||||
* @pending: An IBusPendingCall. | ||||
* @slot: The slot number. | ||||
* @data: The data to store | ||||
* @free_data_func: Callback to free the data. | ||||
* @returns: TRUE if there was enough memory to store the data; FALSE other | ||||
wise. | ||||
* | ||||
* Stores a pointer on a IBusPendingCall, along with an optional function | ||||
* to be used for freeing the data when the data is set again, or when the | ||||
pending call is finalized. | ||||
* | ||||
* The slot number must have been allocated with ibus_pending_call_allocate | ||||
_data_slot(). | ||||
*/ | ||||
gboolean ibus_pending_call_set_data (IBusPendingCall *pending, | gboolean ibus_pending_call_set_data (IBusPendingCall *pending, | |||
gint slot, | gint slot, | |||
gpointer data, | gpointer data, | |||
GDestroyNotify free_data_func); | GDestroyNotify free_data_func); | |||
/** | ||||
* ibus_pending_call_get_data: | ||||
* @pending: An IBusPendingCall. | ||||
* @slot: The slot number. | ||||
* @returns: The stored data; NULL if no such data. | ||||
* | ||||
* Retrieves data previously set with ibus_pending_call_set_data(). | ||||
* | ||||
* The slot must still be allocated (must not have been freed). | ||||
*/ | ||||
gpointer ibus_pending_call_get_data (IBusPendingCall *pending, | gpointer ibus_pending_call_get_data (IBusPendingCall *pending, | |||
gint slot); | gint slot); | |||
G_END_DECLS | G_END_DECLS | |||
#endif | #endif | |||
End of changes. 15 change blocks. | ||||
0 lines changed or deleted | 177 lines changed or added | |||
ibusproperty.h | ibusproperty.h | |||
---|---|---|---|---|
skipping to change at line 44 | skipping to change at line 44 | |||
#define __IBUS_PROPERTY_H_ | #define __IBUS_PROPERTY_H_ | |||
#include "ibusserializable.h" | #include "ibusserializable.h" | |||
#include "ibustext.h" | #include "ibustext.h" | |||
G_BEGIN_DECLS | G_BEGIN_DECLS | |||
/* | /* | |||
* Type macros. | * Type macros. | |||
*/ | */ | |||
#define IBUS_TYPE_PROPERTY (ibus_property_get_type ()) | ||||
#define IBUS_TYPE_PROP_LIST (ibus_prop_list_get_type ()) | ||||
/* define IBusProperty macros */ | /* define IBusProperty macros */ | |||
#define IBUS_TYPE_PROPERTY \ | #define IBUS_TYPE_PROPERTY \ | |||
(ibus_property_get_type ()) | (ibus_property_get_type ()) | |||
#define IBUS_PROPERTY(obj) \ | #define IBUS_PROPERTY(obj) \ | |||
(G_TYPE_CHECK_INSTANCE_CAST ((obj), IBUS_TYPE_PROPERTY, IBusProperty)) | (G_TYPE_CHECK_INSTANCE_CAST ((obj), IBUS_TYPE_PROPERTY, IBusProperty)) | |||
#define IBUS_PROPERTY_CLASS(klass) \ | #define IBUS_PROPERTY_CLASS(klass) \ | |||
(G_TYPE_CHECK_CLASS_CAST ((klass), IBUS_TYPE_PROPERTY, IBusPropertyClas s)) | (G_TYPE_CHECK_CLASS_CAST ((klass), IBUS_TYPE_PROPERTY, IBusPropertyClas s)) | |||
#define IBUS_IS_PROPERTY(obj) \ | #define IBUS_IS_PROPERTY(obj) \ | |||
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), IBUS_TYPE_PROPERTY)) | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), IBUS_TYPE_PROPERTY)) | |||
#define IBUS_IS_PROPERTY_CLASS(klass) \ | #define IBUS_IS_PROPERTY_CLASS(klass) \ | |||
(G_TYPE_CHECK_CLASS_TYPE ((klass), IBUS_TYPE_PROPERTY)) | (G_TYPE_CHECK_CLASS_TYPE ((klass), IBUS_TYPE_PROPERTY)) | |||
#define IBUS_PROPERTY_GET_CLASS(obj) \ | #define IBUS_PROPERTY_GET_CLASS(obj) \ | |||
(G_TYPE_INSTANCE_GET_CLASS ((obj), IBUS_TYPE_PROPERTY, IBusPropertyClas s)) | (G_TYPE_INSTANCE_GET_CLASS ((obj), IBUS_TYPE_PROPERTY, IBusPropertyClas s)) | |||
/* define IBusPropList macros */ | /* define IBusPropList macros */ | |||
/** | ||||
* IBUS_TYPE_PROP_LIST: | ||||
* @returns: IBusPropList GType. | ||||
* | ||||
* Returns GType of IBus property list. | ||||
*/ | ||||
#define IBUS_TYPE_PROP_LIST \ | #define IBUS_TYPE_PROP_LIST \ | |||
(ibus_prop_list_get_type ()) | (ibus_prop_list_get_type ()) | |||
/** | ||||
* IBUS_PROP_LIST: | ||||
* @obj: An object which is subject to casting. | ||||
* | ||||
* Casts an IBUS_PROP_LIST or derived pointer into a (IBusPropList*) pointe | ||||
r. | ||||
* Depending on the current debugging level, this function may invoke | ||||
* certain runtime checks to identify invalid casts. | ||||
*/ | ||||
#define IBUS_PROP_LIST(obj) \ | #define IBUS_PROP_LIST(obj) \ | |||
(G_TYPE_CHECK_INSTANCE_CAST ((obj), IBUS_TYPE_PROP_LIST, IBusPropList)) | (G_TYPE_CHECK_INSTANCE_CAST ((obj), IBUS_TYPE_PROP_LIST, IBusPropList)) | |||
/** | ||||
* IBUS_PROP_LIST_CLASS: | ||||
* @klass: A class to be casted. | ||||
* | ||||
* Casts a derived IBusPropListClass structure into a IBusPropListClass str | ||||
ucture. | ||||
*/ | ||||
#define IBUS_PROP_LIST_CLASS(klass) \ | #define IBUS_PROP_LIST_CLASS(klass) \ | |||
(G_TYPE_CHECK_CLASS_CAST ((klass), IBUS_TYPE_PROP_LIST, IBusPropListCla ss)) | (G_TYPE_CHECK_CLASS_CAST ((klass), IBUS_TYPE_PROP_LIST, IBusPropListCla ss)) | |||
/** | ||||
* IBUS_IS_PROP_LIST: | ||||
* @obj: Instance to check for being a IBUS_PROP_LIST. | ||||
* | ||||
* Checks whether a valid GTypeInstance pointer is of type IBUS_PROP_LIST. | ||||
*/ | ||||
#define IBUS_IS_PROP_LIST(obj) \ | #define IBUS_IS_PROP_LIST(obj) \ | |||
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), IBUS_TYPE_PROP_LIST)) | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), IBUS_TYPE_PROP_LIST)) | |||
/** | ||||
* IBUS_IS_PROP_LIST_CLASS: | ||||
* @klass: A class to be checked. | ||||
* | ||||
* Checks whether class "is a" valid IBusPropListClass structure of type IB | ||||
US_PROP_LIST or derived. | ||||
*/ | ||||
#define IBUS_IS_PROP_LIST_CLASS(klass) \ | #define IBUS_IS_PROP_LIST_CLASS(klass) \ | |||
(G_TYPE_CHECK_CLASS_TYPE ((klass), IBUS_TYPE_PROP_LIST)) | (G_TYPE_CHECK_CLASS_TYPE ((klass), IBUS_TYPE_PROP_LIST)) | |||
/** | ||||
* IBUS_PROP_LIST_GET_CLASS: | ||||
* @obj: An object. | ||||
* | ||||
* Get the class of a given object and cast the class to IBusPropListClass. | ||||
*/ | ||||
#define IBUS_PROP_LIST_GET_CLASS(obj) \ | #define IBUS_PROP_LIST_GET_CLASS(obj) \ | |||
(G_TYPE_INSTANCE_GET_CLASS ((obj), IBUS_TYPE_PROP_LIST, IBusPropListCla ss)) | (G_TYPE_INSTANCE_GET_CLASS ((obj), IBUS_TYPE_PROP_LIST, IBusPropListCla ss)) | |||
/** | /** | |||
* IBusPropType: | * IBusPropType: | |||
* @PROP_TYPE_NORMAL: Property is shown as normal text. | * @PROP_TYPE_NORMAL: Property is shown as normal text. | |||
* @PROP_TYPE_TOGGLE: Property is shown as a toggle button. | * @PROP_TYPE_TOGGLE: Property is shown as a toggle button. | |||
* @PROP_TYPE_RADIO: Property is shown as a radio selection option. | * @PROP_TYPE_RADIO: Property is shown as a radio selection option. | |||
* @PROP_TYPE_MENU: Property is shown as a menu, usually imply it has sub m enu | * @PROP_TYPE_MENU: Property is shown as a menu, usually imply it has sub m enu | |||
* items. | * items. | |||
* @PROP_TYPE_SEPARATOR: A separator for menu. | * @PROP_TYPE_SEPARATOR: A separator for menu. | |||
* | * | |||
* Type of IBusProperty. | * Type enumeration of IBusProperty. | |||
*/ | */ | |||
typedef enum { | typedef enum { | |||
PROP_TYPE_NORMAL = 0, | PROP_TYPE_NORMAL = 0, | |||
PROP_TYPE_TOGGLE = 1, | PROP_TYPE_TOGGLE = 1, | |||
PROP_TYPE_RADIO = 2, | PROP_TYPE_RADIO = 2, | |||
PROP_TYPE_MENU = 3, | PROP_TYPE_MENU = 3, | |||
PROP_TYPE_SEPARATOR = 4, | PROP_TYPE_SEPARATOR = 4, | |||
} IBusPropType; | } IBusPropType; | |||
/** | /** | |||
skipping to change at line 167 | skipping to change at line 207 | |||
}; | }; | |||
struct _IBusPropertyClass { | struct _IBusPropertyClass { | |||
IBusSerializableClass parent; | IBusSerializableClass parent; | |||
}; | }; | |||
/** | /** | |||
* IBusPropList: | * IBusPropList: | |||
* @properties: GArray that holds IBusProperties. | * @properties: GArray that holds IBusProperties. | |||
* | * | |||
* A GArray of IBusProperties. | * An array of IBusProperties. | |||
*/ | */ | |||
struct _IBusPropList { | struct _IBusPropList { | |||
IBusSerializable parent; | IBusSerializable parent; | |||
/*< public >*/ | /*< public >*/ | |||
GArray *properties; | GArray *properties; | |||
}; | }; | |||
struct _IBusPropListClass { | struct _IBusPropListClass { | |||
IBusSerializableClass parent; | IBusSerializableClass parent; | |||
}; | }; | |||
GType ibus_property_get_type (); | GType ibus_property_get_type (); | |||
/** | /** | |||
* ibus_property_new: | * ibus_property_new: | |||
* @key: Unique Identity for the IBusProperty. | * @key: Unique Identity for the IBusProperty. | |||
* @icon: Icon file for the IBusProperty. | * @type: IBusPropType of IBusProperty. | |||
* @label: Text shown in UI. | * @label: Text shown in UI. | |||
* @icon: Icon file for the IBusProperty. | ||||
* @tooltip: Message shown if mouse hovered the IBusProperty. | * @tooltip: Message shown if mouse hovered the IBusProperty. | |||
* @sensitive: Whether the IBusProperty is sensitive to keyboard and mouse event. | * @sensitive: Whether the IBusProperty is sensitive to keyboard and mouse event. | |||
* @visible: Whether the IBusProperty is visible. | * @visible: Whether the IBusProperty is visible. | |||
* @type: IBusPropType of IBusProperty. | ||||
* @state: IBusPropState of IBusProperty. | * @state: IBusPropState of IBusProperty. | |||
* @prop_list: IBusPropList that contains sub IBusProperties. | * @prop_list: IBusPropList that contains sub IBusProperties. | |||
* @returns: A newly allocated IBusProperty. | * @returns: A newly allocated IBusProperty. | |||
* | * | |||
* New a IBusProperty. | * New a IBusProperty. | |||
*/ | */ | |||
IBusProperty *ibus_property_new (const gchar *key, | IBusProperty *ibus_property_new (const gchar *key, | |||
IBusPropType type, | IBusPropType type, | |||
IBusText *label, | IBusText *label, | |||
const gchar *icon, | const gchar *icon, | |||
skipping to change at line 218 | skipping to change at line 258 | |||
* ibus_property_set_label: | * ibus_property_set_label: | |||
* @prop: An IBusProperty. | * @prop: An IBusProperty. | |||
* @label: Text shown in UI. | * @label: Text shown in UI. | |||
* | * | |||
* Set the label of IBusProperty. | * Set the label of IBusProperty. | |||
*/ | */ | |||
void ibus_property_set_label (IBusProperty *prop, | void ibus_property_set_label (IBusProperty *prop, | |||
IBusText *label); | IBusText *label); | |||
/** | /** | |||
* ibus_property_set_icon: | ||||
* @prop: An IBusProperty. | ||||
* @icon: Icon shown in UI. It could be a full path of an icon file or an i | ||||
con name. | ||||
* | ||||
* Set the icon of IBusProperty. | ||||
*/ | ||||
void ibus_property_set_icon (IBusProperty *prop, | ||||
const gchar *icon); | ||||
/** | ||||
* ibus_property_set_tooltip: | ||||
* @prop: An IBusProperty. | ||||
* @tooltip: Text of the tooltip. | ||||
* | ||||
* Set the tooltip of IBusProperty. | ||||
*/ | ||||
void ibus_property_set_tooltip (IBusProperty *prop, | ||||
IBusText *tooltip); | ||||
/** | ||||
* ibus_property_set_sensitive: | ||||
* @prop: An IBusProperty. | ||||
* @sensitive: Whether the IBusProperty is sensitive. | ||||
* | ||||
* Set whether the IBusProperty is sensitive. | ||||
*/ | ||||
void ibus_property_set_sensitive(IBusProperty *prop, | ||||
gboolean sensitive); | ||||
/** | ||||
* ibus_property_set_visible: | * ibus_property_set_visible: | |||
* @prop: An IBusProperty. | * @prop: An IBusProperty. | |||
* @visible: Whether the IBusProperty is visible. | * @visible: Whether the IBusProperty is visible. | |||
* | * | |||
* Set whether the IBusProperty is visible. | * Set whether the IBusProperty is visible. | |||
*/ | */ | |||
void ibus_property_set_visible (IBusProperty *prop, | void ibus_property_set_visible (IBusProperty *prop, | |||
gboolean visible); | gboolean visible); | |||
/** | /** | |||
* ibus_property_set_state: | ||||
* @prop: An IBusProperty. | ||||
* @state: The state of the IBusProperty. | ||||
* | ||||
* Set the state of the IBusProperty. | ||||
*/ | ||||
void ibus_property_set_state (IBusProperty *prop, | ||||
IBusPropState state); | ||||
/** | ||||
* ibus_property_set_sub_props: | * ibus_property_set_sub_props: | |||
* @prop: An IBusProperty. | * @prop: An IBusProperty. | |||
* @prop_list: IBusPropList that contains sub IBusProperties. | * @prop_list: IBusPropList that contains sub IBusProperties. | |||
* | * | |||
* Set the sub IBusProperties. | * Set the sub IBusProperties. | |||
*/ | */ | |||
void ibus_property_set_sub_props(IBusProperty *prop, | void ibus_property_set_sub_props(IBusProperty *prop, | |||
IBusPropList *prop_list); | IBusPropList *prop_list); | |||
/** | /** | |||
End of changes. 14 change blocks. | ||||
7 lines changed or deleted | 91 lines changed or added | |||
ibusserializable.h | ibusserializable.h | |||
---|---|---|---|---|
skipping to change at line 20 | skipping to change at line 20 | |||
* This library is distributed in the hope that it will be useful, | * This library is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* Lesser General Public License for more details. | * Lesser General Public License for more details. | |||
* | * | |||
* You should have received a copy of the GNU Lesser General Public | * You should have received a copy of the GNU Lesser General Public | |||
* License along with this library; if not, write to the | * License along with this library; if not, write to the | |||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330, | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |||
* Boston, MA 02111-1307, USA. | * Boston, MA 02111-1307, USA. | |||
*/ | */ | |||
/** | ||||
* SECTION: ibusserializable | ||||
* @short_description: A serializable object. | ||||
* @stability: Stable | ||||
* | ||||
* An IBusSerializable is an IBus object which can be serialized, that is, | ||||
* to be to and from an IBusMessage. | ||||
* | ||||
* This class is to be extended by other class that requires serialization. | ||||
* An extended class should overrides following methods: | ||||
* <itemizedlist> | ||||
* <listitem> | ||||
* <para><function>serialize(object,iter)</function>: for serialize.< | ||||
/para> | ||||
* </listitem> | ||||
* <listitem> | ||||
* <para><function>deserialize(object,iter)</function>: for deseriali | ||||
ze.</para> | ||||
* </listitem> | ||||
* <listitem> | ||||
* <para><function>copy(desc,src)</function>: for copy between IBusSe | ||||
rializable.</para> | ||||
* </listitem> | ||||
* </itemizedlist> | ||||
* See IBusSerializableSerializeFunc(), IBusSerializableDeserializeFunc(), | ||||
IBusSerializableCopyFunc() | ||||
* for function prototype. | ||||
*/ | ||||
#ifndef __IBUS_SERIALIZABLE_H_ | #ifndef __IBUS_SERIALIZABLE_H_ | |||
#define __IBUS_SERIALIZABLE_H_ | #define __IBUS_SERIALIZABLE_H_ | |||
#include "ibusobject.h" | #include "ibusobject.h" | |||
#include "ibusmessage.h" | #include "ibusmessage.h" | |||
/* | /* | |||
* Type macros. | * Type macros. | |||
*/ | */ | |||
skipping to change at line 44 | skipping to change at line 68 | |||
(G_TYPE_CHECK_INSTANCE_CAST ((obj), IBUS_TYPE_SERIALIZABLE, IBusSeriali zable)) | (G_TYPE_CHECK_INSTANCE_CAST ((obj), IBUS_TYPE_SERIALIZABLE, IBusSeriali zable)) | |||
#define IBUS_SERIALIZABLE_CLASS(klass) \ | #define IBUS_SERIALIZABLE_CLASS(klass) \ | |||
(G_TYPE_CHECK_CLASS_CAST ((klass), IBUS_TYPE_SERIALIZABLE, IBusSerializ ableClass)) | (G_TYPE_CHECK_CLASS_CAST ((klass), IBUS_TYPE_SERIALIZABLE, IBusSerializ ableClass)) | |||
#define IBUS_IS_SERIALIZABLE(obj) \ | #define IBUS_IS_SERIALIZABLE(obj) \ | |||
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), IBUS_TYPE_SERIALIZABLE)) | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), IBUS_TYPE_SERIALIZABLE)) | |||
#define IBUS_IS_SERIALIZABLE_CLASS(klass) \ | #define IBUS_IS_SERIALIZABLE_CLASS(klass) \ | |||
(G_TYPE_CHECK_CLASS_TYPE ((klass), IBUS_TYPE_SERIALIZABLE)) | (G_TYPE_CHECK_CLASS_TYPE ((klass), IBUS_TYPE_SERIALIZABLE)) | |||
#define IBUS_SERIALIZABLE_GET_CLASS(obj) \ | #define IBUS_SERIALIZABLE_GET_CLASS(obj) \ | |||
(G_TYPE_INSTANCE_GET_CLASS ((obj), IBUS_TYPE_SERIALIZABLE, IBusSerializ ableClass)) | (G_TYPE_INSTANCE_GET_CLASS ((obj), IBUS_TYPE_SERIALIZABLE, IBusSerializ ableClass)) | |||
/** | ||||
* ibus_serializable_set_attachment: | ||||
* @o: An IBusSerializable. | ||||
* @k: String formatted key for indexing value. | ||||
* @v: Value to be attached. Should be also serializable. | ||||
* | ||||
* Attach a value to an IBusSerializable. | ||||
* This macro is an convenient wrapper of ibus_serializable_set_qattachment | ||||
(). | ||||
*/ | ||||
#define ibus_serializable_set_attachment(o, k, v) \ | #define ibus_serializable_set_attachment(o, k, v) \ | |||
ibus_serializable_set_qattachment (o, g_quark_from_string (k), v) | ibus_serializable_set_qattachment (o, g_quark_from_string (k), v) | |||
/** | ||||
* ibus_serializable_get_attachment: | ||||
* @o: An IBusSerializable. | ||||
* @k: String formatted key for indexing value. | ||||
* @v: Value to be attached. Should be also serializable. | ||||
* | ||||
* Get a value from attachment of an IBusSerializable. | ||||
* This macro is an convenient wrapper of ibus_serializable_get_qattachment | ||||
(). | ||||
*/ | ||||
#define ibus_serializable_get_attachment(o, k, v) \ | #define ibus_serializable_get_attachment(o, k, v) \ | |||
ibus_serializable_get_qattachment (o, g_quark_from_string (k)) | ibus_serializable_get_qattachment (o, g_quark_from_string (k)) | |||
/** | ||||
* ibus_serializable_remove_attachment: | ||||
* @o: An IBusSerializable. | ||||
* @k: String formatted key for indexing value. | ||||
* | ||||
* Remove a value from attachment of an IBusSerializable. | ||||
* This macro is an convenient wrapper of ibus_serializable_remove_qattachm | ||||
ent(). | ||||
*/ | ||||
#define ibus_serializable_remove_attachment(o, k) \ | #define ibus_serializable_remove_attachment(o, k) \ | |||
ibus_serializable_remove_qattachment (o, g_quark_from_string (k)) | ibus_serializable_remove_qattachment (o, g_quark_from_string (k)) | |||
G_BEGIN_DECLS | G_BEGIN_DECLS | |||
typedef struct _IBusSerializable IBusSerializable; | typedef struct _IBusSerializable IBusSerializable; | |||
typedef struct _IBusSerializableClass IBusSerializableClass; | typedef struct _IBusSerializableClass IBusSerializableClass; | |||
/** | /** | |||
* IBusSerializable: | * IBusSerializable: | |||
* | * | |||
* All the fields in the <structname>IBusSerializable</structname> structur e are | * All the fields in the <structname>IBusSerializable</structname> structur e are | |||
* prtivate to the #IBusSerializable and should never be accessed directly. | * private to the #IBusSerializable and should never be accessed directly. | |||
*/ | */ | |||
struct _IBusSerializable { | struct _IBusSerializable { | |||
GObject parent; | GObject parent; | |||
/* instance members */ | /* instance members */ | |||
guint32 flags; | guint32 flags; | |||
}; | }; | |||
/** | ||||
* IBusSerializableSerializeFunc: | ||||
* @object: An IBusSerializable. | ||||
* @iter: An IBusMessageIter. | ||||
* @returns: TRUE if succeed; FALSE otherwise. | ||||
* | ||||
* Prototype of serialize function. | ||||
* Serialize function convert an IBusSerializable to IBusMessageIter. | ||||
* Returns a gboolean value which indicates whether the conversion is succe | ||||
ss. | ||||
* Return TRUE if succeed. | ||||
*/ | ||||
typedef gboolean (* IBusSerializableSerializeFunc) (IBusSerializable *object, | typedef gboolean (* IBusSerializableSerializeFunc) (IBusSerializable *object, | |||
IBusMessageIter *iter); | IBusMessageIter *iter); | |||
/** | ||||
* IBusSerializableDeserializeFunc: | ||||
* @object: An IBusSerializable. | ||||
* @iter: An IBusMessageIter. | ||||
* @returns: TRUE if succeed; FALSE otherwise. | ||||
* | ||||
* Prototype of deserialize function. | ||||
* Deserialize function convert an IBusMessageIter to IBusSerializable. | ||||
* Returns a gboolean value which indicates whether the conversion is succe | ||||
ss. | ||||
*/ | ||||
typedef gboolean (* IBusSerializableDeserializeFunc) (IBusSerializable *object, | typedef gboolean (* IBusSerializableDeserializeFunc) (IBusSerializable *object, | |||
IBusMessageIter *iter); | IBusMessageIter *iter); | |||
/** | ||||
* IBusSerializableCopyFunc: | ||||
* @dest: The destination IBusSerializable. | ||||
* @src: A source IBusMessageIter. | ||||
* @returns: TRUE if succeed; FALSE otherwise. | ||||
* | ||||
* Prototype of copy function. | ||||
* Copy function copy from source IBusSerializable to the destination one. | ||||
* Returns a gboolean value which indicates whether the copying is success. | ||||
*/ | ||||
typedef gboolean (* IBusSerializableCopyFunc) (IBusSerializable *dest, | typedef gboolean (* IBusSerializableCopyFunc) (IBusSerializable *dest, | |||
const IBusSerializ able *src); | const IBusSerializ able *src); | |||
struct _IBusSerializableClass { | struct _IBusSerializableClass { | |||
IBusObjectClass parent; | IBusObjectClass parent; | |||
/* signature */ | /* signature */ | |||
GString *signature; | GString *signature; | |||
/* virtual table */ | /* virtual table */ | |||
gboolean (* serialize) (IBusSerializable *object, | gboolean (* serialize) (IBusSerializable *object, | |||
skipping to change at line 92 | skipping to change at line 178 | |||
gboolean (* deserialize) (IBusSerializable *object, | gboolean (* deserialize) (IBusSerializable *object, | |||
IBusMessageIter *iter); | IBusMessageIter *iter); | |||
gboolean (* copy) (IBusSerializable *dest, | gboolean (* copy) (IBusSerializable *dest, | |||
const IBusSerializable *src); | const IBusSerializable *src); | |||
/*< private >*/ | /*< private >*/ | |||
/* padding */ | /* padding */ | |||
gpointer pdummy[5]; | gpointer pdummy[5]; | |||
}; | }; | |||
GType ibus_serializable_get_type (void); | GType ibus_serializable_get_type (void); | |||
/** | ||||
* ibus_serializable_new: | ||||
* | ||||
* Creates a new instance of an #IBusSerializable. | ||||
* | ||||
* Returns: a new instance of #IBusSerializable. | ||||
*/ | ||||
IBusSerializable * ibus_serializable_new (void); | IBusSerializable * ibus_serializable_new (void); | |||
/** | ||||
* ibus_serializable_set_qattachment: | ||||
* @object: An IBusSerializable. | ||||
* @key: String formatted key for indexing value. | ||||
* @value: Value to be attached. Should be also serializable. | ||||
* @returns: TRUE if succeed; FALSE otherwise. | ||||
* | ||||
* Attach a value to an IBusSerializable. The value should be serializable | ||||
as well. | ||||
* Basic type such as integer, string are deemed to be serializable. | ||||
* | ||||
* @see_also: ibus_serializable_set_attachment(). | ||||
*/ | ||||
gboolean ibus_serializable_set_qattachment (IBusSerializable *object, | gboolean ibus_serializable_set_qattachment (IBusSerializable *object, | |||
GQuark key, | GQuark key, | |||
const GValue *value); | const GValue *value); | |||
/** | ||||
* ibus_serializable_get_qattachment: | ||||
* @object: An IBusSerializable. | ||||
* @key: String formatted key for indexing value. | ||||
* @returns: The attached value; or NULL if fail to retrieve the value. | ||||
* | ||||
* Get a value from attachment of an IBusSerializable. | ||||
* @see_also: ibus_serializable_set_attachment(). | ||||
*/ | ||||
const GValue *ibus_serializable_get_qattachment (IBusSerializable *object, | const GValue *ibus_serializable_get_qattachment (IBusSerializable *object, | |||
GQuark key); | GQuark key); | |||
/** | ||||
* ibus_serializable_remove_qattachment: | ||||
* @object: An IBusSerializable. | ||||
* @key: String formatted key for indexing value. | ||||
* | ||||
* Remove a value from attachment of an IBusSerializable. | ||||
* @see_also: ibus_serializable_remove_attachment(). | ||||
*/ | ||||
void ibus_serializable_remove_qattachment | void ibus_serializable_remove_qattachment | |||
(IBusSerializable *object, | (IBusSerializable *object, | |||
GQuark key); | GQuark key); | |||
/** | ||||
* ibus_serializable_copy: | ||||
* @object: An IBusSerializable. | ||||
* @returns: A newly allocated clone object; or NULL if @object is not seri | ||||
alizable. | ||||
* | ||||
* Clone an IBusSerializable. | ||||
* The copy method should be implemented in extended class. | ||||
* | ||||
* @see_also: IBusSerializableCopyFunc(). | ||||
*/ | ||||
IBusSerializable *ibus_serializable_copy (IBusSerializable *object); | IBusSerializable *ibus_serializable_copy (IBusSerializable *object); | |||
/** | ||||
* ibus_serializable_serialize: | ||||
* @object: An IBusSerializable. | ||||
* @iter: An IBusMessageIter. | ||||
* @returns: TRUE if succeed; FALSE otherwise. | ||||
* | ||||
* Serialize an IBusSerializable to an IBusMessageIter. | ||||
* The serialize method should be implemented in extended class. | ||||
* | ||||
* @see_also: IBusSerializableCopyFunc(). | ||||
*/ | ||||
gboolean ibus_serializable_serialize (IBusSerializable *object, | gboolean ibus_serializable_serialize (IBusSerializable *object, | |||
IBusMessageIter *iter); | IBusMessageIter *iter); | |||
/** | ||||
* ibus_serializable_deserialize: | ||||
* @iter: An IBusMessageIter. | ||||
* @returns: The deserialized IBusSerializable. | ||||
* | ||||
* Deserialize an IBusMessageIter to an IBusSerializable/ | ||||
* The deserialize method should be implemented in extended class. | ||||
* | ||||
* @see_also: IBusSerializableCopyFunc(). | ||||
*/ | ||||
IBusSerializable *ibus_serializable_deserialize (IBusMessageIter *iter); | IBusSerializable *ibus_serializable_deserialize (IBusMessageIter *iter); | |||
G_END_DECLS | G_END_DECLS | |||
#endif | #endif | |||
End of changes. 16 change blocks. | ||||
1 lines changed or deleted | 172 lines changed or added | |||