Skip to content

Commit bdbb210

Browse files
committed
the initial commit
0 parents  commit bdbb210

File tree

104 files changed

+8511
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+8511
-0
lines changed

FireGestures.idl

+221
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,221 @@
1+
#include "nsISupports.idl"
2+
3+
interface nsIDOMElement;
4+
interface nsIDOMEvent;
5+
interface nsIDOMEventTarget;
6+
interface nsILocalFile;
7+
interface nsIVariant;
8+
interface mozIStorageConnection;
9+
10+
interface xdIGestureService;
11+
interface xdIGestureHandler;
12+
interface xdIGestureObserver;
13+
interface xdIGestureMapping;
14+
interface xdIGestureCommand;
15+
16+
17+
[scriptable, uuid(1d26f3e7-d92e-4bcc-ac79-9624bb181308)]
18+
interface xdIGestureService : nsISupports
19+
{
20+
21+
/**
22+
* A wrapper function to create instance of xdIGestureObserver.
23+
*/
24+
xdIGestureHandler createHandler();
25+
26+
/**
27+
* Registers a mapping to service for later use.
28+
* @param aID The id of the mapping to identify it. It must equal to
29+
* the database table name which preserves the user mapping.
30+
* @param aURI The URI of RDF datasource which preserves the default mapping.
31+
* @param aName The name of the mapping.
32+
*/
33+
void registerMapping(in AUTF8String aID, in string aURI, in AUTF8String aName);
34+
35+
/**
36+
* Returns a registered mapping from service.
37+
* At the first-time calling, creates instance of xdIGestureMapping and initializes it.
38+
* @throws NS_ERROR_NOT_INITIALIZED if the mapping is not registered.
39+
*/
40+
xdIGestureMapping getMapping(in AUTF8String aID);
41+
42+
/**
43+
* A special version of getMapping, which returns the mapping for browser.
44+
*/
45+
xdIGestureMapping getMappingForBrowser();
46+
47+
/**
48+
* Returns meta data of all registered mappings.
49+
*/
50+
nsIVariant getMappingsInfo();
51+
52+
/**
53+
* Backups all user mappings to a file.
54+
*/
55+
void backupMappings(in nsILocalFile aFile);
56+
57+
/**
58+
* Restores all user mappings from a file.
59+
*/
60+
void restoreMappings(in nsILocalFile aFile);
61+
62+
/**
63+
* Returns database connection.
64+
* @param aForceOpen false: Returns null if database file doesn't exist.
65+
* true : Returns connection regardless of the file existence.
66+
*/
67+
mozIStorageConnection getDBConnection(in boolean aForceOpen);
68+
69+
/**
70+
* Returns localized string from string bundle.
71+
*/
72+
wstring getLocaleString(in wstring aName);
73+
74+
};
75+
76+
77+
[scriptable, uuid(ca559550-8ab4-41c5-a72f-fd931322cc7e)]
78+
interface xdIGestureHandler : nsISupports
79+
{
80+
81+
/**
82+
* Get DOM element at the starting point of current mouse gesture.
83+
*/
84+
readonly attribute nsIDOMEventTarget sourceNode;
85+
86+
/**
87+
* This method starts to handle mouse gestures at |nsIDOMEventTarget|
88+
* and register |xdIGestureObserver| as a observer,
89+
* which responds to mouse gestures.
90+
* @param aDrawArea The element where an user can perform gestures.
91+
* @param aObserver The gesture observer which is called back from handler.
92+
*/
93+
void attach(in nsIDOMElement aDrawArea, in xdIGestureObserver aObserver);
94+
95+
/**
96+
* This method stops to handle mouse gestures.
97+
*/
98+
void detach();
99+
100+
/**
101+
* This method opens a popup at pointer and aborts the current mouse gesture.
102+
*/
103+
void openPopupAtPointer(in nsIDOMElement aPopup);
104+
105+
};
106+
107+
108+
[scriptable, uuid(c0db6b26-01d2-4060-91ff-b54af54bdd92)]
109+
interface xdIGestureObserver : nsISupports
110+
{
111+
112+
/**
113+
* Called when the direction is changed in progress of mouse gesture.
114+
*/
115+
void onDirectionChanged(in nsIDOMEvent event, in ACString aDirectionChain);
116+
117+
/**
118+
* Called when user perform mouse gesture.
119+
*/
120+
void onMouseGesture(in nsIDOMEvent event, in ACString aDirectionChain);
121+
122+
/**
123+
* Called when user perform some extra gestures.
124+
*/
125+
void onExtraGesture(in nsIDOMEvent event, in ACString aGestureType);
126+
127+
};
128+
129+
130+
[scriptable, uuid(d7018e80-d6da-4cbc-b77f-8dca4d95bbbf)]
131+
interface xdIGestureMapping : nsISupports
132+
{
133+
134+
/**
135+
* Types of commands.
136+
*/
137+
const unsigned short TYPE_CATEGORY = 0;
138+
const unsigned short TYPE_NORMAL = 1;
139+
const unsigned short TYPE_SCRIPT = 2;
140+
141+
/**
142+
* The id of mapping, which equals to the table name.
143+
*/
144+
readonly attribute AUTF8String id;
145+
146+
/**
147+
* The name of the mapping.
148+
*/
149+
readonly attribute AUTF8String name;
150+
151+
/**
152+
* Initializes mapping.
153+
*/
154+
void init(in AUTF8String aID, in string aURI, in AUTF8String aName);
155+
156+
/**
157+
* Finalizes mapping.
158+
*/
159+
void finalize();
160+
161+
/**
162+
* Returns xdIGestureCommand object for given direction.
163+
* Returns undefined if there are no definition for the given direction.
164+
*/
165+
xdIGestureCommand getCommandForDirection(in ACString aDirection);
166+
167+
/**
168+
* Opens options window to configure mapping.
169+
*/
170+
void configure();
171+
172+
/**
173+
* Returns 2D array of mapping.
174+
*/
175+
nsIVariant getMappingArray();
176+
177+
/**
178+
* Flushes user mapping to local disk.
179+
*/
180+
void saveUserMapping(in nsIVariant aItems);
181+
182+
/**
183+
* API for third-party extensions to add script-type commands.
184+
* Does not add command if there is one which has same script.
185+
* @param aItems Array of JavaScript object which has the following properties:
186+
* name : name of the command.
187+
* script : script of the command.
188+
* direction: default normal gesture to be assigned to the command (e.g. "LRUD").
189+
*/
190+
void addScriptCommands(in nsIVariant aItems);
191+
192+
};
193+
194+
195+
[scriptable, uuid(2a8d26ee-6b43-4e73-9352-7632c128b006)]
196+
interface xdIGestureCommand : nsISupports
197+
{
198+
199+
/**
200+
* Represents the type of the command.
201+
*/
202+
readonly attribute PRUint8 type;
203+
204+
/**
205+
* Represents the localized name of the command.
206+
*/
207+
readonly attribute AString name;
208+
209+
/**
210+
* Represents the value of the command.
211+
*/
212+
readonly attribute AString value;
213+
214+
/**
215+
* Represents the direction of the command.
216+
*/
217+
readonly attribute ACString direction;
218+
219+
};
220+
221+

