GXimProtocol

GXimProtocol

Synopsis




#define             G_XIM_PROTOCOL_ERROR
#define             g_xim_protocol_n_pad4               (_n_)
#define             G_XIM_OPCODE_KEY                    (_m_,_n_)
                    GXimProtocolIface;
                    GXimProtocolPrivate;
                    GXimProtocolQueueNode;
enum                GXimProtocolError;
void                g_xim_protocol_init                 (GXimProtocol *proto);
void                g_xim_protocol_dispose              (GObject *object);
void                g_xim_protocol_finalize             (GObject *object);
GXimProtocolPrivate* g_xim_protocol_get_private         (GXimProtocol *proto);
GQuark              g_xim_protocol_get_error_quark      (void);
gboolean            g_xim_protocol_process_event        (GXimProtocol *proto,
                                                         GdkEventClient *event,
                                                         GError **error);
gboolean            g_xim_protocol_translate            (GXimProtocol *proto,
                                                         gpointer data,
                                                         gssize length,
                                                         GError **error);
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);
gsize               g_xim_protocol_send_format          (GXimProtocol *proto,
                                                         GCancellable *cancellable,
                                                         GError **error,
                                                         guint n_params,
                                                         ...);
gboolean            g_xim_protocol_send                 (GXimProtocol *proto,
                                                         GXimOpcode major_opcode,
                                                         guint8 minor_opcode,
                                                         guint n_params,
                                                         ...);
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);
GXimProtocolQueueNode* g_xim_protocol_end_queue         (GXimProtocol *proto);
void                g_xim_protocol_cancel_queue         (GXimProtocol *proto);
gboolean            g_xim_protocol_is_queued            (GXimProtocol *proto);
gboolean            g_xim_protocol_read_vformat         (GXimProtocol *proto,
                                                         GDataInputStream *stream,
                                                         GCancellable *cancellable,
                                                         GError **error,
                                                         guint n_params,
                                                         va_list args);
gboolean            g_xim_protocol_read_format          (GXimProtocol *proto,
                                                         GDataInputStream *stream,
                                                         GCancellable *cancellable,
                                                         GError **error,
                                                         guint n_params,
                                                         ...);
gboolean            g_xim_protocol_wait_for_reply       (GXimProtocol *proto,
                                                         GXimOpcode major_opcode,
                                                         guint8 minor_opcode,
                                                         GError **error);
gboolean            g_xim_protocol_raise_parser_error   (GXimProtocol *proto,
                                                         guint major_opcode,
                                                         guint minor_opcode,
                                                         guint imid,
                                                         guint icid);
void                g_xim_protocol_add_protocol         (GXimProtocol *proto,
                                                         GXimProtocolClosure *closure);
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);
GXimProtocolClosure* g_xim_protocol_lookup_protocol_by_name
                                                        (GXimProtocol *proto,
                                                         const gchar *name);
GXimProtocolClosure* g_xim_protocol_lookup_protocol_by_id
                                                        (GXimProtocol *proto,
                                                         guint8 major_opcode,
                                                         guint8 minor_opcode);
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);
GSList*             g_xim_protocol_get_extensions       (GXimProtocol *proto);
gboolean            (*GXimProtocolClosureFunc)          (GXimProtocolClosure *closure,
                                                         GXimProtocol *proto,
                                                         GDataInputStream *stream,
                                                         GError **error,
                                                         gpointer user_data);
                    GXimProtocolClosure;
GXimProtocolClosure* g_xim_protocol_closure_new         (guint8 major_opcode,
                                                         guint8 minor_opcode,
                                                         const gchar *name,
                                                         gboolean is_an_extension);
void                g_xim_protocol_closure_free         (gpointer data,
                                                         GClosure *closure);
gboolean            g_xim_protocol_closure_is_an_extension
                                                        (GXimProtocolClosure *closure);
void                g_xim_protocol_closure_set_marshal  (GXimProtocolClosure *closure,
                                                         GXimProtocolClosureFunc func,
                                                         gpointer data);
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,
                                                         ...);
gsize               g_xim_attr_put_attribute_to_stream  (GXimProtocol *proto,
                                                         GXimAttr *attr,
                                                         guint attribute_id,
                                                         GCancellable *cancellable,
                                                         GError **error);
gpointer            g_xim_attr_get_attribute_from_stream
                                                        (GXimProtocol *proto,
                                                         GXimAttr *attr,
                                                         GDataInputStream *stream,
                                                         GCancellable *cancellable,
                                                         GError **error);

Description

Details

G_XIM_PROTOCOL_ERROR

#define G_XIM_PROTOCOL_ERROR		(g_xim_protocol_get_error_quark())


g_xim_protocol_n_pad4()

#define             g_xim_protocol_n_pad4(_n_)

_n_ :


G_XIM_OPCODE_KEY()

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

_m_ :

_n_ :


GXimProtocolIface

typedef struct {
	GTypeInterface  parent_iface;

	GXimMessage    *message;
	GdkAtom         atom_xim_protocol;
	GdkAtom         atom_xim_moredata;
} GXimProtocolIface;

An interface of XIM protocol.

GTypeInterface parent_iface;

GXimMessage *message;

a GXimMessage.

