Add ED_paint.h, split out ED_sculpt.h
authorCampbell Barton <ideasman42@gmail.com>
Mon, 23 Jun 2014 11:59:34 +0000 (21:59 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 23 Jun 2014 12:00:44 +0000 (22:00 +1000)
also rename some functions to match our convention

18 files changed:
source/blender/editors/include/ED_paint.h [new file with mode: 0644]
source/blender/editors/include/ED_sculpt.h
source/blender/editors/sculpt_paint/paint_image.c
source/blender/editors/sculpt_paint/paint_image_2d.c
source/blender/editors/sculpt_paint/paint_image_proj.c
source/blender/editors/sculpt_paint/paint_mask.c
source/blender/editors/sculpt_paint/paint_ops.c
source/blender/editors/sculpt_paint/paint_undo.c
source/blender/editors/sculpt_paint/sculpt.c
source/blender/editors/sculpt_paint/sculpt_undo.c
source/blender/editors/space_api/spacetypes.c
source/blender/editors/space_image/image_ops.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/space_view3d/view3d_edit.c
source/blender/editors/space_view3d/view3d_select.c
source/blender/editors/util/CMakeLists.txt
source/blender/editors/util/ed_util.c
source/blender/editors/util/undo.c

diff --git a/source/blender/editors/include/ED_paint.h b/source/blender/editors/include/ED_paint.h
new file mode 100644 (file)
index 0000000..d7e84d8
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ * ***** 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 ED_paint.h
+ *  \ingroup editors
+ */
+
+#ifndef __ED_PAINT_H__
+#define __ED_PAINT_H__
+
+struct bContext;
+struct RegionView3D;
+struct wmKeyConfig;
+
+/* paint_ops.c */
+void ED_operatortypes_paint(void);
+void ED_keymap_paint(struct wmKeyConfig *keyconf);
+
+/* paint_undo.c */
+enum {
+       UNDO_PAINT_IMAGE    = 0,
+       UNDO_PAINT_MESH     = 1,
+};
+
+typedef void (*UndoRestoreCb)(struct bContext *C, struct ListBase *lb);
+typedef void (*UndoFreeCb)(struct ListBase *lb);
+
+int ED_undo_paint_step(struct bContext *C, int type, int step, const char *name);
+void ED_undo_paint_step_num(struct bContext *C, int type, int num);
+const char *ED_undo_paint_get_name(struct bContext *C, int type, int nr, int *active);
+void ED_undo_paint_free(void);
+int ED_undo_paint_valid(int type, const char *name);
+bool ED_undo_paint_empty(int type);
+void ED_undo_paint_push_begin(int type, const char *name, UndoRestoreCb restore, UndoFreeCb free);
+void ED_undo_paint_push_end(int type);
+
+/* paint_image.c */
+/* image painting specific undo */
+void ED_image_undo_restore(struct bContext *C, struct ListBase *lb);
+void ED_image_undo_free(struct ListBase *lb);
+void ED_imapaint_clear_partial_redraw(void);
+void ED_imapaint_dirty_region(struct Image *ima, struct ImBuf *ibuf, int x, int y, int w, int h);
+
+#endif /* __ED_PAINT_H__ */
index 2e092f7e7fe150b1a9f230583b7c6d536f090a4e..85ff9b5d2460a2dc66653b0e7b12c3096ebc1811 100644 (file)
 
 struct ARegion;
 struct bContext;
-struct MultiresModifierData;
 struct Object;
 struct RegionView3D;
-struct wmKeyConfig;
-struct wmWindowManager;
 struct ViewContext;
 struct rcti;
 
 /* sculpt.c */
 void ED_operatortypes_sculpt(void);
-void sculpt_get_redraw_planes(float planes[4][4], struct ARegion *ar,
-                              struct RegionView3D *rv3d, struct Object *ob);
-void ED_sculpt_get_average_stroke(struct Object *ob, float stroke[3]);
+void ED_sculpt_redraw_planes_get(float planes[4][4], struct ARegion *ar,
+                                 struct RegionView3D *rv3d, struct Object *ob);
+void ED_sculpt_stroke_get_average(struct Object *ob, float stroke[3]);
 bool ED_sculpt_minmax(struct bContext *C, float min[3], float max[3]);
-int do_sculpt_mask_box_select(struct bContext *C, struct ViewContext *vc, struct rcti *rect, bool select, bool extend);
+int  ED_sculpt_mask_box_select(struct bContext *C, struct ViewContext *vc, const struct rcti *rect, bool select, bool extend);
 
-/* paint_ops.c */
-void ED_operatortypes_paint(void);
-void ED_keymap_paint(struct wmKeyConfig *keyconf);
-
-/* paint_undo.c */
-#define UNDO_PAINT_IMAGE    0
-#define UNDO_PAINT_MESH     1
-
-typedef void (*UndoRestoreCb)(struct bContext *C, struct ListBase *lb);
-typedef void (*UndoFreeCb)(struct ListBase *lb);
-
-int ED_undo_paint_step(struct bContext *C, int type, int step, const char *name);
-void ED_undo_paint_step_num(struct bContext *C, int type, int num);
-const char *ED_undo_paint_get_name(struct bContext *C, int type, int nr, int *active);
-void ED_undo_paint_free(void);
-int ED_undo_paint_valid(int type, const char *name);
-bool ED_undo_paint_empty(int type);
-void ED_undo_paint_push_begin(int type, const char *name, UndoRestoreCb restore, UndoFreeCb free);
-void ED_undo_paint_push_end(int type);
-
-/* image painting specific undo */
-void ED_image_undo_restore(struct bContext *C, struct ListBase *lb);
-void ED_image_undo_free(struct ListBase *lb);
-void ED_imapaint_clear_partial_redraw(void);
-void ED_imapaint_dirty_region(struct Image *ima, struct ImBuf *ibuf, int x, int y, int w, int h);
-
-
-#endif
+#endif /* __ED_SCULPT_H__ */
index d0def6b07d652a8153f4dab2fe05ef1eab321ff8..34232c51ff73f320c4e985dc3f14328d9aea2b27 100644 (file)
@@ -69,8 +69,8 @@
 
 #include "ED_image.h"
 #include "ED_object.h"
+#include "ED_paint.h"
 #include "ED_screen.h"
-#include "ED_sculpt.h"
 #include "ED_view3d.h"
 
 #include "WM_api.h"
index 667b487d4b16366ea10243275763a827e0b34ee4..4f67fc9cc8778d63d4fb7b51172b32306d60c374 100644 (file)
@@ -46,8 +46,8 @@
 #include "BKE_paint.h"
 #include "BKE_report.h"
 
+#include "ED_paint.h"
 #include "ED_screen.h"
-#include "ED_sculpt.h"
 
 #include "IMB_imbuf.h"
 #include "IMB_imbuf_types.h"
index cb2a94a053095609901f111ad14eeb3bacf336d3..399b5044a0574fa192d361b9ef898bac96726db3 100644 (file)
@@ -73,8 +73,8 @@
 
 #include "UI_view2d.h"
 
+#include "ED_paint.h"
 #include "ED_screen.h"
-#include "ED_sculpt.h"
 #include "ED_uvedit.h"
 #include "ED_view3d.h"
 
index 9363542ba05598eed9ddfc1b8b37b1e95d5b437e..364ebac42a7ec8437978963342ad8ba2722eed14 100644 (file)
@@ -184,7 +184,7 @@ static void flip_plane(float out[4], const float in[4], const char symm)
        out[3] = in[3];
 }
 
