summaryrefslogtreecommitdiff
path: root/docs/reference/pygobject-functions.xml
blob: 7ca391803117d49232031c35578a0450d97463f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
<?xml version="1.0" standalone="no"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
    "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">

<refentry id="gobject-functions">
  <refnamediv>
    <refname>gobject Functions</refname>
    <refpurpose>miscellaneous functions</refpurpose>
  </refnamediv>

  <refsect1>
    <title>Synopsis</title>

    <programlisting>
<methodsynopsis language="python">
	<methodname><link
linkend="function-gobject--type-name">gobject.type_name</link></methodname>
	<methodparam><parameter>type</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gobject--type-from-name">gobject.type_from_name</link></methodname>
	<methodparam><parameter>type_name</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gobject--type-parent">gobject.type_parent</link></methodname>
	<methodparam><parameter>type</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gobject--type-is-a">gobject.type_is_a</link></methodname>
	<methodparam><parameter>type</parameter></methodparam>
	<methodparam><parameter>parent_type</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gobject--type-children">gobject.type_children</link></methodname>
	<methodparam><parameter>type</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gobject--type-interfaces">gobject.type_interfaces</link></methodname>
	<methodparam><parameter>type</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gobject--type-register">gobject.type_register</link></methodname>
	<methodparam><parameter>class</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gobject--signal-new">gobject.signal_new</link></methodname>
	<methodparam><parameter>signal_name</parameter></methodparam>
	<methodparam><parameter>type</parameter></methodparam>
	<methodparam><parameter>flags</parameter></methodparam>
	<methodparam><parameter>return_type</parameter></methodparam>
	<methodparam><parameter>param_types</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gobject--signal-list-names">gobject.signal_list_names</link></methodname>
	<methodparam><parameter role="keyword">type</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gobject--signal-list-ids">gobject.signal_list_ids</link></methodname>
	<methodparam><parameter role="keyword">type</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gobject--signal-lookup">gobject.signal_lookup</link></methodname>
	<methodparam><parameter role="keyword">name</parameter></methodparam>
	<methodparam><parameter role="keyword">type</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gobject--signal-name">gobject.signal_name</link></methodname>
	<methodparam><parameter role="keyword">signal_id</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gobject--signal-query1">gobject.signal_query</link></methodname>
	<methodparam><parameter role="keyword">name</parameter></methodparam>
	<methodparam><parameter role="keyword">type</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gobject--signal-query2">gobject.signal_query</link></methodname>
	<methodparam><parameter role="keyword">signal_id</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gobject--list-properties">gobject.list_properties</link></methodname>
	<methodparam><parameter>type</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gobject--new">gobject.new</link></methodname>
	<methodparam><parameter>type</parameter></methodparam>
	<methodparam><parameter>...</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gobject--signal-accumulator-true-handled">gobject.signal_accumulator_true_handled</link></methodname>
      </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gobject--add-emission-hook">gobject.add_emission_hook</link></methodname>
 	<methodparam><parameter>type</parameter></methodparam>
 	<methodparam><parameter>name</parameter></methodparam>
 	<methodparam><parameter>callback</parameter></methodparam>
 	<methodparam><parameter>...</parameter></methodparam>
      </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gobject--remove-emission-hook">gobject.remove_emission_hook</link></methodname>
 	<methodparam><parameter>type</parameter></methodparam>
 	<methodparam><parameter>name</parameter></methodparam>
 	<methodparam><parameter>hook_id</parameter></methodparam>
      </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gobject---install-metaclass">gobject._install_metaclass</link></methodname>
 	<methodparam><parameter>metaclass</parameter></methodparam>
      </methodsynopsis>
    </programlisting>

  </refsect1>

  <refsect1>
    <title>Description</title>

    <para>These functions are part of the <literal>PyGTK</literal> gobject
