diff options
-rw-r--r-- | source/blender/blenkernel/BKE_global.h | 8 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/blender.c | 4 | ||||
-rw-r--r-- | source/blender/include/BIF_screen.h | 1 | ||||
-rw-r--r-- | source/blender/include/BIF_space.h | 4 | ||||
-rw-r--r-- | source/blender/include/blendef.h | 1 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_userdef_types.h | 1 | ||||
-rw-r--r-- | source/blender/quicktime/apple/quicktime_export.c | 5 | ||||
-rw-r--r-- | source/blender/src/editscreen.c | 24 | ||||
-rw-r--r-- | source/blender/src/ghostwinlay.c | 15 | ||||
-rw-r--r-- | source/blender/src/headerbuttons.c | 24 | ||||
-rw-r--r-- | source/blender/src/toets.c | 17 | ||||
-rw-r--r-- | source/blender/src/usiblender.c | 16 | ||||
-rw-r--r-- | source/blender/src/winlay.h | 4 |
13 files changed, 112 insertions, 12 deletions
diff --git a/source/blender/blenkernel/BKE_global.h b/source/blender/blenkernel/BKE_global.h index 43db9f08914..ebdd008847c 100644 --- a/source/blender/blenkernel/BKE_global.h +++ b/source/blender/blenkernel/BKE_global.h @@ -121,6 +121,9 @@ typedef struct Global { /* this variable is written to / read from FileGlobal->fileflags */ int fileflags; + /* save the allowed windowstate of blender when using -W or -w */ + int windowstate; + /* Janco's playing ground */ struct bSoundListener* listener; @@ -189,6 +192,11 @@ typedef struct Global { #define G_FILE_SIGN (1 << G_FILE_SIGN_BIT) #define G_FILE_PUBLISH (1 << G_FILE_PUBLISH_BIT) +/* G.windowstate */ +#define G_WINDOWSTATE_USERDEF 0 +#define G_WINDOWSTATE_BORDER 1 +#define G_WINDOWSTATE_FULLSCREEN 2 + /* G.simulf */ #define G_LOADFILE 2 #define G_RESTART 4 diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c index 6c5d5f2fff8..11a98227925 100644 --- a/source/blender/blenkernel/intern/blender.c +++ b/source/blender/blenkernel/intern/blender.c @@ -207,6 +207,10 @@ void initglobals(void) sprintf(versionstr, "www.blender.org %d", G.version); +#ifdef _WIN32 // FULLSCREEN + G.windowstate = G_WINDOWSTATE_USERDEF; +#endif + clear_workob(); /* object.c */ } diff --git a/source/blender/include/BIF_screen.h b/source/blender/include/BIF_screen.h index 7c61896cd7f..416df442e7c 100644 --- a/source/blender/include/BIF_screen.h +++ b/source/blender/include/BIF_screen.h @@ -95,7 +95,6 @@ int is_allowed_to_change_screen(struct bScreen *newp); void splash(void * data, int datasizei, char * string); void screenmain(void); void getdisplaysize(void); -void setfullscreen(void); void setprefsize(int stax, int stay, int sizx, int sizy); void calc_arearcts(struct ScrArea *sa); void resize_screen(int x, int y, int w, int h); diff --git a/source/blender/include/BIF_space.h b/source/blender/include/BIF_space.h index 2c6f6f1ecee..fc1d6ab2312 100644 --- a/source/blender/include/BIF_space.h +++ b/source/blender/include/BIF_space.h @@ -85,6 +85,10 @@ extern void winqreadseqspace(struct ScrArea *sa, void *spacedata, struct B extern void test_butspace(void); extern void start_game(void); +#ifdef _WIN32 // FULLSCREEN +extern void mainwindow_toggle_fullscreen(int fullscreen); +#endif + extern void mainwindow_raise(void); extern void mainwindow_make_active(void); extern void mainwindow_close(void); diff --git a/source/blender/include/blendef.h b/source/blender/include/blendef.h index 66dd7e1b8bf..064cdc4dee6 100644 --- a/source/blender/include/blendef.h +++ b/source/blender/include/blendef.h @@ -189,6 +189,7 @@ #define B_DRAWINFO 62 #define B_REDRCURW3D 63 #define B_FLIPINFOMENU 64 +#define B_FLIPFULLSCREEN 65 #define B_SHOWSPLASH 70 diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index 7fac5a7dd68..9357d1e6f8d 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -88,6 +88,7 @@ extern UserDef U; /* from usiblender.c !!!! */ #define DRAWVIEWINFO 16 #define EVTTOCONSOLE 32 //print ghost events, here for tuhopuu compat. --phase #define FLIPINFOMENU 64 +#define FLIPFULLSCREEN 128 /* transopts */ diff --git a/source/blender/quicktime/apple/quicktime_export.c b/source/blender/quicktime/apple/quicktime_export.c index b88c72bfb54..5863a533900 100644 --- a/source/blender/quicktime/apple/quicktime_export.c +++ b/source/blender/quicktime/apple/quicktime_export.c @@ -574,6 +574,7 @@ int get_qtcodec_settings(void) // cd.componentManufacturer = 0; // cd.componentFlags = 0; // cd.componentFlagsMask = 0; +Handle *theText; if(qcdx == NULL) { qcdx = MEM_callocN(sizeof(QuicktimeCodecDataExt), "QuicktimeCodecDataExt"); @@ -629,6 +630,10 @@ int get_qtcodec_settings(void) SCGetInfo(qcdx->theComponent, scSpatialSettingsType, &qcdx->gSpatialSettings); SCGetInfo(qcdx->theComponent, scDataRateSettingsType, &qcdx->aDataRateSetting); +//GraphicsExportGetSettingsAsText (qcdx->theComponent,theText ); + +//printf("%s\n", theText); + // framerate jugglin' if(qcdx->gTemporalSettings.frameRate == 1571553) { // 23.98 fps diff --git a/source/blender/src/editscreen.c b/source/blender/src/editscreen.c index 60bf34a04f8..fd89b8400ac 100644 --- a/source/blender/src/editscreen.c +++ b/source/blender/src/editscreen.c @@ -118,7 +118,7 @@ static void wait_for_event(void); /* ********* Globals *********** */ static Window *mainwin= NULL; -static int prefsizx= 0, prefsizy= 0, prefstax= 0, prefstay= 0, start_maximized= 1, start_fullscreen = 0; +static int prefsizx= 0, prefsizy= 0, prefstax= 0, prefstay= 0, start_maximized= 1; static short dodrawscreen= 0; static ScrArea *areawinar[MAXWIN]; static ScrArea *g_activearea= NULL; @@ -1111,6 +1111,15 @@ void screenmain(void) } } +#ifdef _WIN32 // FULLSCREEN +void mainwindow_toggle_fullscreen(int fullscreen){ + if (fullscreen) U.uiflag |= FLIPFULLSCREEN; + else U.uiflag &= ~FLIPFULLSCREEN; + + window_toggle_fullscreen(mainwin, fullscreen); +} +#endif + void mainwindow_raise(void) { window_raise(mainwin); } @@ -1124,11 +1133,6 @@ void mainwindow_close(void) { /* ********* AREAS ************* */ -void setfullscreen() -{ - start_fullscreen = 1; -} - void setprefsize(int stax, int stay, int sizx, int sizy) { int scrwidth, scrheight; @@ -1680,10 +1684,14 @@ static bScreen *addscreen(char *name) /* use setprefsize() if you want somethin sc->scene= G.scene; if (!mainwin) { - if (start_fullscreen) - mainwin= window_open("Blender", sc->startx, sc->starty, sc->sizex, sc->sizey, 2); +#ifdef _WIN32 // FULLSCREEN + if (G.windowstate == G_WINDOWSTATE_FULLSCREEN) + mainwin= window_open("Blender", sc->startx, sc->starty, sc->sizex, sc->sizey, G_WINDOWSTATE_FULLSCREEN); else mainwin= window_open("Blender", sc->startx, sc->starty, sc->sizex, sc->sizey, start_maximized); +#else + mainwin= window_open("Blender", sc->startx, sc->starty, sc->sizex, sc->sizey, start_maximized); +#endif if (!mainwin) { printf("ERROR: Unable to open Blender window\n"); diff --git a/source/blender/src/ghostwinlay.c b/source/blender/src/ghostwinlay.c index 73cb6cb9f40..0345f77cf28 100644 --- a/source/blender/src/ghostwinlay.c +++ b/source/blender/src/ghostwinlay.c @@ -234,10 +234,14 @@ Window *window_open(char *title, int posx, int posy, int sizex, int sizey, int s inital_state= start_maximized? GHOST_kWindowStateFullScreen:GHOST_kWindowStateNormal; #else - if (start_maximized == 2) +#ifdef _WIN32 // FULLSCREEN + if (start_maximized == G_WINDOWSTATE_FULLSCREEN) inital_state= GHOST_kWindowStateFullScreen; else inital_state= start_maximized?GHOST_kWindowStateMaximized:GHOST_kWindowStateNormal; +#else + inital_state= start_maximized?GHOST_kWindowStateMaximized:GHOST_kWindowStateNormal; +#endif #endif ghostwin= GHOST_CreateWindow(g_system, @@ -568,6 +572,15 @@ void window_raise(Window *win) { GHOST_SetWindowOrder(win->ghostwin, GHOST_kWindowOrderTop); } +#ifdef _WIN32 //FULLSCREEN +void window_toggle_fullscreen(Window *win, int fullscreen) { + if(fullscreen) + GHOST_SetWindowState(win->ghostwin, GHOST_kWindowStateFullScreen); + else + GHOST_SetWindowState(win->ghostwin, GHOST_kWindowStateMaximized); +} +#endif + void window_warp_pointer(Window *win, int x, int y) { y= win->size[1] - y - 1; GHOST_ClientToScreen(win->ghostwin, x, y, &x, &y); diff --git a/source/blender/src/headerbuttons.c b/source/blender/src/headerbuttons.c index f6a47eb3023..f370a2cc834 100644 --- a/source/blender/src/headerbuttons.c +++ b/source/blender/src/headerbuttons.c @@ -1407,6 +1407,12 @@ void do_global_buttons(unsigned short event) scrarea_queue_headredraw(curarea); break; +#ifdef _WIN32 // FULLSCREEN + case B_FLIPFULLSCREEN: + mainwindow_toggle_fullscreen((U.uiflag & FLIPFULLSCREEN)); + break; +#endif + /* Fileselect windows for user preferences file paths */ case B_FONTDIRFILESEL: /* is button from space.c *info* */ @@ -3408,6 +3414,7 @@ void info_buttons(void) &(U.uiflag), 0, 0, 0, 0, "Hide pulldown menus");/* dir */ } xco+=XIC; + if(U.uiflag & FLIPINFOMENU) { } else { uiBlockSetEmboss(block, UI_EMBOSSP); @@ -3481,7 +3488,22 @@ void info_buttons(void) curarea->headbutlen= xco+2*XIC; if(curarea->headbutlen + 4*XIC < curarea->winx) { - uiDefIconBut(block, BUT, B_FILEMENU, ICON_HELP, (short)(curarea->winx-XIC-2), 0,XIC,YIC, 0, 0, 0, 0, 0, "Toolbox menu, hotkey: SPACE"); + uiDefIconBut(block, BUT, B_FILEMENU, ICON_HELP, + (short)(curarea->winx-XIC-2), 0,XIC,YIC, + 0, 0, 0, 0, 0, "Toolbox menu, hotkey: SPACE"); + +#ifdef _WIN32 // FULLSCREEN + if(U.uiflag & FLIPFULLSCREEN) { + uiDefIconButS(block, TOG|BIT|7, B_FLIPFULLSCREEN, ICON_SPLITSCREEN, + (short)(curarea->winx-(XIC*2)-2), 0,XIC,YIC, + &(U.uiflag), 0, 0, 0, 0, "Toggle Blender fullscreen");/* dir */ + } else { + uiDefIconButS(block, TOG|BIT|7, B_FLIPFULLSCREEN, ICON_FULLSCREEN, + (short)(curarea->winx-(XIC*2)-2), 0,XIC,YIC, + &(U.uiflag), 0, 0, 0, 0, "Toggle Blender fullscreen");/* dir */ + } +#endif + } uiDrawBlock(block); diff --git a/source/blender/src/toets.c b/source/blender/src/toets.c index 91b1c39db7a..6394959dd0c 100644 --- a/source/blender/src/toets.c +++ b/source/blender/src/toets.c @@ -643,7 +643,15 @@ int blenderqread(unsigned short event, short val) case LEFTARROWKEY: case DOWNARROWKEY: if(textediting==0 && textspace==0) { + +#ifdef _WIN32 // FULLSCREEN + if(event==DOWNARROWKEY){ + if (G.qual & LR_ALTKEY) mainwindow_toggle_fullscreen(0); + else CFRA-= 10; + } +#else if(event==DOWNARROWKEY) CFRA-= 10; +#endif else CFRA--; if(G.qual & LR_SHIFTKEY) CFRA= SFRA; @@ -657,8 +665,17 @@ int blenderqread(unsigned short event, short val) case RIGHTARROWKEY: case UPARROWKEY: if(textediting==0 && textspace==0) { + +#ifdef _WIN32 // FULLSCREEN + if(event==UPARROWKEY){ + if(G.qual & LR_ALTKEY) mainwindow_toggle_fullscreen(1); + else CFRA+= 10; + } +#else if(event==UPARROWKEY) CFRA+= 10; +#endif else CFRA++; + if(G.qual & LR_SHIFTKEY) CFRA= EFRA; update_for_newframe(); diff --git a/source/blender/src/usiblender.c b/source/blender/src/usiblender.c index 8f8d635905c..8b3254c346b 100644 --- a/source/blender/src/usiblender.c +++ b/source/blender/src/usiblender.c @@ -182,7 +182,21 @@ int BIF_read_homefile(void) /* disable autoplay in .B.blend... */ G.fileflags &= ~G_FILE_AUTOPLAY; - + +#ifdef _WIN32 // FULLSCREEN + /* choose window startmode */ + switch (G.windowstate){ + case G_WINDOWSTATE_USERDEF: /* use the usersetting */ + break; + case G_WINDOWSTATE_FULLSCREEN: /* force fullscreen */ + U.uiflag |= FLIPFULLSCREEN; + break; + case G_WINDOWSTATE_BORDER: /* force with borders */ + U.uiflag &= ~FLIPFULLSCREEN; + } + mainwindow_toggle_fullscreen ((U.uiflag & FLIPFULLSCREEN)); +#endif + if (BLI_streq(U.tempdir, "/")) { char *tmp= getenv("TEMP"); diff --git a/source/blender/src/winlay.h b/source/blender/src/winlay.h index fb2a2fcb89d..2f5cc3ce386 100644 --- a/source/blender/src/winlay.h +++ b/source/blender/src/winlay.h @@ -44,6 +44,10 @@ void window_set_timer (Window *win, int delay_ms, int event); void window_make_active (Window *win); void window_swap_buffers (Window *win); +#ifdef _WIN32 // FULLSCREEN +void window_toggle_fullscreen(Window *win, int fullscreen); +#endif + void window_raise (Window *win); void window_lower (Window *win); |