Skip to content

Commit

Permalink
Rhodes Emulator merge (from win32-emulator branch)
Browse files Browse the repository at this point in the history
  • Loading branch information
timashev committed Apr 22, 2011
1 parent 33a4cae commit 7cace33
Show file tree
Hide file tree
Showing 28 changed files with 4,117 additions and 143 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -150,3 +150,4 @@ xcuserdata

Manifest.java

platform/wm/rhodes/emulator/GeneratedFiles/*
50 changes: 26 additions & 24 deletions platform/wm/RhoLib/RhoLib.vcproj
Expand Up @@ -176,8 +176,8 @@
</Configuration>
<Configuration
Name="Debug|Pocket PC 2003 (ARMV4)"
OutputDirectory="Pocket PC 2003 (ARMV4)\$(ConfigurationName)"
IntermediateDirectory="Pocket PC 2003 (ARMV4)\$(ConfigurationName)"
OutputDirectory="..\bin\$(PlatformName)\$(ProjectName)\$(ConfigurationName)"
IntermediateDirectory="..\bin\$(PlatformName)\$(ProjectName)\$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="1"
>
Expand Down Expand Up @@ -252,8 +252,8 @@
</Configuration>
<Configuration
Name="Debug|Smartphone 2003 (ARMV4)"
OutputDirectory="Smartphone 2003 (ARMV4)\$(ConfigurationName)"
IntermediateDirectory="Smartphone 2003 (ARMV4)\$(ConfigurationName)"
OutputDirectory="..\bin\$(PlatformName)\$(ProjectName)\$(ConfigurationName)"
IntermediateDirectory="..\bin\$(PlatformName)\$(ProjectName)\$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="1"
>
Expand Down Expand Up @@ -467,8 +467,8 @@
</Configuration>
<Configuration
Name="Release|Pocket PC 2003 (ARMV4)"
OutputDirectory="Pocket PC 2003 (ARMV4)\$(ConfigurationName)"
IntermediateDirectory="Pocket PC 2003 (ARMV4)\$(ConfigurationName)"
OutputDirectory="..\bin\$(PlatformName)\$(ProjectName)\$(ConfigurationName)"
IntermediateDirectory="..\bin\$(PlatformName)\$(ProjectName)\$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="1"
>
Expand Down Expand Up @@ -542,8 +542,8 @@
</Configuration>
<Configuration
Name="Release|Smartphone 2003 (ARMV4)"
OutputDirectory="Smartphone 2003 (ARMV4)\$(ConfigurationName)"
IntermediateDirectory="Smartphone 2003 (ARMV4)\$(ConfigurationName)"
OutputDirectory="..\bin\$(PlatformName)\$(ProjectName)\$(ConfigurationName)"
IntermediateDirectory="..\bin\$(PlatformName)\$(ProjectName)\$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="1"
>
Expand Down Expand Up @@ -617,8 +617,8 @@
</Configuration>
<Configuration
Name="EmulatorDebug|Windows Mobile 6 Professional SDK (ARMV4I)"
OutputDirectory="Windows Mobile 6 Professional SDK (ARMV4I)\$(ConfigurationName)"
IntermediateDirectory="Windows Mobile 6 Professional SDK (ARMV4I)\$(ConfigurationName)"
OutputDirectory="..\bin\$(PlatformName)\$(ProjectName)\$(ConfigurationName)"
IntermediateDirectory="..\bin\$(PlatformName)\$(ProjectName)\$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="1"
>
Expand Down Expand Up @@ -693,8 +693,8 @@
</Configuration>
<Configuration
Name="EmulatorDebug|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
OutputDirectory="..\bin\$(PlatformName)\$(ProjectName)\$(ConfigurationName)"
IntermediateDirectory="..\bin\$(PlatformName)\$(ProjectName)\$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="1"
>
Expand All @@ -720,6 +720,7 @@
PreprocessorDefinitions="_DEBUG;DEBUG;WIN32;_WINDOWS"
MinimalRebuild="true"
RuntimeLibrary="1"
TreatWChar_tAsBuiltInType="false"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="3"
Expand Down Expand Up @@ -759,8 +760,8 @@
</Configuration>
<Configuration
Name="EmulatorDebug|Pocket PC 2003 (ARMV4)"
OutputDirectory="Pocket PC 2003 (ARMV4)\$(ConfigurationName)"
IntermediateDirectory="Pocket PC 2003 (ARMV4)\$(ConfigurationName)"
OutputDirectory="..\bin\$(PlatformName)\$(ProjectName)\$(ConfigurationName)"
IntermediateDirectory="..\bin\$(PlatformName)\$(ProjectName)\$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="1"
>
Expand Down Expand Up @@ -835,8 +836,8 @@
</Configuration>
<Configuration
Name="EmulatorDebug|Smartphone 2003 (ARMV4)"
OutputDirectory="Smartphone 2003 (ARMV4)\$(ConfigurationName)"
IntermediateDirectory="Smartphone 2003 (ARMV4)\$(ConfigurationName)"
OutputDirectory="..\bin\$(PlatformName)\$(ProjectName)\$(ConfigurationName)"
IntermediateDirectory="..\bin\$(PlatformName)\$(ProjectName)\$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="1"
>
Expand Down Expand Up @@ -911,8 +912,8 @@
</Configuration>
<Configuration
Name="EmulatorRelease|Windows Mobile 6 Professional SDK (ARMV4I)"
OutputDirectory="Windows Mobile 6 Professional SDK (ARMV4I)\$(ConfigurationName)"
IntermediateDirectory="Windows Mobile 6 Professional SDK (ARMV4I)\$(ConfigurationName)"
OutputDirectory="..\bin\$(PlatformName)\$(ProjectName)\$(ConfigurationName)"
IntermediateDirectory="..\bin\$(PlatformName)\$(ProjectName)\$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="1"
>
Expand Down Expand Up @@ -986,8 +987,8 @@
</Configuration>
<Configuration
Name="EmulatorRelease|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
OutputDirectory="..\bin\$(PlatformName)\$(ProjectName)\$(ConfigurationName)"
IntermediateDirectory="..\bin\$(PlatformName)\$(ProjectName)\$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="1"
>
Expand All @@ -1012,6 +1013,7 @@
AdditionalIncludeDirectories="../../shared/ruby;../../shared"
PreprocessorDefinitions="_NDEBUG;NDEBUG;WIN32;_WINDOWS"
RuntimeLibrary="0"
TreatWChar_tAsBuiltInType="false"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="3"
Expand Down Expand Up @@ -1051,8 +1053,8 @@
</Configuration>
<Configuration
Name="EmulatorRelease|Pocket PC 2003 (ARMV4)"
OutputDirectory="Pocket PC 2003 (ARMV4)\$(ConfigurationName)"
IntermediateDirectory="Pocket PC 2003 (ARMV4)\$(ConfigurationName)"
OutputDirectory="..\bin\$(PlatformName)\$(ProjectName)\$(ConfigurationName)"
IntermediateDirectory="..\bin\$(PlatformName)\$(ProjectName)\$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="1"
>
Expand Down Expand Up @@ -1126,8 +1128,8 @@
</Configuration>
<Configuration
Name="EmulatorRelease|Smartphone 2003 (ARMV4)"
OutputDirectory="Smartphone 2003 (ARMV4)\$(ConfigurationName)"
IntermediateDirectory="Smartphone 2003 (ARMV4)\$(ConfigurationName)"
OutputDirectory="..\bin\$(PlatformName)\$(ProjectName)\$(ConfigurationName)"
IntermediateDirectory="..\bin\$(PlatformName)\$(ProjectName)\$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="1"
>
Expand Down
5 changes: 5 additions & 0 deletions platform/wm/rhodes.sln
Expand Up @@ -97,6 +97,7 @@ Global
{95D5D2E5-FEF5-4CA9-88CF-FCB0F7465E62}.EmulatorRelease|Smartphone 2003 (ARMV4).ActiveCfg = EmulatorRelease|Smartphone 2003 (ARMV4)
{95D5D2E5-FEF5-4CA9-88CF-FCB0F7465E62}.EmulatorRelease|Smartphone 2003 (ARMV4).Deploy.0 = EmulatorRelease|Smartphone 2003 (ARMV4)
{95D5D2E5-FEF5-4CA9-88CF-FCB0F7465E62}.EmulatorRelease|Win32.ActiveCfg = EmulatorRelease|Win32
{95D5D2E5-FEF5-4CA9-88CF-FCB0F7465E62}.EmulatorRelease|Win32.Build.0 = EmulatorRelease|Win32
{95D5D2E5-FEF5-4CA9-88CF-FCB0F7465E62}.EmulatorRelease|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = EmulatorRelease|Windows Mobile 6 Professional SDK (ARMV4I)
{95D5D2E5-FEF5-4CA9-88CF-FCB0F7465E62}.EmulatorRelease|Windows Mobile 5.0 Smartphone SDK (ARMV4I).ActiveCfg = EmulatorRelease|Windows Mobile 6 Professional SDK (ARMV4I)
{95D5D2E5-FEF5-4CA9-88CF-FCB0F7465E62}.EmulatorRelease|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = EmulatorRelease|Windows Mobile 6 Professional SDK (ARMV4I)
Expand Down Expand Up @@ -148,6 +149,7 @@ Global
{AA77BEC0-2A60-4589-A784-7D78F60B35B6}.EmulatorRelease|Smartphone 2003 (ARMV4).ActiveCfg = EmulatorRelease|Smartphone 2003 (ARMV4)
{AA77BEC0-2A60-4589-A784-7D78F60B35B6}.EmulatorRelease|Smartphone 2003 (ARMV4).Deploy.0 = EmulatorRelease|Smartphone 2003 (ARMV4)
{AA77BEC0-2A60-4589-A784-7D78F60B35B6}.EmulatorRelease|Win32.ActiveCfg = EmulatorRelease|Win32
{AA77BEC0-2A60-4589-A784-7D78F60B35B6}.EmulatorRelease|Win32.Build.0 = EmulatorRelease|Win32
{AA77BEC0-2A60-4589-A784-7D78F60B35B6}.EmulatorRelease|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = EmulatorRelease|Windows Mobile 6 Professional SDK (ARMV4I)
{AA77BEC0-2A60-4589-A784-7D78F60B35B6}.EmulatorRelease|Windows Mobile 5.0 Smartphone SDK (ARMV4I).ActiveCfg = EmulatorRelease|Windows Mobile 6 Professional SDK (ARMV4I)
{AA77BEC0-2A60-4589-A784-7D78F60B35B6}.EmulatorRelease|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = EmulatorRelease|Windows Mobile 6 Professional SDK (ARMV4I)
Expand Down Expand Up @@ -198,6 +200,7 @@ Global
{B381B601-04B1-475B-B635-003F8E7DA3A9}.EmulatorRelease|Smartphone 2003 (ARMV4).ActiveCfg = EmulatorRelease|Smartphone 2003 (ARMV4)
{B381B601-04B1-475B-B635-003F8E7DA3A9}.EmulatorRelease|Smartphone 2003 (ARMV4).Deploy.0 = EmulatorRelease|Smartphone 2003 (ARMV4)
{B381B601-04B1-475B-B635-003F8E7DA3A9}.EmulatorRelease|Win32.ActiveCfg = EmulatorRelease|Win32
{B381B601-04B1-475B-B635-003F8E7DA3A9}.EmulatorRelease|Win32.Build.0 = EmulatorRelease|Win32
{B381B601-04B1-475B-B635-003F8E7DA3A9}.EmulatorRelease|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = EmulatorRelease|Windows Mobile 6 Professional SDK (ARMV4I)
{B381B601-04B1-475B-B635-003F8E7DA3A9}.EmulatorRelease|Windows Mobile 5.0 Smartphone SDK (ARMV4I).ActiveCfg = EmulatorRelease|Windows Mobile 6 Professional SDK (ARMV4I)
{B381B601-04B1-475B-B635-003F8E7DA3A9}.EmulatorRelease|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = EmulatorRelease|Windows Mobile 6 Professional SDK (ARMV4I)
Expand Down Expand Up @@ -248,6 +251,7 @@ Global
{6F57C60E-C083-4D46-A3B9-E17948A33518}.EmulatorRelease|Smartphone 2003 (ARMV4).ActiveCfg = EmulatorRelease|Smartphone 2003 (ARMV4)
{6F57C60E-C083-4D46-A3B9-E17948A33518}.EmulatorRelease|Smartphone 2003 (ARMV4).Deploy.0 = EmulatorRelease|Smartphone 2003 (ARMV4)
{6F57C60E-C083-4D46-A3B9-E17948A33518}.EmulatorRelease|Win32.ActiveCfg = EmulatorRelease|Win32
{6F57C60E-C083-4D46-A3B9-E17948A33518}.EmulatorRelease|Win32.Build.0 = EmulatorRelease|Win32
{6F57C60E-C083-4D46-A3B9-E17948A33518}.EmulatorRelease|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = EmulatorRelease|Windows Mobile 6 Professional SDK (ARMV4I)
{6F57C60E-C083-4D46-A3B9-E17948A33518}.EmulatorRelease|Windows Mobile 5.0 Smartphone SDK (ARMV4I).ActiveCfg = EmulatorRelease|Windows Mobile 6 Professional SDK (ARMV4I)
{6F57C60E-C083-4D46-A3B9-E17948A33518}.EmulatorRelease|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = EmulatorRelease|Windows Mobile 6 Professional SDK (ARMV4I)
Expand Down Expand Up @@ -294,6 +298,7 @@ Global
{F196A418-11F1-4067-9F4F-BCC7D70E6EC5}.EmulatorRelease|Smartphone 2003 (ARMV4).ActiveCfg = EmulatorRelease|Smartphone 2003 (ARMV4)
{F196A418-11F1-4067-9F4F-BCC7D70E6EC5}.EmulatorRelease|Smartphone 2003 (ARMV4).Deploy.0 = EmulatorRelease|Smartphone 2003 (ARMV4)
{F196A418-11F1-4067-9F4F-BCC7D70E6EC5}.EmulatorRelease|Win32.ActiveCfg = EmulatorRelease|Win32
{F196A418-11F1-4067-9F4F-BCC7D70E6EC5}.EmulatorRelease|Win32.Build.0 = EmulatorRelease|Win32
{F196A418-11F1-4067-9F4F-BCC7D70E6EC5}.EmulatorRelease|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = EmulatorRelease|Windows Mobile 6 Professional SDK (ARMV4I)
{F196A418-11F1-4067-9F4F-BCC7D70E6EC5}.EmulatorRelease|Windows Mobile 5.0 Smartphone SDK (ARMV4I).ActiveCfg = EmulatorRelease|Windows Mobile 6 Professional SDK (ARMV4I)
{F196A418-11F1-4067-9F4F-BCC7D70E6EC5}.EmulatorRelease|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = EmulatorRelease|Windows Mobile 6 Professional SDK (ARMV4I)
Expand Down
10 changes: 9 additions & 1 deletion platform/wm/rhodes/MainWindow.h
Expand Up @@ -2,6 +2,8 @@

#pragma once

#ifndef RHODES_EMULATOR

#if !defined(_WIN32_WCE) || defined( OS_PLATFORM_CE )
#include <exdispid.h>
#include <exdisp.h>
Expand Down Expand Up @@ -256,4 +258,10 @@ class CMainWindow :

#if !defined(_WIN32_WCE) || defined( OS_PLATFORM_CE )
HBITMAP SHLoadImageFile ( LPCTSTR pszFileName );
#endif
#endif

#else

#include "emulator\MainWindowQt.h"

#endif
4 changes: 4 additions & 0 deletions platform/wm/rhodes/RhoNativeViewManager.cpp
Expand Up @@ -72,7 +72,9 @@ class RhoNativeViewRunnable_OpenViewCommand : public RhoNativeViewRunnable {
virtual void run() {
CMainWindow* mw = Rhodes_getMainWindow();
String sn(mView->factory_holder->viewtype);
#ifndef RHODES_EMULATOR
mw->openNativeView(mView->factory_holder->factory, mView->n_view, sn);
#endif
//delete this;
}

Expand All @@ -86,7 +88,9 @@ class RhoNativeViewRunnable_CloseViewCommand : public RhoNativeViewRunnable {
}
virtual void run() {
CMainWindow* mw = Rhodes_getMainWindow();
#ifndef RHODES_EMULATOR
mw->closeNativeView();
#endif
//delete this;
}
};
Expand Down
10 changes: 10 additions & 0 deletions platform/wm/rhodes/Rhodes.cpp
Expand Up @@ -110,6 +110,7 @@ public :
}
// Note: In this sample, we don't respond differently to different hr success codes.

#ifndef RHODES_EMULATOR
// Allow only one instance of the application.
// the "| 0x01" activates the correct owned window of the previous instance's main window
HWND hWnd = NULL;
Expand All @@ -128,6 +129,7 @@ public :
SetForegroundWindow( HWND( DWORD(hWnd) | 0x01 ) );
return S_FALSE;
}
#endif

rho_logconf_Init(m_strRootPath.c_str());

Expand Down Expand Up @@ -195,7 +197,11 @@ public :
dwStyle |= WS_OVERLAPPEDWINDOW;
#endif
// Create the main application window
#ifdef RHODES_EMULATOR
m_appWindow.Initialize(convertToStringW(strTitle).c_str());
#else
m_appWindow.Create(NULL, CWindow::rcDefault, convertToStringW(strTitle).c_str(), dwStyle);
#endif
if (NULL == m_appWindow.m_hWnd)
{
return S_FALSE;
Expand Down Expand Up @@ -243,6 +249,9 @@ public :

void RunMessageLoop( ) throw( )
{
#ifdef RHODES_EMULATOR
m_appWindow.MessageLoop();
#else
MSG msg;
while (GetMessage(&msg, NULL, 0, 0))
{
Expand All @@ -252,6 +261,7 @@ public :
DispatchMessage(&msg);
}
}
#endif

#if defined(OS_WINCE)&& !defined( OS_PLATFORM_CE )
CGPSController* pGPS = CGPSController::Instance();
Expand Down
20 changes: 20 additions & 0 deletions platform/wm/rhodes/emulator/ExternalWebView.cpp
@@ -0,0 +1,20 @@
#include "ExternalWebView.h"
#include "ui_ExternalWebView.h"

ExternalWebView::ExternalWebView(QWidget *parent) :
QWidget(parent),
ui(new Ui::ExternalWebView)
{
ui->setupUi(this);
this->ui->webView->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
this->move(0,0);
}

ExternalWebView::~ExternalWebView()
{
}

void ExternalWebView::navigate(QUrl url)
{
ui->webView->setUrl(url);
}
23 changes: 23 additions & 0 deletions platform/wm/rhodes/emulator/ExternalWebView.h
@@ -0,0 +1,23 @@
#ifndef EXTERNALWEBVIEW_H
#define EXTERNALWEBVIEW_H

#include <QWidget>
#include <QUrl>

namespace Ui {
class ExternalWebView;
}

class ExternalWebView : public QWidget
{
Q_OBJECT

public:
explicit ExternalWebView(QWidget *parent = 0);
~ExternalWebView();
void navigate(QUrl url);
private:
Ui::ExternalWebView *ui;
};

#endif // EXTERNALWEBVIEW_H
46 changes: 46 additions & 0 deletions platform/wm/rhodes/emulator/ExternalWebView.ui
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ExternalWebView</class>
<widget class="QWidget" name="ExternalWebView">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>600</height>
</rect>
</property>
<property name="windowTitle">
<string>External Browser</string>
</property>
<property name="locale">
<locale language="English" country="UnitedStates"/>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QWebView" name="webView">
<property name="url">
<url>
<string>about:blank</string>
</url>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>QWebView</class>
<extends>QWidget</extends>
<header>QtWebKit/QWebView</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
18 changes: 18 additions & 0 deletions platform/wm/rhodes/emulator/MainWindowCallback.h
@@ -0,0 +1,18 @@
#ifndef MAINWINDOWCALLBACK_H
#define MAINWINDOWCALLBACK_H

#include <string>

class IMainWindowCallback
{
public:
virtual void updateSizeProperties(int width, int height) = 0;
virtual void onActivate(int active) = 0;
virtual void logEvent(const ::std::string& message) = 0;
virtual void createCustomMenu(void) = 0;
virtual void onCustomMenuItemCommand(int nItemPos) = 0;
protected:
virtual ~IMainWindowCallback() {};
};

#endif // MAINWINDOWCALLBACK_H

0 comments on commit 7cace33

Please sign in to comment.