├── .gitignore ├── CM-LICENSE ├── README.md ├── cinderblock.png ├── cinderblock.xml ├── include ├── CodeEditor.cpp └── CodeEditor.h ├── resources └── CodeEditor │ ├── css │ ├── codemirror.css │ ├── dialog.css │ ├── show-hint.css │ └── solarized.css │ ├── editor.html │ ├── editor_msw.html │ └── js │ ├── codemirror.js │ ├── dialog.js │ ├── glsl-hint.js │ ├── glsl.js │ ├── jquery.color.js │ ├── jquery.min.js │ ├── lua-hint.js │ ├── lua.js │ ├── match-highlighter.js │ ├── search.js │ ├── searchcursor.js │ └── show-hint.js └── samples ├── BasicEditor ├── assets │ └── shaders │ │ └── simple.frag ├── include │ └── Resources.h ├── resources │ ├── CinderApp.icns │ └── cinder_app_icon.ico ├── src │ └── BasicEditorApp.cpp ├── vc10 │ ├── BasicEditor.sln │ ├── BasicEditor.vcxproj │ ├── BasicEditor.vcxproj.filters │ └── Resources.rc ├── vc11 │ ├── BasicEditor.sln │ ├── BasicEditor.vcxproj │ ├── BasicEditor.vcxproj.filters │ └── Resources.rc └── xcode │ ├── BasicEditor.xcodeproj │ └── project.pbxproj │ ├── BasicEditor_Prefix.pch │ └── Info.plist ├── MultiWindow ├── assets │ ├── SphereShader.frag │ └── SphereShader.vert ├── include │ └── Resources.h ├── resources │ ├── CinderApp.icns │ └── cinder_app_icon.ico ├── src │ └── MultiWindowApp.cpp ├── vc10 │ ├── MultiWindow.sln │ ├── MultiWindow.vcxproj │ ├── MultiWindow.vcxproj.filters │ └── Resources.rc ├── vc11 │ ├── MultiWindow.sln │ ├── MultiWindow.vcxproj │ ├── MultiWindow.vcxproj.filters │ └── Resources.rc └── xcode │ ├── Info.plist │ ├── MultiWindow.xcodeproj │ └── project.pbxproj │ └── MultiWindow_Prefix.pch └── MultipleFiles ├── assets ├── SphereShader.frag └── SphereShader.vert ├── include └── Resources.h ├── resources ├── CinderApp.icns └── cinder_app_icon.ico ├── src └── MultipleFilesApp.cpp ├── vc10 ├── MultipleFiles.sln ├── MultipleFiles.vcxproj ├── MultipleFiles.vcxproj.filters └── Resources.rc ├── vc11 ├── MultipleFiles.sln ├── MultipleFiles.vcxproj ├── MultipleFiles.vcxproj.filters └── Resources.rc └── xcode ├── Info.plist ├── MultipleFiles.xcodeproj └── project.pbxproj └── MultipleFiles_Prefix.pch /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Mac OS X cruft 3 | *.pbxuser 4 | *.mode1v3 5 | *.mode2v3 6 | *.user 7 | *.xcworkspace/ 8 | xcuserdata/ 9 | DerivedData/ 10 | build/ 11 | .DS_Store 12 | 13 | # Windows cruft 14 | *.suo 15 | *.ncb 16 | *.sdf 17 | Debug/ 18 | Release/ 19 | ipch/ 20 | -------------------------------------------------------------------------------- /CM-LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2013 by Marijn Haverbeke 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | 21 | Please note that some subdirectories of the CodeMirror distribution 22 | include their own LICENSE files, and are released under different 23 | licences. 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Cinder-CodeEditor 2 | ================ 3 | 4 | Full-Featured Code Editor for Cinder. 5 | (Based on Awesomium and CodeMirror). 6 | 7 | The samples have been tested on XCode 4 and VC11 only. 8 | 9 | #####Features: 10 | * Supported Languages: Glsl (XML, JSon and Lua are coming...). 11 | * Syntax Highlighting. 12 | * Code Completion. 13 | * Search / Replace. 14 | * In-Editor Error messages. 15 | * Code Changed callback system. 16 | * Multi-Window support. 17 | * Auto-Save. 18 | * Support c++11 Lambdas and Intializer Lists. 19 | 20 | #####Block Depedencies 21 | To use this block you will need: 22 | * The [appRewrite branch](https://forum.libcinder.org/#Topic/23286000001389463) of Cinder. 23 | * Paul Houx's [Cinder-Awesomium block](https://github.com/paulhoux/Cinder-Awesomium). 24 | * Some samples may depend on my [LiveAssetManager](https://github.com/simongeilfus/Cinder-LiveAssetManager) block as well, but you don't need it to use the block.( I removed this sample ... Still need some porting for Windows ) 25 | 26 | #####Getting Started 27 | 28 | A basic, one file editor is created like this: 29 | 30 | ```c 31 | mCodeEditor = CodeEditor::create( "simple.frag" ); 32 | ``` 33 | 34 | You can provide an initializer list to open multiple files: 35 | 36 | ```c 37 | mCodeEditor = CodeEditor::create( { "simple.vert", "simple.frag" } ); 38 | ``` 39 | 40 | If you don't specify any settings the editor will come with default options and will register all update/draw/mouse/keyboard signals of your app. You don't need to update or draw anything, the editor will get renderer on top of everything at the end of your "draw" function. By default the editor is visible but you can hide it by pressing `~` or by calling `mCodeEditor->hide()`. 41 | Use `CodeEditor::Settings` if you want to override default settings: 42 | 43 | ```c 44 | CodeEditor::Settings settings; 45 | settings.disableCodeCompletion(); 46 | settings.enableLineNumbers(); 47 | mCodeEditor = CodeEditor::create( "simple.frag", settings ); 48 | ``` 49 | 50 | This will have exactly the same effect: 51 | 52 | ```c 53 | mCodeEditor = CodeEditor::create( "simple.frag", CodeEditor::Settings().codeCompletion(false).lineNumbers() ); 54 | ``` 55 | 56 | You can provide an `app::WindowRef` if you don't want the editor to live in the main window: 57 | 58 | ```c 59 | mCodeEditor = CodeEditor::create( "simple.frag", CodeEditor::Settings().window( otherWindow ) ); 60 | ``` 61 | 62 | Just pass a null `app::WindowRef` if you want to take care of all the events yourself: 63 | 64 | ```c 65 | mCodeEditor = CodeEditor::create( "simple.frag", CodeEditor::Settings().window( WindowRef() ) ); 66 | ``` 67 | You will then need to call the corresponding methods in your app draw,update,mouseMove,mouseDown,... functions if you want the editor to work as expected. 68 | 69 | Use `CodeEditor::registerCodeChanged` if you want to do something when the code get modified: 70 | 71 | ```c 72 | mCodeEditor->registerCodeChanged( "simple.frag", [this](const string& frag) { 73 | try { 74 | mShader = gl::GlslProg( NULL, frag.c_str() ); 75 | } 76 | catch( gl::GlslProgCompileExc exc ) {} 77 | } ); 78 | ``` 79 | 80 | ```c 81 | mCodeEditor->registerCodeChanged( "simple.vert", "simple.frag", [this](const string& vert,const string& frag) { 82 | try { 83 | mShader = gl::GlslProg( vert.c_str(), frag.c_str() ); 84 | mCodeEditor->clearErrors(); 85 | } 86 | catch( gl::GlslProgCompileExc exc ) {} 87 | } ); 88 | ``` 89 | 90 | Use `CodeEditor::setError` to display error messages in the editor: 91 | 92 | ```c 93 | mCodeEditor->registerCodeChanged( "simple.frag", [this](const string& frag) { 94 | try { 95 | mShader = gl::GlslProg( NULL, frag.c_str() ); 96 | mCodeEditor->clearErrors(); 97 | } 98 | catch( gl::GlslProgCompileExc exc ) { 99 | mCodeEditor->setError( "Simple: " + string( exc.what() ) ); 100 | } 101 | } ); 102 | ``` 103 | 104 | You might want to remove focus from the editor `CodeEditor::blur` when using `keyDown` in your main app: 105 | 106 | ```c 107 | void MyApp::keyDown( KeyEvent event ) 108 | { 109 | if( event.isAccelDown() && event.getCode() == KeyEvent::KEY_RETURN ){ 110 | mCodeEditor->blur(); 111 | setFullScreen( !isFullScreen() ); 112 | } 113 | } 114 | ``` 115 | 116 | 117 | #####Note on Files 118 | You don't need to make sure the files already exists, if they don't the editor will take care of creating folders or files. This makes prototyping much more easy. 119 | 120 | The editor supports drag'n'drop as well. 121 | 122 | There's an Auto-Save feature that you can set in your settings, if you want your files to be saved every time they get modified. It might come handy if you are already watching your assets with something like [LiveAssetManager](https://github.com/simongeilfus/Cinder-LiveAssetManager). 123 | 124 | #####Editor Shortcuts 125 | 126 | `` | `` 127 | ----|------ 128 | `Ctrl-S` / `Cmd-S` | Save 129 | `~` | Toggle editor visibility 130 | `Ctrl-Space` | Code Completion 131 | `Shift-Tab` | Switch tab 132 | `Ctrl-F / Cmd-F` | Start searching 133 | `Ctrl-G / Cmd-G` | Find next 134 | `Shift-Ctrl-G / Shift-Cmd-G` | Find previous 135 | `Shift-Ctrl-F / Cmd-Option-F` | Replace 136 | `Shift-Ctrl-R / Shift-Cmd-Option-F` | Replace all 137 | `Ctrl-T` / `Cmd-T` | Switch betweem light and dark theme 138 | 139 | 140 | #####CodeMirror 141 | 142 | The editor itself is based on the excellent [CodeMirror](https://github.com/marijnh/CodeMirror). See license [here](https://github.com/simongeilfus/Cinder-CodeEditor/blob/master/CM-LICENSE). 143 | 144 | 145 | #####Licence 146 | 147 | Copyright (c) 2013, Simon Geilfus - All rights reserved. 148 | This code is intended for use with the Cinder C++ library: http://libcinder.org 149 | 150 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that 151 | the following conditions are met: 152 | 153 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 154 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 155 | 156 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 157 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 158 | -------------------------------------------------------------------------------- /cinderblock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongeilfus/Cinder-CodeEditor/808f4ca85c0ef63f6286b15bf9fc95d94df8fde9/cinderblock.png -------------------------------------------------------------------------------- /cinderblock.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 12 | 13 | 14 | 15 | samples 16 | include 17 | include/*.h 18 | include/CodeEditor.cpp 19 | 20 | 21 | resources/CodeEditor 22 | 23 | 24 | 25 | resources/CodeEditor/editor_msw.html 26 | resources/CodeEditor/css/codemirror.css 27 | resources/CodeEditor/css/dialog.css 28 | resources/CodeEditor/css/show-hint.css 29 | resources/CodeEditor/css/solarized.css 30 | resources/CodeEditor/js/codemirror.js 31 | resources/CodeEditor/js/dialog.js 32 | resources/CodeEditor/js/glsl-hint.js 33 | resources/CodeEditor/js/glsl.js 34 | resources/CodeEditor/js/match-highlighter.js 35 | resources/CodeEditor/js/search.js 36 | resources/CodeEditor/js/searchcursor.js 37 | resources/CodeEditor/js/show-hint.js 38 | resources/CodeEditor/js/jquery.min.js 39 | resources/CodeEditor/js/jquery.color.js 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /include/CodeEditor.h: -------------------------------------------------------------------------------- 1 | // 2 | // CodeEditor.h 3 | // AwesomiumTest 4 | // 5 | // Created by Simon Geilfus on 25/01/13. 6 | // 7 | // 8 | 9 | #pragma once 10 | 11 | #include "cinder/app/AppNative.h" 12 | #include "cinder/gl/Texture.h" 13 | #include "cinder/Utilities.h" 14 | #include "cinder/DataTarget.h" 15 | 16 | #include 17 | #include 18 | #include 19 | 20 | #include 21 | 22 | typedef std::shared_ptr< class CodeEditor > CodeEditorRef; 23 | 24 | class CodeEditor { 25 | public: 26 | 27 | struct Settings { 28 | public: 29 | Settings() 30 | : mCodeCompletionEnabled( true ), mLineWrappingEnabled( true ), mLineNumbersEnabled( false ), mAutoSaveEnabled( false ), mWindow( ci::app::getWindow() ), mPostDrawConnection( true ),mUpdateConnection( true ), mOpacity( 0.6f ), mFontSize( 11 ), mTheme( "light" ), mHeight( 0.0f ), mMode( "glsl" ) 31 | {} 32 | 33 | bool isCodeCompletionEnabled(){ return mCodeCompletionEnabled; } 34 | void enableCodeCompletion( bool enabled = true ){ mCodeCompletionEnabled = enabled; } 35 | void disableCodeCompletion(){ mCodeCompletionEnabled = false; } 36 | Settings& codeCompletion( bool enabled = true ){ enableCodeCompletion( enabled ); return *this; } 37 | 38 | bool isLineWrappingEnabled(){ return mLineWrappingEnabled; } 39 | void enableLineWrapping( bool enabled = true ){ mLineWrappingEnabled = enabled; } 40 | void disableLineWrapping(){ mLineWrappingEnabled = false; } 41 | Settings& lineWrapping( bool enabled = true ){ enableLineWrapping( enabled ); return *this; } 42 | 43 | bool isLineNumbersEnabled(){ return mLineNumbersEnabled; } 44 | void enableLineNumbers( bool enabled = true ){ mLineNumbersEnabled = enabled; } 45 | void disableLineNumbers(){ mLineNumbersEnabled = false; } 46 | Settings& lineNumbers( bool enabled = true ){ enableLineNumbers( enabled ); return *this; } 47 | 48 | bool isAutoSaveEnabled(){ return mAutoSaveEnabled; } 49 | void enableAutoSave( bool enabled = true ){ mAutoSaveEnabled = enabled; } 50 | void disableAutoSave(){ mAutoSaveEnabled = false; } 51 | Settings& autoSave( bool enabled = true ){ enableAutoSave( enabled ); return *this; } 52 | 53 | ci::app::WindowRef getWindow(){ return mWindow; } 54 | void setWindow( ci::app::WindowRef window ){ mWindow = window; } 55 | Settings& window( ci::app::WindowRef window ){ setWindow( window ); return *this; } 56 | 57 | bool isPostDrawConnectionEnabled(){ return mPostDrawConnection; } 58 | void enablePostDrawConnection( bool enabled = true ){ mPostDrawConnection = enabled; } 59 | void disablePostDrawConnection(){ mPostDrawConnection = false; } 60 | Settings& postDrawConnection( bool enabled = true ){ enablePostDrawConnection( enabled ); return *this; } 61 | 62 | bool isUpdateConnectionEnabled(){ return mUpdateConnection; } 63 | void enableUpdateConnection( bool enabled = true ){ mUpdateConnection = enabled; } 64 | void disableUpdateConnection(){ mUpdateConnection = false; } 65 | Settings& updateConnection( bool enabled = true ){ enableUpdateConnection( enabled ); return *this; } 66 | 67 | float getOpacity(){ return mOpacity; } 68 | void setOpacity( float alpha ){ mOpacity = alpha; } 69 | Settings& opacity( float alpha ){ setOpacity( alpha ); return *this; } 70 | 71 | int getFontSize(){ return mFontSize; } 72 | void setFontSize( int size ){ mFontSize = size; } 73 | Settings& fontSize( int size ){ setFontSize( size ); return *this; } 74 | 75 | std::string getTheme(){ return mTheme; } 76 | void setTheme( const std::string& name ){ mTheme = name; } 77 | Settings& theme( const std::string& name ){ setTheme( name ); return *this; } 78 | 79 | 80 | std::string getMode(){ return mMode; } 81 | void setMode( const std::string& name ){ mMode = name; } 82 | Settings& mode( const std::string& name ){ setMode( name ); return *this; } 83 | 84 | float getHeight(){ return mHeight; } 85 | void setHeight( float height ){ mHeight = height; } 86 | Settings& height( float height ){ setHeight( height ); return *this; } 87 | 88 | private: 89 | bool mCodeCompletionEnabled; 90 | bool mLineWrappingEnabled; 91 | bool mLineNumbersEnabled; 92 | bool mAutoSaveEnabled; 93 | bool mPostDrawConnection; 94 | bool mUpdateConnection; 95 | float mOpacity; 96 | int mFontSize; 97 | float mHeight; 98 | std::string mTheme; 99 | std::string mMode; 100 | ci::app::WindowRef mWindow; 101 | }; 102 | 103 | static CodeEditorRef create( const ci::fs::path& filePath = "", Settings settings = Settings() ); 104 | #if defined( CINDER_MAC ) 105 | static CodeEditorRef create( std::initializer_list filePaths, Settings settings = Settings() ); 106 | #else 107 | static CodeEditorRef create( std::vector filePaths, Settings settings = Settings() ); 108 | #endif 109 | 110 | void write( const ci::fs::path& filePath ); 111 | void read( const ci::fs::path& filePath ); 112 | 113 | void setValue( const std::string &value ); 114 | std::string getValue(); 115 | 116 | void setVisible( bool visible = true ){ mVisible = visible; } 117 | bool isVisible(){ return mVisible; } 118 | void hide(){ setVisible( false ); } 119 | void show(){ setVisible( true ); } 120 | 121 | bool hasFocus(); 122 | void blur(); 123 | 124 | void update(); 125 | void draw(); 126 | 127 | void shutdown(); 128 | void resize(); 129 | 130 | void mouseMove( ci::app::MouseEvent event ); 131 | void mouseDown( ci::app::MouseEvent event ); 132 | void mouseDrag( ci::app::MouseEvent event ); 133 | void mouseUp( ci::app::MouseEvent event ); 134 | void mouseWheel( ci::app::MouseEvent event ); 135 | 136 | void keyDown( ci::app::KeyEvent event ); 137 | void keyUp( ci::app::KeyEvent event ); 138 | 139 | void fileDrop( ci::app::FileDropEvent event ); 140 | 141 | void enableLineWrapping( bool enabled = true ); 142 | void enableLineNumbers( bool enabled = true ); 143 | 144 | void setOpacity( float alpha ); 145 | void setFontSize( int size ); 146 | void setTheme( const std::string& name ); 147 | void setMode( const std::string& name ); 148 | void setHeight( float height ); 149 | 150 | void setError( /*uint16_t line, */const std::string &message ); 151 | void clearErrors(); 152 | 153 | void registerCodeChanged( const std::string& fileName, std::function fn ); 154 | void registerCodeChanged( const std::string& firstFileName, const std::string& secondFileName, std::function fn ); 155 | 156 | protected: 157 | 158 | CodeEditor( const ci::fs::path& filePath, Settings settings = Settings() ); 159 | #if defined( CINDER_MAC ) 160 | CodeEditor( std::initializer_list filePaths, Settings settings = Settings() ); 161 | #else 162 | CodeEditor( std::vector filePaths, Settings settings = Settings() ); 163 | #endif 164 | 165 | void setup(); 166 | void connectWindow( ci::app::WindowRef window ); 167 | void initTabs(); 168 | void initAwesomium(); 169 | 170 | class Tab; 171 | typedef std::shared_ptr WebViewRef; 172 | typedef std::shared_ptr TabRef; 173 | 174 | class Tab : public Awesomium::WebViewListener::Load, public Awesomium::JSMethodHandler { 175 | public: 176 | Tab( CodeEditor* parent ) 177 | : mParent( parent ), mPairIsFirst( false ) 178 | {} 179 | 180 | void write( const ci::fs::path& filePath ); 181 | void read( const ci::fs::path& filePath ); 182 | 183 | void setValue( const std::string &value ); 184 | std::string getValue(); 185 | 186 | void setMode( const std::string &value ); 187 | 188 | void OnBeginLoadingFrame(Awesomium::WebView* caller,int64 frame_id,bool is_main_frame,const Awesomium::WebURL& url,bool is_error_page) {} 189 | void OnFailLoadingFrame(Awesomium::WebView* caller,int64 frame_id,bool is_main_frame,const Awesomium::WebURL& url,int error_code,const Awesomium::WebString& error_desc) {} 190 | void OnFinishLoadingFrame(Awesomium::WebView* caller,int64 frame_id,bool is_main_frame,const Awesomium::WebURL& url) {} 191 | void OnDocumentReady(Awesomium::WebView* caller, const Awesomium::WebURL& url); 192 | 193 | void OnMethodCall(Awesomium::WebView* caller,unsigned int remote_object_id,const Awesomium::WebString& method_name,const Awesomium::JSArray& args); 194 | Awesomium::JSValue OnMethodCallWithReturnValue(Awesomium::WebView* caller, unsigned int remote_object_id, const Awesomium::WebString& method_name, const Awesomium::JSArray& args){ return Awesomium::JSValue(); } 195 | 196 | WebViewRef mWebView; 197 | ci::fs::path mFileName; 198 | ci::fs::path mFilePath; 199 | Awesomium::JSObject mJSWindow; 200 | CodeEditor* mParent; 201 | std::function mChangeCallback; 202 | TabRef mPairedTab; 203 | std::function mPairChangeCallback; 205 | bool mPairIsFirst; 206 | 207 | std::string mMode; 208 | 209 | friend class CodeEditor; 210 | }; 211 | 212 | 213 | void deleteTab( TabRef tab ); 214 | TabRef getTab( ci::fs::path fileName ); 215 | 216 | void autoComplete(); 217 | 218 | 219 | Settings mSettings; 220 | 221 | Awesomium::WebCore* mWebCorePtr; 222 | TabRef mCurrentTab; 223 | std::vector mTabs; 224 | int mTabsReady; 225 | 226 | ci::gl::Texture mWebTexture; 227 | bool mVisible; 228 | }; -------------------------------------------------------------------------------- /resources/CodeEditor/css/codemirror.css: -------------------------------------------------------------------------------- 1 | /* BASICS */ 2 | 3 | .CodeMirror { 4 | /* Set height, width, borders, and global font properties here */ 5 | font-family: monospace; 6 | height: 300px; 7 | } 8 | .CodeMirror-scroll { 9 | /* Set scrolling behaviour here */ 10 | overflow: auto; 11 | } 12 | 13 | /* PADDING */ 14 | 15 | .CodeMirror-lines { 16 | padding: 4px 0; /* Vertical padding around content */ 17 | } 18 | .CodeMirror pre { 19 | padding: 0 4px; /* Horizontal padding of content */ 20 | } 21 | 22 | .CodeMirror-scrollbar-filler { 23 | background-color: white; /* The little square between H and V scrollbars */ 24 | } 25 | 26 | /* GUTTER */ 27 | 28 | .CodeMirror-gutters { 29 | border-right: 1px solid #ddd; 30 | background-color: #f7f7f7; 31 | } 32 | .CodeMirror-linenumbers {} 33 | .CodeMirror-linenumber { 34 | padding: 0 3px 0 5px; 35 | min-width: 20px; 36 | text-align: right; 37 | color: #999; 38 | } 39 | 40 | /* CURSOR */ 41 | 42 | .CodeMirror div.CodeMirror-cursor { 43 | border-left: 1px solid black; 44 | } 45 | /* Shown when moving in bi-directional text */ 46 | .CodeMirror div.CodeMirror-secondarycursor { 47 | border-left: 1px solid silver; 48 | } 49 | .CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor { 50 | width: auto; 51 | border: 0; 52 | background: transparent; 53 | background: rgba(0, 200, 0, .4); 54 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#6600c800, endColorstr=#4c00c800); 55 | } 56 | /* Kludge to turn off filter in ie9+, which also accepts rgba */ 57 | .CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor:not(#nonsense_id) { 58 | filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); 59 | } 60 | /* Can style cursor different in overwrite (non-insert) mode */ 61 | .CodeMirror div.CodeMirror-cursor.CodeMirror-overwrite {} 62 | 63 | /* DEFAULT THEME */ 64 | 65 | .cm-s-default .cm-keyword {color: #708;} 66 | .cm-s-default .cm-atom {color: #219;} 67 | .cm-s-default .cm-number {color: #164;} 68 | .cm-s-default .cm-def {color: #00f;} 69 | .cm-s-default .cm-variable {color: black;} 70 | .cm-s-default .cm-variable-2 {color: #05a;} 71 | .cm-s-default .cm-variable-3 {color: #085;} 72 | .cm-s-default .cm-property {color: black;} 73 | .cm-s-default .cm-operator {color: black;} 74 | .cm-s-default .cm-comment {color: #a50;} 75 | .cm-s-default .cm-string {color: #a11;} 76 | .cm-s-default .cm-string-2 {color: #f50;} 77 | .cm-s-default .cm-meta {color: #555;} 78 | .cm-s-default .cm-error {color: #f00;} 79 | .cm-s-default .cm-qualifier {color: #555;} 80 | .cm-s-default .cm-builtin {color: #30a;} 81 | .cm-s-default .cm-bracket {color: #997;} 82 | .cm-s-default .cm-tag {color: #170;} 83 | .cm-s-default .cm-attribute {color: #00c;} 84 | .cm-s-default .cm-header {color: blue;} 85 | .cm-s-default .cm-quote {color: #090;} 86 | .cm-s-default .cm-hr {color: #999;} 87 | .cm-s-default .cm-link {color: #00c;} 88 | 89 | .cm-negative {color: #d44;} 90 | .cm-positive {color: #292;} 91 | .cm-header, .cm-strong {font-weight: bold;} 92 | .cm-em {font-style: italic;} 93 | .cm-emstrong {font-style: italic; font-weight: bold;} 94 | .cm-link {text-decoration: underline;} 95 | 96 | .cm-invalidchar {color: #f00;} 97 | 98 | div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;} 99 | div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;} 100 | 101 | /* STOP */ 102 | 103 | /* The rest of this file contains styles related to the mechanics of 104 | the editor. You probably shouldn't touch them. */ 105 | 106 | .CodeMirror { 107 | line-height: 1; 108 | position: relative; 109 | overflow: hidden; 110 | } 111 | 112 | .CodeMirror-scroll { 113 | /* 30px is the magic margin used to hide the element's real scrollbars */ 114 | /* See overflow: hidden in .CodeMirror, and the paddings in .CodeMirror-sizer */ 115 | margin-bottom: -30px; margin-right: -30px; 116 | padding-bottom: 30px; padding-right: 30px; 117 | height: 100%; 118 | outline: none; /* Prevent dragging from highlighting the element */ 119 | position: relative; 120 | } 121 | .CodeMirror-sizer { 122 | position: relative; 123 | } 124 | 125 | /* The fake, visible scrollbars. Used to force redraw during scrolling 126 | before actuall scrolling happens, thus preventing shaking and 127 | flickering artifacts. */ 128 | .CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler { 129 | position: absolute; 130 | z-index: 6; 131 | display: none; 132 | } 133 | .CodeMirror-vscrollbar { 134 | right: 0; top: 0; 135 | overflow-x: hidden; 136 | overflow-y: scroll; 137 | } 138 | .CodeMirror-hscrollbar { 139 | bottom: 0; left: 0; 140 | overflow-y: hidden; 141 | overflow-x: scroll; 142 | } 143 | .CodeMirror-scrollbar-filler { 144 | right: 0; bottom: 0; 145 | z-index: 6; 146 | } 147 | 148 | .CodeMirror-gutters { 149 | position: absolute; left: 0; top: 0; 150 | height: 100%; 151 | z-index: 3; 152 | } 153 | .CodeMirror-gutter { 154 | height: 100%; 155 | display: inline-block; 156 | /* Hack to make IE7 behave */ 157 | *zoom:1; 158 | *display:inline; 159 | } 160 | .CodeMirror-gutter-elt { 161 | position: absolute; 162 | cursor: default; 163 | z-index: 4; 164 | } 165 | 166 | .CodeMirror-lines { 167 | cursor: text; 168 | } 169 | .CodeMirror pre { 170 | /* Reset some styles that the rest of the page might have set */ 171 | -moz-border-radius: 0; -webkit-border-radius: 0; -o-border-radius: 0; border-radius: 0; 172 | border-width: 0; 173 | background: transparent; 174 | font-family: inherit; 175 | font-size: inherit; 176 | margin: 0; 177 | white-space: pre; 178 | word-wrap: normal; 179 | line-height: inherit; 180 | color: inherit; 181 | z-index: 2; 182 | position: relative; 183 | overflow: visible; 184 | } 185 | .CodeMirror-wrap pre { 186 | word-wrap: break-word; 187 | white-space: pre-wrap; 188 | word-break: normal; 189 | } 190 | .CodeMirror-linebackground { 191 | position: absolute; 192 | left: 0; right: 0; top: 0; bottom: 0; 193 | z-index: 0; 194 | } 195 | 196 | .CodeMirror-linewidget { 197 | position: relative; 198 | z-index: 2; 199 | overflow: auto; 200 | } 201 | 202 | .CodeMirror-wrap .CodeMirror-scroll { 203 | overflow-x: hidden; 204 | } 205 | 206 | .CodeMirror-measure { 207 | position: absolute; 208 | width: 100%; height: 0px; 209 | overflow: hidden; 210 | visibility: hidden; 211 | } 212 | .CodeMirror-measure pre { position: static; } 213 | 214 | .CodeMirror div.CodeMirror-cursor { 215 | position: absolute; 216 | visibility: hidden; 217 | border-right: none; 218 | width: 0; 219 | } 220 | .CodeMirror-focused div.CodeMirror-cursor { 221 | visibility: visible; 222 | } 223 | 224 | .CodeMirror-selected { background: #d9d9d9; } 225 | .CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; } 226 | 227 | .cm-searching { 228 | background: #ffa; 229 | background: rgba(255, 255, 0, .4); 230 | } 231 | 232 | /* IE7 hack to prevent it from returning funny offsetTops on the spans */ 233 | .CodeMirror span { *vertical-align: text-bottom; } 234 | 235 | @media print { 236 | /* Hide the cursor when printing */ 237 | .CodeMirror div.CodeMirror-cursor { 238 | visibility: hidden; 239 | } 240 | } 241 | -------------------------------------------------------------------------------- /resources/CodeEditor/css/dialog.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-dialog { 2 | position: absolute; 3 | left: 0; right: 0; 4 | background: rgba( 255, 255, 255, 1 ); 5 | z-index: 15; 6 | padding: .1em .8em; 7 | overflow: hidden; 8 | color: #333; 9 | 10 | opacity: 0.9999999; 11 | } 12 | 13 | .CodeMirror-dialog-top { 14 | border-bottom: 1px solid #eee; 15 | top: 0; 16 | } 17 | 18 | .CodeMirror-dialog-bottom { 19 | border-top: 1px solid #eee; 20 | bottom: 0; 21 | } 22 | 23 | .CodeMirror-dialog input { 24 | border: none; 25 | outline: none; 26 | background: transparent; 27 | width: 20em; 28 | color: inherit; 29 | font-family: monospace; 30 | } 31 | 32 | .CodeMirror-dialog button { 33 | font-size: 70%; 34 | } 35 | -------------------------------------------------------------------------------- /resources/CodeEditor/css/show-hint.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-hints { 2 | position: absolute; 3 | z-index: 10; 4 | overflow: hidden; 5 | list-style: none; 6 | 7 | margin: 0; 8 | padding: 2px; 9 | 10 | -webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2); 11 | -moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2); 12 | box-shadow: 2px 3px 5px rgba(0,0,0,.2); 13 | border-radius: 3px; 14 | 15 | background: white; 16 | font-size: 90%; 17 | font-family: monospace; 18 | 19 | max-height: 20em; 20 | overflow-y: auto; 21 | } 22 | 23 | .CodeMirror-hint { 24 | margin: 0; 25 | padding: 0 4px; 26 | border-radius: 2px; 27 | max-width: 19em; 28 | overflow: hidden; 29 | white-space: pre; 30 | color: black; 31 | cursor: pointer; 32 | } 33 | 34 | .CodeMirror-hint-active { 35 | background: #08f; 36 | color: white; 37 | } 38 | -------------------------------------------------------------------------------- /resources/CodeEditor/css/solarized.css: -------------------------------------------------------------------------------- 1 | /* 2 | Solarized theme for code-mirror 3 | http://ethanschoonover.com/solarized 4 | */ 5 | 6 | /* 7 | Solarized color pallet 8 | http://ethanschoonover.com/solarized/img/solarized-palette.png 9 | */ 10 | 11 | .solarized.base03 { color: #002b36; } 12 | .solarized.base02 { color: #073642; } 13 | .solarized.base01 { color: #586e75; } 14 | .solarized.base00 { color: #657b83; } 15 | .solarized.base0 { color: #839496; } 16 | .solarized.base1 { color: #93a1a1; } 17 | .solarized.base2 { color: #eee8d5; } 18 | .solarized.base3 { color: #fdf6e3; } 19 | .solarized.solar-yellow { color: #b58900; } 20 | .solarized.solar-orange { color: #cb4b16; } 21 | .solarized.solar-red { color: #dc322f; } 22 | .solarized.solar-magenta { color: #d33682; } 23 | .solarized.solar-violet { color: #6c71c4; } 24 | .solarized.solar-blue { color: #268bd2; } 25 | .solarized.solar-cyan { color: #2aa198; } 26 | .solarized.solar-green { color: #859900; } 27 | 28 | /* Color scheme for code-mirror */ 29 | 30 | .cm-s-solarized { 31 | line-height: 1.45em; 32 | font-family: Menlo,Monaco,"Andale Mono","lucida console","Courier New",monospace !important; 33 | color-profile: sRGB; 34 | rendering-intent: auto; 35 | } 36 | .cm-s-solarized.cm-s-dark { 37 | color: #839496; 38 | background-color: #002b36; 39 | text-shadow: #002b36 0 1px; 40 | } 41 | .cm-s-solarized.cm-s-light { 42 | background-color: #fdf6e3; 43 | color: #657b83; 44 | text-shadow: #eee8d5 0 1px; 45 | } 46 | 47 | .cm-s-solarized .CodeMirror-widget { 48 | text-shadow: none; 49 | } 50 | 51 | 52 | .cm-s-solarized .cm-keyword { color: #cb4b16 } 53 | .cm-s-solarized .cm-atom { color: #d33682; } 54 | .cm-s-solarized .cm-number { color: #d33682; } 55 | .cm-s-solarized .cm-def { color: #2aa198; } 56 | 57 | .cm-s-solarized .cm-variable { color: #268bd2; } 58 | .cm-s-solarized .cm-variable-2 { color: #b58900; } 59 | .cm-s-solarized .cm-variable-3 { color: #6c71c4; } 60 | 61 | .cm-s-solarized .cm-property { color: #2aa198; } 62 | .cm-s-solarized .cm-operator {color: #6c71c4;} 63 | 64 | .cm-s-solarized .cm-comment { color: #586e75; font-style:italic; } 65 | 66 | .cm-s-solarized .cm-string { color: #859900; } 67 | .cm-s-solarized .cm-string-2 { color: #b58900; } 68 | 69 | .cm-s-solarized .cm-meta { color: #859900; } 70 | .cm-s-solarized .cm-error, 71 | .cm-s-solarized .cm-invalidchar { 72 | color: #586e75; 73 | border-bottom: 1px dotted #dc322f; 74 | } 75 | .cm-s-solarized .cm-qualifier { color: #b58900; } 76 | .cm-s-solarized .cm-builtin { color: #d33682; } 77 | .cm-s-solarized .cm-bracket { color: #cb4b16; } 78 | .cm-s-solarized .CodeMirror-matchingbracket { color: #859900; } 79 | .cm-s-solarized .CodeMirror-nonmatchingbracket { color: #dc322f; } 80 | .cm-s-solarized .cm-tag { color: #93a1a1 } 81 | .cm-s-solarized .cm-attribute { color: #2aa198; } 82 | .cm-s-solarized .cm-header { color: #586e75; } 83 | .cm-s-solarized .cm-quote { color: #93a1a1; } 84 | .cm-s-solarized .cm-hr { 85 | color: transparent; 86 | border-top: 1px solid #586e75; 87 | display: block; 88 | } 89 | .cm-s-solarized .cm-link { color: #93a1a1; cursor: pointer; } 90 | .cm-s-solarized .cm-special { color: #6c71c4; } 91 | .cm-s-solarized .cm-em { 92 | color: #999; 93 | text-decoration: underline; 94 | text-decoration-style: dotted; 95 | } 96 | .cm-s-solarized .cm-strong { color: #eee; } 97 | 98 | .cm-s-solarized.cm-s-dark .CodeMirror-focused .CodeMirror-selected { 99 | background: #386774; 100 | color: inherit; 101 | } 102 | 103 | .cm-s-solarized.cm-s-dark ::selection { 104 | background: #386774; 105 | color: inherit; 106 | } 107 | 108 | .cm-s-solarized.cm-s-dark .CodeMirror-selected { 109 | background: #586e75; 110 | } 111 | 112 | .cm-s-solarized.cm-s-light .CodeMirror-focused .CodeMirror-selected { 113 | background: #eee8d5; 114 | color: inherit; 115 | } 116 | 117 | .cm-s-solarized.cm-s-light ::selection { 118 | background: #eee8d5; 119 | color: inherit; 120 | } 121 | 122 | .cm-s-solarized.cm-s-light .CodeMirror-selected { 123 | background: #93a1a1; 124 | } 125 | 126 | 127 | 128 | /* Editor styling */ 129 | 130 | 131 | /* Gutter colors and line number styling based of color scheme (dark / light) */ 132 | 133 | /* Dark */ 134 | .cm-s-solarized.cm-s-dark .CodeMirror-gutters { 135 | background-color: #073642; 136 | border-color: #00232c; 137 | } 138 | 139 | .cm-s-solarized.cm-s-dark .CodeMirror-linenumber { 140 | text-shadow: #021014 0 -1px; 141 | } 142 | 143 | /* Light */ 144 | .cm-s-solarized.cm-s-light .CodeMirror-gutters { 145 | background-color: #eee8d5; 146 | border-color: #eee8d5; 147 | } 148 | 149 | /* Common */ 150 | .cm-s-solarized .CodeMirror-linenumber { 151 | color: #586e75; 152 | } 153 | 154 | .cm-s-solarized .CodeMirror-gutter .CodeMirror-gutter-text { 155 | color: #586e75; 156 | } 157 | 158 | .cm-s-solarized .CodeMirror-lines { 159 | padding-left: 5px; 160 | } 161 | 162 | .cm-s-solarized .CodeMirror-lines .CodeMirror-cursor { 163 | border-left: 1px solid #819090; 164 | } 165 | 166 | /* 167 | Active line. Negative margin compensates left padding of the text in the 168 | view-port 169 | */ 170 | .cm-s-solarized .activeline { 171 | margin-left: -20px; 172 | } 173 | 174 | .cm-s-solarized.cm-s-dark .activeline { 175 | background: rgba(255, 255, 255, 0.05); 176 | 177 | } 178 | .cm-s-solarized.cm-s-light .activeline { 179 | background: rgba(0, 0, 0, 0.05); 180 | } -------------------------------------------------------------------------------- /resources/CodeEditor/editor.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CodeEditor 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 147 | 148 | 149 | 150 | -------------------------------------------------------------------------------- /resources/CodeEditor/editor_msw.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CodeEditor 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 143 | 144 | 145 | 146 | -------------------------------------------------------------------------------- /resources/CodeEditor/js/dialog.js: -------------------------------------------------------------------------------- 1 | // Open simple dialogs on top of an editor. Relies on dialog.css. 2 | 3 | (function() { 4 | function dialogDiv(cm, template, bottom) { 5 | var wrap = cm.getWrapperElement(); 6 | var dialog; 7 | dialog = wrap.appendChild(document.createElement("div")); 8 | if (bottom) { 9 | dialog.className = "CodeMirror-dialog CodeMirror-dialog-bottom"; 10 | } else { 11 | dialog.className = "CodeMirror-dialog CodeMirror-dialog-top"; 12 | } 13 | dialog.innerHTML = template; 14 | return dialog; 15 | } 16 | 17 | CodeMirror.defineExtension("openDialog", function(template, callback, options) { 18 | var dialog = dialogDiv(this, template, options && options.bottom); 19 | var closed = false, me = this; 20 | function close() { 21 | if (closed) return; 22 | closed = true; 23 | dialog.parentNode.removeChild(dialog); 24 | } 25 | var inp = dialog.getElementsByTagName("input")[0], button; 26 | if (inp) { 27 | CodeMirror.on(inp, "keydown", function(e) { 28 | if (e.keyCode == 13 || e.keyCode == 27) { 29 | CodeMirror.e_stop(e); 30 | close(); 31 | me.focus(); 32 | if (e.keyCode == 13) callback(inp.value); 33 | } 34 | }); 35 | if (options && options.value) inp.value = options.value; 36 | inp.focus(); 37 | CodeMirror.on(inp, "blur", close); 38 | } else if (button = dialog.getElementsByTagName("button")[0]) { 39 | CodeMirror.on(button, "click", function() { 40 | close(); 41 | me.focus(); 42 | }); 43 | button.focus(); 44 | CodeMirror.on(button, "blur", close); 45 | } 46 | return close; 47 | }); 48 | 49 | CodeMirror.defineExtension("openConfirm", function(template, callbacks, options) { 50 | var dialog = dialogDiv(this, template, options && options.bottom); 51 | var buttons = dialog.getElementsByTagName("button"); 52 | var closed = false, me = this, blurring = 1; 53 | function close() { 54 | if (closed) return; 55 | closed = true; 56 | dialog.parentNode.removeChild(dialog); 57 | me.focus(); 58 | } 59 | buttons[0].focus(); 60 | for (var i = 0; i < buttons.length; ++i) { 61 | var b = buttons[i]; 62 | (function(callback) { 63 | CodeMirror.on(b, "click", function(e) { 64 | CodeMirror.e_preventDefault(e); 65 | close(); 66 | if (callback) callback(me); 67 | }); 68 | })(callbacks[i]); 69 | CodeMirror.on(b, "blur", function() { 70 | --blurring; 71 | setTimeout(function() { if (blurring <= 0) close(); }, 200); 72 | }); 73 | CodeMirror.on(b, "focus", function() { ++blurring; }); 74 | } 75 | }); 76 | })(); 77 | -------------------------------------------------------------------------------- /resources/CodeEditor/js/glsl-hint.js: -------------------------------------------------------------------------------- 1 | (function () { 2 | function forEach(arr, f) { 3 | for (var i = 0, e = arr.length; i < e; ++i) f(arr[i]); 4 | } 5 | 6 | function arrayContains(arr, item) { 7 | if (!Array.prototype.indexOf) { 8 | var i = arr.length; 9 | while (i--) { 10 | if (arr[i] === item) { 11 | return true; 12 | } 13 | } 14 | return false; 15 | } 16 | return arr.indexOf(item) != -1; 17 | } 18 | 19 | var glslTypes = ("float vec2 vec3 vec4 int ivec2 ivec3 ivec4 bool bvec2 bvec3 bvec4 mat2 mat3 mat4 " + 20 | "void sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow" ).split(" "); 21 | 22 | var glslTypesQualifiers = ("uniform attribute varying const in out inout const" ).split(" "); 23 | var glslPreProcessor = ("#define #undef #if #ifdef #ifndef #else #elif #endif #error #pragma #line #version #extension" ).split(" "); 24 | 25 | var glslKeywords = ("break continue do for while if else true false " + 26 | "lowp mediump highp precision invariant discard return " + 27 | "gl_Position gl_PointSize gl_ClipVertex gl_Vertex gl_Normal gl_Color " + 28 | "gl_SecondaryColor gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 " + 29 | "gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 " + 30 | "gl_MultiTexCoord7 gl_FogCoord gl_FrontColor gl_BackColor " + 31 | "gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord " + 32 | "gl_FragColor gl_FragData gl_FragDepth gl_Color gl_SecondaryColor gl_FogFragCoord " + 33 | "gl_FragCoord gl_FrontFacing" ).split(" "); 34 | 35 | var glslBuiltins = ("sin cos tan asin acos atan atan radians degrees " + 36 | "pow exp log exp2 log2 sqrt inversesqrt abs ceil " + 37 | "clamp floor fract max min mix mod sign smoothstep " + 38 | "step ftransform cross distance dot faceforward " + 39 | "length normalize reflect refract dFdx dFdy fwidth " + 40 | "matrixCompMult all any equal greaterThan greaterThanEqual " + 41 | "lessThan lessThanEqual notEqual " + 42 | "texture1D texture1DProj texture1DProj " + 43 | "texture2D texture2DProj texture2DProj " + 44 | "texture3D texture3DProj " + 45 | "textureCube shadow1D shadow2D shadow1DProj shadow2DProj " + 46 | "texture1DLod texture1DProjLod texture1DProjLod " + 47 | "texture2DLod texture2DProjLod texture2DProjLod texture3DProjLod " + 48 | "textureCubeLod shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod " + 49 | "gl_ModelViewMatrix gl_ModelViewProjectionMatrix gl_ProjectionMatrix " + 50 | "gl_TextureMatrix gl_ModelViewMatrixInverse gl_ModelViewProjectionMatrixInverse " + 51 | "gl_ProjectionMatrixInverse gl_TextureMatrixInverse gl_ModelViewMatrixTranspose " + 52 | "gl_ModelViewProjectionMatrixTranspose gl_ProjectionMatrixTranspose " + 53 | "gl_TextureMatrixTranspose gl_ModelViewMatrixInverseTranspose " + 54 | "gl_ModelViewProjectionMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose " + 55 | "gl_TextureMatrixInverseTranspose gl_NormalMatrix gl_NormalScale " ).split(" "); 56 | 57 | function scriptHint(editor, getToken, options) { 58 | // Find the token at the cursor 59 | var cur = editor.getCursor(), token = getToken(editor, cur), tprop = token; 60 | // If it's not a 'word-style' token, ignore the token. 61 | /*if (!/^[\w$_]*$/.test(token.string)) { 62 | token = tprop = {start: cur.ch, end: cur.ch, string: "", state: token.state, 63 | type: token.string == "." ? "property" : null}; 64 | }*/ 65 | 66 | var variableNames = []; 67 | for( var line = 0; line < editor.lineCount() && line < editor.getCursor().line; line++ ){ 68 | var lineContent = editor.getLine( line ); 69 | var containsType = false; 70 | var typeIndex; 71 | 72 | for (var i = 0, e = glslTypes.length; i < e; ++i){ 73 | typeIndex = lineContent.indexOf( glslTypes[i] ); 74 | if( typeIndex != -1 ){ 75 | containsType = true; 76 | break; 77 | } 78 | } 79 | 80 | if( containsType ){ 81 | var variableName = lineContent.substring( typeIndex ); 82 | variableName = variableName.substring( variableName.search( /\s/ ) ); 83 | variableName = variableName.replace(/\s+/g, ''); 84 | variableName = variableName.substring( 0, variableName.search( /[^A-Za-z]/ ) ); 85 | if( variableName != "main" ) 86 | variableNames.push( variableName ); 87 | } 88 | 89 | } 90 | 91 | return {list: getCompletions(token, variableNames, options), 92 | from: {line: cur.line, ch: token.start}, 93 | to: {line: cur.line, ch: token.end}}; 94 | } 95 | 96 | CodeMirror.glslHint = function(editor, options) { 97 | return scriptHint(editor, 98 | function (e, cur) {return e.getTokenAt(cur);}, 99 | options); 100 | }; 101 | 102 | 103 | function getCompletions(token, variableNames, options) { 104 | var found = [], start = token.string; 105 | function maybeAdd(str) { 106 | if (str.indexOf(start) == 0 && !arrayContains(found, str)) found.push(str); 107 | } 108 | for (var i = 0; i < variableNames.length; i++){ 109 | maybeAdd( variableNames[i] ); 110 | } 111 | 112 | forEach(glslTypes, maybeAdd); 113 | forEach(glslTypesQualifiers, maybeAdd); 114 | forEach(glslPreProcessor, maybeAdd); 115 | forEach(glslKeywords, maybeAdd); 116 | forEach(glslBuiltins, maybeAdd); 117 | 118 | return found; 119 | } 120 | })(); 121 | -------------------------------------------------------------------------------- /resources/CodeEditor/js/glsl.js: -------------------------------------------------------------------------------- 1 | CodeMirror.defineMode("glsl", function(config, parserConfig) { 2 | var indentUnit = config.indentUnit, 3 | keywords = parserConfig.keywords || {}, 4 | builtins = parserConfig.builtins || {}, 5 | blockKeywords = parserConfig.blockKeywords || {}, 6 | atoms = parserConfig.atoms || {}, 7 | hooks = parserConfig.hooks || {}, 8 | multiLineStrings = parserConfig.multiLineStrings; 9 | var isOperatorChar = /[+\-*&%=<>!?|\/]/; 10 | 11 | var curPunc; 12 | 13 | function tokenBase(stream, state) { 14 | var ch = stream.next(); 15 | if (hooks[ch]) { 16 | var result = hooks[ch](stream, state); 17 | if (result !== false) return result; 18 | } 19 | if (ch == '"' || ch == "'") { 20 | state.tokenize = tokenString(ch); 21 | return state.tokenize(stream, state); 22 | } 23 | if (/[\[\]{}\(\),;\:\.]/.test(ch)) { 24 | curPunc = ch; 25 | return "bracket"; 26 | } 27 | if (/\d/.test(ch)) { 28 | stream.eatWhile(/[\w\.]/); 29 | return "number"; 30 | } 31 | if (ch == "/") { 32 | if (stream.eat("*")) { 33 | state.tokenize = tokenComment; 34 | return tokenComment(stream, state); 35 | } 36 | if (stream.eat("/")) { 37 | stream.skipToEnd(); 38 | return "comment"; 39 | } 40 | } 41 | if (isOperatorChar.test(ch)) { 42 | stream.eatWhile(isOperatorChar); 43 | return "operator"; 44 | } 45 | stream.eatWhile(/[\w\$_]/); 46 | var cur = stream.current(); 47 | if (keywords.propertyIsEnumerable(cur)) { 48 | if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; 49 | return "keyword"; 50 | } 51 | if (builtins.propertyIsEnumerable(cur)) { 52 | return "builtin"; 53 | } 54 | if (atoms.propertyIsEnumerable(cur)) return "atom"; 55 | return "word"; 56 | } 57 | 58 | function tokenString(quote) { 59 | return function(stream, state) { 60 | var escaped = false, next, end = false; 61 | while ((next = stream.next()) != null) { 62 | if (next == quote && !escaped) {end = true; break;} 63 | escaped = !escaped && next == "\\"; 64 | } 65 | if (end || !(escaped || multiLineStrings)) 66 | state.tokenize = tokenBase; 67 | return "string"; 68 | }; 69 | } 70 | 71 | function tokenComment(stream, state) { 72 | var maybeEnd = false, ch; 73 | while (ch = stream.next()) { 74 | if (ch == "/" && maybeEnd) { 75 | state.tokenize = tokenBase; 76 | break; 77 | } 78 | maybeEnd = (ch == "*"); 79 | } 80 | return "comment"; 81 | } 82 | 83 | function Context(indented, column, type, align, prev) { 84 | this.indented = indented; 85 | this.column = column; 86 | this.type = type; 87 | this.align = align; 88 | this.prev = prev; 89 | } 90 | function pushContext(state, col, type) { 91 | return state.context = new Context(state.indented, col, type, null, state.context); 92 | } 93 | function popContext(state) { 94 | var t = state.context.type; 95 | if (t == ")" || t == "]" || t == "}") 96 | state.indented = state.context.indented; 97 | return state.context = state.context.prev; 98 | } 99 | 100 | // Interface 101 | 102 | return { 103 | startState: function(basecolumn) { 104 | return { 105 | tokenize: null, 106 | context: new Context((basecolumn || 0) - indentUnit, 0, "top", false), 107 | indented: 0, 108 | startOfLine: true 109 | }; 110 | }, 111 | 112 | token: function(stream, state) { 113 | var ctx = state.context; 114 | if (stream.sol()) { 115 | if (ctx.align == null) ctx.align = false; 116 | state.indented = stream.indentation(); 117 | state.startOfLine = true; 118 | } 119 | if (stream.eatSpace()) return null; 120 | curPunc = null; 121 | var style = (state.tokenize || tokenBase)(stream, state); 122 | if (style == "comment" || style == "meta") return style; 123 | if (ctx.align == null) ctx.align = true; 124 | 125 | if ((curPunc == ";" || curPunc == ":") && ctx.type == "statement") popContext(state); 126 | else if (curPunc == "{") pushContext(state, stream.column(), "}"); 127 | else if (curPunc == "[") pushContext(state, stream.column(), "]"); 128 | else if (curPunc == "(") pushContext(state, stream.column(), ")"); 129 | else if (curPunc == "}") { 130 | while (ctx.type == "statement") ctx = popContext(state); 131 | if (ctx.type == "}") ctx = popContext(state); 132 | while (ctx.type == "statement") ctx = popContext(state); 133 | } 134 | else if (curPunc == ctx.type) popContext(state); 135 | else if (ctx.type == "}" || ctx.type == "top" || (ctx.type == "statement" && curPunc == "newstatement")) 136 | pushContext(state, stream.column(), "statement"); 137 | state.startOfLine = false; 138 | return style; 139 | }, 140 | 141 | indent: function(state, textAfter) { 142 | if (state.tokenize != tokenBase && state.tokenize != null) return 0; 143 | var firstChar = textAfter && textAfter.charAt(0), ctx = state.context, closing = firstChar == ctx.type; 144 | if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : indentUnit); 145 | else if (ctx.align) return ctx.column + (closing ? 0 : 1); 146 | else return ctx.indented + (closing ? 0 : indentUnit); 147 | }, 148 | 149 | electricChars: "{}" 150 | }; 151 | }); 152 | 153 | (function() { 154 | function words(str) { 155 | var obj = {}, words = str.split(" "); 156 | for (var i = 0; i < words.length; ++i) obj[words[i]] = true; 157 | return obj; 158 | } 159 | var glslKeywords = "float vec2 vec3 vec4 int ivec2 ivec3 ivec4 bool bvec2 bvec3 bvec4 mat2 mat3 mat4 " + 160 | "void sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow " + 161 | "uniform attribute varying const in out inout const " + 162 | "#define #undef #if #ifdef #ifndef #else #elif #endif #error #pragma #line #version #extension " + 163 | "break continue do for while if else true false " + 164 | "lowp mediump highp precision invariant discard return " + 165 | "gl_Position gl_PointSize gl_ClipVertex gl_Vertex gl_Normal gl_Color " + 166 | "gl_SecondaryColor gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 " + 167 | "gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 " + 168 | "gl_MultiTexCoord7 gl_FogCoord gl_FrontColor gl_BackColor " + 169 | "gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord " + 170 | "gl_FragColor gl_FragData gl_FragDepth gl_Color gl_SecondaryColor gl_FogFragCoord " + 171 | "gl_FragCoord gl_FrontFacing"; 172 | 173 | var glslBuiltins = "sin cos tan asin acos atan atan radians degrees " + 174 | "pow exp log exp2 log2 sqrt inversesqrt abs ceil " + 175 | "clamp floor fract max min mix mod sign smoothstep " + 176 | "step ftransform cross distance dot faceforward " + 177 | "length normalize reflect refract dFdx dFdy fwidth " + 178 | "matrixCompMult all any equal greaterThan greaterThanEqual " + 179 | "lessThan lessThanEqual notEqual " + 180 | "texture1D texture1DProj texture1DProj " + 181 | "texture2D texture2DProj texture2DProj " + 182 | "texture3D texture3DProj " + 183 | "textureCube shadow1D shadow2D shadow1DProj shadow2DProj " + 184 | "texture1DLod texture1DProjLod texture1DProjLod " + 185 | "texture2DLod texture2DProjLod texture2DProjLod texture3DProjLod " + 186 | "textureCubeLod shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod " + 187 | "gl_ModelViewMatrix gl_ModelViewProjectionMatrix gl_ProjectionMatrix " + 188 | "gl_TextureMatrix gl_ModelViewMatrixInverse gl_ModelViewProjectionMatrixInverse " + 189 | "gl_ProjectionMatrixInverse gl_TextureMatrixInverse gl_ModelViewMatrixTranspose " + 190 | "gl_ModelViewProjectionMatrixTranspose gl_ProjectionMatrixTranspose " + 191 | "gl_TextureMatrixTranspose gl_ModelViewMatrixInverseTranspose " + 192 | "gl_ModelViewProjectionMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose " + 193 | "gl_TextureMatrixInverseTranspose gl_NormalMatrix gl_NormalScale "; 194 | 195 | function cppHook(stream, state) { 196 | if (!state.startOfLine) return false; 197 | stream.skipToEnd(); 198 | return "meta"; 199 | } 200 | 201 | // C#-style strings where "" escapes a quote. 202 | function tokenAtString(stream, state) { 203 | var next; 204 | while ((next = stream.next()) != null) { 205 | if (next == '"' && !stream.eat('"')) { 206 | state.tokenize = null; 207 | break; 208 | } 209 | } 210 | return "string"; 211 | } 212 | 213 | CodeMirror.defineMIME("text/x-glsl", { 214 | name: "glsl", 215 | keywords: words(glslKeywords), 216 | builtins: words(glslBuiltins), 217 | blockKeywords: words("case do else for if switch while struct"), 218 | atoms: words("null"), 219 | hooks: {"#": cppHook} 220 | }); 221 | }()); 222 | -------------------------------------------------------------------------------- /resources/CodeEditor/js/jquery.color.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery Color Animations v@VERSION 3 | * https://github.com/jquery/jquery-color 4 | * 5 | * Copyright 2013 jQuery Foundation and other contributors 6 | * Released under the MIT license. 7 | * http://jquery.org/license 8 | * 9 | * Date: @DATE 10 | */ 11 | (function( jQuery, undefined ) { 12 | 13 | var stepHooks = "backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor", 14 | 15 | // plusequals test for += 100 -= 100 16 | rplusequals = /^([\-+])=\s*(\d+\.?\d*)/, 17 | // a set of RE's that can match strings and generate color tuples. 18 | stringParsers = [{ 19 | re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/, 20 | parse: function( execResult ) { 21 | return [ 22 | execResult[ 1 ], 23 | execResult[ 2 ], 24 | execResult[ 3 ], 25 | execResult[ 4 ] 26 | ]; 27 | } 28 | }, { 29 | re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/, 30 | parse: function( execResult ) { 31 | return [ 32 | execResult[ 1 ] * 2.55, 33 | execResult[ 2 ] * 2.55, 34 | execResult[ 3 ] * 2.55, 35 | execResult[ 4 ] 36 | ]; 37 | } 38 | }, { 39 | // this regex ignores A-F because it's compared against an already lowercased string 40 | re: /#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/, 41 | parse: function( execResult ) { 42 | return [ 43 | parseInt( execResult[ 1 ], 16 ), 44 | parseInt( execResult[ 2 ], 16 ), 45 | parseInt( execResult[ 3 ], 16 ) 46 | ]; 47 | } 48 | }, { 49 | // this regex ignores A-F because it's compared against an already lowercased string 50 | re: /#([a-f0-9])([a-f0-9])([a-f0-9])/, 51 | parse: function( execResult ) { 52 | return [ 53 | parseInt( execResult[ 1 ] + execResult[ 1 ], 16 ), 54 | parseInt( execResult[ 2 ] + execResult[ 2 ], 16 ), 55 | parseInt( execResult[ 3 ] + execResult[ 3 ], 16 ) 56 | ]; 57 | } 58 | }, { 59 | re: /hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/, 60 | space: "hsla", 61 | parse: function( execResult ) { 62 | return [ 63 | execResult[ 1 ], 64 | execResult[ 2 ] / 100, 65 | execResult[ 3 ] / 100, 66 | execResult[ 4 ] 67 | ]; 68 | } 69 | }], 70 | 71 | // jQuery.Color( ) 72 | color = jQuery.Color = function( color, green, blue, alpha ) { 73 | return new jQuery.Color.fn.parse( color, green, blue, alpha ); 74 | }, 75 | spaces = { 76 | rgba: { 77 | props: { 78 | red: { 79 | idx: 0, 80 | type: "byte" 81 | }, 82 | green: { 83 | idx: 1, 84 | type: "byte" 85 | }, 86 | blue: { 87 | idx: 2, 88 | type: "byte" 89 | } 90 | } 91 | }, 92 | 93 | hsla: { 94 | props: { 95 | hue: { 96 | idx: 0, 97 | type: "degrees" 98 | }, 99 | saturation: { 100 | idx: 1, 101 | type: "percent" 102 | }, 103 | lightness: { 104 | idx: 2, 105 | type: "percent" 106 | } 107 | } 108 | } 109 | }, 110 | propTypes = { 111 | "byte": { 112 | floor: true, 113 | max: 255 114 | }, 115 | "percent": { 116 | max: 1 117 | }, 118 | "degrees": { 119 | mod: 360, 120 | floor: true 121 | } 122 | }, 123 | support = color.support = {}, 124 | 125 | // element for support tests 126 | supportElem = jQuery( "

