GXimProtocol

GXimProtocol — Base interface for XIM protocol

Synopsis

                    GXimProtocolClosure;
gboolean            (*GXimProtocolClosureFunc)          (GXimProtocolClosure *closure,
                                                         GXimProtocol *proto,
                                                         GDataInputStream *stream,
                                                         GError **error,
                                                         gpointer user_data);
enum                GXimProtocolError;
struct              GXimProtocolIface;
struct              GXimProtocolQueueNode;
#define             G_XIM_OPCODE_KEY                    (_m_,
                                                         _n_)
#define             G_XIM_PROTOCOL_ERROR
gpointer            g_xim_attr_get_attribute_from_stream
                                                        (GXimProtocol *proto,
                                                         GXimAttr *attr,
                                                         GDataInputStream *stream,
                                                         GCancellable *cancellable,
                                                         GError **error);
gsize               g_xim_attr_put_attribute_to_stream  (GXimProtocol *proto,
                                                         GXimAttr *attr,
                                                         guint attribute_id,
                                                         GCancellable *cancellable,
                                                         GError **error);
void                g_xim_protocol_add_protocol         (GXimProtocol *proto,
                                                         GXimProtocolClosure *closure);
void                g_xim_protocol_cancel_queue         (GXimProtocol *proto);
void                g_xim_protocol_closure_add_signal   (GXimProtocolClosure *closure,
                                                         GClosureMarshal marshaller,
                                                         guint n_params,
                                                         ...);
gulong              g_xim_protocol_closure_connect      (GXimProtocolClosure *closure,
                                                         GCallback func,
                                                         gpointer data);
void                g_xim_protocol_closure_disconnect   (GXimProtocolClosure *closure,
                                                         gulong id);
gboolean            g_xim_protocol_closure_emit_signal  (GXimProtocolClosure *closure,
                                                         GXimProtocol *proto,
                                                         ...);
void                g_xim_protocol_closure_free         (gpointer data,
                                                         GClosure *closure);
gboolean            g_xim_protocol_closure_is_an_extension
                                                        (GXimProtocolClosure *closure);
GXimProtocolClosure * g_xim_protocol_closure_new        (guint8 major_opcode,
                                                         guint8 minor_opcode,
                                                         const gchar *name,
                                                         gboolean is_an_extension);
void                g_xim_protocol_closure_set_marshal  (GXimProtocolClosure *closure,
                                                         GXimProtocolClosureFunc func,
                                                         gpointer data);
gulong              g_xim_protocol_connect_closure_by_id
                                                        (GXimProtocol *proto,
                                                         guint8 major_opcode,
                                                         guint8 minor_opcode,
                                                         GCallback func,
                                                         gpointer data);
gulong              g_xim_protocol_connect_closure_by_name
                                                        (GXimProtocol *proto,
                                                         const gchar *signal_name,
                                                         GCallback func,
                                                         gpointer data);
void                g_xim_protocol_dispose              (GObject *object);
GXimProtocolQueueNode * g_xim_protocol_end_queue        (GXimProtocol *proto);
void                g_xim_protocol_finalize             (GObject *object);
GQuark              g_xim_protocol_get_error_quark      (void);
GSList *            g_xim_protocol_get_extensions       (GXimProtocol *proto);
GXimProtocolPrivate * g_xim_protocol_get_private        (GXimProtocol *proto);
guint               g_xim_protocol_get_queue_length     (GXimProtocol *proto);
void                g_xim_protocol_init                 (GXimProtocol *proto);
gboolean            g_xim_protocol_is_queued            (GXimProtocol *proto);
GXimProtocolClosure * g_xim_protocol_lookup_protocol_by_id
                                                        (GXimProtocol *proto,
                                                         guint8 major_opcode,
                                                         guint8 minor_opcode);
GXimProtocolClosure * g_xim_protocol_lookup_protocol_by_name
                                                        (GXimProtocol *proto,
                                                         const gchar *name);
#define             g_xim_protocol_n_pad4               (_n_)
gboolean            g_xim_protocol_process_event        (GXimProtocol *proto,
                                                         GdkEventClient *event,
                                                         GError **error);
gboolean            g_xim_protocol_raise_parser_error   (GXimProtocol *proto,
                                                         guint major_opcode,
                                                         guint minor_opcode,
                                                         guint imid,
                                                         guint icid);
gboolean            g_xim_protocol_read_format          (GXimProtocol *proto,
                                                         GDataInputStream *stream,
                                                         GCancellable *cancellable,
                                                         GError **error,
                                                         guint n_params,
                                                         ...);
