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-10-07 03:32:21 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2012-10-07 03:32:21 +0400
commit1fe70c07a008185c4e5925aff2c214c93ff396b7 (patch)
tree5dd9fc4a6be56243977b2670c8acfe4eb5543d96 /source/blender/windowmanager
parentcdc1e5a716c08e809b771388c6b5075d32a20c98 (diff)
parente7db06ad9db5a1a05b00fc835038d4366d637851 (diff)
Merged changes in the trunk up to revision 51126.
Conflicts resolved: source/blender/blenloader/intern/readfile.c source/blender/windowmanager/WM_types.h
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/WM_api.h2
-rw-r--r--source/blender/windowmanager/WM_types.h21
-rw-r--r--source/blender/windowmanager/intern/wm_files.c3
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c30
4 files changed, 41 insertions, 15 deletions
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h
index ac05331095b..e7b7f679ce3 100644
--- a/source/blender/windowmanager/WM_api.h
+++ b/source/blender/windowmanager/WM_api.h
@@ -273,7 +273,7 @@ int WM_gesture_lines_cancel(struct bContext *C, struct wmOperator *op);
int WM_gesture_lasso_invoke(struct bContext *C, struct wmOperator *op, struct wmEvent *event);
int WM_gesture_lasso_modal(struct bContext *C, struct wmOperator *op, struct wmEvent *event);
int WM_gesture_lasso_cancel(struct bContext *C, struct wmOperator *op);
-int (*WM_gesture_lasso_path_to_array(struct bContext *C, struct wmOperator *op, int *mcords_tot))[2];
+const int (*WM_gesture_lasso_path_to_array(struct bContext *C, struct wmOperator *op, int *mcords_tot))[2];
int WM_gesture_straightline_invoke(struct bContext *C, struct wmOperator *op, struct wmEvent *event);
int WM_gesture_straightline_modal(struct bContext *C, struct wmOperator *op, struct wmEvent *event);
int WM_gesture_straightline_cancel(struct bContext *C, struct wmOperator *op);
diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h
index 4ec3d8ea755..82bd37eb6cc 100644
--- a/source/blender/windowmanager/WM_types.h
+++ b/source/blender/windowmanager/WM_types.h
@@ -238,7 +238,8 @@ typedef struct wmNotifier {
#define NC_LOGIC (19<<24)
#define NC_MOVIECLIP (20<<24)
#define NC_MASK (21<<24)
-#define NC_LINESTYLE (22<<24)
+#define NC_GPENCIL (22<<24)
+#define NC_LINESTYLE (23<<24)
/* data type, 256 entries is enough, it can overlap */
#define NOTE_DATA 0x00FF0000
@@ -509,7 +510,11 @@ typedef struct wmOperatorType {
* parameters may be provided through operator properties. cannot use
* any interface code or input device state.
* - see defines below for return values */
- int (*exec)(struct bContext *, struct wmOperator *);
+ int (*exec)(struct bContext *, struct wmOperator *)
+#ifdef __GNUC__
+ __attribute__((warn_unused_result))
+#endif
+ ;
/* this callback executes on a running operator whenever as property
* is changed. It can correct its own properties or report errors for
@@ -521,9 +526,17 @@ typedef struct wmOperatorType {
* any further events are handled in modal. if the operation is
* canceled due to some external reason, cancel is called
* - see defines below for return values */
- int (*invoke)(struct bContext *, struct wmOperator *, struct wmEvent *);
+ int (*invoke)(struct bContext *, struct wmOperator *, struct wmEvent *)
+#ifdef __GNUC__
+ __attribute__((warn_unused_result))
+#endif
+ ;
int (*cancel)(struct bContext *, struct wmOperator *);
- int (*modal)(struct bContext *, struct wmOperator *, struct wmEvent *);
+ int (*modal)(struct bContext *, struct wmOperator *, struct wmEvent *)
+#ifdef __GNUC__
+ __attribute__((warn_unused_result))
+#endif
+ ;
/* verify if the operator can be executed in the current context, note
* that the operator might still fail to execute even if this return true */
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index 594804d10f6..aab20e5849b 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -56,6 +56,7 @@
#include "BLI_blenlib.h"
#include "BLI_linklist.h"
#include "BLI_utildefines.h"
+#include "BLI_threads.h"
#include "BLI_callbacks.h"
#include "BLF_translation.h"
@@ -797,7 +798,7 @@ int WM_file_write(bContext *C, const char *target, int fileflags, ReportList *re
/* blend file thumbnail */
/* save before exit_editmode, otherwise derivedmeshes for shared data corrupt #27765) */
- if (U.flag & USER_SAVE_PREVIEWS) {
+ if ((U.flag & USER_SAVE_PREVIEWS) && BLI_thread_is_main()) {
ibuf_thumb = blend_file_thumb(CTX_data_scene(C), CTX_wm_screen(C), &thumb);
}
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index 313fc0a819e..e4d6b3dd465 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -2289,6 +2289,8 @@ static int border_apply_rect(wmOperator *op)
static int border_apply(bContext *C, wmOperator *op, int gesture_mode)
{
+ int retval;
+
if (!border_apply_rect(op))
return 0;
@@ -2296,7 +2298,9 @@ static int border_apply(bContext *C, wmOperator *op, int gesture_mode)
if (RNA_struct_find_property(op->ptr, "gesture_mode") )
RNA_int_set(op->ptr, "gesture_mode", gesture_mode);
- op->type->exec(C, op);
+ retval = op->type->exec(C, op);
+ OPERATOR_RETVAL_CHECK(retval);
+
return 1;
}
@@ -2422,8 +2426,11 @@ static void gesture_circle_apply(bContext *C, wmOperator *op)
RNA_int_set(op->ptr, "y", rect->ymin);
RNA_int_set(op->ptr, "radius", rect->xmax);
- if (op->type->exec)
- op->type->exec(C, op);
+ if (op->type->exec) {
+ int retval;
+ retval = op->type->exec(C, op);
+ OPERATOR_RETVAL_CHECK(retval);
+ }
#ifdef GESTURE_MEMORY
circle_select_size = rect->xmax;
#endif
@@ -2643,8 +2650,10 @@ static void gesture_lasso_apply(bContext *C, wmOperator *op)
wm_gesture_end(C, op);
- if (op->type->exec)
- op->type->exec(C, op);
+ if (op->type->exec) {
+ int retval = op->type->exec(C, op);
+ OPERATOR_RETVAL_CHECK(retval);
+ }
}
int WM_gesture_lasso_modal(bContext *C, wmOperator *op, wmEvent *event)
@@ -2727,7 +2736,7 @@ int WM_gesture_lines_cancel(bContext *C, wmOperator *op)
*
* caller must free.
*/
-int (*WM_gesture_lasso_path_to_array(bContext *UNUSED(C), wmOperator *op, int *mcords_tot))[2]
+const int (*WM_gesture_lasso_path_to_array(bContext *UNUSED(C), wmOperator *op, int *mcords_tot))[2]
{
PropertyRNA *prop = RNA_struct_find_property(op->ptr, "path");
int (*mcords)[2] = NULL;
@@ -2757,7 +2766,8 @@ int (*WM_gesture_lasso_path_to_array(bContext *UNUSED(C), wmOperator *op, int *m
*mcords_tot = 0;
}
- return mcords;
+ /* cast for 'const' */
+ return (const int (*)[2])mcords;
}
#if 0
@@ -2812,8 +2822,10 @@ static int straightline_apply(bContext *C, wmOperator *op)
RNA_int_set(op->ptr, "xend", rect->xmax);
RNA_int_set(op->ptr, "yend", rect->ymax);
- if (op->type->exec)
- op->type->exec(C, op);
+ if (op->type->exec) {
+ int retval = op->type->exec(C, op);
+ OPERATOR_RETVAL_CHECK(retval);
+ }
return 1;
}