-int do_sculpt_mask_box_select(struct bContext *C, ViewContext *vc, rcti *rect, bool select, bool UNUSED(extend))
+int ED_sculpt_mask_box_select(struct bContext *C, ViewContext *vc, const rcti *rect, bool select, bool UNUSED(extend))
 {
        Sculpt *sd = vc->scene->toolsettings->sculpt;
        BoundBox bb;
index 543463cd5f3898e5f08f8a2d49a030380c1cdb95..9021581d47ff88c4d67f071da17df1d320c231c6 100644 (file)
@@ -40,7 +40,7 @@
 #include "BKE_paint.h"
 #include "BKE_main.h"
 
-#include "ED_sculpt.h"
+#include "ED_paint.h"
 #include "ED_screen.h"
 #include "ED_image.h"
 #include "UI_resources.h"
index 5bd6526c27046895e7762334187273c58a7febd4..c5c747dbab4142c96c87ddd6ec3f318fa64621f4 100644 (file)
@@ -38,7 +38,7 @@
 #include "BKE_context.h"
 #include "BKE_global.h"
 
-#include "ED_sculpt.h"
+#include "ED_paint.h"
 
 #include "paint_intern.h"
 
index b2927c83ad73fdb7485c112922843414216750dd..3f39dc7b6ecad6b4131ccf07db10567c5191f84d 100644 (file)
@@ -115,7 +115,7 @@ static int system_physical_thread_count(void)
 }
 #endif  /* __APPLE__ */
 
