1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
17 /** \file
18  * \ingroup editors
19  */
20 
21 #pragma once
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 struct ImBuf;
28 struct Image;
29 struct ImageUser;
30 struct UndoStep;
31 struct UndoType;
32 struct bContext;
33 struct wmKeyConfig;
34 struct wmOperator;
35 
36 /* paint_ops.c */
37 void ED_operatortypes_paint(void);
38 void ED_operatormacros_paint(void);
39 void ED_keymap_paint(struct wmKeyConfig *keyconf);
40 
41 /* paint_image.c */
42 void ED_imapaint_clear_partial_redraw(void);
43 void ED_imapaint_dirty_region(struct Image *ima,
44                               struct ImBuf *ibuf,
45                               struct ImageUser *iuser,
46                               int x,
47                               int y,
48                               int w,
49                               int h,
50                               bool find_old);
51 void ED_imapaint_bucket_fill(struct bContext *C,
52                              float color[3],
53                              struct wmOperator *op,
54                              const int mouse[2]);
55 
56 /* paint_image_proj.c */
57 void ED_paint_data_warning(struct ReportList *reports, bool uvs, bool mat, bool tex, bool stencil);
58 bool ED_paint_proj_mesh_data_check(
59     struct Scene *scene, struct Object *ob, bool *uvs, bool *mat, bool *tex, bool *stencil);
60 
61 /* image_undo.c */
62 void ED_image_undo_push_begin(const char *name, int paint_mode);
63 void ED_image_undo_push_begin_with_image(const char *name,
64                                          struct Image *image,
65                                          struct ImBuf *ibuf,
66                                          struct ImageUser *iuser);
67 
68 void ED_image_undo_push_end(void);
69 void ED_image_undo_restore(struct UndoStep *us);
70 
71 void ED_image_undosys_type(struct UndoType *ut);
72 
73 void *ED_image_paint_tile_find(struct ListBase *paint_tiles,
74                                struct Image *image,
75                                struct ImBuf *ibuf,
76                                struct ImageUser *iuser,
77                                int x_tile,
78                                int y_tile,
79                                unsigned short **r_mask,
80                                bool validate);
81 void *ED_image_paint_tile_push(struct ListBase *paint_tiles,
82                                struct Image *image,
83                                struct ImBuf *ibuf,
84                                struct ImBuf **tmpibuf,
85                                struct ImageUser *iuser,
86                                int x_tile,
87                                int y_tile,
88                                unsigned short **r_mask,
89                                bool **r_valid,
90                                bool use_thread_lock,
91                                bool find_prev);
92 void ED_image_paint_tile_lock_init(void);
93 void ED_image_paint_tile_lock_end(void);
94 
95 struct ListBase *ED_image_paint_tile_list_get(void);
96 
97 #define ED_IMAGE_UNDO_TILE_BITS 6
98 #define ED_IMAGE_UNDO_TILE_SIZE (1 << ED_IMAGE_UNDO_TILE_BITS)
99 #define ED_IMAGE_UNDO_TILE_NUMBER(size) \
100   (((size) + ED_IMAGE_UNDO_TILE_SIZE - 1) >> ED_IMAGE_UNDO_TILE_BITS)
101 
102 /* paint_curve_undo.c */
103 void ED_paintcurve_undo_push_begin(const char *name);
104 void ED_paintcurve_undo_push_end(void);
105 
106 void ED_paintcurve_undosys_type(struct UndoType *ut);
107 
108 #ifdef __cplusplus
109 }
110 #endif
111