2.5
authorTon Roosendaal <ton@blender.org>
Tue, 6 Jan 2009 18:52:18 +0000 (18:52 +0000)
committerTon Roosendaal <ton@blender.org>
Tue, 6 Jan 2009 18:52:18 +0000 (18:52 +0000)
Made ED_screen api calls:
- ED_screen_full_newspace()
- ED_screen_full_prevspace()

Which now gets called by F1 operator, to move to
full-screen-sized browser. For testing fun its default
now. Might become user setting. Also have to check
on opening a temp window for this (and for render).

source/blender/editors/include/ED_screen.h
source/blender/editors/screen/screen_edit.c
source/blender/editors/space_file/file_draw.c
source/blender/windowmanager/intern/wm_operators.c

index bd9d312..a9ad6c5 100644 (file)
@@ -80,6 +80,9 @@ bScreen *ED_screen_duplicate(struct wmWindow *win, struct bScreen *sc);
 void   ED_screen_set_subwinactive(struct wmWindow *win, struct wmEvent *event);
 void   ED_screen_exit(struct bContext *C, struct wmWindow *window, struct bScreen *screen);
 void   ED_screen_animation_timer(struct bContext *C, int enable);
+void   ED_screen_full_newspace(struct bContext *C, ScrArea *sa, int type);
+void   ED_screen_full_prevspace(struct bContext *C);
+
 
 void   ED_operatortypes_screen(void);
 void   ED_keymap_screen(struct wmWindowManager *wm);
index f96a845..f89ef34 100644 (file)
@@ -1302,6 +1302,24 @@ void ed_screen_fullarea(bContext *C)
 
 }
 
+void ED_screen_full_newspace(bContext *C, ScrArea *sa, int type)
+{
+       if(sa->full==0)
+               ed_screen_fullarea(C);
+
+       ED_area_newspace(C, CTX_wm_area(C), type);
+}
+
+void ED_screen_full_prevspace(bContext *C)
+{
+       ScrArea *sa= CTX_wm_area(C);
+       
+       ED_area_prevspace(C);
+       
+       if(sa->full)
+               ed_screen_fullarea(C);
+}
+
 void ED_screen_animation_timer(bContext *C, int enable)
 {
        bScreen *screen= CTX_wm_screen(C);
index 6f842da..5bf5718 100644 (file)
@@ -95,7 +95,7 @@ static void do_file_buttons(bContext *C, void *arg, int event)
                        {
                                char name[FILE_MAX];
 
-                               ED_area_prevspace(C);
+                               ED_screen_full_prevspace(C);
                                if(sfile->op) {
                                        wmOperator *op= sfile->op;
                                        
@@ -119,7 +119,7 @@ static void do_file_buttons(bContext *C, void *arg, int event)
                                WM_operator_free(sfile->op);
                                sfile->op = NULL;
                        }
-                       ED_area_prevspace(C);
+                       ED_screen_full_prevspace(C);
                        
                        break;
        }
index a74e6c1..84b2a39 100644 (file)
@@ -328,43 +328,9 @@ static void WM_OT_open_recentfile(wmOperatorType *ot)
 
 static int wm_mainfile_invoke(bContext *C, wmOperator *op, wmEvent *event)
 {
-       wmWindow *newwin, *win;
-       bScreen *newsc, *sc;
-       ScrArea *sa, *oldsa;
        SpaceFile *sfile;
-
-       rcti rect;
-       
-       win= CTX_wm_window(C);
-       sc= CTX_wm_screen(C);
-       oldsa= CTX_wm_area(C);
-
-#if 0 /* XXX experimental code for opening filebrowser in new window */
-       /*  poll() checks area context, but we don't accept full-area windows */
-       if(sc->full != SCREENNORMAL) 
-               return OPERATOR_CANCELLED;
-       
-       /* adds window to WM */
-       rect.xmin = 0;
-       rect.ymin = 0;
-       rect.xmax = win->sizex;
-       rect.ymax = win->sizey;
-       BLI_translate_rcti(&rect, win->posx, win->posy);
-       newwin= WM_window_open(C, &rect);
-       
-       /* allocs new screen and adds to newly created window, using window size */
-       newsc= screen_add(newwin, CTX_data_scene(C), sc->id.name+2);
-       newwin->screen= newsc;
-
-       /* create filebrowser */
-       CTX_wm_window_set(C, newwin);
-       CTX_wm_screen_set(C, newsc);
-       sa= (ScrArea*)newsc->areabase.first;
-       CTX_wm_area_set(C, sa);
-       ED_area_newspace(C, sa, SPACE_FILE);
-#else 
-       ED_area_newspace(C, oldsa, SPACE_FILE);
-#endif
+       
+       ED_screen_full_newspace(C, CTX_wm_area(C), SPACE_FILE);
 
        /* settings for filebrowser */
        sfile= (SpaceFile*)CTX_wm_space_data(C);