47
55
typedef struct _IBusServer IBusServer;
48
56
typedef struct _IBusServerClass IBusServerClass;
59
* IBusNewConnectionFunc:
60
* @server: An IBusServer.
61
* @connection: The corresponding IBusConnection.
63
* Prototype of new connection callback function.
65
* This callback should be connected to signal ::new-connection
66
* to handle the event that a new connection is coming in.
67
* In this handler, IBus could add a reference and continue processing the connection.
68
* If no reference is added, the new connection will be released and closed after this signal.
70
* @see_also: ::new-connection
50
73
typedef void (* IBusNewConnectionFunc) (IBusServer *server, IBusConnection *connection);
78
* An opaque object representing an IBusServer.
52
80
struct _IBusServer {
54
82
/* instance members */
68
96
GType ibus_server_get_type (void);
100
* @returns: A newly allocated IBusServer instance.
69
104
IBusServer *ibus_server_new (void);
107
* ibus_server_listen:
108
* @server: An IBusServer.
109
* @address: Address of this server.
110
* @returns: TRUE if succeed ; FALSE otherwise.
112
* Listens for new connections on the given address.
114
* If there are multiple semicolon-separated address entries in the address,
115
* tries each one and listens on the first one that works.
117
* Returns FALSE if listening fails for any reason.
119
* To free the server, applications must call first ibus_server_disconnect() and then dbus_server_unref().
70
121
gboolean ibus_server_listen (IBusServer *server,
71
122
const gchar *address);
125
* ibus_server_disconnect:
126
* @server: An IBusServer.
128
* Releases the server's address and stops listening for new clients.
130
* If called more than once, only the first call has an effect. Does not modify the server's reference count.
72
132
void ibus_server_disconnect (IBusServer *server);
135
* ibus_server_get_address:
136
* @server: An IBusServer.
137
* @returns: A newly allocated string which contain address.
139
* Returns the address of the server, as a newly-allocated string which must be freed by the caller.
73
141
const gchar *ibus_server_get_address (IBusServer *server);
144
* ibus_server_get_id:
145
* @server: An IBusServer.
146
* @returns: A newly allocated string which contain address.
148
* Returns the unique ID of the server, as a newly-allocated string which must be freed by the caller.
150
* This ID is normally used by clients to tell when two IBusConnection would be equivalent
151
* (because the server address passed to ibus_connection_open() will have the same guid in the two cases).
152
* ibus_connection_open() can re-use an existing connection with the same ID instead of opening a new connection.
154
* This is an ID unique to each IBusServer. Remember that an IBusServer represents only one mode of connecting,
155
* so e.g. a bus daemon can listen on multiple addresses which will mean it has multiple IBusServer each with
158
* The ID is not a UUID in the sense of RFC4122; the details are explained in the D-Bus specification.
159
* Returns the address of the server, as a newly-allocated string which must be freed by the caller.
74
161
const gchar *ibus_server_get_id (IBusServer *server);
164
* ibus_server_is_connected:
165
* @server: An IBusServer.
166
* @returns: TRUE if the server is still listening for new connections; FALSE otherwise.
168
* Returns TRUE if the server is still listening for new connections.
75
170
gboolean ibus_server_is_connected (IBusServer *server);
173
* ibus_server_set_auth_mechanisms:
174
* @server: An IBusServer.
175
* @mechanisms: NULL-terminated array of mechanisms.
176
* @returns: TRUE if succeed; FALSE if insufficient memory.
178
* Sets the authentication mechanisms that this server offers to clients,
179
* as a NULL-terminated array of mechanism names.
181
* This function only affects connections created after it is called.
182
* Pass NULL instead of an array to use all available mechanisms (this is the default behavior).
184
* The D-Bus specification describes some of the supported mechanisms.
76
186
gboolean ibus_server_set_auth_mechanisms(IBusServer *server,
77
187
const gchar **mechanisms);