Commit: d8f931c9b7db09f969a0a6379782103071e0e9f5
Author: Campbell Barton
Date:   Thu Apr 6 21:55:58 2017 +1000
Branches: blender2.8
https://developer.blender.org/rBd8f931c9b7db09f969a0a6379782103071e0e9f5

Changes from custom-manipulators branch

Minor changes from custom-manipulators branch,
before larger changes are applied.

===================================================================

M       source/blender/CMakeLists.txt
A       source/blender/makesdna/DNA_manipulator_types.h
M       source/blender/makesdna/DNA_userdef_types.h
M       source/blender/makesdna/DNA_view3d_types.h
M       source/blender/makesdna/intern/makesdna.c
M       source/blender/windowmanager/CMakeLists.txt
M       source/blender/windowmanager/WM_api.h
M       source/blender/windowmanager/intern/wm_event_system.c
M       source/blender/windowmanager/intern/wm_operators.c
M       source/blender/windowmanager/manipulators/WM_manipulator_api.h
A       source/blender/windowmanager/manipulators/WM_manipulator_library.h
M       source/blender/windowmanager/manipulators/WM_manipulator_types.h
A       
source/blender/windowmanager/manipulators/intern/manipulator_library/arrow2d_manipulator.c
A       
source/blender/windowmanager/manipulators/intern/manipulator_library/arrow_manipulator.c
A       
source/blender/windowmanager/manipulators/intern/manipulator_library/cage_manipulator.c
A       
source/blender/windowmanager/manipulators/intern/manipulator_library/dial_manipulator.c
A       
source/blender/windowmanager/manipulators/intern/manipulator_library/geom_arrow_manipulator.c
A       
source/blender/windowmanager/manipulators/intern/manipulator_library/geom_cube_manipulator.c
A       
source/blender/windowmanager/manipulators/intern/manipulator_library/geom_dial_manipulator.c
A       
source/blender/windowmanager/manipulators/intern/manipulator_library/manipulator_geometry.h
M       
source/blender/windowmanager/manipulators/intern/manipulator_library/manipulator_library_intern.h
A       
source/blender/windowmanager/manipulators/intern/manipulator_library/primitive_manipulator.c
M       source/blender/windowmanager/manipulators/intern/wm_manipulator.c
M       source/blender/windowmanager/manipulators/intern/wm_manipulator_intern.h
M       source/blender/windowmanager/manipulators/intern/wm_manipulatorgroup.c
M       source/blender/windowmanager/manipulators/intern/wm_manipulatormap.c

===================================================================

