Skip to content

Commit 773d8f5

Browse files
committed
lots of early stages code removal in UI for TiContext,
beginning of moving lightweight windows and some activity logic to pure JS. surround add/remove event listener for EventEmitter in thread checking logic
1 parent 577c6f9 commit 773d8f5

File tree

96 files changed

+597
-968
lines changed

Some content is hidden

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

96 files changed

+597
-968
lines changed

android/modules/api/.factorypath

-5
This file was deleted.

android/modules/api/.settings/org.eclipse.jdt.apt.core.prefs

-8
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
#Sun Jul 31 13:29:22 CDT 2011
1+
#Fri Sep 23 12:49:45 PDT 2011
22
eclipse.preferences.version=1
3-
org.eclipse.jdt.core.compiler.processAnnotations=enabled
3+
org.eclipse.jdt.core.compiler.processAnnotations=disabled

android/modules/app/.classpath

+1
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
1111
<classpathentry combineaccessrules="false" kind="src" path="/titanium"/>
1212
<classpathentry kind="lib" path="/titanium-dist/lib/kroll-apt.jar"/>
13+
<classpathentry combineaccessrules="false" kind="src" path="/kroll-v8"/>
1314
<classpathentry kind="output" path="bin"/>
1415
</classpath>

android/modules/app/.factorypath

-5
This file was deleted.

android/modules/app/.settings/org.eclipse.jdt.apt.core.prefs

-8
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
#Thu Sep 02 15:19:11 CDT 2010
1+
#Fri Sep 23 12:49:32 PDT 2011
22
eclipse.preferences.version=1
3-
org.eclipse.jdt.core.compiler.processAnnotations=enabled
3+
org.eclipse.jdt.core.compiler.processAnnotations=disabled

android/modules/app/src/ti/modules/titanium/app/AndroidModule.java

+5-11
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,18 @@
11
package ti.modules.titanium.app;
22

3-
import org.appcelerator.kroll.KrollInvocation;
43
import org.appcelerator.kroll.KrollModule;
54
import org.appcelerator.kroll.annotations.Kroll;
6-
import org.appcelerator.titanium.TiContext;
75
import org.appcelerator.titanium.proxy.RProxy;
86

