66b0994f9dad0ac36354ada0b3735973ddd3ba7b
[gnome.introspection-doc-generator] / JSDOC / Introspect / Signal.js
1 //<script type="text/javascript">
2 //Gtk = imports.gi.Gtk;
3 GI      = imports.gi.GIRepository;
4
5
6
7 imports['Object.js'].load(Object);
8
9 console = imports['console.js'].console;
10
11
12
13 Introspect = imports['JSDOC/Introspect.js'].Introspect;
14 Basic = imports['JSDOC/Introspect/Basic.js'].Basic;
15
16
17
18 Signal = Object.define(
19     function(sig, memberOf, saveto, keylist) {
20
21         this.propertyType  = 'Signal';
22         
23         var params = this.argsToArrays(sig);
24         // add a reference to self...
25         params.unshift({
26             name : 'self',
27             type : memberOf.alias,
28             direction : 'in',
29             be_null :  false
30                 
31         });
32         var n_original  = GI.base_info_get_name(sig);
33         
34         Object.extend(this,{
35             name : n_original.replace(/-/g,'_'),
36             params : params,
37             memberOf : memberOf.alias,
38             exceptions : [],
39             returns :   [ { type :  this.typeToName(GI.callable_info_get_return_type(sig)) } ],
40             desc : Introspect.doc(memberOf.alias + '.' + n_original)
41         });
42         memberOf[saveto].push(this);
43         keylist.push(this.name);
44         
45         var addedto = [ memberOf.alias ]; // do not add to self...
46        
47         for(var i =1; i < params.length;i++) {
48             var ty = params[i].type;
49             if (typeof(ty) != 'string' || ty.indexOf('.') < 0) {
50                 continue;
51             }
52             if (addedto.indexOf(ty) > -1) {
53                 continue;
54             }
55             
56             
57             
58             Introspect.references[ty] = Introspect.references[ty] || [];
59             Introspect.references[ty].push(this);
60             addedto.push(ty);
61         }
62         
63         
64         
65         
66         
67     },
68     Basic
69 );
70
71
72