gboolean            g_xim_protocol_read_vformat         (GXimProtocol *proto,
                                                         GDataInputStream *stream,
                                                         GCancellable *cancellable,
                                                         GError **error,
                                                         guint n_params,
                                                         va_list args);
void                g_xim_protocol_remove_protocol      (GXimProtocol *proto,
                                                         GXimProtocolClosure *closure);
void                g_xim_protocol_remove_protocol_by_id
                                                        (GXimProtocol *proto,
                                                         guint8 major_opcode,
                                                         guint8 minor_opcode);
gboolean            g_xim_protocol_send                 (GXimProtocol *proto,
                                                         GXimOpcode major_opcode,
                                                         guint8 minor_opcode,
                                                         guint n_params,
                                                         ...);
gsize               g_xim_protocol_send_format          (GXimProtocol *proto,
                                                         GCancellable *cancellable,
                                                         GError **error,
                                                         guint n_params,
                                                         ...);
gboolean            g_xim_protocol_send_packets         (GXimProtocol *proto,
                                                         const gchar *data,
                                                         gsize length);
gsize               g_xim_protocol_send_vformat         (GXimProtocol *proto,
                                                         GCancellable *cancellable,
                                                         GError **error,
                                                         guint n_params,
                                                         va_list args);
gboolean            g_xim_protocol_send_with_list       (GXimProtocol *proto,
                                                         GXimOpcode major_opcode,
                                                         guint8 minor_opcode,
                                                         GSList *types,
                                                         GSList *values);
gboolean            g_xim_protocol_start_queue          (GXimProtocol *proto);
gboolean            g_xim_protocol_translate            (GXimProtocol *proto,
                                                         gpointer data,
                                                         gssize length,
                                                         GError **error);
gboolean            g_xim_protocol_wait_for_reply       (GXimProtocol *proto,
                                                         GXimOpcode major_opcode,
                                                         guint8 minor_opcode,
                                                         GError **error);

Description

GXimProtocol provides an interface to deal with XIM protocol events.

Details

GXimProtocolClosure

typedef struct {
	GCClosure        closure;
	GClosureMarshal  signal_marshaller;
	guint            n_params;
	GType           *param_types;
	GSList          *signal_handlers;
	gchar           *name;
	union {
		GXimOpcode v1;
		guint8     v2;
	} major_opcode;
	guint8           minor_opcode;
	gboolean         is_an_extension;
} GXimProtocolClosure;

GXimProtocolClosureFunc ()

gboolean            (*GXimProtocolClosureFunc)          (GXimProtocolClosure *closure,
                                                         GXimProtocol *proto,
                                                         GDataInputStream *stream,
                                                         GError **error,
                                                         gpointer user_data);


enum GXimProtocolError

typedef enum {
	G_XIM_PROTOCOL_ERROR_BEGIN = 128,
	G_XIM_PROTOCOL_ERROR_UNKNOWN_ENDIAN,
	G_XIM_PROTOCOL_ERROR_INVALID_PACKETS_RECEIVED,
	G_XIM_PROTOCOL_ERROR_DELIVERY_FAILURE,
	G_XIM_PROTOCOL_ERROR_NO_PARSER,
	G_XIM_PROTOCOL_ERROR_NO_DATA,
} GXimProtocolError;

Error codes returned by GXimProtocol functions.

G_XIM_PROTOCOL_ERROR_BEGIN

Unused.

G_XIM_PROTOCOL_ERROR_UNKNOWN_ENDIAN

Packets is sent with the unknown endian.

G_XIM_PROTOCOL_ERROR_INVALID_PACKETS_RECEIVED

Not parserable packets received.

G_XIM_PROTOCOL_ERROR_DELIVERY_FAILURE

Unable to deliver the signal properly.

G_XIM_PROTOCOL_ERROR_NO_PARSER

No handlers available to parse packets.

G_XIM_PROTOCOL_ERROR_NO_DATA

No data received in a request.

struct GXimProtocolIface

struct GXimProtocolIface {
	GTypeInterface  parent_iface;

	GXimMessages   *message;
	GdkAtom         atom_xim_protocol;
	GdkAtom         atom_xim_moredata;
};

An interface of XIM protocol.

GTypeInterface parent_iface;

a parent.

GXimMessages *message;

a GXimMessages.

GdkAtom atom_xim_protocol;

a GdkAtom for _XIM_PROTOCOL.