module but are not directly associated with a specific class.</para>

    <note>
      <para>
        Many functions that previously were in this namespace got moved to <link
        linkend="glib-functions"><literal>glib</literal></link> namespace instead.  They
        are still available in <literal>gobject</literal> for backward compatibility, but
        not documented here.  If you miss documentation for some function, be sure to
        check <link linkend="glib-functions"><literal>glib</literal></link> first.
      </para>
    </note>

  </refsect1>

  <refsect1>
    <title>Functions</title>

    <refsect2 id="function-gobject--type-name">
      <title>gobject.type_name</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gobject.type_name</methodname>
	  <methodparam><parameter>type</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter>type</parameter>&nbsp;:</term>
	  <listitem><simpara>a GObject type, type ID or
instance</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara></simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <function>gobject.type_name</function>() function returns
the unique name that is assigned to the specified
<parameter>type</parameter>. <parameter>type</parameter> can be a GObject
type, type ID or instance. This function raises a TypeError exception
if <parameter>type</parameter> isn't a <literal>PyGTK</literal> type.</para>

    </refsect2>

    <refsect2 id="function-gobject--type-from-name">
      <title>gobject.type_from_name</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gobject.type_from_name</methodname>
	  <methodparam><parameter>type_name</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter>type_name</parameter>&nbsp;:</term>
	  <listitem><simpara>a string containing the name of a
type</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the type ID named
<parameter>type_name</parameter></simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <function>gobject.type_from_name</function>() function
returns the type ID of the <literal>PyGTK</literal> type with the name
specified by <parameter>type_name</parameter>. This function raises a
RuntimeError exception if no type matches
<parameter>type_name</parameter>.</para>

    </refsect2>

    <refsect2 id="function-gobject--type-parent">
      <title>gobject.type_parent</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gobject.type_parent</methodname>
	  <methodparam><parameter>type</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter>type</parameter>&nbsp;:</term>
	  <listitem><simpara>a GObject type, type ID or
instance</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the parent type ID</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <function>gobject.type_parent</function>() function returns
the direct parent type ID of the specified <parameter>type</parameter>.
<parameter>type</parameter> can be a GObject type, type ID or instance. If
<parameter>type</parameter> has no parent, i.e. is a fundamental type, the
RuntimeError exception is raised. </para>

    </refsect2>

    <refsect2 id="function-gobject--type-is-a">
      <title>gobject.type_is_a</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gobject.type_is_a</methodname>
	  <methodparam><parameter>type</parameter></methodparam>
	  <methodparam><parameter>parent_type</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter>type</parameter>&nbsp;:</term>
	  <listitem><simpara>a GObject type, type ID or
instance</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter>parent_type</parameter>&nbsp;:</term>
	  <listitem><simpara>a GObject type, type ID or
instance</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>TRUE</literal> if
<parameter>parent_type</parameter> is an ancestor of
<parameter>type</parameter></simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <function>gobject.type_is_a</function>() function returns
<literal>TRUE</literal> if the specified <parameter>type</parameter> is a
descendant of the type specified by <parameter>parent_type</parameter>. This
function also returns <literal>TRUE</literal> if
<parameter>parent_type</parameter> is an interface and
<parameter>type</parameter> conforms to it.</para>

    </refsect2>

    <refsect2 id="function-gobject--type-children">
      <title>gobject.type_children</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gobject.type_children</methodname>
	  <methodparam><parameter>type</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter>type</parameter>&nbsp;:</term>
	  <listitem><simpara>a GObject type, type ID or
instance</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a list of the child types of
<parameter>type</parameter></simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <function>gobject.type_children</function>() function
returns a list containing the child types of the specified
<parameter>type</parameter>.</para>

    </refsect2>

    <refsect2 id="function-gobject--type-interfaces">
      <title>gobject.type_interfaces</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gobject.type_interfaces</methodname>
	  <methodparam><parameter>type</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter>type</parameter>&nbsp;:</term>
	  <listitem><simpara>a GObject type, type ID or
