+ * InstallerResultMessage contains name-value pairs: name is a string, + * value can be either a string or an int. Message syntax: + *
+ *
+ * message := length named_int_value* length named_string_value* + * named_int_value := name int_value + * named_string_value := name string_value + * name := <string> + * int_value := <int> + * string_value := <string> + * length := <int telling the length of the table that follows> + *+ *
*/
public class InstallerResultMessage
{
+ /** Operation type. Value type: int.
+ Possible values: 0: install, 1: uninstall, 2: componentinfo. */
public static final String NAME_OPERATION = "operation";
+ /** Status code indicating operation result. Value type: int. */
public static final String NAME_RESULT = "result";
+ /** SIF error category. Value type: int. */
public static final String NAME_ERROR_CATEGORY = "error-category";
+ /** Java runtime specific error code. Value type: int. */
+ public static final String NAME_ERROR_CODE = "error-code";
+ /** Localized error message. Value type: string. */
public static final String NAME_ERROR_MSG = "error-message";
+ /** Localized message with more details of the error reason. Value type: string. */
public static final String NAME_ERROR_DETAILS = "error-details";
+ /** Suite UID. Value type: int. */
public static final String NAME_SUITE_UID = "suite-uid";
+ /** Midlet-n UID. Value type: int. */
public static final String NAME_MIDLET_UID = "midlet-uid-";
+ /** Suite component id. Value type: int. */
public static final String NAME_SUITE_CID = "suite-cid";
+ /** Midlet-n component id. Value type: int. */
public static final String NAME_MIDLET_CID = "midlet-cid-";
+ /** Suite global id. Value type: string. */
public static final String NAME_SUITE_GID = "suite-gid";
+ /** Midlet-n global id. Value type: string. */
public static final String NAME_MIDLET_GID = "midlet-gid-";
+ /** Suite name. Value type: string. */
public static final String NAME_SUITE_NAME = "suite-name";
+ /** Midlet-n name. Value type: string. */
public static final String NAME_MIDLET_NAME= "midlet-name-";
+ /** Suite vendor. Value type: string. */
public static final String NAME_VENDOR = "vendor";
+ /** Suite version. Value type: string. */
public static final String NAME_VERSION = "version";
+ /** Component installation status. Value type: int. Possible values:
+ 0: new component,
+ 1: upgrade,
+ 2: already installed,
+ 3: newer version already installed,
+ 4: invalid package, cannot be installed. */
public static final String NAME_INSTALL_STATUS = "install-status";
+ /** Component authenticity. Value type: int. Possible values:
+ 0: component is not authenticated, 1: component is authenticated. */
public static final String NAME_AUTHENTICITY = "authenticity";
+ /** Size of the files owned by the component at the time of the
+ installation. Calculated from MIDlet-Data-Size and
+ MIDlet-Jar-Size attributes. Value type: int. */
public static final String NAME_COMPONENT_SIZE = "component-size";
+ /** Id for installer result Comms message. */
+ private static final int INSTALLER_RESULT_MESSAGE_ID = 601;
+
private Hashtable iNamedIntValues = null;
private Hashtable iNamedStringValues = null;
@@ -165,7 +214,7 @@
{
addValue(NAME_ERROR_DETAILS, msg);
}
- addErrorCategory(eb);
+ addErrorCodes(eb);
}
if (aException instanceof InstallerException)
{
@@ -193,25 +242,24 @@
}
/**
- * Get a string value from this message.
- * @throws IllegalArgumentException if value with given name is not found
+ * Returns a string value from this message, or null
+ * if string value is not present.
*/
- public String getStringValue(String aName)
+ String getStringValue(String aName)
{
Object value = iNamedStringValues.get(aName);
if (value instanceof String)
{
return (String)value;
}
- throw new IllegalArgumentException(
- "InstallerResultMessage: string value " + aName + " not found");
+ return null;
}
/**
* Get an int value from this message.
* @throws IllegalArgumentException if value with given name is not found
*/
- public int getIntValue(String aName)
+ int getIntValue(String aName)
{
Object value = iNamedIntValues.get(aName);
if (value instanceof Integer)
@@ -225,7 +273,7 @@
/**
* Removes a value from this message.
*/
- public void removeValue(String aName)
+ void removeValue(String aName)
{
iNamedStringValues.remove(aName);
iNamedIntValues.remove(aName);
@@ -255,19 +303,20 @@
}
if (iSifNotifier != null)
{
- int errCategory = 0;
- int errCode = 0;
- String errMsg = null;
- String errDetails = null;
- if (getIntValue(NAME_RESULT) != Installer.ERR_NONE)
- {
- errCategory = getIntValue(NAME_ERROR_CATEGORY);
- errCode = Installer.ERR_GENERAL;
- errMsg = getStringValue(NAME_ERROR_MSG);
- errDetails = getStringValue(NAME_ERROR_DETAILS);
- }
try
{
+ int result = getIntValue(NAME_RESULT);
+ int errCategory = 0;
+ int errCode = 0;
+ String errMsg = null;
+ String errDetails = null;
+ if (result != Installer.ERR_NONE)
+ {
+ errCategory = getIntValue(NAME_ERROR_CATEGORY);
+ errCode = getIntValue(NAME_ERROR_CODE);
+ errMsg = getStringValue(NAME_ERROR_MSG);
+ errDetails = getStringValue(NAME_ERROR_DETAILS);
+ }
iSifNotifier.notifyEnd(errCategory, errCode, errMsg, errDetails);
}
catch (Throwable t)
@@ -298,7 +347,7 @@
{
comms.connect(aEndpoint);
CommsMessage msg = new CommsMessage();
- msg.setMessageId(601);
+ msg.setMessageId(INSTALLER_RESULT_MESSAGE_ID);
// Initialise the message data.
msg.write(iNamedIntValues.size());
Enumeration e = iNamedIntValues.keys();
@@ -318,7 +367,7 @@
}
// Send the message.
Log.log("Sending InstallerResultMessage to " + aEndpoint);
- CommsMessage installerResultResponse = comms.sendReceive(msg, 5);
+ comms.sendReceive(msg, 5);
comms.disconnect();
Log.log("Received InstallerResultResponse from " + aEndpoint);
}
@@ -385,48 +434,34 @@
}
/**
- * Adds error category to the result message.
+ * Adds error codes to the result message.
*/
- private void addErrorCategory(ExceptionBase aEb)
+ private void addErrorCodes(ExceptionBase aEb)
{
- switch (aEb.getShortMessageId())
+ if (aEb.getShortMessageId() >= ErrorMessageBase.INSTALLER_RANGE_START &&
+ aEb.getShortMessageId() <= ErrorMessageBase.INSTALLER_RANGE_END)
{
- case InstallerErrorMessage.INST_NO_MEM:
- addValue(NAME_ERROR_CATEGORY, 2); // ELowDiskSpace
- break;
- case InstallerErrorMessage.INST_NO_NET:
- addValue(NAME_ERROR_CATEGORY, 3); // ENetworkUnavailable
- break;
- case InstallerErrorMessage.INST_CORRUPT_PKG:
- addValue(NAME_ERROR_CATEGORY, 5); // ECorruptedPackage
- break;
- case InstallerErrorMessage.INST_COMPAT_ERR:
- addValue(NAME_ERROR_CATEGORY, 6); // EApplicationNotCompatible
- break;
- case InstallerErrorMessage.INST_AUTHORIZATION_ERR:
- // fall through
- case InstallerErrorMessage.INST_AUTHENTICATION_ERR:
- addValue(NAME_ERROR_CATEGORY, 7); // ESecurityError
- break;
- case InstallerErrorMessage.INST_PUSH_REG_ERR:
- // fall through
- case InstallerErrorMessage.INST_UNEXPECTED_ERR:
- // fall through
- case InstallerErrorMessage.UNINST_UNEXPECTED_ERR:
- // fall through
- case InstallerErrorMessage.OTHER_UNEXPECTED_ERR:
- addValue(NAME_ERROR_CATEGORY, 8); // EUnexpectedError
- break;
- case InstallerErrorMessage.INST_CANCEL:
- // fall through
- case InstallerErrorMessage.UNINST_CANCEL:
- addValue(NAME_ERROR_CATEGORY, 9); // EUserCancelled
- break;
- case InstallerErrorMessage.UNINST_NOT_ALLOWED:
- addValue(NAME_ERROR_CATEGORY, 10); // EUninstallationBlocked
- break;
- default:
- addValue(NAME_ERROR_CATEGORY, 8); // EUnexpectedError
+ addValue(NAME_ERROR_CATEGORY,
+ SifRegistrator.getErrorCategory(aEb.getShortMessageId()));
+ addValue(NAME_ERROR_CODE,
+ aEb.getShortMessageId() + aEb.getDetailedMessageId());
+ }
+ else if (aEb.getShortMessageId() >= ErrorMessageBase.SECURITY_RANGE_START &&
+ aEb.getShortMessageId() <= ErrorMessageBase.SECURITY_RANGE_END)
+ {
+ addValue(NAME_ERROR_CATEGORY,
+ SifRegistrator.getErrorCategory(
+ InstallerErrorMessage.INST_AUTHORIZATION_ERR));
+ addValue(NAME_ERROR_CODE,
+ aEb.getShortMessageId() + aEb.getDetailedMessageId());
+ }
+ else
+ {
+ addValue(NAME_ERROR_CATEGORY,
+ SifRegistrator.getErrorCategory(
+ InstallerErrorMessage.INST_UNEXPECTED_ERR));
+ addValue(NAME_ERROR_CODE,
+ aEb.getShortMessageId()*1000 + aEb.getDetailedMessageId());
}
}
}
diff -r 85266cc22c7f -r 35baca0e7a2e javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/InstallBall.java
--- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/InstallBall.java Fri Jun 11 13:33:44 2010 +0300
+++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/InstallBall.java Tue Jul 06 20:36:19 2010 +0300
@@ -20,6 +20,7 @@
import java.util.Hashtable;
+import com.nokia.mj.impl.installer.Installer;
import com.nokia.mj.impl.installer.InstallationNotifier;
import com.nokia.mj.impl.installer.applicationregistrator.ApplicationRegistrator;
import com.nokia.mj.impl.installer.applicationregistrator.SifNotifier;
@@ -303,10 +304,11 @@
Log.logWarning("checkForCancel: Stopping downloader failed", t);
}
}
- throw new InstallerException
- (InstallerErrorMessage.INST_CANCEL, null,
- InstallerDetailedErrorMessage.NO_MSG, null,
- OtaStatusCode.USER_CANCELLED);
+ throw new InstallerException(
+ Installer.ERR_CANCEL,
+ InstallerErrorMessage.INST_CANCEL, null,
+ InstallerDetailedErrorMessage.INST_CANCEL, null,
+ OtaStatusCode.USER_CANCELLED);
}
}
diff -r 85266cc22c7f -r 35baca0e7a2e javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/StartProgressNotifications.java
--- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/StartProgressNotifications.java Fri Jun 11 13:33:44 2010 +0300
+++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/StartProgressNotifications.java Tue Jul 06 20:36:19 2010 +0300
@@ -36,6 +36,12 @@
InstallBall ball = (InstallBall)aBall;
Log.log("Starting progress notifications...");
+ if (ball.iPreinstallation)
+ {
+ Log.log("SifNotifier disabled during preinstallation.");
+ return;
+ }
+
if (!SifNotifier.enabled())
{
Log.log("SifNotifier disabled.");
@@ -99,7 +105,7 @@
}
catch (Throwable t)
{
- Log.logError("StartProgressNotifications: SifNotifier.notifyStart failed", t);
+ Log.log("StartProgressNotifications: SifNotifier.notifyStart failed", t);
try
{
ball.iSifNotifier.destroy();
diff -r 85266cc22c7f -r 35baca0e7a2e javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/uninstall/steps/UninstallBall.java
--- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/uninstall/steps/UninstallBall.java Fri Jun 11 13:33:44 2010 +0300
+++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/uninstall/steps/UninstallBall.java Tue Jul 06 20:36:19 2010 +0300
@@ -21,6 +21,7 @@
import java.util.Hashtable;
import java.util.Vector;
+import com.nokia.mj.impl.installer.Installer;
import com.nokia.mj.impl.installer.InstallationNotifier;
import com.nokia.mj.impl.installer.applicationregistrator.ApplicationRegistrator;
import com.nokia.mj.impl.installer.applicationregistrator.SifNotifier;
@@ -124,10 +125,11 @@
super.checkForCancel();
if (isCancelled())
{
- throw new InstallerException
- (InstallerErrorMessage.UNINST_CANCEL, null,
- InstallerDetailedErrorMessage.NO_MSG, null,
- OtaStatusCode.USER_CANCELLED);
+ throw new InstallerException(
+ Installer.ERR_CANCEL,
+ InstallerErrorMessage.UNINST_CANCEL, null,
+ InstallerDetailedErrorMessage.UNINST_CANCEL, null,
+ OtaStatusCode.USER_CANCELLED);
}
}
diff -r 85266cc22c7f -r 35baca0e7a2e javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/storagehandler/StorageHandler.java
--- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/storagehandler/StorageHandler.java Fri Jun 11 13:33:44 2010 +0300
+++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/storagehandler/StorageHandler.java Tue Jul 06 20:36:19 2010 +0300
@@ -925,13 +925,23 @@
}
else
{
- // Not an update ==> user is making uninstallation.
+ // Not an update ==> suite is being uninstalled.
int oldPreinstallState = readPreinstallState(aSuiteInfo);
if (oldPreinstallState == aSuiteInfo.STATE_PREINSTALLED)
{
- // User is uninstalling a preinstalled application,
- // set preinstall state to STATE_NO_PREINSTALL.
- setNoPreinstallState(aSuiteInfo);
+ if (aSuiteInfo.getResetPreinstall())
+ {
+ // Preinstallation state should be reset,
+ // remove existing data from
+ // StorageNames.PREINSTALL_TABLE table.
+ removePreinstallState(aSuiteInfo);
+ }
+ else
+ {
+ // User is uninstalling a preinstalled application,
+ // set preinstall state to STATE_NO_PREINSTALL.
+ setNoPreinstallState(aSuiteInfo);
+ }
}
else if (oldPreinstallState == aSuiteInfo.STATE_INSTALLED)
{
@@ -1081,13 +1091,11 @@
/**
* Removes preinstall state for given suite from
- * preinstall table but only if preinstall state
- * in given SuiteInfo is SuiteInfo.STATE_INSTALLED.
+ * preinstall table
*/
private void removePreinstallState(SuiteInfo aSuiteInfo)
{
- if (aSuiteInfo == null ||
- aSuiteInfo.iPreinstallState != aSuiteInfo.STATE_INSTALLED)
+ if (aSuiteInfo == null)
{
return;
}
diff -r 85266cc22c7f -r 35baca0e7a2e javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/utils/Args.java
--- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/utils/Args.java Fri Jun 11 13:33:44 2010 +0300
+++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/utils/Args.java Tue Jul 06 20:36:19 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -20,6 +20,7 @@
import com.nokia.mj.impl.installer.utils.InstallerException;
import com.nokia.mj.impl.installer.utils.Log;
+import com.nokia.mj.impl.utils.Base64;
import com.nokia.mj.impl.utils.Tokenizer;
import java.util.Hashtable;
@@ -59,6 +60,7 @@
//Log.log("Args: " + arg + "=" + value);
}
}
+ decodeBase64Args();
}
/**
@@ -203,7 +205,59 @@
}
drive = aDrive.toLowerCase().charAt(0) - 'a';
}
- Log.log("Parsed drive " + aDrive + " --> " + drive);
+ Log.log("Args: Parsed drive " + aDrive + " --> " + drive);
return drive;
}
+
+ /**
+ * Decodes base64 encoded arguments.
+ * In Symbian environment the decoded argument is UTF-16LE string.
+ *
+ * @see /sf/app/jrt/javacommons/utils/inc/javacommonutils.h,
+ * wbase64encode()
+ */
+ private void decodeBase64Args()
+ {
+ String base64Value = get("base64");
+ if (base64Value == null || base64Value.length() == 0)
+ {
+ return;
+ }
+ String[] tokens = Tokenizer.split(base64Value, ",");
+ String name = null;
+ String value = null;
+ for (int i = 0; i < tokens.length; i++)
+ {
+ name = tokens[i];
+ value = null;
+ if (name != null && name.length() > 0)
+ {
+ value = get(name);
+ }
+ if (value != null && value.length() > 0)
+ {
+ try
+ {
+ byte[] valueBytes = Base64.decode(value);
+ if (valueBytes != null && valueBytes.length > 0)
+ {
+ value = new String(valueBytes, "UTF-16LE");
+ Log.log("Args: Base64 decoded option " +
+ name + "=" + value);
+ iArgs.put(name, value);
+ }
+ else
+ {
+ Log.logError("Args: Base64 decoding failed for " +
+ name + "=" + value);
+ }
+ }
+ catch (Throwable t)
+ {
+ Log.logError("Args: Base64 decoding failed for " +
+ name + "=" + value, t);
+ }
+ }
+ }
+ }
}
diff -r 85266cc22c7f -r 35baca0e7a2e javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/rt/installer/ApplicationUtilsImpl.java
--- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/rt/installer/ApplicationUtilsImpl.java Fri Jun 11 13:33:44 2010 +0300
+++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/rt/installer/ApplicationUtilsImpl.java Tue Jul 06 20:36:19 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -85,6 +85,11 @@
Installer.cancel();
}
+ public void uiDisposed()
+ {
+ Log.log("ApplicationUtilsImpl.uiDisposed");
+ }
+
public void checkPermission(Permission aPermission)
throws AccessControlException, NullPointerException
{
@@ -112,7 +117,7 @@
boolean userPromptAllowed = false;
if (aPermission.toString().equals(
- "javax.microedition.io.PushRegistryPermission"))
+ "javax.microedition.io.PushRegistry"))
{
// PushRegistryPermission is the only permission which
// must be prompted from the user during installation.
diff -r 85266cc22c7f -r 35baca0e7a2e javamanager/javainstaller/installer/src.s60/applicationregistrator/sifnotifier.cpp
--- a/javamanager/javainstaller/installer/src.s60/applicationregistrator/sifnotifier.cpp Fri Jun 11 13:33:44 2010 +0300
+++ b/javamanager/javainstaller/installer/src.s60/applicationregistrator/sifnotifier.cpp Tue Jul 06 20:36:19 2010 +0300
@@ -21,21 +21,11 @@
#include "javasymbianoslayer.h" // for CleanupResetAndDestroyPushL
#include "logger.h"
-#if defined(SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK) && defined(RD_JAVA_USIF_NOTIFY_PROGRESS)
+#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
#include
Shell((Display) null)
.
*
@@ -467,11 +480,15 @@
Point size = computeSize(area.width, area.height, true);
size.x -= windowFrameTrim() * 2;
size.y -= windowTitleTrim() + windowFrameTrim();
+
+ // These values will be returned if the size is queried before the Shell
+ // is made visible (and they are not set again).
+ OS.QWidget_resize(topHandle, size.x, size.y);
+
if(OS.windowServer == OS.WS_SYMBIAN_S60 && parent == null) {
setRestoreState(OS.QT_WINDOWMAXIMIZED, false);
- } else {
- OS.QWidget_resize(topHandle, size.x, size.y);
}
+
return size;
}
@@ -991,7 +1008,15 @@
}
// This shell
- super.setVisible(visible);
+ try {
+ if (visible) {
+ suppressResizeEvent = true;
+ }
+ super.setVisible(visible);
+ } finally {
+ suppressResizeEvent = false;
+ }
+
if(isDisposed()) return;
// Dialog shells.
@@ -1128,10 +1153,22 @@
return true;
}
+void qt_swt_event_symbianWindowHide() {
+ notifySymbianWindowVisibilityChange(false);
+}
+
+void qt_swt_event_symbianWindowShow() {
+ notifySymbianWindowVisibilityChange(true);
+}
+
public Rectangle internal_getDefaultBounds() {
return defBounds;
}
+void qt_swt_event_widgetResized_pp(int widgetHandle, int oldWidth, int oldHeight, int width, int height, boolean sendResizeEvent) {
+ super.qt_swt_event_widgetResized_pp(widgetHandle, oldWidth, oldHeight, width, height, !suppressResizeEvent);
+}
+
WindowSurface getWindowSurface() {
checkWidget();
// Only top level shells have window surface
@@ -1144,4 +1181,21 @@
return windowSurface;
}
+void addSymbianWindowVisibilityListener_pp(SymbianWindowVisibilityListener listener) {
+ if (!winVisibilityListeners.contains(listener))
+ winVisibilityListeners.addElement(listener);
}
+
+void removeSymbianWindowVisibilityListener_pp(SymbianWindowVisibilityListener listener) {
+ if (winVisibilityListeners.contains(listener))
+ winVisibilityListeners.removeElement(listener);
+}
+
+void notifySymbianWindowVisibilityChange(boolean visible) {
+ int count = winVisibilityListeners.size();
+ for (int i = 0; i < count; i++) {
+ SymbianWindowVisibilityListener listener = (SymbianWindowVisibilityListener)(winVisibilityListeners.elementAt(i));
+ listener.handleSymbianWindowVisibilityChange(this, visible);
+ }
+}
+}
diff -r 85266cc22c7f -r 35baca0e7a2e javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/widgets/Widget.java
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/widgets/Widget.java Fri Jun 11 13:33:44 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/widgets/Widget.java Tue Jul 06 20:36:19 2010 +0300
@@ -51,13 +51,13 @@
*/
public abstract class Widget {
int handle, topHandle;
-
+
int style, state;
Display display;
EventTable eventTable;
Object data;
PackageProxy packageProxy;
-
+
static final int checkBits (int style, int int0, int int1, int int2, int int3, int int4, int int5) {
int mask = int0 | int1 | int2 | int3 | int4 | int5;
if ((style & mask) == 0) style |= int0;
@@ -111,10 +111,10 @@
/**
* * IMPORTANT: This constructor is not part of the SWT - * public API. It should never be referenced from application code. + * public API. It should never be referenced from application code. *
*/ -protected Widget (Widget parent, int style, int extraStyle, Object packageProxy, +protected Widget (Widget parent, int style, int extraStyle, Object packageProxy, boolean isExtended) { checkSubclass (); checkParent (parent); @@ -190,27 +190,27 @@ final void checkOrientation (Widget parent) { style &= ~SWT.MIRRORED; - + // If orientation explicitly specified then always use that if ((style & (SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT)) == 0) { if (parent != null) { // Inherit the flag from parent if ((parent.style & SWT.LEFT_TO_RIGHT) != 0) style |= SWT.LEFT_TO_RIGHT; if ((parent.style & SWT.RIGHT_TO_LEFT) != 0) style |= SWT.RIGHT_TO_LEFT; - + // If the parent follows the system language direction this widget - // does too (unless the user explicitly specified the direction). + // does too (unless the user explicitly specified the direction). state |= (parent.state & WidgetState.FOLLOWS_SYSLANG_DIRECTION); } else { - // Use the default determined by a system property. - // Setting RIGHT_TO_LEFT flag triggers the coordinate mirroring. + // Use the default determined by a system property. + // Setting RIGHT_TO_LEFT flag triggers the coordinate mirroring. if(Display.defaultOrientation != SWT.LEFT_TO_RIGHT) { style |= Display.defaultOrientation; } - - // If there's no parent this widget follows the system language - // direction if that's the default behavior configured by a system - // property. + + // If there's no parent this widget follows the system language + // direction if that's the default behavior configured by a system + // property. if(Display.defaultOrientationIsSysLangDirection) state |= WidgetState.FOLLOWS_SYSLANG_DIRECTION; } @@ -299,10 +299,10 @@ } /* - * _pp means that some widgets want to "override" this method in another - * package. If this is such a widget then there is a 'package proxy' (pp) that - * must be called instead of the implementation in this package. - */ + * _pp means that some widgets want to "override" this method in another + * package. If this is such a widget then there is a 'package proxy' (pp) that + * must be called instead of the implementation in this package. + */ void createHandle_pp (int index) { } @@ -313,7 +313,7 @@ createHandle_pp (index); } // If subclasses didn't specify topHandle then it's assumed that there's - // only one QWidget. I.e. handle is the root widget. + // only one QWidget. I.e. handle is the root widget. if(topHandle == 0) topHandle = handle; if(packageProxy != null) { packageProxy.hookEvents(); @@ -641,7 +641,7 @@ if (keypad) { event.keyLocation = SWT.KEYPAD; } - + event.keyLocation |= Display.translateKeyLocation(nativeScanCode); return event; @@ -869,7 +869,13 @@ void qt_swt_event_widgetPainted(int widgetHandle, int x, int y, int width, int height, int regionHandle) { } -void qt_swt_event_widgetResized_pp(int widgetHandle, int oldWidth, int oldHeight, int width, int height) { +void qt_swt_event_widgetResized_pp(int widgetHandle, int oldWidth, int oldHeight, int width, int height, boolean sendResizeEvent) { +} + +void qt_swt_event_symbianWindowHide() { +} + +void qt_swt_event_symbianWindowShow() { } void register_pp () { @@ -1120,7 +1126,7 @@ public void setData (String key, Object value) { checkWidget(); if (key == null) error (SWT.ERROR_NULL_ARGUMENT); - + if (key.equals (WidgetConstant.SET_CANVAS_STATE_KEY)) { boolean enabled = ((Boolean)value).booleanValue(); if (enabled) { @@ -1177,11 +1183,11 @@ } if(key.equals(WidgetConstant.CSS_ID)){ - OS.QObject_setObjectName(handle,(String)value); + OS.QObject_setObjectName(topHandle,(String)value); // Do not return here and let Widget store the key // value. } - + int index = 1; Object [] table = null; if ((state & WidgetState.KEYED_DATA) != 0) { @@ -1229,12 +1235,12 @@ } final void setPackageProxy(Object packageProxy) { - // If the subclass is in another package then it provides a proxy object + // If the subclass is in another package then it provides a proxy object // which implements the methods that "override" the package private // implementations from this package. We must call the proxy object - // implementations if they are provided. + // implementations if they are provided. if(packageProxy != null) { - PackageProxy proxyObject = (PackageProxy)packageProxy; + PackageProxy proxyObject = (PackageProxy)packageProxy; proxyObject.setWidget(this); this.packageProxy = proxyObject; } diff -r 85266cc22c7f -r 35baca0e7a2e javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/eswt_widgets.pri --- a/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/eswt_widgets.pri Fri Jun 11 13:33:44 2010 +0300 +++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/eswt_widgets.pri Tue Jul 06 20:36:19 2010 +0300 @@ -54,23 +54,24 @@ symbian { CONFIG += mobility MOBILITY += bearer - + + CONFIG +=hb HEADERS += \ swts60.h \ - swtmobiledevice.h \ + swtmobiledevice.h \ swtflipwatch.h - + SOURCES += \ swts60.cpp \ - swtmobiledevice.cpp \ + swtmobiledevice.cpp \ swtflipwatch.cpp - + LIBS += \ -leikcore \ -lapparc \ - -lavkon \ -lefsrv \ -lcone \ + -lavkon \ -leikcoctl \ -lapgrfx \ -lHWRMVibraClient \ @@ -80,5 +81,7 @@ -lQtContacts \ -lhal \ -lws32 \ - -lgdi + -lgdi \ + -lHbCore \ + -lfbscli } diff -r 85266cc22c7f -r 35baca0e7a2e javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/eventcallback.cpp --- a/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/eventcallback.cpp Fri Jun 11 13:33:44 2010 +0300 +++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/eventcallback.cpp Tue Jul 06 20:36:19 2010 +0300 @@ -105,6 +105,13 @@ { SWT_LOG_EVENT_2("QEvent type=%d (key event) object=%x", eventType, aObj); QKeyEvent *keyEvent = static_castCanvas
object.
*/
public Canvas()
{
super(null);
+ synchronized(this)
+ {
+ objectCount++;
+ }
+
+ modeLock = new Object();
repaintLock = new Object();
cleanupLock = new Object();
+ flushLock = new Object();
+ setMode(GAME_CANVAS, this instanceof GameCanvas);
construct();
keysPressed = new Vector();
}
+ /**
+ * Disposes this instance
+ * Called when finalizer is destroying this instance.
+ */
+ void dispose()
+ {
+ ESWTUIThreadRunner.update(getClass().getName(), -1);
+ ESWTUIThreadRunner.safeSyncExec(new Runnable()
+ {
+ public void run()
+ {
+ if(graphicsBuffer != null)
+ {
+ graphicsBuffer.dispose();
+ graphicsBuffer = null;
+ }
+
+ synchronized(this)
+ {
+ objectCount--;
+
+ if((objectCount == 0) || isMode(GAME_CANVAS))
+ {
+ mShell.dispose();
+ sharedShell = null;
+ sharedKeypad = null;
+ }
+ else
+ {
+ Ticker ticker = getTicker();
+ if (ticker != null)
+ {
+ ticker.removeLabel(tickerLabel);
+ }
+ if(tickerLabel != null)
+ {
+ tickerLabel.dispose();
+ }
+
+ canvasComp.dispose();
+ }
+ }
+ }
+ });
+ }
+
/* (non-Javadoc)
* @see Displayable#eswtConstructShell(int)
*/
Shell eswtConstructShell(int style)
{
- return super.eswtConstructShell(style /*| SWT.RESIZE*/);
+ if(isMode(GAME_CANVAS))
+ {
+ mShell = super.eswtConstructShell(style);
+ }
+ else
+ {
+ if(sharedShell == null)
+ {
+ sharedShell = super.eswtConstructShell(style);
+ }
+ mShell = sharedShell;
+ }
+
+ // Give the Shell the maximized size already before it becomes visible
+ // so that it will return the correct size.
+ mShell.setBounds(org.eclipse.swt.widgets.Display.getCurrent().getClientArea());
+
+ // Make the Shell maximized. On Symbian it's automatically maximized
+ // so this has no effect but on other platforms explicit maximizing
+ // might be needed.
+ mShell.setMaximized(true);
+
+ return mShell;
+ }
+
+ /**
+ * Sets ticker. If ticker is added already to other canvas(es),
+ * it continues running from position where it was. Otherwise
+ * it will start running from beginning when this method returns.
+ *
+ * @param newTicker New ticker. If null, current ticker is removed.
+ */
+ public void setTicker(Ticker newTicker)
+ {
+ super.setTicker(newTicker);
+
+ ESWTUIThreadRunner.syncExec(new Runnable()
+ {
+ public void run()
+ {
+ tickerLabel.setVisible(isMode(CURRENTLY_VISIBLE));
+ }
+ });
+ }
+
+ /**
+ * Creates singleton Label instance used by Ticker.
+ * Creates tickerLabel on shell and sets the visibility of the same.
+ */
+ Label getTickerLabel()
+ {
+ tickerLabel = super.getTickerLabel();
+
+ if (!isMode(CURRENTLY_VISIBLE))
+ {
+ ESWTUIThreadRunner.syncExec(new Runnable()
+ {
+ public void run()
+ {
+ tickerLabel.setVisible(false);
+ }
+ });
+ }
+
+ return tickerLabel;
}
/* (non-Javadoc)
@@ -229,16 +372,16 @@
Composite eswtConstructContent(int style)
{
// Get JAD attribute
- noBackground = JadAttributeUtil.isValue(JadAttributeUtil.ATTRIB_NOKIA_UI_ENHANCEMENT,
- JadAttributeUtil.VALUE_CANVAS_HAS_BACKGROUND);
- if(noBackground)
+ setMode(NO_BACKGROUND, JadAttributeUtil.isValue(JadAttributeUtil.ATTRIB_NOKIA_UI_ENHANCEMENT,
+ JadAttributeUtil.VALUE_CANVAS_HAS_BACKGROUND));
+ if(isMode(NO_BACKGROUND))
{
style |= SWT.NO_BACKGROUND;
}
// Get JAD attribute for S60 Selection Key Compatibility
- selectionKeyCompatibility = JadAttributeUtil.isValue(JadAttributeUtil.ATTRIB_NOKIA_MIDLET_S60_SELECTION_KEY_COMPATIBILITY,
- JadAttributeUtil.VALUE_TRUE);
+ setMode(SELECTIONKEY_COMPATIBILITY, JadAttributeUtil.isValue(JadAttributeUtil.ATTRIB_NOKIA_MIDLET_S60_SELECTION_KEY_COMPATIBILITY,
+ JadAttributeUtil.VALUE_TRUE));
// Get JAD attribute for MIDlet Tap Detection
String tapAttr = JadAttributeUtil.getValue(JadAttributeUtil.ATTRIB_NOKIA_MIDLET_TAP_DETECTION_OPTIONS);
@@ -266,7 +409,7 @@
if((twips == 0) && (timeout == 0))
{
- disableTapDetection = true;
+ setMode(DISABLE_TAPDETECTION, true);
}
// if any one of the value is zero, set defaults
@@ -287,8 +430,23 @@
setDefaultTapValues();
}
- Composite canvasComp = super.eswtConstructContent(style);
+ canvasComp = super.eswtConstructContent(style);
+ canvasComp.setVisible(false);
+
+ createOnScreenKeypad();
+
+ // create graphics buffer
+ graphicsBuffer = Buffer.createInstance(this, canvasComp);
+ return canvasComp;
+ }
+
+ /**
+ * Creates OSK(OnScreenKeypad), shared Keypad will be created for Canvas,
+ * seperate OSK will be created for each GameCanvas.
+ */
+ CanvasKeypad createOnScreenKeypad()
+ {
// Read the on screen keypad settings from the jad attribute
String oskAttr = JadAttributeUtil
.getValue(JadAttributeUtil.ATTRIB_NOKIA_MIDLET_ON_SCREEN_KEYPAD);
@@ -298,16 +456,37 @@
.equalsIgnoreCase(JadAttributeUtil.VALUE_GAMEACTIONS)) || (oskAttr
.equalsIgnoreCase(JadAttributeUtil.VALUE_NAVIGATIONKEYS))))
{
-
// On screen keypad is required, On devices without keyboard it can
// be either navigation keys or navigation and game keys
- onScreenkeypad = new CanvasKeypad(this, canvasComp, oskAttr);
+
+ if(isMode(GAME_CANVAS))
+ {
+ onScreenkeypad = new CanvasKeypad(this, oskAttr);
+ return onScreenkeypad;
+ }
+
+ if(sharedKeypad == null)
+ {
+ sharedKeypad = new CanvasKeypad(this, oskAttr);
+ }
+ onScreenkeypad = sharedKeypad;
+ return onScreenkeypad;
}
- // create graphics buffer
- graphicsBuffer = Buffer.createInstance(this, canvasComp);
+ return null;
+ }
- return canvasComp;
+ Rectangle eswtLayoutShellContent()
+ {
+ Rectangle shellArea = mShell.getClientArea();
+ int oskHeight = (onScreenkeypad != null ? onScreenkeypad.getHeight() : 0);
+ int tickerHeight = (tickerLabel != null ? tickerLabel.getBounds().height : 0);
+
+ canvasComp.setBounds(0, tickerHeight,
+ shellArea.width, shellArea.height - tickerHeight - oskHeight);
+
+ canvasComp.setFocus();
+ return canvasComp.getClientArea();
}
/* (non-Javadoc)
@@ -315,10 +494,28 @@
*/
void eswtHandleShowCurrentEvent()
{
+ setMode(CURRENTLY_VISIBLE, true);
+ eswtSetTitle();
+ ((MobileShell) mShell).setFullScreenMode(isMode(FULLSCREEN_MODE));
+ if(onScreenkeypad != null)
+ {
+ if(!isMode(GAME_CANVAS))
+ {
+ onScreenkeypad.setCurrentCanvas(this);
+ }
+ onScreenkeypad.setFullScreenMode(isMode(FULLSCREEN_MODE));
+ }
+ canvasComp.setVisible(true);
+ if(tickerLabel != null)
+ {
+ tickerLabel.setVisible(!isMode(FULLSCREEN_MODE));
+ }
+ addCommands();
super.eswtHandleShowCurrentEvent();
getContentComp().addPaintListener(paintListener);
getContentComp().addMouseListener(mouseListener);
getContentComp().addMouseMoveListener(mouseListener);
+ ((MobileShellExtension)getShell()).addSymbianWindowVisibilityListener(shellVisibilityListener);
}
/* (non-Javadoc)
@@ -326,10 +523,60 @@
*/
void eswtHandleHideCurrentEvent()
{
+ setMode(CURRENTLY_VISIBLE, false);
+ canvasComp.setVisible(false);
+ if(tickerLabel != null)
+ {
+ tickerLabel.setVisible(false);
+ }
+ removeCommands();
super.eswtHandleHideCurrentEvent();
getContentComp().removePaintListener(paintListener);
getContentComp().removeMouseListener(mouseListener);
getContentComp().removeMouseMoveListener(mouseListener);
+ ((MobileShellExtension)getShell()).removeSymbianWindowVisibilityListener(shellVisibilityListener);
+ }
+
+ /**
+ * eSWT callback to add a Command.
+ */
+ void eswtAddCommand(Command cmd) {
+ if (isMode(CURRENTLY_VISIBLE)) {
+ cmd.eswtAddESWTCommand(mShell, false);
+ }
+ if (eswtIsShown()) {
+ cmd.eswtAddCommandSelectionListener(mShell, getCommandListener());
+ }
+ }
+
+ /**
+ * Adds the commands to this Canvas.
+ * Adds all the commands of displayable to the shell.
+ */
+ void addCommands()
+ {
+ Command cmd = null;
+ for (Enumeration e = getCommands().elements(); e.hasMoreElements();)
+ {
+ cmd = (Command) e.nextElement();
+ final Command finalCommand = cmd;
+ finalCommand.eswtAddESWTCommand(mShell, false);
+ }
+ }
+
+ /**
+ * Removes the commands from this Canvas.
+ * Removes all the commands of displayable from the shell.
+ */
+ void removeCommands()
+ {
+ Command cmd = null;
+ for (Enumeration e = getCommands().elements(); e.hasMoreElements();)
+ {
+ cmd = (Command) e.nextElement();
+ final Command finalCommand = cmd;
+ finalCommand.eswtRemoveESWTCommand(mShell);
+ }
}
/**
@@ -368,14 +615,14 @@
// removed from the queue but repaintPending is still true. In
// that case it's currently being processed and we can still
// add to the invalid area.
- if(!repaintPending)
+ if(!isMode(REPAINT_PENDING))
{
EventDispatcher eventDispatcher = EventDispatcher.instance();
LCDUIEvent event = eventDispatcher.newEvent(
LCDUIEvent.CANVAS_PAINT_MIDLET_REQUEST, this);
event.widget = getContentComp();
eventDispatcher.postEvent(event);
- repaintPending = true;
+ setMode(REPAINT_PENDING, true);
}
}
}
@@ -386,18 +633,39 @@
*
* @param mode - true switches the Canvas to the full-screen mode.
*/
- public void setFullScreenMode(boolean mode)
+ public void setFullScreenMode(boolean aMode)
{
- finalMode = mode;
+ setMode(FULLSCREEN_MODE, aMode);
ESWTUIThreadRunner.syncExec(new Runnable()
{
public void run()
{
- ((MobileShell) getShell()).setFullScreenMode(finalMode);
- //set the CanvasKeypad to the required mode
- if(onScreenkeypad != null)
+ if(tickerLabel != null)
{
- onScreenkeypad.setFullScreenMode(finalMode);
+ if(isMode(FULLSCREEN_MODE))
+ {
+ tickerLabel.setBounds(Integer.MIN_VALUE, 0, 0, 0);
+ }
+ else
+ {
+ tickerLabel.pack();
+ tickerLabel.setLocation(Integer.MIN_VALUE, 0);
+ }
+
+ if(isMode(CURRENTLY_VISIBLE))
+ {
+ tickerLabel.setVisible(!isMode(FULLSCREEN_MODE));
+ }
+ }
+
+ if(isMode(CURRENTLY_VISIBLE))
+ {
+ ((MobileShell)mShell).setFullScreenMode(isMode(FULLSCREEN_MODE));
+ //set the CanvasKeypad to the required mode
+ if(onScreenkeypad != null)
+ {
+ onScreenkeypad.setFullScreenMode(isMode(FULLSCREEN_MODE));
+ }
}
}
});
@@ -506,7 +774,6 @@
}
-
/**
* Callback to be implemented by the application to render the
* Canvas
. The clip region of Graphics
object
@@ -619,7 +886,17 @@
*/
final void initGameCanvas(boolean suppressKeys)
{
- this.suppressGameKeys = suppressKeys;
+ setMode(SUPPRESS_GAMEKEYS, suppressKeys);
+ }
+
+ /**
+ * Gets composite that contains Canvas content.
+ *
+ * @return Composite.
+ */
+ Composite getContentComp()
+ {
+ return canvasComp;
}
/**
@@ -627,15 +904,15 @@
*/
final Graphics getGameBufferGraphics()
{
- tempGraphics = null;
- ESWTUIThreadRunner.safeSyncExec(new Runnable()
- {
- public void run()
- {
- tempGraphics = graphicsBuffer.getGraphics();
- }
- });
- return tempGraphics;
+ tempGraphics = null;
+ ESWTUIThreadRunner.safeSyncExec(new Runnable()
+ {
+ public void run()
+ {
+ tempGraphics = graphicsBuffer.getGraphics();
+ }
+ });
+ return tempGraphics;
}
CanvasKeypad getCanvasKeypad()
@@ -645,7 +922,7 @@
boolean IsFullScreenMode()
{
- return finalMode;
+ return isMode(FULLSCREEN_MODE);
}
/**
@@ -679,18 +956,23 @@
void flushGameBuffer(final int x, final int y, final int width,
final int height)
{
- synchronized(graphicsBuffer)
+ // This is serialized with the
+ // paint callback processing
+ synchronized(flushLock)
{
- ESWTUIThreadRunner.safeSyncExec(new Runnable()
- {
- public void run()
- {
- graphicsBuffer.sync();
- graphicsBuffer.blitToDisplay(null, getContentComp());
- }
- });
+ synchronized(graphicsBuffer)
+ {
+ ESWTUIThreadRunner.safeSyncExec(new Runnable()
+ {
+ public void run()
+ {
+ graphicsBuffer.sync();
+ graphicsBuffer.blitToDisplay(null, getContentComp());
+ }
+ });
+ }
}
- }
+ }
/**
* Called by ShellListener when shell gets activated.
@@ -704,7 +986,7 @@
synchronized(cleanupLock)
{
- cleanupNeeded = true;
+ setMode(CLEANUP_NEEDED, true);
}
LCDUIEvent event = EventDispatcher.instance().newEvent(LCDUIEvent.CANVAS_SHOWNOTIFY, this);
@@ -728,12 +1010,12 @@
{
super.eswtHandleResizeEvent(width, height);
// update new bounds to graphicsBuffer
- // this call must not be synchronized as we
+ // this call must not be synchronized as we
// cannot use locking in UI thread
graphicsBuffer.setControlBounds(getContentComp());
synchronized(cleanupLock)
{
- cleanupNeeded = true;
+ setMode(CLEANUP_NEEDED, true);
}
}
@@ -753,6 +1035,26 @@
}
}
+ private void setMode(final int aMode, boolean value)
+ {
+ synchronized(modeLock)
+ {
+ if(value)
+ {
+ mode |= aMode;
+ }
+ else
+ {
+ mode &= ~aMode;
+ }
+ }
+ }
+
+ private boolean isMode(final int aMode)
+ {
+ return ((mode & aMode) != 0);
+ }
+
/*
* UI thread calls. Paint listener of the eSWT widget.
*/
@@ -761,12 +1063,12 @@
public void paintControl(PaintEvent pe)
{
// Check if we got here from buffer flush
- if(graphicsBuffer.isPaintingActive())
- {
- graphicsBuffer.blitToDisplay(pe.gc.getGCData().internalGc, null);
- }
- else
- {
+ if(graphicsBuffer.isPaintingActive())
+ {
+ graphicsBuffer.blitToDisplay(pe.gc.getGCData().internalGc, null);
+ }
+ else
+ {
// Native toolkit is requesting an update of an area that has
// become invalid. Can't do anything here because the contents
// need to be queried from the MIDlet in another thread by
@@ -784,7 +1086,7 @@
event.height = pe.height;
event.widget = pe.widget;
eventDispatcher.postEvent(event);
- }
+ }
}
}
@@ -834,97 +1136,104 @@
*/
private final void doPaintCallback(final LCDUIEvent event)
{
- // Decide the area going to be painted by the callback.
- final int redrawNowX;
- final int redrawNowY;
- final int redrawNowW;
- final int redrawNowH;
- // Before this thread obtains the repaintLock any repaint() calls
- // will still be adding to the invalid area that is going to be
- // painted by this callback.
- synchronized(repaintLock)
+ synchronized(flushLock)
{
- if(event.type == LCDUIEvent.CANVAS_PAINT_NATIVE_REQUEST)
- {
- // Merge with possibly existing repaint() requests
- invalidate(event.x, event.y, event.width, event.height);
- }
- else
- {
- // Need to add a new event to the queue in subsequent repaint()
- // calls.
- repaintPending = false;
- }
-
- // Store the current area to be painted
- redrawNowX = repaintX1;
- redrawNowY = repaintY1;
- redrawNowW = repaintX2-repaintX1;
- redrawNowH = repaintY2-repaintY1;
-
-
- // After releasing the lock the repaint() calls will start with
- // new invalid area.
- repaintX1 = repaintX2 = repaintY1 = repaintY2 = 0;
-
- // Don't do the callback if there's nothing to paint
- if(!((redrawNowW > 0) && (redrawNowH > 0)))
+ // It's possible that this Canvas is sent to background
+ // right after the visibility is checked here, however
+ // it is okay as in such case we just do one extra paint
+ // callback. The visibility change cannot be synchronized with
+ // this method, since it would expose implementation to deadlock
+ if(!isMode(CURRENTLY_VISIBLE))
{
return;
}
- }
- // Create instance of Graphics if not created yet
- if(canvasGraphics == null)
- {
- ESWTUIThreadRunner.safeSyncExec(new Runnable()
- {
- public void run()
- {
- canvasGraphics = graphicsBuffer.getGraphics();
- canvasGraphics.setSyncStrategy(Graphics.SYNC_LEAVE_SURFACE_SESSION_OPEN);
- }
- });
- }
+ // Decide the area going to be painted by the callback.
+ final int redrawNowX;
+ final int redrawNowY;
+ final int redrawNowW;
+ final int redrawNowH;
+ // Before this thread obtains the repaintLock any repaint() calls
+ // will still be adding to the invalid area that is going to be
+ // painted by this callback.
+ synchronized(repaintLock)
+ {
+ if(event.type == LCDUIEvent.CANVAS_PAINT_NATIVE_REQUEST)
+ {
+ // Merge with possibly existing repaint() requests
+ invalidate(event.x, event.y, event.width, event.height);
+ }
+ else
+ {
+ // Need to add a new event to the queue in subsequent repaint()
+ // calls.
+ setMode(REPAINT_PENDING, false);
+ }
- // Clean the background if dirty, buffer the operations.
- synchronized(cleanupLock)
- {
- if(cleanupNeeded && noBackground)
- {
- // UI thread can change the contentArea object reference at
- // any time. Store the object reference locally to ensure it
- // points to the same rectangle all the time.
- Rectangle contentArea = getContentArea();
+ // Store the current area to be painted
+ redrawNowX = repaintX1;
+ redrawNowY = repaintY1;
+ redrawNowW = repaintX2-repaintX1;
+ redrawNowH = repaintY2-repaintY1;
+
+ // After releasing the lock the repaint() calls will start with
+ // new invalid area.
+ repaintX1 = repaintX2 = repaintY1 = repaintY2 = 0;
+
+ // Don't do the callback if there's nothing to paint
+ if(!((redrawNowW > 0) && (redrawNowH > 0)))
+ {
+ return;
+ }
+ }
- canvasGraphics.setClip(contentArea.x, contentArea.y,
- contentArea.width, contentArea.height);
- canvasGraphics.cleanBackground(contentArea);
- cleanupNeeded = false;
+ // Create instance of Graphics if not created yet
+ if(canvasGraphics == null)
+ {
+ canvasGraphics = graphicsBuffer.getGraphics();
+ canvasGraphics.setSyncStrategy(Graphics.SYNC_LEAVE_SURFACE_SESSION_OPEN);
}
- }
- // Clip must define the invalid area
- canvasGraphics.setClip(redrawNowX, redrawNowY, redrawNowW, redrawNowH);
+ // Clean the background if dirty, buffer the operations.
+ synchronized(cleanupLock)
+ {
+ if(isMode(CLEANUP_NEEDED) && isMode(NO_BACKGROUND))
+ {
+ // UI thread can change the contentArea object reference at
+ // any time. Store the object reference locally to ensure it
+ // points to the same rectangle all the time.
+ Rectangle contentArea = getContentArea();
- // The callback
- paint(canvasGraphics);
+ canvasGraphics.setClip(contentArea.x, contentArea.y,
+ contentArea.width, contentArea.height);
+ canvasGraphics.cleanBackground(contentArea);
+ setMode(CLEANUP_NEEDED, false);
+ }
+ }
- // Blit frame to display
- synchronized(graphicsBuffer)
- {
- ESWTUIThreadRunner.safeSyncExec(new Runnable()
+ // Clip must define the invalid area
+ canvasGraphics.reset();
+ canvasGraphics.setClip(redrawNowX, redrawNowY, redrawNowW, redrawNowH);
+
+ // The callback
+ paint(canvasGraphics);
+
+ // Blit frame to display
+ synchronized(graphicsBuffer)
{
- public void run()
- {
- if(event.widget.isDisposed())
- {
- return;
- }
- graphicsBuffer.sync();
- graphicsBuffer.blitToDisplay(null, event.widget);
- }
- });
+ ESWTUIThreadRunner.safeSyncExec(new Runnable()
+ {
+ public void run()
+ {
+ if(event.widget.isDisposed())
+ {
+ return;
+ }
+ graphicsBuffer.sync();
+ graphicsBuffer.blitToDisplay(null, event.widget);
+ }
+ });
+ }
}
}
@@ -944,11 +1253,11 @@
Logger.method(this, "doKeyPressed", String.valueOf(keyCode));
boolean sendCallback = false;
- if(!(updateGameKeyState(keyCode, true) && suppressGameKeys))
+ if(!(updateGameKeyState(keyCode, true) && isMode(SUPPRESS_GAMEKEYS)))
{
- if((selectionKeyCompatibility == true) && (keyCode == -5))
+ if(isMode(SELECTIONKEY_COMPATIBILITY) && (keyCode == -5))
{
- if(finalMode == true)
+ if(isMode(FULLSCREEN_MODE))
{
if(!((getNumCommands() > 0) && hasCommandListener()))
{
@@ -964,7 +1273,7 @@
sendCallback = true;
}
}
- else if((selectionKeyCompatibility == false) && (keyCode == -5))
+ else if((!isMode(SELECTIONKEY_COMPATIBILITY)) && (keyCode == -5))
{
sendCallback = false;
}
@@ -996,7 +1305,6 @@
}
}
-
/*
* UI thread calls.
*/
@@ -1004,11 +1312,11 @@
{
Logger.method(this, "doKeyReleased", String.valueOf(keyCode));
boolean sendCallback = false;
- if(!(updateGameKeyState(keyCode, true) && suppressGameKeys))
+ if(!(updateGameKeyState(keyCode, true) && isMode(SUPPRESS_GAMEKEYS)))
{
- if((selectionKeyCompatibility == true) && (keyCode == -5))
+ if(isMode(SELECTIONKEY_COMPATIBILITY) && (keyCode == -5))
{
- if(finalMode == true)
+ if(isMode(FULLSCREEN_MODE))
{
if(!((getNumCommands() > 0) && hasCommandListener()))
{
@@ -1024,7 +1332,7 @@
sendCallback = true;
}
}
- else if((selectionKeyCompatibility == false) && (keyCode == -5))
+ else if((!isMode(SELECTIONKEY_COMPATIBILITY)) && (keyCode == -5))
{
sendCallback = false;
}
@@ -1097,10 +1405,10 @@
e.y = event.y;
EventDispatcher.instance().postEvent(e);
- if(!disableTapDetection)
+ if(!isMode(DISABLE_TAPDETECTION))
{
// Supress Drag events
- suppressDragEvent = true;
+ setMode(SUPPRESS_DRAGEVENT, true);
pointerDownX = event.x;
pointerDownY = event.y;
@@ -1116,7 +1424,7 @@
int pointerUpX = event.x;
int pointerUpY = event.y;
- if(!disableTapDetection)
+ if(!isMode(DISABLE_TAPDETECTION))
{
if(timerTask != null)
{
@@ -1126,11 +1434,11 @@
// If Timer not expired and Mouseup is withing rectangle assign
// PointercDown to Pinter Up
- if(suppressDragEvent && checkWithinRect(event.x, event.y))
+ if(isMode(SUPPRESS_DRAGEVENT) && checkWithinRect(event.x, event.y))
{
pointerUpX = pointerDownX;
pointerUpY = pointerDownY;
- suppressDragEvent = false;
+ setMode(SUPPRESS_DRAGEVENT, false);
}
}
@@ -1144,7 +1452,7 @@
public void mouseMove(MouseEvent event)
{
// Check for timeout expiration and if PointerUp falls outside the rectangle
- if(disableTapDetection || (!suppressDragEvent) || !checkWithinRect(event.x, event.y))
+ if(isMode(DISABLE_TAPDETECTION) || (!isMode(SUPPRESS_DRAGEVENT)) || !checkWithinRect(event.x, event.y))
{
LCDUIEvent e = EventDispatcher.instance().newEvent(LCDUIEvent.CANVAS_POINTERDRAGGED,
javax.microedition.lcdui.Canvas.this);
@@ -1243,32 +1551,22 @@
return valid;
}
- /**
- * Disposes this instance
- * Called when finalizer is destroying this instance.
- */
- void dispose()
- {
- super.dispose();
- ESWTUIThreadRunner.safeSyncExec(new Runnable()
- {
- public void run()
- {
- if(graphicsBuffer != null)
- {
- graphicsBuffer.dispose();
- graphicsBuffer = null;
- }
- }
- });
- }
-
class CanvasTimerTask extends TimerTask
{
public void run()
{
- suppressDragEvent = false;
+ setMode(SUPPRESS_DRAGEVENT, false);
+ }
+ }
+
+ class CanvasShellVisibilityListener implements SymbianWindowVisibilityListener
+ {
+ public void handleSymbianWindowVisibilityChange(Widget widget, boolean visible) {
+ if (javax.microedition.lcdui.Canvas.this.getShell() == widget)
+ {
+ graphicsBuffer.getWindowSurface().handleSymbianWindowVisibilityChange(visible);
+ }
}
}
}
diff -r 85266cc22c7f -r 35baca0e7a2e javauis/lcdui_qt/src/javax/microedition/lcdui/Displayable.java
--- a/javauis/lcdui_qt/src/javax/microedition/lcdui/Displayable.java Fri Jun 11 13:33:44 2010 +0300
+++ b/javauis/lcdui_qt/src/javax/microedition/lcdui/Displayable.java Tue Jul 06 20:36:19 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009, 2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -21,11 +21,11 @@
import javax.microedition.lcdui.EventDispatcher.LCDUIEvent;
-import org.eclipse.ercp.swt.mobile.MobileShell;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.*;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.internal.extension.CompositeExtension;
+import org.eclipse.swt.internal.extension.MobileShellExtension;
import org.eclipse.swt.widgets.*;
import com.nokia.mj.impl.rt.support.ApplicationUtils;
import com.nokia.mj.impl.rt.support.ApplicationInfo;
@@ -126,7 +126,7 @@
{
public void run()
{
- shell = eswtConstructShell(SWT.SYSTEM_MODAL);
+ shell = eswtConstructShell(SWT.SHELL_TRIM | SWT.PRIMARY_MODAL);
eswtSetTitle();
contentComp = eswtConstructContent(SWT.NONE);
contentArea = eswtLayoutShellContent();
@@ -166,7 +166,7 @@
*/
Shell eswtConstructShell(int style)
{
- return new MobileShell(ESWTUIThreadRunner.getInstance().getDisplay(), style);
+ return new MobileShellExtension(ESWTUIThreadRunner.getInstance().getDisplay(), style);
}
/**
@@ -191,6 +191,10 @@
if(!shell.isDisposed())
{
eswtUpdateSizes();
+ if(ticker != null)
+ {
+ ticker.start();
+ }
shell.addShellListener(eswtShellListener);
shell.addDisposeListener(eswtDisposeListener);
shell.addControlListener(eswtControlListener);
@@ -343,6 +347,7 @@
if(tickerLabel != null)
{
int tickerHeight = tickerLabel.getBounds().height;
+
contentComp.setBounds(0, tickerHeight,
shellArea.width, shellArea.height - tickerHeight);
}
@@ -620,6 +625,26 @@
}
/**
+ * Gets the commands array.
+ *
+ * @return the commands
+ */
+ Vector getCommands()
+ {
+ return commands;
+ }
+
+ /**
+ * Gets the command listener.
+ *
+ * @return the eswt command listener.
+ */
+ final EswtCommandListener getCommandListener()
+ {
+ return eswtCommandListener;
+ }
+
+ /**
* Gets width.
*
* @return Width of the Displayable in pixels.
@@ -690,10 +715,13 @@
});
if(ticker != null)
{
- // Start to scroll the ticker. Ticker may be already running
- // if it exists in some other displayable already, but
- // calling this again wont do any harm:
- ticker.start();
+ if(isLcduiVisible)
+ {
+ // Start to scroll the ticker. Ticker may be already running
+ // if it exists in some other displayable already, but
+ // calling this again wont do any harm:
+ ticker.start();
+ }
}
}
@@ -746,7 +774,7 @@
/**
* Creates singleton Label instance used by Ticker.
*/
- private Label getTickerLabel()
+ Label getTickerLabel()
{
if(tickerLabel == null)
{
@@ -859,10 +887,14 @@
public void shellActivated(ShellEvent e)
{
- if(!isShellActive)
+ ESWTUIThreadRunner.getInstance().getDisplay()
+ .asyncExec(new Runnable()
{
- handleShellActivatedEvent();
- }
+ public void run()
+ {
+ handleShellActivatedEvent();
+ }
+ });
}
public void shellDeactivated(ShellEvent e)
@@ -907,6 +939,7 @@
*/
class EswtControlListener implements ControlListener
{
+
public void controlResized(ControlEvent e)
{
eswtUpdateSizes();
diff -r 85266cc22c7f -r 35baca0e7a2e javauis/lcdui_qt/src/javax/microedition/lcdui/LCDUIInvokerImpl.java
--- a/javauis/lcdui_qt/src/javax/microedition/lcdui/LCDUIInvokerImpl.java Fri Jun 11 13:33:44 2010 +0300
+++ b/javauis/lcdui_qt/src/javax/microedition/lcdui/LCDUIInvokerImpl.java Tue Jul 06 20:36:19 2010 +0300
@@ -20,7 +20,6 @@
import org.eclipse.swt.internal.qt.graphics.GraphicsContext;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Button;
import com.nokia.mid.ui.DirectGraphics;
import com.nokia.mj.impl.nokialcdui.LCDUIInvoker;
import com.nokia.mj.impl.nokialcdui.ItemControlStateChangeListener;
@@ -30,11 +29,7 @@
private boolean eswtReturn;
- /**
- * Constant for Soft Key Label Height
- */
- public static final int LABEL_HEIGHT = 30;
-
+
static void createInvoker()
{
LCDUIInvoker.setInvoker(
@@ -87,32 +82,7 @@
*/
protected String getSoftKeyLabelLocationImpl(String softKeyId)
{
- String SoftKeyLabelLocation = null;
-
- Displayable disp = javax.microedition.lcdui.Display.getDisplay().getCurrent();
-
- if((disp != null) && (disp instanceof Canvas))
- {
- if(((Canvas) disp).IsFullScreenMode())
- {
-
- if("com.nokia.softkey1.label.location".equals(softKeyId))
- {
- SoftKeyLabelLocation = "0," + String.valueOf(((Canvas) disp).getHeight()) + ","
- + String.valueOf((((Canvas) disp).getWidth())/2) + ","
- + String.valueOf(LABEL_HEIGHT);
- }
- else if("com.nokia.softkey2.label.location".equals(softKeyId))
- {
- SoftKeyLabelLocation = String.valueOf((((Canvas) disp).getWidth())/2) + ","
- + String.valueOf(((Canvas) disp).getHeight()) + ","
- + String.valueOf((((Canvas) disp).getWidth())/2) + ","
- + String.valueOf(LABEL_HEIGHT);
- }
- }
- }
-
- return SoftKeyLabelLocation;
+ return SystemPropertyUtil.getSoftKeyLabelLocationImpl(softKeyId);
}
/*
@@ -122,30 +92,7 @@
*/
protected String getSoftKeyLabelAnchorImpl(String softKeyId)
{
- String SoftKeyLabelAnchor = null;
-
- Displayable disp = javax.microedition.lcdui.Display.getDisplay().getCurrent();
-
- if((disp != null) && (disp instanceof Canvas))
- {
- if(null == ((Canvas) disp).getCanvasKeypad())
- {
- SoftKeyLabelAnchor = String.valueOf(Graphics.TOP | Graphics.HCENTER);
- }
- else
- {
- if("com.nokia.softkey1.label.anchor".equals(softKeyId))
- {
- SoftKeyLabelAnchor = String.valueOf(Graphics.TOP | Graphics.LEFT);
- }
- else if("com.nokia.softkey2.label.anchor".equals(softKeyId))
- {
- SoftKeyLabelAnchor = String.valueOf(Graphics.TOP | Graphics.RIGHT);
- }
- }
- }
-
- return SoftKeyLabelAnchor;
+ return SystemPropertyUtil.getSoftKeyLabelAnchorImpl(softKeyId);
}
protected Display doGetEswtDisplay()
@@ -258,46 +205,7 @@
protected String doGetDynamicProperty(String key)
{
- if("com.nokia.key.scancode".equals(key))
- {
- return String.valueOf(ESWTUIThreadRunner.getLastKeyScancode());
- }
- else if("com.nokia.key.modifier".equals(key))
- {
- return String.valueOf(ESWTUIThreadRunner.getLastKeyModifier());
- }
- else if("com.nokia.keyboard.type".equals(key))
- {
- // TODO: eSWT support required
- /*
- No keypad (for example a touch device without keypad) - None
- Standard ITU-T keypad (Phone keypad with 12 keys) - PhoneKeypad
- QWERTY (4x12 layout) - FullKeyboard
- QWERTY (limited, 4x10 layout) - LimitedKeyboard4x10
- QWERTY (limited, 3x11 layout) - LimitedKeyboard3x11
- Half QWERTY layout (aka Compact QWERTY keyboard). - HalfKeyboard
- Custom QWERTY layout - Custom
- Unknown layout - Unknown
- */
- return "Unknown";
- }
- else if("com.nokia.softkey1.label.location".equals(key))
- {
- return getSoftKeyLabelLocationImpl(key);
- }
- else if("com.nokia.softkey1.label.anchor".equals(key))
- {
- return getSoftKeyLabelAnchorImpl(key);
- }
- else if("com.nokia.softkey2.label.location".equals(key))
- {
- return getSoftKeyLabelLocationImpl(key);
- }
- else if("com.nokia.softkey2.label.anchor".equals(key))
- {
- return getSoftKeyLabelAnchorImpl(key);
- }
- return "key not supported";
+ return SystemPropertyUtil.doGetDynamicProperty(key);
}
protected boolean doDetectCollision(Image image1, int transform1, int p1x, int p1y,
diff -r 85266cc22c7f -r 35baca0e7a2e javauis/lcdui_qt/src/javax/microedition/lcdui/SystemPropertyUtil.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/lcdui_qt/src/javax/microedition/lcdui/SystemPropertyUtil.java Tue Jul 06 20:36:19 2010 +0300
@@ -0,0 +1,159 @@
+/*
+* Copyright (c) 2009,2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+package javax.microedition.lcdui;
+
+import org.eclipse.swt.internal.extension.OS;
+
+final class SystemPropertyUtil {
+
+ /**
+ * Constant for Soft Key Label Height
+ */
+ public static final int LABEL_HEIGHT = 30;
+
+ private static final int HbKeyboardNone = 0x00000000;
+ private static final int HbKeyboard12Key = 0x00000001;
+ private static final int HbKeyboardQwerty = 0x00000001|0x00010000;
+
+ /*
+ * This method checks if the current Displayable exists
+ * If yes, then the current Displayable is asked for the property
+ * If no, the null is returned
+ */
+ final static String getSoftKeyLabelLocationImpl(String softKeyId)
+ {
+ String SoftKeyLabelLocation = null;
+
+ Displayable disp = javax.microedition.lcdui.Display.getDisplay().getCurrent();
+
+ if((disp != null) && (disp instanceof Canvas))
+ {
+ if(((Canvas) disp).IsFullScreenMode())
+ {
+
+ if("com.nokia.softkey1.label.location".equals(softKeyId))
+ {
+ SoftKeyLabelLocation = "0," + String.valueOf(((Canvas) disp).getHeight()) + ","
+ + String.valueOf((((Canvas) disp).getWidth())/2) + ","
+ + String.valueOf(LABEL_HEIGHT);
+ }
+ else if("com.nokia.softkey2.label.location".equals(softKeyId))
+ {
+ SoftKeyLabelLocation = String.valueOf((((Canvas) disp).getWidth())/2) + ","
+ + String.valueOf(((Canvas) disp).getHeight()) + ","
+ + String.valueOf((((Canvas) disp).getWidth())/2) + ","
+ + String.valueOf(LABEL_HEIGHT);
+ }
+ }
+ }
+ return SoftKeyLabelLocation;
+ }
+
+ /*
+ * This method checks if the current Displayable exists
+ * If yes, then the current Displayable is asked for the property
+ * If no, the null is returned
+ */
+ final static String getSoftKeyLabelAnchorImpl(String softKeyId)
+ {
+ String SoftKeyLabelAnchor = null;
+
+ Displayable disp = javax.microedition.lcdui.Display.getDisplay().getCurrent();
+
+ if((disp != null) && (disp instanceof Canvas))
+ {
+ if(null == ((Canvas) disp).getCanvasKeypad())
+ {
+ SoftKeyLabelAnchor = String.valueOf(Graphics.TOP | Graphics.HCENTER);
+ }
+ else
+ {
+ if("com.nokia.softkey1.label.anchor".equals(softKeyId))
+ {
+ SoftKeyLabelAnchor = String.valueOf(Graphics.TOP | Graphics.LEFT);
+ }
+ else if("com.nokia.softkey2.label.anchor".equals(softKeyId))
+ {
+ SoftKeyLabelAnchor = String.valueOf(Graphics.TOP | Graphics.RIGHT);
+ }
+ }
+ }
+
+ return SoftKeyLabelAnchor;
+ }
+
+ final static String doGetDynamicProperty(String key)
+ {
+ if("com.nokia.key.scancode".equals(key))
+ {
+ return String.valueOf(ESWTUIThreadRunner.getLastKeyScancode());
+ }
+ else if("com.nokia.key.modifier".equals(key))
+ {
+ return String.valueOf(ESWTUIThreadRunner.getLastKeyModifier());
+ }
+ else if("com.nokia.keyboard.type".equals(key))
+ {
+ // TODO: eSWT support required
+ /*
+ No keypad (for example a touch device without keypad) - None
+ Standard ITU-T keypad (Phone keypad with 12 keys) - PhoneKeypad
+ QWERTY (4x12 layout) - FullKeyboard
+ QWERTY (limited, 4x10 layout) - LimitedKeyboard4x10
+ QWERTY (limited, 3x11 layout) - LimitedKeyboard3x11
+ Half QWERTY layout (aka Compact QWERTY keyboard). - HalfKeyboard
+ Custom QWERTY layout - Custom
+ Unknown layout - Unknown
+ */
+ String keyBoard="None";
+ int type = OS.HbInputSettingProxy_availableHwKeyboard();
+
+ switch(type){
+ case HbKeyboardNone:
+ keyBoard="None";
+ break;
+ case HbKeyboard12Key:
+ keyBoard="PhoneKeypad";
+ break;
+ case HbKeyboardQwerty:
+ keyBoard="FullKeyboard";
+ break;
+ default:
+ keyBoard = "None";
+ }
+ return keyBoard;
+ }
+ else if("com.nokia.softkey1.label.location".equals(key))
+ {
+ return getSoftKeyLabelLocationImpl(key);
+ }
+ else if("com.nokia.softkey1.label.anchor".equals(key))
+ {
+ return getSoftKeyLabelAnchorImpl(key);
+ }
+ else if("com.nokia.softkey2.label.location".equals(key))
+ {
+ return getSoftKeyLabelLocationImpl(key);
+ }
+ else if("com.nokia.softkey2.label.anchor".equals(key))
+ {
+ return getSoftKeyLabelAnchorImpl(key);
+ }
+ return "key not supported";
+ }
+}
diff -r 85266cc22c7f -r 35baca0e7a2e javauis/mmapi_qt/audiostreaming/inc.emc/cmmaaudiostreammetadatacontrol.h
--- a/javauis/mmapi_qt/audiostreaming/inc.emc/cmmaaudiostreammetadatacontrol.h Fri Jun 11 13:33:44 2010 +0300
+++ b/javauis/mmapi_qt/audiostreaming/inc.emc/cmmaaudiostreammetadatacontrol.h Tue Jul 06 20:36:19 2010 +0300
@@ -20,7 +20,7 @@
#define CMMAAUDIOSTREAMMETADATACONTROL_H
// INCLUDES
-#include
*/
public class StopTimeControl extends ControlImpl implements
- javax.microedition.media.control.StopTimeControl
+ javax.microedition.media.control.StopTimeControl, AnimationObserver
{
private long iStopTime=RESET;
@@ -38,6 +38,7 @@
public StopTimeControl(Player aPlayer)
{
this.iPlayer=aPlayer;
+ ((AnimationPlayer)iPlayer).setiAnimationObserver(this);
}
/**
@@ -101,6 +102,19 @@
"Player is STARTED or setStopTime() is already called successfully");
}
iStopTime = aStopTime;
- ((AnimationPlayer)iPlayer).setiStopTime(iStopTime);
+ //((AnimationPlayer)iPlayer).setiStopTime(iStopTime);
+ }
+
+ /**
+ * Method of AnimationObserver
+ */
+ public void animationAdvanced(long aMediaTime)
+ {
+ if (aMediaTime >= iStopTime)
+ {
+ iStopTime=RESET;
+ ((AnimationPlayer)iPlayer).postEvent(aMediaTime);
+
+ }
}
}
diff -r 85266cc22c7f -r 35baca0e7a2e javauis/mmapi_qt/baseline/javasrc/com/nokia/microedition/media/animation/VideoControl.java
--- a/javauis/mmapi_qt/baseline/javasrc/com/nokia/microedition/media/animation/VideoControl.java Fri Jun 11 13:33:44 2010 +0300
+++ b/javauis/mmapi_qt/baseline/javasrc/com/nokia/microedition/media/animation/VideoControl.java Tue Jul 06 20:36:19 2010 +0300
@@ -96,6 +96,7 @@
// Global??? yes because we need to remove it from player listener, while finalizer will be called
private VideoItem iVideoItem;
+ ESWTinitializeListener iESWTinitializeListener;
/**
* Constructor of VideoControl
@@ -104,6 +105,7 @@
public VideoControl(Player player)
{
this.iPlayer=player;
+ iESWTinitializeListener=(AnimationPlayer)iPlayer;
}
/**
*
@@ -226,16 +228,23 @@
throw new IllegalStateException(
"VideoControl.initDisplayMode() not called yet");
}
- Image image=((AnimationPlayer)iPlayer).getCurrentFrame(aImageType);
- byte bytArry[]= null;//getByteArray(image);
- // TODO Enable the permission check
- // Commented out below line, because I was getting exception
- // Check the permission here, so 'the moment' is not lost?
- //Security.ensurePermission(PERMISSION, PERMISSION, PERM_ARGS);
+ String supportedFormat=System.getProperty("video.snapshot.encodings");
+ if (aImageType==null)
+ {
+ aImageType=supportedFormat.substring(0, supportedFormat.indexOf(' '));
+ }
+ else if (supportedFormat.indexOf(aImageType)==-1)
+ {
+ throw new MediaException("Unsupported image type: " + aImageType);
+ }
+ byte data[]=((AnimationPlayer)iPlayer).getCurrentFrame(aImageType);
+ //TODO before returning the check permissions here
+ // we are making late check here, so that moment should not be lost.
+
// ApplicationUtils appUtils = ApplicationUtils.getInstance();
// PlayerPermission per = new PlayerPermission("audio/video recording","snapshot");
// appUtils.checkPermission(per);
- return bytArry;
+ return data;
}
/**
@@ -287,11 +296,13 @@
// Following line will return the same Display object
// Which is created in Midlet
iDisplay =Display.getDefault();
+ iESWTinitializeListener.notifyDisplayAvailable(iDisplay);
}
else
{
// Get the Display object of ESWT
iDisplay = com.nokia.mj.impl.nokialcdui.LCDUIInvoker.getEswtDisplay();
+ iESWTinitializeListener.notifyDisplayAvailable(iDisplay);
}
if (aMode == USE_GUI_PRIMITIVE)
{
@@ -312,6 +323,7 @@
// Since it is eswtControl itself so no need of LCDUIInvoker here
// assign it in iControl and return immediately from here
iControl=(Control)guiObject;
+ iESWTinitializeListener.notifyControlAvailable(iControl);
// Now we will change the status, when MIDlet developer will call the setParent
iStatus = USE_GUI_PRIMITIVE;
return iControl;
@@ -348,7 +360,8 @@
}
iControl = com.nokia.mj.impl.nokialcdui.LCDUIInvoker
.getEswtControl(aArg);
-
+ //in this case Control will be provided immediately
+ iESWTinitializeListener.notifyControlAvailable(iControl);
//If USE_DIRECT_VIDEO is set, the video by default is not
//shown when the canvas is displayed until setVisible(true) is called
//iIsControlVisible variable of AnimationPlayer class decides, whether
@@ -372,12 +385,9 @@
*/
private Object initLCDUI()
{
- final String DEBUG_STR="VideoControl::initLCDUI()";
- Logger.LOG(Logger.EJavaMMAPI, Logger.EInfo,DEBUG_STR+"+");
iVideoItem = new VideoItem(((AnimationPlayer)iPlayer).getImageDimension());
iPlayer.addPlayerListener(iVideoItem);
iStatus = USE_GUI_PRIMITIVE;
- Logger.LOG(Logger.EJavaMMAPI, Logger.EInfo,DEBUG_STR+"-");
return iVideoItem;
}
@@ -518,6 +528,7 @@
"VideoControl.initDisplayMode() not called yet");
}
//if this is in case of form, return silently
+ // No need to display the CustomItem in full screen mode
//This is as per earlier NOKIA implementation,
if (iVideoItem!=null)
{
@@ -554,13 +565,22 @@
*/
public void setDisplayLocation(int aX, int aY)
{
+ if (iStatus == USE_GUI_PRIMITIVE)
+ {
+ // In USE_GUI_PRIMITIVE mode, this call will be ignored.
+ return;
+ }
+ if (iStatus != USE_DIRECT_VIDEO)
+ {
+ // This method only works when the USE_DIRECT_VIDEO mode is set.
+ throw new IllegalStateException();
+ }
// Need to ignore this call in case of USE_GUI_PRIMITIVE
// in case of customItem, we are getting canvasExtension as control
// and in this case we need to ignore the setDisplayLocation call.
// it is also possible that iControl may be null( it will be null until and unless
// notifyControlAvailable function is not get called)
- System.out.println("VideoControl::setDisplayLocation() curretn status is "+iStatus);
- if (iControl==null || (iControl instanceof org.eclipse.swt.internal.extension.CanvasExtension))
+ if (iControl==null)// || (iControl instanceof org.eclipse.swt.internal.extension.CanvasExtension))
return ;
((AnimationPlayer)iPlayer).setDisplayLocation(aX, aY);
}
@@ -632,20 +652,20 @@
/**
*
* @return Display object retrieved from ESWT
- */
- Display getiDisplay()
- {
- return iDisplay;
- }
+ // */
+// Display getiDisplay()
+// {
+// return iDisplay;
+// }
/**
*
* @return
*/
- Control getControl()
- {
- return iControl;
- }
+// Control getControl()
+// {
+// return iControl;
+// }
/**
* Function of ItemStateChangeListener
* Notified by LCDUI implementation
@@ -656,11 +676,8 @@
{
final String DEBUG_STR= "VideoControl::notifyControlAvailable(Control ctrl,Item item)";
iControl=ctrl;
+ iESWTinitializeListener.notifyControlAvailable(iControl);
Logger.LOG(Logger.EJavaMMAPI, Logger.EInfo, DEBUG_STR+"Control is "+ctrl.hashCode()+ " Item is "+item);
- //TODO is it proper here to put the below line in try/catch?, remove if we can.
- // Otherwise it may deteriorate the performance, as in case of CustomItem on each
- // repaint, eSWT control is getting destroyed, and reconstructed
- ((AnimationPlayer)iPlayer).addPaintListener(iControl);
}
/**
* Function of ItemStateChangeListener
diff -r 85266cc22c7f -r 35baca0e7a2e javauis/mmapi_qt/baseline/javasrc/com/nokia/microedition/media/animation/VideoItem.java
--- a/javauis/mmapi_qt/baseline/javasrc/com/nokia/microedition/media/animation/VideoItem.java Fri Jun 11 13:33:44 2010 +0300
+++ b/javauis/mmapi_qt/baseline/javasrc/com/nokia/microedition/media/animation/VideoItem.java Tue Jul 06 20:36:19 2010 +0300
@@ -96,16 +96,16 @@
/**
* This is dummy implementation of the paint method.
*/
- int count;
+// int count;
protected void paint(Graphics g, int w, int h)
{
//TODO remove this code later
// this is added just for testing purpose
- System.out.println("VideoItem::paint()");
- g.setColor(0x00a000);
- g.fillRect(0,0,w,h);
- g.setColor(0xFFFFFF);
- g.drawString("paint"+(count++), w>>1, h>>1, Graphics.BASELINE|Graphics.HCENTER);
+// System.out.println("VideoItem::paint()");
+// g.setColor(0x00a000);
+// g.fillRect(0,0,w,h);
+// g.setColor(0xFFFFFF);
+// g.drawString("paint"+(count++), w>>1, h>>1, Graphics.BASELINE|Graphics.HCENTER);
}
/**
diff -r 85266cc22c7f -r 35baca0e7a2e javauis/mmapi_qt/baseline/javasrc/org/eclipse/swt/widgets/ProxyControl.java
--- a/javauis/mmapi_qt/baseline/javasrc/org/eclipse/swt/widgets/ProxyControl.java Fri Jun 11 13:33:44 2010 +0300
+++ b/javauis/mmapi_qt/baseline/javasrc/org/eclipse/swt/widgets/ProxyControl.java Tue Jul 06 20:36:19 2010 +0300
@@ -11,7 +11,7 @@
*
* Contributors:
*
-* Description:
+* Description: ProxyControl
*
*/
package org.eclipse.swt.widgets;
@@ -31,43 +31,45 @@
/**
* A Proxy Class for eSWT control.
- *
+ *
* Since re-parenting is not supported, thats why this class were needed.
* When user will call the setParent function of Control(means this class), this class will create
- * the actual Control, for which it will be acting like a proxy. All further call to any function of
- * this class will be delegated to the Control object, created in the setParent method.
- *
- * @author d35kumar
+ * the actual Control, for which it will be acting like a proxy. All further call to any function of
+ * this class will be delegated to the Control object, created in the setParent method.
+ *
*/
-public class ProxyControl extends Control {
+public class ProxyControl extends Control
+{
+
+ /**
+ * this is actual Control(Shell), for which this class is acting like proxy
+ */
+ Control iControl;
+
+ /**
+ * Dimesion of this shell needs to be set
+ */
+ Point iDimension;
- /**
- * this is actual Control(Shell), for which this class is acting like proxy
- */
- Control iControl;
-
- /**
- * Dimesion of this shell needs to be set
- */
- Point iDimension;
-
- /**
- * @param aDimension Dimension to be set for the control class
- */
- public ProxyControl(Point aDimension) {
- iDimension=aDimension;
- }
-
- /**
- * Creates the actual control
- * @return true if it returns properly,
- * or false if any exception is thrown during the execution of this function
- */
- public boolean setParent(Composite aParent){
- if (aParent == null)
+ /**
+ * @param aDimension Dimension to be set for the control class
+ */
+ public ProxyControl(Point aDimension)
+ {
+ iDimension=aDimension;
+ }
+
+ /**
+ * Creates the actual control
+ * @return true if it returns properly,
+ * or false if any exception is thrown during the execution of this function
+ */
+ public boolean setParent(Composite aParent)
+ {
+ if (aParent == null)
{
- SWT.error(SWT.ERROR_NULL_ARGUMENT);
- return false;
+ SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ return false;
}
if (aParent.isDisposed())
{
@@ -78,278 +80,348 @@
// {
// return true;
// }
- iControl= new Shell((Shell)aParent);
- ((Shell)iControl).open();
- iControl.setSize(iDimension);
- return true;
- }
-
- /**
- * Passes the call to iControl, if it is not null, otherwise return silently
- */
- public void addControlListener(ControlListener aListener){
- if(iControl!=null){
- iControl.addControlListener(aListener);
- }
- }
- /**
- *
- */
- public void addFocusListener(FocusListener listener){
- if(iControl!=null)iControl.addFocusListener(listener);
- }
- /**
- *
- */
- public void addKeyListener(KeyListener listener){
- if(iControl!=null)iControl.addKeyListener(listener);
- }
- public void addMouseListener(MouseListener listener){
- if(iControl!=null)iControl.addMouseListener(listener);
- }
- public void addMouseMoveListener(MouseMoveListener listener){
- if(iControl!=null)iControl.addMouseMoveListener(listener);
- }
- /**
- *
- */
- public void addPaintListener(PaintListener aListener){
- if(iControl!=null)iControl.addPaintListener(aListener);
-
- }
-
- public void addTraverseListener(TraverseListener listener){
- if(iControl!=null)iControl.addTraverseListener(listener);
- }
- public Point computeSize(int wHint,
- int hHint){
- Point point=null;
- if(iControl!=null)point=iControl.computeSize(wHint, hHint);
- return point;
- }
-
- public Point computeSize(int wHint,
- int hHint,
- boolean changed){
- Point point=null;
- if(iControl!=null)point=iControl.computeSize(wHint, hHint,changed);
- return point;
- }
-
- public Color getBackground(){
- Color color=null;
- if(iControl!=null)color=iControl.getBackground();
- return color;
- }
- public int getBorderWidth(){
- if(iControl!=null)return iControl.getBorderWidth();
- else return 0;
- }
- public Rectangle getBounds(){
- if(iControl!=null) return iControl.getBounds();
- else return null;
- }
- public boolean getEnabled(){
- if(iControl!=null) return iControl.getEnabled();
- else return false;
- }
- public Font getFont(){
- if(iControl!=null)return iControl.getFont();
- else return null;
- }
- public Color getForeground(){
- if(iControl!=null) return iControl.getForeground();
- else return null;
- }
-
- public java.lang.Object getLayoutData(){
- if(iControl!=null) return iControl.getLayoutData();
- else return null;
- }
-
- public Point getLocation(){
- if(iControl!=null) return iControl.getLocation();
- else return null;
- }
-
- public Menu getMenu(){
- if(iControl!=null) return iControl.getMenu();
- else return null;
- }
- public Composite getParent(){
- if(iControl!=null) return iControl.getParent();
- else return null;
- }
- public Shell getShell(){
- if(iControl!=null) return (Shell)iControl;
- else return null;
- }
- public Point getSize(){
- if(iControl!=null) return iControl.getSize();
- else return null;
- }
-
- public java.lang.String getToolTipText(){
- if(iControl!=null) return iControl.getToolTipText();
- else return null;
- }
- public boolean getVisible(){
- if(iControl!=null) return iControl.getVisible();
- else return false;
- }
- public boolean isEnabled(){
- if(iControl!=null) return iControl.isEnabled();
- else return false;
- }
-
- public boolean isFocusControl(){
- if(iControl!=null) return iControl.isFocusControl();
- else return false;
- }
- public boolean isReparentable(){
- if(iControl!=null) return iControl.isReparentable();
- else return false;
- }
-
- public boolean isVisible(){
- if(iControl!=null)return iControl.isVisible();
- else return false;
- }
- public void moveAbove(Control control){
- if(iControl!=null) iControl.moveAbove(control);
- }
- public void moveBelow(Control control){
- if(iControl!=null) iControl.moveBelow(control);
- }
- public void pack(){
- if(iControl!=null) iControl.pack();
- }
- public void pack(boolean changed){
- if(iControl!=null) iControl.pack(changed);
- }
- public void redraw(){
- if(iControl!=null) iControl.redraw();
- }
- public void redraw(int x,
- int y,
- int width,
- int height,
- boolean all){
- if(iControl!=null) iControl.redraw(x,y,width,height, all);
- }
- public void removeControlListener(ControlListener listener){
- if(iControl!=null) iControl.removeControlListener(listener);
- }
- public void removeFocusListener(FocusListener listener){
- if(iControl!=null) iControl.removeFocusListener(listener);
- }
- public void removeMouseListener(MouseListener listener){
- if(iControl!=null) iControl.removeMouseListener(listener);
- }
- public void removeMouseMoveListener(MouseMoveListener listener){
- if(iControl!=null) iControl.removeMouseMoveListener(listener);
- }
- public void removePaintListener(PaintListener listener){
- if(iControl!=null)iControl.removePaintListener(listener);
- }
- public void removeTraverseListener(TraverseListener listener){
- if(iControl!=null)iControl.removeTraverseListener(listener);
- }
- public void setBounds(int x,
- int y,
- int width,
- int height){
- if(iControl!=null)iControl.setBounds(x, y, width, height);
- }
- public void setBounds(Rectangle rect){
- if(iControl!=null)iControl.setBounds(rect);
- }
- public void setCapture(boolean capture){
- if(iControl!=null)iControl.setCapture(capture);
- }
- public void setEnabled(boolean enabled){
- if(iControl!=null)iControl.setEnabled(enabled);
- }
- public boolean setFocus(){
- if(iControl!=null) return iControl.setFocus();
- else return false;
- }
- public void setFont(Font font){
- if(iControl!=null)iControl.setFont(font);
- }
- public void setForeground(Color color){
- if(iControl!=null)iControl.setForeground(color);
- }
- public void setLayoutData(java.lang.Object layoutData){
- if(iControl!=null)iControl.setLayoutData(layoutData);
- }
- public void setLocation(int x,
- int y){
- if(iControl!=null)iControl.setLocation(x, y);
- }
-
- public void setLocation(Point location){
- if(iControl!=null)iControl.setLocation(location);
- }
- public void setMenu(Menu menu){
- if(iControl!=null)iControl.setMenu(menu);
- }
- public void setRedraw(boolean redraw){
- if(iControl!=null)iControl.setRedraw(redraw);
- }
- public void setSize(int width,
- int height){
- if(iControl!=null) iControl.setSize(width, height);
- }
-
- public void setSize(Point size){
- if(iControl!=null) iControl.setSize(size);
- }
- public void setToolTipText(java.lang.String string){
- if(iControl!=null)iControl.setToolTipText(string);
- }
- public void setVisible(boolean visible){
- if(iControl!=null)iControl.setVisible(visible);
- }
- public Point toControl(int x,
- int y){
- if(iControl!=null)return iControl.toControl(x, y);
- else return null;
- }
- public Point toControl(Point point){
- if(iControl!=null) return iControl.toControl(point);
- else return null;
- }
- public Point toDisplay(int x,
- int y){
- if(iControl!=null)return iControl.toDisplay(x,y);
- else return null;
- }
- public Point toDisplay(Point point){
- if(iControl!=null)return iControl.toDisplay(point);
- else return null;
- }
- public boolean traverse(int traversal){
- if(iControl!=null)return iControl.traverse(traversal);
- else return false;
- }
- public void update(){
- if(iControl!=null)iControl.update();
- }
-
- public void checkSubclass() {
- // do nothing,sub-classing allowed
- }
-
- /**
- * Used in toString function
- * @return class name with full path
- */
- String getNameText () {
- return "org.eclipse.swt.widgets.ProxyControl";
- }
- public String toString(){
- return "org.eclipse.swt.widgets.ProxyControl";
- }
+ iControl= new Shell((Shell)aParent);
+ ((Shell)iControl).open();
+ iControl.setSize(iDimension);
+ return true;
+ }
+
+ /**
+ * Passes the call to iControl, if it is not null, otherwise return silently
+ */
+ public void addControlListener(ControlListener aListener)
+ {
+ if (iControl!=null)
+ {
+ iControl.addControlListener(aListener);
+ }
+ }
+ /**
+ *
+ */
+ public void addFocusListener(FocusListener listener)
+ {
+ if (iControl!=null)iControl.addFocusListener(listener);
+ }
+ /**
+ *
+ */
+ public void addKeyListener(KeyListener listener)
+ {
+ if (iControl!=null)iControl.addKeyListener(listener);
+ }
+ public void addMouseListener(MouseListener listener)
+ {
+ if (iControl!=null)iControl.addMouseListener(listener);
+ }
+ public void addMouseMoveListener(MouseMoveListener listener)
+ {
+ if (iControl!=null)iControl.addMouseMoveListener(listener);
+ }
+ /**
+ *
+ */
+ public void addPaintListener(PaintListener aListener)
+ {
+ if (iControl!=null)iControl.addPaintListener(aListener);
+
+ }
+
+ public void addTraverseListener(TraverseListener listener)
+ {
+ if (iControl!=null)iControl.addTraverseListener(listener);
+ }
+ public Point computeSize(int wHint,
+ int hHint)
+ {
+ Point point=null;
+ if (iControl!=null)point=iControl.computeSize(wHint, hHint);
+ return point;
+ }
+
+ public Point computeSize(int wHint,
+ int hHint,
+ boolean changed)
+ {
+ Point point=null;
+ if (iControl!=null)point=iControl.computeSize(wHint, hHint,changed);
+ return point;
+ }
+
+ public Color getBackground()
+ {
+ Color color=null;
+ if (iControl!=null)color=iControl.getBackground();
+ return color;
+ }
+ public int getBorderWidth()
+ {
+ if (iControl!=null)return iControl.getBorderWidth();
+ else return 0;
+ }
+ public Rectangle getBounds()
+ {
+ if (iControl!=null) return iControl.getBounds();
+ else return null;
+ }
+ public boolean getEnabled()
+ {
+ if (iControl!=null) return iControl.getEnabled();
+ else return false;
+ }
+ public Font getFont()
+ {
+ if (iControl!=null)return iControl.getFont();
+ else return null;
+ }
+ public Color getForeground()
+ {
+ if (iControl!=null) return iControl.getForeground();
+ else return null;
+ }
+
+ public java.lang.Object getLayoutData()
+ {
+ if (iControl!=null) return iControl.getLayoutData();
+ else return null;
+ }
+
+ public Point getLocation()
+ {
+ if (iControl!=null) return iControl.getLocation();
+ else return null;
+ }
+
+ public Menu getMenu()
+ {
+ if (iControl!=null) return iControl.getMenu();
+ else return null;
+ }
+ public Composite getParent()
+ {
+ if (iControl!=null) return iControl.getParent();
+ else return null;
+ }
+ public Shell getShell()
+ {
+ if (iControl!=null) return (Shell)iControl;
+ else return null;
+ }
+ public Point getSize()
+ {
+ if (iControl!=null) return iControl.getSize();
+ else return null;
+ }
+
+ public java.lang.String getToolTipText()
+ {
+ if (iControl!=null) return iControl.getToolTipText();
+ else return null;
+ }
+ public boolean getVisible()
+ {
+ if (iControl!=null) return iControl.getVisible();
+ else return false;
+ }
+ public boolean isEnabled()
+ {
+ if (iControl!=null) return iControl.isEnabled();
+ else return false;
+ }
+
+ public boolean isFocusControl()
+ {
+ if (iControl!=null) return iControl.isFocusControl();
+ else return false;
+ }
+ public boolean isReparentable()
+ {
+ if (iControl!=null) return iControl.isReparentable();
+ else return false;
+ }
+
+ public boolean isVisible()
+ {
+ if (iControl!=null)return iControl.isVisible();
+ else return false;
+ }
+ public void moveAbove(Control control)
+ {
+ if (iControl!=null) iControl.moveAbove(control);
+ }
+ public void moveBelow(Control control)
+ {
+ if (iControl!=null) iControl.moveBelow(control);
+ }
+ public void pack()
+ {
+ if (iControl!=null) iControl.pack();
+ }
+ public void pack(boolean changed)
+ {
+ if (iControl!=null) iControl.pack(changed);
+ }
+ public void redraw()
+ {
+ if (iControl!=null) iControl.redraw();
+ }
+ public void redraw(int x,
+ int y,
+ int width,
+ int height,
+ boolean all)
+ {
+ if (iControl!=null) iControl.redraw(x,y,width,height, all);
+ }
+ public void removeControlListener(ControlListener listener)
+ {
+ if (iControl!=null) iControl.removeControlListener(listener);
+ }
+ public void removeFocusListener(FocusListener listener)
+ {
+ if (iControl!=null) iControl.removeFocusListener(listener);
+ }
+ public void removeMouseListener(MouseListener listener)
+ {
+ if (iControl!=null) iControl.removeMouseListener(listener);
+ }
+ public void removeMouseMoveListener(MouseMoveListener listener)
+ {
+ if (iControl!=null) iControl.removeMouseMoveListener(listener);
+ }
+ public void removePaintListener(PaintListener listener)
+ {
+ if (iControl!=null)iControl.removePaintListener(listener);
+ }
+ public void removeTraverseListener(TraverseListener listener)
+ {
+ if (iControl!=null)iControl.removeTraverseListener(listener);
+ }
+ public void setBounds(int x,
+ int y,
+ int width,
+ int height)
+ {
+ if (iControl!=null)iControl.setBounds(x, y, width, height);
+ }
+ public void setBounds(Rectangle rect)
+ {
+ if (iControl!=null)iControl.setBounds(rect);
+ }
+ public void setCapture(boolean capture)
+ {
+ if (iControl!=null)iControl.setCapture(capture);
+ }
+ public void setEnabled(boolean enabled)
+ {
+ if (iControl!=null)iControl.setEnabled(enabled);
+ }
+ public boolean setFocus()
+ {
+ if (iControl!=null) return iControl.setFocus();
+ else return false;
+ }
+ public void setFont(Font font)
+ {
+ if (iControl!=null)iControl.setFont(font);
+ }
+ public void setForeground(Color color)
+ {
+ if (iControl!=null)iControl.setForeground(color);
+ }
+ public void setLayoutData(java.lang.Object layoutData)
+ {
+ if (iControl!=null)iControl.setLayoutData(layoutData);
+ }
+ public void setLocation(int x,
+ int y)
+ {
+ if (iControl!=null)iControl.setLocation(x, y);
+ }
+
+ public void setLocation(Point location)
+ {
+ if (iControl!=null)iControl.setLocation(location);
+ }
+ public void setMenu(Menu menu)
+ {
+ if (iControl!=null)iControl.setMenu(menu);
+ }
+ public void setRedraw(boolean redraw)
+ {
+ if (iControl!=null)iControl.setRedraw(redraw);
+ }
+ public void setSize(int width,
+ int height)
+ {
+ if (iControl!=null) iControl.setSize(width, height);
+ }
+
+ public void setSize(Point size)
+ {
+ if (iControl!=null) iControl.setSize(size);
+ }
+ public void setToolTipText(java.lang.String string)
+ {
+ if (iControl!=null)iControl.setToolTipText(string);
+ }
+ public void setVisible(boolean visible)
+ {
+ if (iControl!=null)iControl.setVisible(visible);
+ }
+ public Point toControl(int x,
+ int y)
+ {
+ if (iControl!=null)return iControl.toControl(x, y);
+ else return null;
+ }
+ public Point toControl(Point point)
+ {
+ if (iControl!=null) return iControl.toControl(point);
+ else return null;
+ }
+ public Point toDisplay(int x,
+ int y)
+ {
+ if (iControl!=null)return iControl.toDisplay(x,y);
+ else return null;
+ }
+ public Point toDisplay(Point point)
+ {
+ if (iControl!=null)return iControl.toDisplay(point);
+ else return null;
+ }
+ public boolean traverse(int traversal)
+ {
+ if (iControl!=null)return iControl.traverse(traversal);
+ else return false;
+ }
+ public void update()
+ {
+ if (iControl!=null)iControl.update();
+ }
+
+ public void checkSubclass()
+ {
+ // do nothing,sub-classing allowed
+ }
+
+ protected void internal_createHandle()
+ {
+ // TODO Auto-generated method stub
+
+ }
+ /**
+ * Used in toString function
+ * @return class name with full path
+ */
+ String getNameText()
+ {
+ return "org.eclipse.swt.widgets.ProxyControl";
+ }
+ public String toString()
+ {
+ return "org.eclipse.swt.widgets.ProxyControl";
+ }
}
diff -r 85266cc22c7f -r 35baca0e7a2e javauis/mmapi_qt/baseline/src.nga/cmmasurfacewindow.cpp
--- a/javauis/mmapi_qt/baseline/src.nga/cmmasurfacewindow.cpp Fri Jun 11 13:33:44 2010 +0300
+++ b/javauis/mmapi_qt/baseline/src.nga/cmmasurfacewindow.cpp Tue Jul 06 20:36:19 2010 +0300
@@ -18,7 +18,7 @@
// Include Files
#include