GdkAtom atom_xim_moredata;

a GdkAtom for _XIM_MOREDATA.

struct GXimProtocolQueueNode

struct GXimProtocolQueueNode {
	gchar    *data;
	gsize     length;
	guint16   major_opcode;
	guint16   minor_opcode;
	guint16   imid;
	guint16   icid;
	gboolean  is_sent;
};

gchar *data;

the packet data received.

gsize length;

the number of bytes of data.

guint16 major_opcode;

the major opcode in XIM protocol

guint16 minor_opcode;

the minor opcode in XIM protocol

guint16 imid;

the input-method ID

guint16 icid;

the input-context ID

gboolean is_sent;


G_XIM_OPCODE_KEY()

#define G_XIM_OPCODE_KEY(_m_,_n_) GUINT_TO_POINTER ((_m_) << 8 | ((_n_) & 0xff))

Generates a key from opcodes.

_m_ :

a major opcode in XIM protocol.

_n_ :

a minor opcode in XIM protocol.

G_XIM_PROTOCOL_ERROR

#define G_XIM_PROTOCOL_ERROR		(g_xim_protocol_get_error_quark())

Error domain for GXimProtocol. Errors in this domain will be from the GXimProtocolError or GXimStandardError enumeration. See GError for more information on error domains.


g_xim_attr_get_attribute_from_stream ()

gpointer            g_xim_attr_get_attribute_from_stream
                                                        (GXimProtocol *proto,
                                                         GXimAttr *attr,
                                                         GDataInputStream *stream,
                                                         GCancellable *cancellable,
                                                         GError **error);


g_xim_attr_put_attribute_to_stream ()

gsize               g_xim_attr_put_attribute_to_stream  (GXimProtocol *proto,
                                                         GXimAttr *attr,
                                                         guint attribute_id,
                                                         GCancellable *cancellable,
                                                         GError **error);


g_xim_protocol_add_protocol ()

void                g_xim_protocol_add_protocol         (GXimProtocol *proto,
                                                         GXimProtocolClosure *closure);

Registers a closure to add the XIM protocol handler.

proto :

a GXimProtocol.

closure :

a structure of closure.

g_xim_protocol_cancel_queue ()

void                g_xim_protocol_cancel_queue         (GXimProtocol *proto);

Cancels queueing. Note that you have to invoke this function if you can't proceed queueing process with any errors say. otherwise invalid node is kept in the queue and you may get a trouble with it eveutnally.

proto :

a GXimProtocol.

g_xim_protocol_closure_add_signal ()

void                g_xim_protocol_closure_add_signal   (GXimProtocolClosure *closure,
                                                         GClosureMarshal marshaller,
                                                         guint n_params,
                                                         ...);

Adds a marshaller for signal.

closure :

a GXimProtocolClosure.

marshaller :

the GClosureMarshal to deal with the signal.

n_params :

the number of parameters for the signal.

... :

a list of types, one for each parameter.

g_xim_protocol_closure_connect ()

gulong              g_xim_protocol_closure_connect      (GXimProtocolClosure *closure,
                                                         GCallback func,
                                                         gpointer data);

Connects a closure to a signal.

closure :

a GXimProtocolClosure.

func :

the GCallback to connect.

data :

data to pass to func.

Returns :

the handler id.

g_xim_protocol_closure_disconnect ()

void                g_xim_protocol_closure_disconnect   (GXimProtocolClosure *closure,
                                                         gulong id);

Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal if has been connected to. The id becomes invalid and may be reused.

The id has to be a valid signal handler id, connected to a signal of closure.

closure :

a GXimProtocolClosure.

id :

Handler id of the handler to be disconnected.

g_xim_protocol_closure_emit_signal ()

gboolean            g_xim_protocol_closure_emit_signal  (GXimProtocolClosure *closure,
                                                         GXimProtocol *proto,
                                                         ...);

Emits a signal.

closure :

a GXimProtocolClosure.

proto :

the instance which wants to raise a signal with closure.

... :

parameters to be passed to the signal.

Returns :

TRUE to be proceeded a signal in the handlers. FALSE to be failed in any handlers or no handlers for this signal.

g_xim_protocol_closure_free ()

void                g_xim_protocol_closure_free         (gpointer data,
                                                         GClosure *closure);


g_xim_protocol_closure_is_an_extension ()

gboolean            g_xim_protocol_closure_is_an_extension
                                                        (GXimProtocolClosure *closure);

Checks if the closure was created as an extension protocol in XIM.

