Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

PG: added command line only ifdefs

  • Loading branch information...
commit 388b0d766b8e54fb14ea287d8c5fbecfdef339ce 1 parent 1fa84a5
arturo authored May 04, 2012
23  apps/devApps/projectGenerator/src/testApp.cpp
@@ -41,6 +41,8 @@ void testApp::setup(){
41 41
         std::exit(0);
42 42
     }
43 43
 
  44
+
  45
+#ifndef COMMAND_LINE_ONLY
44 46
     panelAddons.setup();
45 47
     ofDirectory addons(ofFilePath::join(getOFRoot(),"addons"));
46 48
     addons.listDir();
@@ -77,6 +79,9 @@ void testApp::setup(){
77 79
     ofSetVerticalSync(true);
78 80
     ofEnableAlphaBlending();
79 81
 	ofSetFrameRate(60);
  82
+#else
  83
+	std::exit(0);
  84
+#endif
80 85
 }
81 86
 
82 87
 void testApp::setupForTarget(int targ){
@@ -117,6 +122,7 @@ void testApp::setupForTarget(int targ){
117 122
 
118 123
 void testApp::generateExamplesCB(bool & pressed){
119 124
 
  125
+#ifndef COMMAND_LINE_ONLY
120 126
 	if (pressed == false) return; // don't do this again on the mouseup.
121 127
 
122 128
 	targetsToMake.clear();
@@ -138,6 +144,8 @@ void testApp::generateExamplesCB(bool & pressed){
138 144
 
139 145
 	int target = ofGetTargetPlatform();
140 146
     setupForTarget(target);
  147
+#endif
  148
+
141 149
 }
142 150
 
143 151
 void testApp::generateExamples(){
@@ -192,6 +200,8 @@ void testApp::generateExamples(){
192 200
 }
193 201
 
194 202
 ofFileDialogResult testApp::makeNewProjectViaDialog(){
  203
+
  204
+#ifndef COMMAND_LINE_ONLY
195 205
     ofFileDialogResult res = ofSystemSaveDialog("newProjectName", "choose a folder for a new OF project :)");
196 206
     if (res.fileName == "" || res.filePath == "") return res;
197 207
     //base.pushDirectory(res.fileName);   // somehow an extra things here helps?
@@ -229,9 +239,13 @@ ofFileDialogResult testApp::makeNewProjectViaDialog(){
229 239
         }
230 240
 	}
231 241
     return res;
  242
+#endif
  243
+
232 244
 }
233 245
 
234 246
 ofFileDialogResult testApp::updateProjectViaDialog(){
  247
+
  248
+#ifndef COMMAND_LINE_ONLY
235 249
     ofFileDialogResult res = ofSystemLoadDialog("choose a folder to update an OF project :)",true);
236 250
     if (res.fileName == "" || res.filePath == "") return res;
237 251
     //base.pushDirectory(res.fileName);   // somehow an extra things here helps?
@@ -272,6 +286,8 @@ ofFileDialogResult testApp::updateProjectViaDialog(){
272 286
 	}
273 287
 
274 288
 	return res;
  289
+#endif
  290
+
275 291
 }
276 292
 
277 293
 void testApp::createProjectPressed(bool & pressed){
@@ -318,6 +334,7 @@ void testApp::update(){
318 334
 //--------------------------------------------------------------
319 335
 void testApp::draw(){
320 336
 
  337
+#ifndef COMMAND_LINE_ONLY
321 338
     //ofBackgroundGradient(ofColor::gray,ofColor::black);
322 339
 
323 340
     panelAddons.draw();
@@ -331,6 +348,8 @@ void testApp::draw(){
331 348
     /*ofDrawBitmapString("press 'm' to make all files\npress ' ' to make a specific file", ofPoint(30,30));*/
332 349
 	ofSetColor(255);
333 350
     ofDrawBitmapString(drawableOfPath, ofPathDrawPoint);
  351
+#endif
  352
+
334 353
 }
335 354
 
336 355
 //--------------------------------------------------------------
@@ -393,6 +412,8 @@ void testApp::dragEvent(ofDragInfo dragInfo){
393 412
 
394 413
 //--------------------------------------------------------------
395 414
 void testApp::setupDrawableOFPath(){
  415
+
  416
+#ifndef COMMAND_LINE_ONLY
396 417
 	vector<string> subdirs = ofSplitString("OF path: " + getOFRoot(), "/");
397 418
 	int textLength = 0;
398 419
 	int padding = 5;
@@ -429,5 +450,7 @@ void testApp::setupDrawableOFPath(){
429 450
 
430 451
 	panelAddons.setPosition(panelAddons.getPosition().x, ofPathRect.y + ofPathRect.height + padding);
431 452
 	examplesPanel.setPosition(examplesPanel.getPosition().x, ofPathRect.y + ofPathRect.height + padding);
  453
+#endif
  454
+
432 455
 
433 456
 }
14  apps/devApps/projectGenerator/src/testApp.h
... ...
@@ -1,12 +1,17 @@
1 1
 #pragma once
2 2
 
  3
+//#define COMMAND_LINE_ONLY
  4
+
3 5
 #include "ofMain.h"
4 6
 #include "CBLinuxProject.h"
5 7
 #include "CBWinProject.h"
6 8
 #include "visualStudioProject.h"
7 9
 #include "xcodeProject.h"
8 10
 #include <Poco/Path.h>
  11
+
  12
+#ifndef COMMAND_LINE_ONLY
9 13
 #include "ofxGui.h"
  14
+#endif
10 15
 
11 16
 class testApp : public ofBaseApp{
12 17
 
@@ -43,7 +48,10 @@ class testApp : public ofBaseApp{
43 48
     
44 49
         string projectPath;
45 50
         string target;
46  
-	
  51
+		vector <int> targetsToMake;
  52
+		bool buildAllExamples;
  53
+
  54
+#ifndef COMMAND_LINE_ONLY
47 55
 		string drawableOfPath;
48 56
 		ofRectangle ofPathRect;
49 57
 		ofPoint ofPathDrawPoint;
@@ -54,7 +62,5 @@ class testApp : public ofBaseApp{
54 62
 		ofxPanel examplesPanel;
55 63
 		ofxToggle osxToggle, iosToggle, wincbToggle, winvsToggle, linuxcbToggle, linux64cbToggle;
56 64
 		ofxButton generateButton;
57  
-
58  
-		vector <int> targetsToMake;
59  
-		bool buildAllExamples;
  65
+#endif
60 66
 };

0 notes on commit 388b0d7

Please sign in to comment.
Something went wrong with that request. Please try again.