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:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2012-12-01 06:47:59 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2012-12-01 06:47:59 +0400
commited0e2fbd9f4edd55e11df694b34e233cb38cb953 (patch)
tree70a0d0fc080339b87cbeb73ebab6d4eda91ca5ba /source/blender/windowmanager
parent129a29873e552d769339c2b7d3b99a0afbbf2ae0 (diff)
parent75cce01a614e686530e26dbd186a88d75dc4e7b5 (diff)
Merged changes in the trunk up to revision 52690.
Conflicts resolved: release/datafiles/startup.blend source/blender/blenlib/intern/bpath.c
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/WM_api.h5
-rw-r--r--source/blender/windowmanager/WM_types.h1
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c6
-rw-r--r--source/blender/windowmanager/intern/wm_gesture.c2
-rw-r--r--source/blender/windowmanager/intern/wm_init_exit.c2
-rw-r--r--source/blender/windowmanager/intern/wm_jobs.c12
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c43
7 files changed, 51 insertions, 20 deletions
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h
index e35e3edfa33..1037542759f 100644
--- a/source/blender/windowmanager/WM_api.h
+++ b/source/blender/windowmanager/WM_api.h
@@ -360,8 +360,9 @@ void WM_jobs_start(struct wmWindowManager *wm, struct wmJob *);
void WM_jobs_stop(struct wmWindowManager *wm, void *owner, void *startjob);
void WM_jobs_kill(struct wmWindowManager *wm, void *owner, void (*)(void *, short int *, short int *, float *));
void WM_jobs_kill_all(struct wmWindowManager *wm);
- void WM_jobs_kill_all_except(struct wmWindowManager *wm, void *owner);
-
+void WM_jobs_kill_all_except(struct wmWindowManager *wm, void *owner);
+void WM_jobs_kill_type(struct wmWindowManager *wm, int job_type);
+
int WM_jobs_has_running(struct wmWindowManager *wm);
/* clipboard */
diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h
index 1d8949292ce..c88011aab13 100644
--- a/source/blender/windowmanager/WM_types.h
+++ b/source/blender/windowmanager/WM_types.h
@@ -301,6 +301,7 @@ typedef struct wmNotifier {
/* NC_MATERIAL Material */
#define ND_SHADING (30<<16)
#define ND_SHADING_DRAW (31<<16)
+#define ND_SHADING_LINKS (32<<16)
/* NC_LAMP Lamp */
#define ND_LIGHTING (40<<16)
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index b3c9cfbc79e..c0e3b19c716 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -135,6 +135,7 @@ static int wm_test_duplicate_notifier(wmWindowManager *wm, unsigned int type, vo
/* XXX: in future, which notifiers to send to other windows? */
void WM_event_add_notifier(const bContext *C, unsigned int type, void *reference)
{
+ ARegion *ar;
wmNotifier *note = MEM_callocN(sizeof(wmNotifier), "notifier");
note->wm = CTX_wm_manager(C);
@@ -142,8 +143,9 @@ void WM_event_add_notifier(const bContext *C, unsigned int type, void *reference
note->window = CTX_wm_window(C);
- if (CTX_wm_region(C))
- note->swinid = CTX_wm_region(C)->swinid;
+ ar = CTX_wm_region(C);
+ if (ar)
+ note->swinid = ar->swinid;
note->category = type & NOTE_CATEGORY;
note->data = type & NOTE_DATA;
diff --git a/source/blender/windowmanager/intern/wm_gesture.c b/source/blender/windowmanager/intern/wm_gesture.c
index b3ffb80243a..a80386e9860 100644
--- a/source/blender/windowmanager/intern/wm_gesture.c
+++ b/source/blender/windowmanager/intern/wm_gesture.c
@@ -255,7 +255,7 @@ static void draw_filled_lasso(wmGesture *gt)
if (sf_vert_first) {
const float zvec[3] = {0.0f, 0.0f, 1.0f};
BLI_scanfill_edge_add(&sf_ctx, sf_vert_first, sf_vert);
- BLI_scanfill_calc_ex(&sf_ctx, FALSE, zvec);
+ BLI_scanfill_calc_ex(&sf_ctx, BLI_SCANFILL_CALC_REMOVE_DOUBLES, zvec);
glEnable(GL_BLEND);
glColor4f(1.0, 1.0, 1.0, 0.05);
diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c
index c9f0bbffc63..1b8bcd51564 100644
--- a/source/blender/windowmanager/intern/wm_init_exit.c
+++ b/source/blender/windowmanager/intern/wm_init_exit.c
@@ -183,7 +183,7 @@ void WM_init(bContext *C, int argc, const char **argv)
GPU_extensions_init();
GPU_set_mipmap(!(U.gameflags & USER_DISABLE_MIPMAP));
GPU_set_anisotropic(U.anisotropic_filter);
- GPU_set_gpu_mipmapping(U.use_gpu_mipmap);
+ GPU_set_gpu_mipmapping();
UI_init();
}
diff --git a/source/blender/windowmanager/intern/wm_jobs.c b/source/blender/windowmanager/intern/wm_jobs.c
index 7481c01d72b..3c3e2c0feaa 100644
--- a/source/blender/windowmanager/intern/wm_jobs.c
+++ b/source/blender/windowmanager/intern/wm_jobs.c
@@ -416,6 +416,18 @@ void WM_jobs_kill_all_except(wmWindowManager *wm, void *owner)
}
+void WM_jobs_kill_type(struct wmWindowManager *wm, int job_type)
+{
+ wmJob *wm_job, *next_job;
+
+ for (wm_job = wm->jobs.first; wm_job; wm_job = next_job) {
+ next_job = wm_job->next;
+
+ if (wm_job->job_type == job_type)
+ wm_jobs_kill_job(wm, wm_job);
+ }
+}
+
/* signal job(s) from this owner or callback to stop, timer is required to get handled */
void WM_jobs_stop(wmWindowManager *wm, void *owner, void *startjob)
{
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index 84cfe791bce..80ceb5700e5 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -793,7 +793,7 @@ static uiBlock *wm_enum_search_menu(bContext *C, ARegion *ar, void *arg_op)
uiButSetSearchFunc(but, operator_enum_search_cb, op->type, operator_enum_call_cb, NULL);
/* fake button, it holds space for search items */
- uiDefBut(block, LABEL, 0, "", 10, 10 - uiSearchBoxhHeight(), 9 * UI_UNIT_X, uiSearchBoxhHeight(), NULL, 0, 0, 0, 0, NULL);
+ uiDefBut(block, LABEL, 0, "", 10, 10 - uiSearchBoxHeight(), uiSearchBoxWidth(), uiSearchBoxHeight(), NULL, 0, 0, 0, 0, NULL);
uiPopupBoundsBlock(block, 6, 0, -UI_UNIT_Y); /* move it downwards, mouse over button */
uiEndBlock(C, block);
@@ -1025,6 +1025,23 @@ wmOperator *WM_operator_last_redo(const bContext *C)
return op;
}
+static void wm_block_redo_cb(bContext *C, void *arg_op, int UNUSED(arg_event))
+{
+ wmOperator *op = arg_op;
+
+ if (op == WM_operator_last_redo(C)) {
+ /* operator was already executed once? undo & repeat */
+ ED_undo_operator_repeat(C, op);
+ }
+ else {
+ /* operator not executed yet, call it */
+ ED_undo_push_op(C, op);
+ wm_operator_register(C, op);
+
+ WM_operator_repeat(C, op);
+ }
+}
+
static uiBlock *wm_block_create_redo(bContext *C, ARegion *ar, void *arg_op)
{
wmOperator *op = arg_op;
@@ -1032,7 +1049,6 @@ static uiBlock *wm_block_create_redo(bContext *C, ARegion *ar, void *arg_op)
uiLayout *layout;
uiStyle *style = UI_GetStyle();
int width = 300;
-
block = uiBeginBlock(C, ar, __func__, UI_EMBOSS);
uiBlockClearFlag(block, UI_BLOCK_LOOP);
@@ -1042,11 +1058,12 @@ static uiBlock *wm_block_create_redo(bContext *C, ARegion *ar, void *arg_op)
* ui_apply_but_funcs_after calls ED_undo_operator_repeate_cb and crashes */
assert(op->type->flag & OPTYPE_REGISTER);
- uiBlockSetHandleFunc(block, ED_undo_operator_repeat_cb_evt, arg_op);
+ uiBlockSetHandleFunc(block, wm_block_redo_cb, arg_op);
layout = uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, width, UI_UNIT_Y, style);
- if (!WM_operator_check_ui_enabled(C, op->type->name))
- uiLayoutSetEnabled(layout, FALSE);
+ if (op == WM_operator_last_redo(C))
+ if (!WM_operator_check_ui_enabled(C, op->type->name))
+ uiLayoutSetEnabled(layout, FALSE);
if (op->type->flag & OPTYPE_MACRO) {
for (op = op->macro.first; op; op = op->next) {
@@ -1058,7 +1075,6 @@ static uiBlock *wm_block_create_redo(bContext *C, ARegion *ar, void *arg_op)
uiLayoutOperatorButs(C, layout, op, NULL, 'H', UI_LAYOUT_OP_SHOW_TITLE);
}
-
uiPopupBoundsBlock(block, 4, 0, 0);
uiEndBlock(C, block);
@@ -1207,22 +1223,21 @@ int WM_operator_ui_popup(bContext *C, wmOperator *op, int width, int height)
* \note operator menu needs undo flag enabled , for redo callback */
static int wm_operator_props_popup_ex(bContext *C, wmOperator *op, const int do_call)
{
-
if ((op->type->flag & OPTYPE_REGISTER) == 0) {
BKE_reportf(op->reports, RPT_ERROR,
"Operator '%s' does not have register enabled, incorrect invoke function", op->type->idname);
return OPERATOR_CANCELLED;
}
- ED_undo_push_op(C, op);
-
- wm_operator_register(C, op);
+ /* if we don't have global undo, we can't do undo push for automatic redo,
+ * so we require manual OK clicking in this popup */
+ if (!(U.uiflag & USER_GLOBALUNDO))
+ return WM_operator_props_dialog_popup(C, op, 300, UI_UNIT_Y);
uiPupBlock(C, wm_block_create_redo, op);
- if (do_call) {
- WM_operator_repeat(C, op);
- }
+ if (do_call)
+ wm_block_redo_cb(C, op, 0);
return OPERATOR_RUNNING_MODAL;
}
@@ -1566,7 +1581,7 @@ static uiBlock *wm_block_search_menu(bContext *C, ARegion *ar, void *UNUSED(arg_
uiButSetSearchFunc(but, operator_search_cb, NULL, operator_call_cb, NULL);
/* fake button, it holds space for search items */
- uiDefBut(block, LABEL, 0, "", 10, 10 - uiSearchBoxhHeight(), 9 * UI_UNIT_X, uiSearchBoxhHeight(), NULL, 0, 0, 0, 0, NULL);
+ uiDefBut(block, LABEL, 0, "", 10, 10 - uiSearchBoxHeight(), uiSearchBoxWidth(), uiSearchBoxHeight(), NULL, 0, 0, 0, 0, NULL);
uiPopupBoundsBlock(block, 6, 0, -UI_UNIT_Y); /* move it downwards, mouse over button */
uiEndBlock(C, block);