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