instance</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a list of the interface types supported by
<parameter>type</parameter></simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <function>gobject.type_interfaces</function>() function
returns a list of the interface types supported by
<parameter>type</parameter>. <parameter>type</parameter> can be a GObject
type, type ID or instance. This function returns a RuntimeError exception if
type is not a valid type or has no interfaces.</para>

    </refsect2>

    <refsect2 id="function-gobject--type-register">
      <title>gobject.type_register</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gobject.type_register</methodname>
	  <methodparam><parameter>class</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter>class</parameter>&nbsp;:</term>
	  <listitem><simpara>a Python class that is a descendant of <link
linkend="class-gobject"><classname>gobject.GObject</classname></link></simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <function>gobject.type_register</function>() function
registers the specified Python <parameter>class</parameter> as a PyGTK type.
class must be a descendant of <link
linkend="class-gobject"><classname>gobject.GObject</classname></link>. The function generates a name for the new type.</para>

    </refsect2>

    <refsect2 id="function-gobject--signal-new">
      <title>gobject.signal_new</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gobject.signal_new</methodname>
	  <methodparam><parameter>signal_name</parameter></methodparam>
	  <methodparam><parameter>type</parameter></methodparam>
	  <methodparam><parameter>flags</parameter></methodparam>
	  <methodparam><parameter>return_type</parameter></methodparam>
	  <methodparam><parameter>param_types</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter>signal_name</parameter>&nbsp;:</term>
	  <listitem><simpara>a string containing the name of the
signal</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter>type</parameter>&nbsp;:</term>
	  <listitem><simpara>the object type that the signal is associated
with</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter>flags</parameter>&nbsp;:</term>
	  <listitem><simpara>the signal flags</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter>return_type</parameter>&nbsp;:</term>
	  <listitem><simpara>the return type of the signal
handler</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter>param_types</parameter>&nbsp;:</term>
	  <listitem><simpara>the parameter types passed to the signal
handler</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a unique integer signal ID</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <function>gobject.signal_new</function>() function registers
a signal with the specified <parameter>signal_name</parameter> for the
specified object <parameter>type</parameter>. The value of
<parameter>flags</parameter> is a combination of:</para>

      <variablelist>
	<varlistentry>
	  <term><literal>gobject.SIGNAL_RUN_FIRST</literal></term>
	  <listitem>
	    <simpara>Invoke the object method handler in the first emission
stage. </simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>gobject.SIGNAL_RUN_LAST</literal></term>
	  <listitem>
	    <simpara>Invoke the object method handler in the third emission
stage.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>gobject.SIGNAL_RUN_CLEANUP</literal></term>
	  <listitem>
	    <simpara>Invoke the object method handler in the last emission
stage.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>gobject.SIGNAL_NO_RECURSE</literal></term>
	  <listitem>
	    <simpara>Signals being emitted for an object while currently
being in emission for this very object will not be emitted recursively, but
instead cause the first emission to be restarted.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>gobject.SIGNAL_DETAILED</literal></term>
	  <listitem>
	    <simpara>This signal supports "::detail" appendixes to the
signal name upon handler connections and emissions.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>gobject.SIGNAL_ACTION</literal></term>
	  <listitem>
	    <simpara>Action signals are signals that may freely be emitted
on alive objects from user code via <link
linkend="method-gobject--emit"><methodname>gobject.emit()</methodname>()</link> 
and friends, without the need of being embedded into extra code that
performs pre or post emission adjustments on the object. They can also be
thought of as generically callable object methods.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>gobject.SIGNAL_NO_HOOKS</literal></term>
	  <listitem>
	    <simpara> No emissions hooks are supported for this
signal.</simpara>
	  </listitem>
	</varlistentry>
      </variablelist>

      <para><parameter>return_type</parameter> is the type of the return
value from a signal handler and may be a gobject type, type ID or instance.
The <parameter>param_types</parameter> parameter is a list of additional
types that are passed to the signal handler. Each parameter type may be
specified as a gobject type, type ID or instance. For example, to add a
signal to the gtk.Window type called "my-signal" that calls a handler with a
gtk.Button widget and an integer value and a return value  that is a
boolean, use:</para>

      <programlisting>
  gobject.signal_new("my_signal", gtk.Window, gobject.SIGNAL_RUN_LAST, gobject.TYPE_BOOLEAN, (gtk.Button, gobject.TYPE_INT))
