Codebase list gnome-shell-extension-appindicator / 9cd0266
Removed usage of E4X to be compatible with newer SpiderMonkey releases. Should fix #28. Jonas Kümmerlin 10 years ago
6 changed file(s) with 203 addition(s) and 183 deletion(s). Raw diff Collapse all Expand all
22 .PHONY= zip-file pot mo schema all
33
44 # files that go into the zip
5 ZIP= $(wildcard *.js) metadata.json $(wildcard schemas/*) $(wildcard locale/*/LC_MESSAGES/*)
5 ZIP= $(wildcard *.js) metadata.json $(wildcard schemas/*) $(wildcard locale/*/LC_MESSAGES/*) $(wildcard interfaces-xml/*)
66
77 all: pot mo schema config.js
88
3737 rm -f config.js
3838 rm -f schemas/gschemas.compiled
3939 rm -f po/messages.pot
40 rm -rf locale
40 rm -rf locale
0 <interface name="com.canonical.dbusmenu">
1 <!-- Properties -->
2 <property name="Version" type="u" access="read">
3 </property>
4 <property name="TextDirection" type="s" access="read">
5 </property>
6 <property name="Status" type="s" access="read">
7 </property>
8 <property name="IconThemePath" type="as" access="read">
9 </property>
10 <!-- Functions -->
11 <method name="GetLayout">
12 <arg type="i" name="parentId" direction="in" />
13 <arg type="i" name="recursionDepth" direction="in" />
14 <arg type="as" name="propertyNames" direction="in" />
15 <arg type="u(ia{sv}av)" name="layout" direction="out" />
16 </method>
17 <method name="GetGroupProperties">
18 <arg type="ai" name="ids" direction="in" >
19 </arg>
20 <arg type="as" name="propertyNames" direction="in" >
21 </arg>
22 <arg type="a(ia{sv})" name="properties" direction="out" >
23 </arg>
24 </method>
25 <method name="GetProperty">
26 <arg type="i" name="id" direction="in">
27 </arg>
28 <arg type="s" name="name" direction="in">
29 </arg>
30 <arg type="v" name="value" direction="out">
31 </arg>
32 </method>
33 <method name="Event">
34 <arg type="i" name="id" direction="in" >
35 </arg>
36 <arg type="s" name="eventId" direction="in" >
37 </arg>
38 <arg type="v" name="data" direction="in" >
39 </arg>
40 <arg type="u" name="timestamp" direction="in" >
41 </arg>
42 </method>
43 <method name="EventGroup">
44 <arg type="a(isvu)" name="events" direction="in">
45 </arg>
46 <arg type="ai" name="idErrors" direction="out">
47 </arg>
48 </method>
49 <method name="AboutToShow">
50 <arg type="i" name="id" direction="in">
51 </arg>
52 <arg type="b" name="needUpdate" direction="out">
53 </arg>
54 </method>
55 <method name="AboutToShowGroup">
56 <arg type="ai" name="ids" direction="in">
57 </arg>
58 <arg type="ai" name="updatesNeeded" direction="out">
59 </arg>
60 <arg type="ai" name="idErrors" direction="out">
61 </arg>
62 </method>
63 <!-- Signals -->
64 <signal name="ItemsPropertiesUpdated">
65 <arg type="a(ia{sv})" name="updatedProps" direction="out" />
66 <arg type="a(ias)" name="removedProps" direction="out" />
67 </signal>
68 <signal name="LayoutUpdated">
69 <arg type="u" name="revision" direction="out" />
70 <arg type="i" name="parent" direction="out" />
71 </signal>
72 <signal name="ItemActivationRequested">
73 <arg type="i" name="id" direction="out" >
74 </arg>
75 <arg type="u" name="timestamp" direction="out" >
76 </arg>
77 </signal>
78 <!-- End of interesting stuff -->
79 </interface>
0 <interface name="org.freedesktop.DBus.Properties">
1 <method name="Get">
2 <arg type="s" direction="in" />
3 <arg type="s" direction="in" />
4 <arg type="v" direction="out" />
5 </method>
6 <method name="GetAll">
7 <arg type="s" direction="in" />
8 <arg type="a{sv}" direction="out" />
9 </method>
10 <signal name="PropertiesChanged">
11 <arg type="s" direction="out" />
12 <arg type="a{sv}" direction="out" />
13 <arg type="as" direction="out" />
14 </signal>
15 </interface>
0 <interface name="org.kde.StatusNotifierItem">
1 <property name="Category" type="s" access="read"/>
2 <property name="Id" type="s" access="read"/>
3 <property name="Title" type="s" access="read"/>
4 <property name="Status" type="s" access="read"/>
5 <property name="WindowId" type="i" access="read"/>
6 <property name="Menu" type="o" access="read" />
7
8 <!-- main icon -->
9 <!-- names are preferred over pixmaps -->
10 <property name="IconName" type="s" access="read" />
11 <property name="IconThemePath" type="s" access="read" />
12
13 <!-- struct containing width, height and image data-->
14 <!-- implementation has been dropped as of now -->
15 <property name="IconPixmap" type="a(iiay)" access="read" />
16
17 <!-- not used in ayatana code, no test case so far -->
18 <property name="OverlayIconName" type="s" access="read"/>
19 <property name="OverlayIconPixmap" type="a(iiay)" access="read" />
20
21 <!-- Requesting attention icon -->
22 <property name="AttentionIconName" type="s" access="read"/>
23
24 <!--same definition as image-->
25 <property name="AttentionIconPixmap" type="a(iiay)" access="read" />
26
27 <!-- tooltip data -->
28 <!-- unimplemented as of now -->
29 <!--(iiay) is an image-->
30 <property name="ToolTip" type="(sa(iiay)ss)" access="read" />
31
32
33 <!-- interaction: actually, we do not use them. -->
34 <method name="Activate">
35 <arg name="x" type="i" direction="in"/>
36 <arg name="y" type="i" direction="in"/>
37 </method>
38
39 <!-- Signals: the client wants to change something in the status-->
40 <signal name="NewTitle"></signal>
41 <signal name="NewIcon"></signal>
42 <signal name="NewIconThemePath">
43 <arg type="s" name="icon_theme_path" direction="out" />
44 </signal>
45 <signal name="NewAttentionIcon"></signal>
46 <signal name="NewOverlayIcon"></signal>
47 <signal name="NewToolTip"></signal>
48 <signal name="NewStatus">
49 <arg name="status" type="s" />
50 </signal>
51
52 <!-- ayatana labels -->
53 <signal name="XAyatanaNewLabel">
54 <arg type="s" name="label" direction="out" />
55 <arg type="s" name="guide" direction="out" />
56 </signal>
57 <property name="XAyatanaLabel" type="s" access="read" />
58 <property name="XAyatanaLabelGuide" type="s" access="read" /> <!-- unimplemented -->
59
60
61 </interface>
0 <interface name="org.kde.StatusNotifierWatcher">
1 <method name="RegisterStatusNotifierItem">
2 <arg type="s" direction="in" />
3 </method>
4 <method name="RegisterNotificationHost">
5 <arg type="s" direction="in" />
6 </method>
7 <property name="RegisteredStatusNotifierItems" type="as" access="read" />
8 <method name="ProtocolVersion">
9 <arg type="s" direction="out" />
10 </method>
11 <method name="IsNotificationHostRegistered">
12 <arg type="b" direction="out" />
13 </method>
14 <signal name="ServiceRegistered">
15 <arg type="s" direction="out" />
16 </signal>
17 <signal name="ServiceUnregistered">
18 <arg type="s" direction="out" />
19 </signal>
20 <property name="IsStatusNotifierHostRegistered" type="b" access="read" />
21 </interface>
22 //
33 // Scraped from various tarballs or aquired using debugging tools
44
5 const StatusNotifierItem = <interface name="org.kde.StatusNotifierItem">
6 <property name="Category" type="s" access="read"/>
7 <property name="Id" type="s" access="read"/>
8 <property name="Title" type="s" access="read"/>
9 <property name="Status" type="s" access="read"/>
10 <property name="WindowId" type="i" access="read"/>
11 <property name="Menu" type="o" access="read" />
5 const StatusNotifierItem = loadInterfaceXml("StatusNotifierItem.xml")
6 const Properties = loadInterfaceXml("Properties.xml")
7 const DBusMenu = loadInterfaceXml("DBusMenu.xml")
8 const StatusNotifierWatcher = loadInterfaceXml("StatusNotifierWatcher.xml")
129
13 <!-- main icon -->
14 <!-- names are preferred over pixmaps -->
15 <property name="IconName" type="s" access="read" />
16 <property name="IconThemePath" type="s" access="read" />
10 // loads a xml file into an in-memory string
11 function loadInterfaceXml(filename) {
12 let extension = imports.misc.extensionUtils.getCurrentExtension()
1713
18 <!-- struct containing width, height and image data-->
19 <!-- implementation has been dropped as of now -->
20 <property name="IconPixmap" type="a(iiay)" access="read" />
14 let interfaces_dir = extension.dir.get_child("interfaces-xml")
2115
22 <!-- not used in ayatana code, no test case so far -->
23 <property name="OverlayIconName" type="s" access="read"/>
24 <property name="OverlayIconPixmap" type="a(iiay)" access="read" />
16 let file = interfaces_dir.get_child(filename)
2517
26 <!-- Requesting attention icon -->
27 <property name="AttentionIconName" type="s" access="read"/>
18 let [ result, contents ] = imports.gi.GLib.file_get_contents(file.get_path())
2819
29 <!--same definition as image-->
30 <property name="AttentionIconPixmap" type="a(iiay)" access="read" />
31
32 <!-- tooltip data -->
33 <!-- unimplemented as of now -->
34 <!--(iiay) is an image-->
35 <property name="ToolTip" type="(sa(iiay)ss)" access="read" />
36
37
38 <!-- interaction: actually, we do not use them. -->
39 <method name="Activate">
40 <arg name="x" type="i" direction="in"/>
41 <arg name="y" type="i" direction="in"/>
42 </method>
43
44 <!-- Signals: the client wants to change something in the status-->
45 <signal name="NewTitle"></signal>
46 <signal name="NewIcon"></signal>
47 <signal name="NewIconThemePath">
48 <arg type="s" name="icon_theme_path" direction="out" />
49 </signal>
50 <signal name="NewAttentionIcon"></signal>
51 <signal name="NewOverlayIcon"></signal>
52 <signal name="NewToolTip"></signal>
53 <signal name="NewStatus">
54 <arg name="status" type="s" />
55 </signal>
56
57 <!-- ayatana labels -->
58 <signal name="XAyatanaNewLabel">
59 <arg type="s" name="label" direction="out" />
60 <arg type="s" name="guide" direction="out" />
61 </signal>
62 <property name="XAyatanaLabel" type="s" access="read" />
63 <property name="XAyatanaLabelGuide" type="s" access="read" /> <!-- unimplemented -->
64
65
66 </interface>;
67
68 const Properties = <interface name="org.freedesktop.DBus.Properties">
69 <method name="Get">
70 <arg type="s" direction="in" />
71 <arg type="s" direction="in" />
72 <arg type="v" direction="out" />
73 </method>
74 <method name="GetAll">
75 <arg type="s" direction="in" />
76 <arg type="a{sv}" direction="out" />
77 </method>
78 <signal name="PropertiesChanged">
79 <arg type="s" direction="out" />
80 <arg type="a{sv}" direction="out" />
81 <arg type="as" direction="out" />
82 </signal>
83 </interface>;
84
85 //copied from libdbusmenu
86 const DBusMenu = <interface name="com.canonical.dbusmenu">
87 <!-- Properties -->
88 <property name="Version" type="u" access="read">
89 </property>
90 <property name="TextDirection" type="s" access="read">
91 </property>
92 <property name="Status" type="s" access="read">
93 </property>
94 <property name="IconThemePath" type="as" access="read">
95 </property>
96 <!-- Functions -->
97 <method name="GetLayout">
98 <arg type="i" name="parentId" direction="in" />
99 <arg type="i" name="recursionDepth" direction="in" />
100 <arg type="as" name="propertyNames" direction="in" />
101 <arg type="u(ia{sv}av)" name="layout" direction="out" />
102 </method>
103 <method name="GetGroupProperties">
104 <arg type="ai" name="ids" direction="in" >
105 </arg>
106 <arg type="as" name="propertyNames" direction="in" >
107 </arg>
108 <arg type="a(ia{sv})" name="properties" direction="out" >
109 </arg>
110 </method>
111 <method name="GetProperty">
112 <arg type="i" name="id" direction="in">
113 </arg>
114 <arg type="s" name="name" direction="in">
115 </arg>
116 <arg type="v" name="value" direction="out">
117 </arg>
118 </method>
119 <method name="Event">
120 <arg type="i" name="id" direction="in" >
121 </arg>
122 <arg type="s" name="eventId" direction="in" >
123 </arg>
124 <arg type="v" name="data" direction="in" >
125 </arg>
126 <arg type="u" name="timestamp" direction="in" >
127 </arg>
128 </method>
129 <method name="EventGroup">
130 <arg type="a(isvu)" name="events" direction="in">
131 </arg>
132 <arg type="ai" name="idErrors" direction="out">
133 </arg>
134 </method>
135 <method name="AboutToShow">
136 <arg type="i" name="id" direction="in">
137 </arg>
138 <arg type="b" name="needUpdate" direction="out">
139 </arg>
140 </method>
141 <method name="AboutToShowGroup">
142 <arg type="ai" name="ids" direction="in">
143 </arg>
144 <arg type="ai" name="updatesNeeded" direction="out">
145 </arg>
146 <arg type="ai" name="idErrors" direction="out">
147 </arg>
148 </method>
149 <!-- Signals -->
150 <signal name="ItemsPropertiesUpdated">
151 <arg type="a(ia{sv})" name="updatedProps" direction="out" />
152 <arg type="a(ias)" name="removedProps" direction="out" />
153 </signal>
154 <signal name="LayoutUpdated">
155 <arg type="u" name="revision" direction="out" />
156 <arg type="i" name="parent" direction="out" />
157 </signal>
158 <signal name="ItemActivationRequested">
159 <arg type="i" name="id" direction="out" >
160 </arg>
161 <arg type="u" name="timestamp" direction="out" >
162 </arg>
163 </signal>
164 <!-- End of interesting stuff -->
165 </interface>
166
167 const StatusNotifierWatcher = <interface name="org.kde.StatusNotifierWatcher">
168 <method name="RegisterStatusNotifierItem">
169 <arg type="s" direction="in" />
170 </method>
171 <method name="RegisterNotificationHost">
172 <arg type="s" direction="in" />
173 </method>
174 <property name="RegisteredStatusNotifierItems" type="as" access="read" />
175 <method name="ProtocolVersion">
176 <arg type="s" direction="out" />
177 </method>
178 <method name="IsNotificationHostRegistered">
179 <arg type="b" direction="out" />
180 </method>
181 <signal name="ServiceRegistered">
182 <arg type="s" direction="out" />
183 </signal>
184 <signal name="ServiceUnregistered">
185 <arg type="s" direction="out" />
186 </signal>
187 <property name="IsStatusNotifierHostRegistered" type="b" access="read" />
188 </interface>;
189
190
20 if (result) {
21 //HACK: The "" + trick is important as hell because file_get_contents returns
22 // an object (WTF?) but Gio.makeProxyWrapper requires `typeof() == "string"`
23 // Otherwise, it will try to check `instanceof XML` and fail miserably because there
24 // is no `XML` on very recent SpiderMonkey releases (or, if SpiderMonkey is old enough,
25 // will spit out a TypeError soon).
26 return "<node>" + contents + "</node>"
27 } else {
28 throw new Error("AppIndicatorSupport: Could not load file: "+filename)
29 }
30 }