closure :

a GXimProtocolClosure.

Returns :

TRUE to be an extension.

g_xim_protocol_closure_new ()

GXimProtocolClosure * g_xim_protocol_closure_new        (guint8 major_opcode,
                                                         guint8 minor_opcode,
                                                         const gchar *name,
                                                         gboolean is_an_extension);

Creates an instance of the GXimProtocolClosure.

major_opcode :

a major opcode in XIM protocol.

minor_opcode :

a minor opcode in XIM protocol.

name :

the XIM protocol name.

is_an_extension :

TRUE to define an extension in XIM protocol, otherwise FALSE.

Returns :

the GXimProtocolClosure.

g_xim_protocol_closure_set_marshal ()

void                g_xim_protocol_closure_set_marshal  (GXimProtocolClosure *closure,
                                                         GXimProtocolClosureFunc func,
                                                         gpointer data);

Sets the marshaller of closure which scans the XIM protocol packets and emit the proper signal as needed. Note that g_xim_protocol_closure_emit_signal() has to be invoked in func otherwise any signals added by g_xim_protocol_closure_add_signal() won't do anything at all.

closure :

a GXimProtocolClosure.

func :

the GXimProtocolClosureFunc function to scan the XIM protocol packet and emits the proper signal.

data :

the data to store in the data field of the GClosure.

g_xim_protocol_connect_closure_by_id ()

gulong              g_xim_protocol_connect_closure_by_id
                                                        (GXimProtocol *proto,
                                                         guint8 major_opcode,
                                                         guint8 minor_opcode,
                                                         GCallback func,
                                                         gpointer data);

Connects a GCallback function to a signal for XIM protocol events.

proto :

a GXimProtocol.

major_opcode :

a major opcode in XIM protocol.

minor_opcode :

a minor opcode in XIM protocol.

func :

the GCallback to connect.

data :

data to pass to func.

Returns :

the handler id.

g_xim_protocol_connect_closure_by_name ()

gulong              g_xim_protocol_connect_closure_by_name
                                                        (GXimProtocol *proto,
                                                         const gchar *signal_name,
                                                         GCallback func,
                                                         gpointer data);

Connects a GCallback function to a signal for XIM protocol events.

proto :

a GXimProtocol.

signal_name :

a XIM protocol event name.

func :

the GCallback to connect.

data :

data to pass to func.

Returns :

the handler id.

g_xim_protocol_dispose ()

void                g_xim_protocol_dispose              (GObject *object);

Releases all references to other objects. This can be used to break reference cycles.

This function should only be called from "dispose" which has the GXimProtocol interface.

object :

a GObject.

g_xim_protocol_end_queue ()

GXimProtocolQueueNode * g_xim_protocol_end_queue        (GXimProtocol *proto);

Terminates the queue.

proto :

a GXimProtocol.

Returns :

the GXimProtocolQueueNode which queued the request this time.

g_xim_protocol_finalize ()

void                g_xim_protocol_finalize             (GObject *object);

Finalizes the instance.

This function should only be called from "finalize" which has the GXimProtocol interface.

object :

a GObject.

g_xim_protocol_get_error_quark ()

GQuark              g_xim_protocol_get_error_quark      (void);


g_xim_protocol_get_extensions ()

GSList *            g_xim_protocol_get_extensions       (GXimProtocol *proto);

Obtains a set of GXimProtocolClosure registered as an extension. this is helpful to deal with G_XIM_QUERY_EXTENSION and so on.

proto :

a GXimProtocol.

Returns :

the GSList which contains GXimProtocolClosure.

g_xim_protocol_get_private ()

GXimProtocolPrivate * g_xim_protocol_get_private        (GXimProtocol *proto);

Obtains the GXimProtocolPrivate which is referenced proto.

proto :

a GXimProtocol.

g_xim_protocol_get_queue_length ()

guint               g_xim_protocol_get_queue_length     (GXimProtocol *proto);

Obtains how many requests are stored in the queue now.

proto :

a GXimProtocol.

Returns :

the number of requests in the queue.

g_xim_protocol_init ()

void                g_xim_protocol_init                 (GXimProtocol *proto);

Initializes proto. this isn't being invoked from the class automatically which has a GXimProtocol interface. you need to call this function manually before doing something with proto.

proto :

a GXimProtocol.

g_xim_protocol_is_queued ()

gboolean            g_xim_protocol_is_queued            (GXimProtocol *proto);

Checks if proto is in queueing process.

proto :

