libgxim Reference Manual | ||||
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties | Signals |
GXimServerTemplate; struct GXimServerTemplateClass; enum GXimServerTemplateError; #define G_XIM_SRV_TMPL_ERROR void g_xim_srv_tmpl_add_connection (GXimServerTemplate *srvtmpl
,GXimConnection *conn
,GdkNativeWindow window
); GQuark g_xim_srv_tmpl_get_error_quark (void
); gboolean g_xim_srv_tmpl_is_running (GXimServerTemplate *srvtmpl
,GError **error
); GXimConnection * g_xim_srv_tmpl_lookup_connection (GXimServerTemplate *srvtmpl
,GdkWindow *window
); GXimConnection * g_xim_srv_tmpl_lookup_connection_with_native_window (GXimServerTemplate *srvtmpl
,GdkNativeWindow window
); void g_xim_srv_tmpl_remove_connection (GXimServerTemplate *srvtmpl
,GdkNativeWindow window
); gboolean g_xim_srv_tmpl_send_selection_notify (GXimServerTemplate *srvtmpl
,GdkEventSelection *event
,const gchar *data
,gsize length
,GError **error
); gboolean g_xim_srv_tmpl_take_ownership (GXimServerTemplate *srvtmpl
,gboolean force
,GError **error
);
"destroy" :Run First
"get-supported-locales" :Run Last
"get-supported-transport" :Run Last
"xconnect" :Run Last
GXimServerTemplate provides a common facility to deal with XIM protocol events, particularly to be working on XIM server.
typedef struct _GXimServerTemplate GXimServerTemplate;
An abstract implementation of XIM server class
typedef enum { G_XIM_SRV_TMPL_ERROR_BEGIN = 128, G_XIM_SRV_TMPL_ERROR_SAME_SERVER_IS_RUNNING, G_XIM_SRV_TMPL_ERROR_ANOTHER_SERVER_IS_RUNNING, G_XIM_SRV_TMPL_ERROR_UNABLE_TO_ACQUIRE_SERVER_OWNER, G_XIM_SRV_TMPL_ERROR_UNABLE_TO_ADD_SERVER, G_XIM_SRV_TMPL_ERROR_UNABLE_TO_SEND_PROPERTY_NOTIFY, } GXimServerTemplateError;
Error codes returned by GXimServerTemplate functions.
Unused. | |
Server is already running in the instance. | |
Server in another process is already running with the same name. | |
Unable to acquire the owner of the name. | |
Unable to add the server to XIM_SERVERS .
|
|
Failed to send PropertyNotify .
|
#define G_XIM_SRV_TMPL_ERROR (g_xim_srv_tmpl_get_error_quark())
Error domain for GXimServerTemplate. Errors in this domain will be from the GXimServerTemplateError or GXimStandardError enumeration. See GError for more information on error domains.
void g_xim_srv_tmpl_add_connection (GXimServerTemplate *srvtmpl
,GXimConnection *conn
,GdkNativeWindow window
);
Puts conn
to get it managed under srvtmpl
. window
will be referred to
deliver events to the right place. i.e. conn
to deal with events for window
.
|
a GXimServerTemplate. |
|
the GXimConnection to get it managed under srvtmpl . |
|
the GdkNativeWindow to make reference. |
gboolean g_xim_srv_tmpl_is_running (GXimServerTemplate *srvtmpl
,GError **error
);
Checks if XIM server process is already running at srvtmpl
.
|
a GXimServerTemplate. |
|
a location to store error, or NULL . |
Returns : |
TRUE when XIM server process is already running at srvtmpl .
Otherwise FALSE . |
GXimConnection * g_xim_srv_tmpl_lookup_connection (GXimServerTemplate *srvtmpl
,GdkWindow *window
);
Looks up the connection which is reference with window
. this is
a convenience function to look up with GdkWindow. use
g_xim_srv_tmpl_lookup_connection_with_native_window()
for GdkNativeWindow
if you like.
|
a GXimServerTemplate. |
|
the GdkWindow to look up the connection. |
Returns : |
a GXimConnection, or NULL if the key is not found. |
GXimConnection * g_xim_srv_tmpl_lookup_connection_with_native_window (GXimServerTemplate *srvtmpl
,GdkNativeWindow window
);
Looks up the connection which is reference with window
.
|
a GXimServerTemplate. |
|
the GdkNativeWindow to look up the connection. |
Returns : |
a GXimConnection, or NULL if the key is not found. |
void g_xim_srv_tmpl_remove_connection (GXimServerTemplate *srvtmpl
,GdkNativeWindow window
);
Gets rid of the connection, which managed under srvtmpl
. window
will be
used as the key to remove it.
|
a GXimServerTemplate. |
|
the GdkNativeWindow to get rid of the connection. which should be
added with g_xim_srv_tmpl_add_connection() . |
gboolean g_xim_srv_tmpl_send_selection_notify (GXimServerTemplate *srvtmpl
,GdkEventSelection *event
,const gchar *data
,gsize length
,GError **error
);
Sends data
with SelectionNotify
. which mainly be used to deliver the result
of LOCALES
and TRANSPORT
request.
|
a GXimServerTemplate. |
|
the GdkEventSelection to send. |
|
the chunks of data to send with SelectionNotify . |
|
the number of bytes of data to send. |
|
a location to store error, or NULL . |
Returns : |
TRUE if data is successfully sent. |
gboolean g_xim_srv_tmpl_take_ownership (GXimServerTemplate *srvtmpl
,gboolean force
,GError **error
);
Starts XIM server if able to take an ownership for "server_name" in X property.
|
a GXimServerTemplate. |
|
TRUE to take an ownership forcibly. FALSE to fail if the XIM server
is already running. |
|
a location to store error, or NULL . |
Returns : |
TRUE when XIM serrver could be started. |
"destroy"
signalvoid user_function (GXimServerTemplate *srvtmpl,
gpointer user_data) : Run First
The ::destroy signal will be emitted when the instance is going to be destroyed. you can do something with it if you want.
|
the object which received the signal. |
|
user data set when the signal handler was connected. |
"get-supported-locales"
signalgchar* user_function (GXimServerTemplate *srvtmpl,
gpointer user_data) : Run Last
The ::get-supported-locales signal will be emitted when the client application is connecting and requesting which locales XIM server would supports.
This is a convenience signal to deal with
"selection-request-event" for LOCALES
request.
|
the object which received the signal. |
|
user data set when the signal handler was connected. |
Returns : |
a locales string that XIM server would supports. multiple locales would be separated with comma. |
"get-supported-transport"
signalgchar* user_function (GXimServerTemplate *srvtmpl,
gpointer user_data) : Run Last
The ::get-supported-transport signal will be emitted when the client application is connecting and requesting which transport-specific names XIM server would supports.
This is a convenience signal to deal with
"selection-request-event" for TRANSPORT
request.
|
the object which received the signal. |
|
user data set when the signal handler was connected. |
Returns : |
a transport-specific names that XIM server would supports. In general, you may just need to support "X/" for X Window System. Multiple transport-specific names would be separated with comma. and evaluated in order of the list. |
"xconnect"
signalGXimConnection* user_function (GXimServerTemplate *srvtmpl,
GdkEvent *event,
gpointer user_data) : Run Last
The ::xconnect signal will be emitted when XIM_XCONNECT
event is
dispatched from the client applications in order to establish
a connection between XIM server and a client.
During processing this signal, it would be supposed to prepare
a GXimConnection instance and sends back XIM_XCONNECT
reply to
the client. See The Input Method Protocol, XIM specification document
for more details about XIM_XCONNECT
.
|
the object which received the signal. |
|
the GdkEventClient which triggered this signal. |
|
user data set when the signal handler was connected. |
Returns : |
a GXimConnection for this session. |