diff --git a/example_drawing_tool/Makefile b/example_drawing_tool/Makefile new file mode 100644 index 0000000..8d8e4c0 --- /dev/null +++ b/example_drawing_tool/Makefile @@ -0,0 +1,13 @@ +# Attempt to load a config.make file. +# If none is found, project defaults in config.project.make will be used. +ifneq ($(wildcard config.make),) + include config.make +endif + +# make sure the the OF_ROOT location is defined +ifndef OF_ROOT + OF_ROOT=$(realpath ../../..) +endif + +# call the project makefile! +include $(OF_ROOT)/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk diff --git a/example_drawing_tool/Project.xcconfig b/example_drawing_tool/Project.xcconfig new file mode 100644 index 0000000..e570b15 --- /dev/null +++ b/example_drawing_tool/Project.xcconfig @@ -0,0 +1,17 @@ +//THE PATH TO THE ROOT OF OUR OF PATH RELATIVE TO THIS PROJECT. +//THIS NEEDS TO BE DEFINED BEFORE CoreOF.xcconfig IS INCLUDED +OF_PATH = ../../.. + +//THIS HAS ALL THE HEADER AND LIBS FOR OF CORE +#include "../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig" + +//ICONS - NEW IN 0072 +ICON_NAME_DEBUG = icon-debug.icns +ICON_NAME_RELEASE = icon.icns +ICON_FILE_PATH = $(OF_PATH)/libs/openFrameworksCompiled/project/osx/ + +//IF YOU WANT AN APP TO HAVE A CUSTOM ICON - PUT THEM IN YOUR DATA FOLDER AND CHANGE ICON_FILE_PATH to: +//ICON_FILE_PATH = bin/data/ + +OTHER_LDFLAGS = $(OF_CORE_LIBS) $(OF_CORE_FRAMEWORKS) +HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS) diff --git a/example_drawing_tool/addons.make b/example_drawing_tool/addons.make new file mode 100644 index 0000000..90083e1 --- /dev/null +++ b/example_drawing_tool/addons.make @@ -0,0 +1,2 @@ +ofxLibwebsockets +ofxSpacebrew diff --git a/example_drawing_tool/bin/data/.gitkeep b/example_drawing_tool/bin/data/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/example_drawing_tool/bin/data/fonts/DINPro-Bold.otf b/example_drawing_tool/bin/data/fonts/DINPro-Bold.otf new file mode 100644 index 0000000..7c83953 Binary files /dev/null and b/example_drawing_tool/bin/data/fonts/DINPro-Bold.otf differ diff --git a/example_drawing_tool/bin/data/fonts/DINPro-Medium.otf b/example_drawing_tool/bin/data/fonts/DINPro-Medium.otf new file mode 100644 index 0000000..b4608d0 Binary files /dev/null and b/example_drawing_tool/bin/data/fonts/DINPro-Medium.otf differ diff --git a/example_drawing_tool/config.make b/example_drawing_tool/config.make new file mode 100644 index 0000000..df10f64 --- /dev/null +++ b/example_drawing_tool/config.make @@ -0,0 +1,142 @@ +################################################################################ +# CONFIGURE PROJECT MAKEFILE (optional) +# This file is where we make project specific configurations. +################################################################################ + +################################################################################ +# OF ROOT +# The location of your root openFrameworks installation +# (default) OF_ROOT = ../../.. +################################################################################ +# OF_ROOT = ../../.. + +################################################################################ +# PROJECT ROOT +# The location of the project - a starting place for searching for files +# (default) PROJECT_ROOT = . (this directory) +# +################################################################################ +# PROJECT_ROOT = . + +################################################################################ +# PROJECT SPECIFIC CHECKS +# This is a project defined section to create internal makefile flags to +# conditionally enable or disable the addition of various features within +# this makefile. For instance, if you want to make changes based on whether +# GTK is installed, one might test that here and create a variable to check. +################################################################################ +# None + +################################################################################ +# PROJECT EXTERNAL SOURCE PATHS +# These are fully qualified paths that are not within the PROJECT_ROOT folder. +# Like source folders in the PROJECT_ROOT, these paths are subject to +# exlclusion via the PROJECT_EXLCUSIONS list. +# +# (default) PROJECT_EXTERNAL_SOURCE_PATHS = (blank) +# +# Note: Leave a leading space when adding list items with the += operator +################################################################################ +# PROJECT_EXTERNAL_SOURCE_PATHS = + +################################################################################ +# PROJECT EXCLUSIONS +# These makefiles assume that all folders in your current project directory +# and any listed in the PROJECT_EXTERNAL_SOURCH_PATHS are are valid locations +# to look for source code. The any folders or files that match any of the +# items in the PROJECT_EXCLUSIONS list below will be ignored. +# +# Each item in the PROJECT_EXCLUSIONS list will be treated as a complete +# string unless teh user adds a wildcard (%) operator to match subdirectories. +# GNU make only allows one wildcard for matching. The second wildcard (%) is +# treated literally. +# +# (default) PROJECT_EXCLUSIONS = (blank) +# +# Will automatically exclude the following: +# +# $(PROJECT_ROOT)/bin% +# $(PROJECT_ROOT)/obj% +# $(PROJECT_ROOT)/%.xcodeproj +# +# Note: Leave a leading space when adding list items with the += operator +################################################################################ +# PROJECT_EXCLUSIONS = + +################################################################################ +# PROJECT LINKER FLAGS +# These flags will be sent to the linker when compiling the executable. +# +# (default) PROJECT_LDFLAGS = -Wl,-rpath=./libs +# +# Note: Leave a leading space when adding list items with the += operator +################################################################################ + +# Currently, shared libraries that are needed are copied to the +# $(PROJECT_ROOT)/bin/libs directory. The following LDFLAGS tell the linker to +# add a runtime path to search for those shared libraries, since they aren't +# incorporated directly into the final executable application binary. +# TODO: should this be a default setting? +# PROJECT_LDFLAGS=-Wl,-rpath=./libs + +################################################################################ +# PROJECT DEFINES +# Create a space-delimited list of DEFINES. The list will be converted into +# CFLAGS with the "-D" flag later in the makefile. +# +# (default) PROJECT_DEFINES = (blank) +# +# Note: Leave a leading space when adding list items with the += operator +################################################################################ +# PROJECT_DEFINES = + +################################################################################ +# PROJECT CFLAGS +# This is a list of fully qualified CFLAGS required when compiling for this +# project. These CFLAGS will be used IN ADDITION TO the PLATFORM_CFLAGS +# defined in your platform specific core configuration files. These flags are +# presented to the compiler BEFORE the PROJECT_OPTIMIZATION_CFLAGS below. +# +# (default) PROJECT_CFLAGS = (blank) +# +# Note: Before adding PROJECT_CFLAGS, note that the PLATFORM_CFLAGS defined in +# your platform specific configuration file will be applied by default and +# further flags here may not be needed. +# +# Note: Leave a leading space when adding list items with the += operator +################################################################################ +# PROJECT_CFLAGS = + +################################################################################ +# PROJECT OPTIMIZATION CFLAGS +# These are lists of CFLAGS that are target-specific. While any flags could +# be conditionally added, they are usually limited to optimization flags. +# These flags are added BEFORE the PROJECT_CFLAGS. +# +# PROJECT_OPTIMIZATION_CFLAGS_RELEASE flags are only applied to RELEASE targets. +# +# (default) PROJECT_OPTIMIZATION_CFLAGS_RELEASE = (blank) +# +# PROJECT_OPTIMIZATION_CFLAGS_DEBUG flags are only applied to DEBUG targets. +# +# (default) PROJECT_OPTIMIZATION_CFLAGS_DEBUG = (blank) +# +# Note: Before adding PROJECT_OPTIMIZATION_CFLAGS, please note that the +# PLATFORM_OPTIMIZATION_CFLAGS defined in your platform specific configuration +# file will be applied by default and further optimization flags here may not +# be needed. +# +# Note: Leave a leading space when adding list items with the += operator +################################################################################ +# PROJECT_OPTIMIZATION_CFLAGS_RELEASE = +# PROJECT_OPTIMIZATION_CFLAGS_DEBUG = + +################################################################################ +# PROJECT COMPILERS +# Custom compilers can be set for CC and CXX +# (default) PROJECT_CXX = (blank) +# (default) PROJECT_CC = (blank) +# Note: Leave a leading space when adding list items with the += operator +################################################################################ +# PROJECT_CXX = +# PROJECT_CC = diff --git a/example_drawing_tool/example_drawing_tool.xcodeproj/project.pbxproj b/example_drawing_tool/example_drawing_tool.xcodeproj/project.pbxproj new file mode 100644 index 0000000..2e7627e --- /dev/null +++ b/example_drawing_tool/example_drawing_tool.xcodeproj/project.pbxproj @@ -0,0 +1,596 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 6D73A566CFEC0B462FE6E43C /* Reactor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2232A9453E355593EF36ADA7 /* Reactor.cpp */; }; + 86135253DC7909CA8590E157 /* Protocol.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 57EEFEC8B85F7C3B15DD45A4 /* Protocol.cpp */; }; + 9EF1133BC23669A5C94FE30F /* jsoncpp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 69668FDE141262BC3C6CA929 /* jsoncpp.cpp */; }; + A08D840E5DC2C6A7F0E514BC /* ofxSpacebrew.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 98FC0EBF71EF465A13CA986F /* ofxSpacebrew.cpp */; }; + A78C77753D562AE8F0E928ED /* Connection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EDF52649DEB8D25CA011EB41 /* Connection.cpp */; }; + C6C3882A0B0872D1485F3874 /* Client.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EE5E38D74C62B19279B65BC7 /* Client.cpp */; }; + CCD326ED8E01272042317DD2 /* Util.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A781C912CD5B01022F6BB2C /* Util.cpp */; }; + D7BE68F81CA0867E00DE3396 /* ofxSpacebrewPanel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D7BE68F41CA0867E00DE3396 /* ofxSpacebrewPanel.cpp */; }; + D7BE68F91CA0867E00DE3396 /* ofxSpacebrewPanelElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D7BE68F61CA0867E00DE3396 /* ofxSpacebrewPanelElement.cpp */; }; + E4328149138ABC9F0047C5CB /* openFrameworksDebug.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E4328148138ABC890047C5CB /* openFrameworksDebug.a */; }; + E4B69E200A3A1BDC003C02F2 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4B69E1D0A3A1BDC003C02F2 /* main.cpp */; }; + E4B69E210A3A1BDC003C02F2 /* ofApp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4B69E1E0A3A1BDC003C02F2 /* ofApp.cpp */; }; + F1AC6AEFB9B93C6AC45C9CA8 /* Events.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 34A70E2C091020EE93F6B1CE /* Events.cpp */; }; + F3AD9E2A2E56B6AF32A0BDAF /* Server.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5D95092D59E7A34C9DB7823E /* Server.cpp */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + E4328147138ABC890047C5CB /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = E4B27C1510CBEB8E00536013; + remoteInfo = openFrameworks; + }; + E4EEB9AB138B136A00A80321 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = E4B27C1410CBEB8E00536013; + remoteInfo = openFrameworks; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + E4C2427710CC5ABF004149E2 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 123354539C152F1EE3FFC190 /* json-forwards.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 30; name = "json-forwards.h"; path = "../../../addons/ofxLibwebsockets/libs/jsoncpp/json/json-forwards.h"; sourceTree = SOURCE_ROOT; }; + 1816162DC196322C5D709C96 /* Server.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 30; name = Server.h; path = ../../../addons/ofxLibwebsockets/libs/ofxLibwebsockets/include/ofxLibwebsockets/Server.h; sourceTree = SOURCE_ROOT; }; + 2232A9453E355593EF36ADA7 /* Reactor.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 30; name = Reactor.cpp; path = ../../../addons/ofxLibwebsockets/libs/ofxLibwebsockets/src/Reactor.cpp; sourceTree = SOURCE_ROOT; }; + 330298EC4A89DC9282754FBC /* ofxLibwebsockets.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 30; name = ofxLibwebsockets.h; path = ../../../addons/ofxLibwebsockets/src/ofxLibwebsockets.h; sourceTree = SOURCE_ROOT; }; + 34A70E2C091020EE93F6B1CE /* Events.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 30; name = Events.cpp; path = ../../../addons/ofxLibwebsockets/libs/ofxLibwebsockets/src/Events.cpp; sourceTree = SOURCE_ROOT; }; + 57EEFEC8B85F7C3B15DD45A4 /* Protocol.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 30; name = Protocol.cpp; path = ../../../addons/ofxLibwebsockets/libs/ofxLibwebsockets/src/Protocol.cpp; sourceTree = SOURCE_ROOT; }; + 5D95092D59E7A34C9DB7823E /* Server.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 30; name = Server.cpp; path = ../../../addons/ofxLibwebsockets/libs/ofxLibwebsockets/src/Server.cpp; sourceTree = SOURCE_ROOT; }; + 69668FDE141262BC3C6CA929 /* jsoncpp.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 30; name = jsoncpp.cpp; path = ../../../addons/ofxLibwebsockets/libs/jsoncpp/jsoncpp.cpp; sourceTree = SOURCE_ROOT; }; + 75DCA31CF0745355CC4AD2DD /* libwebsockets.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 30; name = libwebsockets.h; path = ../../../addons/ofxLibwebsockets/libs/libwebsockets/include/libwebsockets.h; sourceTree = SOURCE_ROOT; }; + 8A781C912CD5B01022F6BB2C /* Util.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 30; name = Util.cpp; path = ../../../addons/ofxLibwebsockets/libs/ofxLibwebsockets/src/Util.cpp; sourceTree = SOURCE_ROOT; }; + 8A7A54FC0AEF8A0E41CFF07C /* Connection.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 30; name = Connection.h; path = ../../../addons/ofxLibwebsockets/libs/ofxLibwebsockets/include/ofxLibwebsockets/Connection.h; sourceTree = SOURCE_ROOT; }; + 98FC0EBF71EF465A13CA986F /* ofxSpacebrew.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 30; name = ofxSpacebrew.cpp; path = ../../../addons/ofxSpacebrew/src/ofxSpacebrew.cpp; sourceTree = SOURCE_ROOT; }; + A881453E52CE0251DEC076CD /* Events.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 30; name = Events.h; path = ../../../addons/ofxLibwebsockets/libs/ofxLibwebsockets/include/ofxLibwebsockets/Events.h; sourceTree = SOURCE_ROOT; }; + BA9FA17BACE0BC9114A35A23 /* Util.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 30; name = Util.h; path = ../../../addons/ofxLibwebsockets/libs/ofxLibwebsockets/include/ofxLibwebsockets/Util.h; sourceTree = SOURCE_ROOT; }; + C2B8940E985FD61B4C8C1E9F /* ofxSpacebrew.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 30; name = ofxSpacebrew.h; path = ../../../addons/ofxSpacebrew/src/ofxSpacebrew.h; sourceTree = SOURCE_ROOT; }; + C77AD7EDA10FC3E9FE9365EF /* Reactor.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 30; name = Reactor.h; path = ../../../addons/ofxLibwebsockets/libs/ofxLibwebsockets/include/ofxLibwebsockets/Reactor.h; sourceTree = SOURCE_ROOT; }; + CF4075AE08DCC901080970F7 /* Protocol.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 30; name = Protocol.h; path = ../../../addons/ofxLibwebsockets/libs/ofxLibwebsockets/include/ofxLibwebsockets/Protocol.h; sourceTree = SOURCE_ROOT; }; + D31CF822CBBBE0B7167F4738 /* lws_config.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 30; name = lws_config.h; path = ../../../addons/ofxLibwebsockets/libs/libwebsockets/include/lws_config.h; sourceTree = SOURCE_ROOT; }; + D7BE68F41CA0867E00DE3396 /* ofxSpacebrewPanel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ofxSpacebrewPanel.cpp; sourceTree = ""; }; + D7BE68F51CA0867E00DE3396 /* ofxSpacebrewPanel.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = ofxSpacebrewPanel.hpp; sourceTree = ""; }; + D7BE68F61CA0867E00DE3396 /* ofxSpacebrewPanelElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ofxSpacebrewPanelElement.cpp; sourceTree = ""; }; + D7BE68F71CA0867E00DE3396 /* ofxSpacebrewPanelElement.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = ofxSpacebrewPanelElement.hpp; sourceTree = ""; }; + E3261A85562BD2578300F23E /* Client.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 30; name = Client.h; path = ../../../addons/ofxLibwebsockets/libs/ofxLibwebsockets/include/ofxLibwebsockets/Client.h; sourceTree = SOURCE_ROOT; }; + E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = openFrameworksLib.xcodeproj; path = ../../../libs/openFrameworksCompiled/project/osx/openFrameworksLib.xcodeproj; sourceTree = SOURCE_ROOT; }; + E4B69B5B0A3A1756003C02F2 /* example_drawing_toolDebug.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = example_drawing_toolDebug.app; sourceTree = BUILT_PRODUCTS_DIR; }; + E4B69E1D0A3A1BDC003C02F2 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = main.cpp; path = src/main.cpp; sourceTree = SOURCE_ROOT; }; + E4B69E1E0A3A1BDC003C02F2 /* ofApp.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 30; name = ofApp.cpp; path = src/ofApp.cpp; sourceTree = SOURCE_ROOT; }; + E4B69E1F0A3A1BDC003C02F2 /* ofApp.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ofApp.h; path = src/ofApp.h; sourceTree = SOURCE_ROOT; }; + E4B6FCAD0C3E899E008CF71C /* openFrameworks-Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist.xml; path = "openFrameworks-Info.plist"; sourceTree = ""; }; + E4EB691F138AFCF100A09F29 /* CoreOF.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = CoreOF.xcconfig; path = ../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig; sourceTree = SOURCE_ROOT; }; + E4EB6923138AFD0F00A09F29 /* Project.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Project.xcconfig; sourceTree = ""; }; + EC14FAAFBB1143E1C64BF2C3 /* json.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 30; name = json.h; path = ../../../addons/ofxLibwebsockets/libs/jsoncpp/json/json.h; sourceTree = SOURCE_ROOT; }; + EDF52649DEB8D25CA011EB41 /* Connection.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 30; name = Connection.cpp; path = ../../../addons/ofxLibwebsockets/libs/ofxLibwebsockets/src/Connection.cpp; sourceTree = SOURCE_ROOT; }; + EE5E38D74C62B19279B65BC7 /* Client.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 30; name = Client.cpp; path = ../../../addons/ofxLibwebsockets/libs/ofxLibwebsockets/src/Client.cpp; sourceTree = SOURCE_ROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + E4B69B590A3A1756003C02F2 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + E4328149138ABC9F0047C5CB /* openFrameworksDebug.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 108C8D494BF6997F7A730F6E /* include */ = { + isa = PBXGroup; + children = ( + 557E2A608249176E0784E609 /* ofxLibwebsockets */, + ); + name = include; + sourceTree = ""; + }; + 12CA34DA3B4F71871CBFA23A /* json */ = { + isa = PBXGroup; + children = ( + 123354539C152F1EE3FFC190 /* json-forwards.h */, + EC14FAAFBB1143E1C64BF2C3 /* json.h */, + ); + name = json; + sourceTree = ""; + }; + 18FCCFAA3CEB7C78C4BFC512 /* include */ = { + isa = PBXGroup; + children = ( + 75DCA31CF0745355CC4AD2DD /* libwebsockets.h */, + D31CF822CBBBE0B7167F4738 /* lws_config.h */, + ); + name = include; + sourceTree = ""; + }; + 213FDE476BBC2B9B0347CC2F /* src */ = { + isa = PBXGroup; + children = ( + EE5E38D74C62B19279B65BC7 /* Client.cpp */, + EDF52649DEB8D25CA011EB41 /* Connection.cpp */, + 34A70E2C091020EE93F6B1CE /* Events.cpp */, + 57EEFEC8B85F7C3B15DD45A4 /* Protocol.cpp */, + 2232A9453E355593EF36ADA7 /* Reactor.cpp */, + 5D95092D59E7A34C9DB7823E /* Server.cpp */, + 8A781C912CD5B01022F6BB2C /* Util.cpp */, + ); + name = src; + sourceTree = ""; + }; + 557E2A608249176E0784E609 /* ofxLibwebsockets */ = { + isa = PBXGroup; + children = ( + E3261A85562BD2578300F23E /* Client.h */, + 8A7A54FC0AEF8A0E41CFF07C /* Connection.h */, + A881453E52CE0251DEC076CD /* Events.h */, + CF4075AE08DCC901080970F7 /* Protocol.h */, + C77AD7EDA10FC3E9FE9365EF /* Reactor.h */, + 1816162DC196322C5D709C96 /* Server.h */, + BA9FA17BACE0BC9114A35A23 /* Util.h */, + ); + name = ofxLibwebsockets; + sourceTree = ""; + }; + 5AC16A8D6EC87B59A03906C1 /* jsoncpp */ = { + isa = PBXGroup; + children = ( + 12CA34DA3B4F71871CBFA23A /* json */, + 69668FDE141262BC3C6CA929 /* jsoncpp.cpp */, + ); + name = jsoncpp; + sourceTree = ""; + }; + 6948EE371B920CB800B5AC1A /* local_addons */ = { + isa = PBXGroup; + children = ( + ); + name = local_addons; + sourceTree = ""; + }; + 70911A54686309FC932B3014 /* libs */ = { + isa = PBXGroup; + children = ( + 5AC16A8D6EC87B59A03906C1 /* jsoncpp */, + CB67BAA20E44B0F45701C777 /* libwebsockets */, + AB97697EC6F10E7234EFF261 /* ofxLibwebsockets */, + ); + name = libs; + sourceTree = ""; + }; + 961F0189D3FC79A9A11F56E1 /* ofxSpacebrew */ = { + isa = PBXGroup; + children = ( + D6F68A2D0DCDC44496E81840 /* src */, + ); + name = ofxSpacebrew; + sourceTree = ""; + }; + 97B6E31FFC746B023496BB48 /* src */ = { + isa = PBXGroup; + children = ( + 330298EC4A89DC9282754FBC /* ofxLibwebsockets.h */, + ); + name = src; + sourceTree = ""; + }; + AAE50E341C7382A4EF10AF5A /* ofxLibwebsockets */ = { + isa = PBXGroup; + children = ( + 97B6E31FFC746B023496BB48 /* src */, + 70911A54686309FC932B3014 /* libs */, + ); + name = ofxLibwebsockets; + sourceTree = ""; + }; + AB97697EC6F10E7234EFF261 /* ofxLibwebsockets */ = { + isa = PBXGroup; + children = ( + 108C8D494BF6997F7A730F6E /* include */, + 213FDE476BBC2B9B0347CC2F /* src */, + ); + name = ofxLibwebsockets; + sourceTree = ""; + }; + BB4B014C10F69532006C3DED /* addons */ = { + isa = PBXGroup; + children = ( + AAE50E341C7382A4EF10AF5A /* ofxLibwebsockets */, + 961F0189D3FC79A9A11F56E1 /* ofxSpacebrew */, + ); + name = addons; + sourceTree = ""; + }; + CB67BAA20E44B0F45701C777 /* libwebsockets */ = { + isa = PBXGroup; + children = ( + 18FCCFAA3CEB7C78C4BFC512 /* include */, + ); + name = libwebsockets; + sourceTree = ""; + }; + D6F68A2D0DCDC44496E81840 /* src */ = { + isa = PBXGroup; + children = ( + 98FC0EBF71EF465A13CA986F /* ofxSpacebrew.cpp */, + C2B8940E985FD61B4C8C1E9F /* ofxSpacebrew.h */, + ); + name = src; + sourceTree = ""; + }; + E4328144138ABC890047C5CB /* Products */ = { + isa = PBXGroup; + children = ( + E4328148138ABC890047C5CB /* openFrameworksDebug.a */, + ); + name = Products; + sourceTree = ""; + }; + E4B69B4A0A3A1720003C02F2 = { + isa = PBXGroup; + children = ( + E4B6FCAD0C3E899E008CF71C /* openFrameworks-Info.plist */, + E4EB6923138AFD0F00A09F29 /* Project.xcconfig */, + E4B69E1C0A3A1BDC003C02F2 /* src */, + E4EEC9E9138DF44700A80321 /* openFrameworks */, + BB4B014C10F69532006C3DED /* addons */, + 6948EE371B920CB800B5AC1A /* local_addons */, + E4B69B5B0A3A1756003C02F2 /* example_drawing_toolDebug.app */, + ); + sourceTree = ""; + }; + E4B69E1C0A3A1BDC003C02F2 /* src */ = { + isa = PBXGroup; + children = ( + E4B69E1D0A3A1BDC003C02F2 /* main.cpp */, + E4B69E1F0A3A1BDC003C02F2 /* ofApp.h */, + E4B69E1E0A3A1BDC003C02F2 /* ofApp.cpp */, + D7BE68F51CA0867E00DE3396 /* ofxSpacebrewPanel.hpp */, + D7BE68F41CA0867E00DE3396 /* ofxSpacebrewPanel.cpp */, + D7BE68F71CA0867E00DE3396 /* ofxSpacebrewPanelElement.hpp */, + D7BE68F61CA0867E00DE3396 /* ofxSpacebrewPanelElement.cpp */, + ); + path = src; + sourceTree = SOURCE_ROOT; + }; + E4EEC9E9138DF44700A80321 /* openFrameworks */ = { + isa = PBXGroup; + children = ( + E4EB691F138AFCF100A09F29 /* CoreOF.xcconfig */, + E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */, + ); + name = openFrameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + E4B69B5A0A3A1756003C02F2 /* example_drawing_tool */ = { + isa = PBXNativeTarget; + buildConfigurationList = E4B69B5F0A3A1757003C02F2 /* Build configuration list for PBXNativeTarget "example_drawing_tool" */; + buildPhases = ( + E4B69B580A3A1756003C02F2 /* Sources */, + E4B69B590A3A1756003C02F2 /* Frameworks */, + E4B6FFFD0C3F9AB9008CF71C /* ShellScript */, + E4C2427710CC5ABF004149E2 /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + E4EEB9AC138B136A00A80321 /* PBXTargetDependency */, + ); + name = example_drawing_tool; + productName = myOFApp; + productReference = E4B69B5B0A3A1756003C02F2 /* example_drawing_toolDebug.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + E4B69B4C0A3A1720003C02F2 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0600; + }; + buildConfigurationList = E4B69B4D0A3A1720003C02F2 /* Build configuration list for PBXProject "example_drawing_tool" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + English, + Japanese, + French, + German, + ); + mainGroup = E4B69B4A0A3A1720003C02F2; + productRefGroup = E4B69B4A0A3A1720003C02F2; + projectDirPath = ""; + projectReferences = ( + { + ProductGroup = E4328144138ABC890047C5CB /* Products */; + ProjectRef = E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */; + }, + ); + projectRoot = ""; + targets = ( + E4B69B5A0A3A1756003C02F2 /* example_drawing_tool */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXReferenceProxy section */ + E4328148138ABC890047C5CB /* openFrameworksDebug.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = openFrameworksDebug.a; + remoteRef = E4328147138ABC890047C5CB /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; +/* End PBXReferenceProxy section */ + +/* Begin PBXShellScriptBuildPhase section */ + E4B6FFFD0C3F9AB9008CF71C /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "rsync -aved ../../../libs/fmodex/lib/osx/libfmodex.dylib \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/\"; install_name_tool -change ./libfmodex.dylib @executable_path/libfmodex.dylib \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/$PRODUCT_NAME\";\nmkdir -p \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/Resources/\"\nrsync -aved \"$ICON_FILE\" \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/Resources/\"\nrsync -aved ../../../libs/glut/lib/osx/GLUT.framework \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/Frameworks/\"\n"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + E4B69B580A3A1756003C02F2 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + E4B69E200A3A1BDC003C02F2 /* main.cpp in Sources */, + E4B69E210A3A1BDC003C02F2 /* ofApp.cpp in Sources */, + 9EF1133BC23669A5C94FE30F /* jsoncpp.cpp in Sources */, + C6C3882A0B0872D1485F3874 /* Client.cpp in Sources */, + A78C77753D562AE8F0E928ED /* Connection.cpp in Sources */, + F1AC6AEFB9B93C6AC45C9CA8 /* Events.cpp in Sources */, + 86135253DC7909CA8590E157 /* Protocol.cpp in Sources */, + 6D73A566CFEC0B462FE6E43C /* Reactor.cpp in Sources */, + F3AD9E2A2E56B6AF32A0BDAF /* Server.cpp in Sources */, + D7BE68F91CA0867E00DE3396 /* ofxSpacebrewPanelElement.cpp in Sources */, + CCD326ED8E01272042317DD2 /* Util.cpp in Sources */, + A08D840E5DC2C6A7F0E514BC /* ofxSpacebrew.cpp in Sources */, + D7BE68F81CA0867E00DE3396 /* ofxSpacebrewPanel.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + E4EEB9AC138B136A00A80321 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = openFrameworks; + targetProxy = E4EEB9AB138B136A00A80321 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + E4B69B4E0A3A1720003C02F2 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = E4EB6923138AFD0F00A09F29 /* Project.xcconfig */; + buildSettings = { + CONFIGURATION_BUILD_DIR = "$(SRCROOT)/bin/"; + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; + GCC_AUTO_VECTORIZATION = YES; + GCC_ENABLE_SSE3_EXTENSIONS = YES; + GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS = YES; + GCC_INLINES_ARE_PRIVATE_EXTERN = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES; + GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = NO; + GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO; + GCC_WARN_UNINITIALIZED_AUTOS = NO; + GCC_WARN_UNUSED_VALUE = NO; + GCC_WARN_UNUSED_VARIABLE = NO; + HEADER_SEARCH_PATHS = ( + "$(OF_CORE_HEADERS)", + ../../../addons/ofxLibwebsockets/libs/jsoncpp, + ../../../addons/ofxLibwebsockets/libs/jsoncpp/json, + ../../../addons/ofxLibwebsockets/libs/libwebsockets/include/, + ../../../addons/ofxLibwebsockets/libs/ofxLibwebsockets/include, + ../../../addons/ofxLibwebsockets/libs/ofxLibwebsockets/include/ofxLibwebsockets, + ../../../addons/ofxLibwebsockets/libs/ofxLibwebsockets/src, + ../../../addons/ofxLibwebsockets/src, + ../../../addons/ofxSpacebrew/src, + ); + MACOSX_DEPLOYMENT_TARGET = 10.8; + ONLY_ACTIVE_ARCH = YES; + OTHER_CPLUSPLUSFLAGS = ( + "-D__MACOSX_CORE__", + "-mtune=native", + ); + OTHER_LDFLAGS = ( + "$(OF_CORE_FRAMEWORKS)", + "$(OF_CORE_LIBS)", + ../../../addons/ofxLibwebsockets/libs/libwebsockets/lib/osx/libwebsockets.a, + ); + SDKROOT = macosx; + }; + name = Debug; + }; + E4B69B4F0A3A1720003C02F2 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = E4EB6923138AFD0F00A09F29 /* Project.xcconfig */; + buildSettings = { + CONFIGURATION_BUILD_DIR = "$(SRCROOT)/bin/"; + COPY_PHASE_STRIP = YES; + DEAD_CODE_STRIPPING = YES; + GCC_AUTO_VECTORIZATION = YES; + GCC_ENABLE_SSE3_EXTENSIONS = YES; + GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS = YES; + GCC_INLINES_ARE_PRIVATE_EXTERN = NO; + GCC_OPTIMIZATION_LEVEL = 3; + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_UNROLL_LOOPS = YES; + GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES; + GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = NO; + GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO; + GCC_WARN_UNINITIALIZED_AUTOS = NO; + GCC_WARN_UNUSED_VALUE = NO; + GCC_WARN_UNUSED_VARIABLE = NO; + HEADER_SEARCH_PATHS = ( + "$(OF_CORE_HEADERS)", + ../../../addons/ofxLibwebsockets/libs/jsoncpp, + ../../../addons/ofxLibwebsockets/libs/jsoncpp/json, + ../../../addons/ofxLibwebsockets/libs/libwebsockets/include/, + ../../../addons/ofxLibwebsockets/libs/ofxLibwebsockets/include, + ../../../addons/ofxLibwebsockets/libs/ofxLibwebsockets/include/ofxLibwebsockets, + ../../../addons/ofxLibwebsockets/libs/ofxLibwebsockets/src, + ../../../addons/ofxLibwebsockets/src, + ../../../addons/ofxSpacebrew/src, + ); + MACOSX_DEPLOYMENT_TARGET = 10.8; + OTHER_CPLUSPLUSFLAGS = ( + "-D__MACOSX_CORE__", + "-mtune=native", + ); + OTHER_LDFLAGS = ( + "$(OF_CORE_FRAMEWORKS)", + "$(OF_CORE_LIBS)", + ../../../addons/ofxLibwebsockets/libs/libwebsockets/lib/osx/libwebsockets.a, + ); + SDKROOT = macosx; + }; + name = Release; + }; + E4B69B600A3A1757003C02F2 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = E4EB6923138AFD0F00A09F29 /* Project.xcconfig */; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", + ); + FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/../../../libs/glut/lib/osx\""; + GCC_DYNAMIC_NO_PIC = NO; + GCC_GENERATE_DEBUGGING_SYMBOLS = YES; + GCC_MODEL_TUNING = NONE; + HEADER_SEARCH_PATHS = ( + "$(OF_CORE_HEADERS)", + ../../../addons/ofxLibwebsockets/libs/jsoncpp, + ../../../addons/ofxLibwebsockets/libs/jsoncpp/json, + ../../../addons/ofxLibwebsockets/libs/libwebsockets/include/, + ../../../addons/ofxLibwebsockets/libs/ofxLibwebsockets/include, + ../../../addons/ofxLibwebsockets/libs/ofxLibwebsockets/include/ofxLibwebsockets, + ../../../addons/ofxLibwebsockets/libs/ofxLibwebsockets/src, + ../../../addons/ofxLibwebsockets/src, + ../../../addons/ofxSpacebrew/src, + ); + ICON = "$(ICON_NAME_DEBUG)"; + ICON_FILE = "$(ICON_FILE_PATH)$(ICON)"; + INFOPLIST_FILE = "openFrameworks-Info.plist"; + INSTALL_PATH = "$(HOME)/Applications"; + LIBRARY_SEARCH_PATHS = "$(inherited)"; + OTHER_LDFLAGS = ( + "$(OF_CORE_FRAMEWORKS)", + "$(OF_CORE_LIBS)", + ../../../addons/ofxLibwebsockets/libs/libwebsockets/lib/osx/libwebsockets.a, + ); + PRODUCT_NAME = "$(TARGET_NAME)Debug"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + E4B69B610A3A1757003C02F2 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = E4EB6923138AFD0F00A09F29 /* Project.xcconfig */; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", + ); + FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/../../../libs/glut/lib/osx\""; + GCC_GENERATE_DEBUGGING_SYMBOLS = YES; + GCC_MODEL_TUNING = NONE; + HEADER_SEARCH_PATHS = ( + "$(OF_CORE_HEADERS)", + ../../../addons/ofxLibwebsockets/libs/jsoncpp, + ../../../addons/ofxLibwebsockets/libs/jsoncpp/json, + ../../../addons/ofxLibwebsockets/libs/libwebsockets/include/, + ../../../addons/ofxLibwebsockets/libs/ofxLibwebsockets/include, + ../../../addons/ofxLibwebsockets/libs/ofxLibwebsockets/include/ofxLibwebsockets, + ../../../addons/ofxLibwebsockets/libs/ofxLibwebsockets/src, + ../../../addons/ofxLibwebsockets/src, + ../../../addons/ofxSpacebrew/src, + ); + ICON = "$(ICON_NAME_RELEASE)"; + ICON_FILE = "$(ICON_FILE_PATH)$(ICON)"; + INFOPLIST_FILE = "openFrameworks-Info.plist"; + INSTALL_PATH = "$(HOME)/Applications"; + LIBRARY_SEARCH_PATHS = "$(inherited)"; + OTHER_LDFLAGS = ( + "$(OF_CORE_FRAMEWORKS)", + "$(OF_CORE_LIBS)", + ../../../addons/ofxLibwebsockets/libs/libwebsockets/lib/osx/libwebsockets.a, + ); + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + baseConfigurationReference = E4EB6923138AFD0F00A09F29; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + E4B69B4D0A3A1720003C02F2 /* Build configuration list for PBXProject "example_drawing_tool" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + E4B69B4E0A3A1720003C02F2 /* Debug */, + E4B69B4F0A3A1720003C02F2 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + E4B69B5F0A3A1757003C02F2 /* Build configuration list for PBXNativeTarget "example_drawing_tool" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + E4B69B600A3A1757003C02F2 /* Debug */, + E4B69B610A3A1757003C02F2 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = E4B69B4C0A3A1720003C02F2 /* Project object */; +} diff --git a/example_drawing_tool/example_drawing_tool.xcodeproj/xcshareddata/xcschemes/example_drawing_tool Debug.xcscheme b/example_drawing_tool/example_drawing_tool.xcodeproj/xcshareddata/xcschemes/example_drawing_tool Debug.xcscheme new file mode 100644 index 0000000..a8eb278 --- /dev/null +++ b/example_drawing_tool/example_drawing_tool.xcodeproj/xcshareddata/xcschemes/example_drawing_tool Debug.xcscheme @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/example_drawing_tool/example_drawing_tool.xcodeproj/xcshareddata/xcschemes/example_drawing_tool Release.xcscheme b/example_drawing_tool/example_drawing_tool.xcodeproj/xcshareddata/xcschemes/example_drawing_tool Release.xcscheme new file mode 100644 index 0000000..9184941 --- /dev/null +++ b/example_drawing_tool/example_drawing_tool.xcodeproj/xcshareddata/xcschemes/example_drawing_tool Release.xcscheme @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/example_drawing_tool/openFrameworks-Info.plist b/example_drawing_tool/openFrameworks-Info.plist new file mode 100644 index 0000000..8d64d2b --- /dev/null +++ b/example_drawing_tool/openFrameworks-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + cc.openFrameworks.ofapp + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + APPL + CFBundleSignature + ???? + CFBundleVersion + 1.0 + CFBundleIconFile + ${ICON} + + diff --git a/example_drawing_tool/src/main.cpp b/example_drawing_tool/src/main.cpp new file mode 100644 index 0000000..e57370b --- /dev/null +++ b/example_drawing_tool/src/main.cpp @@ -0,0 +1,13 @@ +#include "ofMain.h" +#include "ofApp.h" + +//======================================================================== +int main( ){ + ofSetupOpenGL(1024,768,OF_WINDOW); // <-------- setup the GL context + + // this kicks off the running of my app + // can be OF_WINDOW or OF_FULLSCREEN + // pass in width and height too: + ofRunApp(new ofApp()); + +} diff --git a/example_drawing_tool/src/ofApp.cpp b/example_drawing_tool/src/ofApp.cpp new file mode 100644 index 0000000..f682e44 --- /dev/null +++ b/example_drawing_tool/src/ofApp.cpp @@ -0,0 +1,178 @@ +#include "ofApp.h" + +//-------------------------------------------------------------- +void ofApp::setup(){ + + ofSetFrameRate(60); + + string host = Spacebrew::SPACEBREW_CLOUD; // "localhost"; + string name = "of-drawing-tool-example"; + string description = "Draw all the things"; + + spacebrew.addPublish("X", Spacebrew::TYPE_RANGE); + spacebrew.addPublish("Y", Spacebrew::TYPE_RANGE); + spacebrew.addPublish("hue", Spacebrew::TYPE_RANGE); + spacebrew.addPublish("clear", Spacebrew::TYPE_BOOLEAN); + + spacebrew.connect( host, name, description ); + + Spacebrew::addListener(this, spacebrew); + + + //set up the gui tool by passing it your spacebrew + //connection by reference (i.e. with the & symbol) + brewUI.setup( &spacebrew ); + + + numXYs = 0; + hue = 0; + +} + +//-------------------------------------------------------------- +void ofApp::update(){ + + brewUI.update(); + +} + +//-------------------------------------------------------------- +void ofApp::draw(){ + + ofBackgroundGradient(100, 0); + + ofSetLineWidth(4); + + if(points.size()){ + for(int i = 0; i < points.size() - 1; i++){ + + //need to make sure we have enough colors to + ofSetColor(ofColor::fromHsb(hues[i], 200, 200)); + ofDrawLine(points[i], points[i + 1]); + + } + } + + + + //draw UI + brewUI.draw(ofGetWidth() - brewUI.getWidth() - 10, 10); + + + + //Draw app info to screen + string msg; + msg += "App for sending drawing data from Spacebrew \"example_shared_canvas\"\n"; + msg += "Don't forget to add routes from drawing tool to shared canvas at \"" + spacebrew.getHost() + "\"!\n"; + msg += "\n"; + msg += "Click and Drag to draw and send X/Y/Color Values\n"; + msg += "Press SPACE to send a message to clear the canvas (and also clear locally)\n"; + msg += "\n"; + msg += "Points sent: " + ofToString(points.size()) + "\n"; + msg += "Press 'h' to hide Spacebrew Admin Info\n"; + msg += "Press 's' to show Spacebrew Admin Info\n"; + + + + ofSetColor(255); + ofDrawBitmapString(msg, 10, ofGetHeight() - 125); + + +} + + +//-------------------------------------------------------------- +void ofApp::onMessage( Spacebrew::Message & msg ){ + + + + +} + +//-------------------------------------------------------------- +void ofApp::keyPressed(int key){ + + if(key == 's'){ + brewUI.show(); + } + + if(key == 'h'){ + brewUI.hide(); + } + + + if(key == ' '){ + + //send a boolean message to tell the canvas to clear + spacebrew.sendBoolean("clear", true); + + //erase things locally too + points.clear(); + hues.clear(); + + } + + +} + +//-------------------------------------------------------------- +void ofApp::keyReleased(int key){ + +} + +//-------------------------------------------------------------- +void ofApp::mouseMoved(int x, int y ){ + +} + +//-------------------------------------------------------------- +void ofApp::mouseDragged(int x, int y, int button){ + + spacebrew.sendRange("X", ofMap(x, 0, ofGetWidth(), 0, 1023)); + spacebrew.sendRange("Y", ofMap(y, 0, ofGetHeight(), 0, 1023)); + spacebrew.sendRange("hue", hue); + + points.push_back(ofVec2f(x, y)); + hues.push_back(hue); + + hue += 2; + + if(hue > 255) hue = 0; + +} + +//-------------------------------------------------------------- +void ofApp::mousePressed(int x, int y, int button){ + + +} + +//-------------------------------------------------------------- +void ofApp::mouseReleased(int x, int y, int button){ + +} + +//-------------------------------------------------------------- +void ofApp::mouseEntered(int x, int y){ + +} + +//-------------------------------------------------------------- +void ofApp::mouseExited(int x, int y){ + +} + +//-------------------------------------------------------------- +void ofApp::windowResized(int w, int h){ + +} + +//-------------------------------------------------------------- +void ofApp::gotMessage(ofMessage msg){ + +} + +//-------------------------------------------------------------- +void ofApp::dragEvent(ofDragInfo dragInfo){ + +} diff --git a/example_drawing_tool/src/ofApp.h b/example_drawing_tool/src/ofApp.h new file mode 100644 index 0000000..ec309a4 --- /dev/null +++ b/example_drawing_tool/src/ofApp.h @@ -0,0 +1,46 @@ +#pragma once + +#include "ofMain.h" +#include "ofxSpacebrew.h" +#include "ofxSpacebrewPanel.hpp" + + +class ofApp : public ofBaseApp{ + + public: + void setup(); + void update(); + void draw(); + + void keyPressed(int key); + void keyReleased(int key); + void mouseMoved(int x, int y ); + void mouseDragged(int x, int y, int button); + void mousePressed(int x, int y, int button); + void mouseReleased(int x, int y, int button); + void mouseEntered(int x, int y); + void mouseExited(int x, int y); + void windowResized(int w, int h); + void dragEvent(ofDragInfo dragInfo); + void gotMessage(ofMessage msg); + + // create your spacebrew object + Spacebrew::Connection spacebrew; + + // listen to spacebrew Messages + void onMessage( Spacebrew::Message & m ); + + //The Spacebrew UI + //Make sure you have the correct fonts in + //your bin folder! + ofxSpacebrewPanel brewUI; + + //vectors for storing points and colors + vector points; + vector hues; + + //little hack to make sure + //we're getting XY pairs + int numXYs; + int hue; +}; diff --git a/example_drawing_tool/src/ofxSpacebrewPanel.cpp b/example_drawing_tool/src/ofxSpacebrewPanel.cpp new file mode 100644 index 0000000..56d493c --- /dev/null +++ b/example_drawing_tool/src/ofxSpacebrewPanel.cpp @@ -0,0 +1,285 @@ +// +// ofxSpacebrewPanel.cpp +// +// Created by Adiel Fernandez on 2/20/16. +// +// + +#include "ofxSpacebrewPanel.hpp" + + +ofxSpacebrewPanel::ofxSpacebrewPanel(){ + +} + +void ofxSpacebrewPanel::setup(Spacebrew::Connection *_spacebrew){ + + //get local copy of pointer to the connection object + spacebrew = _spacebrew; + + + //Load UI fonts + titles.load("fonts/DINPro-Bold.otf", 16, true); + font.load("fonts/DINPro-Medium.otf", 10, true); + + + isVisible = true; + isOpen = true; + + + //Individual Element formatting + //Ideally hese should be defined in the ofxSpacebrewPanelElement class + //but we need them them below to set the width/height values. + //Make SpacebrewUI namespace then have these globally declared and accessible by this class and the element class via SpacebrewUI::ElementWidth, etc.? + nameWidth = 220; + typeWidth = 80; + outerCircleRad = 7.5; + innerCircleRad = 4.0; + elementHeight = 25; + elementWidth = typeWidth + nameWidth + outerCircleRad; + + + //Get the publishers by going through the connection object THEN + //through the Config object THEN to the getPublish vector + auto pubs = spacebrew -> getConfig() -> getPublish(); + + for(int i = 0; i < pubs.size(); i++){ + + Spacebrew::Message m = pubs[i]; + + ofxSpacebrewPanelElement elem(m.type, m.name, true, &font); + elem.getDimensions(elementHeight, nameWidth, typeWidth, outerCircleRad, innerCircleRad); + + publishers.push_back(elem); + + + } + + //do the same for the subscribers + auto subs = spacebrew -> getConfig() -> getSubscribe(); + + for(int i = 0; i < subs.size(); i++){ + + Spacebrew::Message m = subs[i]; + + ofxSpacebrewPanelElement elem(m.type, m.name, false, &font); + elem.getDimensions(elementHeight, nameWidth, typeWidth, outerCircleRad, innerCircleRad); + + subscribers.push_back(elem); + + } + + //if there are no subs and/or subs then add a placeholder + if(publishers.size() == 0){ + + ofxSpacebrewPanelElement placeholder("N/A", "No Publishers Created", true, &font, true); + placeholder.getDimensions(elementHeight, nameWidth, typeWidth, outerCircleRad, innerCircleRad); + publishers.push_back(placeholder); + + } + + if(subscribers.size() == 0){ + + ofxSpacebrewPanelElement placeholder("N/A", "No Subscribers Created", false, &font, true); + placeholder.getDimensions(elementHeight, nameWidth, typeWidth, outerCircleRad, innerCircleRad); + subscribers.push_back(placeholder); + + } + + + //add up all elements, spacing and font heights to get total box height + int numElements = publishers.size() + subscribers.size(); + + //General Panel Formatting + pubTitle = "/ PUBLISHERS"; + subTitle = "/ SUBSCRIBERS"; + hostTitle = "/ HOST"; + hostName = spacebrew -> getHost(); + + elementSpacing = 5; + padding = 15; + titleSpacing = elementSpacing * 3; + + width = elementWidth + padding * 2; + height = padding * 2 + numElements * elementHeight + (numElements - 1) * elementSpacing; + + height += titleSpacing + titles.stringHeight(pubTitle); + height += titleSpacing + titles.stringHeight(subTitle); + height += titleSpacing + titles.stringHeight(hostTitle); + height += titleSpacing + titles.stringHeight(hostName); + + + //initialize Pos + openPos.set(0, 0); + closedPos.set(0, -height - 10); + + //start as open + animatePos.set(0, 0); + + //need to scale FBO then draw it shrunken down + //or else the FBO makes everything look pixelated + fbo.allocate(width * 2, height * 2); + + //clear out the FBO + fbo.begin(); + ofClear(255, 255, 255, 255); + fbo.end(); + + + //add listener to detect messages + ofAddListener( spacebrew -> onMessageEvent, this, &ofxSpacebrewPanel::onMessage ); + ofAddListener( spacebrew -> onSendEvent, this, &ofxSpacebrewPanel::onSend); + +} + +void ofxSpacebrewPanel::onMessage( Spacebrew::Message& args ){ + + //go through subscribers and see which one this message belongs to + for(int i = 0; i < subscribers.size(); i++){ + + if(subscribers[i].name == args.name){ + subscribers[i].eventTriggered = true; + } + + } + +} + +void ofxSpacebrewPanel::onSend( string& name ){ + + //go through subscribers and see which one this message belongs to + for(int i = 0; i < publishers.size(); i++){ + + if(publishers[i].name == name){ + publishers[i].eventTriggered = true; + } + + } + +} + + +void ofxSpacebrewPanel::update(){ + + //update the publisher & subscriber elements + for(int i = 0; i < publishers.size(); i++){ + publishers[i].update(); + } + + for(int i = 0; i < subscribers.size(); i++){ + subscribers[i].update(); + } + + + + float animateSpeed = 0.09; + + if(isOpen){ + + //prevents unnecessary calculations as interpolations gets 99.999% there + if(ofDist(animatePos.x, animatePos.y, openPos.x, openPos.y) > 0.001){ + animatePos = animatePos.getInterpolated(openPos, animateSpeed); + } + + } else { + + //prevents unnecessary calculations as interpolations gets 99.999% there + if(ofDist(animatePos.x, animatePos.y, closedPos.x, closedPos.y) > 0.001){ + animatePos = animatePos.getInterpolated(closedPos, animateSpeed); + } else { + isVisible = false; + } + + } + + +} + +int ofxSpacebrewPanel::getWidth(){ + return width; +} + +int ofxSpacebrewPanel::getHeight(){ + return height; +} + +void ofxSpacebrewPanel::show(){ + isVisible = true; + isOpen = true; +} + +void ofxSpacebrewPanel::hide(){ + isOpen = false; +} + +void ofxSpacebrewPanel::draw(float _x, float _y){ + + + + if(isVisible){ + + fbo.begin(); + ofEnableAlphaBlending(); + + ofClear(0, 0); + + ofPushMatrix(); + ofScale(2, 2); + ofTranslate(animatePos.x, animatePos.y); + + //draw white background around everything + ofSetColor(255, 220); + ofDrawRectangle(0, 0, width, height); + + //host title + ofSetColor(0); + titles.drawString(hostTitle, padding, padding + titleSpacing); + ofTranslate(0, titles.stringHeight(hostTitle) + titleSpacing); + + //host name + ofSetColor(50); + float centerText = (width - titles.stringWidth(hostName))/2; + titles.drawString(hostName, centerText, padding + titleSpacing); + ofTranslate(0, titles.stringHeight(hostName) + titleSpacing); + + //publishers title + ofSetColor(0); + titles.drawString(pubTitle, padding, padding + titleSpacing); + ofTranslate(0, titles.stringHeight(pubTitle) + titleSpacing); + + //draw publishers + ofTranslate(padding, elementSpacing); + for(int i = 0; i < publishers.size(); i++){ + publishers[i].draw(); + ofTranslate(0, publishers[i].elementHeight + elementSpacing); + } + + //add a little extra gap between pubs and subs + ofTranslate(0, elementSpacing); + + //subs title + ofSetColor(0); + titles.drawString(subTitle, 0, 20); + ofTranslate(0, titles.stringHeight(subTitle) + titleSpacing); + + //draw subs + for(int i = 0; i < subscribers.size(); i++){ + subscribers[i].draw(); + ofTranslate(0, subscribers[i].elementHeight + elementSpacing); + } + + ofPopMatrix(); + + fbo.end(); + + ofSetColor(255); + fbo.draw(_x, _y, width, height); + + + } + + +} + + + diff --git a/example_drawing_tool/src/ofxSpacebrewPanel.hpp b/example_drawing_tool/src/ofxSpacebrewPanel.hpp new file mode 100644 index 0000000..414f2f8 --- /dev/null +++ b/example_drawing_tool/src/ofxSpacebrewPanel.hpp @@ -0,0 +1,89 @@ +// +// SpacebrewUI.hpp +// +// Created by Adiel Fernandez on 2/20/16. +// +// + +#ifndef SpacebrewUI_hpp +#define SpacebrewUI_hpp + +#include + +#endif /* SpacebrewUI */ + +#include "ofMain.h" +#include "ofxSpacebrew.h" +#include "ofxSpacebrewPanelElement.hpp" + +#pragma once + + +class ofxSpacebrewPanel{ + +public: + + ofxSpacebrewPanel(); + + void setup(Spacebrew::Connection *_spacebrew); + void update(); + void draw(float _x, float _y); + + void show(); + void hide(); + int getWidth(); + int getHeight(); + + + + +private: + + void onSend( string& args ); + void onMessage( Spacebrew::Message& name ); + + + + + Spacebrew::Connection *spacebrew; + + //local list of pubs and subs + vector publishers; + vector subscribers; + + bool isVisible; + bool isOpen; + + ofVec2f position; + ofVec2f closedPos, openPos, animatePos; + + + //Formatting + ofTrueTypeFont font; + ofTrueTypeFont titles; + + float width, height; + + //declare these globally so we can have + //use global width/height variables + string pubTitle; + string subTitle; + string hostTitle; + string hostName; + + float nameWidth, typeWidth; + float elementHeight, elementWidth; + float outerCircleRad, innerCircleRad; + float elementSpacing; + float padding; + float titleSpacing; + + + //use an FBO so we can do the + //slide out animation + ofFbo fbo; + +}; + + + diff --git a/example_drawing_tool/src/ofxSpacebrewPanelElement.cpp b/example_drawing_tool/src/ofxSpacebrewPanelElement.cpp new file mode 100644 index 0000000..de5bc2a --- /dev/null +++ b/example_drawing_tool/src/ofxSpacebrewPanelElement.cpp @@ -0,0 +1,191 @@ +// +// ofxSpacebrewPanelElement.cpp +// Drawing Tool +// +// Created by Adiel Fernandez on 2/20/16. +// +// + +#include "ofxSpacebrewPanelElement.hpp" + + +ofxSpacebrewPanelElement::ofxSpacebrewPanelElement(string _type, string _name, bool _isPublisher, ofTrueTypeFont *_font, bool placeHolder){ + + + type = _type; + name = _name; + font = _font; + isPublisher = _isPublisher; + + //set colors depending on type + if(type == "range"){ + typeCol.set(198, 0, 248); + } else if(type == "string"){ + typeCol.set(255, 0, 0); + } else if(type == "boolean"){ + typeCol.set(255, 174, 0); + } + + + + if(isPublisher){ + nameCol.set(176, 237, 255); + } else { + nameCol.set(177, 255, 216); + } + + + //capitalize TYPE name + for(int i = 0; i < type.length(); i++){ + type[i] = toupper(type[i]); + } + + //flag to be flipped by incoming event + eventTriggered = false; + + //use alternate colors when triggered + triggerColors = false; + + //last time triggered + triggerTime = 0; + + //how long to flash alt colors + showTriggeredDelay = 200; + + innerCircleCol.set(255); + outerCircleCol.set(0); + + + + isPlaceHolder = placeHolder; + + //override stuff if we're just a place holder + if(isPlaceHolder){ + nameCol.set(150); + typeCol.set(120); + innerCircleCol.set(200); + outerCircleCol.set(100); + } + + + +} + +//get dimensions from the UI instance +void ofxSpacebrewPanelElement::getDimensions(float elemH, float nameW, float typeW, float outRad, float inRad){ + + elementHeight = elemH; + nameWidth = nameW; + typeWidth = typeW; + outerCircleRad = outRad; + innerCircleRad = inRad; + elementWidth = typeWidth + nameWidth + outerCircleRad; + +} + + +void ofxSpacebrewPanelElement::update(){ + + //change circle colors when an event is triggered + if(!isPlaceHolder){ + + if(eventTriggered){ + triggerTime = ofGetElapsedTimeMillis(); + triggerColors = true; + eventTriggered = false; + } + + + if(triggerColors && ofGetElapsedTimeMillis() - triggerTime < showTriggeredDelay){ + innerCircleCol.set(0); + outerCircleCol.set(4, 203, 255); + } else { + innerCircleCol.set(255); + outerCircleCol.set(0); + } + + } + + +} + +void ofxSpacebrewPanelElement::draw(){ + + + ofPoint nameDim(font -> stringWidth(name), font -> stringHeight(name)); + ofPoint typeDim(font -> stringWidth(type), font -> stringHeight(type)); + + float nameMargin = 15; + + + + ofSetCircleResolution(60); + + //Drawing Publisher from left to right is Type, Name then trigger circle + //need ro reverse if it's a Subscriber + if(isPublisher){ + + //type + ofSetColor(typeCol); + ofDrawRectangle(0, 0, typeWidth, elementHeight); + + ofSetColor(255); + font -> drawString(type, typeWidth/2 - typeDim.x/2, elementHeight/2 + typeDim.y/2); + + //name + ofSetColor(nameCol); + ofDrawRectangle(typeWidth, 0, nameWidth, elementHeight); + + if(!isPlaceHolder){ + ofSetColor(0); + } else { + ofSetColor(255); + } + font -> drawString(name, typeWidth + nameWidth - nameDim.x - nameMargin, elementHeight/2 + nameDim.y/2); + + + //black circle outline + ofSetColor(outerCircleCol); + ofDrawCircle(nameWidth + typeWidth, elementHeight/2, outerCircleRad); + //inner white circle + ofSetColor(innerCircleCol); + ofDrawCircle(nameWidth + typeWidth, elementHeight/2, innerCircleRad); + + } else { + + //push every thing in a little bit so + //the circles align with boxes at the left + ofPushMatrix(); + ofTranslate(outerCircleRad, 0); + + //name + ofSetColor(nameCol); + ofDrawRectangle(0, 0, nameWidth, elementHeight); + + if(!isPlaceHolder){ + ofSetColor(0); + } else { + ofSetColor(255); + } + font -> drawString(name, nameMargin, elementHeight/2 + nameDim.y/2); + + //type + ofSetColor(typeCol); + ofDrawRectangle(nameWidth, 0, typeWidth, elementHeight); + + ofSetColor(255); + font -> drawString(type, nameWidth + typeWidth/2 - typeDim.x/2, elementHeight/2 + typeDim.y/2); + + //black circle outline + ofSetColor(outerCircleCol); + ofDrawCircle(0, elementHeight/2, outerCircleRad); + //inner white circle + ofSetColor(innerCircleCol); + ofDrawCircle(0, elementHeight/2, innerCircleRad); + + ofPopMatrix(); + } + + + +} \ No newline at end of file diff --git a/example_drawing_tool/src/ofxSpacebrewPanelElement.hpp b/example_drawing_tool/src/ofxSpacebrewPanelElement.hpp new file mode 100644 index 0000000..75ee4b9 --- /dev/null +++ b/example_drawing_tool/src/ofxSpacebrewPanelElement.hpp @@ -0,0 +1,50 @@ +// +// ofxSpacebrewPanelElement.hpp +// Drawing Tool +// +// Created by Adiel Fernandez on 2/20/16. +// +// + +#ifndef SpacebrewElement_hpp +#define SpacebrewElement_hpp + +#include + +#endif /* SpacebrewElement_hpp */ + +#include "ofMain.h" +#include "ofxSpacebrew.h" +#pragma once + + + +class ofxSpacebrewPanelElement{ + +public: + + ofxSpacebrewPanelElement(string _type, string _name, bool _isPublisher, ofTrueTypeFont *_font, bool placeHolder = false); + + void getDimensions(float elemH, float nameW, float typeW, float outRad, float inRad); + + void update(); + void draw(); + + //Formatting + float nameWidth, typeWidth; + float elementHeight, elementWidth; + float outerCircleRad, innerCircleRad; + + bool isPublisher; + bool isPlaceHolder; + bool eventTriggered, triggerColors; + int triggerTime, showTriggeredDelay; + + + string type, name; + ofColor typeCol, nameCol; + ofColor innerCircleCol, outerCircleCol; + + ofTrueTypeFont *font; + +}; \ No newline at end of file diff --git a/example_shared_canvas/Makefile b/example_shared_canvas/Makefile new file mode 100644 index 0000000..8d8e4c0 --- /dev/null +++ b/example_shared_canvas/Makefile @@ -0,0 +1,13 @@ +# Attempt to load a config.make file. +# If none is found, project defaults in config.project.make will be used. +ifneq ($(wildcard config.make),) + include config.make +endif + +# make sure the the OF_ROOT location is defined +ifndef OF_ROOT + OF_ROOT=$(realpath ../../..) +endif + +# call the project makefile! +include $(OF_ROOT)/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk diff --git a/example_shared_canvas/Project.xcconfig b/example_shared_canvas/Project.xcconfig new file mode 100644 index 0000000..e570b15 --- /dev/null +++ b/example_shared_canvas/Project.xcconfig @@ -0,0 +1,17 @@ +//THE PATH TO THE ROOT OF OUR OF PATH RELATIVE TO THIS PROJECT. +//THIS NEEDS TO BE DEFINED BEFORE CoreOF.xcconfig IS INCLUDED +OF_PATH = ../../.. + +//THIS HAS ALL THE HEADER AND LIBS FOR OF CORE +#include "../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig" + +//ICONS - NEW IN 0072 +ICON_NAME_DEBUG = icon-debug.icns +ICON_NAME_RELEASE = icon.icns +ICON_FILE_PATH = $(OF_PATH)/libs/openFrameworksCompiled/project/osx/ + +//IF YOU WANT AN APP TO HAVE A CUSTOM ICON - PUT THEM IN YOUR DATA FOLDER AND CHANGE ICON_FILE_PATH to: +//ICON_FILE_PATH = bin/data/ + +OTHER_LDFLAGS = $(OF_CORE_LIBS) $(OF_CORE_FRAMEWORKS) +HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS) diff --git a/example_shared_canvas/addons.make b/example_shared_canvas/addons.make new file mode 100644 index 0000000..90083e1 --- /dev/null +++ b/example_shared_canvas/addons.make @@ -0,0 +1,2 @@ +ofxLibwebsockets +ofxSpacebrew diff --git a/example_shared_canvas/bin/data/.gitkeep b/example_shared_canvas/bin/data/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/example_shared_canvas/bin/data/fonts/DINPro-Bold.otf b/example_shared_canvas/bin/data/fonts/DINPro-Bold.otf new file mode 100644 index 0000000..7c83953 Binary files /dev/null and b/example_shared_canvas/bin/data/fonts/DINPro-Bold.otf differ diff --git a/example_shared_canvas/bin/data/fonts/DINPro-Medium.otf b/example_shared_canvas/bin/data/fonts/DINPro-Medium.otf new file mode 100644 index 0000000..b4608d0 Binary files /dev/null and b/example_shared_canvas/bin/data/fonts/DINPro-Medium.otf differ diff --git a/example_shared_canvas/config.make b/example_shared_canvas/config.make new file mode 100644 index 0000000..df10f64 --- /dev/null +++ b/example_shared_canvas/config.make @@ -0,0 +1,142 @@ +################################################################################ +# CONFIGURE PROJECT MAKEFILE (optional) +# This file is where we make project specific configurations. +################################################################################ + +################################################################################ +# OF ROOT +# The location of your root openFrameworks installation +# (default) OF_ROOT = ../../.. +################################################################################ +# OF_ROOT = ../../.. + +################################################################################ +# PROJECT ROOT +# The location of the project - a starting place for searching for files +# (default) PROJECT_ROOT = . (this directory) +# +################################################################################ +# PROJECT_ROOT = . + +################################################################################ +# PROJECT SPECIFIC CHECKS +# This is a project defined section to create internal makefile flags to +# conditionally enable or disable the addition of various features within +# this makefile. For instance, if you want to make changes based on whether +# GTK is installed, one might test that here and create a variable to check. +################################################################################ +# None + +################################################################################ +# PROJECT EXTERNAL SOURCE PATHS +# These are fully qualified paths that are not within the PROJECT_ROOT folder. +# Like source folders in the PROJECT_ROOT, these paths are subject to +# exlclusion via the PROJECT_EXLCUSIONS list. +# +# (default) PROJECT_EXTERNAL_SOURCE_PATHS = (blank) +# +# Note: Leave a leading space when adding list items with the += operator +################################################################################ +# PROJECT_EXTERNAL_SOURCE_PATHS = + +################################################################################ +# PROJECT EXCLUSIONS +# These makefiles assume that all folders in your current project directory +# and any listed in the PROJECT_EXTERNAL_SOURCH_PATHS are are valid locations +# to look for source code. The any folders or files that match any of the +# items in the PROJECT_EXCLUSIONS list below will be ignored. +# +# Each item in the PROJECT_EXCLUSIONS list will be treated as a complete +# string unless teh user adds a wildcard (%) operator to match subdirectories. +# GNU make only allows one wildcard for matching. The second wildcard (%) is +# treated literally. +# +# (default) PROJECT_EXCLUSIONS = (blank) +# +# Will automatically exclude the following: +# +# $(PROJECT_ROOT)/bin% +# $(PROJECT_ROOT)/obj% +# $(PROJECT_ROOT)/%.xcodeproj +# +# Note: Leave a leading space when adding list items with the += operator +################################################################################ +# PROJECT_EXCLUSIONS = + +################################################################################ +# PROJECT LINKER FLAGS +# These flags will be sent to the linker when compiling the executable. +# +# (default) PROJECT_LDFLAGS = -Wl,-rpath=./libs +# +# Note: Leave a leading space when adding list items with the += operator +################################################################################ + +# Currently, shared libraries that are needed are copied to the +# $(PROJECT_ROOT)/bin/libs directory. The following LDFLAGS tell the linker to +# add a runtime path to search for those shared libraries, since they aren't +# incorporated directly into the final executable application binary. +# TODO: should this be a default setting? +# PROJECT_LDFLAGS=-Wl,-rpath=./libs + +################################################################################ +# PROJECT DEFINES +# Create a space-delimited list of DEFINES. The list will be converted into +# CFLAGS with the "-D" flag later in the makefile. +# +# (default) PROJECT_DEFINES = (blank) +# +# Note: Leave a leading space when adding list items with the += operator +################################################################################ +# PROJECT_DEFINES = + +################################################################################ +# PROJECT CFLAGS +# This is a list of fully qualified CFLAGS required when compiling for this +# project. These CFLAGS will be used IN ADDITION TO the PLATFORM_CFLAGS +# defined in your platform specific core configuration files. These flags are +# presented to the compiler BEFORE the PROJECT_OPTIMIZATION_CFLAGS below. +# +# (default) PROJECT_CFLAGS = (blank) +# +# Note: Before adding PROJECT_CFLAGS, note that the PLATFORM_CFLAGS defined in +# your platform specific configuration file will be applied by default and +# further flags here may not be needed. +# +# Note: Leave a leading space when adding list items with the += operator +################################################################################ +# PROJECT_CFLAGS = + +################################################################################ +# PROJECT OPTIMIZATION CFLAGS +# These are lists of CFLAGS that are target-specific. While any flags could +# be conditionally added, they are usually limited to optimization flags. +# These flags are added BEFORE the PROJECT_CFLAGS. +# +# PROJECT_OPTIMIZATION_CFLAGS_RELEASE flags are only applied to RELEASE targets. +# +# (default) PROJECT_OPTIMIZATION_CFLAGS_RELEASE = (blank) +# +# PROJECT_OPTIMIZATION_CFLAGS_DEBUG flags are only applied to DEBUG targets. +# +# (default) PROJECT_OPTIMIZATION_CFLAGS_DEBUG = (blank) +# +# Note: Before adding PROJECT_OPTIMIZATION_CFLAGS, please note that the +# PLATFORM_OPTIMIZATION_CFLAGS defined in your platform specific configuration +# file will be applied by default and further optimization flags here may not +# be needed. +# +# Note: Leave a leading space when adding list items with the += operator +################################################################################ +# PROJECT_OPTIMIZATION_CFLAGS_RELEASE = +# PROJECT_OPTIMIZATION_CFLAGS_DEBUG = + +################################################################################ +# PROJECT COMPILERS +# Custom compilers can be set for CC and CXX +# (default) PROJECT_CXX = (blank) +# (default) PROJECT_CC = (blank) +# Note: Leave a leading space when adding list items with the += operator +################################################################################ +# PROJECT_CXX = +# PROJECT_CC = diff --git a/example_shared_canvas/example_shared_canvas.xcodeproj/project.pbxproj b/example_shared_canvas/example_shared_canvas.xcodeproj/project.pbxproj new file mode 100644 index 0000000..286c1dc --- /dev/null +++ b/example_shared_canvas/example_shared_canvas.xcodeproj/project.pbxproj @@ -0,0 +1,596 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 6D73A566CFEC0B462FE6E43C /* Reactor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2232A9453E355593EF36ADA7 /* Reactor.cpp */; }; + 86135253DC7909CA8590E157 /* Protocol.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 57EEFEC8B85F7C3B15DD45A4 /* Protocol.cpp */; }; + 9EF1133BC23669A5C94FE30F /* jsoncpp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 69668FDE141262BC3C6CA929 /* jsoncpp.cpp */; }; + A08D840E5DC2C6A7F0E514BC /* ofxSpacebrew.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 98FC0EBF71EF465A13CA986F /* ofxSpacebrew.cpp */; }; + A78C77753D562AE8F0E928ED /* Connection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EDF52649DEB8D25CA011EB41 /* Connection.cpp */; }; + C6C3882A0B0872D1485F3874 /* Client.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EE5E38D74C62B19279B65BC7 /* Client.cpp */; }; + CCD326ED8E01272042317DD2 /* Util.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A781C912CD5B01022F6BB2C /* Util.cpp */; }; + D7BE68F21CA0867400DE3396 /* ofxSpacebrewPanel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D7BE68EE1CA0867400DE3396 /* ofxSpacebrewPanel.cpp */; }; + D7BE68F31CA0867400DE3396 /* ofxSpacebrewPanelElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D7BE68F01CA0867400DE3396 /* ofxSpacebrewPanelElement.cpp */; }; + E4328149138ABC9F0047C5CB /* openFrameworksDebug.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E4328148138ABC890047C5CB /* openFrameworksDebug.a */; }; + E4B69E200A3A1BDC003C02F2 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4B69E1D0A3A1BDC003C02F2 /* main.cpp */; }; + E4B69E210A3A1BDC003C02F2 /* ofApp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4B69E1E0A3A1BDC003C02F2 /* ofApp.cpp */; }; + F1AC6AEFB9B93C6AC45C9CA8 /* Events.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 34A70E2C091020EE93F6B1CE /* Events.cpp */; }; + F3AD9E2A2E56B6AF32A0BDAF /* Server.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5D95092D59E7A34C9DB7823E /* Server.cpp */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + E4328147138ABC890047C5CB /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = E4B27C1510CBEB8E00536013; + remoteInfo = openFrameworks; + }; + E4EEB9AB138B136A00A80321 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = E4B27C1410CBEB8E00536013; + remoteInfo = openFrameworks; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + E4C2427710CC5ABF004149E2 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 123354539C152F1EE3FFC190 /* json-forwards.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 30; name = "json-forwards.h"; path = "../../../addons/ofxLibwebsockets/libs/jsoncpp/json/json-forwards.h"; sourceTree = SOURCE_ROOT; }; + 1816162DC196322C5D709C96 /* Server.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 30; name = Server.h; path = ../../../addons/ofxLibwebsockets/libs/ofxLibwebsockets/include/ofxLibwebsockets/Server.h; sourceTree = SOURCE_ROOT; }; + 2232A9453E355593EF36ADA7 /* Reactor.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 30; name = Reactor.cpp; path = ../../../addons/ofxLibwebsockets/libs/ofxLibwebsockets/src/Reactor.cpp; sourceTree = SOURCE_ROOT; }; + 330298EC4A89DC9282754FBC /* ofxLibwebsockets.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 30; name = ofxLibwebsockets.h; path = ../../../addons/ofxLibwebsockets/src/ofxLibwebsockets.h; sourceTree = SOURCE_ROOT; }; + 34A70E2C091020EE93F6B1CE /* Events.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 30; name = Events.cpp; path = ../../../addons/ofxLibwebsockets/libs/ofxLibwebsockets/src/Events.cpp; sourceTree = SOURCE_ROOT; }; + 57EEFEC8B85F7C3B15DD45A4 /* Protocol.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 30; name = Protocol.cpp; path = ../../../addons/ofxLibwebsockets/libs/ofxLibwebsockets/src/Protocol.cpp; sourceTree = SOURCE_ROOT; }; + 5D95092D59E7A34C9DB7823E /* Server.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 30; name = Server.cpp; path = ../../../addons/ofxLibwebsockets/libs/ofxLibwebsockets/src/Server.cpp; sourceTree = SOURCE_ROOT; }; + 69668FDE141262BC3C6CA929 /* jsoncpp.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 30; name = jsoncpp.cpp; path = ../../../addons/ofxLibwebsockets/libs/jsoncpp/jsoncpp.cpp; sourceTree = SOURCE_ROOT; }; + 75DCA31CF0745355CC4AD2DD /* libwebsockets.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 30; name = libwebsockets.h; path = ../../../addons/ofxLibwebsockets/libs/libwebsockets/include/libwebsockets.h; sourceTree = SOURCE_ROOT; }; + 8A781C912CD5B01022F6BB2C /* Util.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 30; name = Util.cpp; path = ../../../addons/ofxLibwebsockets/libs/ofxLibwebsockets/src/Util.cpp; sourceTree = SOURCE_ROOT; }; + 8A7A54FC0AEF8A0E41CFF07C /* Connection.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 30; name = Connection.h; path = ../../../addons/ofxLibwebsockets/libs/ofxLibwebsockets/include/ofxLibwebsockets/Connection.h; sourceTree = SOURCE_ROOT; }; + 98FC0EBF71EF465A13CA986F /* ofxSpacebrew.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 30; name = ofxSpacebrew.cpp; path = ../../../addons/ofxSpacebrew/src/ofxSpacebrew.cpp; sourceTree = SOURCE_ROOT; }; + A881453E52CE0251DEC076CD /* Events.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 30; name = Events.h; path = ../../../addons/ofxLibwebsockets/libs/ofxLibwebsockets/include/ofxLibwebsockets/Events.h; sourceTree = SOURCE_ROOT; }; + BA9FA17BACE0BC9114A35A23 /* Util.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 30; name = Util.h; path = ../../../addons/ofxLibwebsockets/libs/ofxLibwebsockets/include/ofxLibwebsockets/Util.h; sourceTree = SOURCE_ROOT; }; + C2B8940E985FD61B4C8C1E9F /* ofxSpacebrew.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 30; name = ofxSpacebrew.h; path = ../../../addons/ofxSpacebrew/src/ofxSpacebrew.h; sourceTree = SOURCE_ROOT; }; + C77AD7EDA10FC3E9FE9365EF /* Reactor.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 30; name = Reactor.h; path = ../../../addons/ofxLibwebsockets/libs/ofxLibwebsockets/include/ofxLibwebsockets/Reactor.h; sourceTree = SOURCE_ROOT; }; + CF4075AE08DCC901080970F7 /* Protocol.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 30; name = Protocol.h; path = ../../../addons/ofxLibwebsockets/libs/ofxLibwebsockets/include/ofxLibwebsockets/Protocol.h; sourceTree = SOURCE_ROOT; }; + D31CF822CBBBE0B7167F4738 /* lws_config.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 30; name = lws_config.h; path = ../../../addons/ofxLibwebsockets/libs/libwebsockets/include/lws_config.h; sourceTree = SOURCE_ROOT; }; + D7BE68EE1CA0867400DE3396 /* ofxSpacebrewPanel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ofxSpacebrewPanel.cpp; sourceTree = ""; }; + D7BE68EF1CA0867400DE3396 /* ofxSpacebrewPanel.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = ofxSpacebrewPanel.hpp; sourceTree = ""; }; + D7BE68F01CA0867400DE3396 /* ofxSpacebrewPanelElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ofxSpacebrewPanelElement.cpp; sourceTree = ""; }; + D7BE68F11CA0867400DE3396 /* ofxSpacebrewPanelElement.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = ofxSpacebrewPanelElement.hpp; sourceTree = ""; }; + E3261A85562BD2578300F23E /* Client.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 30; name = Client.h; path = ../../../addons/ofxLibwebsockets/libs/ofxLibwebsockets/include/ofxLibwebsockets/Client.h; sourceTree = SOURCE_ROOT; }; + E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = openFrameworksLib.xcodeproj; path = ../../../libs/openFrameworksCompiled/project/osx/openFrameworksLib.xcodeproj; sourceTree = SOURCE_ROOT; }; + E4B69B5B0A3A1756003C02F2 /* example_shared_canvasDebug.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = example_shared_canvasDebug.app; sourceTree = BUILT_PRODUCTS_DIR; }; + E4B69E1D0A3A1BDC003C02F2 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = main.cpp; path = src/main.cpp; sourceTree = SOURCE_ROOT; }; + E4B69E1E0A3A1BDC003C02F2 /* ofApp.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 30; name = ofApp.cpp; path = src/ofApp.cpp; sourceTree = SOURCE_ROOT; }; + E4B69E1F0A3A1BDC003C02F2 /* ofApp.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ofApp.h; path = src/ofApp.h; sourceTree = SOURCE_ROOT; }; + E4B6FCAD0C3E899E008CF71C /* openFrameworks-Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist.xml; path = "openFrameworks-Info.plist"; sourceTree = ""; }; + E4EB691F138AFCF100A09F29 /* CoreOF.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = CoreOF.xcconfig; path = ../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig; sourceTree = SOURCE_ROOT; }; + E4EB6923138AFD0F00A09F29 /* Project.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Project.xcconfig; sourceTree = ""; }; + EC14FAAFBB1143E1C64BF2C3 /* json.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 30; name = json.h; path = ../../../addons/ofxLibwebsockets/libs/jsoncpp/json/json.h; sourceTree = SOURCE_ROOT; }; + EDF52649DEB8D25CA011EB41 /* Connection.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 30; name = Connection.cpp; path = ../../../addons/ofxLibwebsockets/libs/ofxLibwebsockets/src/Connection.cpp; sourceTree = SOURCE_ROOT; }; + EE5E38D74C62B19279B65BC7 /* Client.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 30; name = Client.cpp; path = ../../../addons/ofxLibwebsockets/libs/ofxLibwebsockets/src/Client.cpp; sourceTree = SOURCE_ROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + E4B69B590A3A1756003C02F2 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + E4328149138ABC9F0047C5CB /* openFrameworksDebug.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 108C8D494BF6997F7A730F6E /* include */ = { + isa = PBXGroup; + children = ( + 557E2A608249176E0784E609 /* ofxLibwebsockets */, + ); + name = include; + sourceTree = ""; + }; + 12CA34DA3B4F71871CBFA23A /* json */ = { + isa = PBXGroup; + children = ( + 123354539C152F1EE3FFC190 /* json-forwards.h */, + EC14FAAFBB1143E1C64BF2C3 /* json.h */, + ); + name = json; + sourceTree = ""; + }; + 18FCCFAA3CEB7C78C4BFC512 /* include */ = { + isa = PBXGroup; + children = ( + 75DCA31CF0745355CC4AD2DD /* libwebsockets.h */, + D31CF822CBBBE0B7167F4738 /* lws_config.h */, + ); + name = include; + sourceTree = ""; + }; + 213FDE476BBC2B9B0347CC2F /* src */ = { + isa = PBXGroup; + children = ( + EE5E38D74C62B19279B65BC7 /* Client.cpp */, + EDF52649DEB8D25CA011EB41 /* Connection.cpp */, + 34A70E2C091020EE93F6B1CE /* Events.cpp */, + 57EEFEC8B85F7C3B15DD45A4 /* Protocol.cpp */, + 2232A9453E355593EF36ADA7 /* Reactor.cpp */, + 5D95092D59E7A34C9DB7823E /* Server.cpp */, + 8A781C912CD5B01022F6BB2C /* Util.cpp */, + ); + name = src; + sourceTree = ""; + }; + 557E2A608249176E0784E609 /* ofxLibwebsockets */ = { + isa = PBXGroup; + children = ( + E3261A85562BD2578300F23E /* Client.h */, + 8A7A54FC0AEF8A0E41CFF07C /* Connection.h */, + A881453E52CE0251DEC076CD /* Events.h */, + CF4075AE08DCC901080970F7 /* Protocol.h */, + C77AD7EDA10FC3E9FE9365EF /* Reactor.h */, + 1816162DC196322C5D709C96 /* Server.h */, + BA9FA17BACE0BC9114A35A23 /* Util.h */, + ); + name = ofxLibwebsockets; + sourceTree = ""; + }; + 5AC16A8D6EC87B59A03906C1 /* jsoncpp */ = { + isa = PBXGroup; + children = ( + 12CA34DA3B4F71871CBFA23A /* json */, + 69668FDE141262BC3C6CA929 /* jsoncpp.cpp */, + ); + name = jsoncpp; + sourceTree = ""; + }; + 6948EE371B920CB800B5AC1A /* local_addons */ = { + isa = PBXGroup; + children = ( + ); + name = local_addons; + sourceTree = ""; + }; + 70911A54686309FC932B3014 /* libs */ = { + isa = PBXGroup; + children = ( + 5AC16A8D6EC87B59A03906C1 /* jsoncpp */, + CB67BAA20E44B0F45701C777 /* libwebsockets */, + AB97697EC6F10E7234EFF261 /* ofxLibwebsockets */, + ); + name = libs; + sourceTree = ""; + }; + 961F0189D3FC79A9A11F56E1 /* ofxSpacebrew */ = { + isa = PBXGroup; + children = ( + D6F68A2D0DCDC44496E81840 /* src */, + ); + name = ofxSpacebrew; + sourceTree = ""; + }; + 97B6E31FFC746B023496BB48 /* src */ = { + isa = PBXGroup; + children = ( + 330298EC4A89DC9282754FBC /* ofxLibwebsockets.h */, + ); + name = src; + sourceTree = ""; + }; + AAE50E341C7382A4EF10AF5A /* ofxLibwebsockets */ = { + isa = PBXGroup; + children = ( + 97B6E31FFC746B023496BB48 /* src */, + 70911A54686309FC932B3014 /* libs */, + ); + name = ofxLibwebsockets; + sourceTree = ""; + }; + AB97697EC6F10E7234EFF261 /* ofxLibwebsockets */ = { + isa = PBXGroup; + children = ( + 108C8D494BF6997F7A730F6E /* include */, + 213FDE476BBC2B9B0347CC2F /* src */, + ); + name = ofxLibwebsockets; + sourceTree = ""; + }; + BB4B014C10F69532006C3DED /* addons */ = { + isa = PBXGroup; + children = ( + AAE50E341C7382A4EF10AF5A /* ofxLibwebsockets */, + 961F0189D3FC79A9A11F56E1 /* ofxSpacebrew */, + ); + name = addons; + sourceTree = ""; + }; + CB67BAA20E44B0F45701C777 /* libwebsockets */ = { + isa = PBXGroup; + children = ( + 18FCCFAA3CEB7C78C4BFC512 /* include */, + ); + name = libwebsockets; + sourceTree = ""; + }; + D6F68A2D0DCDC44496E81840 /* src */ = { + isa = PBXGroup; + children = ( + 98FC0EBF71EF465A13CA986F /* ofxSpacebrew.cpp */, + C2B8940E985FD61B4C8C1E9F /* ofxSpacebrew.h */, + ); + name = src; + sourceTree = ""; + }; + E4328144138ABC890047C5CB /* Products */ = { + isa = PBXGroup; + children = ( + E4328148138ABC890047C5CB /* openFrameworksDebug.a */, + ); + name = Products; + sourceTree = ""; + }; + E4B69B4A0A3A1720003C02F2 = { + isa = PBXGroup; + children = ( + E4B6FCAD0C3E899E008CF71C /* openFrameworks-Info.plist */, + E4EB6923138AFD0F00A09F29 /* Project.xcconfig */, + E4B69E1C0A3A1BDC003C02F2 /* src */, + E4EEC9E9138DF44700A80321 /* openFrameworks */, + BB4B014C10F69532006C3DED /* addons */, + 6948EE371B920CB800B5AC1A /* local_addons */, + E4B69B5B0A3A1756003C02F2 /* example_shared_canvasDebug.app */, + ); + sourceTree = ""; + }; + E4B69E1C0A3A1BDC003C02F2 /* src */ = { + isa = PBXGroup; + children = ( + E4B69E1D0A3A1BDC003C02F2 /* main.cpp */, + E4B69E1F0A3A1BDC003C02F2 /* ofApp.h */, + E4B69E1E0A3A1BDC003C02F2 /* ofApp.cpp */, + D7BE68EF1CA0867400DE3396 /* ofxSpacebrewPanel.hpp */, + D7BE68EE1CA0867400DE3396 /* ofxSpacebrewPanel.cpp */, + D7BE68F11CA0867400DE3396 /* ofxSpacebrewPanelElement.hpp */, + D7BE68F01CA0867400DE3396 /* ofxSpacebrewPanelElement.cpp */, + ); + path = src; + sourceTree = SOURCE_ROOT; + }; + E4EEC9E9138DF44700A80321 /* openFrameworks */ = { + isa = PBXGroup; + children = ( + E4EB691F138AFCF100A09F29 /* CoreOF.xcconfig */, + E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */, + ); + name = openFrameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + E4B69B5A0A3A1756003C02F2 /* example_shared_canvas */ = { + isa = PBXNativeTarget; + buildConfigurationList = E4B69B5F0A3A1757003C02F2 /* Build configuration list for PBXNativeTarget "example_shared_canvas" */; + buildPhases = ( + E4B69B580A3A1756003C02F2 /* Sources */, + E4B69B590A3A1756003C02F2 /* Frameworks */, + E4B6FFFD0C3F9AB9008CF71C /* ShellScript */, + E4C2427710CC5ABF004149E2 /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + E4EEB9AC138B136A00A80321 /* PBXTargetDependency */, + ); + name = example_shared_canvas; + productName = myOFApp; + productReference = E4B69B5B0A3A1756003C02F2 /* example_shared_canvasDebug.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + E4B69B4C0A3A1720003C02F2 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0600; + }; + buildConfigurationList = E4B69B4D0A3A1720003C02F2 /* Build configuration list for PBXProject "example_shared_canvas" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + English, + Japanese, + French, + German, + ); + mainGroup = E4B69B4A0A3A1720003C02F2; + productRefGroup = E4B69B4A0A3A1720003C02F2; + projectDirPath = ""; + projectReferences = ( + { + ProductGroup = E4328144138ABC890047C5CB /* Products */; + ProjectRef = E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */; + }, + ); + projectRoot = ""; + targets = ( + E4B69B5A0A3A1756003C02F2 /* example_shared_canvas */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXReferenceProxy section */ + E4328148138ABC890047C5CB /* openFrameworksDebug.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = openFrameworksDebug.a; + remoteRef = E4328147138ABC890047C5CB /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; +/* End PBXReferenceProxy section */ + +/* Begin PBXShellScriptBuildPhase section */ + E4B6FFFD0C3F9AB9008CF71C /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "rsync -aved ../../../libs/fmodex/lib/osx/libfmodex.dylib \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/\"; install_name_tool -change ./libfmodex.dylib @executable_path/libfmodex.dylib \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/$PRODUCT_NAME\";\nmkdir -p \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/Resources/\"\nrsync -aved \"$ICON_FILE\" \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/Resources/\"\nrsync -aved ../../../libs/glut/lib/osx/GLUT.framework \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/Frameworks/\"\n"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + E4B69B580A3A1756003C02F2 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + E4B69E200A3A1BDC003C02F2 /* main.cpp in Sources */, + E4B69E210A3A1BDC003C02F2 /* ofApp.cpp in Sources */, + 9EF1133BC23669A5C94FE30F /* jsoncpp.cpp in Sources */, + C6C3882A0B0872D1485F3874 /* Client.cpp in Sources */, + A78C77753D562AE8F0E928ED /* Connection.cpp in Sources */, + F1AC6AEFB9B93C6AC45C9CA8 /* Events.cpp in Sources */, + 86135253DC7909CA8590E157 /* Protocol.cpp in Sources */, + 6D73A566CFEC0B462FE6E43C /* Reactor.cpp in Sources */, + F3AD9E2A2E56B6AF32A0BDAF /* Server.cpp in Sources */, + D7BE68F31CA0867400DE3396 /* ofxSpacebrewPanelElement.cpp in Sources */, + CCD326ED8E01272042317DD2 /* Util.cpp in Sources */, + A08D840E5DC2C6A7F0E514BC /* ofxSpacebrew.cpp in Sources */, + D7BE68F21CA0867400DE3396 /* ofxSpacebrewPanel.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + E4EEB9AC138B136A00A80321 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = openFrameworks; + targetProxy = E4EEB9AB138B136A00A80321 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + E4B69B4E0A3A1720003C02F2 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = E4EB6923138AFD0F00A09F29 /* Project.xcconfig */; + buildSettings = { + CONFIGURATION_BUILD_DIR = "$(SRCROOT)/bin/"; + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; + GCC_AUTO_VECTORIZATION = YES; + GCC_ENABLE_SSE3_EXTENSIONS = YES; + GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS = YES; + GCC_INLINES_ARE_PRIVATE_EXTERN = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES; + GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = NO; + GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO; + GCC_WARN_UNINITIALIZED_AUTOS = NO; + GCC_WARN_UNUSED_VALUE = NO; + GCC_WARN_UNUSED_VARIABLE = NO; + HEADER_SEARCH_PATHS = ( + "$(OF_CORE_HEADERS)", + ../../../addons/ofxLibwebsockets/libs/jsoncpp, + ../../../addons/ofxLibwebsockets/libs/jsoncpp/json, + ../../../addons/ofxLibwebsockets/libs/libwebsockets/include/, + ../../../addons/ofxLibwebsockets/libs/ofxLibwebsockets/include, + ../../../addons/ofxLibwebsockets/libs/ofxLibwebsockets/include/ofxLibwebsockets, + ../../../addons/ofxLibwebsockets/libs/ofxLibwebsockets/src, + ../../../addons/ofxLibwebsockets/src, + ../../../addons/ofxSpacebrew/src, + ); + MACOSX_DEPLOYMENT_TARGET = 10.8; + ONLY_ACTIVE_ARCH = YES; + OTHER_CPLUSPLUSFLAGS = ( + "-D__MACOSX_CORE__", + "-mtune=native", + ); + OTHER_LDFLAGS = ( + "$(OF_CORE_FRAMEWORKS)", + "$(OF_CORE_LIBS)", + ../../../addons/ofxLibwebsockets/libs/libwebsockets/lib/osx/libwebsockets.a, + ); + SDKROOT = macosx; + }; + name = Debug; + }; + E4B69B4F0A3A1720003C02F2 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = E4EB6923138AFD0F00A09F29 /* Project.xcconfig */; + buildSettings = { + CONFIGURATION_BUILD_DIR = "$(SRCROOT)/bin/"; + COPY_PHASE_STRIP = YES; + DEAD_CODE_STRIPPING = YES; + GCC_AUTO_VECTORIZATION = YES; + GCC_ENABLE_SSE3_EXTENSIONS = YES; + GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS = YES; + GCC_INLINES_ARE_PRIVATE_EXTERN = NO; + GCC_OPTIMIZATION_LEVEL = 3; + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_UNROLL_LOOPS = YES; + GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES; + GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = NO; + GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO; + GCC_WARN_UNINITIALIZED_AUTOS = NO; + GCC_WARN_UNUSED_VALUE = NO; + GCC_WARN_UNUSED_VARIABLE = NO; + HEADER_SEARCH_PATHS = ( + "$(OF_CORE_HEADERS)", + ../../../addons/ofxLibwebsockets/libs/jsoncpp, + ../../../addons/ofxLibwebsockets/libs/jsoncpp/json, + ../../../addons/ofxLibwebsockets/libs/libwebsockets/include/, + ../../../addons/ofxLibwebsockets/libs/ofxLibwebsockets/include, + ../../../addons/ofxLibwebsockets/libs/ofxLibwebsockets/include/ofxLibwebsockets, + ../../../addons/ofxLibwebsockets/libs/ofxLibwebsockets/src, + ../../../addons/ofxLibwebsockets/src, + ../../../addons/ofxSpacebrew/src, + ); + MACOSX_DEPLOYMENT_TARGET = 10.8; + OTHER_CPLUSPLUSFLAGS = ( + "-D__MACOSX_CORE__", + "-mtune=native", + ); + OTHER_LDFLAGS = ( + "$(OF_CORE_FRAMEWORKS)", + "$(OF_CORE_LIBS)", + ../../../addons/ofxLibwebsockets/libs/libwebsockets/lib/osx/libwebsockets.a, + ); + SDKROOT = macosx; + }; + name = Release; + }; + E4B69B600A3A1757003C02F2 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = E4EB6923138AFD0F00A09F29 /* Project.xcconfig */; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", + ); + FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/../../../libs/glut/lib/osx\""; + GCC_DYNAMIC_NO_PIC = NO; + GCC_GENERATE_DEBUGGING_SYMBOLS = YES; + GCC_MODEL_TUNING = NONE; + HEADER_SEARCH_PATHS = ( + "$(OF_CORE_HEADERS)", + ../../../addons/ofxLibwebsockets/libs/jsoncpp, + ../../../addons/ofxLibwebsockets/libs/jsoncpp/json, + ../../../addons/ofxLibwebsockets/libs/libwebsockets/include/, + ../../../addons/ofxLibwebsockets/libs/ofxLibwebsockets/include, + ../../../addons/ofxLibwebsockets/libs/ofxLibwebsockets/include/ofxLibwebsockets, + ../../../addons/ofxLibwebsockets/libs/ofxLibwebsockets/src, + ../../../addons/ofxLibwebsockets/src, + ../../../addons/ofxSpacebrew/src, + ); + ICON = "$(ICON_NAME_DEBUG)"; + ICON_FILE = "$(ICON_FILE_PATH)$(ICON)"; + INFOPLIST_FILE = "openFrameworks-Info.plist"; + INSTALL_PATH = "$(HOME)/Applications"; + LIBRARY_SEARCH_PATHS = "$(inherited)"; + OTHER_LDFLAGS = ( + "$(OF_CORE_FRAMEWORKS)", + "$(OF_CORE_LIBS)", + ../../../addons/ofxLibwebsockets/libs/libwebsockets/lib/osx/libwebsockets.a, + ); + PRODUCT_NAME = "$(TARGET_NAME)Debug"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + E4B69B610A3A1757003C02F2 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = E4EB6923138AFD0F00A09F29 /* Project.xcconfig */; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", + ); + FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/../../../libs/glut/lib/osx\""; + GCC_GENERATE_DEBUGGING_SYMBOLS = YES; + GCC_MODEL_TUNING = NONE; + HEADER_SEARCH_PATHS = ( + "$(OF_CORE_HEADERS)", + ../../../addons/ofxLibwebsockets/libs/jsoncpp, + ../../../addons/ofxLibwebsockets/libs/jsoncpp/json, + ../../../addons/ofxLibwebsockets/libs/libwebsockets/include/, + ../../../addons/ofxLibwebsockets/libs/ofxLibwebsockets/include, + ../../../addons/ofxLibwebsockets/libs/ofxLibwebsockets/include/ofxLibwebsockets, + ../../../addons/ofxLibwebsockets/libs/ofxLibwebsockets/src, + ../../../addons/ofxLibwebsockets/src, + ../../../addons/ofxSpacebrew/src, + ); + ICON = "$(ICON_NAME_RELEASE)"; + ICON_FILE = "$(ICON_FILE_PATH)$(ICON)"; + INFOPLIST_FILE = "openFrameworks-Info.plist"; + INSTALL_PATH = "$(HOME)/Applications"; + LIBRARY_SEARCH_PATHS = "$(inherited)"; + OTHER_LDFLAGS = ( + "$(OF_CORE_FRAMEWORKS)", + "$(OF_CORE_LIBS)", + ../../../addons/ofxLibwebsockets/libs/libwebsockets/lib/osx/libwebsockets.a, + ); + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + baseConfigurationReference = E4EB6923138AFD0F00A09F29; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + E4B69B4D0A3A1720003C02F2 /* Build configuration list for PBXProject "example_shared_canvas" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + E4B69B4E0A3A1720003C02F2 /* Debug */, + E4B69B4F0A3A1720003C02F2 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + E4B69B5F0A3A1757003C02F2 /* Build configuration list for PBXNativeTarget "example_shared_canvas" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + E4B69B600A3A1757003C02F2 /* Debug */, + E4B69B610A3A1757003C02F2 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = E4B69B4C0A3A1720003C02F2 /* Project object */; +} diff --git a/example_shared_canvas/example_shared_canvas.xcodeproj/xcshareddata/xcschemes/example_shared_canvas Debug.xcscheme b/example_shared_canvas/example_shared_canvas.xcodeproj/xcshareddata/xcschemes/example_shared_canvas Debug.xcscheme new file mode 100644 index 0000000..fca2062 --- /dev/null +++ b/example_shared_canvas/example_shared_canvas.xcodeproj/xcshareddata/xcschemes/example_shared_canvas Debug.xcscheme @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/example_shared_canvas/example_shared_canvas.xcodeproj/xcshareddata/xcschemes/example_shared_canvas Release.xcscheme b/example_shared_canvas/example_shared_canvas.xcodeproj/xcshareddata/xcschemes/example_shared_canvas Release.xcscheme new file mode 100644 index 0000000..939e600 --- /dev/null +++ b/example_shared_canvas/example_shared_canvas.xcodeproj/xcshareddata/xcschemes/example_shared_canvas Release.xcscheme @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/example_shared_canvas/openFrameworks-Info.plist b/example_shared_canvas/openFrameworks-Info.plist new file mode 100644 index 0000000..8d64d2b --- /dev/null +++ b/example_shared_canvas/openFrameworks-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + cc.openFrameworks.ofapp + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + APPL + CFBundleSignature + ???? + CFBundleVersion + 1.0 + CFBundleIconFile + ${ICON} + + diff --git a/example_shared_canvas/src/main.cpp b/example_shared_canvas/src/main.cpp new file mode 100644 index 0000000..e57370b --- /dev/null +++ b/example_shared_canvas/src/main.cpp @@ -0,0 +1,13 @@ +#include "ofMain.h" +#include "ofApp.h" + +//======================================================================== +int main( ){ + ofSetupOpenGL(1024,768,OF_WINDOW); // <-------- setup the GL context + + // this kicks off the running of my app + // can be OF_WINDOW or OF_FULLSCREEN + // pass in width and height too: + ofRunApp(new ofApp()); + +} diff --git a/example_shared_canvas/src/ofApp.cpp b/example_shared_canvas/src/ofApp.cpp new file mode 100644 index 0000000..8a0cfe0 --- /dev/null +++ b/example_shared_canvas/src/ofApp.cpp @@ -0,0 +1,188 @@ +#include "ofApp.h" + +//-------------------------------------------------------------- +void ofApp::setup(){ + + ofSetFrameRate(60); + + string host = Spacebrew::SPACEBREW_CLOUD; // "localhost"; + string name = "of-canvas-example"; + string description = "Draw all the things"; + + spacebrew.addSubscribe("X", Spacebrew::TYPE_RANGE); + spacebrew.addSubscribe("Y", Spacebrew::TYPE_RANGE); + spacebrew.addSubscribe("hue", Spacebrew::TYPE_RANGE); + spacebrew.addSubscribe("clear", Spacebrew::TYPE_BOOLEAN); + + + spacebrew.connect( host, name, description ); + + Spacebrew::addListener(this, spacebrew); + + brewUI.setup(&spacebrew); + + //how many X and Y values we've gotten + //only add a point to the vector if we've received + //an even number, i.e. X AND Y + numXYs = 0; + + //the color we're drawing with + hue = 0; + +} + +//-------------------------------------------------------------- +void ofApp::update(){ + + //update the UI tool + brewUI.update(); + +} + +//-------------------------------------------------------------- +void ofApp::draw(){ + + + ofBackgroundGradient(100, 0); + + ofSetLineWidth(4); + + //if we have points... + if(points.size() > 0){ + + //Go through them and draw a line from this point to the next + for(int i = 0; i < points.size() - 1; i++){ + + //need to make sure we have enough colors to + ofSetColor(ofColor::fromHsb(hues[i], 200, 200)); + ofDrawLine(points[i], points[i + 1]); + + } + } + + + //draw UI + brewUI.draw(10, 10); + + + //Draw app info to screen + string msg; + + msg += "App for receiving drawing data from Spacebrew \"example_drawing_tool\"\n"; + msg += "Don't forget to add routes from drawing tool to shared canvas at \"" + spacebrew.getHost() + "\"!\n"; + msg += "\n"; + msg += "Points received: " + ofToString(points.size()) + "\n"; + msg += "Press 'h' to hide Spacebrew Admin Info\n"; + msg += "Press 's' to show Spacebrew Admin Info\n"; + + + + ofSetColor(255); + ofDrawBitmapString(msg, 10, ofGetHeight() - 80); + +} + + +//-------------------------------------------------------------- +void ofApp::onMessage( Spacebrew::Message & msg ){ + + + //go through message and see what the values are + if(msg.name == "X"){ + currentPoint.x = ofMap(msg.valueRange(), 0, 1023, 0, ofGetWidth()); + numXYs++; + + } else if(msg.name == "Y"){ + currentPoint.y = ofMap(msg.valueRange(), 0, 1023, 0, ofGetHeight()); + numXYs++; + + } else if(msg.name == "hue"){ + hue = msg.valueRange(); + + + } else if(msg.name == "clear"){ + + points.clear(); + hues.clear(); + numXYs = 0; + + } + + + //if we've received 2 points THEN add them + //to the vector + if(msg.name == "X" || msg.name == "Y"){ + if(numXYs % 2 == 0){ + points.push_back(currentPoint); + hues.push_back(hue); + } + } + +} + +//-------------------------------------------------------------- +void ofApp::keyPressed(int key){ + + + //show the gui if it's hidden + if(key == 's'){ + brewUI.show(); + } + + //hide the gui if it's shown + if(key == 'h'){ + brewUI.hide(); + } + + +} + +//-------------------------------------------------------------- +void ofApp::keyReleased(int key){ + +} + +//-------------------------------------------------------------- +void ofApp::mouseMoved(int x, int y ){ + +} + +//-------------------------------------------------------------- +void ofApp::mouseDragged(int x, int y, int button){ + +} + +//-------------------------------------------------------------- +void ofApp::mousePressed(int x, int y, int button){ + +} + +//-------------------------------------------------------------- +void ofApp::mouseReleased(int x, int y, int button){ + +} + +//-------------------------------------------------------------- +void ofApp::mouseEntered(int x, int y){ + +} + +//-------------------------------------------------------------- +void ofApp::mouseExited(int x, int y){ + +} + +//-------------------------------------------------------------- +void ofApp::windowResized(int w, int h){ + +} + +//-------------------------------------------------------------- +void ofApp::gotMessage(ofMessage msg){ + +} + +//-------------------------------------------------------------- +void ofApp::dragEvent(ofDragInfo dragInfo){ + +} diff --git a/example_shared_canvas/src/ofApp.h b/example_shared_canvas/src/ofApp.h new file mode 100644 index 0000000..1ba56fb --- /dev/null +++ b/example_shared_canvas/src/ofApp.h @@ -0,0 +1,51 @@ +#pragma once + +#include "ofMain.h" +#include "ofxSpacebrew.h" +#include "ofxSpacebrewPanel.hpp" + + +class ofApp : public ofBaseApp{ + + public: + void setup(); + void update(); + void draw(); + + void keyPressed(int key); + void keyReleased(int key); + void mouseMoved(int x, int y ); + void mouseDragged(int x, int y, int button); + void mousePressed(int x, int y, int button); + void mouseReleased(int x, int y, int button); + void mouseEntered(int x, int y); + void mouseExited(int x, int y); + void windowResized(int w, int h); + void dragEvent(ofDragInfo dragInfo); + void gotMessage(ofMessage msg); + + // create your spacebrew object + Spacebrew::Connection spacebrew; + + //The Spacebrew UI + //Make sure you have the correct fonts in + //your bin folder! + ofxSpacebrewPanel brewUI; + + + // listen to spacebrew Messages + void onMessage( Spacebrew::Message & m ); + + //vectors to store points and colors + vector points; + vector hues; + + //make sure we store the current point + //when we get an X and Y pair + int numXYs; + ofVec2f currentPoint; + + //Color + int hue; + +}; diff --git a/example_shared_canvas/src/ofxSpacebrewPanel.cpp b/example_shared_canvas/src/ofxSpacebrewPanel.cpp new file mode 100644 index 0000000..56d493c --- /dev/null +++ b/example_shared_canvas/src/ofxSpacebrewPanel.cpp @@ -0,0 +1,285 @@ +// +// ofxSpacebrewPanel.cpp +// +// Created by Adiel Fernandez on 2/20/16. +// +// + +#include "ofxSpacebrewPanel.hpp" + + +ofxSpacebrewPanel::ofxSpacebrewPanel(){ + +} + +void ofxSpacebrewPanel::setup(Spacebrew::Connection *_spacebrew){ + + //get local copy of pointer to the connection object + spacebrew = _spacebrew; + + + //Load UI fonts + titles.load("fonts/DINPro-Bold.otf", 16, true); + font.load("fonts/DINPro-Medium.otf", 10, true); + + + isVisible = true; + isOpen = true; + + + //Individual Element formatting + //Ideally hese should be defined in the ofxSpacebrewPanelElement class + //but we need them them below to set the width/height values. + //Make SpacebrewUI namespace then have these globally declared and accessible by this class and the element class via SpacebrewUI::ElementWidth, etc.? + nameWidth = 220; + typeWidth = 80; + outerCircleRad = 7.5; + innerCircleRad = 4.0; + elementHeight = 25; + elementWidth = typeWidth + nameWidth + outerCircleRad; + + + //Get the publishers by going through the connection object THEN + //through the Config object THEN to the getPublish vector + auto pubs = spacebrew -> getConfig() -> getPublish(); + + for(int i = 0; i < pubs.size(); i++){ + + Spacebrew::Message m = pubs[i]; + + ofxSpacebrewPanelElement elem(m.type, m.name, true, &font); + elem.getDimensions(elementHeight, nameWidth, typeWidth, outerCircleRad, innerCircleRad); + + publishers.push_back(elem); + + + } + + //do the same for the subscribers + auto subs = spacebrew -> getConfig() -> getSubscribe(); + + for(int i = 0; i < subs.size(); i++){ + + Spacebrew::Message m = subs[i]; + + ofxSpacebrewPanelElement elem(m.type, m.name, false, &font); + elem.getDimensions(elementHeight, nameWidth, typeWidth, outerCircleRad, innerCircleRad); + + subscribers.push_back(elem); + + } + + //if there are no subs and/or subs then add a placeholder + if(publishers.size() == 0){ + + ofxSpacebrewPanelElement placeholder("N/A", "No Publishers Created", true, &font, true); + placeholder.getDimensions(elementHeight, nameWidth, typeWidth, outerCircleRad, innerCircleRad); + publishers.push_back(placeholder); + + } + + if(subscribers.size() == 0){ + + ofxSpacebrewPanelElement placeholder("N/A", "No Subscribers Created", false, &font, true); + placeholder.getDimensions(elementHeight, nameWidth, typeWidth, outerCircleRad, innerCircleRad); + subscribers.push_back(placeholder); + + } + + + //add up all elements, spacing and font heights to get total box height + int numElements = publishers.size() + subscribers.size(); + + //General Panel Formatting + pubTitle = "/ PUBLISHERS"; + subTitle = "/ SUBSCRIBERS"; + hostTitle = "/ HOST"; + hostName = spacebrew -> getHost(); + + elementSpacing = 5; + padding = 15; + titleSpacing = elementSpacing * 3; + + width = elementWidth + padding * 2; + height = padding * 2 + numElements * elementHeight + (numElements - 1) * elementSpacing; + + height += titleSpacing + titles.stringHeight(pubTitle); + height += titleSpacing + titles.stringHeight(subTitle); + height += titleSpacing + titles.stringHeight(hostTitle); + height += titleSpacing + titles.stringHeight(hostName); + + + //initialize Pos + openPos.set(0, 0); + closedPos.set(0, -height - 10); + + //start as open + animatePos.set(0, 0); + + //need to scale FBO then draw it shrunken down + //or else the FBO makes everything look pixelated + fbo.allocate(width * 2, height * 2); + + //clear out the FBO + fbo.begin(); + ofClear(255, 255, 255, 255); + fbo.end(); + + + //add listener to detect messages + ofAddListener( spacebrew -> onMessageEvent, this, &ofxSpacebrewPanel::onMessage ); + ofAddListener( spacebrew -> onSendEvent, this, &ofxSpacebrewPanel::onSend); + +} + +void ofxSpacebrewPanel::onMessage( Spacebrew::Message& args ){ + + //go through subscribers and see which one this message belongs to + for(int i = 0; i < subscribers.size(); i++){ + + if(subscribers[i].name == args.name){ + subscribers[i].eventTriggered = true; + } + + } + +} + +void ofxSpacebrewPanel::onSend( string& name ){ + + //go through subscribers and see which one this message belongs to + for(int i = 0; i < publishers.size(); i++){ + + if(publishers[i].name == name){ + publishers[i].eventTriggered = true; + } + + } + +} + + +void ofxSpacebrewPanel::update(){ + + //update the publisher & subscriber elements + for(int i = 0; i < publishers.size(); i++){ + publishers[i].update(); + } + + for(int i = 0; i < subscribers.size(); i++){ + subscribers[i].update(); + } + + + + float animateSpeed = 0.09; + + if(isOpen){ + + //prevents unnecessary calculations as interpolations gets 99.999% there + if(ofDist(animatePos.x, animatePos.y, openPos.x, openPos.y) > 0.001){ + animatePos = animatePos.getInterpolated(openPos, animateSpeed); + } + + } else { + + //prevents unnecessary calculations as interpolations gets 99.999% there + if(ofDist(animatePos.x, animatePos.y, closedPos.x, closedPos.y) > 0.001){ + animatePos = animatePos.getInterpolated(closedPos, animateSpeed); + } else { + isVisible = false; + } + + } + + +} + +int ofxSpacebrewPanel::getWidth(){ + return width; +} + +int ofxSpacebrewPanel::getHeight(){ + return height; +} + +void ofxSpacebrewPanel::show(){ + isVisible = true; + isOpen = true; +} + +void ofxSpacebrewPanel::hide(){ + isOpen = false; +} + +void ofxSpacebrewPanel::draw(float _x, float _y){ + + + + if(isVisible){ + + fbo.begin(); + ofEnableAlphaBlending(); + + ofClear(0, 0); + + ofPushMatrix(); + ofScale(2, 2); + ofTranslate(animatePos.x, animatePos.y); + + //draw white background around everything + ofSetColor(255, 220); + ofDrawRectangle(0, 0, width, height); + + //host title + ofSetColor(0); + titles.drawString(hostTitle, padding, padding + titleSpacing); + ofTranslate(0, titles.stringHeight(hostTitle) + titleSpacing); + + //host name + ofSetColor(50); + float centerText = (width - titles.stringWidth(hostName))/2; + titles.drawString(hostName, centerText, padding + titleSpacing); + ofTranslate(0, titles.stringHeight(hostName) + titleSpacing); + + //publishers title + ofSetColor(0); + titles.drawString(pubTitle, padding, padding + titleSpacing); + ofTranslate(0, titles.stringHeight(pubTitle) + titleSpacing); + + //draw publishers + ofTranslate(padding, elementSpacing); + for(int i = 0; i < publishers.size(); i++){ + publishers[i].draw(); + ofTranslate(0, publishers[i].elementHeight + elementSpacing); + } + + //add a little extra gap between pubs and subs + ofTranslate(0, elementSpacing); + + //subs title + ofSetColor(0); + titles.drawString(subTitle, 0, 20); + ofTranslate(0, titles.stringHeight(subTitle) + titleSpacing); + + //draw subs + for(int i = 0; i < subscribers.size(); i++){ + subscribers[i].draw(); + ofTranslate(0, subscribers[i].elementHeight + elementSpacing); + } + + ofPopMatrix(); + + fbo.end(); + + ofSetColor(255); + fbo.draw(_x, _y, width, height); + + + } + + +} + + + diff --git a/example_shared_canvas/src/ofxSpacebrewPanel.hpp b/example_shared_canvas/src/ofxSpacebrewPanel.hpp new file mode 100644 index 0000000..414f2f8 --- /dev/null +++ b/example_shared_canvas/src/ofxSpacebrewPanel.hpp @@ -0,0 +1,89 @@ +// +// SpacebrewUI.hpp +// +// Created by Adiel Fernandez on 2/20/16. +// +// + +#ifndef SpacebrewUI_hpp +#define SpacebrewUI_hpp + +#include + +#endif /* SpacebrewUI */ + +#include "ofMain.h" +#include "ofxSpacebrew.h" +#include "ofxSpacebrewPanelElement.hpp" + +#pragma once + + +class ofxSpacebrewPanel{ + +public: + + ofxSpacebrewPanel(); + + void setup(Spacebrew::Connection *_spacebrew); + void update(); + void draw(float _x, float _y); + + void show(); + void hide(); + int getWidth(); + int getHeight(); + + + + +private: + + void onSend( string& args ); + void onMessage( Spacebrew::Message& name ); + + + + + Spacebrew::Connection *spacebrew; + + //local list of pubs and subs + vector publishers; + vector subscribers; + + bool isVisible; + bool isOpen; + + ofVec2f position; + ofVec2f closedPos, openPos, animatePos; + + + //Formatting + ofTrueTypeFont font; + ofTrueTypeFont titles; + + float width, height; + + //declare these globally so we can have + //use global width/height variables + string pubTitle; + string subTitle; + string hostTitle; + string hostName; + + float nameWidth, typeWidth; + float elementHeight, elementWidth; + float outerCircleRad, innerCircleRad; + float elementSpacing; + float padding; + float titleSpacing; + + + //use an FBO so we can do the + //slide out animation + ofFbo fbo; + +}; + + + diff --git a/example_shared_canvas/src/ofxSpacebrewPanelElement.cpp b/example_shared_canvas/src/ofxSpacebrewPanelElement.cpp new file mode 100644 index 0000000..de5bc2a --- /dev/null +++ b/example_shared_canvas/src/ofxSpacebrewPanelElement.cpp @@ -0,0 +1,191 @@ +// +// ofxSpacebrewPanelElement.cpp +// Drawing Tool +// +// Created by Adiel Fernandez on 2/20/16. +// +// + +#include "ofxSpacebrewPanelElement.hpp" + + +ofxSpacebrewPanelElement::ofxSpacebrewPanelElement(string _type, string _name, bool _isPublisher, ofTrueTypeFont *_font, bool placeHolder){ + + + type = _type; + name = _name; + font = _font; + isPublisher = _isPublisher; + + //set colors depending on type + if(type == "range"){ + typeCol.set(198, 0, 248); + } else if(type == "string"){ + typeCol.set(255, 0, 0); + } else if(type == "boolean"){ + typeCol.set(255, 174, 0); + } + + + + if(isPublisher){ + nameCol.set(176, 237, 255); + } else { + nameCol.set(177, 255, 216); + } + + + //capitalize TYPE name + for(int i = 0; i < type.length(); i++){ + type[i] = toupper(type[i]); + } + + //flag to be flipped by incoming event + eventTriggered = false; + + //use alternate colors when triggered + triggerColors = false; + + //last time triggered + triggerTime = 0; + + //how long to flash alt colors + showTriggeredDelay = 200; + + innerCircleCol.set(255); + outerCircleCol.set(0); + + + + isPlaceHolder = placeHolder; + + //override stuff if we're just a place holder + if(isPlaceHolder){ + nameCol.set(150); + typeCol.set(120); + innerCircleCol.set(200); + outerCircleCol.set(100); + } + + + +} + +//get dimensions from the UI instance +void ofxSpacebrewPanelElement::getDimensions(float elemH, float nameW, float typeW, float outRad, float inRad){ + + elementHeight = elemH; + nameWidth = nameW; + typeWidth = typeW; + outerCircleRad = outRad; + innerCircleRad = inRad; + elementWidth = typeWidth + nameWidth + outerCircleRad; + +} + + +void ofxSpacebrewPanelElement::update(){ + + //change circle colors when an event is triggered + if(!isPlaceHolder){ + + if(eventTriggered){ + triggerTime = ofGetElapsedTimeMillis(); + triggerColors = true; + eventTriggered = false; + } + + + if(triggerColors && ofGetElapsedTimeMillis() - triggerTime < showTriggeredDelay){ + innerCircleCol.set(0); + outerCircleCol.set(4, 203, 255); + } else { + innerCircleCol.set(255); + outerCircleCol.set(0); + } + + } + + +} + +void ofxSpacebrewPanelElement::draw(){ + + + ofPoint nameDim(font -> stringWidth(name), font -> stringHeight(name)); + ofPoint typeDim(font -> stringWidth(type), font -> stringHeight(type)); + + float nameMargin = 15; + + + + ofSetCircleResolution(60); + + //Drawing Publisher from left to right is Type, Name then trigger circle + //need ro reverse if it's a Subscriber + if(isPublisher){ + + //type + ofSetColor(typeCol); + ofDrawRectangle(0, 0, typeWidth, elementHeight); + + ofSetColor(255); + font -> drawString(type, typeWidth/2 - typeDim.x/2, elementHeight/2 + typeDim.y/2); + + //name + ofSetColor(nameCol); + ofDrawRectangle(typeWidth, 0, nameWidth, elementHeight); + + if(!isPlaceHolder){ + ofSetColor(0); + } else { + ofSetColor(255); + } + font -> drawString(name, typeWidth + nameWidth - nameDim.x - nameMargin, elementHeight/2 + nameDim.y/2); + + + //black circle outline + ofSetColor(outerCircleCol); + ofDrawCircle(nameWidth + typeWidth, elementHeight/2, outerCircleRad); + //inner white circle + ofSetColor(innerCircleCol); + ofDrawCircle(nameWidth + typeWidth, elementHeight/2, innerCircleRad); + + } else { + + //push every thing in a little bit so + //the circles align with boxes at the left + ofPushMatrix(); + ofTranslate(outerCircleRad, 0); + + //name + ofSetColor(nameCol); + ofDrawRectangle(0, 0, nameWidth, elementHeight); + + if(!isPlaceHolder){ + ofSetColor(0); + } else { + ofSetColor(255); + } + font -> drawString(name, nameMargin, elementHeight/2 + nameDim.y/2); + + //type + ofSetColor(typeCol); + ofDrawRectangle(nameWidth, 0, typeWidth, elementHeight); + + ofSetColor(255); + font -> drawString(type, nameWidth + typeWidth/2 - typeDim.x/2, elementHeight/2 + typeDim.y/2); + + //black circle outline + ofSetColor(outerCircleCol); + ofDrawCircle(0, elementHeight/2, outerCircleRad); + //inner white circle + ofSetColor(innerCircleCol); + ofDrawCircle(0, elementHeight/2, innerCircleRad); + + ofPopMatrix(); + } + + + +} \ No newline at end of file diff --git a/example_shared_canvas/src/ofxSpacebrewPanelElement.hpp b/example_shared_canvas/src/ofxSpacebrewPanelElement.hpp new file mode 100644 index 0000000..75ee4b9 --- /dev/null +++ b/example_shared_canvas/src/ofxSpacebrewPanelElement.hpp @@ -0,0 +1,50 @@ +// +// ofxSpacebrewPanelElement.hpp +// Drawing Tool +// +// Created by Adiel Fernandez on 2/20/16. +// +// + +#ifndef SpacebrewElement_hpp +#define SpacebrewElement_hpp + +#include + +#endif /* SpacebrewElement_hpp */ + +#include "ofMain.h" +#include "ofxSpacebrew.h" +#pragma once + + + +class ofxSpacebrewPanelElement{ + +public: + + ofxSpacebrewPanelElement(string _type, string _name, bool _isPublisher, ofTrueTypeFont *_font, bool placeHolder = false); + + void getDimensions(float elemH, float nameW, float typeW, float outRad, float inRad); + + void update(); + void draw(); + + //Formatting + float nameWidth, typeWidth; + float elementHeight, elementWidth; + float outerCircleRad, innerCircleRad; + + bool isPublisher; + bool isPlaceHolder; + bool eventTriggered, triggerColors; + int triggerTime, showTriggeredDelay; + + + string type, name; + ofColor typeCol, nameCol; + ofColor innerCircleCol, outerCircleCol; + + ofTrueTypeFont *font; + +}; \ No newline at end of file diff --git a/src/ofxSpacebrew.cpp b/src/ofxSpacebrew.cpp index 162fd1d..0e8e9f3 100644 --- a/src/ofxSpacebrew.cpp +++ b/src/ofxSpacebrew.cpp @@ -398,6 +398,7 @@ namespace Spacebrew { if ( bConnected ){ #ifdef SPACEBREW_USE_OFX_LWS client.send( m.getJSON( config.clientName ) ); + ofNotifyEvent(onSendEvent, m.name, this); #endif } else { ofLog( OF_LOG_WARNING, "Send failed, not connected!"); diff --git a/src/ofxSpacebrew.h b/src/ofxSpacebrew.h index 10b96b9..c47f5db 100644 --- a/src/ofxSpacebrew.h +++ b/src/ofxSpacebrew.h @@ -299,10 +299,17 @@ namespace Spacebrew { */ ofEvent onMessageEvent; + /* + * @brief ofEvent to listen to. + * Only passes a string with the name + * of the publisher that is sending + */ + ofEvent onSendEvent; + /** * @return Current Spacebrew::Config (list of publish/subscribe, etc) */ - Config * getConfig(); + Config * getConfig(); /** * @return Are we connected?