GXimClientTemplate

GXimClientTemplate — Base class for XIM client

Synopsis

#define             GXC_ESTABLISHED
#define             GXC_NEGOTIATING
#define             GXC_NONE
                    GXimClientTemplate;
struct              GXimClientTemplateClass;
enum                GXimClientTemplateError;
#define             G_XIM_CL_TMPL_ERROR
gboolean            g_xim_cl_tmpl_connect_to_server     (GXimClientTemplate *cltmpl,
                                                         GError **error);
GQuark              g_xim_cl_tmpl_get_error_quark       (void);
gboolean            g_xim_cl_tmpl_is_initialized        (GXimClientTemplate *cltmpl);
gboolean            g_xim_cl_tmpl_is_pending_negotiation
                                                        (GXimClientTemplate *cltmpl);
gboolean            g_xim_cl_tmpl_send_selection_request
                                                        (GXimClientTemplate *cltmpl,
                                                         GdkAtom atom,
                                                         GError **error);
gboolean            g_xim_cl_tmpl_start_negotiation     (GXimClientTemplate *cltmpl,
                                                         GError **error);

Object Hierarchy

  GObject
   +----GXimCore
         +----GXimClientTemplate

Properties

  "atom-server"              gpointer              : Read / Write / Construct Only

Signals

  "notify-locales"                                 : Run First
  "notify-transport"                               : Run First
  "xconnect"                                       : Run Last

Description

GXimClientTemplate provides a common facility to deal with XIM protocol events, particularly to be working on XIM client.

Details

GXC_ESTABLISHED

#define GXC_ESTABLISHED 2

the connection has been established and ready to do something with XIM protocol.


GXC_NEGOTIATING

#define GXC_NEGOTIATING 1

a statte that is negotiating the connection to XIM server.


GXC_NONE

#define GXC_NONE 0

a state not yet starting to negotiate the connection.


GXimClientTemplate

typedef struct _GXimClientTemplate GXimClientTemplate;

An implementation of XIM client class


struct GXimClientTemplateClass

struct GXimClientTemplateClass {
	GXimCoreClass  parent_class;
};


enum GXimClientTemplateError

typedef enum {
	G_XIM_CL_TMPL_ERROR_BEGIN = 128,
	G_XIM_CL_TMPL_ERROR_INVALID_CONNECTION_TYPE,
} GXimClientTemplateError;

Error codes returned by GXimClientTemplate functions.

G_XIM_CL_TMPL_ERROR_BEGIN

Unused.

G_XIM_CL_TMPL_ERROR_INVALID_CONNECTION_TYPE

The connection type isn't inherited from GXimConnection.

G_XIM_CL_TMPL_ERROR

#define G_XIM_CL_TMPL_ERROR		(g_xim_cl_tmpl_get_error_quark())

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


g_xim_cl_tmpl_connect_to_server ()

gboolean            g_xim_cl_tmpl_connect_to_server     (GXimClientTemplate *cltmpl,
                                                         GError **error);

Connects to XIM server. you have to call this function before doing something with XIM protocols.

cltmpl :

a GXimClientTemplate.

error :

a location to store error, or NULL.

Returns :

TRUE to be starting the negotiation to be connected successfully.

g_xim_cl_tmpl_get_error_quark ()

GQuark              g_xim_cl_tmpl_get_error_quark       (void);


g_xim_cl_tmpl_is_initialized ()

gboolean            g_xim_cl_tmpl_is_initialized        (GXimClientTemplate *cltmpl);

Checks if an instance of cltmpl is ready to process XIM protocols.

cltmpl :

a GXimClientTemplate.

Returns :

TRUE to be initialized the instance properly.

g_xim_cl_tmpl_is_pending_negotiation ()

gboolean            g_xim_cl_tmpl_is_pending_negotiation
                                                        (GXimClientTemplate *cltmpl);

Checks if an instance of cltmpl is waiting for finish the negotiation.

cltmpl :

a GXimClientTemplate.

Returns :

TRUE to be pending in any negotiation state.

g_xim_cl_tmpl_send_selection_request ()

gboolean            g_xim_cl_tmpl_send_selection_request
                                                        (GXimClientTemplate *cltmpl,
                                                         GdkAtom atom,
                                                         GError **error);

Sends a request of atom to the XIM server with SelectionRequest event.

cltmpl :

a GXimClientTemplate.

atom :

a GdkAtom to determine which request would be sent.

error :

a location to store error, or NULL.

Returns :

TRUE to be sent a request successfully.

g_xim_cl_tmpl_start_negotiation ()

gboolean            g_xim_cl_tmpl_start_negotiation     (GXimClientTemplate *cltmpl,
                                                         GError **error);

Starts the transaction to negotiate a connection between XIM server and the client.

This is a convenience function to send a request with g_xim_cl_tmpl_send_selection_request().

cltmpl :

a GXimClientTemplate.

error :

a location to store error, or NULL.

Returns :

TRUE to be sent a request for first negotiation successfully.

Property Details

The "atom-server" property

  "atom-server"              gpointer              : Read / Write / Construct Only

the GdkAtom where the client instance should connects to. the atom name would be something what you specify with XMODIFIERS=im=.

Signal Details

The "notify-locales" signal

void                user_function                      (GXimClientTemplate *cltmpl,
                                                        GStrv               locales,
                                                        gpointer            user_data)      : Run First

The ::notify-locales signal will be emitted when the cltmpl received a reply of acquiring the supported locales in XIM server.

This is a convenience signal to deal with "selection-notify-event" for a reply of LOCALES request.

cltmpl :

the object which received the signal.

locales :

an array of the string contains the locale names with NULL-terminated.

user_data :

user data set when the signal handler was connected.

The "notify-transport" signal

void                user_function                      (GXimClientTemplate *cltmpl,
                                                        GStrv               transport,
                                                        gpointer            user_data)      : Run First

The ::notify-transport signal will be emitted when the cltmpl received a reply of acquiring the supported transport-specific names in XIM server.

This is a convenience signal to deal with "selection-notify-event" for a reply of TRANSPORT request.

cltmpl :

the object which received the signal.

transport :

an array of the string contains the transport-specific names with NULL-terminated.

user_data :

user data set when the signal handler was connected.

The "xconnect" signal

gboolean            user_function                      (GXimClientTemplate *cltmpl,
                                                        GdkEvent           *event,
                                                        gpointer            user_data)      : Run Last

The ::xconnect signal will be emitted when XIM_XCONNECT event is dispatched from the XIM server in order to respond to XIM_XCONNECT event from the client. See The Input Method Protocol, XIM specification document for more details about XIM_XCONNECT.

cltmpl :

the object which received the signal.

event :

the GdkEventClient which triggered this signal.

user_data :

user data set when the signal handler was connected.

Returns :

TRUE to stop other handlers from being invoked for the event. FALSE to propagate the event further.

See Also

GXimCore