a GXimProtocol.

Returns :

TRUE to be in the queueing process. otherwise FALSE.

g_xim_protocol_lookup_protocol_by_id ()

GXimProtocolClosure * g_xim_protocol_lookup_protocol_by_id
                                                        (GXimProtocol *proto,
                                                         guint8 major_opcode,
                                                         guint8 minor_opcode);

Looks up the XIM protocol closure with major_opcode and minor_opcode which proto is dealing with.

proto :

a GXimProtocol.

major_opcode :

a major opcode in XIM protocol.

minor_opcode :

a minor opcode in XIM protocol.

Returns :

a GXimProtocolClosure corresponding to major_opcode and minor_opcode.

g_xim_protocol_lookup_protocol_by_name ()

GXimProtocolClosure * g_xim_protocol_lookup_protocol_by_name
                                                        (GXimProtocol *proto,
                                                         const gchar *name);

Looks up the XIM protocol closure with name which proto is dealing with.

proto :

a GXimProtocol.

name :

the name of XIM protocol event.

Returns :

a GXimProtocolClosure corresponding to name.

g_xim_protocol_n_pad4()

#define             g_xim_protocol_n_pad4(_n_)

Generates a number aligned to 4 bytes as needed.

_n_ :

a number

g_xim_protocol_process_event ()

gboolean            g_xim_protocol_process_event        (GXimProtocol *proto,
                                                         GdkEventClient *event,
                                                         GError **error);

Picks up XIM protocol packets from event and deal with it as needed.

proto :

a GXimProtocol.

event :

the GdkEventClient which wants to process this time.

error :

a location to store error, or NULL.

Returns :

TRUE to be processed successfully.

g_xim_protocol_raise_parser_error ()

gboolean            g_xim_protocol_raise_parser_error   (GXimProtocol *proto,
                                                         guint major_opcode,
                                                         guint minor_opcode,
                                                         guint imid,
                                                         guint icid);

Raises an appropriate error to the opposite direction on the connection according to major_opcode and minor_opcode.

proto :

a GXimProtocol.

major_opcode :

a major opcode in XIM protocol.

minor_opcode :

a minor opcode in XIM protocol.

imid :

input-method ID.

icid :

input-context ID.

Returns :

TRUE to be sent an error successfully.

g_xim_protocol_read_format ()

gboolean            g_xim_protocol_read_format          (GXimProtocol *proto,
                                                         GDataInputStream *stream,
                                                         GCancellable *cancellable,
                                                         GError **error,
                                                         guint n_params,
                                                         ...);

Scans XIM protocol packets according to the set of parameters. if any, objects generated against it is stored in the locations pointed to by the pointer arguments. Each pointer argument must be of a type that is appropriate for the value returned by the corresponding value type. See GXimValueType documentation which objects the value type is supposed to be.

proto :

a GXimProtocol.

stream :

a GDataInputStream which contains XIM protocol packets.

cancellable :

optional GCancellable object, NULL to ignore.

error :

a location to store error, or NULL.

n_params :

the number of a set of parameters.

Returns :

TRUE to be read successfully.

g_xim_protocol_read_vformat ()

gboolean            g_xim_protocol_read_vformat         (GXimProtocol *proto,
                                                         GDataInputStream *stream,
                                                         GCancellable *cancellable,
                                                         GError **error,
                                                         guint n_params,
                                                         va_list args);

Scans XIM protocol packets according to the set of parameters. if any, objects generated against it is stored in the locations pointed to by the pointer arguments. Each pointer argument must be of a type that is appropriate for the value returned by the corresponding value type. See GXimValueType documentation which objects the value type is supposed to be.

proto :

a GXimProtocol.

stream :

a GDataInputStream which contains XIM protocol packets.

cancellable :

optional GCancellable object, NULL to ignore.

error :

a location to store error, or NULL.

n_params :

the number of a set of parameters.

args :

a va_list.

Returns :

TRUE to be read successfully.

g_xim_protocol_remove_protocol ()

void                g_xim_protocol_remove_protocol      (GXimProtocol *proto,
                                                         GXimProtocolClosure *closure);

Gets rid of closure to stop XIM protocol handling in proto.

proto :

a GXimProtocol.

closure :

a structure of closure.

g_xim_protocol_remove_protocol_by_id ()

void                g_xim_protocol_remove_protocol_by_id
                                                        (GXimProtocol *proto,
                                                         guint8 major_opcode,
                                                         guint8 minor_opcode);

