Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2009-01-29 21:54:22 +0300
committerTon Roosendaal <ton@blender.org>2009-01-29 21:54:22 +0300
commit5f9ee2cbfe3770838482e7c8f37194f127e8a8c5 (patch)
tree8ec3a82dec1df1cac6e7bfae5a7309ecc0da329e /source/blender/windowmanager
parent2869ce6cfab3aa4ff471bef6e49ac6fe15426247 (diff)
2.5
- Made WM_cursor_wait() work without context or pointers, like old waitcursor(). Only use when operations entirely block UI. It will set waitcursor for all open windows. - Cleanup in mesh tools, removing old cruft, and prepare for more goodies for shul to work on!
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/WM_api.h2
-rw-r--r--source/blender/windowmanager/intern/wm_cursors.c35
-rw-r--r--source/blender/windowmanager/wm_cursors.h4
3 files changed, 23 insertions, 18 deletions
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h
index cb6d26a1506..940fd762f10 100644
--- a/source/blender/windowmanager/WM_api.h
+++ b/source/blender/windowmanager/WM_api.h
@@ -64,7 +64,7 @@ void WM_write_autosave (struct bContext *C);
void WM_cursor_set (struct wmWindow *win, int curs);
void WM_cursor_modal (struct wmWindow *win, int curs);
void WM_cursor_restore (struct wmWindow *win);
-void WM_cursor_wait (struct wmWindow *win, int val);
+void WM_cursor_wait (int val);
void WM_timecursor (struct wmWindow *win, int nr);
void *WM_paint_cursor_activate(struct wmWindowManager *wm, int (*poll)(struct bContext *C), void (*draw)(struct bContext *C, int, int, void *customdata), void *customdata);
diff --git a/source/blender/windowmanager/intern/wm_cursors.c b/source/blender/windowmanager/intern/wm_cursors.c
index 3afc9cc884b..d1c268a1189 100644
--- a/source/blender/windowmanager/intern/wm_cursors.c
+++ b/source/blender/windowmanager/intern/wm_cursors.c
@@ -36,6 +36,8 @@
#include "DNA_userdef_types.h"
#include "BKE_context.h"
+#include "BKE_global.h"
+#include "BKE_main.h"
#include "WM_api.h"
#include "wm_cursors.h"
@@ -120,29 +122,32 @@ void WM_cursor_set(wmWindow *win, int curs)
}
}
-static int LastCursor=-1; /* global, assumed we only have one */
-
void WM_cursor_modal(wmWindow *win, int val)
{
- if(LastCursor == -1)
- LastCursor = win->cursor;
+ if(win->lastcursor == 0)
+ win->lastcursor = win->cursor;
WM_cursor_set(win, val);
}
void WM_cursor_restore(wmWindow *win)
{
- if(LastCursor != -1)
- WM_cursor_set(win, LastCursor);
- LastCursor = -1;
+ if(win->lastcursor)
+ WM_cursor_set(win, win->lastcursor);
+ win->lastcursor = 0;
}
-
-void WM_cursor_wait(wmWindow *win, int val)
+/* to allow usage all over, we do entire WM */
+void WM_cursor_wait(int val)
{
- if(val) {
- WM_cursor_modal(win, CURSOR_WAIT);
- } else {
- WM_cursor_restore(win);
+ wmWindowManager *wm= G.main->wm.first;
+ wmWindow *win= wm->windows.first;
+
+ for(; win; win= win->next) {
+ if(val) {
+ WM_cursor_modal(win, CURSOR_WAIT);
+ } else {
+ WM_cursor_restore(win);
+ }
}
}
@@ -166,8 +171,8 @@ void WM_timecursor(wmWindow *win, int nr)
unsigned char bitmap[16][2];
int i, idx;
- if(LastCursor != -1)
- LastCursor= win->cursor;
+ if(win->lastcursor != 0)
+ win->lastcursor= win->cursor;
memset(&bitmap, 0x00, sizeof(bitmap));
memset(&mask, 0xFF, sizeof(mask));
diff --git a/source/blender/windowmanager/wm_cursors.h b/source/blender/windowmanager/wm_cursors.h
index e3f0e846b7a..096e1916fa9 100644
--- a/source/blender/windowmanager/wm_cursors.h
+++ b/source/blender/windowmanager/wm_cursors.h
@@ -74,9 +74,9 @@ typedef struct BCursor {
} BCursor;
-#define SYSCURSOR -1
+#define SYSCURSOR 1
enum {
- BC_NW_ARROWCURSOR=0,
+ BC_NW_ARROWCURSOR=2,
BC_NS_ARROWCURSOR,
BC_EW_ARROWCURSOR,
BC_WAITCURSOR,