</programlisting>

    </refsect2>

    <refsect2 id="function-gobject--signal-list-names">
      <title>gobject.signal_list_names</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gobject.signal_list_names</methodname>
	  <methodparam><parameter role="keyword">type</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">type</parameter>&nbsp;:</term>
	  <listitem><simpara>a GObject type, type ID or
instance</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a list of the signal names supported by
<parameter>type</parameter></simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <function>gobject.signal_list_names</function>() function
returns a list of the names of the signals that are supported by the
specified GObject <parameter>type</parameter></para>

      <note>
        <para>The type keyword is available in PyGTK 2.6 and above.</para>
      </note>

    </refsect2>

    <refsect2 id="function-gobject--signal-list-ids">
      <title>gobject.signal_list_ids</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gobject.signal_list_ids</methodname>
	  <methodparam><parameter role="keyword">type</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">type</parameter>&nbsp;:</term>
	  <listitem><simpara>a GObject type, type ID or
instance</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a list of the signal ids supported by
<parameter>type</parameter></simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
        <para>This method is available in PyGTK 2.6 and above.</para>
      </note>

      <para>The <function>gobject.signal_list_ids</function>() function
returns a list of the integer ids of the signals that are supported by the
GObject specified by <parameter>type</parameter></para>

    </refsect2>

    <refsect2 id="function-gobject--signal-lookup">
      <title>gobject.signal_lookup</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gobject.signal_lookup</methodname>
	  <methodparam><parameter role="keyword">name</parameter></methodparam>
	  <methodparam><parameter role="keyword">type</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">name</parameter>&nbsp;:</term>
	  <listitem><simpara>the name of a signal for
<parameter>type</parameter></simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">type</parameter>&nbsp;:</term>
	  <listitem><simpara>a GObject type, type ID or
instance</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the integer id of a signal supported by
<parameter>type</parameter></simpara> or 0.</listitem>
	</varlistentry>
      </variablelist>

      <note>
        <para>This method is available in PyGTK 2.6 and above.</para>
      </note>

      <para>The <function>gobject.signal_lookup</function>() function
returns the id of the signal with the name specified by
<parameter>name</parameter> that is supported by the GObject specified
specified by<parameter>type</parameter>. 0 is returned if the signal is not
found.</para>

    </refsect2>

    <refsect2 id="function-gobject--signal-name">
      <title>gobject.signal_name</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gobject.signal_name</methodname>
	  <methodparam><parameter role="keyword">signal_id</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">signal_id</parameter>&nbsp;:</term>
	  <listitem><simpara>an integer signal id</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the name of the signal or
<literal>None</literal>.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
        <para>This method is available in PyGTK 2.6 and above.</para>
      </note>

      <para>The <function>gobject.signal_name</function>() function returns
the name of the signal that has the signal id specified by
<parameter>id</parameter>.</para>

    </refsect2>

    <refsect2 id="function-gobject--signal-query1">
      <title>gobject.signal_query</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gobject.signal_query</methodname>
          <methodparam><parameter role="keyword">name</parameter></methodparam>
	  <methodparam><parameter role="keyword">type</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">name</parameter>&nbsp;:</term>
	  <listitem><simpara>the name of a signal for
<parameter>type</parameter></simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">type</parameter>&nbsp;:</term>
	  <listitem><simpara>a GObject type, type ID or
instance</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a 6-tuple containing signal information or
<literal>None</literal></simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
        <para>This method is available in PyGTK 2.6 and above.</para>
      </note>

      <para>The <function>gobject.signal_query</function>() function returns
