![]() |
![]() |
![]() |
IBus Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties | Signals |
IBusServer; IBusServerClass; void (*IBusNewConnectionFunc) (IBusServer *server
,IBusConnection *connection
); IBusServer * ibus_server_new (void
); gboolean ibus_server_listen (IBusServer *server
,const gchar *address
); void ibus_server_disconnect (IBusServer *server
); const gchar * ibus_server_get_address (IBusServer *server
); const gchar * ibus_server_get_id (IBusServer *server
); gboolean ibus_server_is_connected (IBusServer *server
); gboolean ibus_server_set_auth_mechanisms (IBusServer *server
,const gchar **mechanisms
);
An IBusServer listen on a socket and wait for connections requests, just like DBusServer.
typedef struct { IBusObjectClass parent; /* signals */ void (* new_connection) (IBusServer *server, IBusConnection *connectin); } IBusServerClass;
void (*IBusNewConnectionFunc) (IBusServer *server
,IBusConnection *connection
);
Prototype of new connection callback function.
This callback should be connected to signal ::new-connection to handle the event that a new connection is coming in. In this handler, IBus could add a reference and continue processing the connection. If no reference is added, the new connection will be released and closed after this signal.
see_also
: ::new-connection
|
An IBusServer. |
|
The corresponding IBusConnection. |
IBusServer * ibus_server_new (void
);
New an IBusServer.
Returns : |
A newly allocated IBusServer instance. |
gboolean ibus_server_listen (IBusServer *server
,const gchar *address
);
Listens for new connections on the given address.
If there are multiple semicolon-separated address entries in the address, tries each one and listens on the first one that works.
Returns FALSE if listening fails for any reason.
To free the server, applications must call first ibus_server_disconnect()
and then dbus_server_unref()
.
|
An IBusServer. |
|
Address of this server. |
Returns : |
TRUE if succeed ; FALSE otherwise. |
void ibus_server_disconnect (IBusServer *server
);
Releases the server's address and stops listening for new clients.
If called more than once, only the first call has an effect. Does not modify the server's reference count.
|
An IBusServer. |
const gchar * ibus_server_get_address (IBusServer *server
);
Returns the address of the server, as a newly-allocated string which must be freed by the caller.
|
An IBusServer. |
Returns : |
A newly allocated string which contain address. |
const gchar * ibus_server_get_id (IBusServer *server
);
Returns the unique ID of the server, as a newly-allocated string which must be freed by the caller.
This ID is normally used by clients to tell when two IBusConnection would be equivalent
(because the server address passed to ibus_connection_open()
will have the same guid in the two cases).
ibus_connection_open()
can re-use an existing connection with the same ID instead of opening a new connection.
This is an ID unique to each IBusServer. Remember that an IBusServer represents only one mode of connecting, so e.g. a bus daemon can listen on multiple addresses which will mean it has multiple IBusServer each with their own ID.
The ID is not a UUID in the sense of RFC4122; the details are explained in the D-Bus specification. Returns the address of the server, as a newly-allocated string which must be freed by the caller.
|
An IBusServer. |
Returns : |
A newly allocated string which contain address. |
gboolean ibus_server_is_connected (IBusServer *server
);
Returns TRUE if the server is still listening for new connections.
|
An IBusServer. |
Returns : |
TRUE if the server is still listening for new connections; FALSE otherwise. |
gboolean ibus_server_set_auth_mechanisms (IBusServer *server
,const gchar **mechanisms
);
Sets the authentication mechanisms that this server offers to clients, as a NULL-terminated array of mechanism names.
This function only affects connections created after it is called. Pass NULL instead of an array to use all available mechanisms (this is the default behavior).
The D-Bus specification describes some of the supported mechanisms.
|
An IBusServer. |
|
NULL-terminated array of mechanisms. |
Returns : |
TRUE if succeed; FALSE if insufficient memory. |
"connection-type"
property"connection-type" GType* : Read / Write
The connection type of server object.
"new-connection"
signalvoid user_function (IBusServer *server, GObject *connection, gpointer user_data) : Run Last
Emitted when a new connection is coming in. In this handler, IBus could add a reference and continue processing the connection. If no reference is added, the new connection will be released and closed after this signal.
Argument user_data
is ignored in this function.
See also: IBusNewConnectionFunc()
.
|
An IBusServer. |
|
The corresponding IBusConnection. |
|
user data set when the signal handler was connected. |