LICENSE.txt

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/* ***** BEGIN LICENSE BLOCK *****
2+
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
3+
*
4+
* The contents of this file are subject to the Mozilla Public License Version
5+
* 1.1 (the "License"); you may not use this file except in compliance with
6+
* the License. You may obtain a copy of the License at
7+
* http://www.mozilla.org/MPL/
8+
*
9+
* Software distributed under the License is distributed on an "AS IS" basis,
10+
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11+
* for the specific language governing rights and limitations under the
12+
* License.
13+
*
14+
* The Original Code is FireGestures.
15+
*
16+
* The Initial Developer of the Original Code is Gomita <[email protected]>.
17+
* Portions created by the Initial Developer are Copyright (C) 2011
18+
* the Initial Developer. All Rights Reserved.
19+
*
20+
* Contributor(s):
21+
*
22+
* The Mouse Trails part in "xdGestureHandler.js" is derived from
23+
* Optimoz Mouse Gestures extension.
24+
*
25+
* The Original Code is Mouse Gesture for Mozilla.
26+
*
27+
* The Initial Developer of the Original Code is Jens Bannmann.
28+
* Portions created by the Initial Developer are Copyright (C) 2003
29+
* the Initial Developer. All Rights Reserved.
30+
*
31+
* Contributor(s):
32+
* Jens Bannmann <[email protected]>
33+
* Jochen <[email protected]>
34+
* Mike Kozlowski <[email protected]>
35+
*
36+
* Some parts in "xdGestureHandler.js" is derived from
37+
* All-in-One Gestures extension.
38+
*
39+
* The Original Code is the "All-in-One Gestures" extension for Phoenix.
40+
*
41+
* The Initial Developer of the Original Code is Marc Boullet <[email protected]>
42+
* Portions created by Marc Boullet are Copyright (C) 2003,
43+
* Marc Boullet. All Rights Reserved.
44+
*
45+
* Alternatively, the contents of this file may be used under the terms of
46+
* either the GNU General Public License Version 2 or later (the "GPL"), or
47+
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
48+
* in which case the provisions of the GPL or the LGPL are applicable instead
49+
* of those above. If you wish to allow use of your version of this file only
50+
* under the terms of either the GPL or the LGPL, and not to allow others to
51+
* use your version of this file under the terms of the MPL, indicate your
52+
* decision by deleting the provisions above and replace them with the notice
53+
* and other provisions required by the GPL or the LGPL. If you do not delete
54+
* the provisions above, a recipient may use your version of this file under
55+
* the terms of any one of the MPL, the GPL or the LGPL.
56+
*
57+
* ***** END LICENSE BLOCK ***** */

