diff options
author | Ton Roosendaal <ton@blender.org> | 2008-12-30 16:16:14 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2008-12-30 16:16:14 +0300 |
commit | 25fac7b001aaa03f6341a0c04e08798a01379ca3 (patch) | |
tree | 1606ead91f45c805dd5035990ea04e75cbe87682 /source/blender/windowmanager | |
parent | 446492c2669773e34dc2d827648021f9115dc821 (diff) |
2.5
Editmesh code cleaned and compiling/linking. A whopping
20k lines back! :)
Not that it does stuff... editmode in/out has to be done,
and loads of operators. Also linking/exporting editmesh
calls has to be reviewed.
Also: added a blender_test_break() mechanism in BKE.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/WM_api.h | 1 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 4 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_init_exit.c | 3 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_subwindow.c | 2 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_window.c | 19 | ||||
-rw-r--r-- | source/blender/windowmanager/wm_window.h | 2 |
6 files changed, 29 insertions, 2 deletions
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index 36198087d22..e3eaca7accd 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -155,6 +155,7 @@ void wmOrtho2 (float x1, float x2, float y1, float y2); /* utilities */ void WM_set_framebuffer_index_color(int index); +int WM_framebuffer_to_index(unsigned int col); #endif /* WM_API_H */ diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index d76b7ebebd4..8a4f93d8a3f 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -1114,6 +1114,10 @@ void wm_event_add_ghostevent(wmWindow *win, int type, void *customdata) event.oskey= evt->oskey= event.val; } + /* if test_break set, it catches this. Keep global for now? */ + if(event.type==ESCKEY) + G.afbreek= 1; + wm_event_add(win, &event); break; diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c index eca4dec122e..500b04eccab 100644 --- a/source/blender/windowmanager/intern/wm_init_exit.c +++ b/source/blender/windowmanager/intern/wm_init_exit.c @@ -121,7 +121,8 @@ void WM_init(bContext *C) wm_operatortype_init(); set_free_windowmanager_cb(wm_close_and_free); /* library.c */ - + set_blender_test_break_cb(wm_window_testbreak); /* blender.c */ + ED_spacetypes_init(); /* editors/area/spacetype.c */ /* get the default database, plus a wm */ diff --git a/source/blender/windowmanager/intern/wm_subwindow.c b/source/blender/windowmanager/intern/wm_subwindow.c index abc78f06f8f..29baf9f4cc5 100644 --- a/source/blender/windowmanager/intern/wm_subwindow.c +++ b/source/blender/windowmanager/intern/wm_subwindow.c @@ -456,7 +456,7 @@ void WM_set_framebuffer_index_color(int index) cpack(index_to_framebuffer(index)); } -int framebuffer_to_index(unsigned int col) +int WM_framebuffer_to_index(unsigned int col) { if (col==0) return 0; diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index b38de750114..73860af5f85 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -554,6 +554,25 @@ void wm_window_process_events(const bContext *C) PIL_sleep_ms(5); } +/* exported as handle callback to bke blender.c */ +void wm_window_testbreak(void) +{ + static double ltime= 0; + double curtime= PIL_check_seconds_timer(); + + /* only check for breaks every 50 milliseconds + * if we get called more often. + */ + if ((curtime-ltime)>.05) { + int hasevent= GHOST_ProcessEvents(g_system, 0); /* 0 is no wait */ + + if(hasevent) + GHOST_DispatchEvents(g_system); + + ltime= curtime; + } +} + /* **************** init ********************** */ void wm_ghost_init(bContext *C) diff --git a/source/blender/windowmanager/wm_window.h b/source/blender/windowmanager/wm_window.h index 03f2060e706..97b9f434982 100644 --- a/source/blender/windowmanager/wm_window.h +++ b/source/blender/windowmanager/wm_window.h @@ -52,6 +52,8 @@ void wm_window_swap_buffers (wmWindow *win); wmWindow *wm_window_copy (bContext *C, wmWindow *winorig); wmWindow *wm_window_rip (bContext *C, wmWindow *winorig); +void wm_window_testbreak (void); + /* *************** window operators ************** */ int wm_window_duplicate_op (bContext *C, wmOperator *op); int wm_window_rip_op (bContext *C, wmOperator *op, struct wmEvent *event); |