[Gridflow-cvs] [svn] commit: r5439 - in /trunk: ChangeLog TODO doc/flow_classes/#io.quartz-help.pd src/quartz.m

svn-gridflow at artengine.ca svn-gridflow at artengine.ca
Thu Apr 15 16:41:58 EDT 2010


Author: pboivin
Date: Thu Apr 15 16:41:56 2010
New Revision: 5439

Log:
add [#io.quartz] 'menubar' method to show/hide OSX menubar

Modified:
    trunk/ChangeLog
    trunk/TODO
    trunk/doc/flow_classes/#io.quartz-help.pd
    trunk/src/quartz.m

Modified: trunk/ChangeLog
==============================================================================
--- trunk/ChangeLog (original)
+++ trunk/ChangeLog Thu Apr 15 16:41:56 2010
@@ -25,6 +25,7 @@
  * [#io.videodev]: added colorspace rgba, with alpha=255.
  * [#camera]: added colorspace rgba
  * [#io.quartz]: added support for keypress and keyrelease
+ * [#io.quartz]: added 'menubar' method (show/hide system menubar on OSX)
  * [#io.quicktimecamera]: colorspace rgba's alpha=255 now.
  * [#io.quicktimecamera]: added colorspaces y, yuv, rgb.
 

Modified: trunk/TODO
==============================================================================
--- trunk/TODO (original)
+++ trunk/TODO Thu Apr 15 16:41:56 2010
@@ -16,7 +16,7 @@
 [x] [#io.quartz] keypress/keyrelease
 [L] [#io.quartz] setcursor/hidecursor
 [ ] [#io.quartz] fullscreen mode
-[!] [#io.quartz] hide menubar
+[x] [#io.quartz] hide menubar
 [ ] [#io.quicktime (apple) out] grid, codec, quality.
 [ ] add [cv/#SVD] etc (-lcv) to OSX packages
 [ ] on PPC, retest [#to_pix] with alpha etc...

Modified: trunk/doc/flow_classes/#io.quartz-help.pd
==============================================================================
--- trunk/doc/flow_classes/#io.quartz-help.pd (original)
+++ trunk/doc/flow_classes/#io.quartz-help.pd Thu Apr 15 16:41:56 2010
@@ -1,52 +1,61 @@
-#N canvas 596 7 632 589 10;
+#N canvas 618 22 632 655 10;
 #X obj 0 0 doc_h;
 #X obj 3 70 doc_c;
-#X obj 0 560 doc_f;
+#X obj 0 623 doc_f;
 #X obj 44 40 #out quartz;
 #X obj 3 110 doc_i 1;
-#X obj 3 260 doc_o 1;
+#X obj 3 374 doc_o 1;
 #X obj 14 140 doc_ii 0;
 #X obj 97 140 doc_m i0 grid;
-#X obj 97 206 doc_m i0 title;
 #X text 134 40 video output for OSX (when running without Apple X11)
 ;
-#X obj 14 290 doc_oo 0;
-#X obj 97 162 doc_m i0 move;
+#X obj 14 404 doc_oo 0;
 #X text 232 140 with [#out] \, displays a frame;
-#X text 232 228 set window title;
-#X text 232 206 \$1=title;
-#X text 232 184 move window;
-#X text 232 162 \$1=y_position \, \$2=x_position;
-#X obj 97 290 doc_m o0 grid;
-#X text 232 290 grid(rows columns rgb);
-#X obj 3 540 doc_also;
-#X text 232 312 Resizes the window to the size of the grid \; Encodes
+#X obj 97 404 doc_m o0 grid;
+#X text 232 404 grid(rows columns rgb);
+#X obj 3 603 doc_also;
+#X obj 103 603 doc_link #io.sdl;
+#X obj 231 603 doc_link #io.x11;
+#X obj 97 527 doc_m o0 keypress;
+#X obj 97 549 doc_m o0 keyrelease;
+#X obj 97 571 doc_m o0 position;
+#X obj 97 320 doc_m i0 title;
+#X obj 97 276 doc_m i0 move;
+#X text 232 342 set window title;
+#X text 232 320 \$1=title;
+#X text 232 298 move window;
+#X text 232 276 \$1=y_position \, \$2=x_position;
+#X obj 97 162 doc_m i0 menubar;
+#X text 232 162 \$1=1 \, show system menubar (default);
+#X text 232 184 \$1=0 \, hide system menubar;
+#X text 232 206 \$1=-1 \, show system menubar only if the user moves
+the mouse into the screen area where it would ordinarily be;
+#X text 232 492 The values must be in range 0-255 \, or else they will
+be "wrapped".;
+#X text 232 426 Resizes the window to the size of the grid \; Encodes
 that grid in the display's pixel format \; Also displays it if autodraw
-is greater than 0 \; The values must be in range 0-255 \, or else they
-will be "wrapped".;
-#X obj 103 540 doc_link #io.sdl;
-#X obj 231 540 doc_link #io.x11;
-#X obj 97 386 doc_m o0 keypress;
-#X obj 97 434 doc_m o0 keyrelease;
-#X obj 97 482 doc_m o0 position;
-#X obj 232 408 doc_link #io.x11;
-#X text 232 386 see also:;
-#X obj 232 456 doc_link #io.x11;
-#X text 232 434 see also:;
-#X obj 232 504 doc_link #io.x11;
-#X text 232 482 see also:;
-#X connect 7 1 12 0;
-#X connect 8 1 14 0;
-#X connect 8 1 13 0;
-#X connect 11 1 16 0;
-#X connect 11 1 15 0;
-#X connect 17 1 18 0;
-#X connect 17 1 20 0;
+is greater than 0 \;;
+#X text 232 470 Also displays it if autodraw is greater than 0 \;;
+#X text 232 448 Encodes that grid in the display's pixel format \;
+;
+#X text 232 241 This behaviour is only effective when a GridFlow window
+is active and not when another Pd window is.;
+#X obj 252 557 doc_link #io.x11;
+#X text 252 535 see also:;
+#X obj 233 524 doc_accolade;
+#X connect 7 1 10 0;
+#X connect 11 1 12 0;
+#X connect 11 1 30 0;
+#X connect 11 1 29 0;
+#X connect 11 1 32 0;
+#X connect 11 1 31 0;
+#X connect 13 1 14 0;
+#X connect 13 1 15 0;
+#X connect 19 1 22 0;
 #X connect 19 1 21 0;
-#X connect 19 1 22 0;
-#X connect 23 1 27 0;
-#X connect 23 1 26 0;
-#X connect 24 1 29 0;
-#X connect 24 1 28 0;
-#X connect 25 1 30 0;
-#X connect 25 1 31 0;
+#X connect 20 1 24 0;
+#X connect 20 1 23 0;
+#X connect 25 1 26 0;
+#X connect 25 1 27 0;
+#X connect 25 1 28 0;
+#X connect 25 1 33 0;

Modified: trunk/src/quartz.m
==============================================================================
--- trunk/src/quartz.m (original)
+++ trunk/src/quartz.m Thu Apr 15 16:41:56 2010
@@ -31,6 +31,7 @@
 #include <stdio.h>
 #include <objc/Object.h>
 #include <Cocoa/Cocoa.h>
+#include <Carbon/Carbon.h>
 
 #include "gridflow.hxx.fcs"
 
@@ -115,6 +116,7 @@
 	void report_pointer(BOOL check_bounds);
 	void report_key(NSEvent *e);
 	\decl 0 title (string title="");
+	\decl 0 menubar (int state);
 	\decl 0 move (int y, int x);
 	\decl 0 set_geometry (int y, int x, int sy, int sx);
 	\decl 0 loadbang () {outlet_anything(outlets[0],gensym("nogrey"),0,0);}
@@ -357,6 +359,16 @@
 	[window setTitle: str];
 }
 
+\def 0 menubar (int state) {
+	if (state == 0)
+		SetSystemUIMode( kUIModeAllHidden, kUIOptionDisableAppleMenu | kUIOptionDisableProcessSwitch |
+						   kUIOptionDisableSessionTerminate | kUIOptionDisableForceQuit );
+	else if (state > 0)
+		SetSystemUIMode( kUIModeNormal, 0 );
+	else
+		SetSystemUIMode( kUIModeAllHidden, kUIOptionAutoShowMenuBar );
+}
+
 \def 0 move (int y, int x) {
 	int new_y = MAC_BOTTOMLEFT_TO_TOPLEFT;
 	NSPoint pos = { x, new_y };



More information about the Gridflow-cvs mailing list