-void ED_sculpt_get_average_stroke(Object *ob, float stroke[3])
+void ED_sculpt_stroke_get_average(Object *ob, float stroke[3])
 {
        if (ob->sculpt->last_stroke_valid && ob->sculpt->average_stroke_counter > 0) {
                float fac = 1.0f / ob->sculpt->average_stroke_counter;
@@ -489,8 +489,8 @@ static bool sculpt_get_redraw_rect(ARegion *ar, RegionView3D *rv3d,
        return 1;
 }
 
-void sculpt_get_redraw_planes(float planes[4][4], ARegion *ar,
-                              RegionView3D *rv3d, Object *ob)
+void ED_sculpt_redraw_planes_get(float planes[4][4], ARegion *ar,
+                                 RegionView3D *rv3d, Object *ob)
 {
        PBVH *pbvh = ob->sculpt->pbvh;
        /* copy here, original will be used below */
@@ -4483,7 +4483,7 @@ static void sculpt_stroke_done(const bContext *C, struct PaintStroke *UNUSED(str
 
                /* update last stroke position */
                ob->sculpt->last_stroke_valid = 1;
-               ED_sculpt_get_average_stroke(ob, ob->sculpt->last_stroke);
+               ED_sculpt_stroke_get_average(ob, ob->sculpt->last_stroke);
 
                sculpt_cache_free(ss->cache);
                ss->cache = NULL;
index 71bd42f4fc4d2a42a522630e56ca32f1f2fc5069..0d49049c78e1b628dc0adbd8f3f03b0578b23af7 100644 (file)
@@ -62,7 +62,8 @@
 
 #include "GPU_buffers.h"
 
-#include "ED_sculpt.h"
+#include "ED_paint.h"
+
 #include "bmesh.h"
 #include "paint_intern.h"
 #include "sculpt_intern.h"
index 83040a2648030b2f20fd4c8538d3aabc253ce76d..7a74a58c69db6f39ee1b90ef12e4f33076e79d18 100644 (file)
@@ -53,6 +53,7 @@
 #include "ED_mesh.h"
 #include "ED_node.h"
 #include "ED_object.h"
+#include "ED_paint.h"
 #include "ED_physics.h"
 #include "ED_render.h"
 #include "ED_screen.h"
index cb2da0c13d22447e246e63788f747393c4cdc0a0..902398fb6d2276af73a7e6bbb152cbbc9ddd54ad 100644 (file)
@@ -72,6 +72,7 @@
 #include "RNA_enum_types.h"
 
 #include "ED_image.h"
+#include "ED_paint.h"
 #include "ED_render.h"
 #include "ED_screen.h"
 #include "ED_space_api.h"
@@ -88,7 +89,6 @@
 #include "PIL_time.h"
 
 #include "image_intern.h"
-#include "ED_sculpt.h"
 
 /******************** view navigation utilities *********************/
 
index a0f6d0d5372bebfa7ddb3e087e5f780ccd217971..0e010eff94d3b47f0a4e5fdc857205e4712abd3e 100644 (file)
@@ -3750,7 +3750,7 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
 
                                if (ob->sculpt->partial_redraw) {
                                        if (ar->do_draw & RGN_DRAW_PARTIAL) {
-                                               sculpt_get_redraw_planes(planes, ar, rv3d, ob);
+                                               ED_sculpt_redraw_planes_get(planes, ar, rv3d, ob);
                                                fpl = planes;
                                                ob->sculpt->partial_redraw = 0;
                                        }
@@ -3848,7 +3848,7 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
 
                                if (ob->sculpt->partial_redraw) {
                                        if (ar->do_draw & RGN_DRAW_PARTIAL) {
-                                               sculpt_get_redraw_planes(planes, ar, rv3d, ob);
+                                               ED_sculpt_redraw_planes_get(planes, ar, rv3d, ob);
                                                fpl = planes;
                                                ob->sculpt->partial_redraw = 0;
                                        }
index 98a0d548096b21dc06965e5a1b9e6c620f145963..26ede27bb08b0f199651f53733857f9172b31c2e 100644 (file)
@@ -558,7 +558,7 @@ static bool view3d_orbit_calc_center(bContext *C, float r_dyn_ofs[3])
                 */
                if (ob->mode & OB_MODE_SCULPT) {
                        float stroke[3];
-                       ED_sculpt_get_average_stroke(ob, stroke);
+                       ED_sculpt_stroke_get_average(ob, stroke);
                        copy_v3_v3(lastofs, stroke);
                }
                else {
index 1f1317bde2c570a99356f10a5974d7d6dcebdbaa..32f063d6154740275e3d344653aff20a2f57600b 100644 (file)
@@ -2128,7 +2128,7 @@ static int view3d_borderselect_exec(bContext *C, wmOperator *op)
        }
        else {  /* no editmode, unified for bones and objects */
                if (vc.obact && vc.obact->mode & OB_MODE_SCULPT) {
-                       ret = do_sculpt_mask_box_select(C, &vc, &rect, select, extend);
+                       ret = ED_sculpt_mask_box_select(C, &vc, &rect, select, extend);
                }
                else if (vc.obact && BKE_paint_select_face_test(vc.obact)) {
                        ret = do_paintface_box_select(&vc, &rect, select, extend);
index 3c051586282dd47122979f169cee1bac421d766c..4400870f1b87aca008dcdeabb0d3a08189069abd 100644 (file)
@@ -67,6 +67,7 @@ set(SRC
        ../include/ED_node.h
        ../include/ED_numinput.h
        ../include/ED_object.h
+       ../include/ED_paint.h
        ../include/ED_particle.h
        ../include/ED_physics.h
        ../include/ED_render.h
index 4dfaed98aab7bfc6c2906c4d54e8b33132b40239..c27e0b80b025c7f8d6358a227e868b1fa1362015 100644 (file)
@@ -61,7 +61,7 @@
 #include "ED_image.h"
 #include "ED_mesh.h"
 #include "ED_object.h"
-#include "ED_sculpt.h"
+#include "ED_paint.h"
 #include "ED_space_api.h"
 #include "ED_util.h"
 
index 458b6e1b4816ddc296005603d5c64675e2d5c329..9461010f49f6eda44c92815e853967f9e922c34a 100644 (file)
@@ -58,7 +58,7 @@
 #include "ED_object.h"
 #include "ED_render.h"
 #include "ED_screen.h"
-#include "ED_sculpt.h"
+#include "ED_paint.h"
 #include "ED_util.h"
 #include "ED_text.h"