[Bf-blender-cvs] [7df2717] master: Add ED_paint.h, split out ED_sculpt.h

Campbell Barton noreply at git.blender.org
Mon Jun 23 14:02:54 CEST 2014


Commit: 7df2717727b1430fe4406e24110348b5cbaa788b
Author: Campbell Barton
Date:   Mon Jun 23 21:59:34 2014 +1000
https://developer.blender.org/rB7df2717727b1430fe4406e24110348b5cbaa788b

Add ED_paint.h, split out ED_sculpt.h

also rename some functions to match our convention

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

A	source/blender/editors/include/ED_paint.h
M	source/blender/editors/include/ED_sculpt.h
M	source/blender/editors/sculpt_paint/paint_image.c
M	source/blender/editors/sculpt_paint/paint_image_2d.c
M	source/blender/editors/sculpt_paint/paint_image_proj.c
M	source/blender/editors/sculpt_paint/paint_mask.c
M	source/blender/editors/sculpt_paint/paint_ops.c
M	source/blender/editors/sculpt_paint/paint_undo.c
M	source/blender/editors/sculpt_paint/sculpt.c
M	source/blender/editors/sculpt_paint/sculpt_undo.c
M	source/blender/editors/space_api/spacetypes.c
M	source/blender/editors/space_image/image_ops.c
M	source/blender/editors/space_view3d/drawobject.c
M	source/blender/editors/space_view3d/view3d_edit.c
M	source/blender/editors/space_view3d/view3d_select.c
M	source/blender/editors/util/CMakeLists.txt
M	source/blender/editors/util/ed_util.c
M	source/blender/editors/util/undo.c

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

diff --git a/source/blender/editors/include/ED_sculpt.h b/source/blender/editors/include/ED_paint.h
similarity index 67%
copy from source/blender/editors/include/ED_sculpt.h
copy to source/blender/editors/include/ED_paint.h
index 2e092f7..d7e84d8 100644
--- a/source/blender/editors/include/ED_sculpt.h
+++ b/source/blender/editors/include/ED_paint.h
@@ -4,7 +4,7 @@
  * 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. 
+ * 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
@@ -15,46 +15,29 @@
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
- * The Original Code is Copyright (C) 2008 Blender Foundation.
- * All rights reserved.
- *
- * Contributor(s): Nicholas Bishop
- *
  * ***** END GPL LICENSE BLOCK *****
  */
 
-/** \file ED_sculpt.h
+/** \file ED_paint.h
  *  \ingroup editors
  */
 
-#ifndef __ED_SCULPT_H__
-#define __ED_SCULPT_H__
+#ifndef __ED_PAINT_H__
+#define __ED_PAINT_H__
 
-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]);
-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);
 
 /* 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
+enum {
+	UNDO_PAINT_IMAGE    = 0,
+	UNDO_PAINT_MESH     = 1,
+};
 
 typedef void (*UndoRestoreCb)(struct bContext *C, struct ListBase *lb);
 typedef void (*UndoFreeCb)(struct ListBase *lb);
@@ -68,11 +51,11 @@ 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
+#endif /* __ED_PAINT_H__ */
diff --git a/source/blender/editors/include/ED_sculpt.h b/source/blender/editors/include/ED_sculpt.h
index 2e092f7..85ff9b5 100644
--- a/source/blender/editors/include/ED_sculpt.h
+++ b/source/blender/editors/include/ED_sculpt.h
@@ -32,47 +32,17 @@
 
 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__ */
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index d0def6b..34232c5 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -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"
diff --git a/source/blender/editors/sculpt_paint/paint_image_2d.c b/source/blender/editors/sculpt_paint/paint_image_2d.c
index 667b487..4f67fc9 100644
--- a/source/blender/editors/sculpt_paint/paint_image_2d.c
+++ b/source/blender/editors/sculpt_paint/paint_image_2d.c
@@ -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"
diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c
index cb2a94a..399b504 100644
--- a/source/blender/editors/sculpt_paint/paint_image_proj.c
+++ b/source/blender/editors/sculpt_paint/paint_image_proj.c
@@ -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"
 
diff --git a/source/blender/editors/sculpt_paint/paint_mask.c b/source/blender/editors/sculpt_paint/paint_mask.c
index 9363542..364ebac 100644
--- a/source/blender/editors/sculpt_paint/paint_mask.c
+++ b/source/blender/editors/sculpt_paint/paint_mask.c
@@ -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;
diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c
index 543463c..9021581 100644
--- a/source/blender/editors/sculpt_paint/paint_ops.c
+++ b/source/blender/editors/sculpt_paint/paint_ops.c
@@ -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"
diff --git a/source/blender/editors/sculpt_paint/paint_undo.c b/source/blender/editors/sculpt_paint/paint_undo.c
index 5bd6526..c5c747d 100644
--- a/source/blender/editors/sculpt_paint/paint_undo.c
+++ b/source/blender/editors/sculpt_paint/paint_undo.c
@@ -38,7 +38,7 @@
 #include "BKE_context.h"
 #include "BKE_global.h"
 
-#include "ED_sculpt.h"
+#include "ED_paint.h"
 
 #include "paint_intern.h"
 
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index b2927c8..3f39dc7 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -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;
diff --git a/source/blender/editors/sculpt_paint/sculpt_undo.c b/source/blender/editors/sculpt_paint/sculpt_undo.c
index 71bd42f..0d49049 100644
--- a/source/blender/editors/sculpt_paint/sculpt_undo.c
+++ b/source/blender/editors/sculpt_paint/sculpt_undo.c
@@ -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"
diff --git a/source/blender/editors/space_api/spacetypes.c b/source/blender/editors/space_api/spacetypes.c
index 83040a2..7a74a58 100644
--- a/source/blender/editors/space_api/s

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list