GdkAtom atom_xim_protocol;

GdkAtom atom_xim_moredata;


GXimProtocolPrivate

typedef struct {
	GOutputStream        *base_send_ostream;
	GOutputStream        *base_recv_ostream;
	GDataOutputStream    *send_ostream;
	GDataOutputStream    *recv_ostream;
	GHashTable           *proto_table__named_index;
	GHashTable           *proto_table__id_index;
	GQueue               *markerq;
	GQueue               *syncableq;
	GQueue               *sendq;
	gulong                base_signal_ids[LAST_XIM_EVENTS];
	gulong                signal_ids[LAST_XIM_EVENTS];
	GDataStreamByteOrder  byte_order;
	gboolean              is_disconnected;
	/* XXX: workaround for failing to get the number of bytes written */
	gssize                n_sent;
	gssize                n_received;
} GXimProtocolPrivate;


GXimProtocolQueueNode

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


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;


g_xim_protocol_init ()

void                g_xim_protocol_init                 (GXimProtocol *proto);

proto :


g_xim_protocol_dispose ()

void                g_xim_protocol_dispose              (GObject *object);

object :


g_xim_protocol_finalize ()

void                g_xim_protocol_finalize             (GObject *object);

object :


g_xim_protocol_get_private ()

GXimProtocolPrivate* g_xim_protocol_get_private         (GXimProtocol *proto);

proto :

Returns :


g_xim_protocol_get_error_quark ()

GQuark              g_xim_protocol_get_error_quark      (void);

Returns :


g_xim_protocol_process_event ()

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

proto :

event :

error :

Returns :


g_xim_protocol_translate ()

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

proto :

data :

length :

error :

Returns :


g_xim_protocol_send_packets ()

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

proto :

data :

length :

Returns :


g_xim_protocol_send_vformat ()

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

proto :

cancellable :

error :

n_params :

args :

Returns :


g_xim_protocol_send_format ()

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

proto :

cancellable :

error :

n_params :

... :

Returns :


g_xim_protocol_send ()

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

proto :

major_opcode :

minor_opcode :

n_params :

... :

Returns :


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);

proto :

major_opcode :

minor_opcode :

types :

values :

Returns :


g_xim_protocol_start_queue ()

gboolean            g_xim_protocol_start_queue          (GXimProtocol *proto);

proto :

Returns :


g_xim_protocol_end_queue ()

GXimProtocolQueueNode* g_xim_protocol_end_queue         (GXimProtocol *proto);

proto :

Returns :


g_xim_protocol_cancel_queue ()

void                g_xim_protocol_cancel_queue         (GXimProtocol *proto);

proto :


g_xim_protocol_is_queued ()

gboolean            g_xim_protocol_is_queued            (GXimProtocol *proto);

proto :

Returns :


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);

proto :

stream :

cancellable :

error :

n_params :

args :

Returns :


g_xim_protocol_read_format ()

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

proto :

stream :

cancellable :

error :

n_params :

... :

Returns :


g_xim_protocol_wait_for_reply ()

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

proto :

major_opcode :

minor_opcode :

error :

Returns :


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);

proto :

major_opcode :

minor_opcode :

imid :

icid :

Returns :


g_xim_protocol_add_protocol ()

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

proto :

closure :


g_xim_protocol_remove_protocol ()

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

proto :

closure :


g_xim_protocol_remove_protocol_by_id ()

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

proto :

major_opcode :

minor_opcode :


g_xim_protocol_lookup_protocol_by_name ()

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

proto :

name :

Returns :


g_xim_protocol_lookup_protocol_by_id ()

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

proto :

major_opcode :

minor_opcode :

Returns :


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);

proto :

major_opcode :

minor_opcode :

func :

data :

Returns :


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);

proto :

signal_name :

func :

data :

Returns :


g_xim_protocol_get_extensions ()

GSList*             g_xim_protocol_get_extensions       (GXimProtocol *proto);

proto :

Returns :


GXimProtocolClosureFunc ()

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

closure :

proto :

stream :

error :

user_data :

Returns :


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;


g_xim_protocol_closure_new ()

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

major_opcode :

minor_opcode :

name :

is_an_extension :

Returns :


g_xim_protocol_closure_free ()

void                g_xim_protocol_closure_free         (gpointer data,
                                                         GClosure *closure);

data :

closure :


g_xim_protocol_closure_is_an_extension ()

gboolean            g_xim_protocol_closure_is_an_extension
                                                        (GXimProtocolClosure *closure);

closure :

Returns :


g_xim_protocol_closure_set_marshal ()

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

closure :

func :

data :


g_xim_protocol_closure_add_signal ()

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

closure :

marshaller :

n_params :

... :


g_xim_protocol_closure_connect ()

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

closure :

func :

data :

Returns :


g_xim_protocol_closure_disconnect ()

void                g_xim_protocol_closure_disconnect   (GXimProtocolClosure *closure,
                                                         gulong id);

closure :

id :


g_xim_protocol_closure_emit_signal ()

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

closure :

proto :

... :

Returns :


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);

proto :

attr :

attribute_id :

cancellable :

error :

Returns :


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);

proto :

attr :

stream :

cancellable :

error :

Returns :