diff --git a/source/blender/CMakeLists.txt b/source/blender/CMakeLists.txt
index 9b27f780075..448e66ec540 100644
--- a/source/blender/CMakeLists.txt
+++ b/source/blender/CMakeLists.txt
@@ -57,6 +57,7 @@ set(SRC_DNA_INC
        ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_layer_types.h
        ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_linestyle_types.h
        ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_listBase.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_manipulator_types.h
        ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_material_types.h
        ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_mesh_types.h
        ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_meshdata_types.h
diff --git a/source/blender/makesdna/DNA_manipulator_types.h 
b/source/blender/makesdna/DNA_manipulator_types.h
new file mode 100644
index 00000000000..7b75806f7c0
--- /dev/null
+++ b/source/blender/makesdna/DNA_manipulator_types.h
@@ -0,0 +1,43 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file DNA_manipulator_types.h
+ *  \ingroup DNA
+ */
+
+#ifndef __DNA_MANIPULATOR_TYPES_H__
+#define __DNA_MANIPULATOR_TYPES_H__
+
+typedef struct wmManipulatorGroup {
+       struct wmManipulatorGroup *next, *prev;
+
+       struct wmManipulatorGroupType *type;
+       ListBase manipulators;
+
+       void *py_instance;            /* python stores the class instance here 
*/
+       struct ReportList *reports;   /* errors and warnings storage */
+
+       void *customdata;
+       void (*customdata_free)(void *); /* for freeing customdata from above */
+       int flag; /* private */
+       int pad;
+} wmManipulatorGroup;
+
+#endif /* __DNA_MANIPULATOR_TYPES_H__ */
diff --git a/source/blender/makesdna/DNA_userdef_types.h 
b/source/blender/makesdna/DNA_userdef_types.h
index 82a56af9386..256d53eed0b 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -495,7 +495,8 @@ typedef struct UserDef {
        short tb_leftmouse, tb_rightmouse;
        struct SolidLight light[3];
        short tw_hotspot, tw_flag, tw_handlesize, tw_size;
-       short manipulator_scale, pad3[3];
+       short manipulator_flag, manipulator_scale;
+       int pad3;
        short textimeout, texcollectrate;
        short wmdrawmethod; /* removed wmpad */
        short dragthreshold;
diff --git a/source/blender/makesdna/DNA_view3d_types.h 
b/source/blender/makesdna/DNA_view3d_types.h
index f84a6c3efc8..0be86108dfc 100644
--- a/source/blender/makesdna/DNA_view3d_types.h
+++ b/source/blender/makesdna/DNA_view3d_types.h
@@ -137,7 +137,7 @@ typedef struct RegionView3D {
        char pad[3];
        float ofs_lock[2];                      /* normalized offset for locked 
view: (-1, -1) bottom left, (1, 1) upper right */
 
-       short twdrawflag;
+       short twdrawflag; /* XXX can easily get rid of this (Julian) */
        short rflag;
 
 
@@ -392,8 +392,8 @@ enum {
 /* View3d->twflag */
    /* USE = user setting, DRAW = based on selection */
 #define V3D_USE_MANIPULATOR            1
-#define V3D_DRAW_MANIPULATOR   2
-/* #define V3D_CALC_MANIPULATOR        4 */ /*UNUSED*/
+#define V3D_DRAW_MANIPULATOR        (1 << 1)
+#define V3D_SHADED_MANIPULATORS      (1 << 2)
 
 /* BGPic->flag */
 /* may want to use 1 for select ? */
diff --git a/source/blender/makesdna/intern/makesdna.c 
b/source/blender/makesdna/intern/makesdna.c
index b6cf3d555fa..e761d68ca64 100644
--- a/source/blender/makesdna/intern/makesdna.c
+++ b/source/blender/makesdna/intern/makesdna.c
@@ -77,6 +77,7 @@ static const char *includefiles[] = {
        "DNA_image_types.h",
        "DNA_texture_types.h",
        "DNA_lamp_types.h",
+       "DNA_manipulator_types.h",
        "DNA_material_types.h",
        "DNA_vfont_types.h",
        "DNA_meta_types.h",
@@ -1290,6 +1291,7 @@ int main(int argc, char **argv)
 #include "DNA_image_types.h"
 #include "DNA_texture_types.h"
 #include "DNA_lamp_types.h"
+#include "DNA_manipulator_types.h"
 #include "DNA_material_types.h"
 #include "DNA_vfont_types.h"
 #include "DNA_meta_types.h"
diff --git a/source/blender/windowmanager/CMakeLists.txt 
b/source/blender/windowmanager/CMakeLists.txt
index e0ac19259f5..63f04a803c0 100644
--- a/source/blender/windowmanager/CMakeLists.txt
+++ b/source/blender/windowmanager/CMakeLists.txt
@@ -73,6 +73,13 @@ set(SRC
        manipulators/intern/wm_manipulator.c
        manipulators/intern/wm_manipulatorgroup.c
        manipulators/intern/wm_manipulatormap.c
+       manipulators/intern/manipulator_library/arrow_manipulator.c
+       manipulators/intern/manipulator_library/arrow2d_manipulator.c
+       manipulators/intern/manipulator_library/cage_manipulator.c
+       manipulators/intern/manipulator_library/dial_manipulator.c
+       manipulators/intern/manipulator_library/primitive_manipulator.c
+       manipulators/intern/manipulator_library/geom_arrow_manipulator.c
+       manipulators/intern/manipulator_library/geom_cube_manipulator.c
        manipulators/intern/manipulator_library/manipulator_library_utils.c
 
        WM_api.h
@@ -88,8 +95,10 @@ set(SRC
        wm_window.h
        manipulators/WM_manipulator_api.h
        manipulators/WM_manipulator_types.h
+       manipulators/WM_manipulator_library.h
        manipulators/wm_manipulator_wmapi.h
        manipulators/intern/wm_manipulator_intern.h
+       manipulators/intern/manipulator_library/manipulator_geometry.h
        manipulators/intern/manipulator_library/manipulator_library_intern.h
 )
 
diff --git a/source/blender/windowmanager/WM_api.h 
b/source/blender/windowmanager/WM_api.h
index bae2aea4d27..1cabb07d556 100644
--- a/source/blender/windowmanager/WM_api.h
+++ b/source/blender/windowmanager/WM_api.h
@@ -44,6 +44,7 @@
 
 /* Include external manipulator API's */
 #include "manipulators/WM_manipulator_api.h"
+#include "manipulators/WM_manipulator_library.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/source/blender/windowmanager/intern/wm_event_system.c 
b/source/blender/windowmanager/intern/wm_event_system.c
index 6107bdd93b5..7f7571aa9ee 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -36,6 +36,7 @@
 #include <string.h>
 
 #include "DNA_listBase.h"
+#include "DNA_manipulator_types.h"
 #include "DNA_screen_types.h"
 #include "DNA_scene_types.h"
 #include "DNA_windowmanager_types.h"
diff --git a/source/blender/windowmanager/intern/wm_operators.c 
b/source/blender/windowmanager/intern/wm_operators.c
index d387df1d273..a13635c911e 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -176,6 +176,10 @@ void WM_operatortype_append(void (*opfunc)(wmOperatorType 
*))
                ot->name = N_("Dummy Name");
        }
 
+       if (ot->mgrouptype) {
+               ot->mgrouptype->flag |= WM_MANIPULATORGROUPTYPE_OP;
+       }
+
        /* XXX All ops should have a description but for now allow them not to. 
*/
        RNA_def_struct_ui_text(ot->srna, ot->name, ot->description ? 
ot->description : UNDOCUMENTED_OPERATOR_TIP);
        RNA_def_struct_identifier(ot->srna, ot->idname);
diff --git a/source/blender/windowmanager/manipulators/WM_manipulator_api.h 
b/source/blender/windowmanager/manipulators/WM_manipulator_api.h
index 099ad7fd851..c2d194c7c03 100644
--- a/source/blender/windowmanager/manipulators/WM_manipulator_api.h
+++ b/source/blender/windowmanager/manipulators/WM_manipulator_api.h
@@ -58,6 +58,9 @@ void WM_manipulator_delete(
 
 void WM_manipulator_set_property(struct wmManipulator *, int slot, struct 
PointerRNA *ptr, const char *propname);
 struct PointerRNA *WM_manipulator_set_operator(struct wmManipulator *, const 
char *opname);
+void WM_manipulator_set_custom_handler(
+        struct wmManipulator *manipulator,
+        int (*handler)(struct bContext *, const struct wmEvent *, struct 
wmManipulator *, const int));
 void WM_manipulator_set_func_select(
         struct wmManipulator *manipulator,
         void (*select)(struct bContext *, struct wmManipulator *, const int 
action)); /* wmManipulatorSelectFunc */
diff --git a/source/blender/windowmanager/manipulators/WM_manipulator_library.h 
b/source/blender/windowmanager/manipulators/WM_manipulator_library.h
new file mode 100644
index 00000000000..1e7106905e3
--- /dev/null
+++ b/source/blender/windowmanager/manipulators/WM_manipulator_library.h
@@ -0,0 +1,128 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file blender/windowmanager/manipulators/WM_manipulator_library.h
+ *  \ingroup wm
+ *
+ * \name Generic Manipulator Library
+ *
+ * Only included in WM_api.h and lower level files.
+ */
+
+
+#ifndef __WM_MANIPULATOR_LIBRARY_H__
+#define __WM_MANIPULATOR_LIBRARY_H__
+
+struct wmManipulatorGroup;
+
+
+/* -------------------------------------------------------------------- */
+/* 3D Arrow Manipulator */
+
+enum {
+       MANIPULATOR_ARROW_STYLE_NORMAL        =  1,
+       MANIPULATOR_ARROW_STYLE_NO_AXIS       = (1 << 1),
+       MANIPULATOR_ARROW_STYLE_CROSS         = (1 << 2),
+       MANIPULATOR_ARROW_STYLE_INVERTED      = (1 << 3), /* inverted offset 
during inter

@@ Diff output truncated at 10240 characters. @@

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to