a 6-tuple containing information about the signal with the name specified by
<parameter>name</parameter> that is supported by the GObject specified by
<parameter>type</parameter>. If the signal is not found
<literal>None</literal> is returned.</para>

      <para>The signal information 6-tuple contains:</para>

      <itemizedlist>
        <listitem>
          <simpara>the integer signal id</simpara>
        </listitem>
        <listitem>
          <simpara>the signal name</simpara>
        </listitem>
        <listitem>
          <simpara>the GType that the signal is registered for</simpara>
        </listitem>
        <listitem>
          <simpara>the signal flags (see the <xref
linkend="gobject-signal-constants"
endterm="gobject-signal-constants-title"></xref>)</simpara>
        </listitem>
        <listitem>
          <simpara>the GType of the return from the signal callback
function</simpara>
        </listitem>
        <listitem>
          <simpara>a tuple containing the GTypes of the parameters that are
passed to the signal callback function. Note that these may not correspond
exactly to the <literal>PyGTK</literal> signal callback parameters.</simpara>
        </listitem>
      </itemizedlist>

    </refsect2>

    <refsect2 id="function-gobject--signal-query2">
      <title>gobject.signal_query</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gobject.signal_query</methodname>
          <methodparam><parameter role="keyword">signal_id</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">signal_id</parameter>&nbsp;:</term>
	  <listitem><simpara>the integer id of a signal</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a 6-tuple containing signal information or
<literal>None</literal></simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
        <para>This method is available in PyGTK 2.6 and above.</para>
      </note>

      <para>The <function>gobject.signal_query</function>() function returns
a 6-tuple containing information about the signal with the id specified by
<parameter>signal_id</parameter>. If the signal is not found
<literal>None</literal> is returned.</para>

      <para>The signal information 6-tuple contains:</para>

      <itemizedlist>
        <listitem>
          <simpara>the integer signal id</simpara>
        </listitem>
        <listitem>
          <simpara>the signal name</simpara>
        </listitem>
        <listitem>
          <simpara>the GType that the signal is registered for</simpara>
        </listitem>
        <listitem>
          <simpara>the signal flags (see the <xref
linkend="gobject-signal-constants"
endterm="gobject-signal-constants-title"></xref>)</simpara>
        </listitem>
        <listitem>
          <simpara>the GType of the return from the signal callback
function</simpara>
        </listitem>
        <listitem>
          <simpara>a tuple containing the GTypes of the parameters that are
passed to the signal callback function. Note that these may not correspond
exactly to the <literal>PyGTK</literal> signal callback parameters.</simpara>
        </listitem>
      </itemizedlist>

    </refsect2>

   <refsect2 id="function-gobject--list-properties">
      <title>gobject.list_properties</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gobject.list_properties</methodname>
	  <methodparam><parameter>type</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter>type</parameter>&nbsp;:</term>
	  <listitem><simpara>a GObject type, type ID or
instance</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a list of the properties (as GParam objects)
supported by <parameter>type</parameter></simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <function>gobject.list_properties</function>() function
returns a list of the properties (as GParam objects) supported by
<parameter>type</parameter>.</para>

    </refsect2>

    <refsect2 id="function-gobject--new">
      <title>gobject.new</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gobject.new</methodname>
	  <methodparam><parameter>type</parameter></methodparam>
	  <methodparam><parameter>...</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter>type</parameter>&nbsp;:</term>
	  <listitem><simpara>a GObject type, type ID or
instance</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter>...</parameter>&nbsp;:</term>
	  <listitem><simpara>zero or more property-value