" )[ 0 ], 127 | 128 | // colors = jQuery.Color.names 129 | colors, 130 | 131 | // local aliases of functions called often 132 | each = jQuery.each; 133 | 134 | // determine rgba support immediately 135 | supportElem.style.cssText = "background-color:rgba(1,1,1,.5)"; 136 | support.rgba = supportElem.style.backgroundColor.indexOf( "rgba" ) > -1; 137 | 138 | // define cache name and alpha properties 139 | // for rgba and hsla spaces 140 | each( spaces, function( spaceName, space ) { 141 | space.cache = "_" + spaceName; 142 | space.props.alpha = { 143 | idx: 3, 144 | type: "percent", 145 | def: 1 146 | }; 147 | }); 148 | 149 | function clamp( value, prop, allowEmpty ) { 150 | var type = propTypes[ prop.type ] || {}; 151 | 152 | if ( value == null ) { 153 | return (allowEmpty || !prop.def) ? null : prop.def; 154 | } 155 | 156 | // ~~ is an short way of doing floor for positive numbers 157 | value = type.floor ? ~~value : parseFloat( value ); 158 | 159 | // IE will pass in empty strings as value for alpha, 160 | // which will hit this case 161 | if ( isNaN( value ) ) { 162 | return prop.def; 163 | } 164 | 165 | if ( type.mod ) { 166 | // we add mod before modding to make sure that negatives values 167 | // get converted properly: -10 -> 350 168 | return (value + type.mod) % type.mod; 169 | } 170 | 171 | // for now all property types without mod have min and max 172 | return 0 > value ? 0 : type.max < value ? type.max : value; 173 | } 174 | 175 | function stringParse( string ) { 176 | var inst = color(), 177 | rgba = inst._rgba = []; 178 | 179 | string = string.toLowerCase(); 180 | 181 | each( stringParsers, function( i, parser ) { 182 | var parsed, 183 | match = parser.re.exec( string ), 184 | values = match && parser.parse( match ), 185 | spaceName = parser.space || "rgba"; 186 | 187 | if ( values ) { 188 | parsed = inst[ spaceName ]( values ); 189 | 190 | // if this was an rgba parse the assignment might happen twice 191 | // oh well.... 192 | inst[ spaces[ spaceName ].cache ] = parsed[ spaces[ spaceName ].cache ]; 193 | rgba = inst._rgba = parsed._rgba; 194 | 195 | // exit each( stringParsers ) here because we matched 196 | return false; 197 | } 198 | }); 199 | 200 | // Found a stringParser that handled it 201 | if ( rgba.length ) { 202 | 203 | // if this came from a parsed string, force "transparent" when alpha is 0 204 | // chrome, (and maybe others) return "transparent" as rgba(0,0,0,0) 205 | if ( rgba.join() === "0,0,0,0" ) { 206 | jQuery.extend( rgba, colors.transparent ); 207 | } 208 | return inst; 209 | } 210 | 211 | // named colors 212 | return colors[ string ]; 213 | } 214 | 215 | color.fn = jQuery.extend( color.prototype, { 216 | parse: function( red, green, blue, alpha ) { 217 | if ( red === undefined ) { 218 | this._rgba = [ null, null, null, null ]; 219 | return this; 220 | } 221 | if ( red.jquery || red.nodeType ) { 222 | red = jQuery( red ).css( green ); 223 | green = undefined; 224 | } 225 | 226 | var inst = this, 227 | type = jQuery.type( red ), 228 | rgba = this._rgba = []; 229 | 230 | // more than 1 argument specified - assume ( red, green, blue, alpha ) 231 | if ( green !== undefined ) { 232 | red = [ red, green, blue, alpha ]; 233 | type = "array"; 234 | } 235 | 236 | if ( type === "string" ) { 237 | return this.parse( stringParse( red ) || colors._default ); 238 | } 239 | 240 | if ( type === "array" ) { 241 | each( spaces.rgba.props, function( key, prop ) { 242 | rgba[ prop.idx ] = clamp( red[ prop.idx ], prop ); 243 | }); 244 | return this; 245 | } 246 | 247 | if ( type === "object" ) { 248 | if ( red instanceof color ) { 249 | each( spaces, function( spaceName, space ) { 250 | if ( red[ space.cache ] ) { 251 | inst[ space.cache ] = red[ space.cache ].slice(); 252 | } 253 | }); 254 | } else { 255 | each( spaces, function( spaceName, space ) { 256 | var cache = space.cache; 257 | each( space.props, function( key, prop ) { 258 | 259 | // if the cache doesn't exist, and we know how to convert 260 | if ( !inst[ cache ] && space.to ) { 261 | 262 | // if the value was null, we don't need to copy it 263 | // if the key was alpha, we don't need to copy it either 264 | if ( key === "alpha" || red[ key ] == null ) { 265 | return; 266 | } 267 | inst[ cache ] = space.to( inst._rgba ); 268 | } 269 | 270 | // this is the only case where we allow nulls for ALL properties. 271 | // call clamp with alwaysAllowEmpty 272 | inst[ cache ][ prop.idx ] = clamp( red[ key ], prop, true ); 273 | }); 274 | 275 | // everything defined but alpha? 276 | if ( inst[ cache ] && jQuery.inArray( null, inst[ cache ].slice( 0, 3 ) ) < 0 ) { 277 | // use the default of 1 278 | inst[ cache ][ 3 ] = 1; 279 | if ( space.from ) { 280 | inst._rgba = space.from( inst[ cache ] ); 281 | } 282 | } 283 | }); 284 | } 285 | return this; 286 | } 287 | }, 288 | is: function( compare ) { 289 | var is = color( compare ), 290 | same = true, 291 | inst = this; 292 | 293 | each( spaces, function( _, space ) { 294 | var localCache, 295 | isCache = is[ space.cache ]; 296 | if (isCache) { 297 | localCache = inst[ space.cache ] || space.to && space.to( inst._rgba ) || []; 298 | each( space.props, function( _, prop ) { 299 | if ( isCache[ prop.idx ] != null ) { 300 | same = ( isCache[ prop.idx ] === localCache[ prop.idx ] ); 301 | return same; 302 | } 303 | }); 304 | } 305 | return same; 306 | }); 307 | return same; 308 | }, 309 | _space: function() { 310 | var used = [], 311 | inst = this; 312 | each( spaces, function( spaceName, space ) { 313 | if ( inst[ space.cache ] ) { 314 | used.push( spaceName ); 315 | } 316 | }); 317 | return used.pop(); 318 | }, 319 | transition: function( other, distance ) { 320 | var end = color( other ), 321 | spaceName = end._space(), 322 | space = spaces[ spaceName ], 323 | startColor = this.alpha() === 0 ? color( "transparent" ) : this, 324 | start = startColor[ space.cache ] || space.to( startColor._rgba ), 325 | result = start.slice(); 326 | 327 | end = end[ space.cache ]; 328 | each( space.props, function( key, prop ) { 329 | var index = prop.idx, 330 | startValue = start[ index ], 331 | endValue = end[ index ], 332 | type = propTypes[ prop.type ] || {}; 333 | 334 | // if null, don't override start value 335 | if ( endValue === null ) { 336 | return; 337 | } 338 | // if null - use end 339 | if ( startValue === null ) { 340 | result[ index ] = endValue; 341 | } else { 342 | if ( type.mod ) { 343 | if ( endValue - startValue > type.mod / 2 ) { 344 | startValue += type.mod; 345 | } else if ( startValue - endValue > type.mod / 2 ) { 346 | startValue -= type.mod; 347 | } 348 | } 349 | result[ index ] = clamp( ( endValue - startValue ) * distance + startValue, prop ); 350 | } 351 | }); 352 | return this[ spaceName ]( result ); 353 | }, 354 | blend: function( opaque ) { 355 | // if we are already opaque - return ourself 356 | if ( this._rgba[ 3 ] === 1 ) { 357 | return this; 358 | } 359 | 360 | var rgb = this._rgba.slice(), 361 | a = rgb.pop(), 362 | blend = color( opaque )._rgba; 363 | 364 | return color( jQuery.map( rgb, function( v, i ) { 365 | return ( 1 - a ) * blend[ i ] + a * v; 366 | })); 367 | }, 368 | toRgbaString: function() { 369 | var prefix = "rgba(", 370 | rgba = jQuery.map( this._rgba, function( v, i ) { 371 | return v == null ? ( i > 2 ? 1 : 0 ) : v; 372 | }); 373 | 374 | if ( rgba[ 3 ] === 1 ) { 375 | rgba.pop(); 376 | prefix = "rgb("; 377 | } 378 | 379 | return prefix + rgba.join() + ")"; 380 | }, 381 | toHslaString: function() { 382 | var prefix = "hsla(", 383 | hsla = jQuery.map( this.hsla(), function( v, i ) { 384 | if ( v == null ) { 385 | v = i > 2 ? 1 : 0; 386 | } 387 | 388 | // catch 1 and 2 389 | if ( i && i < 3 ) { 390 | v = Math.round( v * 100 ) + "%"; 391 | } 392 | return v; 393 | }); 394 | 395 | if ( hsla[ 3 ] === 1 ) { 396 | hsla.pop(); 397 | prefix = "hsl("; 398 | } 399 | return prefix + hsla.join() + ")"; 400 | }, 401 | toHexString: function( includeAlpha ) { 402 | var rgba = this._rgba.slice(), 403 | alpha = rgba.pop(); 404 | 405 | if ( includeAlpha ) { 406 | rgba.push( ~~( alpha * 255 ) ); 407 | } 408 | 409 | return "#" + jQuery.map( rgba, function( v ) { 410 | 411 | // default to 0 when nulls exist 412 | v = ( v || 0 ).toString( 16 ); 413 | return v.length === 1 ? "0" + v : v; 414 | }).join(""); 415 | }, 416 | toString: function() { 417 | return this._rgba[ 3 ] === 0 ? "transparent" : this.toRgbaString(); 418 | } 419 | }); 420 | color.fn.parse.prototype = color.fn; 421 | 422 | // hsla conversions adapted from: 423 | // https://code.google.com/p/maashaack/source/browse/packages/graphics/trunk/src/graphics/colors/HUE2RGB.as?r=5021 424 | 425 | function hue2rgb( p, q, h ) { 426 | h = ( h + 1 ) % 1; 427 | if ( h * 6 < 1 ) { 428 | return p + (q - p) * h * 6; 429 | } 430 | if ( h * 2 < 1) { 431 | return q; 432 | } 433 | if ( h * 3 < 2 ) { 434 | return p + (q - p) * ((2/3) - h) * 6; 435 | } 436 | return p; 437 | } 438 | 439 | spaces.hsla.to = function ( rgba ) { 440 | if ( rgba[ 0 ] == null || rgba[ 1 ] == null || rgba[ 2 ] == null ) { 441 | return [ null, null, null, rgba[ 3 ] ]; 442 | } 443 | var r = rgba[ 0 ] / 255, 444 | g = rgba[ 1 ] / 255, 445 | b = rgba[ 2 ] / 255, 446 | a = rgba[ 3 ], 447 | max = Math.max( r, g, b ), 448 | min = Math.min( r, g, b ), 449 | diff = max - min, 450 | add = max + min, 451 | l = add * 0.5, 452 | h, s; 453 | 454 | if ( min === max ) { 455 | h = 0; 456 | } else if ( r === max ) { 457 | h = ( 60 * ( g - b ) / diff ) + 360; 458 | } else if ( g === max ) { 459 | h = ( 60 * ( b - r ) / diff ) + 120; 460 | } else { 461 | h = ( 60 * ( r - g ) / diff ) + 240; 462 | } 463 | 464 | // chroma (diff) == 0 means greyscale which, by definition, saturation = 0% 465 | // otherwise, saturation is based on the ratio of chroma (diff) to lightness (add) 466 | if ( diff === 0 ) { 467 | s = 0; 468 | } else if ( l <= 0.5 ) { 469 | s = diff / add; 470 | } else { 471 | s = diff / ( 2 - add ); 472 | } 473 | return [ Math.round(h) % 360, s, l, a == null ? 1 : a ]; 474 | }; 475 | 476 | spaces.hsla.from = function ( hsla ) { 477 | if ( hsla[ 0 ] == null || hsla[ 1 ] == null || hsla[ 2 ] == null ) { 478 | return [ null, null, null, hsla[ 3 ] ]; 479 | } 480 | var h = hsla[ 0 ] / 360, 481 | s = hsla[ 1 ], 482 | l = hsla[ 2 ], 483 | a = hsla[ 3 ], 484 | q = l <= 0.5 ? l * ( 1 + s ) : l + s - l * s, 485 | p = 2 * l - q; 486 | 487 | return [ 488 | Math.round( hue2rgb( p, q, h + ( 1 / 3 ) ) * 255 ), 489 | Math.round( hue2rgb( p, q, h ) * 255 ), 490 | Math.round( hue2rgb( p, q, h - ( 1 / 3 ) ) * 255 ), 491 | a 492 | ]; 493 | }; 494 | 495 | 496 | each( spaces, function( spaceName, space ) { 497 | var props = space.props, 498 | cache = space.cache, 499 | to = space.to, 500 | from = space.from; 501 | 502 | // makes rgba() and hsla() 503 | color.fn[ spaceName ] = function( value ) { 504 | 505 | // generate a cache for this space if it doesn't exist 506 | if ( to && !this[ cache ] ) { 507 | this[ cache ] = to( this._rgba ); 508 | } 509 | if ( value === undefined ) { 510 | return this[ cache ].slice(); 511 | } 512 | 513 | var ret, 514 | type = jQuery.type( value ), 515 | arr = ( type === "array" || type === "object" ) ? value : arguments, 516 | local = this[ cache ].slice(); 517 | 518 | each( props, function( key, prop ) { 519 | var val = arr[ type === "object" ? key : prop.idx ]; 520 | if ( val == null ) { 521 | val = local[ prop.idx ]; 522 | } 523 | local[ prop.idx ] = clamp( val, prop ); 524 | }); 525 | 526 | if ( from ) { 527 | ret = color( from( local ) ); 528 | ret[ cache ] = local; 529 | return ret; 530 | } else { 531 | return color( local ); 532 | } 533 | }; 534 | 535 | // makes red() green() blue() alpha() hue() saturation() lightness() 536 | each( props, function( key, prop ) { 537 | // alpha is included in more than one space 538 | if ( color.fn[ key ] ) { 539 | return; 540 | } 541 | color.fn[ key ] = function( value ) { 542 | var vtype = jQuery.type( value ), 543 | fn = ( key === "alpha" ? ( this._hsla ? "hsla" : "rgba" ) : spaceName ), 544 | local = this[ fn ](), 545 | cur = local[ prop.idx ], 546 | match; 547 | 548 | if ( vtype === "undefined" ) { 549 | return cur; 550 | } 551 | 552 | if ( vtype === "function" ) { 553 | value = value.call( this, cur ); 554 | vtype = jQuery.type( value ); 555 | } 556 | if ( value == null && prop.empty ) { 557 | return this; 558 | } 559 | if ( vtype === "string" ) { 560 | match = rplusequals.exec( value ); 561 | if ( match ) { 562 | value = cur + parseFloat( match[ 2 ] ) * ( match[ 1 ] === "+" ? 1 : -1 ); 563 | } 564 | } 565 | local[ prop.idx ] = value; 566 | return this[ fn ]( local ); 567 | }; 568 | }); 569 | }); 570 | 571 | // add cssHook and .fx.step function for each named hook. 572 | // accept a space separated string of properties 573 | color.hook = function( hook ) { 574 | var hooks = hook.split( " " ); 575 | each( hooks, function( i, hook ) { 576 | jQuery.cssHooks[ hook ] = { 577 | set: function( elem, value ) { 578 | var parsed, curElem, 579 | backgroundColor = ""; 580 | 581 | if ( value !== "transparent" && ( jQuery.type( value ) !== "string" || ( parsed = stringParse( value ) ) ) ) { 582 | value = color( parsed || value ); 583 | if ( !support.rgba && value._rgba[ 3 ] !== 1 ) { 584 | curElem = hook === "backgroundColor" ? elem.parentNode : elem; 585 | while ( 586 | (backgroundColor === "" || backgroundColor === "transparent") && 587 | curElem && curElem.style 588 | ) { 589 | try { 590 | backgroundColor = jQuery.css( curElem, "backgroundColor" ); 591 | curElem = curElem.parentNode; 592 | } catch ( e ) { 593 | } 594 | } 595 | 596 | value = value.blend( backgroundColor && backgroundColor !== "transparent" ? 597 | backgroundColor : 598 | "_default" ); 599 | } 600 | 601 | value = value.toRgbaString(); 602 | } 603 | try { 604 | elem.style[ hook ] = value; 605 | } catch( e ) { 606 | // wrapped to prevent IE from throwing errors on "invalid" values like 'auto' or 'inherit' 607 | } 608 | } 609 | }; 610 | jQuery.fx.step[ hook ] = function( fx ) { 611 | if ( !fx.colorInit ) { 612 | fx.start = color( fx.elem, hook ); 613 | fx.end = color( fx.end ); 614 | fx.colorInit = true; 615 | } 616 | jQuery.cssHooks[ hook ].set( fx.elem, fx.start.transition( fx.end, fx.pos ) ); 617 | }; 618 | }); 619 | 620 | }; 621 | 622 | color.hook( stepHooks ); 623 | 624 | jQuery.cssHooks.borderColor = { 625 | expand: function( value ) { 626 | var expanded = {}; 627 | 628 | each( [ "Top", "Right", "Bottom", "Left" ], function( i, part ) { 629 | expanded[ "border" + part + "Color" ] = value; 630 | }); 631 | return expanded; 632 | } 633 | }; 634 | 635 | // Basic color names only. 636 | // Usage of any of the other color names requires adding yourself or including 637 | // jquery.color.svg-names.js. 638 | colors = jQuery.Color.names = { 639 | // 4.1. Basic color keywords 640 | aqua: "#00ffff", 641 | black: "#000000", 642 | blue: "#0000ff", 643 | fuchsia: "#ff00ff", 644 | gray: "#808080", 645 | green: "#008000", 646 | lime: "#00ff00", 647 | maroon: "#800000", 648 | navy: "#000080", 649 | olive: "#808000", 650 | purple: "#800080", 651 | red: "#ff0000", 652 | silver: "#c0c0c0", 653 | teal: "#008080", 654 | white: "#ffffff", 655 | yellow: "#ffff00", 656 | 657 | // 4.2.3. "transparent" color keyword 658 | transparent: [ null, null, null, 0 ], 659 | 660 | _default: "#ffffff" 661 | }; 662 | 663 | })( jQuery ); 664 | -------------------------------------------------------------------------------- /resources/CodeEditor/js/lua-hint.js: -------------------------------------------------------------------------------- 1 | (function () { 2 | function forEach(arr, f) { 3 | for (var i = 0, e = arr.length; i < e; ++i) f(arr[i]); 4 | } 5 | 6 | function arrayContains(arr, item) { 7 | if (!Array.prototype.indexOf) { 8 | var i = arr.length; 9 | while (i--) { 10 | if (arr[i] === item) { 11 | return true; 12 | } 13 | } 14 | return false; 15 | } 16 | return arr.indexOf(item) != -1; 17 | } 18 | 19 | 20 | var types = ("Area Camera CameraPersp Channel Color ColorA MouseEvent KeyEvent Font Matrix44f Matrix33f " + 21 | " MayaCamUI Perlin Quatf Rectf Surface TextLayout TextBox TriMesh Vec2f Vec2i Vec3f vector_float " + 22 | " vector_int vector_uint32_t vector_string vector_Vec2i vector_Vec2f vector_Vec3f vector_Color vector_ColorA " + 23 | " gl.Fbo gl.Fbo.Format gl.GlslProg gl.Texture gl.VboMesh gl.VboMesh.Layout " + 24 | " DataSourceRef ImageSourceRef").split(" "); 25 | 26 | var typesQualifiers = ("local global" ).split(" "); 27 | var preProcessor = ("#define #undef #if #ifdef #ifndef #else #elif #endif #error #pragma #line #version #extension" ).split(" "); 28 | 29 | var keywords = ("and break elseif false nil not or return " + 30 | "true function end if then else do " + 31 | "while repeat until for in local " + 32 | "function if repeat do " + 33 | "end until " ).split(" "); 34 | 35 | var builtins = ( "_G _VERSION assert collectgarbage dofile error getfenv getmetatable ipairs load " + 36 | "loadfile loadstring module next pairs pcall print rawequal rawget rawset require " + 37 | "select setfenv setmetatable tonumber tostring type unpack xpcall " + 38 | "coroutine.create coroutine.resume coroutine.running coroutine.status coroutine.wrap coroutine.yield " + 39 | "debug.debug debug.getfenv debug.gethook debug.getinfo debug.getlocal debug.getmetatable " + 40 | "debug.getregistry debug.getupvalue debug.setfenv debug.sethook debug.setlocal debug.setmetatable " + 41 | "debug.setupvalue debug.traceback " + 42 | "close flush lines read seek setvbuf write " + 43 | "io.close io.flush io.input io.lines io.open io.output io.popen io.read io.stderr io.stdin " + 44 | "io.stdout io.tmpfile io.type io.write " + 45 | "math.abs math.acos math.asin math.atan math.atan2 math.ceil math.cos math.cosh math.deg " + 46 | "math.exp math.floor math.fmod math.frexp math.huge math.ldexp math.log math.log10 math.max " + 47 | "math.min math.modf math.pi math.pow math.rad math.random math.randomseed math.sin math.sinh " + 48 | "math.sqrt math.tan math.tanh " + 49 | "os.clock os.date os.difftime os.execute os.exit os.getenv os.remove os.rename os.setlocale " + 50 | "os.time os.tmpname " + 51 | "package.cpath package.loaded package.loaders package.loadlib package.path package.preload " + 52 | "package.seeall " + 53 | "string.byte string.char string.dump string.find string.format string.gmatch string.gsub " + 54 | "string.len string.lower string.match string.rep string.reverse string.sub string.upper " + 55 | "table.concat table.insert table.maxn table.remove table.sort" + 56 | "gl.isExtensionAvailable gl.clear gl.setMatrices gl.setModelView gl.setProjection gl.pushModelView " + 57 | "gl.popModelView gl.pushMatrices gl.popMatrices gl.multModelView gl.multProjection gl.getModelView " + 58 | "gl.getProjection gl.setMatricesWindowPersp gl.setMatricesWindow " + 59 | "gl.getViewport gl.translate gl.scale gl.rotate gl.Begin gl.End gl.vertex " + 60 | "gl.color gl.enable gl.disable gl.enableAlphaBlending gl.disableAlphaBlending gl.enableAdditiveBlending " + 61 | "gl.enableAlphaTest gl.disableAlphaTest gl.enableWireframe gl.disableWireframe " + 62 | "gl.disableDepthRead gl.disableDepthWrite gl.enableDepthRead gl.enableDepthWrite " + 63 | "gl.drawLine gl.drawCube gl.drawColorCube gl.drawStrokedCube " + 64 | "gl.drawSphere gl.drawSolidCircle gl.drawStrokedCircle gl.drawSolidRect " + 65 | "gl.drawSolidRect gl.drawStrokedRect gl.drawCoordinateFrame gl.drawVector gl.drawFrustum gl.drawTorus " + 66 | "gl.drawCylinder gl.draw gl.drawRange gl.drawArrays " + 67 | "gl.drawBillboard gl.drawString gl.drawStringCentered gl.drawStringRight " + 68 | "getWindowWidth getWindowHeight getWindowCenter getWindowSize getWindowAspectRatio getWindowBounds " + 69 | "getFrameRate setFrameRate getAverageFps getFpsSampleInterval setFpsSampleInterval " + 70 | "isFullScreen setFullScreen " + 71 | "getMousePos hideCursor showCursor " + 72 | "getElapsedSeconds getElapsedFrames " + 73 | "quit getAppPath console " + 74 | "randSeed randBool randInt randFloat randPosNegFloat randVec2f randVec3f " + 75 | "loadFile loadResource loadAsset loadImage ").split(" "); 76 | 77 | function scriptHint(editor, getToken, options) { 78 | // Find the token at the cursor 79 | var cur = editor.getCursor(), token = getToken(editor, cur), tprop = token; 80 | // If it's not a 'word-style' token, ignore the token. 81 | /*if (!/^[\w$_]*$/.test(token.string)) { 82 | token = tprop = {start: cur.ch, end: cur.ch, string: "", state: token.state, 83 | type: token.string == "." ? "property" : null}; 84 | }*/ 85 | 86 | var variableNames = []; 87 | for( var line = 0; line < editor.lineCount() && line < editor.getCursor().line; line++ ){ 88 | var lineContent = editor.getLine( line ); 89 | var containsType = false; 90 | var typeIndex; 91 | 92 | for (var i = 0, e = types.length; i < e; ++i){ 93 | typeIndex = lineContent.indexOf( types[i] ); 94 | if( typeIndex != -1 ){ 95 | containsType = true; 96 | break; 97 | } 98 | } 99 | 100 | if( containsType ){ 101 | var variableName = lineContent.substring( typeIndex ); 102 | variableName = variableName.substring( variableName.search( /\s/ ) ); 103 | variableName = variableName.replace(/\s+/g, ''); 104 | variableName = variableName.substring( 0, variableName.search( /[^A-Za-z]/ ) ); 105 | if( variableName != "main" ) 106 | variableNames.push( variableName ); 107 | } 108 | 109 | } 110 | 111 | return {list: getCompletions(token, variableNames, options), 112 | from: {line: cur.line, ch: token.start}, 113 | to: {line: cur.line, ch: token.end}}; 114 | } 115 | 116 | CodeMirror.glslHint = function(editor, options) { 117 | return scriptHint(editor, 118 | function (e, cur) {return e.getTokenAt(cur);}, 119 | options); 120 | }; 121 | 122 | 123 | function getCompletions(token, variableNames, options) { 124 | var found = [], start = token.string; 125 | function maybeAdd(str) { 126 | if (str.indexOf(start) == 0 && !arrayContains(found, str)) found.push(str); 127 | } 128 | for (var i = 0; i < variableNames.length; i++){ 129 | maybeAdd( variableNames[i] ); 130 | } 131 | 132 | forEach(types, maybeAdd); 133 | forEach(typesQualifiers, maybeAdd); 134 | forEach(preProcessor, maybeAdd); 135 | forEach(keywords, maybeAdd); 136 | forEach(builtins, maybeAdd); 137 | 138 | return found; 139 | } 140 | })(); 141 | -------------------------------------------------------------------------------- /resources/CodeEditor/js/lua.js: -------------------------------------------------------------------------------- 1 | // LUA mode. Ported to CodeMirror 2 from Franciszek Wawrzak's 2 | // CodeMirror 1 mode. 3 | // highlights keywords, strings, comments (no leveling supported! ("[==[")), tokens, basic indenting 4 | 5 | CodeMirror.defineMode("lua", function(config, parserConfig) { 6 | var indentUnit = config.indentUnit; 7 | 8 | function prefixRE(words) { 9 | return new RegExp("^(?:" + words.join("|") + ")", "i"); 10 | } 11 | function wordRE(words) { 12 | return new RegExp("^(?:" + words.join("|") + ")$", "i"); 13 | } 14 | var specials = wordRE(parserConfig.specials || []); 15 | 16 | // long list of standard functions from lua manual 17 | var builtins = wordRE([ 18 | "_G","_VERSION","assert","collectgarbage","dofile","error","getfenv","getmetatable","ipairs","load", 19 | "loadfile","loadstring","module","next","pairs","pcall","print","rawequal","rawget","rawset","require", 20 | "select","setfenv","setmetatable","tonumber","tostring","type","unpack","xpcall", 21 | 22 | "coroutine.create","coroutine.resume","coroutine.running","coroutine.status","coroutine.wrap","coroutine.yield", 23 | 24 | "debug.debug","debug.getfenv","debug.gethook","debug.getinfo","debug.getlocal","debug.getmetatable", 25 | "debug.getregistry","debug.getupvalue","debug.setfenv","debug.sethook","debug.setlocal","debug.setmetatable", 26 | "debug.setupvalue","debug.traceback", 27 | 28 | "close","flush","lines","read","seek","setvbuf","write", 29 | 30 | "io.close","io.flush","io.input","io.lines","io.open","io.output","io.popen","io.read","io.stderr","io.stdin", 31 | "io.stdout","io.tmpfile","io.type","io.write", 32 | 33 | "math.abs","math.acos","math.asin","math.atan","math.atan2","math.ceil","math.cos","math.cosh","math.deg", 34 | "math.exp","math.floor","math.fmod","math.frexp","math.huge","math.ldexp","math.log","math.log10","math.max", 35 | "math.min","math.modf","math.pi","math.pow","math.rad","math.random","math.randomseed","math.sin","math.sinh", 36 | "math.sqrt","math.tan","math.tanh", 37 | 38 | "os.clock","os.date","os.difftime","os.execute","os.exit","os.getenv","os.remove","os.rename","os.setlocale", 39 | "os.time","os.tmpname", 40 | 41 | "package.cpath","package.loaded","package.loaders","package.loadlib","package.path","package.preload", 42 | "package.seeall", 43 | 44 | "string.byte","string.char","string.dump","string.find","string.format","string.gmatch","string.gsub", 45 | "string.len","string.lower","string.match","string.rep","string.reverse","string.sub","string.upper", 46 | 47 | "table.concat","table.insert","table.maxn","table.remove","table.sort" 48 | ]); 49 | var keywords = wordRE(["and","break","elseif","false","nil","not","or","return", 50 | "true","function", "end", "if", "then", "else", "do", 51 | "while", "repeat", "until", "for", "in", "local" ]); 52 | 53 | var indentTokens = wordRE(["function", "if","repeat","do", "\\(", "{"]); 54 | var dedentTokens = wordRE(["end", "until", "\\)", "}"]); 55 | var dedentPartial = prefixRE(["end", "until", "\\)", "}", "else", "elseif"]); 56 | 57 | function readBracket(stream) { 58 | var level = 0; 59 | while (stream.eat("=")) ++level; 60 | stream.eat("["); 61 | return level; 62 | } 63 | 64 | function normal(stream, state) { 65 | var ch = stream.next(); 66 | if (ch == "-" && stream.eat("-")) { 67 | if (stream.eat("[") && stream.eat("[")) 68 | return (state.cur = bracketed(readBracket(stream), "comment"))(stream, state); 69 | stream.skipToEnd(); 70 | return "comment"; 71 | } 72 | if (ch == "\"" || ch == "'") 73 | return (state.cur = string(ch))(stream, state); 74 | if (ch == "[" && /[\[=]/.test(stream.peek())) 75 | return (state.cur = bracketed(readBracket(stream), "string"))(stream, state); 76 | if (/\d/.test(ch)) { 77 | stream.eatWhile(/[\w.%]/); 78 | return "number"; 79 | } 80 | if (/[\w_]/.test(ch)) { 81 | stream.eatWhile(/[\w\\\-_.]/); 82 | return "variable"; 83 | } 84 | return null; 85 | } 86 | 87 | function bracketed(level, style) { 88 | return function(stream, state) { 89 | var curlev = null, ch; 90 | while ((ch = stream.next()) != null) { 91 | if (curlev == null) {if (ch == "]") curlev = 0;} 92 | else if (ch == "=") ++curlev; 93 | else if (ch == "]" && curlev == level) { state.cur = normal; break; } 94 | else curlev = null; 95 | } 96 | return style; 97 | }; 98 | } 99 | 100 | function string(quote) { 101 | return function(stream, state) { 102 | var escaped = false, ch; 103 | while ((ch = stream.next()) != null) { 104 | if (ch == quote && !escaped) break; 105 | escaped = !escaped && ch == "\\"; 106 | } 107 | if (!escaped) state.cur = normal; 108 | return "string"; 109 | }; 110 | } 111 | 112 | return { 113 | startState: function(basecol) { 114 | return {basecol: basecol || 0, indentDepth: 0, cur: normal}; 115 | }, 116 | 117 | token: function(stream, state) { 118 | if (stream.eatSpace()) return null; 119 | var style = state.cur(stream, state); 120 | var word = stream.current(); 121 | if (style == "variable") { 122 | if (keywords.test(word)) style = "keyword"; 123 | else if (builtins.test(word)) style = "builtin"; 124 | else if (specials.test(word)) style = "variable-2"; 125 | } 126 | if ((style != "comment") && (style != "string")){ 127 | if (indentTokens.test(word)) ++state.indentDepth; 128 | else if (dedentTokens.test(word)) --state.indentDepth; 129 | } 130 | return style; 131 | }, 132 | 133 | indent: function(state, textAfter) { 134 | var closing = dedentPartial.test(textAfter); 135 | return state.basecol + indentUnit * (state.indentDepth - (closing ? 1 : 0)); 136 | } 137 | }; 138 | }); 139 | 140 | CodeMirror.defineMIME("text/x-lua", "lua"); 141 | -------------------------------------------------------------------------------- /resources/CodeEditor/js/match-highlighter.js: -------------------------------------------------------------------------------- 1 | // Define match-highlighter commands. Depends on searchcursor.js 2 | // Use by attaching the following function call to the cursorActivity event: 3 | //myCodeMirror.matchHighlight(minChars); 4 | // And including a special span.CodeMirror-matchhighlight css class (also optionally a separate one for .CodeMirror-focused -- see demo matchhighlighter.html) 5 | 6 | (function() { 7 | var DEFAULT_MIN_CHARS = 2; 8 | 9 | function MatchHighlightState() { 10 | this.marked = []; 11 | } 12 | function getMatchHighlightState(cm) { 13 | return cm._matchHighlightState || (cm._matchHighlightState = new MatchHighlightState()); 14 | } 15 | 16 | function clearMarks(cm) { 17 | var state = getMatchHighlightState(cm); 18 | for (var i = 0; i < state.marked.length; ++i) 19 | state.marked[i].clear(); 20 | state.marked = []; 21 | } 22 | 23 | function markDocument(cm, className, minChars) { 24 | clearMarks(cm); 25 | minChars = (typeof minChars !== 'undefined' ? minChars : DEFAULT_MIN_CHARS); 26 | if (cm.somethingSelected() && cm.getSelection().replace(/^\s+|\s+$/g, "").length >= minChars) { 27 | var state = getMatchHighlightState(cm); 28 | var query = cm.getSelection(); 29 | cm.operation(function() { 30 | if (cm.lineCount() < 2000) { // This is too expensive on big documents. 31 | for (var cursor = cm.getSearchCursor(query); cursor.findNext();) { 32 | //Only apply matchhighlight to the matches other than the one actually selected 33 | if (cursor.from().line !== cm.getCursor(true).line || 34 | cursor.from().ch !== cm.getCursor(true).ch) 35 | state.marked.push(cm.markText(cursor.from(), cursor.to(), 36 | {className: className})); 37 | } 38 | } 39 | }); 40 | } 41 | } 42 | 43 | CodeMirror.defineExtension("matchHighlight", function(className, minChars) { 44 | markDocument(this, className, minChars); 45 | }); 46 | })(); 47 | -------------------------------------------------------------------------------- /resources/CodeEditor/js/search.js: -------------------------------------------------------------------------------- 1 | // Define search commands. Depends on dialog.js or another 2 | // implementation of the openDialog method. 3 | 4 | // Replace works a little oddly -- it will do the replace on the next 5 | // Ctrl-G (or whatever is bound to findNext) press. You prevent a 6 | // replace by making sure the match is no longer selected when hitting 7 | // Ctrl-G. 8 | 9 | (function() { 10 | function searchOverlay(query) { 11 | if (typeof query == "string") return {token: function(stream) { 12 | if (stream.match(query)) return "searching"; 13 | stream.next(); 14 | stream.skipTo(query.charAt(0)) || stream.skipToEnd(); 15 | }}; 16 | return {token: function(stream) { 17 | if (stream.match(query)) return "searching"; 18 | while (!stream.eol()) { 19 | stream.next(); 20 | if (stream.match(query, false)) break; 21 | } 22 | }}; 23 | } 24 | 25 | function SearchState() { 26 | this.posFrom = this.posTo = this.query = null; 27 | this.overlay = null; 28 | } 29 | function getSearchState(cm) { 30 | return cm._searchState || (cm._searchState = new SearchState()); 31 | } 32 | function getSearchCursor(cm, query, pos) { 33 | // Heuristic: if the query string is all lowercase, do a case insensitive search. 34 | return cm.getSearchCursor(query, pos, typeof query == "string" && query == query.toLowerCase()); 35 | } 36 | function dialog(cm, text, shortText, f) { 37 | if (cm.openDialog) cm.openDialog(text, f); 38 | else f(prompt(shortText, "")); 39 | } 40 | function confirmDialog(cm, text, shortText, fs) { 41 | if (cm.openConfirm) cm.openConfirm(text, fs); 42 | else if (confirm(shortText)) fs[0](); 43 | } 44 | function parseQuery(query) { 45 | var isRE = query.match(/^\/(.*)\/([a-z]*)$/); 46 | return isRE ? new RegExp(isRE[1], isRE[2].indexOf("i") == -1 ? "" : "i") : query; 47 | } 48 | var queryDialog = 49 | 'Search: (Use /re/ syntax for regexp search)'; 50 | function doSearch(cm, rev) { 51 | var state = getSearchState(cm); 52 | if (state.query) return findNext(cm, rev); 53 | dialog(cm, queryDialog, "Search for:", function(query) { 54 | cm.operation(function() { 55 | if (!query || state.query) return; 56 | state.query = parseQuery(query); 57 | cm.removeOverlay(state.overlay); 58 | state.overlay = searchOverlay(query); 59 | cm.addOverlay(state.overlay); 60 | state.posFrom = state.posTo = cm.getCursor(); 61 | findNext(cm, rev); 62 | }); 63 | }); 64 | } 65 | function findNext(cm, rev) {cm.operation(function() { 66 | var state = getSearchState(cm); 67 | var cursor = getSearchCursor(cm, state.query, rev ? state.posFrom : state.posTo); 68 | if (!cursor.find(rev)) { 69 | cursor = getSearchCursor(cm, state.query, rev ? {line: cm.lineCount() - 1} : {line: 0, ch: 0}); 70 | if (!cursor.find(rev)) return; 71 | } 72 | cm.setSelection(cursor.from(), cursor.to()); 73 | state.posFrom = cursor.from(); state.posTo = cursor.to(); 74 | });} 75 | function clearSearch(cm) {cm.operation(function() { 76 | var state = getSearchState(cm); 77 | if (!state.query) return; 78 | state.query = null; 79 | cm.removeOverlay(state.overlay); 80 | });} 81 | 82 | var replaceQueryDialog = 83 | 'Replace: (Use /re/ syntax for regexp search)'; 84 | var replacementQueryDialog = 'With: '; 85 | var doReplaceConfirm = "Replace? "; 86 | function replace(cm, all) { 87 | dialog(cm, replaceQueryDialog, "Replace:", function(query) { 88 | if (!query) return; 89 | query = parseQuery(query); 90 | dialog(cm, replacementQueryDialog, "Replace with:", function(text) { 91 | if (all) { 92 | cm.operation(function() { 93 | for (var cursor = getSearchCursor(cm, query); cursor.findNext();) { 94 | if (typeof query != "string") { 95 | var match = cm.getRange(cursor.from(), cursor.to()).match(query); 96 | cursor.replace(text.replace(/\$(\d)/, function(_, i) {return match[i];})); 97 | } else cursor.replace(text); 98 | } 99 | }); 100 | } else { 101 | clearSearch(cm); 102 | var cursor = getSearchCursor(cm, query, cm.getCursor()); 103 | function advance() { 104 | var start = cursor.from(), match; 105 | if (!(match = cursor.findNext())) { 106 | cursor = getSearchCursor(cm, query); 107 | if (!(match = cursor.findNext()) || 108 | (start && cursor.from().line == start.line && cursor.from().ch == start.ch)) return; 109 | } 110 | cm.setSelection(cursor.from(), cursor.to()); 111 | confirmDialog(cm, doReplaceConfirm, "Replace?", 112 | [function() {doReplace(match);}, advance]); 113 | } 114 | function doReplace(match) { 115 | cursor.replace(typeof query == "string" ? text : 116 | text.replace(/\$(\d)/, function(_, i) {return match[i];})); 117 | advance(); 118 | } 119 | advance(); 120 | } 121 | }); 122 | }); 123 | } 124 | 125 | CodeMirror.commands.find = function(cm) {clearSearch(cm); doSearch(cm);}; 126 | CodeMirror.commands.findNext = doSearch; 127 | CodeMirror.commands.findPrev = function(cm) {doSearch(cm, true);}; 128 | CodeMirror.commands.clearSearch = clearSearch; 129 | CodeMirror.commands.replace = replace; 130 | CodeMirror.commands.replaceAll = function(cm) {replace(cm, true);}; 131 | })(); 132 | -------------------------------------------------------------------------------- /resources/CodeEditor/js/searchcursor.js: -------------------------------------------------------------------------------- 1 | (function(){ 2 | function SearchCursor(cm, query, pos, caseFold) { 3 | this.atOccurrence = false; this.cm = cm; 4 | if (caseFold == null && typeof query == "string") caseFold = false; 5 | 6 | pos = pos ? cm.clipPos(pos) : {line: 0, ch: 0}; 7 | this.pos = {from: pos, to: pos}; 8 | 9 | // The matches method is filled in based on the type of query. 10 | // It takes a position and a direction, and returns an object 11 | // describing the next occurrence of the query, or null if no 12 | // more matches were found. 13 | if (typeof query != "string") { // Regexp match 14 | if (!query.global) query = new RegExp(query.source, query.ignoreCase ? "ig" : "g"); 15 | this.matches = function(reverse, pos) { 16 | if (reverse) { 17 | query.lastIndex = 0; 18 | var line = cm.getLine(pos.line).slice(0, pos.ch), match = query.exec(line), start = 0; 19 | while (match) { 20 | start += match.index + 1; 21 | line = line.slice(start); 22 | query.lastIndex = 0; 23 | var newmatch = query.exec(line); 24 | if (newmatch) match = newmatch; 25 | else break; 26 | } 27 | start--; 28 | } else { 29 | query.lastIndex = pos.ch; 30 | var line = cm.getLine(pos.line), match = query.exec(line), 31 | start = match && match.index; 32 | } 33 | if (match && match[0]) 34 | return {from: {line: pos.line, ch: start}, 35 | to: {line: pos.line, ch: start + match[0].length}, 36 | match: match}; 37 | }; 38 | } else { // String query 39 | if (caseFold) query = query.toLowerCase(); 40 | var fold = caseFold ? function(str){return str.toLowerCase();} : function(str){return str;}; 41 | var target = query.split("\n"); 42 | // Different methods for single-line and multi-line queries 43 | if (target.length == 1) { 44 | if (!query.length) { 45 | // Empty string would match anything and never progress, so 46 | // we define it to match nothing instead. 47 | this.matches = function() {}; 48 | } else { 49 | this.matches = function(reverse, pos) { 50 | var line = fold(cm.getLine(pos.line)), len = query.length, match; 51 | if (reverse ? (pos.ch >= len && (match = line.lastIndexOf(query, pos.ch - len)) != -1) 52 | : (match = line.indexOf(query, pos.ch)) != -1) 53 | return {from: {line: pos.line, ch: match}, 54 | to: {line: pos.line, ch: match + len}}; 55 | }; 56 | } 57 | } else { 58 | this.matches = function(reverse, pos) { 59 | var ln = pos.line, idx = (reverse ? target.length - 1 : 0), match = target[idx], line = fold(cm.getLine(ln)); 60 | var offsetA = (reverse ? line.indexOf(match) + match.length : line.lastIndexOf(match)); 61 | if (reverse ? offsetA >= pos.ch || offsetA != match.length 62 | : offsetA <= pos.ch || offsetA != line.length - match.length) 63 | return; 64 | for (;;) { 65 | if (reverse ? !ln : ln == cm.lineCount() - 1) return; 66 | line = fold(cm.getLine(ln += reverse ? -1 : 1)); 67 | match = target[reverse ? --idx : ++idx]; 68 | if (idx > 0 && idx < target.length - 1) { 69 | if (line != match) return; 70 | else continue; 71 | } 72 | var offsetB = (reverse ? line.lastIndexOf(match) : line.indexOf(match) + match.length); 73 | if (reverse ? offsetB != line.length - match.length : offsetB != match.length) 74 | return; 75 | var start = {line: pos.line, ch: offsetA}, end = {line: ln, ch: offsetB}; 76 | return {from: reverse ? end : start, to: reverse ? start : end}; 77 | } 78 | }; 79 | } 80 | } 81 | } 82 | 83 | SearchCursor.prototype = { 84 | findNext: function() {return this.find(false);}, 85 | findPrevious: function() {return this.find(true);}, 86 | 87 | find: function(reverse) { 88 | var self = this, pos = this.cm.clipPos(reverse ? this.pos.from : this.pos.to); 89 | function savePosAndFail(line) { 90 | var pos = {line: line, ch: 0}; 91 | self.pos = {from: pos, to: pos}; 92 | self.atOccurrence = false; 93 | return false; 94 | } 95 | 96 | for (;;) { 97 | if (this.pos = this.matches(reverse, pos)) { 98 | this.atOccurrence = true; 99 | return this.pos.match || true; 100 | } 101 | if (reverse) { 102 | if (!pos.line) return savePosAndFail(0); 103 | pos = {line: pos.line-1, ch: this.cm.getLine(pos.line-1).length}; 104 | } 105 | else { 106 | var maxLine = this.cm.lineCount(); 107 | if (pos.line == maxLine - 1) return savePosAndFail(maxLine); 108 | pos = {line: pos.line+1, ch: 0}; 109 | } 110 | } 111 | }, 112 | 113 | from: function() {if (this.atOccurrence) return this.pos.from;}, 114 | to: function() {if (this.atOccurrence) return this.pos.to;}, 115 | 116 | replace: function(newText) { 117 | var self = this; 118 | if (this.atOccurrence) 119 | self.pos.to = this.cm.replaceRange(newText, self.pos.from, self.pos.to); 120 | } 121 | }; 122 | 123 | CodeMirror.defineExtension("getSearchCursor", function(query, pos, caseFold) { 124 | return new SearchCursor(this, query, pos, caseFold); 125 | }); 126 | })(); 127 | -------------------------------------------------------------------------------- /resources/CodeEditor/js/show-hint.js: -------------------------------------------------------------------------------- 1 | CodeMirror.showHint = function(cm, getHints, options) { 2 | if (!options) options = {}; 3 | 4 | function collectHints(previousToken) { 5 | // We want a single cursor position. 6 | if (cm.somethingSelected()) return; 7 | 8 | var token = cm.getTokenAt(cm.getCursor()); 9 | 10 | // Don't show completions if token has changed 11 | if (previousToken != null && 12 | (token.start != previousToken.start || token.type != previousToken.type)) 13 | return; 14 | 15 | var result = getHints(cm, options); 16 | if (!result || !result.list.length) return; 17 | var completions = result.list; 18 | // When there is only one completion, use it directly. 19 | if (!previousToken && options.completeSingle !== false && completions.length == 1) { 20 | cm.replaceRange(completions[0], result.from, result.to); 21 | return true; 22 | } 23 | 24 | // Build the select widget 25 | var hints = document.createElement("ul"), selectedHint = 0; 26 | hints.className = "CodeMirror-hints"; 27 | for (var i = 0; i < completions.length; ++i) { 28 | var elt = hints.appendChild(document.createElement("li")); 29 | elt.className = "CodeMirror-hint" + (i ? "" : " CodeMirror-hint-active"); 30 | elt.appendChild(document.createTextNode(completions[i])); 31 | elt.hintId = i; 32 | } 33 | var pos = cm.cursorCoords(options.alignWithWord !== false ? result.from : null); 34 | hints.style.left = pos.left + "px"; 35 | hints.style.top = pos.bottom + "px"; 36 | document.body.appendChild(hints); 37 | 38 | // If we're at the edge of the screen, then we want the menu to appear on the left of the cursor. 39 | var winW = window.innerWidth || Math.max(document.body.offsetWidth, document.documentElement.offsetWidth); 40 | if (winW - pos.left < hints.clientWidth) 41 | hints.style.left = (pos.left - sel.clientWidth) + "px"; 42 | 43 | function changeActive(i) { 44 | if (i < 0 || i >= completions.length || selectedHint == i) return; 45 | hints.childNodes[selectedHint].className = "CodeMirror-hint"; 46 | var node = hints.childNodes[selectedHint = i]; 47 | node.className = "CodeMirror-hint CodeMirror-hint-active"; 48 | if (node.offsetTop < hints.scrollTop) 49 | hints.scrollTop = node.offsetTop - 3; 50 | else if (node.offsetTop + node.offsetHeight > hints.scrollTop + hints.clientHeight) 51 | hints.scrollTop = node.offsetTop + node.offsetHeight - hints.clientHeight + 3; 52 | } 53 | 54 | var ourMap = { 55 | Up: function() {changeActive(selectedHint - 1);}, 56 | Down: function() {changeActive(selectedHint + 1);}, 57 | Enter: pick, 58 | Tab: pick, 59 | Esc: close 60 | }; 61 | if (options.customKeys) for (var key in options.customKeys) if (options.customKeys.hasOwnProperty(key)) { 62 | var val = options.customKeys[key]; 63 | if (/^(Up|Down|Enter|Esc)$/.test(key)) val = ourMap[val]; 64 | ourMap[key] = val; 65 | } 66 | 67 | cm.addKeyMap(ourMap); 68 | cm.on("cursorActivity", cursorActivity); 69 | CodeMirror.on(hints, "dblclick", function(e) { 70 | var t = e.target || e.srcElement; 71 | if (t.hintId != null) {selectedHint = t.hintId; pick();} 72 | setTimeout(function(){cm.focus();}, 20); 73 | }); 74 | CodeMirror.on(hints, "click", function(e) { 75 | var t = e.target || e.srcElement; 76 | if (t.hintId != null) changeActive(t.hintId); 77 | setTimeout(function(){cm.focus();}, 20); 78 | }); 79 | 80 | var done = false, once; 81 | function close() { 82 | if (done) return; 83 | done = true; 84 | clearTimeout(once); 85 | hints.parentNode.removeChild(hints); 86 | cm.removeKeyMap(ourMap); 87 | cm.off("cursorActivity", cursorActivity); 88 | } 89 | function pick() { 90 | cm.replaceRange(completions[selectedHint], result.from, result.to); 91 | close(); 92 | } 93 | var once; 94 | function cursorActivity() { 95 | clearTimeout(once); 96 | once = setTimeout(function(){close(); collectHints(token);}, 70); 97 | } 98 | return true; 99 | } 100 | return collectHints(); 101 | }; 102 | -------------------------------------------------------------------------------- /samples/BasicEditor/assets/shaders/simple.frag: -------------------------------------------------------------------------------- 1 | void main(){ 2 | gl_FragColor = vec4( 1.0, 0.4, 0.6, 1.0 ); 3 | } -------------------------------------------------------------------------------- /samples/BasicEditor/include/Resources.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "cinder/CinderResources.h" 3 | 4 | //#define RES_MY_RES CINDER_RESOURCE( ../resources/, image_name.png, 128, IMAGE ) 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /samples/BasicEditor/resources/CinderApp.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongeilfus/Cinder-CodeEditor/808f4ca85c0ef63f6286b15bf9fc95d94df8fde9/samples/BasicEditor/resources/CinderApp.icns -------------------------------------------------------------------------------- /samples/BasicEditor/resources/cinder_app_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongeilfus/Cinder-CodeEditor/808f4ca85c0ef63f6286b15bf9fc95d94df8fde9/samples/BasicEditor/resources/cinder_app_icon.ico -------------------------------------------------------------------------------- /samples/BasicEditor/src/BasicEditorApp.cpp: -------------------------------------------------------------------------------- 1 | #include "cinder/app/AppNative.h" 2 | #include "cinder/gl/gl.h" 3 | #include "cinder/gl/GlslProg.h" 4 | 5 | #include "CodeEditor.h" 6 | 7 | using namespace ci; 8 | using namespace ci::app; 9 | using namespace std; 10 | 11 | class BasicEditorApp : public AppNative { 12 | public: 13 | void setup(); 14 | void draw(); 15 | 16 | gl::GlslProg mShader; 17 | CodeEditorRef mCodeEditor; 18 | }; 19 | 20 | void BasicEditorApp::setup() 21 | { 22 | 23 | // Create CodeEditor 24 | mCodeEditor = CodeEditor::create( "shaders/simple.frag" ); 25 | 26 | mCodeEditor->registerCodeChanged( "shaders/simple.frag", [this](const string& frag) { 27 | try { 28 | mShader = gl::GlslProg( NULL, frag.c_str() ); 29 | mCodeEditor->clearErrors(); 30 | } 31 | catch( gl::GlslProgCompileExc exc ) { 32 | mCodeEditor->setError( "Simple: " + string( exc.what() ) ); 33 | } 34 | } ); 35 | 36 | } 37 | 38 | 39 | void BasicEditorApp::draw() 40 | { 41 | // clear out the window with black 42 | gl::clear( Color( 0, 0, 0 ) ); 43 | 44 | if( mShader ){ 45 | gl::enableAlphaBlending(); 46 | mShader.bind(); 47 | gl::drawSolidRect( getWindowBounds() ); 48 | mShader.unbind(); 49 | gl::disableAlphaBlending(); 50 | } 51 | } 52 | 53 | CINDER_APP_NATIVE( BasicEditorApp, RendererGl ) 54 | -------------------------------------------------------------------------------- /samples/BasicEditor/vc10/BasicEditor.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 11.00 2 | # Visual C++ Express 2010 3 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BasicEditor", "BasicEditor.vcxproj", "{139A0701-F940-4C93-9AD7-B783E2B7F146}" 4 | EndProject 5 | Global 6 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 7 | Debug|Win32 = Debug|Win32 8 | Release|Win32 = Release|Win32 9 | EndGlobalSection 10 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 11 | {139A0701-F940-4C93-9AD7-B783E2B7F146}.Debug|Win32.ActiveCfg = Debug|Win32 12 | {139A0701-F940-4C93-9AD7-B783E2B7F146}.Debug|Win32.Build.0 = Debug|Win32 13 | {139A0701-F940-4C93-9AD7-B783E2B7F146}.Release|Win32.ActiveCfg = Release|Win32 14 | {139A0701-F940-4C93-9AD7-B783E2B7F146}.Release|Win32.Build.0 = Release|Win32 15 | EndGlobalSection 16 | GlobalSection(SolutionProperties) = preSolution 17 | HideSolutionNode = FALSE 18 | EndGlobalSection 19 | EndGlobal 20 | -------------------------------------------------------------------------------- /samples/BasicEditor/vc10/BasicEditor.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | Win32 6 | 7 | 8 | Release 9 | Win32 10 | 11 | 12 | 13 | {139A0701-F940-4C93-9AD7-B783E2B7F146} 14 | BasicEditor 15 | Win32Proj 16 | 17 | 18 | 19 | Application 20 | Unicode 21 | true 22 | 23 | 24 | Application 25 | Unicode 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | <_ProjectFileVersion>10.0.30319.1 38 | $(SolutionDir)$(Configuration)\ 39 | $(Configuration)\ 40 | true 41 | $(SolutionDir)$(Configuration)\ 42 | $(Configuration)\ 43 | false 44 | 45 | 46 | 47 | Disabled 48 | ..\include;"..\..\..\..\..\\include";"..\..\..\..\..\\boost";..\..\..\..\Cinder-Awesomium\include;..\..\..\include 49 | WIN32;_DEBUG;_WINDOWS;NOMINMAX;%(PreprocessorDefinitions) 50 | true 51 | EnableFastChecks 52 | MultiThreadedDebug 53 | 54 | Level3 55 | EditAndContinue 56 | true 57 | 58 | 59 | "..\..\..\..\..\\include";..\include 60 | 61 | 62 | cinder_d.lib;%(AdditionalDependencies);..\..\..\..\Cinder-Awesomium\build\lib\msw\awesomium.lib 63 | "..\..\..\..\..\\lib";"..\..\..\..\..\\lib\msw" 64 | true 65 | Windows 66 | false 67 | 68 | MachineX86 69 | LIBCMT;LIBCPMT 70 | 71 | 72 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\avcodec-53.dll" "$(OutDir)" 73 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\avformat-53.dll" "$(OutDir)" 74 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\avutil-51.dll" "$(OutDir)" 75 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium.dll" "$(OutDir)" 76 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium_pak_utility.exe" "$(OutDir)" 77 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium_process.exe" "$(OutDir)" 78 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium_process.pdb" "$(OutDir)" 79 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium_symbols.pdb" "$(OutDir)" 80 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\icudt.dll" "$(OutDir)" 81 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\inspector.pak" "$(OutDir)" 82 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\libEGL.dll" "$(OutDir)" 83 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\libGLESv2.dll" "$(OutDir)" 84 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\SDL.dll" "$(OutDir)" 85 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\webui_assets.pak" "$(OutDir)" 86 | xcopy /y "..\..\..\resources\CodeEditor\editor_msw.html" "$(OutDir)" 87 | xcopy /y "..\..\..\resources\CodeEditor\css\codemirror.css" "$(OutDir)" 88 | xcopy /y "..\..\..\resources\CodeEditor\css\dialog.css" "$(OutDir)" 89 | xcopy /y "..\..\..\resources\CodeEditor\css\show-hint.css" "$(OutDir)" 90 | xcopy /y "..\..\..\resources\CodeEditor\css\solarized.css" "$(OutDir)" 91 | xcopy /y "..\..\..\resources\CodeEditor\js\codemirror.js" "$(OutDir)" 92 | xcopy /y "..\..\..\resources\CodeEditor\js\dialog.js" "$(OutDir)" 93 | xcopy /y "..\..\..\resources\CodeEditor\js\glsl-hint.js" "$(OutDir)" 94 | xcopy /y "..\..\..\resources\CodeEditor\js\glsl.js" "$(OutDir)" 95 | xcopy /y "..\..\..\resources\CodeEditor\js\match-highlighter.js" "$(OutDir)" 96 | xcopy /y "..\..\..\resources\CodeEditor\js\search.js" "$(OutDir)" 97 | xcopy /y "..\..\..\resources\CodeEditor\js\searchcursor.js" "$(OutDir)" 98 | xcopy /y "..\..\..\resources\CodeEditor\js\show-hint.js" "$(OutDir)" 99 | xcopy /y "..\..\..\resources\CodeEditor\js\jquery.min.js" "$(OutDir)" 100 | xcopy /y "..\..\..\resources\CodeEditor\js\jquery.color.js" "$(OutDir)" 101 | 102 | 103 | 104 | 105 | ..\include;"..\..\..\..\..\\include";"..\..\..\..\..\\boost";..\..\..\..\Cinder-Awesomium\include;..\..\..\include 106 | WIN32;NDEBUG;_WINDOWS;NOMINMAX;%(PreprocessorDefinitions) 107 | MultiThreaded 108 | 109 | Level3 110 | ProgramDatabase 111 | true 112 | 113 | 114 | true 115 | 116 | 117 | "..\..\..\..\..\\include";..\include 118 | 119 | 120 | cinder.lib;%(AdditionalDependencies);..\..\..\..\Cinder-Awesomium\build\lib\msw\awesomium.lib 121 | "..\..\..\..\..\\lib";"..\..\..\..\..\\lib\msw" 122 | false 123 | true 124 | Windows 125 | true 126 | 127 | false 128 | 129 | MachineX86 130 | 131 | 132 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\avcodec-53.dll" "$(OutDir)" 133 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\avformat-53.dll" "$(OutDir)" 134 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\avutil-51.dll" "$(OutDir)" 135 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium.dll" "$(OutDir)" 136 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium_pak_utility.exe" "$(OutDir)" 137 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium_process.exe" "$(OutDir)" 138 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium_process.pdb" "$(OutDir)" 139 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium_symbols.pdb" "$(OutDir)" 140 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\icudt.dll" "$(OutDir)" 141 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\inspector.pak" "$(OutDir)" 142 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\libEGL.dll" "$(OutDir)" 143 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\libGLESv2.dll" "$(OutDir)" 144 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\SDL.dll" "$(OutDir)" 145 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\webui_assets.pak" "$(OutDir)" 146 | xcopy /y "..\..\..\resources\CodeEditor\editor_msw.html" "$(OutDir)" 147 | xcopy /y "..\..\..\resources\CodeEditor\css\codemirror.css" "$(OutDir)" 148 | xcopy /y "..\..\..\resources\CodeEditor\css\dialog.css" "$(OutDir)" 149 | xcopy /y "..\..\..\resources\CodeEditor\css\show-hint.css" "$(OutDir)" 150 | xcopy /y "..\..\..\resources\CodeEditor\css\solarized.css" "$(OutDir)" 151 | xcopy /y "..\..\..\resources\CodeEditor\js\codemirror.js" "$(OutDir)" 152 | xcopy /y "..\..\..\resources\CodeEditor\js\dialog.js" "$(OutDir)" 153 | xcopy /y "..\..\..\resources\CodeEditor\js\glsl-hint.js" "$(OutDir)" 154 | xcopy /y "..\..\..\resources\CodeEditor\js\glsl.js" "$(OutDir)" 155 | xcopy /y "..\..\..\resources\CodeEditor\js\match-highlighter.js" "$(OutDir)" 156 | xcopy /y "..\..\..\resources\CodeEditor\js\search.js" "$(OutDir)" 157 | xcopy /y "..\..\..\resources\CodeEditor\js\searchcursor.js" "$(OutDir)" 158 | xcopy /y "..\..\..\resources\CodeEditor\js\show-hint.js" "$(OutDir)" 159 | xcopy /y "..\..\..\resources\CodeEditor\js\jquery.min.js" "$(OutDir)" 160 | xcopy /y "..\..\..\resources\CodeEditor\js\jquery.color.js" "$(OutDir)" 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | -------------------------------------------------------------------------------- /samples/BasicEditor/vc10/BasicEditor.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 5 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 6 | 7 | 8 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 9 | h;hpp;hxx;hm;inl;inc;xsd 10 | 11 | 12 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 13 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav 14 | 15 | 16 | {DB07A3C0-68B4-418A-86DB-FE2C60746DE2} 17 | 18 | 19 | {F217377D-F8C5-47C3-AFE0-6D73E2C6FAA3} 20 | 21 | 22 | {0BDA8507-737B-42D4-BA46-958E524E9CAB} 23 | 24 | 25 | {BBD45668-8226-408F-8FAC-125623A31322} 26 | 27 | 28 | {9B03AEDE-6538-48CC-8382-BF1FCF9091A7} 29 | 30 | 31 | 32 | 33 | Source Files 34 | 35 | 36 | Source Files 37 | 38 | 39 | Header Files 40 | 41 | 42 | Blocks\Awesomium\include 43 | 44 | 45 | Blocks\CodeEditor\include 46 | 47 | 48 | Blocks\CodeEditor\include 49 | 50 | 51 | 52 | 53 | Header Files 54 | 55 | 56 | 57 | 58 | Resource Files 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /samples/BasicEditor/vc10/Resources.rc: -------------------------------------------------------------------------------- 1 | #include "../include/Resources.h" 2 | 3 | 1 ICON "..\\resources\\cinder_app_icon.ico" 4 | -------------------------------------------------------------------------------- /samples/BasicEditor/vc11/BasicEditor.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Express 2012 for Windows Desktop 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BasicEditor", "BasicEditor.vcxproj", "{12731FFD-7190-4F5E-8548-C647EE02FCAA}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Release|Win32 = Release|Win32 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {12731FFD-7190-4F5E-8548-C647EE02FCAA}.Debug|Win32.ActiveCfg = Debug|Win32 13 | {12731FFD-7190-4F5E-8548-C647EE02FCAA}.Debug|Win32.Build.0 = Debug|Win32 14 | {12731FFD-7190-4F5E-8548-C647EE02FCAA}.Release|Win32.ActiveCfg = Release|Win32 15 | {12731FFD-7190-4F5E-8548-C647EE02FCAA}.Release|Win32.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /samples/BasicEditor/vc11/BasicEditor.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | Win32 6 | 7 | 8 | Release 9 | Win32 10 | 11 | 12 | 13 | {12731FFD-7190-4F5E-8548-C647EE02FCAA} 14 | BasicEditor 15 | Win32Proj 16 | 17 | 18 | 19 | Application 20 | false 21 | v110_xp 22 | Unicode 23 | true 24 | 25 | 26 | Application 27 | true 28 | v110_xp 29 | Unicode 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | <_ProjectFileVersion>10.0.30319.1 42 | $(SolutionDir)$(Configuration)\ 43 | $(Configuration)\ 44 | true 45 | $(SolutionDir)$(Configuration)\ 46 | $(Configuration)\ 47 | false 48 | 49 | 50 | 51 | Disabled 52 | ..\include;"..\..\..\..\..\\include";"..\..\..\..\..\\boost";..\..\..\..\Cinder-Awesomium\include;..\..\..\include 53 | WIN32;_DEBUG;_WINDOWS;NOMINMAX;%(PreprocessorDefinitions) 54 | true 55 | EnableFastChecks 56 | MultiThreadedDebug 57 | 58 | Level3 59 | EditAndContinue 60 | true 61 | 62 | 63 | "..\..\..\..\..\\include";..\include 64 | 65 | 66 | cinder_d.lib;%(AdditionalDependencies);..\..\..\..\Cinder-Awesomium\build\lib\msw\awesomium.lib 67 | "..\..\..\..\..\\lib";"..\..\..\..\..\\lib\msw" 68 | true 69 | Windows 70 | false 71 | 72 | MachineX86 73 | LIBCMT;LIBCPMT 74 | 75 | 76 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\avcodec-53.dll" "$(OutDir)" 77 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\avformat-53.dll" "$(OutDir)" 78 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\avutil-51.dll" "$(OutDir)" 79 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium.dll" "$(OutDir)" 80 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium_pak_utility.exe" "$(OutDir)" 81 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium_process.exe" "$(OutDir)" 82 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium_process.pdb" "$(OutDir)" 83 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium_symbols.pdb" "$(OutDir)" 84 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\icudt.dll" "$(OutDir)" 85 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\inspector.pak" "$(OutDir)" 86 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\libEGL.dll" "$(OutDir)" 87 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\libGLESv2.dll" "$(OutDir)" 88 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\SDL.dll" "$(OutDir)" 89 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\webui_assets.pak" "$(OutDir)" 90 | xcopy /y "..\..\..\resources\CodeEditor\editor_msw.html" "$(OutDir)" 91 | xcopy /y "..\..\..\resources\CodeEditor\css\codemirror.css" "$(OutDir)" 92 | xcopy /y "..\..\..\resources\CodeEditor\css\dialog.css" "$(OutDir)" 93 | xcopy /y "..\..\..\resources\CodeEditor\css\show-hint.css" "$(OutDir)" 94 | xcopy /y "..\..\..\resources\CodeEditor\css\solarized.css" "$(OutDir)" 95 | xcopy /y "..\..\..\resources\CodeEditor\js\codemirror.js" "$(OutDir)" 96 | xcopy /y "..\..\..\resources\CodeEditor\js\dialog.js" "$(OutDir)" 97 | xcopy /y "..\..\..\resources\CodeEditor\js\glsl-hint.js" "$(OutDir)" 98 | xcopy /y "..\..\..\resources\CodeEditor\js\glsl.js" "$(OutDir)" 99 | xcopy /y "..\..\..\resources\CodeEditor\js\match-highlighter.js" "$(OutDir)" 100 | xcopy /y "..\..\..\resources\CodeEditor\js\search.js" "$(OutDir)" 101 | xcopy /y "..\..\..\resources\CodeEditor\js\searchcursor.js" "$(OutDir)" 102 | xcopy /y "..\..\..\resources\CodeEditor\js\show-hint.js" "$(OutDir)" 103 | xcopy /y "..\..\..\resources\CodeEditor\js\jquery.min.js" "$(OutDir)" 104 | xcopy /y "..\..\..\resources\CodeEditor\js\jquery.color.js" "$(OutDir)" 105 | 106 | 107 | 108 | 109 | ..\include;"..\..\..\..\..\\include";"..\..\..\..\..\\boost";..\..\..\..\Cinder-Awesomium\include;..\..\..\include 110 | WIN32;NDEBUG;_WINDOWS;NOMINMAX;%(PreprocessorDefinitions) 111 | MultiThreaded 112 | 113 | Level3 114 | ProgramDatabase 115 | true 116 | 117 | 118 | true 119 | 120 | 121 | "..\..\..\..\..\\include";..\include 122 | 123 | 124 | cinder.lib;%(AdditionalDependencies);..\..\..\..\Cinder-Awesomium\build\lib\msw\awesomium.lib 125 | "..\..\..\..\..\\lib";"..\..\..\..\..\\lib\msw" 126 | false 127 | true 128 | Windows 129 | true 130 | 131 | false 132 | 133 | MachineX86 134 | 135 | 136 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\avcodec-53.dll" "$(OutDir)" 137 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\avformat-53.dll" "$(OutDir)" 138 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\avutil-51.dll" "$(OutDir)" 139 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium.dll" "$(OutDir)" 140 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium_pak_utility.exe" "$(OutDir)" 141 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium_process.exe" "$(OutDir)" 142 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium_process.pdb" "$(OutDir)" 143 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium_symbols.pdb" "$(OutDir)" 144 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\icudt.dll" "$(OutDir)" 145 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\inspector.pak" "$(OutDir)" 146 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\libEGL.dll" "$(OutDir)" 147 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\libGLESv2.dll" "$(OutDir)" 148 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\SDL.dll" "$(OutDir)" 149 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\webui_assets.pak" "$(OutDir)" 150 | xcopy /y "..\..\..\resources\CodeEditor\editor_msw.html" "$(OutDir)" 151 | xcopy /y "..\..\..\resources\CodeEditor\css\codemirror.css" "$(OutDir)" 152 | xcopy /y "..\..\..\resources\CodeEditor\css\dialog.css" "$(OutDir)" 153 | xcopy /y "..\..\..\resources\CodeEditor\css\show-hint.css" "$(OutDir)" 154 | xcopy /y "..\..\..\resources\CodeEditor\css\solarized.css" "$(OutDir)" 155 | xcopy /y "..\..\..\resources\CodeEditor\js\codemirror.js" "$(OutDir)" 156 | xcopy /y "..\..\..\resources\CodeEditor\js\dialog.js" "$(OutDir)" 157 | xcopy /y "..\..\..\resources\CodeEditor\js\glsl-hint.js" "$(OutDir)" 158 | xcopy /y "..\..\..\resources\CodeEditor\js\glsl.js" "$(OutDir)" 159 | xcopy /y "..\..\..\resources\CodeEditor\js\match-highlighter.js" "$(OutDir)" 160 | xcopy /y "..\..\..\resources\CodeEditor\js\search.js" "$(OutDir)" 161 | xcopy /y "..\..\..\resources\CodeEditor\js\searchcursor.js" "$(OutDir)" 162 | xcopy /y "..\..\..\resources\CodeEditor\js\show-hint.js" "$(OutDir)" 163 | xcopy /y "..\..\..\resources\CodeEditor\js\jquery.min.js" "$(OutDir)" 164 | xcopy /y "..\..\..\resources\CodeEditor\js\jquery.color.js" "$(OutDir)" 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | -------------------------------------------------------------------------------- /samples/BasicEditor/vc11/BasicEditor.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 5 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 6 | 7 | 8 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 9 | h;hpp;hxx;hm;inl;inc;xsd 10 | 11 | 12 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 13 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav 14 | 15 | 16 | {CFAF4214-30D5-4AF4-9012-D5E1B8EEFD06} 17 | 18 | 19 | {A9FC715D-A97F-4456-AB2B-739B6911AAFD} 20 | 21 | 22 | {B3358EA7-E3EC-4944-893E-2005888A9373} 23 | 24 | 25 | {5A810FB8-AC75-4244-8BC4-0A1BF9C4260F} 26 | 27 | 28 | {F7038D16-6314-48BC-B544-12D894F01F1C} 29 | 30 | 31 | 32 | 33 | Source Files 34 | 35 | 36 | Source Files 37 | 38 | 39 | Header Files 40 | 41 | 42 | Blocks\Awesomium\include 43 | 44 | 45 | Blocks\CodeEditor\include 46 | 47 | 48 | Blocks\CodeEditor\include 49 | 50 | 51 | 52 | 53 | Header Files 54 | 55 | 56 | 57 | 58 | Resource Files 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /samples/BasicEditor/vc11/Resources.rc: -------------------------------------------------------------------------------- 1 | #include "../include/Resources.h" 2 | 3 | 1 ICON "..\\resources\\cinder_app_icon.ico" 4 | -------------------------------------------------------------------------------- /samples/BasicEditor/xcode/BasicEditor_Prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | #if defined( __cplusplus ) 6 | #include "cinder/Cinder.h" 7 | 8 | #include "cinder/app/AppBasic.h" 9 | 10 | #include "cinder/gl/gl.h" 11 | 12 | #include "cinder/CinderMath.h" 13 | #include "cinder/Matrix.h" 14 | #include "cinder/Vector.h" 15 | #include "cinder/Quaternion.h" 16 | #endif 17 | -------------------------------------------------------------------------------- /samples/BasicEditor/xcode/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | CinderApp.icns 11 | CFBundleIdentifier 12 | org.libcinder.BasicEditor 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | NSMainNibFile 24 | MainMenu 25 | NSPrincipalClass 26 | NSApplication 27 | 28 | 29 | -------------------------------------------------------------------------------- /samples/MultiWindow/assets/SphereShader.frag: -------------------------------------------------------------------------------- 1 | void main(){ 2 | gl_FragColor = vec4( 0.3, 0.2, 0.9, 1.0 ); 3 | } -------------------------------------------------------------------------------- /samples/MultiWindow/assets/SphereShader.vert: -------------------------------------------------------------------------------- 1 | void main(){ 2 | gl_Position = ftransform(); 3 | } -------------------------------------------------------------------------------- /samples/MultiWindow/include/Resources.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "cinder/CinderResources.h" 3 | 4 | //#define RES_MY_RES CINDER_RESOURCE( ../resources/, image_name.png, 128, IMAGE ) 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /samples/MultiWindow/resources/CinderApp.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongeilfus/Cinder-CodeEditor/808f4ca85c0ef63f6286b15bf9fc95d94df8fde9/samples/MultiWindow/resources/CinderApp.icns -------------------------------------------------------------------------------- /samples/MultiWindow/resources/cinder_app_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongeilfus/Cinder-CodeEditor/808f4ca85c0ef63f6286b15bf9fc95d94df8fde9/samples/MultiWindow/resources/cinder_app_icon.ico -------------------------------------------------------------------------------- /samples/MultiWindow/src/MultiWindowApp.cpp: -------------------------------------------------------------------------------- 1 | #include "cinder/app/AppNative.h" 2 | #include "cinder/gl/gl.h" 3 | #include "cinder/gl/GlslProg.h" 4 | 5 | #include "CodeEditor.h" 6 | 7 | // VisualStudio does'nt seem to support initializer_list 8 | // yet so let's use boost::assign::list_of instead 9 | #if defined( CINDER_MSW ) 10 | #include "boost/assign/list_of.hpp" 11 | using namespace boost::assign; 12 | #endif 13 | 14 | 15 | using namespace ci; 16 | using namespace ci::app; 17 | using namespace std; 18 | 19 | class MultiWindowApp : public AppNative { 20 | public: 21 | void setup(); 22 | void drawMain(); 23 | void keyDown( KeyEvent event ); 24 | 25 | gl::GlslProg mShader; 26 | CodeEditorRef mCodeEditor; 27 | }; 28 | 29 | void MultiWindowApp::setup() 30 | { 31 | // Create secondary window 32 | WindowRef editorWindow = createWindow( Window::Format().size( 500, 180 ) ); 33 | editorWindow->getSignalDraw().connect( [this](){ gl::clear( ColorA::gray( 0.85f ) ); } ); 34 | editorWindow->setPos( getWindowIndex(0)->getPos() - Vec2i( 510, 0 ) ); 35 | 36 | // Connect main draw to main window 37 | getWindowIndex(0)->connectDraw( &MultiWindowApp::drawMain, this ); 38 | 39 | // Create CodeEditor 40 | #if defined( CINDER_MSW ) 41 | mCodeEditor = CodeEditor::create( list_of( "SphereShader.vert" )( "SphereShader.frag").convert_to_container>(), CodeEditor::Settings().lineNumbers().autoSave() ); 42 | #else 43 | mCodeEditor = CodeEditor::create( { "SphereShader.vert", "SphereShader.frag" }, CodeEditor::Settings().lineNumbers().autoSave() ); 44 | #endif 45 | 46 | mCodeEditor->registerCodeChanged( "SphereShader.vert", "SphereShader.frag", [this](const string& vert,const string& frag) { 47 | try { 48 | mShader = gl::GlslProg( vert.c_str(), frag.c_str() ); 49 | mCodeEditor->clearErrors(); 50 | } 51 | catch( gl::GlslProgCompileExc exc ) { 52 | mCodeEditor->setError( "Sphere: " + string( exc.what() ) ); 53 | } 54 | } ); 55 | } 56 | 57 | void MultiWindowApp::drawMain() 58 | { 59 | gl::clear( Color( 1, 1, 1 ) ); 60 | 61 | if( mShader ){ 62 | gl::enableAlphaBlending(); 63 | gl::enableWireframe(); 64 | 65 | mShader.bind(); 66 | gl::drawSphere( Vec3f( getWindowCenter().x, getWindowCenter().y, 0.0f ), 150.0f ); 67 | mShader.unbind(); 68 | 69 | gl::disableWireframe(); 70 | gl::disableAlphaBlending(); 71 | } 72 | } 73 | 74 | 75 | void MultiWindowApp::keyDown( KeyEvent event ) 76 | { 77 | if( event.isAccelDown() && event.getCode() == KeyEvent::KEY_RETURN ){ 78 | mCodeEditor->blur(); 79 | setFullScreen( !isFullScreen() ); 80 | } 81 | } 82 | 83 | CINDER_APP_NATIVE( MultiWindowApp, RendererGl ) 84 | -------------------------------------------------------------------------------- /samples/MultiWindow/vc10/MultiWindow.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 11.00 2 | # Visual C++ Express 2010 3 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MultiWindow", "MultiWindow.vcxproj", "{1FD1F5A1-5B2F-4857-82BB-F023E367B68C}" 4 | EndProject 5 | Global 6 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 7 | Debug|Win32 = Debug|Win32 8 | Release|Win32 = Release|Win32 9 | EndGlobalSection 10 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 11 | {1FD1F5A1-5B2F-4857-82BB-F023E367B68C}.Debug|Win32.ActiveCfg = Debug|Win32 12 | {1FD1F5A1-5B2F-4857-82BB-F023E367B68C}.Debug|Win32.Build.0 = Debug|Win32 13 | {1FD1F5A1-5B2F-4857-82BB-F023E367B68C}.Release|Win32.ActiveCfg = Release|Win32 14 | {1FD1F5A1-5B2F-4857-82BB-F023E367B68C}.Release|Win32.Build.0 = Release|Win32 15 | EndGlobalSection 16 | GlobalSection(SolutionProperties) = preSolution 17 | HideSolutionNode = FALSE 18 | EndGlobalSection 19 | EndGlobal 20 | -------------------------------------------------------------------------------- /samples/MultiWindow/vc10/MultiWindow.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | Win32 6 | 7 | 8 | Release 9 | Win32 10 | 11 | 12 | 13 | {1FD1F5A1-5B2F-4857-82BB-F023E367B68C} 14 | MultiWindow 15 | Win32Proj 16 | 17 | 18 | 19 | Application 20 | Unicode 21 | true 22 | 23 | 24 | Application 25 | Unicode 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | <_ProjectFileVersion>10.0.30319.1 38 | $(SolutionDir)$(Configuration)\ 39 | $(Configuration)\ 40 | true 41 | $(SolutionDir)$(Configuration)\ 42 | $(Configuration)\ 43 | false 44 | 45 | 46 | 47 | Disabled 48 | ..\include;"..\..\..\..\..\\include";"..\..\..\..\..\\boost";..\..\..\..\Cinder-Awesomium\include;..\..\..\include 49 | WIN32;_DEBUG;_WINDOWS;NOMINMAX;%(PreprocessorDefinitions) 50 | true 51 | EnableFastChecks 52 | MultiThreadedDebug 53 | 54 | Level3 55 | EditAndContinue 56 | true 57 | 58 | 59 | "..\..\..\..\..\\include";..\include 60 | 61 | 62 | cinder_d.lib;%(AdditionalDependencies);..\..\..\..\Cinder-Awesomium\build\lib\msw\awesomium.lib 63 | "..\..\..\..\..\\lib";"..\..\..\..\..\\lib\msw" 64 | true 65 | Windows 66 | false 67 | 68 | MachineX86 69 | LIBCMT;LIBCPMT 70 | 71 | 72 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\avcodec-53.dll" "$(OutDir)" 73 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\avformat-53.dll" "$(OutDir)" 74 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\avutil-51.dll" "$(OutDir)" 75 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium.dll" "$(OutDir)" 76 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium_pak_utility.exe" "$(OutDir)" 77 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium_process.exe" "$(OutDir)" 78 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium_process.pdb" "$(OutDir)" 79 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium_symbols.pdb" "$(OutDir)" 80 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\icudt.dll" "$(OutDir)" 81 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\inspector.pak" "$(OutDir)" 82 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\libEGL.dll" "$(OutDir)" 83 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\libGLESv2.dll" "$(OutDir)" 84 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\SDL.dll" "$(OutDir)" 85 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\webui_assets.pak" "$(OutDir)" 86 | xcopy /y "..\..\..\resources\CodeEditor\editor_msw.html" "$(OutDir)" 87 | xcopy /y "..\..\..\resources\CodeEditor\css\codemirror.css" "$(OutDir)" 88 | xcopy /y "..\..\..\resources\CodeEditor\css\dialog.css" "$(OutDir)" 89 | xcopy /y "..\..\..\resources\CodeEditor\css\show-hint.css" "$(OutDir)" 90 | xcopy /y "..\..\..\resources\CodeEditor\css\solarized.css" "$(OutDir)" 91 | xcopy /y "..\..\..\resources\CodeEditor\js\codemirror.js" "$(OutDir)" 92 | xcopy /y "..\..\..\resources\CodeEditor\js\dialog.js" "$(OutDir)" 93 | xcopy /y "..\..\..\resources\CodeEditor\js\glsl-hint.js" "$(OutDir)" 94 | xcopy /y "..\..\..\resources\CodeEditor\js\glsl.js" "$(OutDir)" 95 | xcopy /y "..\..\..\resources\CodeEditor\js\match-highlighter.js" "$(OutDir)" 96 | xcopy /y "..\..\..\resources\CodeEditor\js\search.js" "$(OutDir)" 97 | xcopy /y "..\..\..\resources\CodeEditor\js\searchcursor.js" "$(OutDir)" 98 | xcopy /y "..\..\..\resources\CodeEditor\js\show-hint.js" "$(OutDir)" 99 | xcopy /y "..\..\..\resources\CodeEditor\js\jquery.min.js" "$(OutDir)" 100 | xcopy /y "..\..\..\resources\CodeEditor\js\jquery.color.js" "$(OutDir)" 101 | 102 | 103 | 104 | 105 | ..\include;"..\..\..\..\..\\include";"..\..\..\..\..\\boost";..\..\..\..\Cinder-Awesomium\include;..\..\..\include 106 | WIN32;NDEBUG;_WINDOWS;NOMINMAX;%(PreprocessorDefinitions) 107 | MultiThreaded 108 | 109 | Level3 110 | ProgramDatabase 111 | true 112 | 113 | 114 | true 115 | 116 | 117 | "..\..\..\..\..\\include";..\include 118 | 119 | 120 | cinder.lib;%(AdditionalDependencies);..\..\..\..\Cinder-Awesomium\build\lib\msw\awesomium.lib 121 | "..\..\..\..\..\\lib";"..\..\..\..\..\\lib\msw" 122 | false 123 | true 124 | Windows 125 | true 126 | 127 | false 128 | 129 | MachineX86 130 | 131 | 132 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\avcodec-53.dll" "$(OutDir)" 133 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\avformat-53.dll" "$(OutDir)" 134 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\avutil-51.dll" "$(OutDir)" 135 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium.dll" "$(OutDir)" 136 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium_pak_utility.exe" "$(OutDir)" 137 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium_process.exe" "$(OutDir)" 138 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium_process.pdb" "$(OutDir)" 139 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium_symbols.pdb" "$(OutDir)" 140 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\icudt.dll" "$(OutDir)" 141 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\inspector.pak" "$(OutDir)" 142 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\libEGL.dll" "$(OutDir)" 143 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\libGLESv2.dll" "$(OutDir)" 144 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\SDL.dll" "$(OutDir)" 145 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\webui_assets.pak" "$(OutDir)" 146 | xcopy /y "..\..\..\resources\CodeEditor\editor_msw.html" "$(OutDir)" 147 | xcopy /y "..\..\..\resources\CodeEditor\css\codemirror.css" "$(OutDir)" 148 | xcopy /y "..\..\..\resources\CodeEditor\css\dialog.css" "$(OutDir)" 149 | xcopy /y "..\..\..\resources\CodeEditor\css\show-hint.css" "$(OutDir)" 150 | xcopy /y "..\..\..\resources\CodeEditor\css\solarized.css" "$(OutDir)" 151 | xcopy /y "..\..\..\resources\CodeEditor\js\codemirror.js" "$(OutDir)" 152 | xcopy /y "..\..\..\resources\CodeEditor\js\dialog.js" "$(OutDir)" 153 | xcopy /y "..\..\..\resources\CodeEditor\js\glsl-hint.js" "$(OutDir)" 154 | xcopy /y "..\..\..\resources\CodeEditor\js\glsl.js" "$(OutDir)" 155 | xcopy /y "..\..\..\resources\CodeEditor\js\match-highlighter.js" "$(OutDir)" 156 | xcopy /y "..\..\..\resources\CodeEditor\js\search.js" "$(OutDir)" 157 | xcopy /y "..\..\..\resources\CodeEditor\js\searchcursor.js" "$(OutDir)" 158 | xcopy /y "..\..\..\resources\CodeEditor\js\show-hint.js" "$(OutDir)" 159 | xcopy /y "..\..\..\resources\CodeEditor\js\jquery.min.js" "$(OutDir)" 160 | xcopy /y "..\..\..\resources\CodeEditor\js\jquery.color.js" "$(OutDir)" 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | -------------------------------------------------------------------------------- /samples/MultiWindow/vc10/MultiWindow.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 5 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 6 | 7 | 8 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 9 | h;hpp;hxx;hm;inl;inc;xsd 10 | 11 | 12 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 13 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav 14 | 15 | 16 | {9724D997-291F-45E9-B51C-3CCA0D40345A} 17 | 18 | 19 | {84134609-6004-4A74-A98B-137A45718EA0} 20 | 21 | 22 | {DF20ED21-EACE-458D-AF7B-1FC2272D4214} 23 | 24 | 25 | {70BD1587-3DEA-4E7A-9927-7EF5DE5BC743} 26 | 27 | 28 | {92AB2111-4A31-464A-A540-AEB0B08012CB} 29 | 30 | 31 | 32 | 33 | Source Files 34 | 35 | 36 | Source Files 37 | 38 | 39 | Header Files 40 | 41 | 42 | Blocks\Awesomium\include 43 | 44 | 45 | Blocks\CodeEditor\include 46 | 47 | 48 | Blocks\CodeEditor\include 49 | 50 | 51 | 52 | 53 | Header Files 54 | 55 | 56 | 57 | 58 | Resource Files 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /samples/MultiWindow/vc10/Resources.rc: -------------------------------------------------------------------------------- 1 | #include "../include/Resources.h" 2 | 3 | 1 ICON "..\\resources\\cinder_app_icon.ico" 4 | -------------------------------------------------------------------------------- /samples/MultiWindow/vc11/MultiWindow.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Express 2012 for Windows Desktop 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MultiWindow", "MultiWindow.vcxproj", "{3F4F4450-A017-4673-BA9B-1263B6D316ED}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Release|Win32 = Release|Win32 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {3F4F4450-A017-4673-BA9B-1263B6D316ED}.Debug|Win32.ActiveCfg = Debug|Win32 13 | {3F4F4450-A017-4673-BA9B-1263B6D316ED}.Debug|Win32.Build.0 = Debug|Win32 14 | {3F4F4450-A017-4673-BA9B-1263B6D316ED}.Release|Win32.ActiveCfg = Release|Win32 15 | {3F4F4450-A017-4673-BA9B-1263B6D316ED}.Release|Win32.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /samples/MultiWindow/vc11/MultiWindow.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | Win32 6 | 7 | 8 | Release 9 | Win32 10 | 11 | 12 | 13 | {3F4F4450-A017-4673-BA9B-1263B6D316ED} 14 | MultiWindow 15 | Win32Proj 16 | 17 | 18 | 19 | Application 20 | false 21 | v110_xp 22 | Unicode 23 | true 24 | 25 | 26 | Application 27 | true 28 | v110_xp 29 | Unicode 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | <_ProjectFileVersion>10.0.30319.1 42 | $(SolutionDir)$(Configuration)\ 43 | $(Configuration)\ 44 | true 45 | $(SolutionDir)$(Configuration)\ 46 | $(Configuration)\ 47 | false 48 | 49 | 50 | 51 | Disabled 52 | ..\include;"..\..\..\..\..\\include";"..\..\..\..\..\\boost";..\..\..\..\Cinder-Awesomium\include;..\..\..\include 53 | WIN32;_DEBUG;_WINDOWS;NOMINMAX;%(PreprocessorDefinitions) 54 | true 55 | EnableFastChecks 56 | MultiThreadedDebug 57 | 58 | Level3 59 | EditAndContinue 60 | true 61 | 62 | 63 | "..\..\..\..\..\\include";..\include 64 | 65 | 66 | cinder_d.lib;%(AdditionalDependencies);..\..\..\..\Cinder-Awesomium\build\lib\msw\awesomium.lib 67 | "..\..\..\..\..\\lib";"..\..\..\..\..\\lib\msw" 68 | true 69 | Windows 70 | false 71 | 72 | MachineX86 73 | LIBCMT;LIBCPMT 74 | 75 | 76 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\avcodec-53.dll" "$(OutDir)" 77 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\avformat-53.dll" "$(OutDir)" 78 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\avutil-51.dll" "$(OutDir)" 79 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium.dll" "$(OutDir)" 80 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium_pak_utility.exe" "$(OutDir)" 81 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium_process.exe" "$(OutDir)" 82 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium_process.pdb" "$(OutDir)" 83 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium_symbols.pdb" "$(OutDir)" 84 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\icudt.dll" "$(OutDir)" 85 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\inspector.pak" "$(OutDir)" 86 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\libEGL.dll" "$(OutDir)" 87 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\libGLESv2.dll" "$(OutDir)" 88 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\SDL.dll" "$(OutDir)" 89 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\webui_assets.pak" "$(OutDir)" 90 | xcopy /y "..\..\..\resources\CodeEditor\editor_msw.html" "$(OutDir)" 91 | xcopy /y "..\..\..\resources\CodeEditor\css\codemirror.css" "$(OutDir)" 92 | xcopy /y "..\..\..\resources\CodeEditor\css\dialog.css" "$(OutDir)" 93 | xcopy /y "..\..\..\resources\CodeEditor\css\show-hint.css" "$(OutDir)" 94 | xcopy /y "..\..\..\resources\CodeEditor\css\solarized.css" "$(OutDir)" 95 | xcopy /y "..\..\..\resources\CodeEditor\js\codemirror.js" "$(OutDir)" 96 | xcopy /y "..\..\..\resources\CodeEditor\js\dialog.js" "$(OutDir)" 97 | xcopy /y "..\..\..\resources\CodeEditor\js\glsl-hint.js" "$(OutDir)" 98 | xcopy /y "..\..\..\resources\CodeEditor\js\glsl.js" "$(OutDir)" 99 | xcopy /y "..\..\..\resources\CodeEditor\js\match-highlighter.js" "$(OutDir)" 100 | xcopy /y "..\..\..\resources\CodeEditor\js\search.js" "$(OutDir)" 101 | xcopy /y "..\..\..\resources\CodeEditor\js\searchcursor.js" "$(OutDir)" 102 | xcopy /y "..\..\..\resources\CodeEditor\js\show-hint.js" "$(OutDir)" 103 | xcopy /y "..\..\..\resources\CodeEditor\js\jquery.min.js" "$(OutDir)" 104 | xcopy /y "..\..\..\resources\CodeEditor\js\jquery.color.js" "$(OutDir)" 105 | 106 | 107 | 108 | 109 | ..\include;"..\..\..\..\..\\include";"..\..\..\..\..\\boost";..\..\..\..\Cinder-Awesomium\include;..\..\..\include 110 | WIN32;NDEBUG;_WINDOWS;NOMINMAX;%(PreprocessorDefinitions) 111 | MultiThreaded 112 | 113 | Level3 114 | ProgramDatabase 115 | true 116 | 117 | 118 | true 119 | 120 | 121 | "..\..\..\..\..\\include";..\include 122 | 123 | 124 | cinder.lib;%(AdditionalDependencies);..\..\..\..\Cinder-Awesomium\build\lib\msw\awesomium.lib 125 | "..\..\..\..\..\\lib";"..\..\..\..\..\\lib\msw" 126 | false 127 | true 128 | Windows 129 | true 130 | 131 | false 132 | 133 | MachineX86 134 | 135 | 136 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\avcodec-53.dll" "$(OutDir)" 137 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\avformat-53.dll" "$(OutDir)" 138 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\avutil-51.dll" "$(OutDir)" 139 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium.dll" "$(OutDir)" 140 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium_pak_utility.exe" "$(OutDir)" 141 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium_process.exe" "$(OutDir)" 142 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium_process.pdb" "$(OutDir)" 143 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium_symbols.pdb" "$(OutDir)" 144 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\icudt.dll" "$(OutDir)" 145 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\inspector.pak" "$(OutDir)" 146 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\libEGL.dll" "$(OutDir)" 147 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\libGLESv2.dll" "$(OutDir)" 148 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\SDL.dll" "$(OutDir)" 149 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\webui_assets.pak" "$(OutDir)" 150 | xcopy /y "..\..\..\resources\CodeEditor\editor_msw.html" "$(OutDir)" 151 | xcopy /y "..\..\..\resources\CodeEditor\css\codemirror.css" "$(OutDir)" 152 | xcopy /y "..\..\..\resources\CodeEditor\css\dialog.css" "$(OutDir)" 153 | xcopy /y "..\..\..\resources\CodeEditor\css\show-hint.css" "$(OutDir)" 154 | xcopy /y "..\..\..\resources\CodeEditor\css\solarized.css" "$(OutDir)" 155 | xcopy /y "..\..\..\resources\CodeEditor\js\codemirror.js" "$(OutDir)" 156 | xcopy /y "..\..\..\resources\CodeEditor\js\dialog.js" "$(OutDir)" 157 | xcopy /y "..\..\..\resources\CodeEditor\js\glsl-hint.js" "$(OutDir)" 158 | xcopy /y "..\..\..\resources\CodeEditor\js\glsl.js" "$(OutDir)" 159 | xcopy /y "..\..\..\resources\CodeEditor\js\match-highlighter.js" "$(OutDir)" 160 | xcopy /y "..\..\..\resources\CodeEditor\js\search.js" "$(OutDir)" 161 | xcopy /y "..\..\..\resources\CodeEditor\js\searchcursor.js" "$(OutDir)" 162 | xcopy /y "..\..\..\resources\CodeEditor\js\show-hint.js" "$(OutDir)" 163 | xcopy /y "..\..\..\resources\CodeEditor\js\jquery.min.js" "$(OutDir)" 164 | xcopy /y "..\..\..\resources\CodeEditor\js\jquery.color.js" "$(OutDir)" 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | -------------------------------------------------------------------------------- /samples/MultiWindow/vc11/MultiWindow.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 5 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 6 | 7 | 8 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 9 | h;hpp;hxx;hm;inl;inc;xsd 10 | 11 | 12 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 13 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav 14 | 15 | 16 | {5638FA3B-C450-4078-9854-C7DE751BE290} 17 | 18 | 19 | {C7D33107-0861-43AD-BB87-94BF75CF7749} 20 | 21 | 22 | {1014F6C3-C7FD-4572-B749-E019C6826CB3} 23 | 24 | 25 | {25EA1ABF-129B-44D9-B1F9-DD6F16F55791} 26 | 27 | 28 | {0E389171-CB78-41CE-856A-FD46F0B2149A} 29 | 30 | 31 | 32 | 33 | Source Files 34 | 35 | 36 | Source Files 37 | 38 | 39 | Header Files 40 | 41 | 42 | Blocks\Awesomium\include 43 | 44 | 45 | Blocks\CodeEditor\include 46 | 47 | 48 | Blocks\CodeEditor\include 49 | 50 | 51 | 52 | 53 | Header Files 54 | 55 | 56 | 57 | 58 | Resource Files 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /samples/MultiWindow/vc11/Resources.rc: -------------------------------------------------------------------------------- 1 | #include "../include/Resources.h" 2 | 3 | 1 ICON "..\\resources\\cinder_app_icon.ico" 4 | -------------------------------------------------------------------------------- /samples/MultiWindow/xcode/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | CinderApp.icns 11 | CFBundleIdentifier 12 | org.libcinder.MultiWindow 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | NSMainNibFile 24 | MainMenu 25 | NSPrincipalClass 26 | NSApplication 27 | 28 | 29 | -------------------------------------------------------------------------------- /samples/MultiWindow/xcode/MultiWindow_Prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | #if defined( __cplusplus ) 6 | #include "cinder/Cinder.h" 7 | 8 | #include "cinder/app/AppBasic.h" 9 | 10 | #include "cinder/gl/gl.h" 11 | 12 | #include "cinder/CinderMath.h" 13 | #include "cinder/Matrix.h" 14 | #include "cinder/Vector.h" 15 | #include "cinder/Quaternion.h" 16 | #endif 17 | -------------------------------------------------------------------------------- /samples/MultipleFiles/assets/SphereShader.frag: -------------------------------------------------------------------------------- 1 | void main(){ 2 | gl_FragColor = vec4( 0.3, 0.6, 0.8, 1.0 ); 3 | } -------------------------------------------------------------------------------- /samples/MultipleFiles/assets/SphereShader.vert: -------------------------------------------------------------------------------- 1 | void main(){ 2 | gl_Position = ftransform(); 3 | } -------------------------------------------------------------------------------- /samples/MultipleFiles/include/Resources.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "cinder/CinderResources.h" 3 | 4 | //#define RES_MY_RES CINDER_RESOURCE( ../resources/, image_name.png, 128, IMAGE ) 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /samples/MultipleFiles/resources/CinderApp.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongeilfus/Cinder-CodeEditor/808f4ca85c0ef63f6286b15bf9fc95d94df8fde9/samples/MultipleFiles/resources/CinderApp.icns -------------------------------------------------------------------------------- /samples/MultipleFiles/resources/cinder_app_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongeilfus/Cinder-CodeEditor/808f4ca85c0ef63f6286b15bf9fc95d94df8fde9/samples/MultipleFiles/resources/cinder_app_icon.ico -------------------------------------------------------------------------------- /samples/MultipleFiles/src/MultipleFilesApp.cpp: -------------------------------------------------------------------------------- 1 | #include "cinder/app/AppNative.h" 2 | #include "cinder/gl/gl.h" 3 | #include "cinder/gl/GlslProg.h" 4 | 5 | #include "CodeEditor.h" 6 | 7 | // VisualStudio does'nt seem to support initializer_list 8 | // yet so let's use boost::assign::list_of instead 9 | #if defined( CINDER_MSW ) 10 | #include "boost/assign/list_of.hpp" 11 | using namespace boost::assign; 12 | #endif 13 | 14 | 15 | using namespace ci; 16 | using namespace ci::app; 17 | using namespace std; 18 | 19 | class MultipleFilesApp : public AppNative { 20 | public: 21 | void setup(); 22 | void draw(); 23 | 24 | gl::GlslProg mShader; 25 | CodeEditorRef mCodeEditor; 26 | }; 27 | 28 | void MultipleFilesApp::setup() 29 | { 30 | // Create CodeEditor 31 | #if defined( CINDER_MSW ) 32 | mCodeEditor = CodeEditor::create( list_of( "SphereShader.vert" )( "SphereShader.frag").convert_to_container>(), CodeEditor::Settings().lineNumbers().autoSave() ); 33 | #else 34 | mCodeEditor = CodeEditor::create( { "SphereShader.vert", "SphereShader.frag" }, CodeEditor::Settings().lineNumbers().autoSave() ); 35 | #endif 36 | 37 | mCodeEditor->registerCodeChanged( "SphereShader.vert", "SphereShader.frag", [this](const string& vert,const string& frag) { 38 | try { 39 | mShader = gl::GlslProg( vert.c_str(), frag.c_str() ); 40 | mCodeEditor->clearErrors(); 41 | } 42 | catch( gl::GlslProgCompileExc exc ) { 43 | mCodeEditor->setError( "Sphere: " + string( exc.what() ) ); 44 | } 45 | } ); 46 | 47 | } 48 | 49 | void MultipleFilesApp::draw() 50 | { 51 | gl::clear( Color( 1, 1, 1 ) ); 52 | 53 | if( mShader ){ 54 | gl::enableAlphaBlending(); 55 | gl::enableWireframe(); 56 | 57 | mShader.bind(); 58 | gl::drawSphere( Vec3f( getWindowCenter().x, getWindowCenter().y, 0.0f ), 150.0f ); 59 | mShader.unbind(); 60 | 61 | gl::disableWireframe(); 62 | gl::disableAlphaBlending(); 63 | } 64 | } 65 | 66 | CINDER_APP_NATIVE( MultipleFilesApp, RendererGl ) 67 | -------------------------------------------------------------------------------- /samples/MultipleFiles/vc10/MultipleFiles.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 11.00 2 | # Visual C++ Express 2010 3 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MultipleFiles", "MultipleFiles.vcxproj", "{0DE2A3FD-11D3-466B-8ADC-6DFF6642D67A}" 4 | EndProject 5 | Global 6 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 7 | Debug|Win32 = Debug|Win32 8 | Release|Win32 = Release|Win32 9 | EndGlobalSection 10 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 11 | {0DE2A3FD-11D3-466B-8ADC-6DFF6642D67A}.Debug|Win32.ActiveCfg = Debug|Win32 12 | {0DE2A3FD-11D3-466B-8ADC-6DFF6642D67A}.Debug|Win32.Build.0 = Debug|Win32 13 | {0DE2A3FD-11D3-466B-8ADC-6DFF6642D67A}.Release|Win32.ActiveCfg = Release|Win32 14 | {0DE2A3FD-11D3-466B-8ADC-6DFF6642D67A}.Release|Win32.Build.0 = Release|Win32 15 | EndGlobalSection 16 | GlobalSection(SolutionProperties) = preSolution 17 | HideSolutionNode = FALSE 18 | EndGlobalSection 19 | EndGlobal 20 | -------------------------------------------------------------------------------- /samples/MultipleFiles/vc10/MultipleFiles.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | Win32 6 | 7 | 8 | Release 9 | Win32 10 | 11 | 12 | 13 | {0DE2A3FD-11D3-466B-8ADC-6DFF6642D67A} 14 | MultipleFiles 15 | Win32Proj 16 | 17 | 18 | 19 | Application 20 | Unicode 21 | true 22 | 23 | 24 | Application 25 | Unicode 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | <_ProjectFileVersion>10.0.30319.1 38 | $(SolutionDir)$(Configuration)\ 39 | $(Configuration)\ 40 | true 41 | $(SolutionDir)$(Configuration)\ 42 | $(Configuration)\ 43 | false 44 | 45 | 46 | 47 | Disabled 48 | ..\include;"..\..\..\..\..\\include";"..\..\..\..\..\\boost";..\..\..\..\Cinder-Awesomium\include;..\..\..\include 49 | WIN32;_DEBUG;_WINDOWS;NOMINMAX;%(PreprocessorDefinitions) 50 | true 51 | EnableFastChecks 52 | MultiThreadedDebug 53 | 54 | Level3 55 | EditAndContinue 56 | true 57 | 58 | 59 | "..\..\..\..\..\\include";..\include 60 | 61 | 62 | cinder_d.lib;%(AdditionalDependencies);..\..\..\..\Cinder-Awesomium\build\lib\msw\awesomium.lib 63 | "..\..\..\..\..\\lib";"..\..\..\..\..\\lib\msw" 64 | true 65 | Windows 66 | false 67 | 68 | MachineX86 69 | LIBCMT;LIBCPMT 70 | 71 | 72 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\avcodec-53.dll" "$(OutDir)" 73 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\avformat-53.dll" "$(OutDir)" 74 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\avutil-51.dll" "$(OutDir)" 75 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium.dll" "$(OutDir)" 76 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium_pak_utility.exe" "$(OutDir)" 77 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium_process.exe" "$(OutDir)" 78 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium_process.pdb" "$(OutDir)" 79 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium_symbols.pdb" "$(OutDir)" 80 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\icudt.dll" "$(OutDir)" 81 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\inspector.pak" "$(OutDir)" 82 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\libEGL.dll" "$(OutDir)" 83 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\libGLESv2.dll" "$(OutDir)" 84 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\SDL.dll" "$(OutDir)" 85 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\webui_assets.pak" "$(OutDir)" 86 | xcopy /y "..\..\..\resources\CodeEditor\editor_msw.html" "$(OutDir)" 87 | xcopy /y "..\..\..\resources\CodeEditor\css\codemirror.css" "$(OutDir)" 88 | xcopy /y "..\..\..\resources\CodeEditor\css\dialog.css" "$(OutDir)" 89 | xcopy /y "..\..\..\resources\CodeEditor\css\show-hint.css" "$(OutDir)" 90 | xcopy /y "..\..\..\resources\CodeEditor\css\solarized.css" "$(OutDir)" 91 | xcopy /y "..\..\..\resources\CodeEditor\js\codemirror.js" "$(OutDir)" 92 | xcopy /y "..\..\..\resources\CodeEditor\js\dialog.js" "$(OutDir)" 93 | xcopy /y "..\..\..\resources\CodeEditor\js\glsl-hint.js" "$(OutDir)" 94 | xcopy /y "..\..\..\resources\CodeEditor\js\glsl.js" "$(OutDir)" 95 | xcopy /y "..\..\..\resources\CodeEditor\js\match-highlighter.js" "$(OutDir)" 96 | xcopy /y "..\..\..\resources\CodeEditor\js\search.js" "$(OutDir)" 97 | xcopy /y "..\..\..\resources\CodeEditor\js\searchcursor.js" "$(OutDir)" 98 | xcopy /y "..\..\..\resources\CodeEditor\js\show-hint.js" "$(OutDir)" 99 | xcopy /y "..\..\..\resources\CodeEditor\js\jquery.min.js" "$(OutDir)" 100 | xcopy /y "..\..\..\resources\CodeEditor\js\jquery.color.js" "$(OutDir)" 101 | 102 | 103 | 104 | 105 | ..\include;"..\..\..\..\..\\include";"..\..\..\..\..\\boost";..\..\..\..\Cinder-Awesomium\include;..\..\..\include 106 | WIN32;NDEBUG;_WINDOWS;NOMINMAX;%(PreprocessorDefinitions) 107 | MultiThreaded 108 | 109 | Level3 110 | ProgramDatabase 111 | true 112 | 113 | 114 | true 115 | 116 | 117 | "..\..\..\..\..\\include";..\include 118 | 119 | 120 | cinder.lib;%(AdditionalDependencies);..\..\..\..\Cinder-Awesomium\build\lib\msw\awesomium.lib 121 | "..\..\..\..\..\\lib";"..\..\..\..\..\\lib\msw" 122 | false 123 | true 124 | Windows 125 | true 126 | 127 | false 128 | 129 | MachineX86 130 | 131 | 132 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\avcodec-53.dll" "$(OutDir)" 133 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\avformat-53.dll" "$(OutDir)" 134 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\avutil-51.dll" "$(OutDir)" 135 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium.dll" "$(OutDir)" 136 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium_pak_utility.exe" "$(OutDir)" 137 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium_process.exe" "$(OutDir)" 138 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium_process.pdb" "$(OutDir)" 139 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium_symbols.pdb" "$(OutDir)" 140 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\icudt.dll" "$(OutDir)" 141 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\inspector.pak" "$(OutDir)" 142 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\libEGL.dll" "$(OutDir)" 143 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\libGLESv2.dll" "$(OutDir)" 144 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\SDL.dll" "$(OutDir)" 145 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\webui_assets.pak" "$(OutDir)" 146 | xcopy /y "..\..\..\resources\CodeEditor\editor_msw.html" "$(OutDir)" 147 | xcopy /y "..\..\..\resources\CodeEditor\css\codemirror.css" "$(OutDir)" 148 | xcopy /y "..\..\..\resources\CodeEditor\css\dialog.css" "$(OutDir)" 149 | xcopy /y "..\..\..\resources\CodeEditor\css\show-hint.css" "$(OutDir)" 150 | xcopy /y "..\..\..\resources\CodeEditor\css\solarized.css" "$(OutDir)" 151 | xcopy /y "..\..\..\resources\CodeEditor\js\codemirror.js" "$(OutDir)" 152 | xcopy /y "..\..\..\resources\CodeEditor\js\dialog.js" "$(OutDir)" 153 | xcopy /y "..\..\..\resources\CodeEditor\js\glsl-hint.js" "$(OutDir)" 154 | xcopy /y "..\..\..\resources\CodeEditor\js\glsl.js" "$(OutDir)" 155 | xcopy /y "..\..\..\resources\CodeEditor\js\match-highlighter.js" "$(OutDir)" 156 | xcopy /y "..\..\..\resources\CodeEditor\js\search.js" "$(OutDir)" 157 | xcopy /y "..\..\..\resources\CodeEditor\js\searchcursor.js" "$(OutDir)" 158 | xcopy /y "..\..\..\resources\CodeEditor\js\show-hint.js" "$(OutDir)" 159 | xcopy /y "..\..\..\resources\CodeEditor\js\jquery.min.js" "$(OutDir)" 160 | xcopy /y "..\..\..\resources\CodeEditor\js\jquery.color.js" "$(OutDir)" 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | -------------------------------------------------------------------------------- /samples/MultipleFiles/vc10/MultipleFiles.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 5 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 6 | 7 | 8 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 9 | h;hpp;hxx;hm;inl;inc;xsd 10 | 11 | 12 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 13 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav 14 | 15 | 16 | {3672D4CB-50C3-4D89-B96B-A5E1EAA79165} 17 | 18 | 19 | {BFD1E4A0-3E2C-4A3B-8D19-7395607E7A87} 20 | 21 | 22 | {A49AF3F4-BE93-431C-BB31-12A1FA186B4C} 23 | 24 | 25 | {A4343A7A-1808-4D95-A730-D0BE2F74E301} 26 | 27 | 28 | {FD921972-0AAA-4701-A084-BB1DF8F4215A} 29 | 30 | 31 | 32 | 33 | Source Files 34 | 35 | 36 | Source Files 37 | 38 | 39 | Header Files 40 | 41 | 42 | Blocks\Awesomium\include 43 | 44 | 45 | Blocks\CodeEditor\include 46 | 47 | 48 | Blocks\CodeEditor\include 49 | 50 | 51 | 52 | 53 | Header Files 54 | 55 | 56 | 57 | 58 | Resource Files 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /samples/MultipleFiles/vc10/Resources.rc: -------------------------------------------------------------------------------- 1 | #include "../include/Resources.h" 2 | 3 | 1 ICON "..\\resources\\cinder_app_icon.ico" 4 | -------------------------------------------------------------------------------- /samples/MultipleFiles/vc11/MultipleFiles.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Express 2012 for Windows Desktop 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MultipleFiles", "MultipleFiles.vcxproj", "{AF646783-2BC1-4069-83B6-72AC81781CC6}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Release|Win32 = Release|Win32 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {AF646783-2BC1-4069-83B6-72AC81781CC6}.Debug|Win32.ActiveCfg = Debug|Win32 13 | {AF646783-2BC1-4069-83B6-72AC81781CC6}.Debug|Win32.Build.0 = Debug|Win32 14 | {AF646783-2BC1-4069-83B6-72AC81781CC6}.Release|Win32.ActiveCfg = Release|Win32 15 | {AF646783-2BC1-4069-83B6-72AC81781CC6}.Release|Win32.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /samples/MultipleFiles/vc11/MultipleFiles.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | Win32 6 | 7 | 8 | Release 9 | Win32 10 | 11 | 12 | 13 | {AF646783-2BC1-4069-83B6-72AC81781CC6} 14 | MultipleFiles 15 | Win32Proj 16 | 17 | 18 | 19 | Application 20 | false 21 | v110_xp 22 | Unicode 23 | true 24 | 25 | 26 | Application 27 | true 28 | v110_xp 29 | Unicode 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | <_ProjectFileVersion>10.0.30319.1 42 | $(SolutionDir)$(Configuration)\ 43 | $(Configuration)\ 44 | true 45 | $(SolutionDir)$(Configuration)\ 46 | $(Configuration)\ 47 | false 48 | 49 | 50 | 51 | Disabled 52 | ..\include;"..\..\..\..\..\\include";"..\..\..\..\..\\boost";..\..\..\..\Cinder-Awesomium\include;..\..\..\include 53 | WIN32;_DEBUG;_WINDOWS;NOMINMAX;%(PreprocessorDefinitions) 54 | true 55 | EnableFastChecks 56 | MultiThreadedDebug 57 | 58 | Level3 59 | EditAndContinue 60 | true 61 | 62 | 63 | "..\..\..\..\..\\include";..\include 64 | 65 | 66 | cinder_d.lib;%(AdditionalDependencies);..\..\..\..\Cinder-Awesomium\build\lib\msw\awesomium.lib 67 | "..\..\..\..\..\\lib";"..\..\..\..\..\\lib\msw" 68 | true 69 | Windows 70 | false 71 | 72 | MachineX86 73 | LIBCMT;LIBCPMT 74 | 75 | 76 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\avcodec-53.dll" "$(OutDir)" 77 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\avformat-53.dll" "$(OutDir)" 78 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\avutil-51.dll" "$(OutDir)" 79 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium.dll" "$(OutDir)" 80 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium_pak_utility.exe" "$(OutDir)" 81 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium_process.exe" "$(OutDir)" 82 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium_process.pdb" "$(OutDir)" 83 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium_symbols.pdb" "$(OutDir)" 84 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\icudt.dll" "$(OutDir)" 85 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\inspector.pak" "$(OutDir)" 86 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\libEGL.dll" "$(OutDir)" 87 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\libGLESv2.dll" "$(OutDir)" 88 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\SDL.dll" "$(OutDir)" 89 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\webui_assets.pak" "$(OutDir)" 90 | xcopy /y "..\..\..\resources\CodeEditor\editor_msw.html" "$(OutDir)" 91 | xcopy /y "..\..\..\resources\CodeEditor\css\codemirror.css" "$(OutDir)" 92 | xcopy /y "..\..\..\resources\CodeEditor\css\dialog.css" "$(OutDir)" 93 | xcopy /y "..\..\..\resources\CodeEditor\css\show-hint.css" "$(OutDir)" 94 | xcopy /y "..\..\..\resources\CodeEditor\css\solarized.css" "$(OutDir)" 95 | xcopy /y "..\..\..\resources\CodeEditor\js\codemirror.js" "$(OutDir)" 96 | xcopy /y "..\..\..\resources\CodeEditor\js\dialog.js" "$(OutDir)" 97 | xcopy /y "..\..\..\resources\CodeEditor\js\glsl-hint.js" "$(OutDir)" 98 | xcopy /y "..\..\..\resources\CodeEditor\js\glsl.js" "$(OutDir)" 99 | xcopy /y "..\..\..\resources\CodeEditor\js\match-highlighter.js" "$(OutDir)" 100 | xcopy /y "..\..\..\resources\CodeEditor\js\search.js" "$(OutDir)" 101 | xcopy /y "..\..\..\resources\CodeEditor\js\searchcursor.js" "$(OutDir)" 102 | xcopy /y "..\..\..\resources\CodeEditor\js\show-hint.js" "$(OutDir)" 103 | xcopy /y "..\..\..\resources\CodeEditor\js\jquery.min.js" "$(OutDir)" 104 | xcopy /y "..\..\..\resources\CodeEditor\js\jquery.color.js" "$(OutDir)" 105 | 106 | 107 | 108 | 109 | ..\include;"..\..\..\..\..\\include";"..\..\..\..\..\\boost";..\..\..\..\Cinder-Awesomium\include;..\..\..\include 110 | WIN32;NDEBUG;_WINDOWS;NOMINMAX;%(PreprocessorDefinitions) 111 | MultiThreaded 112 | 113 | Level3 114 | ProgramDatabase 115 | true 116 | 117 | 118 | true 119 | 120 | 121 | "..\..\..\..\..\\include";..\include 122 | 123 | 124 | cinder.lib;%(AdditionalDependencies);..\..\..\..\Cinder-Awesomium\build\lib\msw\awesomium.lib 125 | "..\..\..\..\..\\lib";"..\..\..\..\..\\lib\msw" 126 | false 127 | true 128 | Windows 129 | true 130 | 131 | false 132 | 133 | MachineX86 134 | 135 | 136 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\avcodec-53.dll" "$(OutDir)" 137 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\avformat-53.dll" "$(OutDir)" 138 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\avutil-51.dll" "$(OutDir)" 139 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium.dll" "$(OutDir)" 140 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium_pak_utility.exe" "$(OutDir)" 141 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium_process.exe" "$(OutDir)" 142 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium_process.pdb" "$(OutDir)" 143 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\awesomium_symbols.pdb" "$(OutDir)" 144 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\icudt.dll" "$(OutDir)" 145 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\inspector.pak" "$(OutDir)" 146 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\libEGL.dll" "$(OutDir)" 147 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\libGLESv2.dll" "$(OutDir)" 148 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\SDL.dll" "$(OutDir)" 149 | xcopy /y "..\..\..\..\Cinder-Awesomium\build\bin\msw\webui_assets.pak" "$(OutDir)" 150 | xcopy /y "..\..\..\resources\CodeEditor\editor_msw.html" "$(OutDir)" 151 | xcopy /y "..\..\..\resources\CodeEditor\css\codemirror.css" "$(OutDir)" 152 | xcopy /y "..\..\..\resources\CodeEditor\css\dialog.css" "$(OutDir)" 153 | xcopy /y "..\..\..\resources\CodeEditor\css\show-hint.css" "$(OutDir)" 154 | xcopy /y "..\..\..\resources\CodeEditor\css\solarized.css" "$(OutDir)" 155 | xcopy /y "..\..\..\resources\CodeEditor\js\codemirror.js" "$(OutDir)" 156 | xcopy /y "..\..\..\resources\CodeEditor\js\dialog.js" "$(OutDir)" 157 | xcopy /y "..\..\..\resources\CodeEditor\js\glsl-hint.js" "$(OutDir)" 158 | xcopy /y "..\..\..\resources\CodeEditor\js\glsl.js" "$(OutDir)" 159 | xcopy /y "..\..\..\resources\CodeEditor\js\match-highlighter.js" "$(OutDir)" 160 | xcopy /y "..\..\..\resources\CodeEditor\js\search.js" "$(OutDir)" 161 | xcopy /y "..\..\..\resources\CodeEditor\js\searchcursor.js" "$(OutDir)" 162 | xcopy /y "..\..\..\resources\CodeEditor\js\show-hint.js" "$(OutDir)" 163 | xcopy /y "..\..\..\resources\CodeEditor\js\jquery.min.js" "$(OutDir)" 164 | xcopy /y "..\..\..\resources\CodeEditor\js\jquery.color.js" "$(OutDir)" 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | -------------------------------------------------------------------------------- /samples/MultipleFiles/vc11/MultipleFiles.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 5 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 6 | 7 | 8 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 9 | h;hpp;hxx;hm;inl;inc;xsd 10 | 11 | 12 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 13 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav 14 | 15 | 16 | {8D969C48-D8CC-49B4-977B-529F8B4F179A} 17 | 18 | 19 | {4188A09E-7B69-482B-8FB7-AC67D1C38DB6} 20 | 21 | 22 | {689822C7-954D-478A-854B-1E16FD33D7D5} 23 | 24 | 25 | {5D594E3F-BAC5-41FB-AAFB-89F74C2F9636} 26 | 27 | 28 | {E330D573-D0FC-4029-85C1-7E2CC7CABC1F} 29 | 30 | 31 | 32 | 33 | Source Files 34 | 35 | 36 | Source Files 37 | 38 | 39 | Header Files 40 | 41 | 42 | Blocks\Awesomium\include 43 | 44 | 45 | Blocks\CodeEditor\include 46 | 47 | 48 | Blocks\CodeEditor\include 49 | 50 | 51 | 52 | 53 | Header Files 54 | 55 | 56 | 57 | 58 | Resource Files 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /samples/MultipleFiles/vc11/Resources.rc: -------------------------------------------------------------------------------- 1 | #include "../include/Resources.h" 2 | 3 | 1 ICON "..\\resources\\cinder_app_icon.ico" 4 | -------------------------------------------------------------------------------- /samples/MultipleFiles/xcode/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | CinderApp.icns 11 | CFBundleIdentifier 12 | org.libcinder.MultipleFiles 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | NSMainNibFile 24 | MainMenu 25 | NSPrincipalClass 26 | NSApplication 27 | 28 | 29 | -------------------------------------------------------------------------------- /samples/MultipleFiles/xcode/MultipleFiles_Prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | #if defined( __cplusplus ) 6 | #include "cinder/Cinder.h" 7 | 8 | #include "cinder/app/AppBasic.h" 9 | 10 | #include "cinder/gl/gl.h" 11 | 12 | #include "cinder/CinderMath.h" 13 | #include "cinder/Matrix.h" 14 | #include "cinder/Vector.h" 15 | #include "cinder/Quaternion.h" 16 | #endif 17 | --------------------------------------------------------------------------------