Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
bakercp committed Jun 27, 2014
2 parents 2d482e7 + c6f30ac commit acb592c
Show file tree
Hide file tree
Showing 9 changed files with 93 additions and 72 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
raw/
releases/

scripts/access_token.txt

*.mode1v3

# xcode
Expand Down
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
- 0.1.6 (Pending)
- 0.1.7 (Pending)

- 0.1.6
+ Now uses openFrameworks 0.8.2.
+ Add ARCHITECTURE.md document.
+ Updated README.md.
+ Updates version naming scheme.
+ Update ofSketch OSX App plist.
+ Various bugfixes and source cleanup.

- 0.1.5 (06-16-2014)
+ Server now sends available addons to client.
Expand Down
10 changes: 7 additions & 3 deletions ofSketchApp/openFrameworks-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,21 @@
<string>English</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string>${ICON}</string>
<key>CFBundleIdentifier</key>
<string>cc.openFrameworks.ofapp</string>
<string>io.olab.ofSketch</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.1.5</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>CFBundleIconFile</key>
<string>${ICON}</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.developer-tools</string>
</dict>
</plist>
60 changes: 30 additions & 30 deletions ofSketchApp/src/App.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace of {
namespace Sketch {


const std::string App::VERSION_PRE_RELEASE = "";
const std::string App::VERSION_SPECIAL = "";


App::App():
Expand All @@ -45,7 +45,7 @@ App::App():
ofLogNotice("App::App") << "Editor setting's projectDir: " << _editorSettings.getProjectDir();
_taskQueue.registerTaskEvents(this);

HTTP::BasicJSONRPCServerSettings settings; // TODO: load from file.
ofx::HTTP::BasicJSONRPCServerSettings settings; // TODO: load from file.
settings.setBufferSize(1024 * 1024 * 3); // 3 MB
settings.setPort(7890);
server = ofx::HTTP::BasicJSONRPCServer::makeShared(settings);
Expand Down Expand Up @@ -197,7 +197,7 @@ void App::mousePressed(int x, int y, int button)
}


void App::loadProject(const void* pSender, JSONRPC::MethodArgs& args)
void App::loadProject(const void* pSender, ofx::JSONRPC::MethodArgs& args)
{
if (args.params.isMember("projectName")) {
std::string projectName = args.params["projectName"].asString();
Expand All @@ -208,13 +208,13 @@ void App::loadProject(const void* pSender, JSONRPC::MethodArgs& args)
}


void App::loadTemplateProject(const void* pSender, JSONRPC::MethodArgs& args)
void App::loadTemplateProject(const void* pSender, ofx::JSONRPC::MethodArgs& args)
{
_projectManager.loadTemplateProject(pSender, args);
}


void App::saveProject(const void* pSender, JSONRPC::MethodArgs& args)
void App::saveProject(const void* pSender, ofx::JSONRPC::MethodArgs& args)
{
std::string projectName = args.params["projectData"]["projectFile"]["name"].asString();

Expand All @@ -227,7 +227,7 @@ void App::saveProject(const void* pSender, JSONRPC::MethodArgs& args)
}


void App::createProject(const void* pSender, JSONRPC::MethodArgs& args)
void App::createProject(const void* pSender, ofx::JSONRPC::MethodArgs& args)
{
std::string projectName = args.params["projectName"].asString();
if (!_projectManager.projectExists(projectName)) {
Expand All @@ -236,7 +236,7 @@ void App::createProject(const void* pSender, JSONRPC::MethodArgs& args)
}


void App::deleteProject(const void* pSender, JSONRPC::MethodArgs& args)
void App::deleteProject(const void* pSender, ofx::JSONRPC::MethodArgs& args)
{

std::string projectName = args.params["projectName"].asString();
Expand All @@ -246,7 +246,7 @@ void App::deleteProject(const void* pSender, JSONRPC::MethodArgs& args)
}


void App::renameProject(const void* pSender, JSONRPC::MethodArgs& args)
void App::renameProject(const void* pSender, ofx::JSONRPC::MethodArgs& args)
{
std::string projectName = args.params["projectName"].asString();
if (_projectManager.projectExists(projectName)) {
Expand All @@ -256,7 +256,7 @@ void App::renameProject(const void* pSender, JSONRPC::MethodArgs& args)
}


void App::createClass(const void* pSender, JSONRPC::MethodArgs& args)
void App::createClass(const void* pSender, ofx::JSONRPC::MethodArgs& args)
{
std::string projectName = args.params["projectName"].asString();
if (_projectManager.projectExists(projectName)) {
Expand All @@ -269,7 +269,7 @@ void App::createClass(const void* pSender, JSONRPC::MethodArgs& args)
}


void App::deleteClass(const void* pSender, JSONRPC::MethodArgs& args)
void App::deleteClass(const void* pSender, ofx::JSONRPC::MethodArgs& args)
{
std::string projectName = args.params["projectName"].asString();
if (_projectManager.projectExists(projectName)) {
Expand All @@ -283,7 +283,7 @@ void App::deleteClass(const void* pSender, JSONRPC::MethodArgs& args)
}


void App::renameClass(const void* pSender, JSONRPC::MethodArgs& args)
void App::renameClass(const void* pSender, ofx::JSONRPC::MethodArgs& args)
{
std::string projectName = args.params["projectName"].asString();
if (_projectManager.projectExists(projectName)) {
Expand All @@ -299,7 +299,7 @@ void App::renameClass(const void* pSender, JSONRPC::MethodArgs& args)
}


void App::runProject(const void* pSender, JSONRPC::MethodArgs& args)
void App::runProject(const void* pSender, ofx::JSONRPC::MethodArgs& args)
{

std::string projectName = args.params["projectName"].asString();
Expand All @@ -314,7 +314,7 @@ void App::runProject(const void* pSender, JSONRPC::MethodArgs& args)
else args.error["message"] = "The requested project does not exist.";
}

void App::compileProject(const void* pSender, JSONRPC::MethodArgs& args)
void App::compileProject(const void* pSender, ofx::JSONRPC::MethodArgs& args)
{

std::string projectName = args.params["projectName"].asString();
Expand All @@ -323,13 +323,13 @@ void App::compileProject(const void* pSender, JSONRPC::MethodArgs& args)
ofLogNotice("App::compileProject") << "Compiling " << projectName << " project";
const Project& project = _projectManager.getProject(projectName);
Poco::UUID taskId = _compiler.compile(project);
ofLogNotice("APP::compileProject") << "Task ID: " << taskId.toString();
ofLogNotice("App::compileProject") << "Task ID: " << taskId.toString();
args.result = taskId.toString();
}
else args.error["message"] = "The requested project does not exist.";
}

void App::stop(const void* pSender, JSONRPC::MethodArgs& args)
void App::stop(const void* pSender, ofx::JSONRPC::MethodArgs& args)
{
if (args.params.isMember("taskId"))
{
Expand All @@ -345,19 +345,19 @@ void App::stop(const void* pSender, JSONRPC::MethodArgs& args)
}


void App::getProjectList(const void* pSender, JSONRPC::MethodArgs& args)
void App::getProjectList(const void* pSender, ofx::JSONRPC::MethodArgs& args)
{
_projectManager.getProjectList(pSender, args);
}


void App::loadEditorSettings(const void *pSender, JSONRPC::MethodArgs &args)
void App::loadEditorSettings(const void *pSender, ofx::JSONRPC::MethodArgs &args)
{
args.result = _editorSettings.getData();
}


bool App::onWebSocketOpenEvent(HTTP::WebSocketOpenEventArgs& args)
bool App::onWebSocketOpenEvent(ofx::HTTP::WebSocketOpenEventArgs& args)
{
ofLogVerbose("App::onWebSocketOpenEvent") << "Connection opened from: " << args.getConnectionRef().getClientAddress().toString();

Expand All @@ -378,7 +378,7 @@ bool App::onWebSocketOpenEvent(HTTP::WebSocketOpenEventArgs& args)
params["major"] = getVersionMajor();
params["minor"] = getVersionMinor();
params["patch"] = getVersionPatch();
params["prerelease"] = getVersionPreRelease();
params["special"] = getVersionSpecial();
params["target"] = toString(ofGetTargetPlatform());

json = App::toJSONMethod("Server", "version", params);
Expand Down Expand Up @@ -424,7 +424,7 @@ bool App::onWebSocketOpenEvent(HTTP::WebSocketOpenEventArgs& args)
}


bool App::onWebSocketCloseEvent(HTTP::WebSocketCloseEventArgs& args)
bool App::onWebSocketCloseEvent(ofx::HTTP::WebSocketCloseEventArgs& args)
{
std::stringstream ss;

Expand All @@ -437,21 +437,21 @@ bool App::onWebSocketCloseEvent(HTTP::WebSocketCloseEventArgs& args)
}


bool App::onWebSocketFrameReceivedEvent(HTTP::WebSocketFrameEventArgs& args)
bool App::onWebSocketFrameReceivedEvent(ofx::HTTP::WebSocketFrameEventArgs& args)
{
// ofLogVerbose("App::onWebSocketFrameReceivedEvent") << "Frame received from: " << args.getConnectionRef().getClientAddress().toString();
return false; // did not handle it
}


bool App::onWebSocketFrameSentEvent(HTTP::WebSocketFrameEventArgs& args)
bool App::onWebSocketFrameSentEvent(ofx::HTTP::WebSocketFrameEventArgs& args)
{
// ofLogVerbose("App::onWebSocketFrameSentEvent") << "Frame sent to: " << args.getConnectionRef().getClientAddress().toString();
return false; // did not handle it
}


bool App::onWebSocketErrorEvent(HTTP::WebSocketErrorEventArgs& args)
bool App::onWebSocketErrorEvent(ofx::HTTP::WebSocketErrorEventArgs& args)
{
ofLogError("App::onWebSocketErrorEvent") << "Stop: " << args.getError();

Expand All @@ -460,22 +460,22 @@ bool App::onWebSocketErrorEvent(HTTP::WebSocketErrorEventArgs& args)
}


bool App::onHTTPPostEvent(HTTP::PostEventArgs& args)
bool App::onHTTPPostEvent(ofx::HTTP::PostEventArgs& args)
{
// ofLogNotice("ofApp::onHTTPPostEvent") << "Data: " << args.getBuffer().getText();
return false;
}


bool App::onHTTPFormEvent(HTTP::PostFormEventArgs& args)
bool App::onHTTPFormEvent(ofx::HTTP::PostFormEventArgs& args)
{
// ofLogNotice("ofApp::onHTTPFormEvent") << "";
// HTTP::Utils::dumpNameValueCollection(args.getForm(), ofGetLogLevel());
return false;
}


bool App::onHTTPUploadEvent(HTTP::PostUploadEventArgs& args)
bool App::onHTTPUploadEvent(ofx::HTTP::PostUploadEventArgs& args)
{
// std::string stateString = "";
//
Expand Down Expand Up @@ -658,9 +658,9 @@ std::string App::getVersion()
ss << VERSION_MINOR << ".";
ss << VERSION_PATCH;

if (!VERSION_PRE_RELEASE.empty())
if (!VERSION_SPECIAL.empty())
{
ss << "-" << VERSION_PRE_RELEASE;
ss << "-" << VERSION_SPECIAL;
}

return ss.str();
Expand All @@ -684,9 +684,9 @@ int App::getVersionPatch()
}


std::string App::getVersionPreRelease()
std::string App::getVersionSpecial()
{
return VERSION_PRE_RELEASE;
return VERSION_SPECIAL;
}


Expand Down
59 changes: 28 additions & 31 deletions ofSketchApp/src/App.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@
#include "EditorSettings.h"


using namespace ofx;


namespace of {
namespace Sketch {

Expand All @@ -65,30 +62,30 @@ class App: public ofBaseApp

void mousePressed(int x, int y, int button);

void loadProject(const void* pSender, JSONRPC::MethodArgs& args);
void loadTemplateProject(const void* pSender, JSONRPC::MethodArgs& args);
void saveProject(const void* pSender, JSONRPC::MethodArgs& args);
void createProject(const void* pSender, JSONRPC::MethodArgs& args);
void deleteProject(const void* pSender, JSONRPC::MethodArgs& args);
void renameProject(const void* pSender, JSONRPC::MethodArgs& args);
void createClass(const void* pSender, JSONRPC::MethodArgs& args);
void deleteClass(const void* pSender, JSONRPC::MethodArgs& args);
void renameClass(const void* pSender, JSONRPC::MethodArgs& args);
void runProject(const void* pSender, JSONRPC::MethodArgs& args);
void compileProject(const void* pSender, JSONRPC::MethodArgs& args);
void stop(const void* pSender, JSONRPC::MethodArgs& args);
void getProjectList(const void* pSender, JSONRPC::MethodArgs& args);
void loadEditorSettings(const void* pSender, JSONRPC::MethodArgs& args);

bool onWebSocketOpenEvent(HTTP::WebSocketOpenEventArgs& args);
bool onWebSocketCloseEvent(HTTP::WebSocketCloseEventArgs& args);
bool onWebSocketFrameReceivedEvent(HTTP::WebSocketFrameEventArgs& args);
bool onWebSocketFrameSentEvent(HTTP::WebSocketFrameEventArgs& args);
bool onWebSocketErrorEvent(HTTP::WebSocketErrorEventArgs& args);

bool onHTTPPostEvent(HTTP::PostEventArgs& args);
bool onHTTPFormEvent(HTTP::PostFormEventArgs& args);
bool onHTTPUploadEvent(HTTP::PostUploadEventArgs& args);
void loadProject(const void* pSender, ofx::JSONRPC::MethodArgs& args);
void loadTemplateProject(const void* pSender, ofx::JSONRPC::MethodArgs& args);
void saveProject(const void* pSender, ofx::JSONRPC::MethodArgs& args);
void createProject(const void* pSender, ofx::JSONRPC::MethodArgs& args);
void deleteProject(const void* pSender, ofx::JSONRPC::MethodArgs& args);
void renameProject(const void* pSender, ofx::JSONRPC::MethodArgs& args);
void createClass(const void* pSender, ofx::JSONRPC::MethodArgs& args);
void deleteClass(const void* pSender, ofx::JSONRPC::MethodArgs& args);
void renameClass(const void* pSender, ofx::JSONRPC::MethodArgs& args);
void runProject(const void* pSender, ofx::JSONRPC::MethodArgs& args);
void compileProject(const void* pSender, ofx::JSONRPC::MethodArgs& args);
void stop(const void* pSender, ofx::JSONRPC::MethodArgs& args);
void getProjectList(const void* pSender, ofx::JSONRPC::MethodArgs& args);
void loadEditorSettings(const void* pSender, ofx::JSONRPC::MethodArgs& args);

bool onWebSocketOpenEvent(ofx::HTTP::WebSocketOpenEventArgs& args);
bool onWebSocketCloseEvent(ofx::HTTP::WebSocketCloseEventArgs& args);
bool onWebSocketFrameReceivedEvent(ofx::HTTP::WebSocketFrameEventArgs& args);
bool onWebSocketFrameSentEvent(ofx::HTTP::WebSocketFrameEventArgs& args);
bool onWebSocketErrorEvent(ofx::HTTP::WebSocketErrorEventArgs& args);

bool onHTTPPostEvent(ofx::HTTP::PostEventArgs& args);
bool onHTTPFormEvent(ofx::HTTP::PostFormEventArgs& args);
bool onHTTPUploadEvent(ofx::HTTP::PostUploadEventArgs& args);

void onSSLServerVerificationError(Poco::Net::VerificationErrorArgs& args);
void onSSLClientVerificationError(Poco::Net::VerificationErrorArgs& args);
Expand Down Expand Up @@ -116,7 +113,7 @@ class App: public ofBaseApp
static int getVersionMajor();
static int getVersionMinor();
static int getVersionPatch();
static std::string getVersionPreRelease();
static std::string getVersionSpecial();

// TODO: Move this.
static std::string toString(ofTargetPlatform targetPlatform);
Expand All @@ -125,13 +122,13 @@ class App: public ofBaseApp
{
VERSION_MAJOR = 0,
VERSION_MINOR = 1,
VERSION_PATCH = 5
VERSION_PATCH = 6
};

static const std::string VERSION_PRE_RELEASE;
static const std::string VERSION_SPECIAL;

private:
HTTP::BasicJSONRPCServer::SharedPtr server;
ofx::HTTP::BasicJSONRPCServer::SharedPtr server;

// WebSocketLoggerChannel::SharedPtr _loggerChannel;

Expand Down
Loading

0 comments on commit acb592c

Please sign in to comment.