|
Blender
V2.59
|
00001 /* 00002 * $Id: ED_gpencil.h 36644 2011-05-12 16:47:36Z campbellbarton $ 00003 * 00004 * ***** BEGIN GPL LICENSE BLOCK ***** 00005 * 00006 * This program is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU General Public License 00008 * as published by the Free Software Foundation; either version 2 00009 * of the License, or (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software Foundation, 00018 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00019 * 00020 * The Original Code is Copyright (C) 2008, Blender Foundation 00021 * This is a new part of Blender 00022 * 00023 * Contributor(s): Joshua Leung 00024 * 00025 * ***** END GPL LICENSE BLOCK ***** 00026 */ 00027 00032 #ifndef ED_GPENCIL_H 00033 #define ED_GPENCIL_H 00034 00035 struct ListBase; 00036 struct bContext; 00037 struct bScreen; 00038 struct ScrArea; 00039 struct ARegion; 00040 struct View3D; 00041 struct SpaceNode; 00042 struct SpaceSeq; 00043 struct bGPdata; 00044 struct bGPDlayer; 00045 struct bGPDframe; 00046 struct PointerRNA; 00047 struct Panel; 00048 struct ImBuf; 00049 struct wmKeyConfig; 00050 00051 00052 /* ------------- Grease-Pencil Helpers ---------------- */ 00053 00054 /* Temporary 'Stroke Point' data 00055 * 00056 * Used as part of the 'stroke cache' used during drawing of new strokes 00057 */ 00058 typedef struct tGPspoint { 00059 int x, y; /* x and y coordinates of cursor (in relative to area) */ 00060 float pressure; /* pressure of tablet at this point */ 00061 } tGPspoint; 00062 00063 00064 /* Check if 'sketching sessions' are enabled */ 00065 #define GPENCIL_SKETCH_SESSIONS_ON(scene) ((scene)->toolsettings->gpencil_flags & GP_TOOL_FLAG_PAINTSESSIONS_ON) 00066 00067 /* ----------- Grease Pencil Tools/Context ------------- */ 00068 00069 struct bGPdata **gpencil_data_get_pointers(struct bContext *C, struct PointerRNA *ptr); 00070 struct bGPdata *gpencil_data_get_active(struct bContext *C); 00071 struct bGPdata *gpencil_data_get_active_v3d(struct Scene *scene); /* for offscreen rendering */ 00072 00073 /* ----------- Grease Pencil Operators ----------------- */ 00074 00075 void ED_keymap_gpencil(struct wmKeyConfig *keyconf); 00076 void ED_operatortypes_gpencil(void); 00077 00078 /* ------------ Grease-Pencil Drawing API ------------------ */ 00079 /* drawgpencil.c */ 00080 00081 void draw_gpencil_2dimage(struct bContext *C, struct ImBuf *ibuf); 00082 void draw_gpencil_view2d(struct bContext *C, short onlyv2d); 00083 void draw_gpencil_view3d(struct bContext *C, short only3d); 00084 void draw_gpencil_view3d_ext(struct Scene *scene, struct View3D *v3d, struct ARegion *ar, short only3d); 00085 00086 void gpencil_panel_standard(const struct bContext *C, struct Panel *pa); 00087 00088 /* ----------- Grease-Pencil AnimEdit API ------------------ */ 00089 short gplayer_frames_looper(struct bGPDlayer *gpl, struct Scene *scene, short (*gpf_cb)(struct bGPDframe *, struct Scene *)); 00090 void gplayer_make_cfra_list(struct bGPDlayer *gpl, ListBase *elems, short onlysel); 00091 00092 void deselect_gpencil_layers(void *data, short select_mode); 00093 00094 short is_gplayer_frame_selected(struct bGPDlayer *gpl); 00095 void set_gplayer_frame_selection(struct bGPDlayer *gpl, short mode); 00096 void select_gpencil_frames(struct bGPDlayer *gpl, short select_mode); 00097 void select_gpencil_frame(struct bGPDlayer *gpl, int selx, short select_mode); 00098 void borderselect_gplayer_frames(struct bGPDlayer *gpl, float min, float max, short select_mode); 00099 00100 void delete_gpencil_layers(void); 00101 void delete_gplayer_frames(struct bGPDlayer *gpl); 00102 void duplicate_gplayer_frames(struct bGPDlayer *gpd); 00103 00104 void free_gpcopybuf(void); 00105 void copy_gpdata(void); 00106 void paste_gpdata(void); 00107 00108 void snap_gplayer_frames(struct bGPDlayer *gpl, short mode); 00109 void mirror_gplayer_frames(struct bGPDlayer *gpl, short mode); 00110 00111 #endif /* ED_GPENCIL_H */