chrome.manifest

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
content firegestures chrome/content/firegestures/
2+
locale firegestures en-US chrome/locale/en-US/firegestures/
3+
locale firegestures ja chrome/locale/ja/firegestures/
4+
locale firegestures ru-RU chrome/locale/ru-RU/firegestures/
5+
locale firegestures fr chrome/locale/fr/firegestures/
6+
locale firegestures zh-CN chrome/locale/zh-CN/firegestures/
7+
locale firegestures pl-PL chrome/locale/pl-PL/firegestures/
8+
locale firegestures zh-TW chrome/locale/zh-TW/firegestures/
9+
locale firegestures it-IT chrome/locale/it-IT/firegestures/
10+
locale firegestures de chrome/locale/de/firegestures/
11+
locale firegestures pt-BR chrome/locale/pt-BR/firegestures/
12+
locale firegestures fi-FI chrome/locale/fi-FI/firegestures/
13+
locale firegestures ko-KR chrome/locale/ko-KR/firegestures/
14+
locale firegestures cs-CZ chrome/locale/cs-CZ/firegestures/
15+
locale firegestures nb-NO chrome/locale/nb-NO/firegestures/
16+
locale firegestures hu-HU chrome/locale/hu-HU/firegestures/
17+
locale firegestures sk-SK chrome/locale/sk-SK/firegestures/
18+
locale firegestures tr-TR chrome/locale/tr-TR/firegestures/
19+
locale firegestures sr chrome/locale/sr/firegestures/
20+
locale firegestures vi chrome/locale/vi/firegestures/
21+
locale firegestures es-AR chrome/locale/es-AR/firegestures/
22+
locale firegestures es-ES chrome/locale/es-ES/firegestures/
23+
locale firegestures ro chrome/locale/ro/firegestures/
24+
locale firegestures nl chrome/locale/nl/firegestures/
25+
locale firegestures et-EE chrome/locale/et-EE/firegestures/
26+
locale firegestures sv-SE chrome/locale/sv-SE/firegestures/
27+
locale firegestures he chrome/locale/he/firegestures/
28+
skin firegestures classic/1.0 chrome/skin/classic/firegestures/
29+
30+
overlay chrome://browser/content/browser.xul chrome://firegestures/content/browser.xul
31+
overlay chrome://global/content/viewSource.xul chrome://firegestures/content/viewSource.xul
32+
overlay chrome://global/content/viewPartialSource.xul chrome://firegestures/content/viewSource.xul
33+
34+
# [Firefox4]
35+
interfaces components/FireGestures.xpt
36+
component {1d26f3e7-d92e-4bcc-ac79-9624bb181308} components/xdGestureService.js
37+
component {ca559550-8ab4-41c5-a72f-fd931322cc7e} components/xdGestureHandler.js
38+
component {d7018e80-d6da-4cbc-b77f-8dca4d95bbbf} components/xdGestureMapping.js
39+
contract @xuldev.org/firegestures/service;1 {1d26f3e7-d92e-4bcc-ac79-9624bb181308}
40+
contract @xuldev.org/firegestures/handler;1 {ca559550-8ab4-41c5-a72f-fd931322cc7e}
41+
contract @xuldev.org/firegestures/mapping;1 {d7018e80-d6da-4cbc-b77f-8dca4d95bbbf}
42+

0 commit comments

Comments
 (0)