pairs</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a new object if the specified
<parameter>type</parameter></simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <function>gobject.new</function>() function returns a new
object of the specified <parameter>type</parameter>. type must specify a
type that is a descendant of <link
linkend="class-gobject"><classname>gobject.GObject</classname></link>. A
TypeError exception is raised if <parameter>type</parameter> specifies an
abstract class or a type that is not a descendant of <link
linkend="class-gobject"><classname>gobject.GObject</classname></link>. A set
of property-value pairs may be specified to set the value of the object's
properties.</para>

    </refsect2>

    <refsect2 id="function-gobject--signal-accumulator-true-handled">
      <title>gobject.signal_accumulator_true_handled</title>
      
      <programlisting><methodsynopsis language="python">
        <methodname>gobject.signal_accumulator_true_handled</methodname>
	</methodsynopsis></programlisting>

      <note>
        <para>This function is available in PyGTK 2.8 and above.</para>
      </note>

      <para>The <function>signal_accumulator_true_handled</function>()
      function is only used as accumulator argument when registering
      signals.</para>

    </refsect2>

    <refsect2 id="function-gobject--add-emission-hook">
      <title>gobject.add_emission_hook</title>
      
      <programlisting><methodsynopsis language="python">
        <methodname>gobject.add_emission_hook</methodname>
 	<methodparam><parameter>type</parameter></methodparam>
 	<methodparam><parameter>name</parameter></methodparam>
 	<methodparam><parameter>callback</parameter></methodparam>
 	<methodparam><parameter>...</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist role="params">
        <varlistentry>
          <term><emphasis>type</emphasis>&nbsp;:</term>
          <listitem><simpara>a Python GObject instance or
          type</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><emphasis>name</emphasis>&nbsp;:</term>
          <listitem><simpara>a signal name</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><emphasis>callback</emphasis>&nbsp;:</term>
          <listitem><simpara>a function</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><emphasis>...</emphasis>&nbsp;:</term>
          <listitem><simpara>zero or more extra arguments that will be
          passed to callback.</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><emphasis>Returns</emphasis>&nbsp;:</term>
          <listitem><simpara>the hook id, for later use with <link
          linkend="function-gobject--signal-remove-emission-hook"><function>gobject.signal_remove_emission_hook</function>()</link>.</simpara></listitem>
        </varlistentry>
      </variablelist>
      <note>
        <para>This function is available in PyGTK 2.8 and above.</para>
      </note>

      <para>The <function>add_emission_hook</function>() function adds an
      emission hook for the signal specified by <parameter>name</parameter>,
      which will get called for any emission of that signal, independent of
      the instance. This is possible only for signals which don't have the
      <literal>gobject.SIGNAL_NO_HOOKS</literal> flag set.</para>

    </refsect2>

    <refsect2 id="function-gobject--remove-emission-hook">
      <title>gobject.remove_emission_hook</title>
      
      <programlisting><methodsynopsis language="python">
        <methodname>gobject.remove_emission_hook</methodname>
 	<methodparam><parameter>type</parameter></methodparam>
 	<methodparam><parameter>name</parameter></methodparam>
 	<methodparam><parameter>hook_id</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist role="params">
        <varlistentry>
          <term><emphasis>type</emphasis>&nbsp;:</term>
          <listitem><simpara>a Python GObject instance or
          type</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><emphasis>name</emphasis>&nbsp;:</term>
          <listitem><simpara>a signal name</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><emphasis>hook_id</emphasis>&nbsp;:</term>
          <listitem><simpara>the id of the emission hook as returned by the
          <link
          linkend="function-gobject--add-emission-hook"><function>gobject.add_emission_hook</function>()</link>)
          function.</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><emphasis>Returns</emphasis>&nbsp;:</term>
          <listitem><simpara></simpara></listitem>
        </varlistentry>
      </variablelist>
      <note>
        <para>This function is available in PyGTK 2.8 and above.</para>
      </note>

      <para>The <function>remove_emission_hook</function>() function deletes
      an emission hook.</para>

    </refsect2>

    <refsect2 id="function-gobject---install-metaclass">
      <title>gobject._install_metaclass</title>
      
      <programlisting><methodsynopsis language="python">
        <methodname>gobject._install_metaclass</methodname>
 	<methodparam><parameter>metaclass</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist role="params">
        <varlistentry>
          <term><emphasis>metaclass</emphasis>&nbsp;:</term>
          <listitem><simpara></simpara></listitem>
        </varlistentry>
      </variablelist>
      <note>
        <para>This function is available in PyGTK 2.10 and above.</para>
      </note>

      <para>The <function>_install_metaclass</function>() function installs
      the metaclass specified by <parameter>metaclass</parameter>.</para>

    </refsect2>

  </refsect1>

</refentry>