Gets rid of XIM protocol handling to stop dealing with major_opcode and minor_opcode in proto.

proto :

a GXimProtocol.

major_opcode :

a major opcode in XIM protocol.

minor_opcode :

a minor opcode in XIM protocol.

g_xim_protocol_send ()

gboolean            g_xim_protocol_send                 (GXimProtocol *proto,
                                                         GXimOpcode major_opcode,
                                                         guint8 minor_opcode,
                                                         guint n_params,
                                                         ...);

Sends XIM protocol according to the set of parameters. one is a parameter type defined in GXimValueType, and one is an object related to that. See GXimValueType documentation which objects are supposed to be specified with them.

proto :

a GXimProtocol.

major_opcode :

a major opcode in XIM protocol.

minor_opcode :

a minor opcode in XIM protocol.

n_params :

the number of a set of parameters.

Returns :

TRUE to be sent successfully.

g_xim_protocol_send_format ()

gsize               g_xim_protocol_send_format          (GXimProtocol *proto,
                                                         GCancellable *cancellable,
                                                         GError **error,
                                                         guint n_params,
                                                         ...);

Converts the objects to the XIM protocol packets according to the format and store it into the send buffer. you shouldn't use this function directly. use g_xim_protocol_send() instead.

proto :

a GXimProtocol.

cancellable :

optional GCancellable object, NULL to ignore.

error :

a location to store error, or NULL.

n_params :

the number of a set of parameters.

Returns :

the number of data stored.

g_xim_protocol_send_packets ()

gboolean            g_xim_protocol_send_packets         (GXimProtocol *proto,
                                                         const gchar *data,
                                                         gsize length);

Sends data to the opposite direction on the connection.

proto :

a GXimProtocol.

data :

a chunk of XIM protocol packets.

length :

the number of data.

Returns :

TRUE to be sent successfully.

g_xim_protocol_send_vformat ()

gsize               g_xim_protocol_send_vformat         (GXimProtocol *proto,
                                                         GCancellable *cancellable,
                                                         GError **error,
                                                         guint n_params,
                                                         va_list args);

Converts the objects to the XIM protocol packets according to format and store it into the send buffer. you shouldn't use this function directly. use g_xim_protocol_send() instead.

proto :

a GXimProtocol.

cancellable :

optional GCancellable object, NULL to ignore.

error :

a location to store error, or NULL.

n_params :

the number of a set of parameters.

args :

a va_list.

Returns :

the number of data stored.

g_xim_protocol_send_with_list ()

gboolean            g_xim_protocol_send_with_list       (GXimProtocol *proto,
                                                         GXimOpcode major_opcode,
                                                         guint8 minor_opcode,
                                                         GSList *types,
                                                         GSList *values);

Sends XIM protocol according to types and values. See GXimValueType documentation which objects are supposed to be specified with them.

proto :

a GXimProtocol.

major_opcode :

a major opcode in XIM protocol.

minor_opcode :

a minor opcode in XIM protocol.

types :

a list of GXimValueType.

values :

a list of objects fitting to each value types in types.

Returns :

TRUE to be sent successfully.

g_xim_protocol_start_queue ()

gboolean            g_xim_protocol_start_queue          (GXimProtocol *proto);

Prepares the queue to not send a request immediately. this function is useful if you need to wait for any requests but want to send it after the pending requests is done.

proto :

a GXimProtocol.

Returns :

TRUE to be ready to queue.

g_xim_protocol_translate ()

gboolean            g_xim_protocol_translate            (GXimProtocol *proto,
                                                         gpointer data,
                                                         gssize length,
                                                         GError **error);

Translate the packets and deliver it to the appropriate places.

proto :

a GXimProtocol.

data :

a chunk of XIM protocol packets

length :

the number of data.

error :

a location to store error, or NULL.

Returns :

TRUE to be processed successfully.

g_xim_protocol_wait_for_reply ()

gboolean            g_xim_protocol_wait_for_reply       (GXimProtocol *proto,
                                                         GXimOpcode major_opcode,
                                                         guint8 minor_opcode,
                                                         GError **error);

Waits for a response of major_opcode and minor_opcode or G_XIM_ERROR. this can be used if you need to send a request synchronously. Note that using this function in the server instance won't works due to how GObject delivers signals and iterates it.

proto :

a GXimProtocol.

major_opcode :

a major opcode in XIM protocol.

minor_opcode :

a minor opcode in XIM protocol.

error :

a location to store error, or NULL.

Returns :

TRUE the request was successfully done.