8 new revisions:
Revision: 1d7d97500049
Author: Qiangning Hong <
hon...@gmail.com>
Date: Sat Oct 1 01:15:29 2011
Log: hotkey
http://code.google.com/p/onering-desktop/source/detail?r=1d7d97500049
Revision: 51b2fcffbfda
Author: Qiangning Hong <
hon...@gmail.com>
Date: Sat Oct 1 01:17:26 2011
Log: hotkey test
http://code.google.com/p/onering-desktop/source/detail?r=51b2fcffbfda
Revision: 73e9db732ff6
Author: Qiangning Hong <
hon...@gmail.com>
Date: Sat Oct 1 01:25:22 2011
Log: craete cores directory
http://code.google.com/p/onering-desktop/source/detail?r=73e9db732ff6
Revision: f13554e5e986
Author: Qiangning Hong <
hon...@gmail.com>
Date: Sun Nov 20 06:13:29 2011
Log: add skeleton of webkitcore
http://code.google.com/p/onering-desktop/source/detail?r=f13554e5e986
Revision: 18da82a96fbf
Author: Qiangning Hong <
hon...@gmail.com>
Date: Sun Nov 20 06:17:45 2011
Log: add Window and controller
http://code.google.com/p/onering-desktop/source/detail?r=18da82a96fbf
Revision: 19de4ac63aac
Author: Qiangning Hong <
hon...@gmail.com>
Date: Sun Nov 20 06:54:49 2011
Log: version
http://code.google.com/p/onering-desktop/source/detail?r=19de4ac63aac
Revision: 9162d6583708
Author: Qiangning Hong <
hon...@gmail.com>
Date: Mon Dec 12 18:45:01 2011
Log: tmp save
http://code.google.com/p/onering-desktop/source/detail?r=9162d6583708
Revision: e19d0e645eba
Author: Qiangning Hong <
hon...@gmail.com>
Date: Mon Dec 12 19:04:27 2011
Log: Meet the needs of PEP333...
http://code.google.com/p/onering-desktop/source/detail?r=e19d0e645eba
==============================================================================
Revision: 1d7d97500049
Author: Qiangning Hong <
hon...@gmail.com>
Date: Sat Oct 1 01:15:29 2011
Log: hotkey
http://code.google.com/p/onering-desktop/source/detail?r=1d7d97500049
Modified:
/include/onering.h
/plugins/hotkey/src/app.cpp
/plugins/hotkey/src/app.h
/plugins/hotkey/src/hotkey.cpp
/plugins/hotkey/src/hotkey.h
/plugins/hotkey/src/qxtglobalshortcut.cpp
/plugins/hotkey/src/qxtglobalshortcut.h
/plugins/hotkey/src/qxtglobalshortcut_mac.cpp
/plugins/hotkey/src/qxtglobalshortcut_p.h
/plugins/hotkey/src/qxtglobalshortcut_win.cpp
/plugins/hotkey/src/qxtglobalshortcut_x11.cpp
/qtcore/js/onering.js
/qtcore/
qtcore.pro
/qtcore/src/app.cpp
=======================================
--- /include/onering.h Mon Sep 12 19:47:12 2011
+++ /include/onering.h Sat Oct 1 01:15:29 2011
@@ -13,6 +13,10 @@
# define ONERING_EXPORT
#endif
+#define ONERING_OK 0
+#define ONERING_ERR_INVALID_APPNAME -1
+#define ONERING_ERR_NO_HELPER_FUNCTION -2
+
/* Return the version number of the core.
* e.g. "OneRingQtCore 1.0.0" */
ONERING_EXPORT const char* onering_version();
=======================================
--- /plugins/hotkey/src/app.cpp Sun Sep 11 02:07:25 2011
+++ /plugins/hotkey/src/app.cpp Sat Oct 1 01:15:29 2011
@@ -28,12 +28,12 @@
return g_apps.contains(appname);
}
-QByteArray call_app(const QString &method, const QUrl &url, const QString
&body)
+QByteArray call_app(const QString &method, const QUrl &url, const
QByteArray &body)
{
QString appname = url.host();
const char * response;
int response_len;
- onering_response_handle_t response_handle;
+ void* response_handle;
QByteArray retval;
if (is_appname_registered(appname)) {
@@ -43,7 +43,7 @@
path_query += surl.mid(surl.indexOf('?'));
}
- response_handle = g_apps[appname].first(qPrintable(appname),
qPrintable(method), path_query, body.toUtf8().constData(), &response,
&response_len);
+ response_handle = g_apps[appname].first(qPrintable(appname),
qPrintable(method), path_query, body.constData(), body.size(), &response,
&response_len);
retval.append(response, response_len);
// free response
g_apps[appname].second(qPrintable(appname), response_handle);
@@ -52,7 +52,7 @@
return retval;
}
-QByteArray call_app_body(const QString &method, const QUrl &url, const
QString &body)
+QByteArray call_app_body(const QString &method, const QUrl &url, const
QByteArray &body)
{
QByteArray response = call_app(method, url, body);
@@ -82,7 +82,9 @@
{
}
-onering_response_handle_t App::processRequest(const char* appname,
+onering_helpers_t* App::helpers = 0;
+
+void* App::processRequest(const char* appname,
const char* method, const QString& path, const QByteArray& body,
const char** response, int* response_len)
{
@@ -98,14 +100,14 @@
*response = res->constData();
*response_len = res->size();
- return reinterpret_cast<onering_response_handle_t>(res);
+ return res;
}
-void App::freeResponse(const char* appname, onering_response_handle_t
handle)
+void App::freeResponse(const char* appname, void* handle)
{
Q_UNUSED(appname);
- delete reinterpret_cast<QByteArray *>(handle);
+ delete static_cast<QByteArray*>(handle);
}
QString App::generateObjectId(void* obj)
@@ -152,7 +154,17 @@
void App::publishEvent(const QString& type, void* sender, const QString&
event, const QString& data)
{
- onering_publish(qPrintable(QString("%1.%2.%3.%4")
+ helpers->publish(qPrintable(QString("%1.%2.%3.%4")
.arg(appname, type, getId(sender), event)),
qPrintable(data));
}
+
+void App::setHelpers(onering_helpers_t* helpers)
+{
+ App::helpers = helpers;
+}
+
+onering_helpers_t* App::getHelpers()
+{
+ return App::helpers;
+}
=======================================
--- /plugins/hotkey/src/app.h Mon Sep 12 19:47:12 2011
+++ /plugins/hotkey/src/app.h Sat Oct 1 01:15:29 2011
@@ -11,8 +11,8 @@
int is_appname_registered(const QString &appname);
-QByteArray call_app(const QString& method, const QUrl &url, const QString
&body);
-QByteArray call_app_body(const QString &method, const QUrl &url, const
QString &body);
+QByteArray call_app(const QString& method, const QUrl &url, const
QByteArray &body);
+QByteArray call_app_body(const QString &method, const QUrl &url, const
QByteArray &body);
class App : public QObject
{
@@ -25,6 +25,8 @@
void freeResponse(const char* appname, void* response_handle);
static QString generateObjectId(void* obj);
+ static void setHelpers(onering_helpers_t* helpers);
+ static onering_helpers_t* getHelpers();
private slots:
void instanceDestroyed(QObject* obj);
@@ -41,6 +43,7 @@
virtual QByteArray processCall(const QString& command, const QVariantMap&
param) = 0;
QString appname;
+ static onering_helpers_t* helpers;
};
#endif
=======================================
--- /plugins/hotkey/src/hotkey.cpp Sun Sep 11 02:07:25 2011
+++ /plugins/hotkey/src/hotkey.cpp Sat Oct 1 01:15:29 2011
@@ -4,29 +4,77 @@
#include "hotkey.h"
#include "json.h"
-ONERING_EXPORT const char* require_onering_version()
-{
- return "OneRingQtCore 1.0";
+static const char JS[] = " \
+ONERING.HotKey = function() { \n\
+}; \n\
+ONERING.HotKey.prototype = (new ONERING.Base()).extend({ \n\
+ appname: \"hotkey\", \n\
+ type: \"HotKey\", \n\
+ destroy: function() { \n\
+ return this._call(\"destroy\"); \n\
+ }, \n\
+ }); \n\
+ONERING.HotKey.instances = {}; \n\
+ONERING.HotKey.create = function(shortcut) { \n\
+ var hotkey = new ONERING.HotKey(); \n\
+
hotkey.id = (hotkey._create(\"create\", {shortcut: shortcut})).id; \n\
+ ONERING.HotKey.instances[shortcut] = hotkey; \n\
+ return hotkey; \n\
+}; \n\
+ONERING.HotKey.set = function(shortcut, callback) { \n\
+ var hotkey = ONERING.HotKey.instances[shortcut] || new
ONERING.HotKey.create(shortcut); \n\
+ hotkey.bind(\"activated\", callback); \n\
+}; \n\
+ONERING.HotKey.clear = function(shortcut) { \n\
+ var hotkey = ONERING.HotKey.instances[shortcut]; \n\
+ if (hotkey !== undefined) { \n\
+ hotkey.destroy(); \n\
+ delete ONERING.HotKey.instances[shortcut]; \n\
+ } \n\
+}; \n\
+ONERING.setHotKey = ONERING.HotKey.set; \n\
+ONERING.clearHotKey = ONERING.HotKey.clear; \n\
+ \n\
+window.addEventListener('unload', function() { \n\
+ for (var shortcut in ONERING.HotKey.instances) { \n\
+ ONERING.HotKey.clear(shortcut); \n\
+ } \n\
+ }); \n\
+";
+
+
+const char* require_onering_version()
+{
+ return "QtCore 1.0";
}
-ONERING_EXPORT const char* get_onering_appname()
+const char* get_onering_appname()
{
return "hotkey";
}
-ONERING_EXPORT int register_onering_plugin(const char* appname)
-{
- return onering_register_app(appname, &app, &app_free_response);
+int register_onering_plugin(const char* appname)
+{
+ onering_helpers_t* h = HotKeyApp::getApp(appname).getHelpers();
+ if (!h || !(h->register_app)) {
+ return ONERING_ERR_NO_HELPER_FUNCTION;
+ }
+ return h->register_app(appname, &app, &app_free_response);
}
-onering_response_handle_t app(const char* appname, const char* method,
const char* path, const char* body, const char** response, int*
response_len)
-{
- return HotKeyApp::getApp(appname).processRequest(appname, method, path,
body, response, response_len);
+void set_onering_helpers(onering_helpers_t* helpers)
+{
+ HotKeyApp::setHelpers(helpers);
}
-void app_free_response(const char* appname, onering_response_handle_t
response_handle)
-{
- HotKeyApp::getApp(appname).freeResponse(appname, response_handle);
+void* app(const char* appname, const char* method, const char* path, const
char* body, int body_len, const char** response, int* response_len)
+{
+ return HotKeyApp::getApp(appname).processRequest(appname, method, path,
QByteArray(body, body_len), response, response_len);
+}
+
+void app_free_response(const char* appname, void* handle)
+{
+ HotKeyApp::getApp(appname).freeResponse(appname, handle);
}
HotKeyApp::HotKeyApp(const QString& appname)
@@ -44,6 +92,10 @@
{
QxtGlobalShortcut* shortcut;
+ if (command == "hotkey.js") {
+ return JS;
+ }
+
if (command == "create") {
shortcut = new
QxtGlobalShortcut(QKeySequence(param["shortcut"].toString()));
connect(shortcut, SIGNAL(activated()),
=======================================
--- /plugins/hotkey/src/hotkey.h Sun Sep 11 02:07:25 2011
+++ /plugins/hotkey/src/hotkey.h Sat Oct 1 01:15:29 2011
@@ -6,8 +6,19 @@
#include "qxtglobalshortcut.h"
#include "app.h"
-onering_response_handle_t app(const char* appname, const char* method,
const char* path, const char* body, const char** response, int*
response_len);
-void app_free_response(const char* appname, onering_response_handle_t
response);
+#ifdef __cplusplus
+extern "C" {
+#endif
+ONERING_EXPORT const char* require_onering_version();
+ONERING_EXPORT const char* get_onering_appname();
+ONERING_EXPORT int register_onering_plugin(const char* appname);
+ONERING_EXPORT void set_onering_helpers(onering_helpers_t* helpers);
+#ifdef __cplusplus
+}
+#endif
+
+void* app(const char* appname, const char* method, const char* path, const
char* body, int body_len, const char** response, int* response_len);
+void app_free_response(const char* appname, void* response);
class HotKeyApp : public App
{
@@ -15,11 +26,12 @@
static HotKeyApp& getApp(const QString& appname);
QByteArray processCall(const QString& path, const QVariantMap& param);
-private slots:
+private:
HotKeyApp(const QString& appname);
HotKeyApp(HotKeyApp const&);
void operator=(HotKeyApp const&);
+private slots:
void activated();
};
#endif
=======================================
--- /plugins/hotkey/src/qxtglobalshortcut.cpp Sun Sep 11 02:07:25 2011
+++ /plugins/hotkey/src/qxtglobalshortcut.cpp Sat Oct 1 01:15:29 2011
@@ -1,28 +1,34 @@
-/****************************************************************************
- **
- ** Copyright (C) Qxt Foundation. Some rights reserved.
- **
- ** This file is part of the QxtGui module of the Qxt library.
- **
- ** This library is free software; you can redistribute it and/or modify it
- ** under the terms of the Common Public License, version 1.0, as published
- ** by IBM, and/or under the terms of the GNU Lesser General Public
License,
- ** version 2.1, as published by the Free Software Foundation.
- **
- ** This file is provided "AS IS", without WARRANTIES OR CONDITIONS OF ANY
- ** KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY
- ** WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR
- ** FITNESS FOR A PARTICULAR PURPOSE.
- **
- ** You should have received a copy of the CPL and the LGPL along with this
- ** file. See the LICENSE file and the cpl1.0.txt/lgpl-2.1.txt files
- ** included with the source distribution for more information.
- ** If you did not receive a copy of the licenses, contact the Qxt
Foundation.
- **
- ** <
http://libqxt.org> <
found...@libqxt.org>
- **
-
****************************************************************************/
#include "qxtglobalshortcut.h"
+/****************************************************************************
+** Copyright (c) 2006 - 2011, the LibQxt project.
+** See the Qxt AUTHORS file for a list of authors and copyright holders.
+** All rights reserved.
+**
+** Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
the
+** documentation and/or other materials provided with the
distribution.
+** * Neither the name of the LibQxt project nor the
+** names of its contributors may be used to endorse or promote
products
+** derived from this software without specific prior written
permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND
+** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED
+** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+** DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
+** DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES
+** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES;
+** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND
+** ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS
+** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+** <
http://libqxt.org> <
found...@libqxt.org>
+*****************************************************************************/
+
#include "qxtglobalshortcut_p.h"
#include <QAbstractEventDispatcher>
#include <QtDebug>
@@ -52,10 +58,10 @@
bool QxtGlobalShortcutPrivate::setShortcut(const QKeySequence& shortcut)
{
- Qt::KeyboardModifiers allMods = Qt::ShiftModifier |
Qt::ControlModifier | Qt::AltModifier | Qt::MetaModifier |
Qt::KeypadModifier | Qt::GroupSwitchModifier;
+ Qt::KeyboardModifiers allMods = Qt::ShiftModifier |
Qt::ControlModifier | Qt::AltModifier | Qt::MetaModifier;
key = shortcut.isEmpty() ? Qt::Key(0) : Qt::Key((shortcut[0] ^
allMods) & shortcut[0]);
mods = shortcut.isEmpty() ? Qt::KeyboardModifiers(0) :
Qt::KeyboardModifiers(shortcut[0] & allMods);
- const quint32 nativeKey = nativeKeycode(key, mods);
+ const quint32 nativeKey = nativeKeycode(key);
const quint32 nativeMods = nativeModifiers(mods);
const bool res = registerShortcut(nativeKey, nativeMods);
shortcuts.insert(qMakePair(nativeKey, nativeMods), &qxt_p());
@@ -66,7 +72,7 @@
bool QxtGlobalShortcutPrivate::unsetShortcut()
{
- const quint32 nativeKey = nativeKeycode(key, mods);
+ const quint32 nativeKey = nativeKeycode(key);
const quint32 nativeMods = nativeModifiers(mods);
const bool res = unregisterShortcut(nativeKey, nativeMods);
shortcuts.remove(qMakePair(nativeKey, nativeMods));
=======================================
--- /plugins/hotkey/src/qxtglobalshortcut.h Sun Sep 11 02:07:25 2011
+++ /plugins/hotkey/src/qxtglobalshortcut.h Sat Oct 1 01:15:29 2011
@@ -1,28 +1,34 @@
-/****************************************************************************
- **
- ** Copyright (C) Qxt Foundation. Some rights reserved.
- **
- ** This file is part of the QxtGui module of the Qxt library.
- **
- ** This library is free software; you can redistribute it and/or modify it
- ** under the terms of the Common Public License, version 1.0, as published
- ** by IBM, and/or under the terms of the GNU Lesser General Public
License,
- ** version 2.1, as published by the Free Software Foundation.
- **
- ** This file is provided "AS IS", without WARRANTIES OR CONDITIONS OF ANY
- ** KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY
- ** WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR
- ** FITNESS FOR A PARTICULAR PURPOSE.
- **
- ** You should have received a copy of the CPL and the LGPL along with this
- ** file. See the LICENSE file and the cpl1.0.txt/lgpl-2.1.txt files
- ** included with the source distribution for more information.
- ** If you did not receive a copy of the licenses, contact the Qxt
Foundation.
- **
- ** <
http://libqxt.org> <
found...@libqxt.org>
- **
-
****************************************************************************/
#ifndef QXTGLOBALSHORTCUT_H
+/****************************************************************************
+** Copyright (c) 2006 - 2011, the LibQxt project.
+** See the Qxt AUTHORS file for a list of authors and copyright holders.
+** All rights reserved.
+**
+** Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
the
+** documentation and/or other materials provided with the
distribution.
+** * Neither the name of the LibQxt project nor the
+** names of its contributors may be used to endorse or promote
products
+** derived from this software without specific prior written
permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND
+** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED
+** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+** DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
+** DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES
+** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES;
+** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND
+** ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS
+** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+** <
http://libqxt.org> <
found...@libqxt.org>
+*****************************************************************************/
+
#define QXTGLOBALSHORTCUT_H
#include "qxtglobal.h"
@@ -30,7 +36,7 @@
#include <QKeySequence>
class QxtGlobalShortcutPrivate;
-class QxtGlobalShortcut : public QObject
+class QXT_GUI_EXPORT QxtGlobalShortcut : public QObject
{
Q_OBJECT
QXT_DECLARE_PRIVATE(QxtGlobalShortcut)
=======================================
--- /plugins/hotkey/src/qxtglobalshortcut_mac.cpp Sun Sep 11 02:07:25 2011
+++ /plugins/hotkey/src/qxtglobalshortcut_mac.cpp Sat Oct 1 01:15:29 2011
@@ -1,28 +1,34 @@
-/****************************************************************************
- **
- ** Copyright (C) Qxt Foundation. Some rights reserved.
- **
- ** This file is part of the QxtGui module of the Qxt library.
- **
- ** This library is free software; you can redistribute it and/or modify it
- ** under the terms of the Common Public License, version 1.0, as published
- ** by IBM, and/or under the terms of the GNU Lesser General Public
License,
- ** version 2.1, as published by the Free Software Foundation.
- **
- ** This file is provided "AS IS", without WARRANTIES OR CONDITIONS OF ANY
- ** KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY
- ** WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR
- ** FITNESS FOR A PARTICULAR PURPOSE.
- **
- ** You should have received a copy of the CPL and the LGPL along with this
- ** file. See the LICENSE file and the cpl1.0.txt/lgpl-2.1.txt files
- ** included with the source distribution for more information.
- ** If you did not receive a copy of the licenses, contact the Qxt
Foundation.
- **
- ** <
http://libqxt.org> <
found...@libqxt.org>
- **
-
****************************************************************************/
#include <Carbon/Carbon.h>
+/****************************************************************************
+** Copyright (c) 2006 - 2011, the LibQxt project.
+** See the Qxt AUTHORS file for a list of authors and copyright holders.
+** All rights reserved.
+**
+** Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
the
+** documentation and/or other materials provided with the
distribution.
+** * Neither the name of the LibQxt project nor the
+** names of its contributors may be used to endorse or promote
products
+** derived from this software without specific prior written
permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND
+** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED
+** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+** DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
+** DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES
+** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES;
+** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND
+** ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS
+** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+** <
http://libqxt.org> <
found...@libqxt.org>
+*****************************************************************************/
+
#include "qxtglobalshortcut_p.h"
#include <QMap>
#include <QHash>
@@ -39,6 +45,7 @@
{
Q_UNUSED(nextHandler);
Q_UNUSED(data);
+ qDebug() << "event" << event;
if (GetEventClass(event) == kEventClassKeyboard && GetEventKind(event)
== kEventHotKeyPressed)
{
EventHotKeyID keyID;
@@ -53,7 +60,7 @@
{
quint32 native = 0;
if (modifiers & Qt::ShiftModifier)
- native |= shiftKeyBit;
+ native |= shiftKey;
if (modifiers & Qt::ControlModifier)
native |= cmdKey;
if (modifiers & Qt::AltModifier)
@@ -65,201 +72,156 @@
return native;
}
-quint32 QxtGlobalShortcutPrivate::nativeKeycode(Qt::Key key,
Qt::KeyboardModifiers modifiers)
-{
- quint32 INVALID_KEYCODE = 0xff;
-
- switch (key)
- {
- case Qt::Key_A:
- return kVK_ANSI_A;
- case Qt::Key_S:
- return kVK_ANSI_S;
- case Qt::Key_D:
- return kVK_ANSI_D;
- case Qt::Key_F:
- return kVK_ANSI_F;
- case Qt::Key_H:
- return kVK_ANSI_H;
- case Qt::Key_G:
- return kVK_ANSI_G;
- case Qt::Key_Z:
- return kVK_ANSI_Z;
- case Qt::Key_X:
- return kVK_ANSI_X;
- case Qt::Key_C:
- return kVK_ANSI_C;
- case Qt::Key_V:
- return kVK_ANSI_V;
- case Qt::Key_B:
- return kVK_ANSI_B;
- case Qt::Key_Q:
- return kVK_ANSI_Q;
- case Qt::Key_W:
- return kVK_ANSI_W;
- case Qt::Key_E:
- return kVK_ANSI_E;
- case Qt::Key_R:
- return kVK_ANSI_R;
- case Qt::Key_Y:
- return kVK_ANSI_Y;
- case Qt::Key_T:
- return kVK_ANSI_T;
- case Qt::Key_1:
- return (modifiers & Qt::KeypadModifier) ? kVK_ANSI_Keypad1 : kVK_ANSI_1;
- case Qt::Key_2:
- return (modifiers & Qt::KeypadModifier) ? kVK_ANSI_Keypad2 : kVK_ANSI_2;
- case Qt::Key_3:
- return (modifiers & Qt::KeypadModifier) ? kVK_ANSI_Keypad3 : kVK_ANSI_3;
- case Qt::Key_4:
- return (modifiers & Qt::KeypadModifier) ? kVK_ANSI_Keypad4 : kVK_ANSI_4;
- case Qt::Key_6:
- return (modifiers & Qt::KeypadModifier) ? kVK_ANSI_Keypad6 : kVK_ANSI_6;
- case Qt::Key_5:
- return (modifiers & Qt::KeypadModifier) ? kVK_ANSI_Keypad5 : kVK_ANSI_5;
- case Qt::Key_Equal:
- return (modifiers & Qt::KeypadModifier) ? kVK_ANSI_KeypadEquals :
kVK_ANSI_Equal;
- case Qt::Key_9:
- return (modifiers & Qt::KeypadModifier) ? kVK_ANSI_Keypad9 : kVK_ANSI_9;
- case Qt::Key_7:
- return (modifiers & Qt::KeypadModifier) ? kVK_ANSI_Keypad7 : kVK_ANSI_7;
- case Qt::Key_Minus:
- return (modifiers & Qt::KeypadModifier) ? kVK_ANSI_KeypadMinus :
kVK_ANSI_Minus;
- case Qt::Key_8:
- return (modifiers & Qt::KeypadModifier) ? kVK_ANSI_Keypad8 : kVK_ANSI_8;
- case Qt::Key_0:
- return (modifiers & Qt::KeypadModifier) ? kVK_ANSI_Keypad0 : kVK_ANSI_0;
- case Qt::Key_BracketRight:
- return kVK_ANSI_RightBracket;
- case Qt::Key_O:
- return kVK_ANSI_O;
- case Qt::Key_U:
- return kVK_ANSI_U;
- case Qt::Key_BracketLeft:
- return kVK_ANSI_LeftBracket;
- case Qt::Key_I:
- return kVK_ANSI_I;
- case Qt::Key_P:
- return kVK_ANSI_P;
- case Qt::Key_L:
- return kVK_ANSI_L;
- case Qt::Key_J:
- return kVK_ANSI_J;
- case Qt::Key_QuoteDbl:
- return kVK_ANSI_Quote;
- case Qt::Key_K:
- return kVK_ANSI_K;
- case Qt::Key_Semicolon:
- return kVK_ANSI_Semicolon;
- case Qt::Key_Backslash:
- return kVK_ANSI_Backslash;
- case Qt::Key_Comma:
- return kVK_ANSI_Comma;
- case Qt::Key_Slash:
- return (modifiers & Qt::KeypadModifier) ? kVK_ANSI_KeypadDivide :
kVK_ANSI_Slash;
- case Qt::Key_N:
- return kVK_ANSI_N;
- case Qt::Key_M:
- return kVK_ANSI_M;
- case Qt::Key_Period:
- return (modifiers & Qt::KeypadModifier) ? kVK_ANSI_KeypadDecimal :
kVK_ANSI_Period;
- case Qt::Key_Dead_Grave:
- return kVK_ANSI_Grave;
- case Qt::Key_Asterisk:
- return kVK_ANSI_KeypadMultiply;
- case Qt::Key_Plus:
- return kVK_ANSI_KeypadPlus;
- case Qt::Key_Clear:
- return kVK_ANSI_KeypadClear;
- case Qt::Key_Return:
- return kVK_Return;
- case Qt::Key_Enter:
- return kVK_ANSI_KeypadEnter;
- case Qt::Key_Tab:
- return kVK_Tab;
- case Qt::Key_Space:
- return kVK_Space;
- case Qt::Key_Backspace:
- return kVK_Delete;
- case Qt::Key_Escape:
- return kVK_Escape;
- case Qt::Key_Control:
- return kVK_Command;
- case Qt::Key_Shift:
- return kVK_Shift;
- case Qt::Key_CapsLock:
- return kVK_CapsLock;
- case Qt::Key_Option:
- return kVK_Option;
- case Qt::Key_Meta:
- return kVK_Control;
- case Qt::Key_F17:
- return kVK_F17;
- case Qt::Key_VolumeUp:
- return kVK_VolumeUp;
- case Qt::Key_VolumeDown:
- return kVK_VolumeDown;
- case Qt::Key_F18:
- return kVK_F18;
- case Qt::Key_F19:
- return kVK_F19;
- case Qt::Key_F20:
- return kVK_F20;
- case Qt::Key_F5:
- return kVK_F5;
- case Qt::Key_F6:
- return kVK_F6;
- case Qt::Key_F7:
- return kVK_F7;
- case Qt::Key_F3:
- return kVK_F3;
- case Qt::Key_F8:
- return kVK_F8;
- case Qt::Key_F9:
- return kVK_F9;
- case Qt::Key_F11:
- return kVK_F11;
- case Qt::Key_F13:
- return kVK_F13;
- case Qt::Key_F16:
- return kVK_F16;
- case Qt::Key_F14:
- return kVK_F14;
- case Qt::Key_F10:
- return kVK_F10;
- case Qt::Key_F12:
- return kVK_F12;
- case Qt::Key_F15:
- return kVK_F15;
- case Qt::Key_Help:
- return kVK_Help;
- case Qt::Key_Home:
- return kVK_Home;
- case Qt::Key_PageUp:
- return kVK_PageUp;
- case Qt::Key_Delete:
- return kVK_ForwardDelete;
- case Qt::Key_F4:
- return kVK_F4;
- case Qt::Key_End:
- return kVK_End;
- case Qt::Key_F2:
- return kVK_F2;
- case Qt::Key_PageDown:
- return kVK_PageDown;
- case Qt::Key_F1:
- return kVK_F1;
- case Qt::Key_Left:
- return kVK_LeftArrow;
- case Qt::Key_Right:
- return kVK_RightArrow;
- case Qt::Key_Down:
- return kVK_DownArrow;
- case Qt::Key_Up:
- return kVK_UpArrow;
- default:
- return INVALID_KEYCODE;
- }
+quint32 QxtGlobalShortcutPrivate::nativeKeycode(Qt::Key key)
+{
+ UTF16Char ch;
+ // Constants found in NSEvent.h from AppKit.framework
+ switch (key)
+ {
+ case Qt::Key_Return:
+ return kVK_Return;
+ case Qt::Key_Enter:
+ return kVK_ANSI_KeypadEnter;
+ case Qt::Key_Tab:
+ return kVK_Tab;
+ case Qt::Key_Space:
+ return kVK_Space;
+ case Qt::Key_Backspace:
+ return kVK_Delete;
+ case Qt::Key_Control:
+ return kVK_Command;
+ case Qt::Key_Shift:
+ return kVK_Shift;
+ case Qt::Key_CapsLock:
+ return kVK_CapsLock;
+ case Qt::Key_Option:
+ return kVK_Option;
+ case Qt::Key_Meta:
+ return kVK_Control;
+ case Qt::Key_F17:
+ return kVK_F17;
+ case Qt::Key_VolumeUp:
+ return kVK_VolumeUp;
+ case Qt::Key_VolumeDown:
+ return kVK_VolumeDown;
+ case Qt::Key_F18:
+ return kVK_F18;
+ case Qt::Key_F19:
+ return kVK_F19;
+ case Qt::Key_F20:
+ return kVK_F20;
+ case Qt::Key_F5:
+ return kVK_F5;
+ case Qt::Key_F6:
+ return kVK_F6;
+ case Qt::Key_F7:
+ return kVK_F7;
+ case Qt::Key_F3:
+ return kVK_F3;
+ case Qt::Key_F8:
+ return kVK_F8;
+ case Qt::Key_F9:
+ return kVK_F9;
+ case Qt::Key_F11:
+ return kVK_F11;
+ case Qt::Key_F13:
+ return kVK_F13;
+ case Qt::Key_F16:
+ return kVK_F16;
+ case Qt::Key_F14:
+ return kVK_F14;
+ case Qt::Key_F10:
+ return kVK_F10;
+ case Qt::Key_F12:
+ return kVK_F12;
+ case Qt::Key_F15:
+ return kVK_F15;
+ case Qt::Key_Help:
+ return kVK_Help;
+ case Qt::Key_Home:
+ return kVK_Home;
+ case Qt::Key_PageUp:
+ return kVK_PageUp;
+ case Qt::Key_Delete:
+ return kVK_ForwardDelete;
+ case Qt::Key_F4:
+ return kVK_F4;
+ case Qt::Key_End:
+ return kVK_End;
+ case Qt::Key_F2:
+ return kVK_F2;
+ case Qt::Key_PageDown:
+ return kVK_PageDown;
+ case Qt::Key_F1:
+ return kVK_F1;
+ case Qt::Key_Left:
+ return kVK_LeftArrow;
+ case Qt::Key_Right:
+ return kVK_RightArrow;
+ case Qt::Key_Down:
+ return kVK_DownArrow;
+ case Qt::Key_Up:
+ return kVK_UpArrow;
+ default:
+ ;
+ }
+
+ if (key == Qt::Key_Escape) ch = 27;
+ else if (key == Qt::Key_Return) ch = 13;
+ else if (key == Qt::Key_Enter) ch = 3;
+ else if (key == Qt::Key_Tab) ch = 9;
+ else ch = key;
+
+ CFDataRef currentLayoutData;
+ TISInputSourceRef currentKeyboard =
TISCopyCurrentKeyboardInputSource();
+
+ if (currentKeyboard == NULL)
+ return 0;
+
+ currentLayoutData =
(CFDataRef)TISGetInputSourceProperty(currentKeyboard,
kTISPropertyUnicodeKeyLayoutData);
+ CFRelease(currentKeyboard);
+ if (currentLayoutData == NULL)
+ return 0;
+
+ UCKeyboardLayout* header =
(UCKeyboardLayout*)CFDataGetBytePtr(currentLayoutData);
+ UCKeyboardTypeHeader* table = header->keyboardTypeList;
+
+ uint8_t *data = (uint8_t*)header;
+ // God, would a little documentation for this shit kill you...
+ for (quint32 i=0; i < header->keyboardTypeCount; i++)
+ {
+ UCKeyStateRecordsIndex* stateRec = 0;
+ if (table[i].keyStateRecordsIndexOffset != 0)
+ {
+ stateRec = reinterpret_cast<UCKeyStateRecordsIndex*>(data +
table[i].keyStateRecordsIndexOffset);
+ if (stateRec->keyStateRecordsIndexFormat !=
kUCKeyStateRecordsIndexFormat) stateRec = 0;
+ }
+
+ UCKeyToCharTableIndex* charTable =
reinterpret_cast<UCKeyToCharTableIndex*>(data +
table[i].keyToCharTableIndexOffset);
+ if (charTable->keyToCharTableIndexFormat !=
kUCKeyToCharTableIndexFormat) continue;
+
+ for (quint32 j=0; j < charTable->keyToCharTableCount; j++)
+ {
+ UCKeyOutput* keyToChar = reinterpret_cast<UCKeyOutput*>(data +
charTable->keyToCharTableOffsets[j]);
+ for (quint32 k=0; k < charTable->keyToCharTableSize; k++)
+ {
+ if (keyToChar[k] & kUCKeyOutputTestForIndexMask)
+ {
+ long idx = keyToChar[k] & kUCKeyOutputGetIndexMask;
+ if (stateRec && idx < stateRec->keyStateRecordCount)
+ {
+ UCKeyStateRecord* rec =
reinterpret_cast<UCKeyStateRecord*>(data +
stateRec->keyStateRecordOffsets[idx]);
+ if (rec->stateZeroCharData == ch) return k;
+ }
+ }
+ else if (!(keyToChar[k] & kUCKeyOutputSequenceIndexMask)
&& keyToChar[k] < 0xFFFE)
+ {
+ if (keyToChar[k] == ch) return k;
+ }
+ } // for k
+ } // for j
+ } // for i
+ return 0;
}
bool QxtGlobalShortcutPrivate::registerShortcut(quint32 nativeKey, quint32
nativeMods)
@@ -269,6 +231,7 @@
EventTypeSpec t;
t.eventClass = kEventClassKeyboard;
t.eventKind = kEventHotKeyPressed;
+ qDebug() << "install handler";
InstallApplicationEventHandler(&qxt_mac_handle_hot_key, 1, &t,
NULL, NULL);
}
@@ -283,6 +246,8 @@
keyIDs.insert(Identifier(nativeMods, nativeKey), keyID.id);
keyRefs.insert(keyID.id, ref);
}
+
+ qDebug() << "registerShortcut" << nativeKey << nativeMods << rv;
return rv;
}
=======================================
--- /plugins/hotkey/src/qxtglobalshortcut_p.h Sun Sep 11 02:07:25 2011
+++ /plugins/hotkey/src/qxtglobalshortcut_p.h Sat Oct 1 01:15:29 2011
@@ -1,28 +1,34 @@
-/****************************************************************************
- **
- ** Copyright (C) Qxt Foundation. Some rights reserved.
- **
- ** This file is part of the QxtGui module of the Qxt library.
- **
- ** This library is free software; you can redistribute it and/or modify it
- ** under the terms of the Common Public License, version 1.0, as published
- ** by IBM, and/or under the terms of the GNU Lesser General Public
License,
- ** version 2.1, as published by the Free Software Foundation.
- **
- ** This file is provided "AS IS", without WARRANTIES OR CONDITIONS OF ANY
- ** KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY
- ** WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR
- ** FITNESS FOR A PARTICULAR PURPOSE.
- **
- ** You should have received a copy of the CPL and the LGPL along with this
- ** file. See the LICENSE file and the cpl1.0.txt/lgpl-2.1.txt files
- ** included with the source distribution for more information.
- ** If you did not receive a copy of the licenses, contact the Qxt
Foundation.
- **
- ** <
http://libqxt.org> <
found...@libqxt.org>
- **
-
****************************************************************************/
#ifndef QXTGLOBALSHORTCUT_P_H
+/****************************************************************************
+** Copyright (c) 2006 - 2011, the LibQxt project.
+** See the Qxt AUTHORS file for a list of authors and copyright holders.
+** All rights reserved.
+**
+** Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
the
+** documentation and/or other materials provided with the
distribution.
+** * Neither the name of the LibQxt project nor the
+** names of its contributors may be used to endorse or promote
products
+** derived from this software without specific prior written
permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND
+** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED
+** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+** DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
+** DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES
+** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES;
+** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND
+** ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS
+** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+** <
http://libqxt.org> <
found...@libqxt.org>
+*****************************************************************************/
+
#define QXTGLOBALSHORTCUT_P_H
#include "qxtglobalshortcut.h"
@@ -54,7 +60,7 @@
static void activateShortcut(quint32 nativeKey, quint32 nativeMods);
private:
- static quint32 nativeKeycode(Qt::Key keycode, Qt::KeyboardModifiers
modifiers=Qt::NoModifier);
+ static quint32 nativeKeycode(Qt::Key keycode);
static quint32 nativeModifiers(Qt::KeyboardModifiers modifiers);
static bool registerShortcut(quint32 nativeKey, quint32 nativeMods);
=======================================
--- /plugins/hotkey/src/qxtglobalshortcut_win.cpp Sun Sep 11 02:07:25 2011
+++ /plugins/hotkey/src/qxtglobalshortcut_win.cpp Sat Oct 1 01:15:29 2011
@@ -1,28 +1,34 @@
-/****************************************************************************
- **
- ** Copyright (C) Qxt Foundation. Some rights reserved.
- **
- ** This file is part of the QxtGui module of the Qxt library.
- **
- ** This library is free software; you can redistribute it and/or modify it
- ** under the terms of the Common Public License, version 1.0, as published
- ** by IBM, and/or under the terms of the GNU Lesser General Public
License,
- ** version 2.1, as published by the Free Software Foundation.
- **
- ** This file is provided "AS IS", without WARRANTIES OR CONDITIONS OF ANY
- ** KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY
- ** WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR
- ** FITNESS FOR A PARTICULAR PURPOSE.
- **
- ** You should have received a copy of the CPL and the LGPL along with this
- ** file. See the LICENSE file and the cpl1.0.txt/lgpl-2.1.txt files
- ** included with the source distribution for more information.
- ** If you did not receive a copy of the licenses, contact the Qxt
Foundation.
- **
- ** <
http://libqxt.org> <
found...@libqxt.org>
- **
-
****************************************************************************/
#include "qxtglobalshortcut_p.h"
+/****************************************************************************
+** Copyright (c) 2006 - 2011, the LibQxt project.
+** See the Qxt AUTHORS file for a list of authors and copyright holders.
+** All rights reserved.
+**
+** Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
the
+** documentation and/or other materials provided with the
distribution.
+** * Neither the name of the LibQxt project nor the
+** names of its contributors may be used to endorse or promote
products
+** derived from this software without specific prior written
permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND
+** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED
+** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+** DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
+** DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES
+** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES;
+** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND
+** ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS
+** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+** <
http://libqxt.org> <
found...@libqxt.org>
+*****************************************************************************/
+
#include <qt_windows.h>
bool QxtGlobalShortcutPrivate::eventFilter(void* message)
@@ -55,7 +61,7 @@
return native;
}
-quint32 QxtGlobalShortcutPrivate::nativeKeycode(Qt::Key key,
Qt::KeyboardModifiers modifiers)
+quint32 QxtGlobalShortcutPrivate::nativeKeycode(Qt::Key key)
{
switch (key)
{
@@ -155,8 +161,6 @@
return VK_SUBTRACT;
case Qt::Key_Slash:
return VK_DIVIDE;
-
-#ifdef VK_MEDIA_NEXT_TRACK
case Qt::Key_MediaNext:
return VK_MEDIA_NEXT_TRACK;
case Qt::Key_MediaPrevious:
@@ -174,7 +178,7 @@
return VK_VOLUME_UP;
case Qt::Key_VolumeMute:
return VK_VOLUME_MUTE;
-#endif
+
// numbers
case Qt::Key_0:
case Qt::Key_1:
=======================================
--- /plugins/hotkey/src/qxtglobalshortcut_x11.cpp Sun Sep 11 02:07:25 2011
+++ /plugins/hotkey/src/qxtglobalshortcut_x11.cpp Sat Oct 1 01:15:29 2011
@@ -1,28 +1,34 @@
-/****************************************************************************
- **
- ** Copyright (C) Qxt Foundation. Some rights reserved.
- **
- ** This file is part of the QxtGui module of the Qxt library.
- **
- ** This library is free software; you can redistribute it and/or modify it
- ** under the terms of the Common Public License, version 1.0, as published
- ** by IBM, and/or under the terms of the GNU Lesser General Public
License,
- ** version 2.1, as published by the Free Software Foundation.
- **
- ** This file is provided "AS IS", without WARRANTIES OR CONDITIONS OF ANY
- ** KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY
- ** WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR
- ** FITNESS FOR A PARTICULAR PURPOSE.
- **
- ** You should have received a copy of the CPL and the LGPL along with this
- ** file. See the LICENSE file and the cpl1.0.txt/lgpl-2.1.txt files
- ** included with the source distribution for more information.
- ** If you did not receive a copy of the licenses, contact the Qxt
Foundation.
- **
- ** <
http://libqxt.org> <
found...@libqxt.org>
- **
-
****************************************************************************/
#include "qxtglobalshortcut_p.h"
+/****************************************************************************
+** Copyright (c) 2006 - 2011, the LibQxt project.
+** See the Qxt AUTHORS file for a list of authors and copyright holders.
+** All rights reserved.
+**
+** Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
the
+** documentation and/or other materials provided with the
distribution.
+** * Neither the name of the LibQxt project nor the
+** names of its contributors may be used to endorse or promote
products
+** derived from this software without specific prior written
permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND
+** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED
+** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+** DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
+** DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES
+** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES;
+** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND
+** ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS
+** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+** <
http://libqxt.org> <
found...@libqxt.org>
+*****************************************************************************/
+
#include <QX11Info>
#include <X11/Xlib.h>
@@ -82,7 +88,7 @@
return native;
}
-quint32 QxtGlobalShortcutPrivate::nativeKeycode(Qt::Key key,
Qt::KeyboardModifiers modifiers)
+quint32 QxtGlobalShortcutPrivate::nativeKeycode(Qt::Key key)
{
Display* display = QX11Info::display();
return XKeysymToKeycode(display,
XStringToKeysym(QKeySequence(key).toString().toLatin1().data()));
=======================================
--- /qtcore/js/onering.js Wed Aug 31 02:54:24 2011
+++ /qtcore/js/onering.js Sat Oct 1 01:15:29 2011
@@ -228,46 +228,6 @@
});
// }}}
-
-// HotKey {{{
-
-ONERING.HotKey = function() {
-};
-ONERING.HotKey.prototype = (new ONERING.Base()).extend({
- appname: "hotkey",
- type: "HotKey",
- destroy: function() {
- return this._call("destroy");
- },
- });
-ONERING.HotKey.instances = {};
-ONERING.HotKey.create = function(shortcut) {
- var hotkey = new ONERING.HotKey();
-
hotkey.id = (hotkey._create("create", {shortcut: shortcut})).id;
- ONERING.HotKey.instances[shortcut] = hotkey;
- return hotkey;
-};
-ONERING.HotKey.set = function(shortcut, callback) {
- var hotkey = ONERING.HotKey.instances[shortcut] || new
ONERING.HotKey.create(shortcut);
- hotkey.bind("activated", callback);
-};
-ONERING.HotKey.clear = function(shortcut) {
- var hotkey = ONERING.HotKey.instances[shortcut];
- if (hotkey !== undefined) {
- hotkey.destroy();
- delete ONERING.HotKey.instances[shortcut];
- }
-};
-ONERING.setHotKey = ONERING.HotKey.set;
-ONERING.clearHotKey = ONERING.HotKey.clear;
-
-window.addEventListener('unload', function() {
- for (var shortcut in ONERING.HotKey.instances) {
- ONERING.HotKey.clear(shortcut);
- }
- });
-
-// }}}
// subscribe/unsubscribe {{{
=======================================
--- /qtcore/
qtcore.pro Sun Sep 11 02:13:42 2011
+++ /qtcore/
qtcore.pro Sat Oct 1 01:15:29 2011
@@ -75,3 +75,5 @@
LIBS += -framework AppKit
}
# end dock icon click
+
+macx:LIBS += -framework Carbon
=======================================
--- /qtcore/src/app.cpp Mon Sep 12 19:47:12 2011
+++ /qtcore/src/app.cpp Sat Oct 1 01:15:29 2011
@@ -14,7 +14,7 @@
int onering_register_app(const char* appname, onering_app_func_t app_func,
onering_free_response_func_t free_response_func)
{
if (strlen(appname) > ONERING_MAX_APPNAME_LEN) {
- return -1;
+ return ONERING_ERR_INVALID_APPNAME;
}
qDebug() << "register app:" << appname;
==============================================================================
Revision: 51b2fcffbfda
Author: Qiangning Hong <
hon...@gmail.com>
Date: Sat Oct 1 01:17:26 2011
Log: hotkey test
http://code.google.com/p/onering-desktop/source/detail?r=51b2fcffbfda
Added:
/plugins/hotkey/
hotkey.pro
/plugins/hotkey/src/json.cpp
/plugins/hotkey/src/json.h
/plugins/hotkey/test/test.c
Modified:
/.hgignore
=======================================
--- /dev/null
+++ /plugins/hotkey/
hotkey.pro Sat Oct 1 01:17:26 2011
@@ -0,0 +1,30 @@
+TEMPLATE = lib
+TARGET = hotkey
+DEPENDPATH += . ../../include src
+INCLUDEPATH += . ../../include
+DEFINES += ONERING_LIBRARY
+CONFIG += shared
+
+HEADERS = \
+ ../../include/onering.h \
+ src/hotkey.h \
+ src/qxtglobalshortcut.h \
+ src/qxtglobal.h \
+ src/qxtglobalshortcut_p.h \
+ src/json.h \
+ src/app.h
+
+SOURCES = \
+ src/hotkey.cpp \
+ src/qxtglobalshortcut.cpp \
+ src/json.cpp \
+ src/app.cpp
+
+macx:SOURCES += src/qxtglobalshortcut_mac.cpp
+win32:SOURCES += src/qxtglobalshortcut_win.cpp
+unix:!macx:SOURCES += src/qxtglobalshortcut_x11.cpp
+macx:LIBS += -framework Carbon
+win32 {
+ win32-g++:LIBS += -l user32
+ !win32-g++:LIBS += user32.lib
+}
=======================================
--- /dev/null
+++ /plugins/hotkey/src/json.cpp Sat Oct 1 01:17:26 2011
@@ -0,0 +1,428 @@
+/**
+ * \file json.h
+ *
+ * \author Eeli Reilin <
ee...@nilier.org>,
+ * Mikko Ahonen <
mikko.j...@jyu.fi>
+ * \version 0.1
+ * \date 8/25/2010
+ */
+
+#include <QDebug>
+
+#include "json.h"
+
+/**
+ * parse
+ */
+QVariant Json::parse(const QString &json)
+{
+ bool success = true;
+ return Json::parse(json, success);
+}
+
+/**
+ * parse
+ */
+QVariant Json::parse(const QString &json, bool &success)
+{
+ success = true;
+
+ //Return an empty QVariant if the JSON data is either null or empty
+ if(!json.isNull() || !json.isEmpty())
+ {
+ QString data = json;
+ //We'll start from index 0
+ int index = 0;
+
+ //Parse the first value
+ QVariant value = Json::parseValue(data, index, success);
+
+ //Return the parsed value
+ return value;
+ }
+ else
+ {
+ //Return the empty QVariant
+ return QVariant();
+ }
+}
+
+/**
+ * parseValue
+ */
+QVariant Json::parseValue(const QString &json, int &index, bool &success)
+{
+ //Determine what kind of data we should parse by
+ //checking out the upcoming token
+ switch(Json::lookAhead(json, index))
+ {
+ case JsonTokenString:
+ return Json::parseString(json, index, success);
+ case JsonTokenNumber:
+ return Json::parseNumber(json, index);
+ case JsonTokenCurlyOpen:
+ return Json::parseObject(json, index, success);
+ case JsonTokenSquaredOpen:
+ return Json::parseArray(json, index, success);
+ case JsonTokenTrue:
+ Json::nextToken(json, index);
+ return QVariant(true);
+ case JsonTokenFalse:
+ Json::nextToken(json, index);
+ return QVariant(false);
+ case JsonTokenNull:
+ Json::nextToken(json, index);
+ return QVariant();
+ case JsonTokenNone:
+ break;
+ }
+
+ //If there were no tokens, flag the failure and return an empty QVariant
+ success = false;
+ return QVariant();
+}
+
+/**
+ * parseObject
+ */
+QVariant Json::parseObject(const QString &json, int &index, bool &success)
+{
+ QVariantMap map;
+ int token;
+
+ //Get rid of the whitespace and increment index
+ Json::nextToken(json, index);
+
+ //Loop through all of the key/value pairs of the object
+ bool done = false;
+ while(!done)
+ {
+ //Get the upcoming token
+ token = Json::lookAhead(json, index);
+
+ if(token == JsonTokenNone)
+ {
+ success = false;
+ return QVariantMap();
+ }
+ else if(token == JsonTokenComma)
+ {
+ Json::nextToken(json, index);
+ }
+ else if(token == JsonTokenCurlyClose)
+ {
+ Json::nextToken(json, index);
+ return map;
+ }
+ else
+ {
+ //Parse the key/value pair's name
+ QString name = Json::parseString(json, index, success).toString();
+
+ if(!success)
+ {
+ return QVariantMap();
+ }
+
+ //Get the next token
+ token = Json::nextToken(json, index);
+
+ //If the next token is not a colon, flag the failure
+ //return an empty QVariant
+ if(token != JsonTokenColon)
+ {
+ success = false;
+ return QVariant(QVariantMap());
+ }
+
+ //Parse the key/value pair's value
+ QVariant value = Json::parseValue(json, index, success);
+
+ if(!success)
+ {
+ return QVariantMap();
+ }
+
+ //Assign the value to the key in the map
+ map[name] = value;
+ }
+ }
+
+ //Return the map successfully
+ return QVariant(map);
+}
+
+/**
+ * parseArray
+ */
+QVariant Json::parseArray(const QString &json, int &index, bool &success)
+{
+ QVariantList list;
+
+ Json::nextToken(json, index);
+
+ bool done = false;
+ while(!done)
+ {
+ int token = Json::lookAhead(json, index);
+
+ if(token == JsonTokenNone)
+ {
+ success = false;
+ return QVariantList();
+ }
+ else if(token == JsonTokenComma)
+ {
+ Json::nextToken(json, index);
+ }
+ else if(token == JsonTokenSquaredClose)
+ {
+ Json::nextToken(json, index);
+ break;
+ }
+ else
+ {
+ QVariant value = Json::parseValue(json, index, success);
+
+ if(!success)
+ {
+ return QVariantList();
+ }
+
+ list.push_back(value);
+ }
+ }
+
+ return QVariant(list);
+}
+
+/**
+ * parseString
+ */
+QVariant Json::parseString(const QString &json, int &index, bool &success)
+{
+ QString s;
+ QChar c;
+
+ Json::eatWhitespace(json, index);
+
+ c = json[index++];
+
+ bool complete = false;
+ while(!complete)
+ {
+ if(index == json.size())
+ {
+ break;
+ }
+
+ c = json[index++];
+
+ if(c == '\"')
+ {
+ complete = true;
+ break;
+ }
+ else if(c == '\\')
+ {
+ if(index == json.size())
+ {
+ break;
+ }
+
+ c = json[index++];
+
+ if(c == '\"')
+ {
+ s.append('\"');
+ }
+ else if(c == '\\')
+ {
+ s.append('\\');
+ }
+ else if(c == '/')
+ {
+ s.append('/');
+ }
+ else if(c == 'b')
+ {
+ s.append('\b');
+ }
+ else if(c == 'f')
+ {
+ s.append('\f');
+ }
+ else if(c == 'n')
+ {
+ s.append('\n');
+ }
+ else if(c == 'r')
+ {
+ s.append('\r');
+ }
+ else if(c == 't')
+ {
+ s.append('\t');
+ }
+ else if(c == 'u')
+ {
+ int remainingLength = json.size() - index;
+
+ if(remainingLength >= 4)
+ {
+ QString unicodeStr = json.mid(index, 4);
+
+ int symbol = unicodeStr.toInt(0, 16);
+
+ s.append(QChar(symbol));
+
+ index += 4;
+ }
+ else
+ {
+ break;
+ }
+ }
+ }
+ else
+ {
+ s.append(c);
+ }
+ }
+
+ if(!complete)
+ {
+ success = false;
+ return QVariant();
+ }
+
+ return QVariant(s);
+}
+
+/**
+ * parseNumber
+ */
+QVariant Json::parseNumber(const QString &json, int &index)
+{
+ Json::eatWhitespace(json, index);
+
+ int lastIndex = Json::lastIndexOfNumber(json, index);
+ int charLength = (lastIndex - index) + 1;
+ QString numberStr;
+
+ numberStr = json.mid(index, charLength);
+
+ index = lastIndex + 1;
+
+ return QVariant(numberStr);
+}
+
+/**
+ * lastIndexOfNumber
+ */
+int Json::lastIndexOfNumber(const QString &json, int index)
+{
+ int lastIndex;
+
+ for(lastIndex = index; lastIndex < json.size(); lastIndex++)
+ {
+ if(QString("0123456789+-.eE").indexOf(json[lastIndex]) == -1)
+ {
+ break;
+ }
+ }
+
+ return lastIndex -1;
+}
+
+/**
+ * eatWhitespace
+ */
+void Json::eatWhitespace(const QString &json, int &index)
+{
+ for(; index < json.size(); index++)
+ {
+ if(QString(" \t\n\r").indexOf(json[index]) == -1)
+ {
+ break;
+ }
+ }
+}
+
+/**
+ * lookAhead
+ */
+int Json::lookAhead(const QString &json, int index)
+{
+ int saveIndex = index;
+ return Json::nextToken(json, saveIndex);
+}
+
+/**
+ * nextToken
+ */
+int Json::nextToken(const QString &json, int &index)
+{
+ Json::eatWhitespace(json, index);
+
+ if(index == json.size())
+ {
+ return JsonTokenNone;
+ }
+
+ QChar c = json[index];
+ index++;
+ switch(c.toAscii())
+ {
+ case '{': return JsonTokenCurlyOpen;
+ case '}': return JsonTokenCurlyClose;
+ case '[': return JsonTokenSquaredOpen;
+ case ']': return JsonTokenSquaredClose;
+ case ',': return JsonTokenComma;
+ case '"': return JsonTokenString;
+ case '0': case '1': case '2': case '3': case '4':
+ case '5': case '6': case '7': case '8': case '9':
+ case '-': return JsonTokenNumber;
+ case ':': return JsonTokenColon;
+ }
+
+ index--;
+
+ int remainingLength = json.size() - index;
+
+ //True
+ if(remainingLength >= 4)
+ {
+ if (json[index] == 't' && json[index + 1] == 'r' &&
+ json[index + 2] == 'u' && json[index + 3] == 'e')
+ {
+ index += 4;
+ return JsonTokenTrue;
+ }
+ }
+
+ //False
+ if (remainingLength >= 5)
+ {
+ if (json[index] == 'f' && json[index + 1] == 'a' &&
+ json[index + 2] == 'l' && json[index + 3] == 's' &&
+ json[index + 4] == 'e')
+ {
+ index += 5;
+ return JsonTokenFalse;
+ }
+ }
+
+ //Null
+ if (remainingLength >= 4)
+ {
+ if (json[index] == 'n' && json[index + 1] == 'u' &&
+ json[index + 2] == 'l' && json[index + 3] == 'l')
+ {
+ index += 4;
+ return JsonTokenNull;
+ }
+ }
+
+ return JsonTokenNone;
+}
=======================================
--- /dev/null
+++ /plugins/hotkey/src/json.h Sat Oct 1 01:17:26 2011
@@ -0,0 +1,157 @@
+/**
+ * \file json.h
+ *
+ * \author Eeli Reilin <
ee...@nilier.org>,
+ * Mikko Ahonen <
mikko.j...@jyu.fi>
+ * \version 0.1
+ * \date 8/25/2010
+ */
+
+#ifndef JSON_H
+#define JSON_H
+
+#include <QVariant>
+#include <QString>
+
+/**
+ * \enum JsonToken
+ */
+enum JsonToken
+{
+ JsonTokenNone = 0,
+ JsonTokenCurlyOpen = 1,
+ JsonTokenCurlyClose = 2,
+ JsonTokenSquaredOpen = 3,
+ JsonTokenSquaredClose = 4,
+ JsonTokenColon = 5,
+ JsonTokenComma = 6,
+ JsonTokenString = 7,
+ JsonTokenNumber = 8,
+ JsonTokenTrue = 9,
+ JsonTokenFalse = 10,
+ JsonTokenNull = 11
+};
+
+/**
+ * \class Json
+ * \brief A JSON data parser
+ *
+ * Json parses a JSON data into a QVariant hierarchy.
+ */
+class Json
+{
+ public:
+ /**
+ * Parse a JSON string
+ *
+ * \param json The JSON data
+ */
+ static QVariant parse(const QString &json);
+
+ /**
+ * Parse a JSON string
+ *
+ * \param json The JSON data
+ * \param success The success of the parsing
+ */
+ static QVariant parse(const QString &json, bool &success);
+
+ private:
+ /**
+ * Parses a value starting from index
+ *
+ * \param json The JSON data
+ * \param index The start index
+ * \param success The success of the parse process
+ *
+ * \return QVariant The parsed value
+ */
+ static QVariant parseValue(const QString &json, int &index,
+ bool &success);
+
+ /**
+ * Parses an object starting from index
+ *
+ * \param json The JSON data
+ * \param index The start index
+ * \param success The success of the object parse
+ *
+ * \return QVariant The parsed object map
+ */
+ static QVariant parseObject(const QString &json, int &index,
+ bool &success);
+
+ /**
+ * Parses an array starting from index
+ *
+ * \param json The JSON data
+ * \param index The starting index
+ * \param success The success of the array parse
+ *
+ * \return QVariant The parsed variant array
+ */
+ static QVariant parseArray(const QString &json, int &index,
+ bool &success);
+
+ /**
+ * Parses a string starting from index
+ *
+ * \param json The JSON data
+ * \param index The starting index
+ * \param success The success of the string parse
+ *
+ * \return QVariant The parsed string
+ */
+ static QVariant parseString(const QString &json, int &index,
+ bool &success);
+
+ /**
+ * Parses a number starting from index
+ *
+ * \param json The JSON data
+ * \param index The starting index
+ *
+ * \return QVariant The parsed number
+ */
+ static QVariant parseNumber(const QString &json, int &index);
+
+ /**
+ * Get the last index of a number starting from index
+ *
+ * \param json The JSON data
+ * \param index The starting index
+ *
+ * \return The last index of the number
+ */
+ static int lastIndexOfNumber(const QString &json, int index);
+
+ /**
+ * Skip unwanted whitespace symbols starting from index
+ *
+ * \param json The JSON data
+ * \param index The start index
+ */
+ static void eatWhitespace(const QString &json, int &index);
+
+ /**
+ * Check what token lies ahead
+ *
+ * \param json The JSON data
+ * \param index The starting index
+ *
+ * \return int The upcoming token
+ */
+ static int lookAhead(const QString &json, int index);
+
+ /**
+ * Get the next JSON token
+ *
+ * \param json The JSON data
+ * \param index The starting index
+ *
+ * \return int The next JSON token
+ */
+ static int nextToken(const QString &json, int &index);
+};
+
+#endif //JSON_H
=======================================
--- /dev/null
+++ /plugins/hotkey/test/test.c Sat Oct 1 01:17:26 2011
@@ -0,0 +1,44 @@
+#include <string.h>
+#include <stdio.h>
+#include <onering.h>
+
+static const char HTML[] = "\
+<html><head> \
+<script src='onering://onering/onering.js'></script> \
+<script src='onering://hotkey/hotkey.js'></script> \
+</head><body> \
+<p>Press Alt+P to increase number.</p> \
+<div id='x'>0</div>\
+<script>\
+var n = 0;\
+ONERING.getCurrentWindow().showInspector();\
+ONERING.HotKey.set('Ctrl+Alt+R', function(){\
+ n = n + 1; \
+ document.getElementById('x').innerHTML = n;\
+ });\
+</script>\
+</body></html>";
+
+
+void* test_app(const char* appname, const char* method, const char* path,
const char* body, int body_len, const char** response, int* response_len)
+{
+ if (strcmp(path, "/init") == 0) {
+ *response = "{\"width\": 400, \"height\": 300, \"url\": \"/\"}";
+ } else {
+ *response = HTML;
+ }
+ *response_len = strlen(*response);
+ return 0;
+}
+
+void free_response(const char* appname, void* response_handle)
+{
+}
+
+int main()
+{
+ printf("load %d plugins\n", onering_load_plugins("plugins"));
+ onering_register_app("test", &test_app, &free_response);
+
+ return onering_loop("test");
+}
=======================================
--- /.hgignore Sun Sep 11 02:13:42 2011
+++ /.hgignore Sat Oct 1 01:17:26 2011
@@ -14,4 +14,5 @@
.*\.(so|a|dll|rc)$
object_script\.OneRing\.
.*\.bundle$
-qtcore/test/test$
+.*\.dylib$
+.*/test/test$
==============================================================================
Revision: 73e9db732ff6
Author: Qiangning Hong <
hon...@gmail.com>
Date: Sat Oct 1 01:25:22 2011
Log: craete cores directory
http://code.google.com/p/onering-desktop/source/detail?r=73e9db732ff6
Added:
/cores/qtcore/js/onering.js
/cores/qtcore/
qtcore.pro
/cores/qtcore/qtcore.qrc
/cores/qtcore/src/app.cpp
/cores/qtcore/src/app.h
/cores/qtcore/src/application.cpp
/cores/qtcore/src/application.h
/cores/qtcore/src/appreply.cpp
/cores/qtcore/src/appreply.h
/cores/qtcore/src/cocoainit.h
/cores/qtcore/src/
cocoainit.mm
/cores/qtcore/src/dataloader.cpp
/cores/qtcore/src/dataloader.h
/cores/qtcore/src/debugger.cpp
/cores/qtcore/src/debugger.h
/cores/qtcore/src/dockiconclick.h
/cores/qtcore/src/
dockiconclick.mm
/cores/qtcore/src/jsapi.cpp
/cores/qtcore/src/jsapi.h
/cores/qtcore/src/json.cpp
/cores/qtcore/src/json.h
/cores/qtcore/src/menu.cpp
/cores/qtcore/src/menu.h
/cores/qtcore/src/networkaccessmanager.cpp
/cores/qtcore/src/networkaccessmanager.h
/cores/qtcore/src/oneringapp.cpp
/cores/qtcore/src/oneringapp.h
/cores/qtcore/src/oneringview.cpp
/cores/qtcore/src/oneringview.h
/cores/qtcore/src/pluginloader.cpp
/cores/qtcore/src/pluginloader.h
/cores/qtcore/src/publishevent.cpp
/cores/qtcore/src/publishevent.h
/cores/qtcore/src/pubsubhub.cpp
/cores/qtcore/src/pubsubhub.h
/cores/qtcore/src/qtcore.cpp
/cores/qtcore/src/systemtrayicon.cpp
/cores/qtcore/src/systemtrayicon.h
/cores/qtcore/test/Makefile
/cores/qtcore/test/test.c
/cores/qtcore/test/testplugin.c
/cores/qtcore/test/testplugin2.c
Deleted:
/qtcore/js/onering.js
/qtcore/
qtcore.pro
/qtcore/qtcore.qrc
/qtcore/src/app.cpp
/qtcore/src/app.h
/qtcore/src/application.cpp
/qtcore/src/application.h
/qtcore/src/appreply.cpp
/qtcore/src/appreply.h
/qtcore/src/cocoainit.h
/qtcore/src/
cocoainit.mm
/qtcore/src/dataloader.cpp
/qtcore/src/dataloader.h
/qtcore/src/debugger.cpp
/qtcore/src/debugger.h
/qtcore/src/dockiconclick.h
/qtcore/src/
dockiconclick.mm
/qtcore/src/jsapi.cpp
/qtcore/src/jsapi.h
/qtcore/src/json.cpp
/qtcore/src/json.h
/qtcore/src/menu.cpp
/qtcore/src/menu.h
/qtcore/src/networkaccessmanager.cpp
/qtcore/src/networkaccessmanager.h
/qtcore/src/oneringapp.cpp
/qtcore/src/oneringapp.h
/qtcore/src/oneringview.cpp
/qtcore/src/oneringview.h
/qtcore/src/pluginloader.cpp
/qtcore/src/pluginloader.h
/qtcore/src/publishevent.cpp
/qtcore/src/publishevent.h
/qtcore/src/pubsubhub.cpp
/qtcore/src/pubsubhub.h
/qtcore/src/qtcore.cpp
/qtcore/src/systemtrayicon.cpp
/qtcore/src/systemtrayicon.h
/qtcore/test/Makefile
/qtcore/test/test.c
/qtcore/test/testplugin.c
/qtcore/test/testplugin2.c
=======================================
--- /dev/null
+++ /cores/qtcore/js/onering.js Sat Oct 1 01:25:22 2011
@@ -0,0 +1,406 @@
+ONERING = new Object();
+
+// Base {{{
+ONERING.Base = function() {};
+ONERING.Base.prototype = {
+ _call: function(command, param) {
+ if (!param) { param = {}; }
+
param.id =
this.id;
+ return ONERING.call_app(this.appname, command, param);
+ },
+ _create: function(command, param) {
+ var obj = ONERING.call_app(this.appname, command, param);
+ if (!(this.validate_type(obj))) {
+ throw new Error(this.type + " not created");
+ }
+ return obj;
+ },
+ _destroy: function(command) {
+ if (!
this.id) { return; }
+ var r = this._call(command);
+
this.id = null;
+ return r;
+ },
+ validate_type: function(obj) {
+ return (obj && obj.type == this.type);
+ },
+ bind: function(event, callback) {
+ ONERING.subscribe(this.appname+"."+this.type+"."+
this.id+"."+event,
+ function(e) {
+ if (e instanceof Object && e.event_id) {
+ e = new ONERING.Event(e.event_id);
+ }
+ callback(e);
+ });
+ },
+ unbind: function(event) {
+ ONERING.unsubscribe(this.appname+"."+this.type+"."+
this.id+"."+event);
+ },
+ extend: function(d) {
+ for (var k in d) {
+ this[k] = d[k];
+ }
+ return this;
+ },
+};
+//}}}
+
+// Event {{{
+ONERING.Event = function(id) {
+
this.id = id;
+};
+ONERING.Event.prototype = (new ONERING.Base()).extend({
+ appname: "onering",
+ type: "Event",
+ preventDefault: function() {
+ this._call("Event.preventDefault");
+ }
+ });
+// }}}
+
+// Application {{{
+
+ONERING.Application = function() {
+
this.id = 0;
+};
+ONERING.Application.prototype = (new ONERING.Base()).extend({
+ appname: "onering",
+ type: "Application",
+ setQuitOnLastWindowClosed: function(quit) {
+ return this._call("Application.setQuitOnLastWindowClosed", {quit:
quit}),
+ },
+ exit: function() {
+ this._call("Application.exit");
+ },
+ });
+
+ONERING.application = new ONERING.Application();
+ONERING.getApplication = function() {
+ return ONERING.application;
+};
+
+// }}}
+
+// Window {{{
+
+ONERING.Window = function(obj) {
+ if (!this.validate_type(obj)) {
+ throw new Error("invalid type");
+ }
+
this.id =
obj.id;
+};
+ONERING.Window.prototype = (new ONERING.Base()).extend({
+ appname: "onering",
+ type: "Window",
+ createWindow: function(url, width, height, props) {
+ url = ONERING.resolve(url);
+ props.url = url;
+ props.width = width;
+ props.height = height;
+ var window = this._create("Window.create", props);
+ return new ONERING.Window(window);
+ },
+ isAlive: function() {
+ return this._call("Window.isAlive");
+ },
+ showInspector: function() {
+ return this._call("Window.showInspector");
+ },
+ hide: function() {
+ return this._call("Window.hide");
+ },
+ show: function() {
+ return this._call("Window.show");
+ },
+ maximize: function() {
+ return this._call("Window.maximize");
+ },
+ showNormal: function() {
+ return this._call("Window.showNormal");
+ },
+ isMinimized: function() {
+ return this._call("Window.isMinimized");
+ },
+ activateWindow: function() {
+ return this._call("Window.activateWindow");
+ }
+
+ });
+
+ONERING.window = new ONERING.Window({type: "Window",
+ id: _OneRing.getCurrentWindowId()});
+
+ONERING.getCurrentWindow = function() {
+ return ONERING.window;
+};
+
+// shortcuts
+ONERING.createWindow = function(url, width, height, props) {
+ return ONERING.getCurrentWindow().createWindow(url, width, height, props);
+};
+
+// }}}
+
+// System Tray Icon {{{
+
+ONERING.SystemTrayIcon = function(url) {
+
this.id = this._create("create").id;
+ if (url) {
+ this.load(url);
+ }
+};
+ONERING.SystemTrayIcon.prototype = (new ONERING.Base()).extend({
+ appname: "systray",
+ type: "SystemTrayIcon",
+ destroy: function() {
+ this._destroy("destroy");
+ },
+ load: function(url) {
+ return this._call("load", {url: ONERING.resolve(url)});
+ },
+ setContextMenu: function(menu) {
+ return this._call("setContextMenu", {menuId:
menu.id});
+ }
+ });
+
+// }}}
+
+// Menu {{{
+
+ONERING.Menu = function(items) {
+
this.id = this._create("Menu.create").id;
+ for (var i=0; i<items.length; i++) {
+ var item = items[i];
+ if (item === ONERING.Menu.SEPARATOR) {
+ this.addSeparator();
+ } else {
+ this.addItem(item[0], item[1], item[2]);
+ }
+ };
+};
+ONERING.Menu.SEPARATOR = Object(); // a const
+ONERING.Menu.prototype = new ONERING.Base();
+ONERING.Menu.prototype.extend({
+ appname: "menu",
+ type: "Menu",
+ destroy: function() {
+ this._destroy("Menu.destroy");
+ },
+ addSeparator: function() {
+ return this._call("Menu.addSeparator");
+ },
+ addItem: function(title, callback, props) {
+ if (!(callback instanceof Function)) {
+ props = callback;
+ callback = null;
+ }
+ var item = new ONERING.MenuItem(this._call("Menu.addMenuItem", {text:
title}));
+ if (callback) {
+ item.bind('triggered', callback);
+ }
+ if (props) {
+ item.setProperties(props);
+ }
+ },
+ get: function(index) {
+ return new ONERING.MenuItem(this._call("Menu.getMenuItem", {index:
index}));
+ }
+ });
+
+ONERING.MenuItem = function(item) {
+ if (!item || item.type != this.type) {
+ throw new Error("invalid menu item");
+ }
+
this.id =
item.id;
+};
+ONERING.MenuItem.prototype = (new ONERING.Base()).extend({
+ appname: "menu",
+ type: "MenuItem",
+ setProperties: function(props) {
+ return this._call("MenuItem.setProperties", props);
+ },
+ setText: function(text) {
+ return this._call("MenuItem.setText", {text: text});
+ },
+ setEnabled: function(enabled) {
+ return this.setProperties({enabled: enabled});
+ },
+ });
+
+// }}}
+
+// subscribe/unsubscribe {{{
+
+ONERING.subscriptions = {};
+ONERING.hub = _OneRing.getPubSubHub().published;
+
+ONERING.subscribe = function(channel, callback) {
+ var ss = ONERING.subscriptions[channel] = ONERING.subscriptions[channel] |
| {};
+ var f = ss[callback] = ss[callback] || function(ch, msg) {
+ if (ch === channel) {
+ callback(JSON.parse(msg));
+ }
+ };
+ ONERING.hub.connect(f);
+};
+
+ONERING.unsubscribe = function(channel, callback) {
+ if (channel === undefined) {
+ for (channel in ONERING.subscriptions) {
+ ONERING.unsubscribe(channel);
+ }
+ } else {
+ var ss = ONERING.subscriptions[channel];
+ if (ss) {
+ if (callback === undefined) {
+ for (callback in ss) {
+ ONERING.hub.disconnect(ss[callback]);
+ }
+ delete ONERING.subscriptions[channel];
+ } else {
+ var f = ss[callback];
+ if (f) {
+ ONERING.hub.disconnect(f);
+ delete ss[callback];
+ }
+ }
+ }
+ }
+};
+
+window.addEventListener('unload', function() {
+ ONERING.unsubscribe();
+ });
+
+// }}}
+
+// functions {{{
+
+ONERING.log = function(o) {
+ return _OneRing.log(o);
+};
+
+ONERING.callback = function(name, para) {
+ var window_id = name.split('_')[1];
+ if (window_id != ONERING._window_id) {
+ return;
+ }
+ var f = _get_registered_function(name);
+ if (f) {
+ f(para);
+ }
+};
+
+ONERING.exit = function() {
+ ONERING.getApplication().exit();
+};
+
+ONERING.ajax = function(settings) {
+ var url = settings.url;
+ var data = settings.data || "";
+ if ( data instanceof Object ) {
+ data = ONERING.param(data);
+ }
+ var type = settings.type || "GET";
+ var dataType = settings.dataType;
+ var success = settings.success;
+ var async = settings.async || true;
+
+ if (data && type == "GET") {
+ url += ((url.indexOf('?') < 0) ? '?' : '&') + data;
+ data = "";
+ }
+
+ _OneRing.ajax(type, url, data, _register_function(function(s) {
+ if (dataType == "json") {
+ s = window.JSON.parse(s);
+ }
+ success && success(s);
+ }), async);
+};
+
+ONERING.get = function(url, data, callback, dataType) {
+ if (data instanceof Function) {
+ dataType = dataType || callback;
+ callback = data;
+ data = null;
+ }
+
+ return ONERING.ajax({
+ type: "GET",
+ url: url,
+ data: data,
+ success: callback,
+ dataType: dataType
+ });
+};
+
+ONERING.getJSON = function(url, data, callback) {
+ return ONERING.get(url, data, callback, "json");
+};
+
+ONERING.post = function(url, data, callback, dataType) {
+ if (data instanceof Function) {
+ dataType = dataType || callback;
+ callback = data;
+ data = null;
+ }
+
+ return ONERING.ajax({
+ type: "POST",
+ url: url,
+ data: data,
+ success: callback,
+ dataType: dataType
+ });
+};
+
+ONERING.call_app = function(appname, command, param) {
+ var url = appname ? ("onering://"+appname+"/"+command) : ("/"+command);
+ var data = JSON.stringify(param || {});
+ var r = _OneRing.call("POST", url, data);
+ r = JSON.parse(r);
+ if (r && r.err) {
+ throw new Error("ONERING.call_app("+appname+", "+command+") failed: " +
r.err);
+ }
+ return r;
+};
+
+ONERING.resolve = function(url) {
+ return _OneRing.resolve(url);
+};
+
+// }}}
+
+// internal utilities {{{
+
+var _guid = 0;
+var _get_guid = function() {
+ _guid += 1;
+ return '' + _guid;
+};
+
+ONERING._window_id = Math.floor(Math.random()*1000000);
+
+var _registered_functions = new Object();
+var _register_function = function(func) {
+ var name = 'f_' + ONERING._window_id + '_' + _get_guid();
+ _registered_functions[name] = func;
+ return name;
+};
+var _get_registered_function = function(name) {
+ return _registered_functions[name];
+};
+
+ONERING.param = function(a) {
+ var s = [];
+ for (var key in a) {
+ var value = a[key];
+ s.push( encodeURIComponent(key) + "=" + encodeURIComponent(value) );
+ }
+ return s.join("&").replace(/%20/g, "+");
+};
+
+// }}}
+
+// vim:set foldmethod=marker:
=======================================
--- /dev/null
+++ /cores/qtcore/
qtcore.pro Sat Oct 1 01:25:22 2011
@@ -0,0 +1,79 @@
+######################################################################
+# Automatically generated by qmake (2.01a) Thu Aug 19 21:40:02 2010
+######################################################################
+
+TEMPLATE = lib
+TARGET = OneRingQtCore
+DEPENDPATH += . ../include src
+INCLUDEPATH += . ../include
+QT += webkit network
+RESOURCES = qtcore.qrc
+CONFIG += shared
+DEFINES += ONERING_LIBRARY
+VERSION = 1
+macx {
+ CONFIG += lib_bundle
+ FRAMEWORK_HEADERS.version = Versions
+ FRAMEWORK_HEADERS.files = ../include/onering.h
+ FRAMEWORK_HEADERS.path = Headers
+ QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS
+ QMAKE_FRAMEWORK_BUNDLE_NAME = OneRingQtCore
+ QMAKE_FRAMEWORK_VERSION = $$VERSION
+}
+
+!release {
+ DEFINES += DEBUG
+}
+
+# Input
+HEADERS += \
+ ../include/onering.h \
+ src/app.h \
+ src/application.h \
+ src/appreply.h \
+ src/dataloader.h \
+ src/debugger.h \
+ src/jsapi.h \
+ src/json.h \
+ src/menu.h \
+ src/networkaccessmanager.h \
+ src/oneringapp.h \
+ src/oneringview.h \
+ src/publishevent.h \
+ src/pubsubhub.h \
+ src/systemtrayicon.h \
+ src/pluginloader.h
+
+SOURCES += \
+ src/app.cpp \
+ src/application.cpp \
+ src/appreply.cpp \
+ src/dataloader.cpp \
+ src/debugger.cpp \
+ src/jsapi.cpp \
+ src/json.cpp \
+ src/menu.cpp \
+ src/networkaccessmanager.cpp \
+ src/qtcore.cpp \
+ src/oneringapp.cpp \
+ src/oneringview.cpp \
+ src/publishevent.cpp \
+ src/pubsubhub.cpp \
+ src/systemtrayicon.cpp \
+ src/pluginloader.cpp
+
+# dock icon click
+macx {
+ HEADERS += \
+ src/cocoainit.h \
+ src/dockiconclick.h
+
+ OBJECTIVE_SOURCES += \
+ src/
cocoainit.mm \
+ src/
dockiconclick.mm
+
+ LIBS += -framework AppKit
+}
+# end dock icon click
+
+macx:LIBS += -framework Carbon
=======================================
--- /dev/null
+++ /cores/qtcore/qtcore.qrc Sat Oct 1 01:25:22 2011
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>js/onering.js</file>
+</qresource>
+</RCC>
=======================================
--- /dev/null
+++ /cores/qtcore/src/app.cpp Sat Oct 1 01:25:22 2011
@@ -0,0 +1,170 @@
+#include <QDebug>
+#include <QString>
+#include <QHash>
+#include <QPair>
+#include <QUrl>
+#include <string.h>
+#include <assert.h>
+#include <onering.h>
+#include "app.h"
+#include "json.h"
+
+QHash<QString, QPair<onering_app_func_t, onering_free_response_func_t> >
g_apps;
+
+int onering_register_app(const char* appname, onering_app_func_t app_func,
onering_free_response_func_t free_response_func)
+{
+ if (strlen(appname) > ONERING_MAX_APPNAME_LEN) {
+ return ONERING_ERR_INVALID_APPNAME;
+ }
+
+ qDebug() << "register app:" << appname;
+ QPair<onering_app_func_t, onering_free_response_func_t> funcs(app_func,
free_response_func);
+ g_apps[appname] = funcs;
+ return 0;
+}
+
+int is_appname_registered(const QString &appname)
+{
+ return g_apps.contains(appname);
+}
+
+int get_app(const char* appname, onering_app_func_t* app,
onering_free_response_func_t* free_respnose)
+{
+ if (!is_appname_registered(appname)) {
+ return -1;
+ }
+
+ *app = g_apps[appname].first;
+ *free_respnose = g_apps[appname].second;
+ return 0;
+}
+
+QByteArray call_app(const QString &method, const QUrl &url, const QString
&body)
+{
+ QString appname = url.host();
+ const char * response;
+ int response_len;
+ void* response_handle;
+ QByteArray retval;
+
+ if (is_appname_registered(appname)) {
+ QByteArray surl = url.toString().toUtf8();
+ QByteArray path_query = url.path().toUtf8();
+ if (url.hasQuery()) {
+ path_query += surl.mid(surl.indexOf('?'));
+ }
+
+ QByteArray qbody = body.toUtf8();
+ response_handle = g_apps[appname].first(qPrintable(appname),
qPrintable(method), path_query, qbody.constData(), qbody.size(), &response,
&response_len);
+ retval.append(response, response_len);
+ // free response
+ g_apps[appname].second(qPrintable(appname), response_handle);
+ }
+
+ return retval;
+}
+
+QByteArray call_app_body(const QString &method, const QUrl &url, const
QString &body)
+{
+ QByteArray response = call_app(method, url, body);
+
+ int index;
+ if ((index = response.indexOf("\r\n")) < 0) {
+ // not header/body seperator found.
+ // consider the whole response is body
+ return response;
+ }
+ QByteArray line = response.left(index);
+ if (line.indexOf("200") < 0) {
+ qDebug() << "error status line:" << line;
+ return "";
+ }
+
+ if ((index = response.indexOf("\r\n\r\n")) < 0) {
+ qDebug() << "Body not found:" << response;
+ return "";
+ }
+ response.remove(0, index+4);
+ return response;
+}
+
+App::App(const QString& appname, QObject* parent)
+ : QObject(parent),
+ appname(appname)
+{
+}
+
+void* App::processRequest(const char* appname,
+ const char* method, const QString& path, const QByteArray& body,
+ const char** response, int* response_len)
+{
+ Q_UNUSED(appname);
+ Q_UNUSED(method);
+
+ assert(path.startsWith("/"));
+
+ QByteArray* res = new QByteArray();
+
+ QVariantMap param = Json::parse(QString::fromUtf8(body)).toMap();
+ *res = processCall(path.mid(1), param);
+
+ *response = res->constData();
+ *response_len = res->size();
+ return res;
+}
+
+void App::freeResponse(const char* appname, void* handle)
+{
+ Q_UNUSED(appname);
+
+ delete static_cast<QByteArray*>(handle);
+}
+
+QString App::generateObjectId(void* obj)
+{
+ return QString::number(reinterpret_cast<unsigned long>(obj), 16);
+}
+
+
+QString App::getId(QObject* obj)
+{
+ connect(obj, SIGNAL(destroyed(QObject*)),
+ this, SLOT(instanceDestroyed(QObject*)),
+ Qt::UniqueConnection);
+ return generateObjectId(obj);
+}
+
+QString App::getId(void* obj)
+{
+ return generateObjectId(obj);
+}
+
+void* App::getInstance(const QString& id)
+{
+ bool ok;
+ return reinterpret_cast<void *>(id.toULong(&ok, 16));
+}
+
+void App::instanceDestroyed(QObject* obj)
+{
+ qDebug() << obj << "deleted";
+}
+
+void App::publishEvent(const QString& type, void* sender, const QString&
event)
+{
+ publishEvent(type, sender, event, "null");
+}
+
+void App::publishEvent(const QString& type, void* sender, const QString&
event, QEvent* e)
+{
+ QString data = QString("{\"event_id\":\"%1\"}").arg(getId(e));
+ publishEvent(type, sender, event, data);
+}
+
+
+void App::publishEvent(const QString& type, void* sender, const QString&
event, const QString& data)
+{
+ onering_publish(qPrintable(QString("%1.%2.%3.%4")
+ .arg(appname, type, getId(sender), event)),
+ qPrintable(data));
+}
=======================================
--- /dev/null
+++ /cores/qtcore/src/app.h Sat Oct 1 01:25:22 2011
@@ -0,0 +1,47 @@
+#ifndef APP_H
+#define APP_H
+
+#include <onering.h>
+#include <QString>
+#include <QUrl>
+#include <QByteArray>
+#include <QVariantMap>
+#include <QEvent>
+#include <QSet>
+
+int is_appname_registered(const QString &appname);
+int get_app(const char* appname, onering_app_func_t* app,
onering_free_response_func_t* free_respnose);
+
+QByteArray call_app(const QString& method, const QUrl &url, const QString
&body);
+QByteArray call_app_body(const QString &method, const QUrl &url, const
QString &body);
+
+class App : public QObject
+{
+ Q_OBJECT
+
+public:
+ App(const QString& appname, QObject *parent=0);
+
+ void* processRequest(const char* appname, const char* method, const
QString& path, const QByteArray& body, const char** response, int*
response_len);
+ void freeResponse(const char* appname, void* response_handle);
+
+ static QString generateObjectId(void* obj);
+
+private slots:
+ void instanceDestroyed(QObject* obj);
+
+protected:
+ QString getId(QObject* obj);
+ QString getId(void* obj);
+ void* getInstance(const QString& id);
+ void publishEvent(const QString& type, void* sender, const QString&
event);
+ void publishEvent(const QString& type, void* sender, const QString&
event, QEvent* e);
+ void publishEvent(const QString& type, void* sender, const QString&
event, const QString& data);
+
+private:
+ virtual QByteArray processCall(const QString& command, const QVariantMap&
param) = 0;
+
+ QString appname;
+};
+
+#endif
=======================================
--- /dev/null
+++ /cores/qtcore/src/application.cpp Sat Oct 1 01:25:22 2011
@@ -0,0 +1,131 @@
+#include <QDir>
+#include <QDebug>
+#include <QWebSettings>
+#include <QWebSecurityOrigin>
+#include <QVariantMap>
+#include <QDesktopServices>
+#include <QApplication>
+#include <QUrl>
+#include <onering.h>
+#include "application.h"
+#include "oneringapp.h"
+#include "app.h"
+#include "oneringview.h"
+#include "dataloader.h"
+#include "debugger.h"
+#include "json.h"
+#include "dockiconclick.h"
+
+// plugins
+#include "menu.h"
+#include "systemtrayicon.h"
+
+static QUrl getAbsUrl(const QString &url, const QString &appname)
+{
+ QUrl u(url);
+
+ if (u.isRelative()) {
+ u.setScheme("onering");
+ u.setHost(appname);
+ }
+ return u;
+}
+
+Application::Application(int &argc, char **argv)
+ : QApplication(argc, argv),
+ quiting(false)
+{
+#ifdef Q_WS_MAC
+#ifdef QT_MAC_USE_COCOA
+ connect(&_dockIconClickMonitor, SIGNAL(dockIconClicked()),
+ this, SIGNAL(dockIconClicked()));
+#endif
+#endif
+}
+
+Application::~Application()
+{
+ quiting = true;
+}
+
+int Application::load(const char* appname)
+{
+#ifdef Q_OS_MAC
+ QDir plugins_dir = QCoreApplication::applicationDirPath();
+ if (!plugins_dir.path().startsWith("/System/")) {
+
plugins_dir.cd("../plugins");
+ QCoreApplication::setLibraryPaths(QStringList(plugins_dir.path()));
+ }
+#endif
+ qDebug() << "plugins dir:" << QCoreApplication::libraryPaths();
+
+ QWebSettings *settings = QWebSettings::globalSettings();
+ settings->setAttribute(QWebSettings::JavascriptCanOpenWindows, true);
+ settings->setAttribute(QWebSettings::JavascriptCanAccessClipboard, true);
+ settings->setAttribute(QWebSettings::LocalStorageEnabled, true);
+ settings->setAttribute(QWebSettings::LocalStorageDatabaseEnabled, true);
+ settings->setAttribute(QWebSettings::LocalContentCanAccessRemoteUrls,
true);
+ settings->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
+
+ QWebSecurityOrigin::addLocalScheme("onering");
+
+ register_onering_app("onering");
+
+ // register plugin apps
+ register_menu_app("menu");
+ register_systray_app("systray");
+
+ QUrl initurl;
+ initurl.setScheme("onering");
+ initurl.setHost(appname);
+ initurl.setPath("/init");
+ QByteArray response = call_app_body("GET", initurl, "");
+
+ QVariantMap props = Json::parse(QString::fromLocal8Bit(response)).toMap();
+
+ QString s;
+ QUrl url;
+ QDir dir;
+
+ QString real_appname = props.value("appname", appname).toString();
+ qDebug() << "appname:" << real_appname;
+ QCoreApplication::setApplicationName(real_appname);
+
+ s = props.value("storageDir").toString();
+ dir = QDesktopServices::storageLocation(QDesktopServices::DataLocation);
+ s = QDir::cleanPath(dir.filePath(s));
+ qDebug() << "data location:" << s;
+ settings->setLocalStoragePath(s);
+
+ s = props.value("icon").toString();
+ if (!s.isEmpty()) {
+ url = getAbsUrl(s, appname);
+ DataLoader *dataloader = new DataLoader();
+ Debugger::traceObj(dataloader);
+ connect(dataloader, SIGNAL(got(QByteArray&)),
+ this, SLOT(setWindowIconByData(QByteArray&)));
+ connect(dataloader, SIGNAL(got(QByteArray&)),
+ dataloader, SLOT(deleteLater()));
+ dataloader->load(url);
+ }
+
+ s = props["url"].toString();
+ if (s.isEmpty()) {
+ s = "/";
+ }
+ props["url"] = getAbsUrl(s, appname);
+
+ OneRingView* window = OneRingApp::createWindow(props);
+
+ window->show();
+ return 0;
+}
+
+void Application::setWindowIconByData(QByteArray &data)
+{
+ qDebug() << "setWindowIconByData";
+ QPixmap pixmap;
+ pixmap.loadFromData(data);
+ setWindowIcon(QIcon(pixmap));
+}
+
=======================================
--- /dev/null
+++ /cores/qtcore/src/application.h Sat Oct 1 01:25:22 2011
@@ -0,0 +1,44 @@
+#ifndef APPLICATION_H
+#define APPLICATION_H
+
+#include <QApplication>
+#include <QObject>
+#include "pubsubhub.h"
+#ifdef Q_WS_MAC
+#ifdef QT_MAC_USE_COCOA
+#include "dockiconclick.h"
+#endif
+#endif
+
+class Application : public QApplication
+{
+ Q_OBJECT
+
+public:
+ Application(int &argc, char **argv);
+ ~Application();
+
+ int load(const char* appname);
+ PubSubHub pubsubhub;
+ bool quiting;
+
+public slots:
+ void setWindowIconByData(QByteArray &data);
+
+signals:
+#ifdef Q_WS_MAC
+#ifdef QT_MAC_USE_COCOA
+ void dockIconClicked();
+#endif
+#endif
+
+#ifdef Q_WS_MAC
+#ifdef QT_MAC_USE_COCOA
+private:
+ DockIconClickMonitor _dockIconClickMonitor;
+#endif
+#endif
+
+};
+
+#endif
=======================================
--- /dev/null
+++ /cores/qtcore/src/appreply.cpp Sat Oct 1 01:25:22 2011
@@ -0,0 +1,121 @@
+#include <QDebug>
+#include <QtNetwork>
+#include <QIODevice>
+#include <QTimer>
+#include <string.h>
+#include <onering.h>
+#include "appreply.h"
+#include "app.h"
+
+
+AppReply::AppReply(const QUrl &url, QObject *parent)
+ : QNetworkReply(parent)
+{
+ AppReply("GET", url, 0, parent);
+}
+
+AppReply::AppReply(const char* method, const QUrl &url, QIODevice
*body_device, QObject *parent)
+ : QNetworkReply(parent)
+{
+ this->method = method;
+ this->url = url;
+ this->body_device = body_device;
+
+ if (body_device) {
+ qDebug() << "body_device connect";
+ connect(body_device, SIGNAL(readyRead()),
+ this, SLOT(readBody()));
+ } else {
+ QTimer::singleShot(0, this, SLOT(parseResponse()));
+ }
+}
+
+void AppReply::readBody()
+{
+ qDebug() << "body_device readyRead";
+ this->body += this->body_device->readAll();
+ if (this->body_device->atEnd()) {
+ parseResponse();
+ }
+}
+
+void AppReply::parseResponse()
+{
+ content = call_app(method, url, body);
+ offset = 0;
+
+ open(ReadOnly | Unbuffered);
+
+ // default attribute
+ setAttribute(QNetworkRequest::HttpStatusCodeAttribute, 200);
+ setHeader(QNetworkRequest::ContentTypeHeader, QVariant("text/html;
charset=UTF-8"));
+
+ // TODO speed optimization needed
+ int index;
+ bool ok;
+ int code;
+ QByteArray line, key, value;
+ QList<QByteArray> words;
+ if ((index = content.indexOf("\r\n")) < 0) {
+ goto finish;
+ }
+ line = content.left(index);
+ words = line.split(' ');
+ if (words.size() < 3) {
+ goto finish;
+ }
+ code = words[1].toInt(&ok);
+ if (!ok) {
+ goto finish;
+ }
+ setAttribute(QNetworkRequest::HttpStatusCodeAttribute, code);
+ offset = index + 2;
+
+ // iterate over lines of header
+ for(; (index = content.indexOf("\r\n", offset)) > offset; offset=index+2)
{
+ line = content.mid(offset, index-offset);
+ int pos = line.indexOf(':');
+ if (pos <= 0) {
+ continue;
+ }
+ key = line.left(pos);
+ value = line.mid(pos+1).trimmed();
+ setRawHeader(key, value);
+ }
+
+ if (index == offset) {
+ // the CRLF seperate headers and body
+ offset += 2;
+ }
+
+finish:
+// qDebug() << "body:" << content.mid(offset);
+ emit readyRead();
+ emit finished();
+}
+
+void AppReply::abort()
+{
+}
+
+qint64 AppReply::bytesAvailable() const
+{
+ return content.size() - offset;
+}
+
+bool AppReply::isSequential() const
+{
+ return true;
+}
+
+qint64 AppReply::readData(char *data, qint64 maxSize)
+{
+ if (offset < content.size()) {
+ qint64 number = qMin(maxSize, content.size() - offset);
+ memcpy(data, content.constData() + offset, number);
+ offset += number;
+ return number;
+ } else
+ return -1;
+}
+
=======================================
--- /dev/null
+++ /cores/qtcore/src/appreply.h Sat Oct 1 01:25:22 2011
@@ -0,0 +1,34 @@
+#ifndef APPREPLY_H
+#define APPREPLY_H
+
+#include <QNetworkReply>
+#include <QIODevice>
+
+class AppReply : public QNetworkReply
+{
+ Q_OBJECT
+
+public:
+ AppReply(const QUrl &url, QObject *parent=0);
+ AppReply(const char* method, const QUrl &url, QIODevice *body_device=0,
QObject *parent=0);
+ void abort();
+ qint64 bytesAvailable() const;
+ bool isSequential() const;
+
+protected:
+ qint64 readData(char *data, qint64 maxSize);
+
+private slots:
+ void readBody();
+ void parseResponse();
+
+private:
+ QIODevice *body_device;
+ QByteArray body;
+ QString method;
+ QUrl url;
+ QByteArray content;
+ qint64 offset;
+};
+
+#endif
=======================================
--- /dev/null
+++ /cores/qtcore/src/cocoainit.h Sat Oct 1 01:25:22 2011
@@ -0,0 +1,15 @@
+#ifndef ONERING_COCOAINIT_H
+#define ONERING_COCOAINIT_H
+
+class CocoaInitializer
+{
+ public:
+ CocoaInitializer();
+ ~CocoaInitializer();
+
+ private:
+ class Private;
+ Private* d;
+};
+
+#endif
=======================================
--- /dev/null
+++ /cores/qtcore/src/
cocoainit.mm Sat Oct 1 01:25:22 2011
@@ -0,0 +1,21 @@
+#include <AppKit/AppKit.h>
+#include "cocoainit.h"
+
+class CocoaInitializer::Private
+{
+ public:
+ NSAutoreleasePool* autoReleasePool;
+};
+
+CocoaInitializer::CocoaInitializer()
+{
+ d = new CocoaInitializer::Private();
+ NSApplicationLoad();
+ d->autoReleasePool = [[NSAutoreleasePool alloc] init];
+}
+
+CocoaInitializer::~CocoaInitializer()
+{
+ [d->autoReleasePool release];
+ delete d;
+}
=======================================
--- /dev/null
+++ /cores/qtcore/src/dataloader.cpp Sat Oct 1 01:25:22 2011
@@ -0,0 +1,27 @@
+#include <QDebug>
+#include <QNetworkRequest>
+#include "networkaccessmanager.h"
+#include "dataloader.h"
+#include "debugger.h"
+
+DataLoader::DataLoader(QObject *parent)
+ : QObject(parent)
+{
+}
+
+void DataLoader::load(const QUrl &url)
+{
+ NetworkAccessManager *manager = new NetworkAccessManager(this);
+ Debugger::traceObj(manager);
+ connect(manager, SIGNAL(finished(QNetworkReply*)),
+ this, SLOT(fetched(QNetworkReply*)));
+ manager->get(QNetworkRequest(url));
+}
+
+void DataLoader::fetched(QNetworkReply *reply)
+{
+ QByteArray data = reply->readAll();
+ emit got(data);
+
+ reply->manager()->deleteLater();
+}
=======================================
--- /dev/null
+++ /cores/qtcore/src/dataloader.h Sat Oct 1 01:25:22 2011
@@ -0,0 +1,24 @@
+#ifndef DATALOADER_H
+#define DATALOADER_H
+
+#include <QObject>
+#include <QUrl>
+#include <QNetworkReply>
+
+class DataLoader : public QObject
+{
+ Q_OBJECT
+
+public:
+ DataLoader(QObject *parent=0);
+ void load(const QUrl &url);
+
+signals:
+ void got(QByteArray &data);
+
+private slots:
+ void fetched(QNetworkReply *reply);
+};
+
+
+#endif
=======================================
--- /dev/null
+++ /cores/qtcore/src/debugger.cpp Sat Oct 1 01:25:22 2011
@@ -0,0 +1,23 @@
+#include <QDebug>
+#include "debugger.h"
+
+static Debugger *debugger = 0;
+
+void Debugger::traceObj(QObject *obj)
+{
+#ifdef DEBUG
+ qDebug() << "=== NEW" << obj;
+ if (!debugger) {
+ debugger = new Debugger();
+ }
+ connect(obj, SIGNAL(destroyed(QObject*)),
+ debugger, SLOT(printDestroyed(QObject*)));
+#endif
+}
+
+void Debugger::printDestroyed(QObject *obj)
+{
+#ifdef DEBUG
+ qDebug() << "=== DEL" << obj;
+#endif
+}
=======================================
--- /dev/null
+++ /cores/qtcore/src/debugger.h Sat Oct 1 01:25:22 2011
@@ -0,0 +1,17 @@
+#ifndef DEBUG_H
+#define DEBUG_H
+
+#include <QObject>
+
+class Debugger : public QObject
+{
+ Q_OBJECT
+
+public:
+ static void traceObj(QObject *obj);
+
+public slots:
+ void printDestroyed(QObject *obj);
+};
+
+#endif
=======================================
--- /dev/null
+++ /cores/qtcore/src/dockiconclick.h Sat Oct 1 01:25:22 2011
@@ -0,0 +1,24 @@
+#ifndef ONERING_DOCKICONCLICK_H
+#define ONERING_DOCKICONCLICK_H
+
+#include <QObject>
+
+class DockIconClickMonitor : public QObject
+{
+ Q_OBJECT
+
+ public:
+ DockIconClickMonitor();
+ ~DockIconClickMonitor();
+
+ void emitEvent();
+
+ signals:
+ void dockIconClicked();
+
+ private:
+ class Private;
+ Private* d;
+};
+
+#endif
=======================================
--- /dev/null
+++ /cores/qtcore/src/
dockiconclick.mm Sat Oct 1 01:25:22 2011
@@ -0,0 +1,47 @@
+#include <Cocoa/Cocoa.h>
+#include <QDebug>
+#include "dockiconclick.h"
+
+@interface DockIconClickEventHandler : NSObject
+{
+@public
+ DockIconClickMonitor* monitor;
+}
+- (void)handle:(NSAppleEventDescriptor*)event
withReplyEvent:(NSAppleEventDescriptor*)replyEvent;
+@end
+
+@implementation DockIconClickEventHandler
+- (void)handle:(NSAppleEventDescriptor*)event
withReplyEvent:(NSAppleEventDescriptor*)replyEvent {
+ if (monitor)
+ monitor->emitEvent();
+}
+@end
+
+class DockIconClickMonitor::Private
+{
+ public:
+ DockIconClickEventHandler* handler;
+};
+
+DockIconClickMonitor::DockIconClickMonitor()
+{
+ d = new DockIconClickMonitor::Private();
+ d->handler = [[DockIconClickEventHandler alloc] init];
+ d->handler->monitor = this;
+
+ [[NSAppleEventManager sharedAppleEventManager]
+ setEventHandler:d->handler
+ andSelector:@selector(handle:withReplyEvent:)
+ forEventClass:kCoreEventClass
+ andEventID:kAEReopenApplication];
+}
+
+DockIconClickMonitor::~DockIconClickMonitor()
+{
+ delete d;
+}
+
+void DockIconClickMonitor::emitEvent()
+{
+ emit dockIconClicked();
+}
=======================================
--- /dev/null
+++ /cores/qtcore/src/jsapi.cpp Sat Oct 1 01:25:22 2011
@@ -0,0 +1,126 @@
+// includes {{{
+#include <QDebug>
+#include <QApplication>
+#include <qwebview.h>
+#include <qwebframe.h>
+#include <QWebInspector>
+#include <QIcon>
+#include <QUrl>
+#include <QNetworkRequest>
+#include <QNetworkReply>
+#include <QSystemTrayIcon>
+#include <QApplication>
+#include "jsapi.h"
+#include "oneringview.h"
+#include "app.h"
+#include "networkaccessmanager.h"
+#include "systemtrayicon.h"
+#include "menu.h"
+#include "debugger.h"
+#include "application.h"
+// }}}
+
+// public methods {{{
+
+JsApi::JsApi(QObject *parent)
+ : QObject(parent)
+{
+}
+
+JsApi::~JsApi()
+{
+}
+
+void JsApi::setWebView(QWebView *view)
+{
+ QWebPage *page = view->page();
+ frame = page->mainFrame();
+
+ attachObject();
+ connect(frame, SIGNAL(javaScriptWindowObjectCleared()), this,
SLOT(attachObject()));
+}
+
+void JsApi::setWindow(QWidget *window)
+{
+ this->window = window;
+}
+
+void JsApi::attachObject()
+{
+ frame->addToJavaScriptWindowObject(QString("_OneRing"), this);
+}
+
+void JsApi::invokeCallback(const QString &funcname)
+{
+ qDebug() << "invokeCallback" << funcname;
+
+ frame->evaluateJavaScript(QString("ONERING.callback('%1');
null;").arg(funcname));
+}
+
+void JsApi::invokeCallback(const QString &funcname, const QString ¶m)
+{
+ qDebug() << "invokeCallback" << funcname << param;
+
+ QString jsparam = param;
+ // escape javascript string
+ jsparam.replace('\\', "\\\\").replace('\'', "\\'");
+ frame->evaluateJavaScript(
+ QString("ONERING.callback('%1', '%2'); null;")
+ .arg(funcname, jsparam));
+}
+
+// }}}
+
+// javascript api {{{
+
+QVariant JsApi::test(QVariant param)
+{
+ qDebug() << param;
+ return QVariant();
+}
+
+void JsApi::log(const QString &s)
+{
+ qDebug() << "JsApi::log" << s;
+}
+
+QString JsApi::call(const QString &method, const QString &url, const
QString &body) const
+{
+ qDebug() << "JsApi::call" << method << url << body;
+ QUrl absurl = frame->baseUrl().resolved(url);
+ QString response = call_app_body(method, absurl, body);
+ if (response.isEmpty()) {
+ response = "null";
+ }
+ qDebug() << "JsApi::call" << url << "returns" << response;
+ return response;
+}
+
+void JsApi::ajax(const QString &type, const QString &url, const QString
&body, const QString &callback, bool async)
+{
+ Q_UNUSED(async);
+
+ qDebug() << "JsApi::ajax" << type << url << body << callback;
+ QUrl absurl = frame->baseUrl().resolved(url);
+ QByteArray response = call_app_body(type, absurl, body);
+ invokeCallback(callback, response);
+}
+
+QString JsApi::getCurrentWindowId()
+{
+ return App::generateObjectId(window);
+}
+
+QObject* JsApi::getPubSubHub()
+{
+ return &(static_cast<Application *>(qApp)->pubsubhub);
+}
+
+QString JsApi::resolve(const QString &relative)
+{
+ return frame->baseUrl().resolved(relative).toString();
+}
+
+// }}}
+
+// vim:set foldmethod=marker:
=======================================
--- /dev/null
+++ /cores/qtcore/src/jsapi.h Sat Oct 1 01:25:22 2011
@@ -0,0 +1,52 @@
+#ifndef JSAPI_H
+#define JSAPI_H
+
+#include <qobject.h>
+#include <QWebInspector>
+#include <QHash>
+#include <QList>
+#include <QVariantMap>
+
+class QWebView;
+class QWebFrame;
+class OneRingView;
+
+typedef QPair<QObject*, QString> EventSource;
+
+class JsApi : public QObject
+{
+ Q_OBJECT
+
+public:
+ JsApi(QObject *parent);
+ ~JsApi();
+
+ void setWebView(QWebView *view);
+ void setWindow(QWidget *window);
+ void invokeCallback(const QString &funcname);
+ void invokeCallback(const QString &funcname, const QString ¶m);
+
+ Q_INVOKABLE QObject* getPubSubHub(void);
+ Q_INVOKABLE QString resolve(const QString &relative);
+ Q_INVOKABLE QString call(const QString& method, const QString& url,
+ const QString& body) const;
+
+public slots:
+ QVariant test(QVariant param);
+
+ void log(const QString &s);
+ void ajax(const QString &type, const QString &url, const QString &body,
const QString &callback, bool async);
+ QString getCurrentWindowId();
+
+private slots:
+ void attachObject();
+
+private:
+ QWidget *window;
+ QWebFrame *frame;
+ QHash< EventSource, QList<QString> > callbacks;
+
+ void registerCallback(QObject *sender, const QString &event, const
QString &callback_funcname);
+};
+
+#endif
=======================================
--- /dev/null
+++ /cores/qtcore/src/json.cpp Sat Oct 1 01:25:22 2011
@@ -0,0 +1,428 @@
+/**
+ * \file json.h
+ *
+ * \author Eeli Reilin <
ee...@nilier.org>,
+ * Mikko Ahonen <
mikko.j...@jyu.fi>
+ * \version 0.1
+ * \date 8/25/2010
+ */
+
+#include <QDebug>
+
+#include "json.h"
+
+/**
+ * parse
+ */
+QVariant Json::parse(const QString &json)
+{
+ bool success = true;
+ return Json::parse(json, success);
+}
+
+/**
+ * parse
+ */
+QVariant Json::parse(const QString &json, bool &success)
+{
+ success = true;
+
+ //Return an empty QVariant if the JSON data is either null or empty
+ if(!json.isNull() || !json.isEmpty())
+ {
+ QString data = json;
+ //We'll start from index 0
+ int index = 0;
+
+ //Parse the first value
+ QVariant value = Json::parseValue(data, index, success);
+
+ //Return the parsed value
+ return value;
+ }
+ else
+ {
+ //Return the empty QVariant
+ return QVariant();
+ }
+}
+
+/**
+ * parseValue
+ */
+QVariant Json::parseValue(const QString &json, int &index, bool &success)
+{
+ //Determine what kind of data we should parse by
+ //checking out the upcoming token
+ switch(Json::lookAhead(json, index))
+ {
+ case JsonTokenString:
+ return Json::parseString(json, index, success);
+ case JsonTokenNumber:
+ return Json::parseNumber(json, index);
+ case JsonTokenCurlyOpen:
+ return Json::parseObject(json, index, success);
+ case JsonTokenSquaredOpen:
+ return Json::parseArray(json, index, success);
+ case JsonTokenTrue:
+ Json::nextToken(json, index);
+ return QVariant(true);
+ case JsonTokenFalse:
+ Json::nextToken(json, index);
+ return QVariant(false);
+ case JsonTokenNull:
+ Json::nextToken(json, index);
+ return QVariant();
+ case JsonTokenNone:
+ break;
+ }
+
+ //If there were no tokens, flag the failure and return an empty QVariant
+ success = false;
+ return QVariant();
+}
+
+/**
+ * parseObject
+ */
+QVariant Json::parseObject(const QString &json, int &index, bool &success)
+{
+ QVariantMap map;
+ int token;
+
+ //Get rid of the whitespace and increment index
+ Json::nextToken(json, index);
+
+ //Loop through all of the key/value pairs of the object
+ bool done = false;
+ while(!done)
+ {
+ //Get the upcoming token
+ token = Json::lookAhead(json, index);
+
+ if(token == JsonTokenNone)
+ {
+ success = false;
+ return QVariantMap();
+ }
+ else if(token == JsonTokenComma)
+ {
+ Json::nextToken(json, index);
+ }
+ else if(token == JsonTokenCurlyClose)
+ {
+ Json::nextToken(json, index);
+ return map;
+ }
+ else
+ {
+ //Parse the key/value pair's name
+ QString name = Json::parseString(json, index, success).toString();
+
+ if(!success)
+ {
+ return QVariantMap();
+ }
+
+ //Get the next token
+ token = Json::nextToken(json, index);
+
+ //If the next token is not a colon, flag the failure
+ //return an empty QVariant
+ if(token != JsonTokenColon)
+ {
+ success = false;
+ return QVariant(QVariantMap());
+ }
+
+ //Parse the key/value pair's value
+ QVariant value = Json::parseValue(json, index, success);
+
+ if(!success)
+ {
+ return QVariantMap();
+ }
+
+ //Assign the value to the key in the map
+ map[name] = value;
+ }
+ }
+
+ //Return the map successfully
+ return QVariant(map);
+}
+
+/**
+ * parseArray
+ */
+QVariant Json::parseArray(const QString &json, int &index, bool &success)
+{
+ QVariantList list;
+
+ Json::nextToken(json, index);
+
+ bool done = false;
+ while(!done)
+ {
+ int token = Json::lookAhead(json, index);
+
+ if(token == JsonTokenNone)
+ {
+ success = false;
+ return QVariantList();
+ }
+ else if(token == JsonTokenComma)
+ {
+ Json::nextToken(json, index);
+ }
+ else if(token == JsonTokenSquaredClose)
+ {
+ Json::nextToken(json, index);
+ break;
+ }
+ else
+ {
+ QVariant value = Json::parseValue(json, index, success);
+
+ if(!success)
+ {
+ return QVariantList();
+ }
+
+ list.push_back(value);
+ }
+ }
+
+ return QVariant(list);
+}
+
+/**
+ * parseString
+ */
+QVariant Json::parseString(const QString &json, int &index, bool &success)
+{
+ QString s;
+ QChar c;
+
+ Json::eatWhitespace(json, index);
+
+ c = json[index++];
+
+ bool complete = false;
+ while(!complete)
+ {
+ if(index == json.size())
+ {
+ break;
+ }
+
+ c = json[index++];
+
+ if(c == '\"')
+ {
+ complete = true;
+ break;
+ }
+ else if(c == '\\')
+ {
+ if(index == json.size())
+ {
+ break;
+ }
+
+ c = json[index++];
+
+ if(c == '\"')
+ {
+ s.append('\"');
+ }
+ else if(c == '\\')
+ {
+ s.append('\\');
+ }
+ else if(c == '/')
+ {
+ s.append('/');
+ }
+ else if(c == 'b')
+ {
+ s.append('\b');
+ }
+ else if(c == 'f')
+ {
+ s.append('\f');
+ }
+ else if(c == 'n')
+ {
+ s.append('\n');
+ }
+ else if(c == 'r')
+ {
+ s.append('\r');
+ }
+ else if(c == 't')
+ {
+ s.append('\t');
+ }
+ else if(c == 'u')
+ {
+ int remainingLength = json.size() - index;
+
+ if(remainingLength >= 4)
+ {
+ QString unicodeStr = json.mid(index, 4);
+
+ int symbol = unicodeStr.toInt(0, 16);
+
+ s.append(QChar(symbol));
+
+ index += 4;
+ }
+ else
+ {
+ break;
+ }
+ }
+ }
+ else
+ {
+ s.append(c);
+ }
+ }
+
+ if(!complete)
+ {
+ success = false;
+ return QVariant();
+ }
+
+ return QVariant(s);
+}
+
+/**
+ * parseNumber
+ */
+QVariant Json::parseNumber(const QString &json, int &index)
+{
+ Json::eatWhitespace(json, index);
+
+ int lastIndex = Json::lastIndexOfNumber(json, index);
+ int charLength = (lastIndex - index) + 1;
+ QString numberStr;
+
+ numberStr = json.mid(index, charLength);
+
+ index = lastIndex + 1;
+
+ return QVariant(numberStr);
+}
+
+/**
+ * lastIndexOfNumber
+ */
+int Json::lastIndexOfNumber(const QString &json, int index)
+{
+ int lastIndex;
+
+ for(lastIndex = index; lastIndex < json.size(); lastIndex++)
+ {
+ if(QString("0123456789+-.eE").indexOf(json[lastIndex]) == -1)
+ {
+ break;
+ }
+ }
+
+ return lastIndex -1;
+}
+
+/**
+ * eatWhitespace
+ */
+void Json::eatWhitespace(const QString &json, int &index)
+{
+ for(; index < json.size(); index++)
+ {
+ if(QString(" \t\n\r").indexOf(json[index]) == -1)
+ {
+ break;
+ }
+ }
+}
+
+/**
+ * lookAhead
+ */
+int Json::lookAhead(const QString &json, int index)
+{
+ int saveIndex = index;
+ return Json::nextToken(json, saveIndex);
+}
+
+/**
+ * nextToken
+ */
+int Json::nextToken(const QString &json, int &index)
+{
+ Json::eatWhitespace(json, index);
+
+ if(index == json.size())
+ {
+ return JsonTokenNone;
+ }
+
+ QChar c = json[index];
+ index++;
+ switch(c.toAscii())
+ {
+ case '{': return JsonTokenCurlyOpen;
+ case '}': return JsonTokenCurlyClose;
+ case '[': return JsonTokenSquaredOpen;
+ case ']': return JsonTokenSquaredClose;
+ case ',': return JsonTokenComma;
+ case '"': return JsonTokenString;
+ case '0': case '1': case '2': case '3': case '4':
+ case '5': case '6': case '7': case '8': case '9':
+ case '-': return JsonTokenNumber;
+ case ':': return JsonTokenColon;
+ }
+
+ index--;
+
+ int remainingLength = json.size() - index;
+
+ //True
+ if(remainingLength >= 4)
+ {
+ if (json[index] == 't' && json[index + 1] == 'r' &&
+ json[index + 2] == 'u' && json[index + 3] == 'e')
+ {
+ index += 4;
+ return JsonTokenTrue;
+ }
+ }
+
+ //False
+ if (remainingLength >= 5)
+ {
+ if (json[index] == 'f' && json[index + 1] == 'a' &&
+ json[index + 2] == 'l' && json[index + 3] == 's' &&
+ json[index + 4] == 'e')
+ {
+ index += 5;
+ return JsonTokenFalse;
+ }
+ }
+
+ //Null
+ if (remainingLength >= 4)
+ {
+ if (json[index] == 'n' && json[index + 1] == 'u' &&
+ json[index + 2] == 'l' && json[index + 3] == 'l')
+ {
+ index += 4;
+ return JsonTokenNull;
+ }
+ }
+
+ return JsonTokenNone;
+}
=======================================
--- /dev/null
+++ /cores/qtcore/src/json.h Sat Oct 1 01:25:22 2011
@@ -0,0 +1,157 @@
+/**
+ * \file json.h
+ *
+ * \author Eeli Reilin <
ee...@nilier.org>,
+ * Mikko Ahonen <
mikko.j...@jyu.fi>
+ * \version 0.1
+ * \date 8/25/2010
+ */
+
+#ifndef JSON_H
+#define JSON_H
+
+#include <QVariant>
+#include <QString>
+
+/**
+ * \enum JsonToken
+ */
+enum JsonToken
+{
+ JsonTokenNone = 0,
+ JsonTokenCurlyOpen = 1,
+ JsonTokenCurlyClose = 2,
+ JsonTokenSquaredOpen = 3,
+ JsonTokenSquaredClose = 4,
+ JsonTokenColon = 5,
+ JsonTokenComma = 6,
+ JsonTokenString = 7,
+ JsonTokenNumber = 8,
+ JsonTokenTrue = 9,
+ JsonTokenFalse = 10,
+ JsonTokenNull = 11
+};
+
+/**
+ * \class Json
+ * \brief A JSON data parser
+ *
+ * Json parses a JSON data into a QVariant hierarchy.
+ */
+class Json
+{
+ public:
+ /**
+ * Parse a JSON string
+ *
+ * \param json The JSON data
+ */
+ static QVariant parse(const QString &json);
+
+ /**
+ * Parse a JSON string
+ *
+ * \param json The JSON data
+ * \param success The success of the parsing
+ */
+ static QVariant parse(const QString &json, bool &success);
+
+ private:
+ /**
+ * Parses a value starting from index
+ *
+ * \param json The JSON data
+ * \param index The start index
+ * \param success The success of the parse process
+ *
+ * \return QVariant The parsed value
+ */
+ static QVariant parseValue(const QString &json, int &index,
+ bool &success);
+
+ /**
+ * Parses an object starting from index
+ *
+ * \param json The JSON data
+ * \param index The start index
+ * \param success The success of the object parse
+ *
+ * \return QVariant The parsed object map
+ */
+ static QVariant parseObject(const QString &json, int &index,
+ bool &success);
+
+ /**
+ * Parses an array starting from index
+ *
+ * \param json The JSON data
+ * \param index The starting index
+ * \param success The success of the array parse
+ *
+ * \return QVariant The parsed variant array
+ */
+ static QVariant parseArray(const QString &json, int &index,
+ bool &success);
+
+ /**
+ * Parses a string starting from index
+ *
+ * \param json The JSON data
+ * \param index The starting index
+ * \param success The success of the string parse
+ *
+ * \return QVariant The parsed string
+ */
+ static QVariant parseString(const QString &json, int &index,
+ bool &success);
+
+ /**
+ * Parses a number starting from index
+ *
+ * \param json The JSON data
+ * \param index The starting index
+ *
+ * \return QVariant The parsed number
+ */
+ static QVariant parseNumber(const QString &json, int &index);
+
+ /**
+ * Get the last index of a number starting from index
+ *
+ * \param json The JSON data
+ * \param index The starting index
+ *
+ * \return The last index of the number
+ */
+ static int lastIndexOfNumber(const QString &json, int index);
+
+ /**
+ * Skip unwanted whitespace symbols starting from index
+ *
+ * \param json The JSON data
+ * \param index The start index
+ */
+ static void eatWhitespace(const QString &json, int &index);
+
+ /**
+ * Check what token lies ahead
+ *
+ * \param json The JSON data
+ * \param index The starting index
+ *
+ * \return int The upcoming token
+ */
+ static int lookAhead(const QString &json, int index);
+
+ /**
+ * Get the next JSON token
+ *
+ * \param json The JSON data
+ * \param index The starting index
+ *
+ * \return int The next JSON token
+ */
+ static int nextToken(const QString &json, int &index);
+};
+
+#endif //JSON_H
=======================================
--- /dev/null
+++ /cores/qtcore/src/menu.cpp Sat Oct 1 01:25:22 2011
@@ -0,0 +1,136 @@
+#include <QDebug>
+#include <QObject>
+#include <QString>
+#include <QMenu>
+#include <QUrl>
+#include <QKeySequence>
+#include <assert.h>
+#include "menu.h"
+
+static MenuApp* g_manager = 0;
+
+MenuApp::MenuApp(const QString& appname, QObject* parent)
+ : App(appname, parent)
+{
+}
+
+QByteArray MenuApp::processCall(const QString& command, const QVariantMap&
param)
+{
+ if (command == "Menu.create") {
+ return createMenu();
+ } else if (command.startsWith("Menu.")) {
+ QString id = param.value("id").toString();
+ QMenu* menu = static_cast<QMenu *>(getInstance(id));
+ if (!menu) {
+ return "{\"err\":\"invalid id\"}";
+ }
+ if (command == "Menu.destroy") {
+ return destroyMenu(menu);
+ } else if (command == "Menu.addSeparator") {
+ return addSeparator(menu);
+ } else if (command == "Menu.addMenuItem") {
+ return addMenuItem(menu, param.value("text").toString());
+ } else if (command == "Menu.getMenuItem") {
+ return getMenuItem(menu, param.value("index").toInt());
+ }
+ } else if (command.startsWith("MenuItem.")) {
+ QString id = param.value("id").toString();
+ QAction* item = static_cast<QAction *>(getInstance(id));
+ if (!item) {
+ return "{\"err\":\"invalid id\"}";
+ }
+ if (command == "MenuItem.setProperties") {
+ return setMenuItemProperties(item, param);
+ } else if (command == "MenuItem.setText") {
+ return setMenuItemText(item, param.value("text").toString());
+ }
+ }
+
+ return "{\"err\":\"invalid command\"}";
+}
+
+QByteArray MenuApp::createMenu()
+{
+ QMenu* menu = new QMenu();
+ return
QString("{\"type\":\"Menu\",\"id\":\"%1\"}").arg(getId(menu)).toLatin1();
+}
+
+QByteArray MenuApp::destroyMenu(QMenu* menu)
+{
+ delete menu;
+ return "null";
+}
+
+QByteArray MenuApp::addSeparator(QMenu* menu)
+{
+ menu->addSeparator();
+ return "null";
+}
+
+QByteArray MenuApp::addMenuItem(QMenu* menu, const QString& text)
+{
+ QAction* action = menu->addAction(text);
+ connect(action, SIGNAL(triggered(bool)),
+ this, SLOT(menuItemTriggered(bool)));
+ return
QString("{\"type\":\"MenuItem\",\"id\":\"%1\"}").arg(getId(action)).toLatin1();
+}
+
+QByteArray MenuApp::getMenuItem(QMenu* menu, int index)
+{
+ QList<QAction *> actions = menu->actions();
+ if (index < 0 || index >= actions.size()) {
+ return "null";
+ }
+ QAction* action = actions[index];
+ return
QString("{\"type\":\"MenuItem\",\"id\":\"%1\"}").arg(getId(action)).toLatin1();
+}
+
+QByteArray MenuApp::setMenuItemProperties(QAction* item, const
QVariantMap& props)
+{
+ if (props.contains("shortcut")) {
+ QString shortcut = props.value("shortcut").toString();
+ item->setShortcut(QKeySequence(shortcut));
+ item->setShortcutContext(Qt::ApplicationShortcut);
+ }
+ if (props.contains("enabled")) {
+ item->setEnabled(props.value("enabled").toBool());
+ }
+ if (props.contains("disabled")) {
+ item->setEnabled(!(props.value("disabled").toBool()));
+ }
+ return "null";
+}
+
+QByteArray MenuApp::setMenuItemText(QAction* item, const QString& text)
+{
+ item->setText(text);
+ return "null";
+}
+
+void MenuApp::menuItemTriggered(bool checked)
+{
+ publishEvent("MenuItem", sender(), "triggered",
+ QString("{\"checked\":%1}").arg(checked ? "true" : "false"));
+}
+
+static void* menu_app(const char* appname, const char* method,
+ const char* path, const char* body, int body_len,
+ const char** response, int* response_len)
+{
+ if (!g_manager) {
+ g_manager = new MenuApp(appname);
+ }
+
+ return g_manager->processRequest(appname, method, path, QByteArray(body,
body_len), response, response_len);
+}
+
+
+static void menu_app_free_response(const char* appname, void*
response_handle)
+{
+ g_manager->freeResponse(appname, response_handle);
+}
+
+void register_menu_app(const char* appname)
+{
+ onering_register_app(appname, &menu_app, &menu_app_free_response);
+}
=======================================
--- /dev/null
+++ /cores/qtcore/src/menu.h Sat Oct 1 01:25:22 2011
@@ -0,0 +1,36 @@
+#ifndef MENU_H
+#define MENU_H
+
+#include <onering.h>
+#include <QSet>
+#include <QMenu>
+#include <QVariantMap>
+#include "app.h"
+
+class MenuApp : public App
+{
+Q_OBJECT
+
+public:
+ MenuApp(const QString& appname, QObject* parent=0);
+
+private:
+ QByteArray createMenu();
+ QByteArray destroyMenu(QMenu* menu);
+ QByteArray addSeparator(QMenu* menu);
+ QByteArray addMenuItem(QMenu* menu, const QString& text);
+ QByteArray getMenuItem(QMenu* menu, int index);
+
+ QByteArray setMenuItemProperties(QAction* action, const QVariantMap&
props);
+ QByteArray setMenuItemText(QAction* action, const QString& text);
+
+private slots:
+ void menuItemTriggered(bool checked=false);
+
+private:
+ QByteArray processCall(const QString& command, const QVariantMap& param);
+};
+
+void register_menu_app(const char* appname);
+
+#endif
=======================================
--- /dev/null
+++ /cores/qtcore/src/networkaccessmanager.cpp Sat Oct 1 01:25:22 2011
@@ -0,0 +1,41 @@
+#include <QDebug>
+#include <QtNetwork>
+#include <QIODevice>
+#include <onering.h>
+#include "networkaccessmanager.h"
+#include "appreply.h"
+#include "app.h"
+#include "debugger.h"
+
+NetworkAccessManager::NetworkAccessManager(QObject *parent,
QNetworkAccessManager *manager)
+ : QNetworkAccessManager(parent)
+{
+ if (manager) {
+ setCache(manager->cache());
+ setCookieJar(manager->cookieJar());
+ setProxy(manager->proxy());
+ setProxyFactory(manager->proxyFactory());
+ }
+
+ methods[QNetworkAccessManager::HeadOperation] = "HEAD";
+ methods[QNetworkAccessManager::GetOperation] = "GET";
+ methods[QNetworkAccessManager::PutOperation] = "PUT";
+ methods[QNetworkAccessManager::PostOperation] = "POST";
+ methods[QNetworkAccessManager::DeleteOperation] = "DELETE";
+}
+
+QNetworkReply *NetworkAccessManager::createRequest(
+ QNetworkAccessManager::Operation operation,
+ const QNetworkRequest &request,
+ QIODevice *device)
+{
+ const QUrl& url = request.url();
+ if (is_appname_registered(url.host())) {
+// qDebug() << "delegate to app" << url.toString();
+ AppReply *reply = new AppReply(methods[operation], url, device, this);
+ Debugger::traceObj(reply);
+ return reply;
+ }
+
+ return QNetworkAccessManager::createRequest(operation, request, device);
+}
=======================================
--- /dev/null
+++ /cores/qtcore/src/networkaccessmanager.h Sat Oct 1 01:25:22 2011
@@ -0,0 +1,20 @@
+#ifndef NETWORKACCESSMANAGER_H
+#define NETWORKACCESSMANAGER_H
+
+#include <QNetworkAccessManager>
+
+class NetworkAccessManager : public QNetworkAccessManager
+{
+ Q_OBJECT
+
+public:
+ NetworkAccessManager(QObject *parent = 0, QNetworkAccessManager
*oldManager=0);
+
+protected:
+ QNetworkReply *createRequest(Operation operation, const QNetworkRequest
&request, QIODevice *device);
+
+private:
+ const char* methods[10];
+};
+
+#endif
=======================================
--- /dev/null
+++ /cores/qtcore/src/oneringapp.cpp Sat Oct 1 01:25:22 2011
@@ -0,0 +1,143 @@
+#include <QApplication>
+#include <QDebug>
+#include <QFile>
+#include <onering.h>
+#include "application.h"
+#include "oneringapp.h"
+#include "oneringview.h"
+#include "debugger.h"
+
+static OneRingApp* g_app = 0;
+
+OneRingApp::OneRingApp(const QString& appname, QObject *parent)
+ : App(appname, parent)
+{
+ QFile file(":/js/onering.js");
+ if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
+ return;
+ }
+ _js = file.readAll();
+ file.close();
+ _js.prepend("HTTP/1.1 200 OK\r\nContent-Type:
application/javascript\r\n\r\n");
+
+#ifdef Q_WS_MAC
+#ifdef QT_MAC_USE_COCOA
+ connect(static_cast<Application *>(qApp), SIGNAL(dockIconClicked()),
+ this, SLOT(dockIconClicked()));
+#endif
+#endif
+}
+
+QByteArray OneRingApp::processCall(const QString& command, const
QVariantMap& param)
+{
+ if (command == "onering.js") {
+ return _js;
+ } else if (command == "Window.create") {
+ OneRingView* window = createWindow(param);
+ _windows.insert(window);
+ connect(window, SIGNAL(destroyed(QObject *)),
+ this, SLOT(windowDestroyed(QObject *)));
+ window->show();
+ return QString("{\"type\":\"Window\",\"id\":\"%1\"}")
+ .arg(getId(window)).toLatin1();
+ } else if (command.startsWith("Window.")) {
+ QString id = param.value("id").toString();
+ OneRingView* window = static_cast<OneRingView *>(getInstance(id));
+
+ if (command == "Window.isAlive") {
+ return _windows.contains(window) ? "true" : "false";
+ } else if (!window) {
+ return "{\"err\":\"invalid id\"}";
+ } else if (command == "Window.showInspector") {
+ window->showInspector();
+ return "null";
+ } else if (command == "Window.hide") {
+ window->hide();
+ return "null";
+ } else if (command == "Window.show") {
+ window->show();
+ return "null";
+ } else if (command == "Window.maximize") {
+ window->showMaximized();
+ return "null";
+ } else if (command == "Window.showNormal") {
+ window->showNormal();
+ return "null";
+ } else if (command == "Window.isMinimized") {
+ return window->isMinimized() ? "true" : "false";
+ } else if (command == "Window.activateWindow") {
+ window->activateWindow();
+ return "null";
+ }
+ } else if (command.startsWith("Application.")) {
+ if (command == "Application.setQuitOnLastWindowClosed") {
+ qApp->setQuitOnLastWindowClosed(param["quit"].toBool());
+ return "null";
+ } else if (command == "Application.exit") {
+ qApp->quit();
+ return "null";
+ }
+ } else if (command == "Event.preventDefault") {
+ QString id = param.value("id").toString();
+ QEvent* event = static_cast<QEvent *>(getInstance(id));
+ if (!event) {
+ return "{\"err\":\"invalid id\"}";
+ }
+ event->ignore();
+ return "null";
+ }
+
+ return "{\"err\":\"invalid command\"}";
+}
+
+OneRingView* OneRingApp::createWindow(const QVariantMap& props)
+{
+ if (!g_app) {
+ g_app = new OneRingApp("onering");
+ }
+
+ OneRingView* window = new OneRingView(props);
+ connect(window, SIGNAL(eventOccurred(QEvent*, const QString&)),
+ g_app, SLOT(windowEventOccurred(QEvent*, const QString&)));
+ return window;
+}
+
+void OneRingApp::windowEventOccurred(QEvent* e, const QString& type)
+{
+ publishEvent("Window", sender(), type, e);
+}
+
+void OneRingApp::windowDestroyed(QObject *obj)
+{
+ _windows.remove(static_cast<OneRingView *>(obj));
+}
+
+#ifdef Q_WS_MAC
+#ifdef QT_MAC_USE_COCOA
+void OneRingApp::dockIconClicked()
+{
+ publishEvent("Application", 0, "dockIconClicked");
+}
+#endif
+#endif
+
+static void* app(const char *appname, const char* method, const char*
path, const char* body, int body_len, const char **response, int
*response_len)
+{
+ if (!g_app) {
+ g_app = new OneRingApp(appname);
+ }
+
+ return g_app->processRequest(appname, method, path, QByteArray(body,
body_len), response, response_len);
+}
+
+static void free_response(const char *appname, void* response_handle)
+{
+ g_app->freeResponse(appname, response_handle);
+}
+
+void register_onering_app(const char* appname)
+{
+ onering_register_app(appname, &app, &free_response);
+}
+
+
=======================================
--- /dev/null
+++ /cores/qtcore/src/oneringapp.h Sat Oct 1 01:25:22 2011
@@ -0,0 +1,38 @@
+#ifndef ONERINGAPP_H
+#define ONERINGAPP_H
+
+#include <onering.h>
+#include <QVariantMap>
+#include <QSet>
+#include <QByteArray>
+#include <QEvent>
+#include "oneringview.h"
+#include "app.h"
+
+class OneRingApp : public App
+{
+ Q_OBJECT
+
+public:
+ OneRingApp(const QString& appname, QObject* parent=0);
+
+ static OneRingView* createWindow(const QVariantMap& props);
+
+private slots:
+ void windowEventOccurred(QEvent* e, const QString& type);
+ void windowDestroyed(QObject *);
+#ifdef Q_WS_MAC
+#ifdef QT_MAC_USE_COCOA
+ void dockIconClicked();
+#endif
+#endif
+
+private:
+ QByteArray processCall(const QString& command, const QVariantMap&
param);
+ QByteArray _js;
+ QSet<OneRingView *> _windows;
+};
+
+void register_onering_app(const char* appname);
+
+#endif
=======================================
--- /dev/null
+++ /cores/qtcore/src/oneringview.cpp Sat Oct 1 01:25:22 2011
@@ -0,0 +1,123 @@
+#include <QDebug>
+#include <QPair>
+#include <QEvent>
+#include <QCloseEvent>
+#include "oneringview.h"
+#include "networkaccessmanager.h"
+#include "jsapi.h"
+#include "debugger.h"
+
+OneRingView::OneRingView(const QVariantMap &props)
+ : QWebView(),
+#ifdef CONTEXTMENU
+ contextMenuEnabled(true),
+#else
+ contextMenuEnabled(false),
+#endif
+ inspector(0)
+{
+ QNetworkAccessManager *oldManager = page()->networkAccessManager();
+ NetworkAccessManager *newManager = new NetworkAccessManager(this,
oldManager);
+ Debugger::traceObj(newManager);
+ page()->setNetworkAccessManager(newManager);
+
+#ifdef DEBUG
+ connect(this, SIGNAL(urlChanged(const QUrl &)),
+ this, SLOT(printCurrentUrl(const QUrl &)));
+#endif
+
+ connect(this, SIGNAL(titleChanged(const QString &)),
+ this, SLOT(setWindowTitle(const QString &)));
+
+ jsapi = new JsApi(this);
+ Debugger::traceObj(jsapi);
+ jsapi->setWebView(this);
+ jsapi->setWindow(this);
+
+ setAttribute(Qt::WA_DeleteOnClose, true);
+
+ setProperties(props);
+}
+
+OneRingView::~OneRingView()
+{
+ if (inspector) {
+ delete inspector;
+ }
+}
+
+void OneRingView::printCurrentUrl(const QUrl &url)
+{
+ qDebug() << "nav to:" << url.toString();
+}
+
+void OneRingView::contextMenuEvent(QContextMenuEvent *ev)
+{
+ if (contextMenuEnabled) {
+ QWebView::contextMenuEvent(ev);
+ }
+}
+
+void OneRingView::changeEvent(QEvent * event)
+{
+ switch (event->type()) {
+ case QEvent::WindowStateChange:
+ emit eventOccurred(event, "windowStateChange");
+ break;
+ default:
+ ;
+ }
+ QWebView::changeEvent(event);
+}
+
+void OneRingView::closeEvent(QCloseEvent *event)
+{
+ emit eventOccurred(event, "close");
+}
+
+void OneRingView::activateWindow()
+{
+ QWebView::activateWindow();
+}
+
+void OneRingView::setProperties(const QVariantMap& props)
+{
+ load(props["url"].toString());
+ resize(props["width"].toInt(), props["height"].toInt());
+
+ if (props["fixedSize"].toBool()) {
+ setFixedSize(width(), height());
+ }
+ if (!props["title"].toString().isEmpty()) {
+ setWindowTitle(props["title"].toString());
+ }
+
+ if (props.contains("minimizeButton")
+ || props.contains("maximizeButton")) {
+ Qt::WindowFlags flags = Qt::Widget;
+ flags |= Qt::CustomizeWindowHint
+ | Qt::WindowTitleHint
+ | Qt::WindowSystemMenuHint
+ | Qt::WindowMinimizeButtonHint
+ | Qt::WindowMaximizeButtonHint
+ | Qt::WindowCloseButtonHint;
+ if (!(props.value("minimizeButton", QVariant(true)).toBool()))
+ flags ^= Qt::WindowMinimizeButtonHint;
+ if (!(props.value("maximizeButton", QVariant(true)).toBool()))
+ flags ^= Qt::WindowMaximizeButtonHint;
+ setWindowFlags(flags);
+ }
+}
+
+void OneRingView::showInspector()
+{
+ if (!inspector) {
+ inspector = new QWebInspector();
+ }
+ if (!inspector->page()) {
+ inspector->setPage(page());
+ }
+ inspector->resize(800, 600);
+ inspector->show();
+ inspector->activateWindow(); // put inspector at the top most
+}
=======================================
--- /dev/null
+++ /cores/qtcore/src/oneringview.h Sat Oct 1 01:25:22 2011
@@ -0,0 +1,44 @@
+#ifndef ONERINGVIEW_H
+#define ONERINGVIEW_H
+
+#include <QWebView>
+#include <QHash>
+#include <QEvent>
+#include <QList>
+#include <QPair>
+#include <QWebInspector>
+#include "jsapi.h"
+
+class OneRingView : public QWebView
+{
+ Q_OBJECT
+
+public:
+ OneRingView(const QVariantMap &props);
+ ~OneRingView();
+
+ void setProperties(const QVariantMap &props);
+ void showInspector(void);
+
+signals:
+ void eventOccurred(QEvent *event, const QString& type);
+
+public slots:
+ void activateWindow(void);
+
+private slots:
+ void printCurrentUrl(const QUrl &url);
+
+protected:
+ void contextMenuEvent(QContextMenuEvent *ev);
+ void changeEvent(QEvent* event);
+ void closeEvent(QCloseEvent* event);
+ void initializEventMap(void);
+
+private:
+ bool contextMenuEnabled;
+ JsApi *jsapi;
+ QWebInspector *inspector;
+};
+
+#endif
=======================================
--- /dev/null
+++ /cores/qtcore/src/pluginloader.cpp Sat Oct 1 01:25:22 2011
@@ -0,0 +1,109 @@
+#include <QDir>
+#include <QLibrary>
+#include <QDebug>
+#include <onering.h>
+#include "pluginloader.h"
+
+int PluginLoader::loadDir(const QDir& dir)
+{
+ int n_loaded_plugins = 0;
+ QStringList entries = dir.entryList();
+
+ for (int i = 0; i < entries.size(); ++i) {
+ if (entries[i] == "." || entries[i] == "..")
+ continue;
+ QString path = dir.filePath(entries[i]);
+ if (loadPlugin(path)) {
+ n_loaded_plugins += 1;
+ }
+ }
+
+ return n_loaded_plugins;
+}
+
+bool PluginLoader::loadPlugin(const QString& path)
+{
+ QLibrary lib(path);
+ if (!lib.load()) {
+ qDebug() << "load plugin" << path << "failed";
+ return false;
+ }
+
+ require_onering_version_func_t require_onering_version =
(require_onering_version_func_t) lib.resolve("require_onering_version");
+ get_onering_appname_func_t get_onering_appname =
(get_onering_appname_func_t) lib.resolve("get_onering_appname");
+ register_onering_plugin_func_t register_onering_plugin =
(register_onering_plugin_func_t) lib.resolve("register_onering_plugin");
+ set_onering_helpers_func_t set_onering_helpers =
(set_onering_helpers_func_t) lib.resolve("set_onering_helpers");
+
+ if (!require_onering_version || !get_onering_appname |
| !register_onering_plugin || !set_onering_helpers) {
+ qDebug() << path << "is not an onering plugin";
+ lib.unload();
+ return false;
+ }
+
+ const QString required_version = require_onering_version();
+ if (!versionMatch(required_version, onering_version())) {
+ qDebug() << path << "requires" << required_version << ", not me";
+ lib.unload();
+ return false;
+ }
+
+ static onering_helpers_t helpers = {
+ onering_call_app,
+ onering_free_response,
+ onering_register_app,
+ onering_subscribe,
+ onering_unsubscribe,
+ onering_publish,
+ };
+ set_onering_helpers(&helpers);
+
+ if (int ret = register_onering_plugin(get_onering_appname())) {
+ qDebug() << path << "register failed:" << ret;
+ lib.unload();
+ return false;
+ }
+
+ return true;
+}
+
+bool PluginLoader::versionMatch(const QString& pluginRequiredVersion,
const QString& coreVersion)
+{
+ QStringList coreV = coreVersion.split(' ', QString::SkipEmptyParts);
+ if (coreV.size() != 2) {
+ qDebug() << "Core version" << coreVersion << "is invalid";
+ return false;
+ }
+
+ QStringList patterns = pluginRequiredVersion.split('|');
+ for (int i = 0; i < patterns.size(); ++i) {
+ QStringList require = patterns[i].split(' ', QString::SkipEmptyParts);
+ if (require.size() == 2 && require[0] == coreV[0] &&
versionCompare(require[1], coreV[1]) <= 0) {
+ return true;
+ }
+ }
+ return false;
+}
+
+// compare between versions like "1.0.0" and "0.9".
+int PluginLoader::versionCompare(const QString& v1, const QString& v2)
+{
+ int i1, i2;
+ QStringList l1 = v1.split('.');
+ QStringList l2 = v2.split('.');
+
+ for (int i = 0; ; ++i) {
+ if (i >= l1.size()) {
+ return (i >= l2.size()) ? 0 : -1;
+ } else if (i >= l2.size()) {
+ return 1;
+ }
+
+ i1 = l1[i].toInt();
+ i2 = l2[i].toInt();
+ if (i1 > i2) {
+ return 1;
+ } else if (i1 < i2) {
+ return -1;
+ }
+ }
+}
=======================================
--- /dev/null
+++ /cores/qtcore/src/pluginloader.h Sat Oct 1 01:25:22 2011
@@ -0,0 +1,19 @@
+#ifndef PLUGINLOADER_H
+#define PLUGINLOADER_H
+
+#include <QObject>
+#include <QDir>
+#include <QString>
+
+class PluginLoader : public QObject
+{
+public:
+ static int loadDir(const QDir& dir);
+ static bool loadPlugin(const QString& path);
+ static bool versionMatch(const QString& pluginRequiredVersion, const
QString& coreVersion);
+
+private:
+ static int versionCompare(const QString& v1, const QString& v2);
+};
+
+#endif
=======================================
--- /dev/null
+++ /cores/qtcore/src/publishevent.cpp Sat Oct 1 01:25:22 2011
@@ -0,0 +1,26 @@
+#include <QDebug>
+#include "publishevent.h"
+
+int PublishEvent::_type = QEvent::registerEventType();
+
+PublishEvent::PublishEvent(const char *channel, const char *msg)
+ : QEvent(static_cast<QEvent::Type>(_type)),
+ _channel(channel),
+ _msg(msg)
+{
+}
+
+const QString& PublishEvent::channel()
+{
+ return _channel;
+}
+
+const QString& PublishEvent::message()
+{
+ return _msg;
+}
+
+int PublishEvent::type()
+{
+ return _type;
+}
=======================================
--- /dev/null
+++ /cores/qtcore/src/publishevent.h Sat Oct 1 01:25:22 2011
@@ -0,0 +1,22 @@
+#ifndef PUBLISHEVENT_H
+#define PUBLISHEVENT_H
+
+#include <QEvent>
+#include <QString>
+
+class PublishEvent : public QEvent
+{
+public:
+ PublishEvent(const char *channel, const char *msg);
+
+ const QString& channel(void);
+ const QString& message(void);
+ static int type(void);
+
+private:
+ QString _channel;
+ QString _msg;
+ static int _type;
+};
+
+#endif
=======================================
--- /dev/null
+++ /cores/qtcore/src/pubsubhub.cpp Sat Oct 1 01:25:22 2011
@@ -0,0 +1,9 @@
+#include <QDebug>
+#include "publishevent.h"
+#include "pubsubhub.h"
+
+void PubSubHub::publish(const QString& channel, const QString& message)
+{
+ qDebug() << "publish" << channel << message;
+ emit published(channel, message);
+}
=======================================
--- /dev/null
+++ /cores/qtcore/src/pubsubhub.h Sat Oct 1 01:25:22 2011
@@ -0,0 +1,17 @@
+#ifndef PUBSUBHUB_H
+#define PUBSUBHUB_H
+
+#include <QObject>
+
+class PubSubHub : public QObject
+{
+Q_OBJECT
+
+public:
+ void publish(const QString &channel, const QString &message);
+
+signals:
+ void published(const QString &channel, const QString &message);
+};
+
+#endif
=======================================
--- /dev/null
+++ /cores/qtcore/src/qtcore.cpp Sat Oct 1 01:25:22 2011
@@ -0,0 +1,95 @@
+#include <QDesktopServices>
+#include <QDir>
+#include <QDebug>
+#include <QApplication>
+#include <QCoreApplication>
+#include <QWebSettings>
+#include <QWebSecurityOrigin>
+#include <string.h>
+#include <onering.h>
+#include "oneringview.h"
+#include "app.h"
+#include "oneringapp.h"
+#include "dataloader.h"
+#include "application.h"
+#include "publishevent.h"
+#include "cocoainit.h"
+#include "pluginloader.h"
+
+// Implementations of APIs in oneirng.h:
+//
+// onering_register_app() implemented in app.cpp
+//
+
+int onering_loop(const char* appname)
+{
+ int argc = 1;
+ char name[ONERING_MAX_APPNAME_LEN+1];
+ char *argv[] = {name};
+
+ strncpy(name, appname, ONERING_MAX_APPNAME_LEN);
+ name[ONERING_MAX_APPNAME_LEN] = '\0';
+
+#ifdef Q_WS_MAC
+#ifdef QT_MAC_USE_COCOA
+ CocoaInitializer cocoaInitializer;
+#endif
+#endif
+ Application app(argc, argv);
+ int retval = app.load(appname);
+ if (retval)
+ return retval;
+ return app.exec();
+}
+
+const char* onering_version()
+{
+ return "QtCore 1.0.0";
+}
+
+int onering_load_plugins(const char* dir)
+{
+ return PluginLoader::loadDir(QDir(dir));
+}
+
+void* onering_call_app(const char* appname, const char* method, const
char* path, const char* body, int body_len, const char** response, int*
response_len)
+{
+ onering_app_func_t app;
+ onering_free_response_func_t free_response;
+
+ if (get_app(appname, &app, &free_response)) {
+ *response = "404 Not Found";
+ *response_len = strlen(*response);
+ return NULL;
+ }
+
+ return app(appname, method, path, body, body_len, response, response_len);
+}
+
+void onering_free_response(const char* appname, void* response_handle)
+{
+ onering_app_func_t app;
+ onering_free_response_func_t free_response;
+
+ if (get_app(appname, &app, &free_response)) {
+ return;
+ }
+
+ free_response(appname, response_handle);
+}
+
+void onering_subscribe(const char* channel, const char* callback_appname,
const char* callback_method)
+{
+}
+
+void onering_unsubscribe(const char* channel, const char*
callback_appname, const char* callback_method)
+{
+}
+
+void onering_publish(const char* channel, const char* msg)
+{
+ Application *app = static_cast<Application *>(qApp);
+ if (app && !app->quiting) {
+ app->pubsubhub.publish(channel, msg);
+ }
+}
=======================================
--- /dev/null
+++ /cores/qtcore/src/systemtrayicon.cpp Sat Oct 1 01:25:22 2011
@@ -0,0 +1,110 @@
+#include <QDebug>
+#include <QApplication>
+#include <QMenu>
+#include "systemtrayicon.h"
+#include "jsapi.h"
+#include "dataloader.h"
+#include "debugger.h"
+
+static SystemTrayIconApp* g_app = 0;
+
+SystemTrayIconApp::SystemTrayIconApp(const QString& appname, QObject
*parent)
+ : App(appname, parent)
+{
+}
+
+QByteArray SystemTrayIconApp::processCall(const QString& command, const
QVariantMap& param)
+{
+ QSystemTrayIcon* icon;
+
+ if (command == "create") {
+ icon = new QSystemTrayIcon();
+ connect(icon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
+ this, SLOT(notifyClicked(QSystemTrayIcon::ActivationReason)));
+ return QString("{\"type\":\"SystemTrayIcon\",\"id\":\"%1\"}")
+ .arg(getId(icon)).toLatin1();
+ }
+
+
+ QString id = param.value("id").toString();
+ icon = static_cast<QSystemTrayIcon *>(getInstance(id));
+ if (!icon) {
+ return "{\"err\":\"invalid id\"}";
+ }
+
+ if (command == "destroy") {
+ delete icon;
+ return "null";
+ } else if (command == "load") {
+ DataLoader *loader = new DataLoader(icon);
+ connect(loader, SIGNAL(got(QByteArray&)),
+ this, SLOT(iconFetched(QByteArray&)));
+ connect(loader, SIGNAL(got(QByteArray&)),
+ loader, SLOT(deleteLater()));
+ loader->load(param["url"].toString());
+ return "null";
+ } else if (command == "setContextMenu") {
+ QString menu_id = param.value("menuId").toString();
+ QMenu* menu = static_cast<QMenu *>(getInstance(menu_id));
+ if (!menu) {
+ return "{\"err\":\"invalid menu id\"}";
+ }
+ icon->setContextMenu(menu);
+ return "null";
+ }
+
+ return "{\"err\":\"invalid command\"}";
+}
+
+void SystemTrayIconApp::iconFetched(QByteArray &data)
+{
+ QSystemTrayIcon *icon = static_cast<QSystemTrayIcon
*>(sender()->parent());
+
+ QPixmap pixmap;
+ pixmap.loadFromData(data);
+
+ icon->setIcon(QIcon(pixmap));
+ icon->show();
+}
+
+void SystemTrayIconApp::notifyClicked(QSystemTrayIcon::ActivationReason
reason)
+{
+ QSystemTrayIcon *icon = static_cast<QSystemTrayIcon *>(sender());
+ QString channel = QString("systray.SystemTrayIcon.%1.").arg(getId(icon));
+
+ switch (reason) {
+ case QSystemTrayIcon::Trigger:
+ publishEvent("SystemTrayIcon", icon, "click");
+ break;
+ case QSystemTrayIcon::Context:
+ publishEvent("SystemTrayIcon", icon, "rightclick");
+ break;
+ case QSystemTrayIcon::DoubleClick:
+ publishEvent("SystemTrayIcon", icon, "doubleclick");
+ break;
+ default:
+ ;
+ }
+}
+
+static void* app(const char* appname, const char* method,
+ const char* path, const char* body, int body_len,
+ const char** response, int* response_len)
+{
+ if (!g_app) {
+ g_app = new SystemTrayIconApp(appname);
+ }
+
+ return g_app->processRequest(appname, method, path, QByteArray(body,
body_len), response, response_len);
+}
+
+
+static void app_free_response(const char* appname, void* response_handle)
+{
+ g_app->freeResponse(appname, response_handle);
+}
+
+void register_systray_app(const char* appname)
+{
+ onering_register_app(appname, &app, &app_free_response);
+}
=======================================
--- /dev/null
+++ /cores/qtcore/src/systemtrayicon.h Sat Oct 1 01:25:22 2011
@@ -0,0 +1,25 @@
+#ifndef SYSTEMTRAYICON_H
+#define SYSTEMTRAYICON_H
+
+#include <QSystemTrayIcon>
+#include <QByteArray>
+#include "app.h"
+
+class SystemTrayIconApp : public App
+{
+Q_OBJECT
+
+public:
+ SystemTrayIconApp(const QString& appname, QObject* parent=0);
+
+private:
+ QByteArray processCall(const QString& command, const QVariantMap& param);
+
+private slots:
+ void iconFetched(QByteArray &data);
+ void notifyClicked(QSystemTrayIcon::ActivationReason reason);
+};
+
+void register_systray_app(const char* appname);
+
+#endif
=======================================
--- /dev/null
+++ /cores/qtcore/test/Makefile Sat Oct 1 01:25:22 2011
@@ -0,0 +1,17 @@
+all: test plugin
+
+test: test.c
+ gcc -o test $^ -I ../../include -F.. -framework OneringQtCore
+
+plugin: testplugin.so testplugin2.so
+
+testplugin.so: testplugin.c
+ gcc -o testplugin.so $^ -I ../../include -shared
+ cp testplugin.so plugins
+
+testplugin2.so: testplugin2.c
+ gcc -o testplugin2.so $^ -I ../../include -shared
+ cp testplugin2.so plugins
+
+clean:
+ rm test testplugin.so testplugin2.so
=======================================
--- /dev/null
+++ /cores/qtcore/test/test.c Sat Oct 1 01:25:22 2011
@@ -0,0 +1,40 @@
+#include <string.h>
+#include <stdio.h>
+#include <onering.h>
+
+void* test_app(const char* appname, const char* method, const char* path,
const char* body, int body_len, const char** response, int* response_len)
+{
+ if (strcmp(path, "/init") == 0) {
+ *response = "{\"width\": 400, \"height\": 300, \"url\": \"/\"}";
+ } else {
+ *response = "<html><head><script
src='onering://onering/onering.js'></script></head><body><p>Hello,
World!</p></body></html>";
+ }
+ *response_len = strlen(*response);
+ return 0;
+}
+
+void free_response(const char* appname, void* response_handle)
+{
+}
+
+int main()
+{
+ printf("load %d plugins\n", onering_load_plugins("plugins"));
+ onering_register_app("test", &test_app, &free_response);
+
+ const char* response;
+ int response_len;
+ void* handler;
+
+ printf("GET onering://testplugin/ ->\n");
+ onering_call_app("testplugin", "GET", "/", NULL, 0, &response,
&response_len);
+ printf("%s\n", response);
+ onering_free_response("testplugin", handler);
+
+ printf("GET onering://testplugin2/ ->\n");
+ handler = onering_call_app("testplugin2", "GET", "/", NULL, 0, &response,
&response_len);
+ printf("%s\n", response);
+ onering_free_response("testplugin2", handler);
+
+ return 0;
+}
=======================================
--- /dev/null
+++ /cores/qtcore/test/testplugin.c Sat Oct 1 01:25:22 2011
@@ -0,0 +1,39 @@
+#include <string.h>
+#include <onering.h>
+
+onering_helpers_t* h = NULL;
+
+ONERING_EXPORT const char* require_onering_version()
+{
+ return "QtCore 1.0";
+}
+
+ONERING_EXPORT const char* get_onering_appname()
+{
+ return "testplugin";
+}
+
+void* app(const char* appname, const char* method, const char* path, const
char* body, int body_len, const char**response, int* response_len)
+{
+ *response = "Hello Test Plugin";
+ *response_len = strlen(*response);
+ return 0;
+}
+
+void free_response(const char* appname, void* handler)
+{
+}
+
+ONERING_EXPORT int register_onering_plugin(const char* appname)
+{
+ if (!h) {
+ return -2;
+ }
+
+ return h->register_app(appname, &app, &free_response);
+}
+
+ONERING_EXPORT void set_onering_helpers(onering_helpers_t* helpers)
+{
+ h = helpers;
+}
=======================================
--- /dev/null
+++ /cores/qtcore/test/testplugin2.c Sat Oct 1 01:25:22 2011
@@ -0,0 +1,39 @@
+#include <string.h>
+#include <onering.h>
+
+onering_helpers_t* h = NULL;
+
+ONERING_EXPORT const char* require_onering_version()
+{
+ return "QtCore 1.0";
+}
+
+ONERING_EXPORT const char* get_onering_appname()
+{
+ return "testplugin2";
+}
+
+void* app(const char* appname, const char* method, const char* path, const
char* body, int body_len, const char**response, int* response_len)
+{
+ *response = "Hello Test Plugin 2";
+ *response_len = strlen(*response);
+ return 0;
+}
+
+void free_response(const char* appname, void* handler)
+{
+}
+
+ONERING_EXPORT int register_onering_plugin(const char* appname)
+{
+ if (!h) {
+ return -2;
+ }
+
+ return h->register_app(appname, &app, &free_response);
+}
+
+ONERING_EXPORT void set_onering_helpers(onering_helpers_t* helpers)
+{
+ h = helpers;
+}
=======================================
--- /qtcore/js/onering.js Sat Oct 1 01:15:29 2011
+++ /dev/null
@@ -1,406 +0,0 @@
-ONERING = new Object();
-
-// Base {{{
-ONERING.Base = function() {};
-ONERING.Base.prototype = {
- _call: function(command, param) {
- if (!param) { param = {}; }
-
param.id =
this.id;
- return ONERING.call_app(this.appname, command, param);
- },
- _create: function(command, param) {
- var obj = ONERING.call_app(this.appname, command, param);
- if (!(this.validate_type(obj))) {
- throw new Error(this.type + " not created");
- }
- return obj;
- },
- _destroy: function(command) {
- if (!
this.id) { return; }
- var r = this._call(command);
-
this.id = null;
- return r;
- },
- validate_type: function(obj) {
- return (obj && obj.type == this.type);
- },
- bind: function(event, callback) {
- ONERING.subscribe(this.appname+"."+this.type+"."+
this.id+"."+event,
- function(e) {
- if (e instanceof Object && e.event_id) {
- e = new ONERING.Event(e.event_id);
- }
- callback(e);
- });
- },
- unbind: function(event) {
- ONERING.unsubscribe(this.appname+"."+this.type+"."+
this.id+"."+event);
- },
- extend: function(d) {
- for (var k in d) {
- this[k] = d[k];
- }
- return this;
- },
-};
-//}}}
-
-// Event {{{
-ONERING.Event = function(id) {
-
this.id = id;
-};
-ONERING.Event.prototype = (new ONERING.Base()).extend({
- appname: "onering",
- type: "Event",
- preventDefault: function() {
- this._call("Event.preventDefault");
- }
- });
-// }}}
-
-// Application {{{
-
-ONERING.Application = function() {
-
this.id = 0;
-};
-ONERING.Application.prototype = (new ONERING.Base()).extend({
- appname: "onering",
- type: "Application",
- setQuitOnLastWindowClosed: function(quit) {
- return this._call("Application.setQuitOnLastWindowClosed", {quit:
quit}),
- },
- exit: function() {
- this._call("Application.exit");
- },
- });
-
-ONERING.application = new ONERING.Application();
-ONERING.getApplication = function() {
- return ONERING.application;
-};
-
-// }}}
-
-// Window {{{
-
-ONERING.Window = function(obj) {
- if (!this.validate_type(obj)) {
- throw new Error("invalid type");
- }
-
this.id =
obj.id;
-};
-ONERING.Window.prototype = (new ONERING.Base()).extend({
- appname: "onering",
- type: "Window",
- createWindow: function(url, width, height, props) {
- url = ONERING.resolve(url);
- props.url = url;
- props.width = width;
- props.height = height;
- var window = this._create("Window.create", props);
- return new ONERING.Window(window);
- },
- isAlive: function() {
- return this._call("Window.isAlive");
- },
- showInspector: function() {
- return this._call("Window.showInspector");
- },
- hide: function() {
- return this._call("Window.hide");
- },
- show: function() {
- return this._call("Window.show");
- },
- maximize: function() {
- return this._call("Window.maximize");
- },
- showNormal: function() {
- return this._call("Window.showNormal");
- },
- isMinimized: function() {
- return this._call("Window.isMinimized");
- },
- activateWindow: function() {
- return this._call("Window.activateWindow");
- }
-
- });
-
-ONERING.window = new ONERING.Window({type: "Window",
- id: _OneRing.getCurrentWindowId()});
-
-ONERING.getCurrentWindow = function() {
- return ONERING.window;
-};
-
-// shortcuts
-ONERING.createWindow = function(url, width, height, props) {
- return ONERING.getCurrentWindow().createWindow(url, width, height, props);
-};
-
-// }}}
-
-// System Tray Icon {{{
-
-ONERING.SystemTrayIcon = function(url) {
-
this.id = this._create("create").id;
- if (url) {
- this.load(url);
- }
-};
-ONERING.SystemTrayIcon.prototype = (new ONERING.Base()).extend({
- appname: "systray",
- type: "SystemTrayIcon",
- destroy: function() {
- this._destroy("destroy");
- },
- load: function(url) {
- return this._call("load", {url: ONERING.resolve(url)});
- },
- setContextMenu: function(menu) {
- return this._call("setContextMenu", {menuId:
menu.id});
- }
- });
-
-// }}}
-
-// Menu {{{
-
-ONERING.Menu = function(items) {
-
this.id = this._create("Menu.create").id;
- for (var i=0; i<items.length; i++) {
- var item = items[i];
- if (item === ONERING.Menu.SEPARATOR) {
- this.addSeparator();
- } else {
- this.addItem(item[0], item[1], item[2]);
- }
- };
-};
-ONERING.Menu.SEPARATOR = Object(); // a const
-ONERING.Menu.prototype = new ONERING.Base();
-ONERING.Menu.prototype.extend({
- appname: "menu",
- type: "Menu",
- destroy: function() {
- this._destroy("Menu.destroy");
- },
- addSeparator: function() {
- return this._call("Menu.addSeparator");
- },
- addItem: function(title, callback, props) {
- if (!(callback instanceof Function)) {
- props = callback;
- callback = null;
- }
- var item = new ONERING.MenuItem(this._call("Menu.addMenuItem", {text:
title}));
- if (callback) {
- item.bind('triggered', callback);
- }
- if (props) {
- item.setProperties(props);
- }
- },
- get: function(index) {
- return new ONERING.MenuItem(this._call("Menu.getMenuItem", {index:
index}));
- }
- });
-
-ONERING.MenuItem = function(item) {
- if (!item || item.type != this.type) {
- throw new Error("invalid menu item");
- }
-
this.id =
item.id;
-};
-ONERING.MenuItem.prototype = (new ONERING.Base()).extend({
- appname: "menu",
- type: "MenuItem",
- setProperties: function(props) {
- return this._call("MenuItem.setProperties", props);
- },
- setText: function(text) {
- return this._call("MenuItem.setText", {text: text});
- },
- setEnabled: function(enabled) {
- return this.setProperties({enabled: enabled});
- },
- });
-
-// }}}
-
-// subscribe/unsubscribe {{{
-
-ONERING.subscriptions = {};
-ONERING.hub = _OneRing.getPubSubHub().published;
-
-ONERING.subscribe = function(channel, callback) {
- var ss = ONERING.subscriptions[channel] = ONERING.subscriptions[channel] |
| {};
- var f = ss[callback] = ss[callback] || function(ch, msg) {
- if (ch === channel) {
- callback(JSON.parse(msg));
- }
- };
- ONERING.hub.connect(f);
-};
-
-ONERING.unsubscribe = function(channel, callback) {
- if (channel === undefined) {
- for (channel in ONERING.subscriptions) {
- ONERING.unsubscribe(channel);
- }
- } else {
- var ss = ONERING.subscriptions[channel];
- if (ss) {
- if (callback === undefined) {
- for (callback in ss) {
- ONERING.hub.disconnect(ss[callback]);
- }
- delete ONERING.subscriptions[channel];
- } else {
- var f = ss[callback];
- if (f) {
- ONERING.hub.disconnect(f);
- delete ss[callback];
- }
- }
- }
- }
-};
-
-window.addEventListener('unload', function() {
- ONERING.unsubscribe();
- });
-
-// }}}
-
-// functions {{{
-
-ONERING.log = function(o) {
- return _OneRing.log(o);
-};
-
-ONERING.callback = function(name, para) {
- var window_id = name.split('_')[1];
- if (window_id != ONERING._window_id) {
- return;
- }
- var f = _get_registered_function(name);
- if (f) {
- f(para);
- }
-};
-
-ONERING.exit = function() {
- ONERING.getApplication().exit();
-};
-
-ONERING.ajax = function(settings) {
- var url = settings.url;
- var data = settings.data || "";
- if ( data instanceof Object ) {
- data = ONERING.param(data);
- }
- var type = settings.type || "GET";
- var dataType = settings.dataType;
- var success = settings.success;
- var async = settings.async || true;
-
- if (data && type == "GET") {
- url += ((url.indexOf('?') < 0) ? '?' : '&') + data;
- data = "";
- }
-
- _OneRing.ajax(type, url, data, _register_function(function(s) {
- if (dataType == "json") {
- s = window.JSON.parse(s);
- }
- success && success(s);
- }), async);
-};
-
-ONERING.get = function(url, data, callback, dataType) {
- if (data instanceof Function) {
- dataType = dataType || callback;
- callback = data;
- data = null;
- }
-
- return ONERING.ajax({
- type: "GET",
- url: url,
- data: data,
- success: callback,
- dataType: dataType
- });
-};
-
-ONERING.getJSON = function(url, data, callback) {
- return ONERING.get(url, data, callback, "json");
-};
-
-ONERING.post = function(url, data, callback, dataType) {
- if (data instanceof Function) {
- dataType = dataType || callback;
- callback = data;
- data = null;
- }
-
- return ONERING.ajax({
- type: "POST",
- url: url,
- data: data,
- success: callback,
- dataType: dataType
- });
-};
-
-ONERING.call_app = function(appname, command, param) {
- var url = appname ? ("onering://"+appname+"/"+command) : ("/"+command);
- var data = JSON.stringify(param || {});
- var r = _OneRing.call("POST", url, data);
- r = JSON.parse(r);
- if (r && r.err) {
- throw new Error("ONERING.call_app("+appname+", "+command+") failed: " +
r.err);
- }
- return r;
-};
-
-ONERING.resolve = function(url) {
- return _OneRing.resolve(url);
-};
-
-// }}}
-
-// internal utilities {{{
-
-var _guid = 0;
-var _get_guid = function() {
- _guid += 1;
- return '' + _guid;
-};
-
-ONERING._window_id = Math.floor(Math.random()*1000000);
-
-var _registered_functions = new Object();
-var _register_function = function(func) {
- var name = 'f_' + ONERING._window_id + '_' + _get_guid();
- _registered_functions[name] = func;
- return name;
-};
-var _get_registered_function = function(name) {
- return _registered_functions[name];
-};
-
-ONERING.param = function(a) {
- var s = [];
- for (var key in a) {
- var value = a[key];
- s.push( encodeURIComponent(key) + "=" + encodeURIComponent(value) );
- }
- return s.join("&").replace(/%20/g, "+");
-};
-
-// }}}
-
-// vim:set foldmethod=marker:
=======================================
--- /qtcore/
qtcore.pro Sat Oct 1 01:15:29 2011
+++ /dev/null
@@ -1,79 +0,0 @@
-######################################################################
-# Automatically generated by qmake (2.01a) Thu Aug 19 21:40:02 2010
-######################################################################
-
-TEMPLATE = lib
-TARGET = OneRingQtCore
-DEPENDPATH += . ../include src
-INCLUDEPATH += . ../include
-QT += webkit network
-RESOURCES = qtcore.qrc
-CONFIG += shared
-DEFINES += ONERING_LIBRARY
-VERSION = 1
-macx {
- CONFIG += lib_bundle
- FRAMEWORK_HEADERS.version = Versions
- FRAMEWORK_HEADERS.files = ../include/onering.h
- FRAMEWORK_HEADERS.path = Headers
- QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS
- QMAKE_FRAMEWORK_BUNDLE_NAME = OneRingQtCore
- QMAKE_FRAMEWORK_VERSION = $$VERSION
-}
-
-!release {
- DEFINES += DEBUG
-}
-
-# Input
-HEADERS += \
- ../include/onering.h \
- src/app.h \
- src/application.h \
- src/appreply.h \
- src/dataloader.h \
- src/debugger.h \
- src/jsapi.h \
- src/json.h \
- src/menu.h \
- src/networkaccessmanager.h \
- src/oneringapp.h \
- src/oneringview.h \
- src/publishevent.h \
- src/pubsubhub.h \
- src/systemtrayicon.h \
- src/pluginloader.h
-
-SOURCES += \
- src/app.cpp \
- src/application.cpp \
- src/appreply.cpp \
- src/dataloader.cpp \
- src/debugger.cpp \
- src/jsapi.cpp \
- src/json.cpp \
- src/menu.cpp \
- src/networkaccessmanager.cpp \
- src/qtcore.cpp \
- src/oneringapp.cpp \
- src/oneringview.cpp \
- src/publishevent.cpp \
- src/pubsubhub.cpp \
- src/systemtrayicon.cpp \
- src/pluginloader.cpp
-
-# dock icon click
-macx {
- HEADERS += \
- src/cocoainit.h \
- src/dockiconclick.h
-
- OBJECTIVE_SOURCES += \
- src/
cocoainit.mm \
- src/
dockiconclick.mm
-
- LIBS += -framework AppKit
-}
-# end dock icon click
-
-macx:LIBS += -framework Carbon
=======================================
--- /qtcore/qtcore.qrc Sun Sep 11 02:13:42 2011
+++ /dev/null
@@ -1,5 +0,0 @@
-<!DOCTYPE RCC><RCC version="1.0">
-<qresource>
- <file>js/onering.js</file>
-</qresource>
-</RCC>
=======================================
--- /qtcore/src/app.cpp Sat Oct 1 01:15:29 2011
+++ /dev/null
@@ -1,170 +0,0 @@
-#include <QDebug>
-#include <QString>
-#include <QHash>
-#include <QPair>
-#include <QUrl>
-#include <string.h>
-#include <assert.h>
-#include <onering.h>
-#include "app.h"
-#include "json.h"
-
-QHash<QString, QPair<onering_app_func_t, onering_free_response_func_t> >
g_apps;
-
-int onering_register_app(const char* appname, onering_app_func_t app_func,
onering_free_response_func_t free_response_func)
-{
- if (strlen(appname) > ONERING_MAX_APPNAME_LEN) {
- return ONERING_ERR_INVALID_APPNAME;
- }
-
- qDebug() << "register app:" << appname;
- QPair<onering_app_func_t, onering_free_response_func_t> funcs(app_func,
free_response_func);
- g_apps[appname] = funcs;
- return 0;
-}
-
-int is_appname_registered(const QString &appname)
-{
- return g_apps.contains(appname);
-}
-
-int get_app(const char* appname, onering_app_func_t* app,
onering_free_response_func_t* free_respnose)
-{
- if (!is_appname_registered(appname)) {
- return -1;
- }
-
- *app = g_apps[appname].first;
- *free_respnose = g_apps[appname].second;
- return 0;
-}
-
-QByteArray call_app(const QString &method, const QUrl &url, const QString
&body)
-{
- QString appname = url.host();
- const char * response;
- int response_len;
- void* response_handle;
- QByteArray retval;
-
- if (is_appname_registered(appname)) {
- QByteArray surl = url.toString().toUtf8();
- QByteArray path_query = url.path().toUtf8();
- if (url.hasQuery()) {
- path_query += surl.mid(surl.indexOf('?'));
- }
-
- QByteArray qbody = body.toUtf8();
- response_handle = g_apps[appname].first(qPrintable(appname),
qPrintable(method), path_query, qbody.constData(), qbody.size(), &response,
&response_len);
- retval.append(response, response_len);
- // free response
- g_apps[appname].second(qPrintable(appname), response_handle);
- }
-
- return retval;
-}
-
-QByteArray call_app_body(const QString &method, const QUrl &url, const
QString &body)
-{
- QByteArray response = call_app(method, url, body);
-
- int index;
- if ((index = response.indexOf("\r\n")) < 0) {
- // not header/body seperator found.
- // consider the whole response is body
- return response;
- }
- QByteArray line = response.left(index);
- if (line.indexOf("200") < 0) {
- qDebug() << "error status line:" << line;
- return "";
- }
-
- if ((index = response.indexOf("\r\n\r\n")) < 0) {
- qDebug() << "Body not found:" << response;
- return "";
- }
- response.remove(0, index+4);
- return response;
-}
-
-App::App(const QString& appname, QObject* parent)
- : QObject(parent),
- appname(appname)
-{
-}
-
-void* App::processRequest(const char* appname,
- const char* method, const QString& path, const QByteArray& body,
- const char** response, int* response_len)
-{
- Q_UNUSED(appname);
- Q_UNUSED(method);
-
- assert(path.startsWith("/"));
-
- QByteArray* res = new QByteArray();
-
- QVariantMap param = Json::parse(QString::fromUtf8(body)).toMap();
- *res = processCall(path.mid(1), param);
-
- *response = res->constData();
- *response_len = res->size();
- return res;
-}
-
-void App::freeResponse(const char* appname, void* handle)
-{
- Q_UNUSED(appname);
-
- delete static_cast<QByteArray*>(handle);
-}
-
-QString App::generateObjectId(void* obj)
-{
- return QString::number(reinterpret_cast<unsigned long>(obj), 16);
-}
-
-
-QString App::getId(QObject* obj)
-{
- connect(obj, SIGNAL(destroyed(QObject*)),
- this, SLOT(instanceDestroyed(QObject*)),
- Qt::UniqueConnection);
- return generateObjectId(obj);
-}
-
-QString App::getId(void* obj)
-{
- return generateObjectId(obj);
-}
-
-void* App::getInstance(const QString& id)
-{
- bool ok;
- return reinterpret_cast<void *>(id.toULong(&ok, 16));
-}
-
-void App::instanceDestroyed(QObject* obj)
-{
- qDebug() << obj << "deleted";
-}
-
-void App::publishEvent(const QString& type, void* sender, const QString&
event)
-{
- publishEvent(type, sender, event, "null");
-}
-
-void App::publishEvent(const QString& type, void* sender, const QString&
event, QEvent* e)
-{
- QString data = QString("{\"event_id\":\"%1\"}").arg(getId(e));
- publishEvent(type, sender, event, data);
-}
-
-
-void App::publishEvent(const QString& type, void* sender, const QString&
event, const QString& data)
-{
- onering_publish(qPrintable(QString("%1.%2.%3.%4")
- .arg(appname, type, getId(sender), event)),
- qPrintable(data));
-}
=======================================
--- /qtcore/src/app.h Mon Sep 12 19:47:12 2011
+++ /dev/null
@@ -1,47 +0,0 @@
-#ifndef APP_H
-#define APP_H
-
-#include <onering.h>
-#include <QString>
-#include <QUrl>
-#include <QByteArray>
-#include <QVariantMap>
-#include <QEvent>
-#include <QSet>
-
-int is_appname_registered(const QString &appname);
-int get_app(const char* appname, onering_app_func_t* app,
onering_free_response_func_t* free_respnose);
-
-QByteArray call_app(const QString& method, const QUrl &url, const QString
&body);
-QByteArray call_app_body(const QString &method, const QUrl &url, const
QString &body);
-
-class App : public QObject
-{
- Q_OBJECT
-
-public:
- App(const QString& appname, QObject *parent=0);
-
- void* processRequest(const char* appname, const char* method, const
QString& path, const QByteArray& body, const char** response, int*
response_len);
- void freeResponse(const char* appname, void* response_handle);
-
- static QString generateObjectId(void* obj);
-
-private slots:
- void instanceDestroyed(QObject* obj);
-
-protected:
- QString getId(QObject* obj);
- QString getId(void* obj);
- void* getInstance(const QString& id);
- void publishEvent(const QString& type, void* sender, const QString&
event);
- void publishEvent(const QString& type, void* sender, const QString&
event, QEvent* e);
- void publishEvent(const QString& type, void* sender, const QString&
event, const QString& data);
-
-private:
- virtual QByteArray processCall(const QString& command, const QVariantMap&
param) = 0;
-
- QString appname;
-};
-
-#endif
=======================================
--- /qtcore/src/application.cpp Sun Sep 11 02:07:25 2011
+++ /dev/null
@@ -1,131 +0,0 @@
-#include <QDir>
-#include <QDebug>
-#include <QWebSettings>
-#include <QWebSecurityOrigin>
-#include <QVariantMap>
-#include <QDesktopServices>
-#include <QApplication>
-#include <QUrl>
-#include <onering.h>
-#include "application.h"
-#include "oneringapp.h"
-#include "app.h"
-#include "oneringview.h"
-#include "dataloader.h"
-#include "debugger.h"
-#include "json.h"
-#include "dockiconclick.h"
-
-// plugins
-#include "menu.h"
-#include "systemtrayicon.h"
-
-static QUrl getAbsUrl(const QString &url, const QString &appname)
-{
- QUrl u(url);
-
- if (u.isRelative()) {
- u.setScheme("onering");
- u.setHost(appname);
- }
- return u;
-}
-
-Application::Application(int &argc, char **argv)
- : QApplication(argc, argv),
- quiting(false)
-{
-#ifdef Q_WS_MAC
-#ifdef QT_MAC_USE_COCOA
- connect(&_dockIconClickMonitor, SIGNAL(dockIconClicked()),
- this, SIGNAL(dockIconClicked()));
-#endif
-#endif
-}
-
-Application::~Application()
-{
- quiting = true;
-}
-
-int Application::load(const char* appname)
-{
-#ifdef Q_OS_MAC
- QDir plugins_dir = QCoreApplication::applicationDirPath();
- if (!plugins_dir.path().startsWith("/System/")) {
-
plugins_dir.cd("../plugins");
- QCoreApplication::setLibraryPaths(QStringList(plugins_dir.path()));
- }
-#endif
- qDebug() << "plugins dir:" << QCoreApplication::libraryPaths();
-
- QWebSettings *settings = QWebSettings::globalSettings();
- settings->setAttribute(QWebSettings::JavascriptCanOpenWindows, true);
- settings->setAttribute(QWebSettings::JavascriptCanAccessClipboard, true);
- settings->setAttribute(QWebSettings::LocalStorageEnabled, true);
- settings->setAttribute(QWebSettings::LocalStorageDatabaseEnabled, true);
- settings->setAttribute(QWebSettings::LocalContentCanAccessRemoteUrls,
true);
- settings->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
-
- QWebSecurityOrigin::addLocalScheme("onering");
-
- register_onering_app("onering");
-
- // register plugin apps
- register_menu_app("menu");
- register_systray_app("systray");
-
- QUrl initurl;
- initurl.setScheme("onering");
- initurl.setHost(appname);
- initurl.setPath("/init");
- QByteArray response = call_app_body("GET", initurl, "");
-
- QVariantMap props = Json::parse(QString::fromLocal8Bit(response)).toMap();
-
- QString s;
- QUrl url;
- QDir dir;
-
- QString real_appname = props.value("appname", appname).toString();
- qDebug() << "appname:" << real_appname;
- QCoreApplication::setApplicationName(real_appname);
-
- s = props.value("storageDir").toString();
- dir = QDesktopServices::storageLocation(QDesktopServices::DataLocation);
- s = QDir::cleanPath(dir.filePath(s));
- qDebug() << "data location:" << s;
- settings->setLocalStoragePath(s);
-
- s = props.value("icon").toString();
- if (!s.isEmpty()) {
- url = getAbsUrl(s, appname);
- DataLoader *dataloader = new DataLoader();
- Debugger::traceObj(dataloader);
- connect(dataloader, SIGNAL(got(QByteArray&)),
- this, SLOT(setWindowIconByData(QByteArray&)));
- connect(dataloader, SIGNAL(got(QByteArray&)),
- dataloader, SLOT(deleteLater()));
- dataloader->load(url);
- }
-
- s = props["url"].toString();
- if (s.isEmpty()) {
- s = "/";
- }
- props["url"] = getAbsUrl(s, appname);
-
- OneRingView* window = OneRingApp::createWindow(props);
-
- window->show();
- return 0;
-}
-
-void Application::setWindowIconByData(QByteArray &data)
-{
- qDebug() << "setWindowIconByData";
- QPixmap pixmap;
- pixmap.loadFromData(data);
- setWindowIcon(QIcon(pixmap));
-}
-
=======================================
--- /qtcore/src/application.h Wed Aug 31 02:54:24 2011
+++ /dev/null
@@ -1,44 +0,0 @@
-#ifndef APPLICATION_H
-#define APPLICATION_H
-
-#include <QApplication>
-#include <QObject>
-#include "pubsubhub.h"
-#ifdef Q_WS_MAC
-#ifdef QT_MAC_USE_COCOA
-#include "dockiconclick.h"
-#endif
-#endif
-
-class Application : public QApplication
-{
- Q_OBJECT
-
-public:
- Application(int &argc, char **argv);
- ~Application();
-
- int load(const char* appname);
- PubSubHub pubsubhub;
- bool quiting;
-
-public slots:
- void setWindowIconByData(QByteArray &data);
-
-signals:
-#ifdef Q_WS_MAC
-#ifdef QT_MAC_USE_COCOA
- void dockIconClicked();
-#endif
-#endif
-
-#ifdef Q_WS_MAC
-#ifdef QT_MAC_USE_COCOA
-private:
- DockIconClickMonitor _dockIconClickMonitor;
-#endif
-#endif
-
-};
-
-#endif
=======================================
--- /qtcore/src/appreply.cpp Wed Aug 31 02:54:24 2011
+++ /dev/null
@@ -1,121 +0,0 @@
-#include <QDebug>
-#include <QtNetwork>
-#include <QIODevice>
-#include <QTimer>
-#include <string.h>
-#include <onering.h>
-#include "appreply.h"
-#include "app.h"
-
-
-AppReply::AppReply(const QUrl &url, QObject *parent)
- : QNetworkReply(parent)
-{
- AppReply("GET", url, 0, parent);
-}
-
-AppReply::AppReply(const char* method, const QUrl &url, QIODevice
*body_device, QObject *parent)
- : QNetworkReply(parent)
-{
- this->method = method;
- this->url = url;
- this->body_device = body_device;
-
- if (body_device) {
- qDebug() << "body_device connect";
- connect(body_device, SIGNAL(readyRead()),
- this, SLOT(readBody()));
- } else {
- QTimer::singleShot(0, this, SLOT(parseResponse()));
- }
-}
-
-void AppReply::readBody()
-{
- qDebug() << "body_device readyRead";
- this->body += this->body_device->readAll();
- if (this->body_device->atEnd()) {
- parseResponse();
- }
-}
-
-void AppReply::parseResponse()
-{
- content = call_app(method, url, body);
- offset = 0;
-
- open(ReadOnly | Unbuffered);
-
- // default attribute
- setAttribute(QNetworkRequest::HttpStatusCodeAttribute, 200);
- setHeader(QNetworkRequest::ContentTypeHeader, QVariant("text/html;
charset=UTF-8"));
-
- // TODO speed optimization needed
- int index;
- bool ok;
- int code;
- QByteArray line, key, value;
- QList<QByteArray> words;
- if ((index = content.indexOf("\r\n")) < 0) {
- goto finish;
- }
- line = content.left(index);
- words = line.split(' ');
- if (words.size() < 3) {
- goto finish;
- }
- code = words[1].toInt(&ok);
- if (!ok) {
- goto finish;
- }
- setAttribute(QNetworkRequest::HttpStatusCodeAttribute, code);
- offset = index + 2;
-
- // iterate over lines of header
- for(; (index = content.indexOf("\r\n", offset)) > offset; offset=index+2)
{
- line = content.mid(offset, index-offset);
- int pos = line.indexOf(':');
- if (pos <= 0) {
- continue;
- }
- key = line.left(pos);
- value = line.mid(pos+1).trimmed();
- setRawHeader(key, value);
- }
-
- if (index == offset) {
- // the CRLF seperate headers and body
- offset += 2;
- }
-
-finish:
-// qDebug() << "body:" << content.mid(offset);
- emit readyRead();
- emit finished();
-}
-
-void AppReply::abort()
-{
-}
-
-qint64 AppReply::bytesAvailable() const
-{
- return content.size() - offset;
-}
-
-bool AppReply::isSequential() const
-{
- return true;
-}
-
-qint64 AppReply::readData(char *data, qint64 maxSize)
-{
- if (offset < content.size()) {
- qint64 number = qMin(maxSize, content.size() - offset);
- memcpy(data, content.constData() + offset, number);
- offset += number;
- return number;
- } else
- return -1;
-}
-
=======================================
***Additional files exist in this changeset.***
==============================================================================
Revision: f13554e5e986
Author: Qiangning Hong <
hon...@gmail.com>
Date: Sun Nov 20 06:13:29 2011
Log: add skeleton of webkitcore
http://code.google.com/p/onering-desktop/source/detail?r=f13554e5e986
Added:
/cores/webkitcore/OneRing.xcodeproj/project.pbxproj
/cores/webkitcore/OneRing.xcodeproj/project.xcworkspace/contents.xcworkspacedata
/cores/webkitcore/OneRing.xcodeproj/project.xcworkspace/xcuserdata/hongqn.xcuserdatad/UserInterfaceState.xcuserstate
/cores/webkitcore/OneRing.xcodeproj/xcuserdata/hongqn.xcuserdatad/xcschemes/OneRing.xcscheme
/cores/webkitcore/OneRing.xcodeproj/xcuserdata/hongqn.xcuserdatad/xcschemes/xcschememanagement.plist
/cores/webkitcore/OneRing/OneRing-Info.plist
/cores/webkitcore/OneRing/OneRing-Prefix.pch
/cores/webkitcore/OneRing/OneRing.h
/cores/webkitcore/OneRing/OneRing.m
/cores/webkitcore/OneRing/en.lproj/InfoPlist.strings
/cores/webkitcore/OneRingTests/OneRingTests-Info.plist
/cores/webkitcore/OneRingTests/OneRingTests.h
/cores/webkitcore/OneRingTests/OneRingTests.m
/cores/webkitcore/OneRingTests/en.lproj/InfoPlist.strings
=======================================
--- /dev/null
+++ /cores/webkitcore/OneRing.xcodeproj/project.pbxproj Sun Nov 20 06:13:29
2011
@@ -0,0 +1,434 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 46;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ EA45678B1479421A00830199 /* Cocoa.framework in Frameworks */ = {isa =
PBXBuildFile; fileRef = EA45678A1479421A00830199 /* Cocoa.framework */; };
+ EA4567951479421A00830199 /* InfoPlist.strings in Resources */ = {isa =
PBXBuildFile; fileRef = EA4567931479421A00830199 /* InfoPlist.strings */; };
+ EA4567991479421A00830199 /* OneRing.m in Sources */ = {isa =
PBXBuildFile; fileRef = EA4567981479421A00830199 /* OneRing.m */; };
+ EA4567A11479421A00830199 /* SenTestingKit.framework in Frameworks */ =
{isa = PBXBuildFile; fileRef = EA4567A01479421A00830199 /*
SenTestingKit.framework */; };
+ EA4567A21479421A00830199 /* Cocoa.framework in Frameworks */ = {isa =
PBXBuildFile; fileRef = EA45678A1479421A00830199 /* Cocoa.framework */; };
+ EA4567A51479421A00830199 /* OneRing.framework in Frameworks */ = {isa =
PBXBuildFile; fileRef = EA4567871479421A00830199 /* OneRing.framework */; };
+ EA4567AB1479421A00830199 /* InfoPlist.strings in Resources */ = {isa =
PBXBuildFile; fileRef = EA4567A91479421A00830199 /* InfoPlist.strings */; };
+ EA4567AD1479421A00830199 /* OneRingTests.h in Resources */ = {isa =
PBXBuildFile; fileRef = EA4567AC1479421A00830199 /* OneRingTests.h */; };
+ EA4567AF1479421A00830199 /* OneRingTests.m in Sources */ = {isa =
PBXBuildFile; fileRef = EA4567AE1479421A00830199 /* OneRingTests.m */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXContainerItemProxy section */
+ EA4567A31479421A00830199 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = EA45677D1479421A00830199 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = EA4567861479421A00830199;
+ remoteInfo = OneRing;
+ };
+/* End PBXContainerItemProxy section */
+
+/* Begin PBXFileReference section */
+ EA4567871479421A00830199 /* OneRing.framework */ = {isa =
PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0;
path = OneRing.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ EA45678A1479421A00830199 /* Cocoa.framework */ = {isa =
PBXFileReference; lastKnownFileType = wrapper.framework; name =
Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework;
sourceTree = SDKROOT; };
+ EA45678D1479421A00830199 /* AppKit.framework */ = {isa =
PBXFileReference; lastKnownFileType = wrapper.framework; name =
AppKit.framework; path = System/Library/Frameworks/AppKit.framework;
sourceTree = SDKROOT; };
+ EA45678E1479421A00830199 /* CoreData.framework */ = {isa =
PBXFileReference; lastKnownFileType = wrapper.framework; name =
CoreData.framework; path = System/Library/Frameworks/CoreData.framework;
sourceTree = SDKROOT; };
+ EA45678F1479421A00830199 /* Foundation.framework */ = {isa =
PBXFileReference; lastKnownFileType = wrapper.framework; name =
Foundation.framework; path =
System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
+ EA4567921479421A00830199 /* OneRing-Info.plist */ = {isa =
PBXFileReference; lastKnownFileType = text.plist.xml; path
= "OneRing-Info.plist"; sourceTree = "<group>"; };
+ EA4567941479421A00830199 /* en */ = {isa = PBXFileReference;
lastKnownFileType = text.plist.strings; name = en; path =
en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ EA4567961479421A00830199 /* OneRing-Prefix.pch */ = {isa =
PBXFileReference; lastKnownFileType = sourcecode.c.h; path
= "OneRing-Prefix.pch"; sourceTree = "<group>"; };
+ EA4567971479421A00830199 /* OneRing.h */ = {isa = PBXFileReference;
lastKnownFileType = sourcecode.c.h; path = OneRing.h; sourceTree
= "<group>"; };
+ EA4567981479421A00830199 /* OneRing.m */ = {isa = PBXFileReference;
lastKnownFileType = sourcecode.c.objc; path = OneRing.m; sourceTree
= "<group>"; };
+ EA45679F1479421A00830199 /* OneRingTests.octest */ = {isa =
PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0;
path = OneRingTests.octest; sourceTree = BUILT_PRODUCTS_DIR; };
+ EA4567A01479421A00830199 /* SenTestingKit.framework */ = {isa =
PBXFileReference; lastKnownFileType = wrapper.framework; name =
SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework;
sourceTree = DEVELOPER_DIR; };
+ EA4567A81479421A00830199 /* OneRingTests-Info.plist */ = {isa =
PBXFileReference; lastKnownFileType = text.plist.xml; path
= "OneRingTests-Info.plist"; sourceTree = "<group>"; };
+ EA4567AA1479421A00830199 /* en */ = {isa = PBXFileReference;
lastKnownFileType = text.plist.strings; name = en; path =
en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ EA4567AC1479421A00830199 /* OneRingTests.h */ = {isa = PBXFileReference;
lastKnownFileType = sourcecode.c.h; path = OneRingTests.h; sourceTree
= "<group>"; };
+ EA4567AE1479421A00830199 /* OneRingTests.m */ = {isa = PBXFileReference;
lastKnownFileType = sourcecode.c.objc; path = OneRingTests.m; sourceTree
= "<group>"; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ EA4567831479421A00830199 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask =
2147483647;
+ files = (
+ EA45678B1479421A00830199 /* Cocoa.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ EA45679B1479421A00830199 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask =
2147483647;
+ files = (
+ EA4567A11479421A00830199 /* SenTestingKit.framework in Frameworks */,
+ EA4567A21479421A00830199 /* Cocoa.framework in Frameworks */,
+ EA4567A51479421A00830199 /* OneRing.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ EA45677B1479421A00830199 = {
+ isa = PBXGroup;
+ children = (
+ EA4567901479421A00830199 /* OneRing */,
+ EA4567A61479421A00830199 /* OneRingTests */,
+ EA4567891479421A00830199 /* Frameworks */,
+ EA4567881479421A00830199 /* Products */,
+ );
+ sourceTree = "<group>";
+ };
+ EA4567881479421A00830199 /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ EA4567871479421A00830199 /* OneRing.framework */,
+ EA45679F1479421A00830199 /* OneRingTests.octest */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ EA4567891479421A00830199 /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ EA45678A1479421A00830199 /* Cocoa.framework */,
+ EA4567A01479421A00830199 /* SenTestingKit.framework */,
+ EA45678C1479421A00830199 /* Other Frameworks */,
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
+ EA45678C1479421A00830199 /* Other Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ EA45678D1479421A00830199 /* AppKit.framework */,
+ EA45678E1479421A00830199 /* CoreData.framework */,
+ EA45678F1479421A00830199 /* Foundation.framework */,
+ );
+ name = "Other Frameworks";
+ sourceTree = "<group>";
+ };
+ EA4567901479421A00830199 /* OneRing */ = {
+ isa = PBXGroup;
+ children = (
+ EA4567971479421A00830199 /* OneRing.h */,
+ EA4567981479421A00830199 /* OneRing.m */,
+ EA4567911479421A00830199 /* Supporting Files */,
+ );
+ path = OneRing;
+ sourceTree = "<group>";
+ };
+ EA4567911479421A00830199 /* Supporting Files */ = {
+ isa = PBXGroup;
+ children = (
+ EA4567921479421A00830199 /* OneRing-Info.plist */,
+ EA4567931479421A00830199 /* InfoPlist.strings */,
+ EA4567961479421A00830199 /* OneRing-Prefix.pch */,
+ );
+ name = "Supporting Files";
+ sourceTree = "<group>";
+ };
+ EA4567A61479421A00830199 /* OneRingTests */ = {
+ isa = PBXGroup;
+ children = (
+ EA4567AC1479421A00830199 /* OneRingTests.h */,
+ EA4567AE1479421A00830199 /* OneRingTests.m */,
+ EA4567A71479421A00830199 /* Supporting Files */,
+ );
+ path = OneRingTests;
+ sourceTree = "<group>";
+ };
+ EA4567A71479421A00830199 /* Supporting Files */ = {
+ isa = PBXGroup;
+ children = (
+ EA4567A81479421A00830199 /* OneRingTests-Info.plist */,
+ EA4567A91479421A00830199 /* InfoPlist.strings */,
+ );
+ name = "Supporting Files";
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXHeadersBuildPhase section */
+ EA4567841479421A00830199 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask =
2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXHeadersBuildPhase section */
+
+/* Begin PBXNativeTarget section */
+ EA4567861479421A00830199 /* OneRing */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = EA4567B21479421A00830199 /* Build
configuration list for PBXNativeTarget "OneRing" */;
+ buildPhases = (
+ EA4567821479421A00830199 /* Sources */,
+ EA4567831479421A00830199 /* Frameworks */,
+ EA4567841479421A00830199 /* Headers */,
+ EA4567851479421A00830199 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = OneRing;
+ productName = OneRing;
+ productReference = EA4567871479421A00830199 /* OneRing.framework */;
+ productType = "com.apple.product-type.framework";
+ };
+ EA45679E1479421A00830199 /* OneRingTests */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = EA4567B51479421A00830199 /* Build
configuration list for PBXNativeTarget "OneRingTests" */;
+ buildPhases = (
+ EA45679A1479421A00830199 /* Sources */,
+ EA45679B1479421A00830199 /* Frameworks */,
+ EA45679C1479421A00830199 /* Resources */,
+ EA45679D1479421A00830199 /* ShellScript */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ EA4567A41479421A00830199 /* PBXTargetDependency */,
+ );
+ name = OneRingTests;
+ productName = OneRingTests;
+ productReference = EA45679F1479421A00830199 /* OneRingTests.octest */;
+ productType = "com.apple.product-type.bundle";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ EA45677D1479421A00830199 /* Project object */ = {
+ isa = PBXProject;
+ buildConfigurationList = EA4567801479421A00830199 /* Build
configuration list for PBXProject "OneRing" */;
+ compatibilityVersion = "Xcode 3.2";
+ developmentRegion = English;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ );
+ mainGroup = EA45677B1479421A00830199;
+ productRefGroup = EA4567881479421A00830199 /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ EA4567861479421A00830199 /* OneRing */,
+ EA45679E1479421A00830199 /* OneRingTests */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ EA4567851479421A00830199 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask =
2147483647;
+ files = (
+ EA4567951479421A00830199 /* InfoPlist.strings in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ EA45679C1479421A00830199 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask =
2147483647;
+ files = (
+ EA4567AB1479421A00830199 /* InfoPlist.strings in Resources */,
+ EA4567AD1479421A00830199 /* OneRingTests.h in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXShellScriptBuildPhase section */
+ EA45679D1479421A00830199 /* ShellScript */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask =
2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "# Run the unit tests in this test
bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n";
+ };
+/* End PBXShellScriptBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ EA4567821479421A00830199 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask =
2147483647;
+ files = (
+ EA4567991479421A00830199 /* OneRing.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ EA45679A1479421A00830199 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask =
2147483647;
+ files = (
+ EA4567AF1479421A00830199 /* OneRingTests.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXTargetDependency section */
+ EA4567A41479421A00830199 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = EA4567861479421A00830199 /* OneRing */;
+ targetProxy = EA4567A31479421A00830199 /* PBXContainerItemProxy */;
+ };
+/* End PBXTargetDependency section */
+
+/* Begin PBXVariantGroup section */
+ EA4567931479421A00830199 /* InfoPlist.strings */ = {
+ isa = PBXVariantGroup;
+ children = (
+ EA4567941479421A00830199 /* en */,
+ );
+ name = InfoPlist.strings;
+ sourceTree = "<group>";
+ };
+ EA4567A91479421A00830199 /* InfoPlist.strings */ = {
+ isa = PBXVariantGroup;
+ children = (
+ EA4567AA1479421A00830199 /* en */,
+ );
+ name = InfoPlist.strings;
+ sourceTree = "<group>";
+ };
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+ EA4567B01479421A00830199 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = "$(ARCHS_STANDARD_64_BIT)";
+ COPY_PHASE_STRIP = NO;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ MACOSX_DEPLOYMENT_TARGET = 10.7;
+ ONLY_ACTIVE_ARCH = YES;
+ SDKROOT = macosx;
+ };
+ name = Debug;
+ };
+ EA4567B11479421A00830199 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = "$(ARCHS_STANDARD_64_BIT)";
+ COPY_PHASE_STRIP = YES;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ MACOSX_DEPLOYMENT_TARGET = 10.7;
+ SDKROOT = macosx;
+ };
+ name = Release;
+ };
+ EA4567B31479421A00830199 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ FRAMEWORK_VERSION = A;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "OneRing/OneRing-Prefix.pch";
+ INFOPLIST_FILE = "OneRing/OneRing-Info.plist";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ WRAPPER_EXTENSION = framework;
+ };
+ name = Debug;
+ };
+ EA4567B41479421A00830199 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ FRAMEWORK_VERSION = A;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "OneRing/OneRing-Prefix.pch";
+ INFOPLIST_FILE = "OneRing/OneRing-Info.plist";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ WRAPPER_EXTENSION = framework;
+ };
+ name = Release;
+ };
+ EA4567B61479421A00830199 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks";
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "OneRing/OneRing-Prefix.pch";
+ INFOPLIST_FILE = "OneRingTests/OneRingTests-Info.plist";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ WRAPPER_EXTENSION = octest;
+ };
+ name = Debug;
+ };
+ EA4567B71479421A00830199 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks";
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "OneRing/OneRing-Prefix.pch";
+ INFOPLIST_FILE = "OneRingTests/OneRingTests-Info.plist";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ WRAPPER_EXTENSION = octest;
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ EA4567801479421A00830199 /* Build configuration list for
PBXProject "OneRing" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ EA4567B01479421A00830199 /* Debug */,
+ EA4567B11479421A00830199 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ EA4567B21479421A00830199 /* Build configuration list for
PBXNativeTarget "OneRing" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ EA4567B31479421A00830199 /* Debug */,
+ EA4567B41479421A00830199 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ };
+ EA4567B51479421A00830199 /* Build configuration list for
PBXNativeTarget "OneRingTests" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ EA4567B61479421A00830199 /* Debug */,
+ EA4567B71479421A00830199 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = EA45677D1479421A00830199 /* Project object */;
+}
=======================================
--- /dev/null
+++
/cores/webkitcore/OneRing.xcodeproj/project.xcworkspace/contents.xcworkspacedata
Sun Nov 20 06:13:29 2011
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Workspace
+ version = "1.0">
+ <FileRef
+ location = "self:OneRing.xcodeproj">
+ </FileRef>
+</Workspace>
=======================================
--- /dev/null
+++
/cores/webkitcore/OneRing.xcodeproj/project.xcworkspace/xcuserdata/hongqn.xcuserdatad/UserInterfaceState.xcuserstate
Sun Nov 20 06:13:29 2011
@@ -0,0 +1,2695 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST
1.0//EN" "
http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>$archiver</key>
+ <string>NSKeyedArchiver</string>
+ <key>$objects</key>
+ <array>
+ <string>$null</string>
+ <dict>
+ <key>$class</key>
+ <dict>
+ <key>CF$UID</key>
+ <integer>57</integer>
+ </dict>
+ <key>NS.keys</key>
+ <array>
+ <dict>
+ <key>CF$UID</key>
+ <integer>2</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>3</integer>
+ </dict>
+ </array>
+ <key>NS.objects</key>
+ <array>
+ <dict>
+ <key>CF$UID</key>
+ <integer>4</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>185</integer>
+ </dict>
+ </array>
+ </dict>
+ <string>794A49F8-9474-4B2D-917E-9517D117932A</string>
+ <string>IDEWorkspaceDocument</string>
+ <dict>
+ <key>$class</key>
+ <dict>
+ <key>CF$UID</key>
+ <integer>48</integer>
+ </dict>
+ <key>NS.keys</key>
+ <array>
+ <dict>
+ <key>CF$UID</key>
+ <integer>5</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>6</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>7</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>8</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>9</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>10</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>11</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>12</integer>
+ </dict>
+ </array>
+ <key>NS.objects</key>
+ <array>
+ <dict>
+ <key>CF$UID</key>
+ <integer>13</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>14</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>16</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>36</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>2</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>7</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>26</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>36</integer>
+ </dict>
+ </array>
+ </dict>
+ <string>IDEWindowFrame</string>
+ <string>IDEOrderedWorkspaceTabControllers</string>
+
<string>IDEWorkspaceTabController_8D67BC79-1E96-4FE3-9F6D-3572B0B5495A</string>
+ <string>IDEWindowInFullscreenMode</string>
+ <string>IDEWorkspaceWindowControllerUniqueIdentifier</string>
+ <string>IDEActiveWorkspaceTabController</string>
+ <string>IDEWindowToolbarIsVisible</string>
+ <string>IDEWindowTabBarIsVisible</string>
+ <string>{{10, 68}, {1400, 810}}</string>
+ <dict>
+ <key>$class</key>
+ <dict>
+ <key>CF$UID</key>
+ <integer>15</integer>
+ </dict>
+ <key>NS.objects</key>
+ <array>
+ <dict>
+ <key>CF$UID</key>
+ <integer>7</integer>
+ </dict>
+ </array>
+ </dict>
+ <dict>
+ <key>$classes</key>
+ <array>
+ <string>NSArray</string>
+ <string>NSObject</string>
+ </array>
+ <key>$classname</key>
+ <string>NSArray</string>
+ </dict>
+ <dict>
+ <key>$class</key>
+ <dict>
+ <key>CF$UID</key>
+ <integer>48</integer>
+ </dict>
+ <key>NS.keys</key>
+ <array>
+ <dict>
+ <key>CF$UID</key>
+ <integer>17</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>18</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>19</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>20</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>21</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>22</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>23</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>24</integer>
+ </dict>
+ </array>
+ <key>NS.objects</key>
+ <array>
+ <dict>
+ <key>CF$UID</key>
+ <integer>25</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>26</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>27</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>151</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>157</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>176</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>36</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>47</integer>
+ </dict>
+ </array>
+ </dict>
+ <string>IDETabLabel</string>
+ <string>IDEShowNavigator</string>
+ <string>IDEEditorArea</string>
+ <string>IDEWorkspaceTabControllerUtilityAreaSplitView</string>
+ <string>IDENavigatorArea</string>
+ <string>IDEWorkspaceTabControllerDesignAreaSplitView</string>
+ <string>IDEShowUtilities</string>
+ <string>AssistantEditorsLayout</string>
+ <string>OneRing.xcodeproj</string>
+ <true/>
+ <dict>
+ <key>$class</key>
+ <dict>
+ <key>CF$UID</key>
+ <integer>48</integer>
+ </dict>
+ <key>NS.keys</key>
+ <array>
+ <dict>
+ <key>CF$UID</key>
+ <integer>28</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>29</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>30</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>31</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>32</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>33</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>34</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>35</integer>
+ </dict>
+ </array>
+ <key>NS.objects</key>
+ <array>
+ <dict>
+ <key>CF$UID</key>
+ <integer>36</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>37</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>70</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>26</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>47</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>131</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>139</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>140</integer>
+ </dict>
+ </array>
+ </dict>
+ <string>ShowDebuggerArea</string>
+ <string>IDEEDitorArea_DebugArea</string>
+ <string>IDEEditorMode_Standard</string>
+ <string>IDEShowEditor</string>
+ <string>EditorMode</string>
+ <string>DebuggerSplitView</string>
+ <string>DefaultPersistentRepresentations</string>
+ <string>layoutTree</string>
+ <false/>
+ <dict>
+ <key>$class</key>
+ <dict>
+ <key>CF$UID</key>
+ <integer>48</integer>
+ </dict>
+ <key>NS.keys</key>
+ <array>
+ <dict>
+ <key>CF$UID</key>
+ <integer>38</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>39</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>40</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>41</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>42</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>43</integer>
+ </dict>
+ </array>
+ <key>NS.objects</key>
+ <array>
+ <dict>
+ <key>CF$UID</key>
+ <integer>44</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>45</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>49</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>44</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>62</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>68</integer>
+ </dict>
+ </array>
+ </dict>
+ <string>LayoutFocusMode</string>
+ <string>console</string>
+ <string>IDEDebuggerAreaSplitView</string>
+ <string>LayoutMode</string>
+ <string>IDEDebugArea_SplitView</string>
+ <string>variables</string>
+ <integer>1</integer>
+ <dict>
+ <key>$class</key>
+ <dict>
+ <key>CF$UID</key>
+ <integer>48</integer>
+ </dict>
+ <key>NS.keys</key>
+ <array>
+ <dict>
+ <key>CF$UID</key>
+ <integer>46</integer>
+ </dict>
+ </array>
+ <key>NS.objects</key>
+ <array>
+ <dict>
+ <key>CF$UID</key>
+ <integer>47</integer>
+ </dict>
+ </array>
+ </dict>
+ <string>ConsoleFilterMode</string>
+ <integer>0</integer>
+ <dict>
+ <key>$classes</key>
+ <array>
+ <string>NSMutableDictionary</string>
+ <string>NSDictionary</string>
+ <string>NSObject</string>
+ </array>
+ <key>$classname</key>
+ <string>NSMutableDictionary</string>
+ </dict>
+ <dict>
+ <key>$class</key>
+ <dict>
+ <key>CF$UID</key>
+ <integer>48</integer>
+ </dict>
+ <key>NS.keys</key>
+ <array>
+ <dict>
+ <key>CF$UID</key>
+ <integer>50</integer>
+ </dict>
+ </array>
+ <key>NS.objects</key>
+ <array>
+ <dict>
+ <key>CF$UID</key>
+ <integer>51</integer>
+ </dict>
+ </array>
+ </dict>
+ <string>DVTSplitViewItems</string>
+ <dict>
+ <key>$class</key>
+ <dict>
+ <key>CF$UID</key>
+ <integer>61</integer>
+ </dict>
+ <key>NS.objects</key>
+ <array>
+ <dict>
+ <key>CF$UID</key>
+ <integer>52</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>58</integer>
+ </dict>
+ </array>
+ </dict>
+ <dict>
+ <key>$class</key>
+ <dict>
+ <key>CF$UID</key>
+ <integer>57</integer>
+ </dict>
+ <key>NS.keys</key>
+ <array>
+ <dict>
+ <key>CF$UID</key>
+ <integer>53</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>54</integer>
+ </dict>
+ </array>
+ <key>NS.objects</key>
+ <array>
+ <dict>
+ <key>CF$UID</key>
+ <integer>55</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>56</integer>
+ </dict>
+ </array>
+ </dict>
+ <string>DVTIdentifier</string>
+ <string>DVTViewMagnitude</string>
+ <string>VariablesView</string>
+ <real>570</real>
+ <dict>
+ <key>$classes</key>
+ <array>
+ <string>NSDictionary</string>
+ <string>NSObject</string>
+ </array>
+ <key>$classname</key>
+ <string>NSDictionary</string>
+ </dict>
+ <dict>
+ <key>$class</key>
+ <dict>
+ <key>CF$UID</key>
+ <integer>57</integer>
+ </dict>
+ <key>NS.keys</key>
+ <array>
+ <dict>
+ <key>CF$UID</key>
+ <integer>53</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>54</integer>
+ </dict>
+ </array>
+ <key>NS.objects</key>
+ <array>
+ <dict>
+ <key>CF$UID</key>
+ <integer>59</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>60</integer>
+ </dict>
+ </array>
+ </dict>
+ <string>ConsoleArea</string>
+ <real>569</real>
+ <dict>
+ <key>$classes</key>
+ <array>
+ <string>NSMutableArray</string>
+ <string>NSArray</string>
+ <string>NSObject</string>
+ </array>
+ <key>$classname</key>
+ <string>NSMutableArray</string>
+ </dict>
+ <dict>
+ <key>$class</key>
+ <dict>
+ <key>CF$UID</key>
+ <integer>48</integer>
+ </dict>
+ <key>NS.keys</key>
+ <array>
+ <dict>
+ <key>CF$UID</key>
+ <integer>50</integer>
+ </dict>
+ </array>
+ <key>NS.objects</key>
+ <array>
+ <dict>
+ <key>CF$UID</key>
+ <integer>63</integer>
+ </dict>
+ </array>
+ </dict>
+ <dict>
+ <key>$class</key>
+ <dict>
+ <key>CF$UID</key>
+ <integer>61</integer>
+ </dict>
+ <key>NS.objects</key>
+ <array>
+ <dict>
+ <key>CF$UID</key>
+ <integer>64</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>66</integer>
+ </dict>
+ </array>
+ </dict>
+ <dict>
+ <key>$class</key>
+ <dict>
+ <key>CF$UID</key>
+ <integer>57</integer>
+ </dict>
+ <key>NS.keys</key>
+ <array>
+ <dict>
+ <key>CF$UID</key>
+ <integer>53</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>54</integer>
+ </dict>
+ </array>
+ <key>NS.objects</key>
+ <array>
+ <dict>
+ <key>CF$UID</key>
+ <integer>55</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>65</integer>
+ </dict>
+ </array>
+ </dict>
+ <real>570</real>
+ <dict>
+ <key>$class</key>
+ <dict>
+ <key>CF$UID</key>
+ <integer>57</integer>
+ </dict>
+ <key>NS.keys</key>
+ <array>
+ <dict>
+ <key>CF$UID</key>
+ <integer>53</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>54</integer>
+ </dict>
+ </array>
+ <key>NS.objects</key>
+ <array>
+ <dict>
+ <key>CF$UID</key>
+ <integer>59</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>67</integer>
+ </dict>
+ </array>
+ </dict>
+ <real>569</real>
+ <dict>
+ <key>$class</key>
+ <dict>
+ <key>CF$UID</key>
+ <integer>48</integer>
+ </dict>
+ <key>NS.keys</key>
+ <array>
+ <dict>
+ <key>CF$UID</key>
+ <integer>69</integer>
+ </dict>
+ </array>
+ <key>NS.objects</key>
+ <array>
+ <dict>
+ <key>CF$UID</key>
+ <integer>44</integer>
+ </dict>
+ </array>
+ </dict>
+ <string>VariablesViewSelectedScope</string>
+ <dict>
+ <key>$class</key>
+ <dict>
+ <key>CF$UID</key>
+ <integer>48</integer>
+ </dict>
+ <key>NS.keys</key>
+ <array>
+ <dict>
+ <key>CF$UID</key>
+ <integer>71</integer>
+ </dict>
+ </array>
+ <key>NS.objects</key>
+ <array>
+ <dict>
+ <key>CF$UID</key>
+ <integer>72</integer>
+ </dict>
+ </array>
+ </dict>
+ <string>EditorLayout_PersistentRepresentation</string>
+ <dict>
+ <key>$class</key>
+ <dict>
+ <key>CF$UID</key>
+ <integer>48</integer>
+ </dict>
+ <key>NS.keys</key>
+ <array>
+ <dict>
+ <key>CF$UID</key>
+ <integer>73</integer>
+ </dict>
+ </array>
+ <key>NS.objects</key>
+ <array>
+ <dict>
+ <key>CF$UID</key>
+ <integer>74</integer>
+ </dict>
+ </array>
+ </dict>
+ <string>Main</string>
+ <dict>
+ <key>$class</key>
+ <dict>
+ <key>CF$UID</key>
+ <integer>57</integer>
+ </dict>
+ <key>NS.keys</key>
+ <array>
+ <dict>
+ <key>CF$UID</key>
+ <integer>75</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>76</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>77</integer>
+ </dict>
+ </array>
+ <key>NS.objects</key>
+ <array>
+ <dict>
+ <key>CF$UID</key>
+ <integer>78</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>47</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>129</integer>
+ </dict>
+ </array>
+ </dict>
+ <string>EditorLayout_StateSavingStateDictionaries</string>
+ <string>EditorLayout_Selected</string>
+ <string>EditorLayout_Geometry</string>
+ <dict>
+ <key>$class</key>
+ <dict>
+ <key>CF$UID</key>
+ <integer>15</integer>
+ </dict>
+ <key>NS.objects</key>
+ <array>
+ <dict>
+ <key>CF$UID</key>
+ <integer>79</integer>
+ </dict>
+ </array>
+ </dict>
+ <dict>
+ <key>$class</key>
+ <dict>
+ <key>CF$UID</key>
+ <integer>48</integer>
+ </dict>
+ <key>NS.keys</key>
+ <array>
+ <dict>
+ <key>CF$UID</key>
+ <integer>80</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>81</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>82</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>83</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>84</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>85</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>86</integer>
+ </dict>
+ </array>
+ <key>NS.objects</key>
+ <array>
+ <dict>
+ <key>CF$UID</key>
+ <integer>87</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>88</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>100</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>124</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>124</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>125</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>126</integer>
+ </dict>
+ </array>
+ </dict>
+ <string>FileDataType</string>
+ <string>ArchivableRepresentation</string>
+ <string>EditorState</string>
+ <string>NavigableItemName</string>
+ <string>DocumentNavigableItemName</string>
+ <string>DocumentExtensionIdentifier</string>
+ <string>DocumentURL</string>
+ <string>com.apple.xcode.project</string>
+ <dict>
+ <key>$class</key>
+ <dict>
+ <key>CF$UID</key>
+ <integer>99</integer>
+ </dict>
+ <key>DocumentLocation</key>
+ <dict>
+ <key>CF$UID</key>
+ <integer>95</integer>
+ </dict>
+ <key>DomainIdentifier</key>
+ <dict>
+ <key>CF$UID</key>
+ <integer>89</integer>
+ </dict>
+ <key>IdentifierPath</key>
+ <dict>
+ <key>CF$UID</key>
+ <integer>90</integer>
+ </dict>
+ <key>IndexOfDocumentIdentifier</key>
+ <dict>
+ <key>CF$UID</key>
+ <integer>94</integer>
+ </dict>
+ </dict>
+ <string>Xcode.IDENavigableItemDomain.WorkspaceStructure</string>
+ <dict>
+ <key>$class</key>
+ <dict>
+ <key>CF$UID</key>
+ <integer>15</integer>
+ </dict>
+ <key>NS.objects</key>
+ <array>
+ <dict>
+ <key>CF$UID</key>
+ <integer>91</integer>
+ </dict>
+ </array>
+ </dict>
+ <dict>
+ <key>$class</key>
+ <dict>
+ <key>CF$UID</key>
+ <integer>93</integer>
+ </dict>
+ <key>Identifier</key>
+ <dict>
+ <key>CF$UID</key>
+ <integer>92</integer>
+ </dict>
+ </dict>
+ <string>OneRing</string>
+ <dict>
+ <key>$classes</key>
+ <array>
+ <string>IDEArchivableStringIndexPair</string>
+ <string>NSObject</string>
+ </array>
+ <key>$classname</key>
+ <string>IDEArchivableStringIndexPair</string>
+ </dict>
+ <integer>9223372036854775807</integer>
+ <dict>
+ <key>$class</key>
+ <dict>
+ <key>CF$UID</key>
+ <integer>98</integer>
+ </dict>
+ <key>documentURL</key>
+ <dict>
+ <key>CF$UID</key>
+ <integer>96</integer>
+ </dict>
+ <key>timestamp</key>
+ <dict>
+ <key>CF$UID</key>
+ <integer>0</integer>
+ </dict>
+ </dict>
+ <dict>
+ <key>$class</key>
+ <dict>
+ <key>CF$UID</key>
+ <integer>97</integer>
+ </dict>
+ <key>NS.string</key>
+
<string>file://localhost/Users/hongqn/Envs/onering/onering-desktop/cores/webkitcore/OneRing.xcodeproj/</string>
+ </dict>
+ <dict>
+ <key>$classes</key>
+ <array>
+ <string>NSMutableString</string>
+ <string>NSString</string>
+ <string>NSObject</string>
+ </array>
+ <key>$classname</key>
+ <string>NSMutableString</string>
+ </dict>
+ <dict>
+ <key>$classes</key>
+ <array>
+ <string>DVTDocumentLocation</string>
+ <string>NSObject</string>
+ </array>
+ <key>$classname</key>
+ <string>DVTDocumentLocation</string>
+ </dict>
+ <dict>
+ <key>$classes</key>
+ <array>
+ <string>IDENavigableItemArchivableRepresentation</string>
+ <string>NSObject</string>
+ </array>
+ <key>$classname</key>
+ <string>IDENavigableItemArchivableRepresentation</string>
+ </dict>
+ <dict>
+ <key>$class</key>
+ <dict>
+ <key>CF$UID</key>
+ <integer>57</integer>
+ </dict>
+ <key>NS.keys</key>
+ <array>
+ <dict>
+ <key>CF$UID</key>
+ <integer>101</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>102</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>103</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>104</integer>
+ </dict>
+ </array>
+ <key>NS.objects</key>
+ <array>
+ <dict>
+ <key>CF$UID</key>
+ <integer>105</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>112</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
***The diff for this file has been truncated for email.***
=======================================
--- /dev/null
+++
/cores/webkitcore/OneRing.xcodeproj/xcuserdata/hongqn.xcuserdatad/xcschemes/OneRing.xcscheme
Sun Nov 20 06:13:29 2011
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+ version = "1.3">
+ <BuildAction
+ parallelizeBuildables = "YES"
+ buildImplicitDependencies = "YES">
+ <BuildActionEntries>
+ <BuildActionEntry
+ buildForTesting = "YES"
+ buildForRunning = "YES"
+ buildForProfiling = "YES"
+ buildForArchiving = "YES"
+ buildForAnalyzing = "YES">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "EA4567861479421A00830199"
+ BuildableName = "OneRing.framework"
+ BlueprintName = "OneRing"
+ ReferencedContainer = "container:OneRing.xcodeproj">
+ </BuildableReference>
+ </BuildActionEntry>
+ </BuildActionEntries>
+ </BuildAction>
+ <TestAction
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ buildConfiguration = "Debug">
+ <Testables>
+ <TestableReference
+ skipped = "NO">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "EA45679E1479421A00830199"
+ BuildableName = "OneRingTests.octest"
+ BlueprintName = "OneRingTests"
+ ReferencedContainer = "container:OneRing.xcodeproj">
+ </BuildableReference>
+ </TestableReference>
+ </Testables>
+ </TestAction>
+ <LaunchAction
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
+ launchStyle = "0"
+ useCustomWorkingDirectory = "NO"
+ buildConfiguration = "Debug">
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </LaunchAction>
+ <ProfileAction
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ savedToolIdentifier = ""
+ useCustomWorkingDirectory = "NO"
+ buildConfiguration = "Release">
+ </ProfileAction>
+ <AnalyzeAction
+ buildConfiguration = "Debug">
+ </AnalyzeAction>
+ <ArchiveAction
+ buildConfiguration = "Release"
+ revealArchiveInOrganizer = "YES">
+ </ArchiveAction>
+</Scheme>
=======================================
--- /dev/null
+++
/cores/webkitcore/OneRing.xcodeproj/xcuserdata/hongqn.xcuserdatad/xcschemes/xcschememanagement.plist
Sun Nov 20 06:13:29 2011
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST
1.0//EN" "
http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>SchemeUserState</key>
+ <dict>
+ <key>OneRing.xcscheme</key>
+ <dict>
+ <key>orderHint</key>
+ <integer>0</integer>
+ </dict>
+ </dict>
+ <key>SuppressBuildableAutocreation</key>
+ <dict>
+ <key>EA4567861479421A00830199</key>
+ <dict>
+ <key>primary</key>
+ <true/>
+ </dict>
+ <key>EA45679E1479421A00830199</key>
+ <dict>
+ <key>primary</key>
+ <true/>
+ </dict>
+ </dict>
+</dict>
+</plist>
=======================================
--- /dev/null
+++ /cores/webkitcore/OneRing/OneRing-Info.plist Sun Nov 20 06:13:29 2011
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST
1.0//EN" "
http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string>com.douban.${PRODUCT_NAME:rfc1034identifier}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundlePackageType</key>
+ <string>FMWK</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+ <key>NSHumanReadableCopyright</key>
+ <string>Copyright © 2011 __MyCompanyName__. All rights reserved.</string>
+ <key>NSPrincipalClass</key>
+ <string></string>
+</dict>
+</plist>
=======================================
--- /dev/null
+++ /cores/webkitcore/OneRing/OneRing-Prefix.pch Sun Nov 20 06:13:29 2011
@@ -0,0 +1,7 @@
+//
+// Prefix header for all source files of the 'OneRing' target in
the 'OneRing' project
+//
+
+#ifdef __OBJC__
+ #import <Cocoa/Cocoa.h>
+#endif
=======================================
--- /dev/null
+++ /cores/webkitcore/OneRing/OneRing.h Sun Nov 20 06:13:29 2011
@@ -0,0 +1,13 @@
+//
+// OneRing.h
+// OneRing
+//
+// Created by hongqn on 11/20/11.
+// Copyright 2011 __MyCompanyName__. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+@interface OneRing : NSObject
+
+@end
=======================================
--- /dev/null
+++ /cores/webkitcore/OneRing/OneRing.m Sun Nov 20 06:13:29 2011
@@ -0,0 +1,23 @@
+//
+// OneRing.m
+// OneRing
+//
+// Created by hongqn on 11/20/11.
+// Copyright 2011 __MyCompanyName__. All rights reserved.
+//
+
+#import "OneRing.h"
+
+@implementation OneRing
+
+- (id)init
+{
+ self = [super init];
+ if (self) {
+ // Initialization code here.
+ }
+
+ return self;
+}
+
+@end
=======================================
--- /dev/null
+++ /cores/webkitcore/OneRing/en.lproj/InfoPlist.strings Sun Nov 20
06:13:29 2011
@@ -0,0 +1,2 @@
+/* Localized versions of Info.plist keys */
+
=======================================
--- /dev/null
+++ /cores/webkitcore/OneRingTests/OneRingTests-Info.plist Sun Nov 20
06:13:29 2011
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST
1.0//EN" "
http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.douban.${PRODUCT_NAME:rfc1034identifier}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundlePackageType</key>
+ <string>BNDL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+</dict>
+</plist>
=======================================
--- /dev/null
+++ /cores/webkitcore/OneRingTests/OneRingTests.h Sun Nov 20 06:13:29 2011
@@ -0,0 +1,13 @@
+//
+// OneRingTests.h
+// OneRingTests
+//
+// Created by hongqn on 11/20/11.
+// Copyright 2011 __MyCompanyName__. All rights reserved.
+//
+
+#import <SenTestingKit/SenTestingKit.h>
+
+@interface OneRingTests : SenTestCase
+
+@end
=======================================
--- /dev/null
+++ /cores/webkitcore/OneRingTests/OneRingTests.m Sun Nov 20 06:13:29 2011
@@ -0,0 +1,32 @@
+//
+// OneRingTests.m
+// OneRingTests
+//
+// Created by hongqn on 11/20/11.
+// Copyright 2011 __MyCompanyName__. All rights reserved.
+//
+
+#import "OneRingTests.h"
+
+@implementation OneRingTests
+
+- (void)setUp
+{
+ [super setUp];
+
+ // Set-up code here.
+}
+
+- (void)tearDown
+{
+ // Tear-down code here.
+
+ [super tearDown];
+}
+
+- (void)testExample
+{
+ STFail(@"Unit tests are not implemented yet in OneRingTests");
+}
+
+@end
=======================================
--- /dev/null
+++ /cores/webkitcore/OneRingTests/en.lproj/InfoPlist.strings Sun Nov 20
06:13:29 2011
@@ -0,0 +1,2 @@
+/* Localized versions of Info.plist keys */
+
==============================================================================
Revision: 18da82a96fbf
Author: Qiangning Hong <
hon...@gmail.com>
Date: Sun Nov 20 06:17:45 2011
Log: add Window and controller
http://code.google.com/p/onering-desktop/source/detail?r=18da82a96fbf
Added:
/cores/webkitcore/OneRing/OneRingWindowController.h
/cores/webkitcore/OneRing/OneRingWindowController.m
/cores/webkitcore/OneRing/Window.xib
Modified:
/cores/webkitcore/OneRing.xcodeproj/project.pbxproj
/cores/webkitcore/OneRing.xcodeproj/project.xcworkspace/xcuserdata/hongqn.xcuserdatad/UserInterfaceState.xcuserstate
=======================================
--- /dev/null
+++ /cores/webkitcore/OneRing/OneRingWindowController.h Sun Nov 20 06:17:45
2011
@@ -0,0 +1,18 @@
+//
+// OneRingWindowController.h
+// OneRing
+//
+// Created by hongqn on 11/20/11.
+// Copyright 2011 __MyCompanyName__. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import <WebKit/WebKit.h>
+
+@interface OneRingWindowController : NSObject {
+ WebView *theWebView;
+}
+
+@property (assign) IBOutlet WebView *theWebView;
+
+@end
=======================================
--- /dev/null
+++ /cores/webkitcore/OneRing/OneRingWindowController.m Sun Nov 20 06:17:45
2011
@@ -0,0 +1,24 @@
+//
+// OneRingWindowController.m
+// OneRing
+//
+// Created by hongqn on 11/20/11.
+// Copyright 2011 __MyCompanyName__. All rights reserved.
+//
+
+#import "OneRingWindowController.h"
+
+@implementation OneRingWindowController
+@synthesize theWebView;
+
+- (id)init
+{
+ self = [super init];
+ if (self) {
+ // Initialization code here.
+ }
+
+ return self;
+}
+
+@end
=======================================
--- /dev/null
+++ /cores/webkitcore/OneRing/Window.xib Sun Nov 20 06:17:45 2011
@@ -0,0 +1,294 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
+ <data>
+ <int key="IBDocument.SystemTarget">1070</int>
+ <string key="IBDocument.SystemVersion">11C74</string>
+ <string key="IBDocument.InterfaceBuilderVersion">1617</string>
+ <string key="IBDocument.AppKitVersion">1138.23</string>
+ <string key="IBDocument.HIToolboxVersion">567.00</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.WebKitIBPlugin</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>1617</string>
+ <string>518</string>
+ </object>
+ </object>
+ <object class="NSArray" key="IBDocument.IntegratedClassDependencies">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>NSWindowTemplate</string>
+ <string>NSView</string>
+ <string>NSCustomObject</string>
+ <string>WebView</string>
+ </object>
+ <object class="NSArray" key="IBDocument.PluginDependencies">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.WebKitIBPlugin</string>
+ </object>
+ <object class="NSMutableDictionary" key="IBDocument.Metadata">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys" id="0">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <reference key="dict.values" ref="0"/>
+ </object>
+ <object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSCustomObject" id="1001">
+ <string key="NSClassName">NSObject</string>
+ </object>
+ <object class="NSCustomObject" id="1003">
+ <string key="NSClassName">FirstResponder</string>
+ </object>
+ <object class="NSCustomObject" id="1004">
+ <string key="NSClassName">NSApplication</string>
+ </object>
+ <object class="NSWindowTemplate" id="1005">
+ <int key="NSWindowStyleMask">15</int>
+ <int key="NSWindowBacking">2</int>
+ <string key="NSWindowRect">{{196, 240}, {480, 270}}</string>
+ <int key="NSWTFlags">544735232</int>
+ <string key="NSWindowTitle">Window</string>
+ <string key="NSWindowClass">NSWindow</string>
+ <nil key="NSViewClass"/>
+ <nil key="NSUserInterfaceItemIdentifier"/>
+ <object class="NSView" key="NSWindowView" id="1006">
+ <reference key="NSNextResponder"/>
+ <int key="NSvFlags">256</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="WebView" id="34518982">
+ <reference key="NSNextResponder" ref="1006"/>
+ <int key="NSvFlags">274</int>
+ <object class="NSMutableSet" key="NSDragTypes">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="set.sortedObjects">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>Apple HTML pasteboard type</string>
+ <string>Apple PDF pasteboard type</string>
+ <string>Apple PICT pasteboard type</string>
+ <string>Apple URL pasteboard type</string>
+ <string>Apple Web Archive pasteboard type</string>
+ <string>NSColor pasteboard type</string>
+ <string>NSFilenamesPboardType</string>
+ <string>NSStringPboardType</string>
+ <string>NeXT RTFD pasteboard type</string>
+ <string>NeXT Rich Text Format v1.0 pasteboard type</string>
+ <string>NeXT TIFF v4.0 pasteboard type</string>
+ <string>WebURLsWithTitlesPboardType</string>
+ <string>public.png</string>
+ <string>public.url</string>
+ <string>public.url-name</string>
+ </object>
+ </object>
+ <string key="NSFrameSize">{480, 270}</string>
+ <reference key="NSSuperview" ref="1006"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView"/>
+ <string key="NSReuseIdentifierKey">_NS:51</string>
+ <string key="FrameName"/>
+ <string key="GroupName"/>
+ <object class="WebPreferences" key="Preferences">
+ <string key="Identifier"/>
+ <object class="NSMutableDictionary" key="Values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>WebKitDefaultFixedFontSize</string>
+ <string>WebKitDefaultFontSize</string>
+ <string>WebKitMinimumFontSize</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <integer value="12"/>
+ <integer value="12"/>
+ <integer value="1"/>
+ </object>
+ </object>
+ </object>
+ <bool key="UseBackForwardList">YES</bool>
+ <bool key="AllowsUndo">YES</bool>
+ </object>
+ </object>
+ <string key="NSFrameSize">{480, 270}</string>
+ <reference key="NSSuperview"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="34518982"/>
+ </object>
+ <string key="NSScreenRect">{{0, 0}, {1680, 1028}}</string>
+ <string key="NSMaxSize">{10000000000000, 10000000000000}</string>
+ <bool key="NSWindowIsRestorable">YES</bool>
+ </object>
+ <object class="NSCustomObject" id="1029046121">
+ <string key="NSClassName">OneRingWindowController</string>
+ </object>
+ </object>
+ <object class="IBObjectContainer" key="IBDocument.Objects">
+ <object class="NSMutableArray" key="connectionRecords">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">theWebView</string>
+ <reference key="source" ref="1029046121"/>
+ <reference key="destination" ref="34518982"/>
+ </object>
+ <int key="connectionID">5</int>
+ </object>
+ </object>
+ <object class="IBMutableOrderedSet" key="objectRecords">
+ <object class="NSArray" key="orderedObjects">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBObjectRecord">
+ <int key="objectID">0</int>
+ <reference key="object" ref="0"/>
+ <reference key="children" ref="1000"/>
+ <nil key="parent"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-2</int>
+ <reference key="object" ref="1001"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">File's Owner</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-1</int>
+ <reference key="object" ref="1003"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">First Responder</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-3</int>
+ <reference key="object" ref="1004"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">Application</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">1</int>
+ <reference key="object" ref="1005"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="1006"/>
+ </object>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">2</int>
+ <reference key="object" ref="1006"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="34518982"/>
+ </object>
+ <reference key="parent" ref="1005"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">3</int>
+ <reference key="object" ref="34518982"/>
+ <reference key="parent" ref="1006"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">4</int>
+ <reference key="object" ref="1029046121"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">OneRingWindowController</string>
+ </object>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="flattenedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>-1.IBPluginDependency</string>
+ <string>-2.IBPluginDependency</string>
+ <string>-3.IBPluginDependency</string>
+ <string>1.IBPluginDependency</string>
+ <string>1.IBWindowTemplateEditedContentRect</string>
+ <string>1.NSWindowTemplate.visibleAtLaunch</string>
+ <string>2.IBPluginDependency</string>
+ <string>3.IBPluginDependency</string>
+ <string>4.IBPluginDependency</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>{{357, 418}, {480, 270}}</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.WebKitIBPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="unlocalizedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference key="dict.sortedKeys" ref="0"/>
+ <reference key="dict.values" ref="0"/>
+ </object>
+ <nil key="activeLocalization"/>
+ <object class="NSMutableDictionary" key="localizations">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference key="dict.sortedKeys" ref="0"/>
+ <reference key="dict.values" ref="0"/>
+ </object>
+ <nil key="sourceID"/>
+ <int key="maxID">5</int>
+ </object>
+ <object class="IBClassDescriber" key="IBDocument.Classes">
+ <object class="NSMutableArray" key="referencedPartialClassDescriptions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">OneRingWindowController</string>
+ <string key="superclassName">NSObject</string>
+ <object class="NSMutableDictionary" key="outlets">
+ <string key="NS.key.0">theWebView</string>
+ <string key="NS.object.0">WebView</string>
+ </object>
+ <object class="NSMutableDictionary" key="toOneOutletInfosByName">
+ <string key="NS.key.0">theWebView</string>
+ <object class="IBToOneOutletInfo" key="NS.object.0">
+ <string key="name">theWebView</string>
+ <string key="candidateClassName">WebView</string>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">./Classes/OneRingWindowController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">WebView</string>
+ <object class="NSMutableDictionary" key="actions">
+ <string key="NS.key.0">reloadFromOrigin:</string>
+ <string key="NS.object.0">id</string>
+ </object>
+ <object class="NSMutableDictionary" key="actionInfosByName">
+ <string key="NS.key.0">reloadFromOrigin:</string>
+ <object class="IBActionInfo" key="NS.object.0">
+ <string key="name">reloadFromOrigin:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">./Classes/WebView.h</string>
+ </object>
+ </object>
+ </object>
+ </object>
+ <int key="IBDocument.localizationMode">0</int>
+ <string
key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
+ <object class="NSMutableDictionary"
key="IBDocument.PluginDeclaredDevelopmentDependencies">
+ <string
key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3</string>
+ <integer value="3000" key="NS.object.0"/>
+ </object>
+ <bool
key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
+ <int key="IBDocument.defaultPropertyAccessControl">3</int>
+ </data>
+</archive>
=======================================
--- /cores/webkitcore/OneRing.xcodeproj/project.pbxproj Sun Nov 20 06:13:29
2011
+++ /cores/webkitcore/OneRing.xcodeproj/project.pbxproj Sun Nov 20 06:17:45
2011
@@ -16,6 +16,10 @@
EA4567AB1479421A00830199 /* InfoPlist.strings in Resources */ = {isa =
PBXBuildFile; fileRef = EA4567A91479421A00830199 /* InfoPlist.strings */; };
EA4567AD1479421A00830199 /* OneRingTests.h in Resources */ = {isa =
PBXBuildFile; fileRef = EA4567AC1479421A00830199 /* OneRingTests.h */; };
EA4567AF1479421A00830199 /* OneRingTests.m in Sources */ = {isa =
PBXBuildFile; fileRef = EA4567AE1479421A00830199 /* OneRingTests.m */; };
+ EA4567BC147942C100830199 /* WebKit.framework in Frameworks */ = {isa =
PBXBuildFile; fileRef = EA4567BB147942C100830199 /* WebKit.framework */; };
+ EA4567BF147942E000830199 /* Window.xib in Resources */ = {isa =
PBXBuildFile; fileRef = EA4567BE147942E000830199 /* Window.xib */; };
+ EA4567C21479431700830199 /* OneRingWindowController.h in Headers */ =
{isa = PBXBuildFile; fileRef = EA4567C01479431700830199 /*
OneRingWindowController.h */; };
+ EA4567C31479431700830199 /* OneRingWindowController.m in Sources */ =
{isa = PBXBuildFile; fileRef = EA4567C11479431700830199 /*
OneRingWindowController.m */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -45,6 +49,10 @@
EA4567AA1479421A00830199 /* en */ = {isa = PBXFileReference;
lastKnownFileType = text.plist.strings; name = en; path =
en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
EA4567AC1479421A00830199 /* OneRingTests.h */ = {isa = PBXFileReference;
lastKnownFileType = sourcecode.c.h; path = OneRingTests.h; sourceTree
= "<group>"; };
EA4567AE1479421A00830199 /* OneRingTests.m */ = {isa = PBXFileReference;
lastKnownFileType = sourcecode.c.objc; path = OneRingTests.m; sourceTree
= "<group>"; };
+ EA4567BB147942C100830199 /* WebKit.framework */ = {isa =
PBXFileReference; lastKnownFileType = wrapper.framework; name =
WebKit.framework; path
= ../../../../../../../System/Library/Frameworks/WebKit.framework;
sourceTree = "<group>"; };
+ EA4567BE147942E000830199 /* Window.xib */ = {isa = PBXFileReference;
fileEncoding = 4; lastKnownFileType = file.xib; path = Window.xib;
sourceTree = "<group>"; };
+ EA4567C01479431700830199 /* OneRingWindowController.h */ = {isa =
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h;
path = OneRingWindowController.h; sourceTree = "<group>"; };
+ EA4567C11479431700830199 /* OneRingWindowController.m */ = {isa =
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc;
path = OneRingWindowController.m; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -53,6 +61,7 @@
buildActionMask =
2147483647;
files = (
EA45678B1479421A00830199 /* Cocoa.framework in Frameworks */,
+ EA4567BC147942C100830199 /* WebKit.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -91,6 +100,7 @@
EA4567891479421A00830199 /* Frameworks */ = {
isa = PBXGroup;
children = (
+ EA4567BB147942C100830199 /* WebKit.framework */,
EA45678A1479421A00830199 /* Cocoa.framework */,
EA4567A01479421A00830199 /* SenTestingKit.framework */,
EA45678C1479421A00830199 /* Other Frameworks */,
@@ -114,6 +124,9 @@
EA4567971479421A00830199 /* OneRing.h */,
EA4567981479421A00830199 /* OneRing.m */,
EA4567911479421A00830199 /* Supporting Files */,
+ EA4567BE147942E000830199 /* Window.xib */,
+ EA4567C01479431700830199 /* OneRingWindowController.h */,
+ EA4567C11479431700830199 /* OneRingWindowController.m */,
);
path = OneRing;
sourceTree = "<group>";
@@ -154,6 +167,7 @@
isa = PBXHeadersBuildPhase;
buildActionMask =
2147483647;
files = (
+ EA4567C21479431700830199 /* OneRingWindowController.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -226,6 +240,7 @@
buildActionMask =
2147483647;
files = (
EA4567951479421A00830199 /* InfoPlist.strings in Resources */,
+ EA4567BF147942E000830199 /* Window.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -262,6 +277,7 @@
buildActionMask =
2147483647;
files = (
EA4567991479421A00830199 /* OneRing.m in Sources */,
+ EA4567C31479431700830199 /* OneRingWindowController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -419,6 +435,7 @@
EA4567B41479421A00830199 /* Release */,
);
defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
};
EA4567B51479421A00830199 /* Build configuration list for
PBXNativeTarget "OneRingTests" */ = {
isa = XCConfigurationList;
@@ -427,6 +444,7 @@
EA4567B71479421A00830199 /* Release */,
);
defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
=======================================
---
/cores/webkitcore/OneRing.xcodeproj/project.xcworkspace/xcuserdata/hongqn.xcuserdatad/UserInterfaceState.xcuserstate
Sun Nov 20 06:13:29 2011
+++
/cores/webkitcore/OneRing.xcodeproj/project.xcworkspace/xcuserdata/hongqn.xcuserdatad/UserInterfaceState.xcuserstate
Sun Nov 20 06:17:45 2011
@@ -11,7 +11,7 @@
<key>$class</key>
<dict>
<key>CF$UID</key>
- <integer>57</integer>
+ <integer>58</integer>
</dict>
<key>NS.keys</key>
<array>
@@ -32,7 +32,7 @@
</dict>
<dict>
<key>CF$UID</key>
- <integer>185</integer>
+ <integer>240</integer>
</dict>
</array>
</dict>
@@ -42,7 +42,7 @@
<key>$class</key>
<dict>
<key>CF$UID</key>
- <integer>48</integer>
+ <integer>49</integer>
</dict>
<key>NS.keys</key>
<array>
@@ -95,7 +95,7 @@
</dict>
<dict>
<key>CF$UID</key>
- <integer>36</integer>
+ <integer>37</integer>
</dict>
<dict>
<key>CF$UID</key>
@@ -111,7 +111,7 @@
</dict>
<dict>
<key>CF$UID</key>
- <integer>36</integer>
+ <integer>37</integer>
</dict>
</array>
</dict>
@@ -151,7 +151,7 @@
<key>$class</key>
<dict>
<key>CF$UID</key>
- <integer>48</integer>
+ <integer>49</integer>
</dict>
<key>NS.keys</key>
<array>
@@ -204,23 +204,23 @@
</dict>
<dict>
<key>CF$UID</key>
- <integer>151</integer>
+ <integer>184</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>157</integer>
+ <integer>191</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>176</integer>
+ <integer>231</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>36</integer>
+ <integer>26</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>47</integer>
+ <integer>48</integer>
</dict>
</array>
</dict>
@@ -232,13 +232,13 @@
<string>IDEWorkspaceTabControllerDesignAreaSplitView</string>
<string>IDEShowUtilities</string>
<string>AssistantEditorsLayout</string>
- <string>OneRing.xcodeproj</string>
+ <string>OneRingWindowController.m</string>
<true/>
<dict>
<key>$class</key>
<dict>
<key>CF$UID</key>
- <integer>48</integer>
+ <integer>49</integer>
</dict>
<key>NS.keys</key>
<array>
@@ -274,20 +274,24 @@
<key>CF$UID</key>
<integer>35</integer>
</dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>36</integer>
+ </dict>
</array>
<key>NS.objects</key>
<array>
<dict>
<key>CF$UID</key>
- <integer>36</integer>
+ <integer>37</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>37</integer>
+ <integer>38</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>70</integer>
+ <integer>71</integer>
</dict>
<dict>
<key>CF$UID</key>
@@ -295,19 +299,23 @@
</dict>
<dict>
<key>CF$UID</key>
- <integer>47</integer>
+ <integer>48</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>131</integer>
+ <integer>118</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>139</integer>
+ <integer>126</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>140</integer>
+ <integer>127</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>172</integer>
</dict>
</array>
</dict>
@@ -318,21 +326,18 @@
<string>EditorMode</string>
<string>DebuggerSplitView</string>
<string>DefaultPersistentRepresentations</string>
+ <string>IDEEditorMode_Genius</string>
<string>layoutTree</string>
<false/>
<dict>
<key>$class</key>
<dict>
<key>CF$UID</key>
- <integer>48</integer>
+ <integer>49</integer>
</dict>
<key>NS.keys</key>
<array>
<dict>
- <key>CF$UID</key>
- <integer>38</integer>
- </dict>
- <dict>
<key>CF$UID</key>
<integer>39</integer>
</dict>
@@ -352,32 +357,36 @@
<key>CF$UID</key>
<integer>43</integer>
</dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>44</integer>
+ </dict>
</array>
<key>NS.objects</key>
<array>
<dict>
<key>CF$UID</key>
- <integer>44</integer>
+ <integer>45</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>45</integer>
+ <integer>46</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>49</integer>
+ <integer>50</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>44</integer>
+ <integer>45</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>62</integer>
+ <integer>63</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>68</integer>
+ <integer>69</integer>
</dict>
</array>
</dict>
@@ -392,20 +401,20 @@
<key>$class</key>
<dict>
<key>CF$UID</key>
- <integer>48</integer>
+ <integer>49</integer>
</dict>
<key>NS.keys</key>
<array>
<dict>
<key>CF$UID</key>
- <integer>46</integer>
+ <integer>47</integer>
</dict>
</array>
<key>NS.objects</key>
<array>
<dict>
<key>CF$UID</key>
- <integer>47</integer>
+ <integer>48</integer>
</dict>
</array>
</dict>
@@ -425,20 +434,20 @@
<key>$class</key>
<dict>
<key>CF$UID</key>
- <integer>48</integer>
+ <integer>49</integer>
</dict>
<key>NS.keys</key>
<array>
<dict>
<key>CF$UID</key>
- <integer>50</integer>
+ <integer>51</integer>
</dict>
</array>
<key>NS.objects</key>
<array>
<dict>
<key>CF$UID</key>
- <integer>51</integer>
+ <integer>52</integer>
</dict>
</array>
</dict>
@@ -447,17 +456,17 @@
<key>$class</key>
<dict>
<key>CF$UID</key>
- <integer>61</integer>
+ <integer>62</integer>
</dict>
<key>NS.objects</key>
<array>
<dict>
<key>CF$UID</key>
- <integer>52</integer>
+ <integer>53</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>58</integer>
+ <integer>59</integer>
</dict>
</array>
</dict>
@@ -465,35 +474,35 @@
<key>$class</key>
<dict>
<key>CF$UID</key>
- <integer>57</integer>
+ <integer>58</integer>
</dict>
<key>NS.keys</key>
<array>
<dict>
<key>CF$UID</key>
- <integer>53</integer>
+ <integer>54</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>54</integer>
+ <integer>55</integer>
</dict>
</array>
<key>NS.objects</key>
<array>
<dict>
<key>CF$UID</key>
- <integer>55</integer>
+ <integer>56</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>56</integer>
+ <integer>57</integer>
</dict>
</array>
</dict>
<string>DVTIdentifier</string>
<string>DVTViewMagnitude</string>
<string>VariablesView</string>
- <real>570</real>
+ <real>440</real>
<dict>
<key>$classes</key>
<array>
@@ -507,33 +516,33 @@
<key>$class</key>
<dict>
<key>CF$UID</key>
- <integer>57</integer>
+ <integer>58</integer>
</dict>
<key>NS.keys</key>
<array>
<dict>
<key>CF$UID</key>
- <integer>53</integer>
+ <integer>54</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>54</integer>
+ <integer>55</integer>
</dict>
</array>
<key>NS.objects</key>
<array>
<dict>
<key>CF$UID</key>
- <integer>59</integer>
+ <integer>60</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>60</integer>
+ <integer>61</integer>
</dict>
</array>
</dict>
<string>ConsoleArea</string>
- <real>569</real>
+ <real>439</real>
<dict>
<key>$classes</key>
<array>
@@ -548,20 +557,20 @@
<key>$class</key>
<dict>
<key>CF$UID</key>
- <integer>48</integer>
+ <integer>49</integer>
</dict>
<key>NS.keys</key>
<array>
<dict>
<key>CF$UID</key>
- <integer>50</integer>
+ <integer>51</integer>
</dict>
</array>
<key>NS.objects</key>
<array>
<dict>
<key>CF$UID</key>
- <integer>63</integer>
+ <integer>64</integer>
</dict>
</array>
</dict>
@@ -569,17 +578,17 @@
<key>$class</key>
<dict>
<key>CF$UID</key>
- <integer>61</integer>
+ <integer>62</integer>
</dict>
<key>NS.objects</key>
<array>
<dict>
<key>CF$UID</key>
- <integer>64</integer>
+ <integer>65</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>66</integer>
+ <integer>67</integer>
</dict>
</array>
</dict>
@@ -587,80 +596,80 @@
<key>$class</key>
<dict>
<key>CF$UID</key>
- <integer>57</integer>
+ <integer>58</integer>
</dict>
<key>NS.keys</key>
<array>
<dict>
<key>CF$UID</key>
- <integer>53</integer>
+ <integer>54</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>54</integer>
+ <integer>55</integer>
</dict>
</array>
<key>NS.objects</key>
<array>
<dict>
<key>CF$UID</key>
- <integer>55</integer>
+ <integer>56</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>65</integer>
+ <integer>66</integer>
</dict>
</array>
</dict>
- <real>570</real>
+ <real>440</real>
<dict>
<key>$class</key>
<dict>
<key>CF$UID</key>
- <integer>57</integer>
+ <integer>58</integer>
</dict>
<key>NS.keys</key>
<array>
<dict>
<key>CF$UID</key>
- <integer>53</integer>
+ <integer>54</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>54</integer>
+ <integer>55</integer>
</dict>
</array>
<key>NS.objects</key>
<array>
<dict>
<key>CF$UID</key>
- <integer>59</integer>
+ <integer>60</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>67</integer>
+ <integer>68</integer>
</dict>
</array>
</dict>
- <real>569</real>
+ <real>439</real>
<dict>
<key>$class</key>
<dict>
<key>CF$UID</key>
- <integer>48</integer>
+ <integer>49</integer>
</dict>
<key>NS.keys</key>
<array>
<dict>
<key>CF$UID</key>
- <integer>69</integer>
+ <integer>70</integer>
</dict>
</array>
<key>NS.objects</key>
<array>
<dict>
<key>CF$UID</key>
- <integer>44</integer>
+ <integer>45</integer>
</dict>
</array>
</dict>
@@ -669,20 +678,20 @@
<key>$class</key>
<dict>
<key>CF$UID</key>
- <integer>48</integer>
+ <integer>49</integer>
</dict>
<key>NS.keys</key>
<array>
<dict>
<key>CF$UID</key>
- <integer>71</integer>
+ <integer>72</integer>
</dict>
</array>
<key>NS.objects</key>
<array>
<dict>
<key>CF$UID</key>
- <integer>72</integer>
+ <integer>73</integer>
</dict>
</array>
</dict>
@@ -691,20 +700,20 @@
<key>$class</key>
<dict>
<key>CF$UID</key>
- <integer>48</integer>
+ <integer>49</integer>
</dict>
<key>NS.keys</key>
<array>
<dict>
<key>CF$UID</key>
- <integer>73</integer>
+ <integer>74</integer>
</dict>
</array>
<key>NS.objects</key>
<array>
<dict>
<key>CF$UID</key>
- <integer>74</integer>
+ <integer>75</integer>
</dict>
</array>
</dict>
@@ -713,36 +722,36 @@
<key>$class</key>
<dict>
<key>CF$UID</key>
- <integer>57</integer>
+ <integer>58</integer>
</dict>
<key>NS.keys</key>
<array>
<dict>
<key>CF$UID</key>
- <integer>75</integer>
+ <integer>76</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>76</integer>
+ <integer>77</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>77</integer>
+ <integer>78</integer>
</dict>
</array>
<key>NS.objects</key>
<array>
<dict>
<key>CF$UID</key>
- <integer>78</integer>
+ <integer>79</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>47</integer>
+ <integer>48</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>129</integer>
+ <integer>116</integer>
</dict>
</array>
</dict>
@@ -759,7 +768,7 @@
<array>
<dict>
<key>CF$UID</key>
- <integer>79</integer>
+ <integer>80</integer>
</dict>
</array>
</dict>
@@ -767,15 +776,11 @@
<key>$class</key>
<dict>
<key>CF$UID</key>
- <integer>48</integer>
+ <integer>49</integer>
</dict>
<key>NS.keys</key>
<array>
<dict>
- <key>CF$UID</key>
- <integer>80</integer>
- </dict>
- <dict>
<key>CF$UID</key>
<integer>81</integer>
</dict>
@@ -799,36 +804,40 @@
<key>CF$UID</key>
<integer>86</integer>
</dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>87</integer>
+ </dict>
</array>
<key>NS.objects</key>
<array>
<dict>
<key>CF$UID</key>
- <integer>87</integer>
+ <integer>88</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>88</integer>
+ <integer>89</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>100</integer>
+ <integer>104</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>124</integer>
+ <integer>93</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>124</integer>
+ <integer>93</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>125</integer>
+ <integer>112</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>126</integer>
+ <integer>113</integer>
</dict>
</array>
</dict>
@@ -839,32 +848,32 @@
<string>DocumentNavigableItemName</string>
<string>DocumentExtensionIdentifier</string>
<string>DocumentURL</string>
- <string>com.apple.xcode.project</string>
+ <string>public.objective-c-source</string>
<dict>
<key>$class</key>
<dict>
<key>CF$UID</key>
- <integer>99</integer>
+ <integer>103</integer>
</dict>
<key>DocumentLocation</key>
<dict>
<key>CF$UID</key>
- <integer>95</integer>
+ <integer>99</integer>
</dict>
<key>DomainIdentifier</key>
<dict>
<key>CF$UID</key>
- <integer>89</integer>
+ <integer>90</integer>
</dict>
<key>IdentifierPath</key>
<dict>
<key>CF$UID</key>
- <integer>90</integer>
+ <integer>91</integer>
</dict>
<key>IndexOfDocumentIdentifier</key>
<dict>
<key>CF$UID</key>
- <integer>94</integer>
+ <integer>48</integer>
</dict>
</dict>
<string>Xcode.IDENavigableItemDomain.WorkspaceStructure</string>
@@ -878,7 +887,15 @@
<array>
<dict>
<key>CF$UID</key>
- <integer>91</integer>
+ <integer>92</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>95</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>97</integer>
</dict>
</array>
</dict>
@@ -886,15 +903,15 @@
<key>$class</key>
<dict>
<key>CF$UID</key>
- <integer>93</integer>
+ <integer>94</integer>
</dict>
<key>Identifier</key>
<dict>
<key>CF$UID</key>
- <integer>92</integer>
+ <integer>93</integer>
</dict>
</dict>
- <string>OneRing</string>
+ <string>OneRingWindowController.m</string>
<dict>
<key>$classes</key>
<array>
@@ -904,17 +921,42 @@
<key>$classname</key>
<string>IDEArchivableStringIndexPair</string>
</dict>
- <integer>9223372036854775807</integer>
<dict>
<key>$class</key>
<dict>
+ <key>CF$UID</key>
+ <integer>94</integer>
+ </dict>
+ <key>Identifier</key>
+ <dict>
+ <key>CF$UID</key>
+ <integer>96</integer>
+ </dict>
+ </dict>
+ <string>OneRing</string>
+ <dict>
+ <key>$class</key>
+ <dict>
+ <key>CF$UID</key>
+ <integer>94</integer>
+ </dict>
+ <key>Identifier</key>
+ <dict>
<key>CF$UID</key>
<integer>98</integer>
</dict>
+ </dict>
+ <string>OneRing</string>
+ <dict>
+ <key>$class</key>
+ <dict>
+ <key>CF$UID</key>
+ <integer>102</integer>
+ </dict>
<key>documentURL</key>
<dict>
<key>CF$UID</key>
- <integer>96</integer>
+ <integer>100</integer>
</dict>
<key>timestamp</key>
<dict>
@@ -926,10 +968,10 @@
<key>$class</key>
<dict>
<key>CF$UID</key>
- <integer>97</integer>
+ <integer>101</integer>
</dict>
<key>NS.string</key>
-
<string>file://localhost/Users/hongqn/Envs/onering/onering-desktop/cores/webkitcore/OneRing.xcodeproj/</string>
+
<string>file://localhost/Users/hongqn/Envs/onering/onering-desktop/cores/webkitcore/OneRing/OneRingWindowController.m</string>
</dict>
<dict>
<key>$classes</key>
@@ -963,69 +1005,115 @@
<key>$class</key>
<dict>
<key>CF$UID</key>
- <integer>57</integer>
+ <integer>58</integer>
</dict>
<key>NS.keys</key>
<array>
<dict>
<key>CF$UID</key>
- <integer>101</integer>
+ <integer>105</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>102</integer>
+ <integer>106</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>103</integer>
+ <integer>107</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>104</integer>
+ <integer>108</integer>
</dict>
</array>
<key>NS.objects</key>
<array>
<dict>
<key>CF$UID</key>
- <integer>105</integer>
+ <integer>109</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>112</integer>
+ <integer>110</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>113</integer>
+ <integer>37</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>123</integer>
+ <integer>111</integer>
</dict>
</array>
</dict>
- <string>Xcode3ProjectEditor.sourceList.splitview</string>
- <string>Xcode3ProjectEditorPreviousTargetEditorClass</string>
- <string>Xcode3ProjectEditorSelectedDocumentLocations</string>
- <string>Xcode3ProjectEditor_Xcode3InfoEditor</string>
+ <string>PrimaryDocumentTimestamp</string>
+ <string>PrimaryDocumentVisibleCharacterRange</string>
+ <string>HideAllIssues</string>
+ <string>PrimaryDocumentSelectedCharacterRange</string>
+ <real>343491432.24055898</real>
+ <string>{0, 375}</string>
+ <string>{0, 0}</string>
+ <string>Xcode.IDEKit.EditorDocument.SourceCode</string>
<dict>
<key>$class</key>
<dict>
<key>CF$UID</key>
- <integer>48</integer>
+ <integer>115</integer>
+ </dict>
+ <key>NS.base</key>
+ <dict>
+ <key>CF$UID</key>
+ <integer>0</integer>
+ </dict>
+ <key>NS.relative</key>
+ <dict>
+ <key>CF$UID</key>
+ <integer>114</integer>
+ </dict>
+ </dict>
+
<string>file://localhost/Users/hongqn/Envs/onering/onering-desktop/cores/webkitcore/OneRing/OneRingWindowController.m</string>
+ <dict>
+ <key>$classes</key>
+ <array>
+ <string>NSURL</string>
+ <string>NSObject</string>
+ </array>
+ <key>$classname</key>
+ <string>NSURL</string>
+ </dict>
+ <dict>
+ <key>$class</key>
+ <dict>
+ <key>CF$UID</key>
+ <integer>15</integer>
+ </dict>
+ <key>NS.objects</key>
+ <array>
+ <dict>
+ <key>CF$UID</key>
+ <integer>117</integer>
+ </dict>
+ </array>
+ </dict>
+ <string>{{0, 0}, {880, 734}}</string>
+ <dict>
+ <key>$class</key>
+ <dict>
+ <key>CF$UID</key>
+ <integer>49</integer>
</dict>
<key>NS.keys</key>
<array>
<dict>
<key>CF$UID</key>
- <integer>50</integer>
+ <integer>51</integer>
</dict>
</array>
<key>NS.objects</key>
<array>
<dict>
<key>CF$UID</key>
- <integer>106</integer>
+ <integer>119</integer>
</dict>
</array>
</dict>
@@ -1033,17 +1121,17 @@
<key>$class</key>
<dict>
<key>CF$UID</key>
- <integer>61</integer>
+ <integer>62</integer>
</dict>
<key>NS.objects</key>
<array>
<dict>
<key>CF$UID</key>
- <integer>107</integer>
+ <integer>120</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>110</integer>
+ <integer>123</integer>
</dict>
</array>
</dict>
@@ -1051,218 +1139,491 @@
<key>$class</key>
<dict>
<key>CF$UID</key>
- <integer>57</integer>
+ <integer>58</integer>
</dict>
<key>NS.keys</key>
<array>
<dict>
<key>CF$UID</key>
- <integer>53</integer>
+ <integer>54</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>54</integer>
+ <integer>55</integer>
</dict>
</array>
<key>NS.objects</key>
<array>
<dict>
<key>CF$UID</key>
- <integer>108</integer>
+ <integer>121</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>109</integer>
+ <integer>122</integer>
</dict>
</array>
***The diff for this file has been truncated for email.***
==============================================================================
Revision: 19de4ac63aac
Author: Qiangning Hong <
hon...@gmail.com>
Date: Sun Nov 20 06:54:49 2011
Log: version
http://code.google.com/p/onering-desktop/source/detail?r=19de4ac63aac
Added:
/cores/webkitcore/OneRing/core.c
Deleted:
/cores/webkitcore/OneRing.xcodeproj/project.xcworkspace/contents.xcworkspacedata
/cores/webkitcore/OneRing.xcodeproj/project.xcworkspace/xcuserdata/hongqn.xcuserdatad/UserInterfaceState.xcuserstate
Modified:
/.hgignore
/cores/webkitcore/OneRing.xcodeproj/project.pbxproj
/cores/webkitcore/OneRing/OneRing.m
/cores/webkitcore/OneRingTests/OneRingTests.m
/include/onering.h
=======================================
--- /dev/null
+++ /cores/webkitcore/OneRing/core.c Sun Nov 20 06:54:49 2011
@@ -0,0 +1,14 @@
+//
+// core.c
+//
+//
+// Created by hongqn on 11/20/11.
+// Copyright 2011 __MyCompanyName__. All rights reserved.
+//
+
+#include <onering.h>
+
+const char* onering_version()
+{
+ return "WebKitCore 1.0.0";
+}
=======================================
---
/cores/webkitcore/OneRing.xcodeproj/project.xcworkspace/contents.xcworkspacedata
Sun Nov 20 06:13:29 2011
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<Workspace
- version = "1.0">
- <FileRef
- location = "self:OneRing.xcodeproj">
- </FileRef>
-</Workspace>
=======================================
---
/cores/webkitcore/OneRing.xcodeproj/project.xcworkspace/xcuserdata/hongqn.xcuserdatad/UserInterfaceState.xcuserstate
Sun Nov 20 06:17:45 2011
+++ /dev/null
@@ -1,4240 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST
1.0//EN" "
http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>$archiver</key>
- <string>NSKeyedArchiver</string>
- <key>$objects</key>
- <array>
- <string>$null</string>
- <dict>
- <key>$class</key>
- <dict>
- <key>CF$UID</key>
- <integer>58</integer>
- </dict>
- <key>NS.keys</key>
- <array>
- <dict>
- <key>CF$UID</key>
- <integer>2</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>3</integer>
- </dict>
- </array>
- <key>NS.objects</key>
- <array>
- <dict>
- <key>CF$UID</key>
- <integer>4</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>240</integer>
- </dict>
- </array>
- </dict>
- <string>794A49F8-9474-4B2D-917E-9517D117932A</string>
- <string>IDEWorkspaceDocument</string>
- <dict>
- <key>$class</key>
- <dict>
- <key>CF$UID</key>
- <integer>49</integer>
- </dict>
- <key>NS.keys</key>
- <array>
- <dict>
- <key>CF$UID</key>
- <integer>5</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>6</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>7</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>8</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>9</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>10</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>11</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>12</integer>
- </dict>
- </array>
- <key>NS.objects</key>
- <array>
- <dict>
- <key>CF$UID</key>
- <integer>13</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>14</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>16</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>37</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>2</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>7</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>26</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>37</integer>
- </dict>
- </array>
- </dict>
- <string>IDEWindowFrame</string>
- <string>IDEOrderedWorkspaceTabControllers</string>
-
<string>IDEWorkspaceTabController_8D67BC79-1E96-4FE3-9F6D-3572B0B5495A</string>
- <string>IDEWindowInFullscreenMode</string>
- <string>IDEWorkspaceWindowControllerUniqueIdentifier</string>
- <string>IDEActiveWorkspaceTabController</string>
- <string>IDEWindowToolbarIsVisible</string>
- <string>IDEWindowTabBarIsVisible</string>
- <string>{{10, 68}, {1400, 810}}</string>
- <dict>
- <key>$class</key>
- <dict>
- <key>CF$UID</key>
- <integer>15</integer>
- </dict>
- <key>NS.objects</key>
- <array>
- <dict>
- <key>CF$UID</key>
- <integer>7</integer>
- </dict>
- </array>
- </dict>
- <dict>
- <key>$classes</key>
- <array>
- <string>NSArray</string>
- <string>NSObject</string>
- </array>
- <key>$classname</key>
- <string>NSArray</string>
- </dict>
- <dict>
- <key>$class</key>
- <dict>
- <key>CF$UID</key>
- <integer>49</integer>
- </dict>
- <key>NS.keys</key>
- <array>
- <dict>
- <key>CF$UID</key>
- <integer>17</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>18</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>19</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>20</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>21</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>22</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>23</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>24</integer>
- </dict>
- </array>
- <key>NS.objects</key>
- <array>
- <dict>
- <key>CF$UID</key>
- <integer>25</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>26</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>27</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>184</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>191</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>231</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>26</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>48</integer>
- </dict>
- </array>
- </dict>
- <string>IDETabLabel</string>
- <string>IDEShowNavigator</string>
- <string>IDEEditorArea</string>
- <string>IDEWorkspaceTabControllerUtilityAreaSplitView</string>
- <string>IDENavigatorArea</string>
- <string>IDEWorkspaceTabControllerDesignAreaSplitView</string>
- <string>IDEShowUtilities</string>
- <string>AssistantEditorsLayout</string>
- <string>OneRingWindowController.m</string>
- <true/>
- <dict>
- <key>$class</key>
- <dict>
- <key>CF$UID</key>
- <integer>49</integer>
- </dict>
- <key>NS.keys</key>
- <array>
- <dict>
- <key>CF$UID</key>
- <integer>28</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>29</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>30</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>31</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>32</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>33</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>34</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>35</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>36</integer>
- </dict>
- </array>
- <key>NS.objects</key>
- <array>
- <dict>
- <key>CF$UID</key>
- <integer>37</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>38</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>71</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>26</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>48</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>118</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>126</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>127</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>172</integer>
- </dict>
- </array>
- </dict>
- <string>ShowDebuggerArea</string>
- <string>IDEEDitorArea_DebugArea</string>
- <string>IDEEditorMode_Standard</string>
- <string>IDEShowEditor</string>
- <string>EditorMode</string>
- <string>DebuggerSplitView</string>
- <string>DefaultPersistentRepresentations</string>
- <string>IDEEditorMode_Genius</string>
- <string>layoutTree</string>
- <false/>
- <dict>
- <key>$class</key>
- <dict>
- <key>CF$UID</key>
- <integer>49</integer>
- </dict>
- <key>NS.keys</key>
- <array>
- <dict>
- <key>CF$UID</key>
- <integer>39</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>40</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>41</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>42</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>43</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>44</integer>
- </dict>
- </array>
- <key>NS.objects</key>
- <array>
- <dict>
- <key>CF$UID</key>
- <integer>45</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>46</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>50</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>45</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>63</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>69</integer>
- </dict>
- </array>
- </dict>
- <string>LayoutFocusMode</string>
- <string>console</string>
- <string>IDEDebuggerAreaSplitView</string>
- <string>LayoutMode</string>
- <string>IDEDebugArea_SplitView</string>
- <string>variables</string>
- <integer>1</integer>
- <dict>
- <key>$class</key>
- <dict>
- <key>CF$UID</key>
- <integer>49</integer>
- </dict>
- <key>NS.keys</key>
- <array>
- <dict>
- <key>CF$UID</key>
- <integer>47</integer>
- </dict>
- </array>
- <key>NS.objects</key>
- <array>
- <dict>
- <key>CF$UID</key>
- <integer>48</integer>
- </dict>
- </array>
- </dict>
- <string>ConsoleFilterMode</string>
- <integer>0</integer>
- <dict>
- <key>$classes</key>
- <array>
- <string>NSMutableDictionary</string>
- <string>NSDictionary</string>
- <string>NSObject</string>
- </array>
- <key>$classname</key>
- <string>NSMutableDictionary</string>
- </dict>
- <dict>
- <key>$class</key>
- <dict>
- <key>CF$UID</key>
- <integer>49</integer>
- </dict>
- <key>NS.keys</key>
- <array>
- <dict>
- <key>CF$UID</key>
- <integer>51</integer>
- </dict>
- </array>
- <key>NS.objects</key>
- <array>
- <dict>
- <key>CF$UID</key>
- <integer>52</integer>
- </dict>
- </array>
- </dict>
- <string>DVTSplitViewItems</string>
- <dict>
- <key>$class</key>
- <dict>
- <key>CF$UID</key>
- <integer>62</integer>
- </dict>
- <key>NS.objects</key>
- <array>
- <dict>
- <key>CF$UID</key>
- <integer>53</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>59</integer>
- </dict>
- </array>
- </dict>
- <dict>
- <key>$class</key>
- <dict>
- <key>CF$UID</key>
- <integer>58</integer>
- </dict>
- <key>NS.keys</key>
- <array>
- <dict>
- <key>CF$UID</key>
- <integer>54</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>55</integer>
- </dict>
- </array>
- <key>NS.objects</key>
- <array>
- <dict>
- <key>CF$UID</key>
- <integer>56</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>57</integer>
- </dict>
- </array>
- </dict>
- <string>DVTIdentifier</string>
- <string>DVTViewMagnitude</string>
- <string>VariablesView</string>
- <real>440</real>
- <dict>
- <key>$classes</key>
- <array>
- <string>NSDictionary</string>
- <string>NSObject</string>
- </array>
- <key>$classname</key>
- <string>NSDictionary</string>
- </dict>
- <dict>
- <key>$class</key>
- <dict>
- <key>CF$UID</key>
- <integer>58</integer>
- </dict>
- <key>NS.keys</key>
- <array>
- <dict>
- <key>CF$UID</key>
- <integer>54</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>55</integer>
- </dict>
- </array>
- <key>NS.objects</key>
- <array>
- <dict>
- <key>CF$UID</key>
- <integer>60</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>61</integer>
- </dict>
- </array>
- </dict>
- <string>ConsoleArea</string>
- <real>439</real>
- <dict>
- <key>$classes</key>
- <array>
- <string>NSMutableArray</string>
- <string>NSArray</string>
- <string>NSObject</string>
- </array>
- <key>$classname</key>
- <string>NSMutableArray</string>
- </dict>
- <dict>
- <key>$class</key>
- <dict>
- <key>CF$UID</key>
- <integer>49</integer>
- </dict>
- <key>NS.keys</key>
- <array>
- <dict>
- <key>CF$UID</key>
- <integer>51</integer>
- </dict>
- </array>
- <key>NS.objects</key>
- <array>
- <dict>
- <key>CF$UID</key>
- <integer>64</integer>
- </dict>
- </array>
- </dict>
- <dict>
- <key>$class</key>
- <dict>
- <key>CF$UID</key>
- <integer>62</integer>
- </dict>
- <key>NS.objects</key>
- <array>
- <dict>
- <key>CF$UID</key>
- <integer>65</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>67</integer>
- </dict>
- </array>
- </dict>
- <dict>
- <key>$class</key>
- <dict>
- <key>CF$UID</key>
- <integer>58</integer>
- </dict>
- <key>NS.keys</key>
- <array>
- <dict>
- <key>CF$UID</key>
- <integer>54</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>55</integer>
- </dict>
- </array>
- <key>NS.objects</key>
- <array>
- <dict>
- <key>CF$UID</key>
- <integer>56</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>66</integer>
- </dict>
- </array>
- </dict>
- <real>440</real>
- <dict>
- <key>$class</key>
- <dict>
- <key>CF$UID</key>
- <integer>58</integer>
- </dict>
- <key>NS.keys</key>
- <array>
- <dict>
- <key>CF$UID</key>
- <integer>54</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>55</integer>
- </dict>
- </array>
- <key>NS.objects</key>
- <array>
- <dict>
- <key>CF$UID</key>
- <integer>60</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>68</integer>
- </dict>
- </array>
- </dict>
- <real>439</real>
- <dict>
- <key>$class</key>
- <dict>
- <key>CF$UID</key>
- <integer>49</integer>
- </dict>
- <key>NS.keys</key>
- <array>
- <dict>
- <key>CF$UID</key>
- <integer>70</integer>
- </dict>
- </array>
- <key>NS.objects</key>
- <array>
- <dict>
- <key>CF$UID</key>
- <integer>45</integer>
- </dict>
- </array>
- </dict>
- <string>VariablesViewSelectedScope</string>
- <dict>
- <key>$class</key>
- <dict>
- <key>CF$UID</key>
- <integer>49</integer>
- </dict>
- <key>NS.keys</key>
- <array>
- <dict>
- <key>CF$UID</key>
- <integer>72</integer>
- </dict>
- </array>
- <key>NS.objects</key>
- <array>
- <dict>
- <key>CF$UID</key>
- <integer>73</integer>
- </dict>
- </array>
- </dict>
- <string>EditorLayout_PersistentRepresentation</string>
- <dict>
- <key>$class</key>
- <dict>
- <key>CF$UID</key>
- <integer>49</integer>
- </dict>
- <key>NS.keys</key>
- <array>
- <dict>
- <key>CF$UID</key>
- <integer>74</integer>
- </dict>
- </array>
- <key>NS.objects</key>
- <array>
- <dict>
- <key>CF$UID</key>
- <integer>75</integer>
- </dict>
- </array>
- </dict>
- <string>Main</string>
- <dict>
- <key>$class</key>
- <dict>
- <key>CF$UID</key>
- <integer>58</integer>
- </dict>
- <key>NS.keys</key>
- <array>
- <dict>
- <key>CF$UID</key>
- <integer>76</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>77</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>78</integer>
- </dict>
- </array>
- <key>NS.objects</key>
- <array>
- <dict>
- <key>CF$UID</key>
- <integer>79</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>48</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>116</integer>
- </dict>
- </array>
- </dict>
- <string>EditorLayout_StateSavingStateDictionaries</string>
- <string>EditorLayout_Selected</string>
- <string>EditorLayout_Geometry</string>
- <dict>
- <key>$class</key>
- <dict>
- <key>CF$UID</key>
- <integer>15</integer>
- </dict>
- <key>NS.objects</key>
- <array>
- <dict>
- <key>CF$UID</key>
- <integer>80</integer>
- </dict>
- </array>
- </dict>
- <dict>
- <key>$class</key>
- <dict>
- <key>CF$UID</key>
- <integer>49</integer>
- </dict>
- <key>NS.keys</key>
- <array>
- <dict>
- <key>CF$UID</key>
- <integer>81</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>82</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>83</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>84</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>85</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>86</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>87</integer>
- </dict>
- </array>
- <key>NS.objects</key>
- <array>
- <dict>
- <key>CF$UID</key>
- <integer>88</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>89</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>104</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>93</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>93</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>112</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>113</integer>
- </dict>
- </array>
- </dict>
- <string>FileDataType</string>
- <string>ArchivableRepresentation</string>
- <string>EditorState</string>
- <string>NavigableItemName</string>
- <string>DocumentNavigableItemName</string>
- <string>DocumentExtensionIdentifier</string>
- <string>DocumentURL</string>
- <string>public.objective-c-source</string>
- <dict>
- <key>$class</key>
- <dict>
- <key>CF$UID</key>
- <integer>103</integer>
- </dict>
- <key>DocumentLocation</key>
- <dict>
- <key>CF$UID</key>
- <integer>99</integer>
- </dict>
- <key>DomainIdentifier</key>
- <dict>
- <key>CF$UID</key>
- <integer>90</integer>
- </dict>
- <key>IdentifierPath</key>
- <dict>
- <key>CF$UID</key>
- <integer>91</integer>
- </dict>
- <key>IndexOfDocumentIdentifier</key>
- <dict>
- <key>CF$UID</key>
- <integer>48</integer>
- </dict>
- </dict>
- <string>Xcode.IDENavigableItemDomain.WorkspaceStructure</string>
- <dict>
- <key>$class</key>
- <dict>
- <key>CF$UID</key>
- <integer>15</integer>
- </dict>
- <key>NS.objects</key>
- <array>
- <dict>
- <key>CF$UID</key>
- <integer>92</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>95</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
- <integer>97</integer>
- </dict>
- </array>
- </dict>
- <dict>
- <key>$class</key>
- <dict>
- <key>CF$UID</key>
- <integer>94</integer>
- </dict>
- <key>Identifier</key>
- <dict>
- <key>CF$UID</key>
- <integer>93</integer>
- </dict>
- </dict>
- <string>OneRingWindowController.m</string>
- <dict>
- <key>$classes</key>
- <array>
- <string>IDEArchivableStringIndexPair</string>
- <string>NSObject</string>
- </array>
- <key>$classname</key>
- <string>IDEArchivableStringIndexPair</string>
- </dict>
- <dict>
- <key>$class</key>
- <dict>
- <key>CF$UID</key>
- <integer>94</integer>
- </dict>
- <key>Identifier</key>
- <dict>
- <key>CF$UID</key>
- <integer>96</integer>
- </dict>
- </dict>
- <string>OneRing</string>
- <dict>
- <key>$class</key>
- <dict>
- <key>CF$UID</key>
- <integer>94</integer>
- </dict>
- <key>Identifier</key>
- <dict>
- <key>CF$UID</key>
- <integer>98</integer>
- </dict>
- </dict>
- <string>OneRing</string>
- <dict>
- <key>$class</key>
- <dict>
- <key>CF$UID</key>
- <integer>102</integer>
- </dict>
- <key>documentURL</key>
- <dict>
- <key>CF$UID</key>
- <integer>100</integer>
- </dict>
- <key>timestamp</key>
- <dict>
- <key>CF$UID</key>
- <integer>0</integer>
- </dict>
- </dict>
- <dict>
- <key>$class</key>
- <dict>
- <key>CF$UID</key>
- <integer>101</integer>
- </dict>
- <key>NS.string</key>
-
<string>file://localhost/Users/hongqn/Envs/onering/onering-desktop/cores/webkitcore/OneRing/OneRingWindowController.m</string>
- </dict>
- <dict>
- <key>$classes</key>
- <array>
- <string>NSMutableString</string>
- <string>NSString</string>
- <string>NSObject</string>
- </array>
- <key>$classname</key>
- <string>NSMutableString</string>
- </dict>
- <dict>
- <key>$classes</key>
- <array>
- <string>DVTDocumentLocation</string>
- <string>NSObject</string>
- </array>
- <key>$classname</key>
- <string>DVTDocumentLocation</string>
- </dict>
- <dict>
- <key>$classes</key>
- <array>
- <string>IDENavigableItemArchivableRepresentation</string>
***The diff for this file has been truncated for email.***
=======================================
--- /.hgignore Sat Oct 1 01:17:26 2011
+++ /.hgignore Sun Nov 20 06:54:49 2011
@@ -16,3 +16,5 @@
.*\.bundle$
.*\.dylib$
.*/test/test$
+.*project\.xcworkspace/
+.*xcuserdata/
=======================================
--- /cores/webkitcore/OneRing.xcodeproj/project.pbxproj Sun Nov 20 06:17:45
2011
+++ /cores/webkitcore/OneRing.xcodeproj/project.pbxproj Sun Nov 20 06:54:49
2011
@@ -20,6 +20,8 @@
EA4567BF147942E000830199 /* Window.xib in Resources */ = {isa =
PBXBuildFile; fileRef = EA4567BE147942E000830199 /* Window.xib */; };
EA4567C21479431700830199 /* OneRingWindowController.h in Headers */ =
{isa = PBXBuildFile; fileRef = EA4567C01479431700830199 /*
OneRingWindowController.h */; };
EA4567C31479431700830199 /* OneRingWindowController.m in Sources */ =
{isa = PBXBuildFile; fileRef = EA4567C11479431700830199 /*
OneRingWindowController.m */; };
+ EA4567C71479477C00830199 /* onering.h in Headers */ = {isa =
PBXBuildFile; fileRef = EA4567C61479477C00830199 /* onering.h */; };
+ EA4567C91479498600830199 /* core.c in Sources */ = {isa = PBXBuildFile;
fileRef = EA4567C81479498600830199 /* core.c */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -53,6 +55,8 @@
EA4567BE147942E000830199 /* Window.xib */ = {isa = PBXFileReference;
fileEncoding = 4; lastKnownFileType = file.xib; path = Window.xib;
sourceTree = "<group>"; };
EA4567C01479431700830199 /* OneRingWindowController.h */ = {isa =
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h;
path = OneRingWindowController.h; sourceTree = "<group>"; };
EA4567C11479431700830199 /* OneRingWindowController.m */ = {isa =
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc;
path = OneRingWindowController.m; sourceTree = "<group>"; };
+ EA4567C61479477C00830199 /* onering.h */ = {isa = PBXFileReference;
fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = onering.h;
path = ../../../include/onering.h; sourceTree = "<group>"; };
+ EA4567C81479498600830199 /* core.c */ = {isa = PBXFileReference;
fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = core.c;
sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -121,12 +125,13 @@
EA4567901479421A00830199 /* OneRing */ = {
isa = PBXGroup;
children = (
+ EA4567C81479498600830199 /* core.c */,
EA4567971479421A00830199 /* OneRing.h */,
EA4567981479421A00830199 /* OneRing.m */,
- EA4567911479421A00830199 /* Supporting Files */,
EA4567BE147942E000830199 /* Window.xib */,
EA4567C01479431700830199 /* OneRingWindowController.h */,
EA4567C11479431700830199 /* OneRingWindowController.m */,
+ EA4567911479421A00830199 /* Supporting Files */,
);
path = OneRing;
sourceTree = "<group>";
@@ -134,6 +139,7 @@
EA4567911479421A00830199 /* Supporting Files */ = {
isa = PBXGroup;
children = (
+ EA4567C61479477C00830199 /* onering.h */,
EA4567921479421A00830199 /* OneRing-Info.plist */,
EA4567931479421A00830199 /* InfoPlist.strings */,
EA4567961479421A00830199 /* OneRing-Prefix.pch */,
@@ -168,6 +174,7 @@
buildActionMask =
2147483647;
files = (
EA4567C21479431700830199 /* OneRingWindowController.h in Headers */,
+ EA4567C71479477C00830199 /* onering.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -278,6 +285,7 @@
files = (
EA4567991479421A00830199 /* OneRing.m in Sources */,
EA4567C31479431700830199 /* OneRingWindowController.m in Sources */,
+ EA4567C91479498600830199 /* core.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -339,7 +347,7 @@
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- MACOSX_DEPLOYMENT_TARGET = 10.7;
+ MACOSX_DEPLOYMENT_TARGET = 10.5;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
};
@@ -359,7 +367,7 @@
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- MACOSX_DEPLOYMENT_TARGET = 10.7;
+ MACOSX_DEPLOYMENT_TARGET = 10.5;
SDKROOT = macosx;
};
name = Release;
@@ -372,6 +380,7 @@
FRAMEWORK_VERSION = A;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "OneRing/OneRing-Prefix.pch";
+ HEADER_SEARCH_PATHS = ../../include;
INFOPLIST_FILE = "OneRing/OneRing-Info.plist";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = framework;
@@ -386,6 +395,7 @@
FRAMEWORK_VERSION = A;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "OneRing/OneRing-Prefix.pch";
+ HEADER_SEARCH_PATHS = ../../include;
INFOPLIST_FILE = "OneRing/OneRing-Info.plist";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = framework;
@@ -398,6 +408,7 @@
FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks";
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "OneRing/OneRing-Prefix.pch";
+ HEADER_SEARCH_PATHS = ../../include;
INFOPLIST_FILE = "OneRingTests/OneRingTests-Info.plist";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = octest;
@@ -410,6 +421,7 @@
FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks";
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "OneRing/OneRing-Prefix.pch";
+ HEADER_SEARCH_PATHS = ../../include;
INFOPLIST_FILE = "OneRingTests/OneRingTests-Info.plist";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = octest;
=======================================
--- /cores/webkitcore/OneRing/OneRing.m Sun Nov 20 06:13:29 2011
+++ /cores/webkitcore/OneRing/OneRing.m Sun Nov 20 06:54:49 2011
@@ -6,6 +6,7 @@
// Copyright 2011 __MyCompanyName__. All rights reserved.
//
+#include <onering.h>
#import "OneRing.h"
@implementation OneRing
@@ -21,3 +22,4 @@
}
@end
+
=======================================
--- /cores/webkitcore/OneRingTests/OneRingTests.m Sun Nov 20 06:13:29 2011
+++ /cores/webkitcore/OneRingTests/OneRingTests.m Sun Nov 20 06:54:49 2011
@@ -7,6 +7,7 @@
//
#import "OneRingTests.h"
+#include <onering.h>
@implementation OneRingTests
@@ -24,9 +25,10 @@
[super tearDown];
}
-- (void)testExample
-{
- STFail(@"Unit tests are not implemented yet in OneRingTests");
+- (void)testVersion
+{
+ const char* version = onering_version();
+ STAssertEquals(strcmp(version, "WebKitCore 1.0.0"), 0, @"version
number mismatch");
}
@end
=======================================
--- /include/onering.h Sat Oct 1 01:15:29 2011
+++ /include/onering.h Sun Nov 20 06:54:49 2011
@@ -19,7 +19,7 @@
/* Return the version number of the core.
* e.g. "OneRingQtCore 1.0.0" */
-ONERING_EXPORT const char* onering_version();
+ONERING_EXPORT const char* onering_version(void);
/* Load all OneRingPlugins under dir.
* Returns number of loaded plugins. */
==============================================================================
Revision: 9162d6583708
Author: Qiangning Hong <
hon...@gmail.com>
Date: Mon Dec 12 18:45:01 2011
Log: tmp save
http://code.google.com/p/onering-desktop/source/detail?r=9162d6583708
Modified:
/cores/webkitcore/OneRing.xcodeproj/project.pbxproj
/cores/webkitcore/OneRing/core.c
/include/onering.h
=======================================
--- /cores/webkitcore/OneRing.xcodeproj/project.pbxproj Sun Nov 20 06:54:49
2011
+++ /cores/webkitcore/OneRing.xcodeproj/project.pbxproj Mon Dec 12 18:45:01
2011
@@ -22,6 +22,7 @@
EA4567C31479431700830199 /* OneRingWindowController.m in Sources */ =
{isa = PBXBuildFile; fileRef = EA4567C11479431700830199 /*
OneRingWindowController.m */; };
EA4567C71479477C00830199 /* onering.h in Headers */ = {isa =
PBXBuildFile; fileRef = EA4567C61479477C00830199 /* onering.h */; };
EA4567C91479498600830199 /* core.c in Sources */ = {isa = PBXBuildFile;
fileRef = EA4567C81479498600830199 /* core.c */; };
+ EA4567CB14794E6E00830199 /* pluginloader.c in Sources */ = {isa =
PBXBuildFile; fileRef = EA4567CA14794E6E00830199 /* pluginloader.c */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -57,6 +58,7 @@
EA4567C11479431700830199 /* OneRingWindowController.m */ = {isa =
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc;
path = OneRingWindowController.m; sourceTree = "<group>"; };
EA4567C61479477C00830199 /* onering.h */ = {isa = PBXFileReference;
fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = onering.h;
path = ../../../include/onering.h; sourceTree = "<group>"; };
EA4567C81479498600830199 /* core.c */ = {isa = PBXFileReference;
fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = core.c;
sourceTree = "<group>"; };
+ EA4567CA14794E6E00830199 /* pluginloader.c */ = {isa = PBXFileReference;
fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path =
pluginloader.c; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -132,6 +134,7 @@
EA4567C01479431700830199 /* OneRingWindowController.h */,
EA4567C11479431700830199 /* OneRingWindowController.m */,
EA4567911479421A00830199 /* Supporting Files */,
+ EA4567CA14794E6E00830199 /* pluginloader.c */,
);
path = OneRing;
sourceTree = "<group>";
@@ -286,6 +289,7 @@
EA4567991479421A00830199 /* OneRing.m in Sources */,
EA4567C31479431700830199 /* OneRingWindowController.m in Sources */,
EA4567C91479498600830199 /* core.c in Sources */,
+ EA4567CB14794E6E00830199 /* pluginloader.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
=======================================
--- /cores/webkitcore/OneRing/core.c Sun Nov 20 06:54:49 2011
+++ /cores/webkitcore/OneRing/core.c Mon Dec 12 18:45:01 2011
@@ -7,6 +7,7 @@
//
#include <onering.h>
+#include <dirent.h>
const char* onering_version()
{
=======================================
--- /include/onering.h Sun Nov 20 06:54:49 2011
+++ /include/onering.h Mon Dec 12 18:45:01 2011
@@ -16,6 +16,7 @@
#define ONERING_OK 0
#define ONERING_ERR_INVALID_APPNAME -1
#define ONERING_ERR_NO_HELPER_FUNCTION -2
+#define ONERING_ERR_GENERIC -100
/* Return the version number of the core.
* e.g. "OneRingQtCore 1.0.0" */
==============================================================================
Revision: e19d0e645eba
Author: Qiangning Hong <
hon...@gmail.com>
Date: Mon Dec 12 19:04:27 2011
Log: Meet the needs of PEP333
(
http://www.python.org/dev/peps/pep-0333/#environ-variables).
Thank raptium.
Fixes issue 47.
http://code.google.com/p/onering-desktop/source/detail?r=e19d0e645eba
Modified:
/bindings/python/onering.py
=======================================
--- /bindings/python/onering.py Tue Jan 4 00:25:13 2011
+++ /bindings/python/onering.py Mon Dec 12 19:04:27 2011
@@ -1,3 +1,4 @@
+import sys
import logging
from cStringIO import StringIO
try:
@@ -24,7 +25,15 @@
'SCRIPT_NAME': '',
'PATH_INFO': path,
'QUERY_STRING': query,
+ 'SERVER_NAME': appname,
+ 'SERVER_PORT': '80',
'HTTP_HOST': appname,
+ 'wsgi.version': (1, 0),
+ 'wsgi.url_scheme': 'onering',
+ 'wsgi.errors': sys.stderr,
+ 'wsgi.multithread': True,
+ 'wsgi.multiprocess': False,
+ 'wsgi.run_once': False,
}
if body is not None:
environ['wsgi.input'] = StringIO(body)