97
@Kroll.module(parentModule=AppModule.class)
10-
public class AndroidModule extends KrollModule {
11-
8+
public class AndroidModule extends KrollModule
9+
{
1210
protected RProxy r;
13-
14-
public AndroidModule(TiContext context) {
15-
super(context);
16-
}
17-
11+
1812
@Kroll.getProperty(name="R")
19-
public RProxy getR(KrollInvocation invocation) {
13+
public RProxy getR() {
2014
if (r == null) {
21-
r = new RProxy(invocation.getTiContext(), RProxy.RESOURCE_TYPE_APPLICATION);
15+
r = new RProxy(RProxy.RESOURCE_TYPE_APPLICATION);
2216
}
2317
return r;
2418
}

android/modules/app/src/ti/modules/titanium/app/AppModule.java

+6-7
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,21 @@
33
import org.appcelerator.kroll.KrollModule;
44
import org.appcelerator.kroll.annotations.Kroll;
55
import org.appcelerator.titanium.ITiAppInfo;
6-
import org.appcelerator.titanium.TiContext;
6+
import org.appcelerator.titanium.TiApplication;
77

88
@Kroll.module
99
public class AppModule extends KrollModule
1010
{
1111
private ITiAppInfo appInfo;
1212

13-
public AppModule(TiContext tiContext) {
14-
super(tiContext);
15-
16-
getTiContext().getTiApp().addAppEventProxy(this);
17-
appInfo = getTiContext().getTiApp().getAppInfo();
13+
public AppModule()
14+
{
15+
TiApplication.getInstance().addAppEventProxy(this);
16+
appInfo = TiApplication.getInstance().getAppInfo();
1817
}
1918

2019
public void onDestroy() {
21-
getTiContext().getTiApp().removeAppEventProxy(this);
20+
TiApplication.getInstance().removeAppEventProxy(this);
2221
}
2322

2423
@Kroll.getProperty(name="id") @Kroll.method

android/modules/app/src/ti/modules/titanium/app/properties/PropertiesModule.java

+12-13
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@
66
*/
77
package ti.modules.titanium.app.properties;
88

9-
import org.appcelerator.kroll.KrollDefaultValueProvider;
109
import org.appcelerator.kroll.KrollDict;
1110
import org.appcelerator.kroll.KrollInvocation;
1211
import org.appcelerator.kroll.KrollModule;
1312
import org.appcelerator.kroll.annotations.Kroll;
14-
import org.appcelerator.titanium.TiContext;
13+
import org.appcelerator.titanium.TiApplication;
1514
import org.appcelerator.titanium.TiProperties;
1615
import org.appcelerator.titanium.util.Log;
1716
import org.appcelerator.titanium.util.TiConvert;
@@ -26,12 +25,12 @@ public class PropertiesModule extends KrollModule {
2625
private static final String LCAT = "PropertiesModule";
2726
private TiProperties appProperties;
2827

29-
public PropertiesModule(TiContext tiContext) {
30-
super(tiContext);
31-
32-
appProperties = tiContext.getTiApp().getAppProperties();
28+
public PropertiesModule()
29+
{
30+
appProperties = TiApplication.getInstance().getAppProperties();
3331
}
3432

33+
/* TODO
3534
public static class DefaultValues implements KrollDefaultValueProvider {
3635
protected static DefaultValues _instance = new DefaultValues();
3736
@Override
@@ -41,11 +40,11 @@ public Object getDefaultValue(Class<?> clazz) {
4140
public static DefaultValues getInstance() {
4241
return _instance;
4342
}
44-
}
45-
43+
}*/
44+
4645
@Kroll.method
4746
public Object getBool(String key,
48-
@Kroll.argument(optional=true, defaultValueProvider=DefaultValues.class) Boolean defaultValue) {
47+
@Kroll.argument(optional=true/* TODO, defaultValueProvider=DefaultValues.class*/) Boolean defaultValue) {
4948

5049
if (!appProperties.hasProperty(key)) {
5150
// pre-empt so we can correctly return null for primitive types
@@ -58,7 +57,7 @@ public Object getBool(String key,
5857

5958
@Kroll.method
6059
public Object getDouble(String key,
61-
@Kroll.argument(optional=true, defaultValueProvider=DefaultValues.class) Double defaultValue) {
60+
@Kroll.argument(optional=true/* TODO, , defaultValueProvider=DefaultValues.class*/) Double defaultValue) {
6261
if (!appProperties.hasProperty(key)) {
6362
// pre-empt so we can correctly return null for primitive types
6463
return defaultValue;
@@ -70,7 +69,7 @@ public Object getDouble(String key,
7069

7170
@Kroll.method
7271
public Object getInt(String key,
73-
@Kroll.argument(optional=true, defaultValueProvider=DefaultValues.class) Integer defaultValue) {
72+
@Kroll.argument(optional=true/* TODO, , defaultValueProvider=DefaultValues.class*/) Integer defaultValue) {
7473
if (!appProperties.hasProperty(key)) {
7574
// pre-empt so we can correctly return null for primitive types
7675
return defaultValue;
@@ -82,13 +81,13 @@ public Object getInt(String key,
8281

8382
@Kroll.method
8483
public Object getString(String key,
85-
@Kroll.argument(optional=true, defaultValueProvider=DefaultValues.class) String defaultValue) {
84+
@Kroll.argument(optional=true/* TODO, , defaultValueProvider=DefaultValues.class*/) String defaultValue) {
8685
return appProperties.getString(key, defaultValue);
8786
}
8887

8988
@Kroll.method
9089
public Object getList(KrollInvocation invocation, String key,
91-
@Kroll.argument(optional=true, defaultValueProvider=DefaultValues.class) Object[] defaultValue) {
90+
@Kroll.argument(optional=true/* TODO, , defaultValueProvider=DefaultValues.class*/) Object[] defaultValue) {
9291

9392
String[] values = new String[0];
9493
if (appProperties.hasListProperty(key)) {

android/modules/filesystem/.factorypath

-5
This file was deleted.

android/modules/filesystem/.settings/org.eclipse.jdt.apt.core.prefs

-8
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
#Sun Jul 31 13:29:22 CDT 2011
1+
#Fri Sep 23 12:49:20 PDT 2011
22
eclipse.preferences.version=1
3-
org.eclipse.jdt.core.compiler.processAnnotations=enabled
3+
org.eclipse.jdt.core.compiler.processAnnotations=disabled

android/modules/filesystem/src/ti/modules/titanium/filesystem/FileProxy.java

+4-19
Original file line numberDiff line numberDiff line change
@@ -6,36 +6,21 @@
66
*/
77
package ti.modules.titanium.filesystem;
88

9-
import java.io.IOException;
10-
import java.util.ArrayList;
11-
import java.util.Collection;
12-
import java.util.Iterator;
13-
import java.util.List;
14-
159
import org.appcelerator.kroll.annotations.Kroll;
16-
import org.appcelerator.titanium.TiBlob;
17-
import org.appcelerator.titanium.TiContext;
1810
import org.appcelerator.titanium.TiFileProxy;
19-
import org.appcelerator.titanium.io.TiBaseFile;
20-
import org.appcelerator.titanium.io.TiFileFactory;
21-
import org.appcelerator.titanium.util.Log;
22-
import org.appcelerator.titanium.util.TiConvert;
23-
import org.appcelerator.titanium.util.TiFileHelper2;
24-
25-
import android.net.Uri;
2611

2712
@Kroll.proxy
2813
public class FileProxy extends TiFileProxy
2914
{
3015
private static final String LCAT = "FileProxy";
3116

32-
public FileProxy(TiContext tiContext, String[] parts)
17+
public FileProxy(String[] parts)
3318
{
34-
super(tiContext, parts, true);
19+
super(parts, true);
3520
}
3621

37-
public FileProxy(TiContext tiContext, String[] parts, boolean resolve)
22+
public FileProxy(String[] parts, boolean resolve)
3823
{
39-
super(tiContext, parts, resolve);
24+
super(parts, resolve);
4025
}
4126
}

android/modules/filesystem/src/ti/modules/titanium/filesystem/FilesystemModule.java

+4-11
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,9 @@
1212
import org.appcelerator.kroll.KrollModule;
1313
import org.appcelerator.kroll.annotations.Kroll;
1414
import org.appcelerator.titanium.TiApplication;
15-
import org.appcelerator.titanium.TiContext;
1615
import org.appcelerator.titanium.util.Log;
1716
import org.appcelerator.titanium.util.TiConfig;
1817
import org.appcelerator.titanium.util.TiConvert;
19-
import org.appcelerator.titanium.util.TiTempFileHelper;
2018

2119
import ti.modules.titanium.stream.FileStreamProxy;
2220

@@ -31,11 +29,6 @@ public class FilesystemModule extends KrollModule
3129
@Kroll.constant public static int MODE_APPEND = 2;
3230

3331
private static String[] RESOURCES_DIR = { "app://" };
34-
35-
public FilesystemModule(TiContext tiContext)
36-
{
37-
super(tiContext);
38-
}
3932

4033
// Methods
4134
@Kroll.method
@@ -44,7 +37,7 @@ public FileProxy createTempFile()
4437
try {
4538
File f = File.createTempFile("tifile", "tmp");
4639
String[] parts = { f.getAbsolutePath() };
47-
return new FileProxy(getTiContext(), parts, false);
40+
return new FileProxy(parts, false);
4841
} catch (IOException e) {
4942
Log.e(LCAT, "Unable to create tmp file: " + e.getMessage(), e);
5043
return null;
@@ -59,7 +52,7 @@ public FileProxy createTempDirectory()
5952
File f = new File(tmpdir,dir);
6053
f.mkdirs();
6154
String[] parts = { f.getAbsolutePath() };
62-
return new FileProxy(getTiContext(), parts);
55+
return new FileProxy(parts);
6356
}
6457

6558
@Kroll.getProperty @Kroll.method
@@ -72,7 +65,7 @@ public boolean isExternalStoragePresent()
7265
public FileProxy getFile(Object[] parts)
7366
{
7467
String[] sparts = TiConvert.toStringArray(parts);
75-
return new FileProxy(getTiContext(), sparts);
68+
return new FileProxy(sparts);
7669
}
7770

7871
@Kroll.getProperty @Kroll.method
@@ -122,7 +115,7 @@ public String getLineEnding()
122115
public FileStreamProxy openStream(int mode, Object[] parts) throws IOException
123116
{
124117
String[] sparts = TiConvert.toStringArray(parts);
125-
FileProxy fileProxy = new FileProxy(getTiContext(), sparts);
118+
FileProxy fileProxy = new FileProxy(sparts);
126119
fileProxy.getBaseFile().open(mode, true);
127120

128121
return new FileStreamProxy(fileProxy);

android/modules/media/.factorypath

-5
This file was deleted.

android/modules/media/.settings/org.eclipse.jdt.apt.core.prefs

-8
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
#Sun Jul 31 13:29:22 CDT 2011
1+
#Fri Sep 23 12:49:05 PDT 2011
22
eclipse.preferences.version=1
3-
org.eclipse.jdt.core.compiler.processAnnotations=enabled
3+
org.eclipse.jdt.core.compiler.processAnnotations=disabled

android/modules/ui/.classpath

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
<classpathentry kind="src" path="gen"/>
1010
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
1111
<classpathentry combineaccessrules="false" kind="src" path="/titanium"/>
12-
<classpathentry combineaccessrules="false" kind="src" path="/titanium-api"/>
1312
<classpathentry combineaccessrules="false" kind="src" path="/titanium-filesystem"/>
1413
<classpathentry combineaccessrules="false" kind="src" path="/titanium-media"/>
1514
<classpathentry combineaccessrules="false" kind="src" path="/titanium-app"/>
1615
<classpathentry kind="lib" path="/titanium-dist/lib/kroll-apt.jar"/>
16+
<classpathentry combineaccessrules="false" kind="src" path="/kroll-v8"/>
1717
<classpathentry kind="output" path="bin"/>
1818
</classpath>

android/modules/ui/.factorypath

-5
This file was deleted.

android/modules/ui/.settings/org.eclipse.jdt.apt.core.prefs

-8
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
#Sun Jul 31 13:29:22 CDT 2011
1+
#Fri Sep 23 12:48:46 PDT 2011
22
eclipse.preferences.version=1
3-
org.eclipse.jdt.core.compiler.processAnnotations=enabled
3+
org.eclipse.jdt.core.compiler.processAnnotations=disabled

0 commit comments

Comments
 (0)