73
81
<indexterm zone="IBusNewConnectionFunc"><primary sortas="IBusNewConnectionFunc">IBusNewConnectionFunc</primary></indexterm><programlisting><link linkend="void">void</link> (*IBusNewConnectionFunc) (<link linkend="IBusServer">IBusServer</link> *server,
74
82
<link linkend="IBusConnection">IBusConnection</link> *connection);</programlisting>
84
Prototype of new connection callback function.
87
This callback should be connected to signal ::new-connection
88
to handle the event that a new connection is coming in.
89
In this handler, IBus could add a reference and continue processing the connection.
90
If no reference is added, the new connection will be released and closed after this signal.
93
<parameter>see_also</parameter>: ::new-connection</para>
76
95
</para><variablelist role="params">
77
96
<varlistentry><term><parameter>server</parameter> :</term>
97
<listitem><simpara> An IBusServer.
79
98
</simpara></listitem></varlistentry>
80
99
<varlistentry><term><parameter>connection</parameter> :</term>
100
<listitem><simpara> The corresponding IBusConnection.
82
101
</simpara></listitem></varlistentry>
83
102
</variablelist></refsect2>
84
103
<refsect2 id="IBusServer-struct" role="struct">
85
104
<title>IBusServer</title>
86
105
<indexterm zone="IBusServer-struct"><primary sortas="IBusServer">IBusServer</primary></indexterm><programlisting>typedef struct _IBusServer IBusServer;</programlisting>
107
An opaque object representing an IBusServer.</para>
88
109
</para></refsect2>
89
110
<refsect2 id="ibus-server-new" role="function">
90
111
<title>ibus_server_new ()</title>
91
112
<indexterm zone="ibus-server-new"><primary sortas="ibus_server_new">ibus_server_new</primary></indexterm><programlisting><link linkend="IBusServer">IBusServer</link> * ibus_server_new (void);</programlisting>
114
New an IBusServer.</para>
93
116
</para><variablelist role="params">
94
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
117
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> A newly allocated IBusServer instance.
95
118
</simpara></listitem></varlistentry>
96
119
</variablelist></refsect2>
97
120
<refsect2 id="ibus-server-listen" role="function">
99
122
<indexterm zone="ibus-server-listen"><primary sortas="ibus_server_listen">ibus_server_listen</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> ibus_server_listen (<link linkend="IBusServer">IBusServer</link> *server,
100
123
const <link linkend="gchar">gchar</link> *address);</programlisting>
125
Listens for new connections on the given address.
128
If there are multiple semicolon-separated address entries in the address,
129
tries each one and listens on the first one that works.
132
Returns FALSE if listening fails for any reason.
135
To free the server, applications must call first <link linkend="ibus-server-disconnect"><function>ibus_server_disconnect()</function></link> and then <link linkend="dbus-server-unref"><function>dbus_server_unref()</function></link>.</para>
102
137
</para><variablelist role="params">
103
138
<varlistentry><term><parameter>server</parameter> :</term>
139
<listitem><simpara> An IBusServer.
105
140
</simpara></listitem></varlistentry>
106
141
<varlistentry><term><parameter>address</parameter> :</term>
142
<listitem><simpara> Address of this server.
108
143
</simpara></listitem></varlistentry>
109
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
144
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> TRUE if succeed ; FALSE otherwise.
110
145
</simpara></listitem></varlistentry>
111
146
</variablelist></refsect2>
112
147
<refsect2 id="ibus-server-disconnect" role="function">
113
148
<title>ibus_server_disconnect ()</title>
114
149
<indexterm zone="ibus-server-disconnect"><primary sortas="ibus_server_disconnect">ibus_server_disconnect</primary></indexterm><programlisting><link linkend="void">void</link> ibus_server_disconnect (<link linkend="IBusServer">IBusServer</link> *server);</programlisting>
151
Releases the server's address and stops listening for new clients.
154
If called more than once, only the first call has an effect. Does not modify the server's reference count.</para>
116
156
</para><variablelist role="params">
117
157
<varlistentry><term><parameter>server</parameter> :</term>
158
<listitem><simpara> An IBusServer.
119
159
</simpara></listitem></varlistentry>
120
160
</variablelist></refsect2>
121
161
<refsect2 id="ibus-server-get-address" role="function">
122
162
<title>ibus_server_get_address ()</title>
123
163
<indexterm zone="ibus-server-get-address"><primary sortas="ibus_server_get_address">ibus_server_get_address</primary></indexterm><programlisting>const <link linkend="gchar">gchar</link> * ibus_server_get_address (<link linkend="IBusServer">IBusServer</link> *server);</programlisting>
165
Returns the address of the server, as a newly-allocated string which must be freed by the caller.</para>
125
167
</para><variablelist role="params">
126
168
<varlistentry><term><parameter>server</parameter> :</term>
169
<listitem><simpara> An IBusServer.
128
170
</simpara></listitem></varlistentry>
129
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
171
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> A newly allocated string which contain address.
130
172
</simpara></listitem></varlistentry>
131
173
</variablelist></refsect2>
132
174
<refsect2 id="ibus-server-get-id" role="function">
133
175
<title>ibus_server_get_id ()</title>
134
176
<indexterm zone="ibus-server-get-id"><primary sortas="ibus_server_get_id">ibus_server_get_id</primary></indexterm><programlisting>const <link linkend="gchar">gchar</link> * ibus_server_get_id (<link linkend="IBusServer">IBusServer</link> *server);</programlisting>
178
Returns the unique ID of the server, as a newly-allocated string which must be freed by the caller.
181
This ID is normally used by clients to tell when two IBusConnection would be equivalent
182
(because the server address passed to <link linkend="ibus-connection-open"><function>ibus_connection_open()</function></link> will have the same guid in the two cases).
183
<link linkend="ibus-connection-open"><function>ibus_connection_open()</function></link> can re-use an existing connection with the same ID instead of opening a new connection.
186
This is an ID unique to each IBusServer. Remember that an IBusServer represents only one mode of connecting,
187
so e.g. a bus daemon can listen on multiple addresses which will mean it has multiple IBusServer each with
191
The ID is not a UUID in the sense of RFC4122; the details are explained in the D-Bus specification.
192
Returns the address of the server, as a newly-allocated string which must be freed by the caller.</para>
136
194
</para><variablelist role="params">
137
195
<varlistentry><term><parameter>server</parameter> :</term>
196
<listitem><simpara> An IBusServer.
139
197
</simpara></listitem></varlistentry>
140
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
198
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> A newly allocated string which contain address.
141
199
</simpara></listitem></varlistentry>
142
200
</variablelist></refsect2>
143
201
<refsect2 id="ibus-server-is-connected" role="function">
144
202
<title>ibus_server_is_connected ()</title>
145
203
<indexterm zone="ibus-server-is-connected"><primary sortas="ibus_server_is_connected">ibus_server_is_connected</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> ibus_server_is_connected (<link linkend="IBusServer">IBusServer</link> *server);</programlisting>
205
Returns TRUE if the server is still listening for new connections.</para>
147
207
</para><variablelist role="params">
148
208
<varlistentry><term><parameter>server</parameter> :</term>
209
<listitem><simpara> An IBusServer.
150
210
</simpara></listitem></varlistentry>
151
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
211
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> TRUE if the server is still listening for new connections; FALSE otherwise.
152
212
</simpara></listitem></varlistentry>
153
213
</variablelist></refsect2>
154
214
<refsect2 id="ibus-server-set-auth-mechanisms" role="function">
156
216
<indexterm zone="ibus-server-set-auth-mechanisms"><primary sortas="ibus_server_set_auth_mechanisms">ibus_server_set_auth_mechanisms</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> ibus_server_set_auth_mechanisms (<link linkend="IBusServer">IBusServer</link> *server,
157
217
const <link linkend="gchar">gchar</link> **mechanisms);</programlisting>
219
Sets the authentication mechanisms that this server offers to clients,
220
as a NULL-terminated array of mechanism names.
223
This function only affects connections created after it is called.
224
Pass NULL instead of an array to use all available mechanisms (this is the default behavior).
227
The D-Bus specification describes some of the supported mechanisms.</para>
159
229
</para><variablelist role="params">
160
230
<varlistentry><term><parameter>server</parameter> :</term>
231
<listitem><simpara> An IBusServer.
162
232
</simpara></listitem></varlistentry>
163
233
<varlistentry><term><parameter>mechanisms</parameter> :</term>
234
<listitem><simpara> NULL-terminated array of mechanisms.
165
235
</simpara></listitem></varlistentry>
166
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
236
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> TRUE if succeed; FALSE if insufficient memory.
167
237
</simpara></listitem></varlistentry>
168
238
</variablelist></refsect2>
172
242
<title role="property_details.title">Property Details</title>
173
243
<refsect2 id="IBusServer--connection-type" role="property"><title>The <literal>"connection-type"</literal> property</title>
174
244
<indexterm zone="IBusServer--connection-type"><primary sortas="IBusServer:connection-type">IBusServer:connection-type</primary></indexterm><programlisting> "connection-type" <link linkend="GType">GType</link>* : Read / Write</programlisting>
175
<para>The connection type of server object.</para></refsect2>
246
The connection type of server object.</para>
178
251
<refsect1 id="IBusServer.signal-details" role="signals">
179
252
<title role="signals.title">Signal Details</title>
180
253
<refsect2 id="IBusServer-new-connection" role="signal"><title>The <literal>"new-connection"</literal> signal</title>
181
<indexterm zone="IBusServer-new-connection"><primary sortas="IBusServer::new-connection">IBusServer::new-connection</primary></indexterm><programlisting><link linkend="void">void</link> user_function (<link linkend="IBusServer">IBusServer</link> *ibusserver,
182
<link linkend="GObject">GObject</link> *arg1,
254
<indexterm zone="IBusServer-new-connection"><primary sortas="IBusServer::new-connection">IBusServer::new-connection</primary></indexterm><programlisting><link linkend="void">void</link> user_function (<link linkend="IBusServer">IBusServer</link> *server,
255
<link linkend="GObject">GObject</link> *connection,
183
256
<link linkend="gpointer">gpointer</link> user_data) : Run Last</programlisting>
258
Emitted when a new connection is coming in.
259
In this handler, IBus could add a reference and continue processing the connection.
260
If no reference is added, the new connection will be released and closed after this signal.
263
<note><para>Argument <parameter>user_data</parameter> is ignored in this function.</para></note>
266
See also: <link linkend="IBusNewConnectionFunc"><function>IBusNewConnectionFunc()</function></link>.</para>
185
268
</para><variablelist role="params">
186
<varlistentry><term><parameter>ibusserver</parameter> :</term>
187
<listitem><simpara>the object which received the signal.
269
<varlistentry><term><parameter>server</parameter> :</term>
270
<listitem><simpara> An IBusServer.
188
271
</simpara></listitem></varlistentry>
189
<varlistentry><term><parameter>arg1</parameter> :</term>
272
<varlistentry><term><parameter>connection</parameter> :</term>
273
<listitem><simpara> The corresponding IBusConnection.
191
274
</simpara></listitem></varlistentry>
192
275
<varlistentry><term><parameter>user_data</parameter> :</term>
193
276
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>