diff options
Diffstat (limited to 'source/blender/editors/include')
-rw-r--r-- | source/blender/editors/include/ED_armature.h | 2 | ||||
-rw-r--r-- | source/blender/editors/include/ED_curve.h | 3 | ||||
-rw-r--r-- | source/blender/editors/include/ED_gpencil.h | 2 | ||||
-rw-r--r-- | source/blender/editors/include/ED_image.h | 3 | ||||
-rw-r--r-- | source/blender/editors/include/ED_keyframing.h | 5 | ||||
-rw-r--r-- | source/blender/editors/include/ED_mball.h | 2 | ||||
-rw-r--r-- | source/blender/editors/include/ED_mesh.h | 12 | ||||
-rw-r--r-- | source/blender/editors/include/ED_node.h | 3 | ||||
-rw-r--r-- | source/blender/editors/include/ED_object.h | 2 | ||||
-rw-r--r-- | source/blender/editors/include/ED_particle.h | 9 | ||||
-rw-r--r-- | source/blender/editors/include/ED_screen.h | 3 | ||||
-rw-r--r-- | source/blender/editors/include/ED_types.h | 4 | ||||
-rw-r--r-- | source/blender/editors/include/ED_util.h | 6 | ||||
-rw-r--r-- | source/blender/editors/include/ED_view3d.h | 177 | ||||
-rw-r--r-- | source/blender/editors/include/UI_interface.h | 13 | ||||
-rw-r--r-- | source/blender/editors/include/UI_interface_icons.h | 4 |
16 files changed, 176 insertions, 74 deletions
diff --git a/source/blender/editors/include/ED_armature.h b/source/blender/editors/include/ED_armature.h index 36923736068..a029c5c1f12 100644 --- a/source/blender/editors/include/ED_armature.h +++ b/source/blender/editors/include/ED_armature.h @@ -117,7 +117,7 @@ void ED_armature_deselect_all_visible(struct Object *obedit); int ED_do_pose_selectbuffer(struct Scene *scene, struct Base *base, unsigned int *buffer, short hits, short extend); -int mouse_armature(struct bContext *C, const short mval[2], int extend); +int mouse_armature(struct bContext *C, const int mval[2], int extend); int join_armature_exec(struct bContext *C, struct wmOperator *op); struct Bone *get_indexed_bone (struct Object *ob, int index); float ED_rollBoneToVector(EditBone *bone, const float new_up_axis[3], const short axis_only); diff --git a/source/blender/editors/include/ED_curve.h b/source/blender/editors/include/ED_curve.h index cfafd38ed15..d78d2846572 100644 --- a/source/blender/editors/include/ED_curve.h +++ b/source/blender/editors/include/ED_curve.h @@ -66,11 +66,12 @@ void free_editNurb (struct Object *obedit); void free_curve_editNurb (struct Curve *cu); -int mouse_nurb (struct bContext *C, const short mval[2], int extend); +int mouse_nurb (struct bContext *C, const int mval[2], int extend); struct Nurb *add_nurbs_primitive(struct bContext *C, float mat[4][4], int type, int newob); int isNurbsel (struct Nurb *nu); +void ED_nurb_set_spline_type(struct Nurb *nu, int type); int join_curve_exec (struct bContext *C, struct wmOperator *op); diff --git a/source/blender/editors/include/ED_gpencil.h b/source/blender/editors/include/ED_gpencil.h index d06b0d6c4ee..e5715316a31 100644 --- a/source/blender/editors/include/ED_gpencil.h +++ b/source/blender/editors/include/ED_gpencil.h @@ -56,7 +56,7 @@ struct wmKeyConfig; * Used as part of the 'stroke cache' used during drawing of new strokes */ typedef struct tGPspoint { - short x, y; /* x and y coordinates of cursor (in relative to area) */ + int x, y; /* x and y coordinates of cursor (in relative to area) */ float pressure; /* pressure of tablet at this point */ } tGPspoint; diff --git a/source/blender/editors/include/ED_image.h b/source/blender/editors/include/ED_image.h index 2c866495503..cfe9ea53d9a 100644 --- a/source/blender/editors/include/ED_image.h +++ b/source/blender/editors/include/ED_image.h @@ -68,8 +68,5 @@ int ED_space_image_show_uvshadow(struct SpaceImage *sima, struct Object *obedit) /* UI level image (texture) updating... render calls own stuff (too) */ void ED_image_update_frame(const struct Main *mainp, int cfra); -/* image_render.c, export for screen_ops.c, render operator */ -void ED_space_image_output(struct bContext *C); - #endif /* ED_IMAGE_H */ diff --git a/source/blender/editors/include/ED_keyframing.h b/source/blender/editors/include/ED_keyframing.h index 7bab563641a..294b9b8475a 100644 --- a/source/blender/editors/include/ED_keyframing.h +++ b/source/blender/editors/include/ED_keyframing.h @@ -36,6 +36,7 @@ extern "C" { #endif +struct Main; struct ListBase; struct ID; struct Scene; @@ -190,7 +191,7 @@ KeyingSetInfo *ANIM_keyingset_info_find_named(const char name[]); /* for RNA type registrations... */ void ANIM_keyingset_info_register(KeyingSetInfo *ksi); -void ANIM_keyingset_info_unregister(const struct bContext *C, KeyingSetInfo *ksi); +void ANIM_keyingset_info_unregister(struct Main *bmain, KeyingSetInfo *ksi); /* cleanup on exit */ void ANIM_keyingset_infos_exit(void); @@ -210,7 +211,7 @@ struct KeyingSet *ANIM_get_keyingset_for_autokeying(struct Scene *scene, const c void ANIM_keying_sets_menu_setup(struct bContext *C, const char title[], const char op_name[]); /* Dynamically populate an enum of Keying Sets */ -struct EnumPropertyItem *ANIM_keying_sets_enum_itemf(struct bContext *C, struct PointerRNA *ptr, int *free); +struct EnumPropertyItem *ANIM_keying_sets_enum_itemf(struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop, int *free); /* Check if KeyingSet can be used in the current context */ short ANIM_keyingset_context_ok_poll(struct bContext *C, struct KeyingSet *ks); diff --git a/source/blender/editors/include/ED_mball.h b/source/blender/editors/include/ED_mball.h index a742be7337c..2afc3155398 100644 --- a/source/blender/editors/include/ED_mball.h +++ b/source/blender/editors/include/ED_mball.h @@ -42,7 +42,7 @@ void ED_keymap_metaball(struct wmKeyConfig *keyconf); struct MetaElem *add_metaball_primitive(struct bContext *C, float mat[4][4], int type, int newname); -int mouse_mball(struct bContext *C, const short mval[2], int extend); +int mouse_mball(struct bContext *C, const int mval[2], int extend); void free_editMball(struct Object *obedit); void make_editMball(struct Object *obedit); diff --git a/source/blender/editors/include/ED_mesh.h b/source/blender/editors/include/ED_mesh.h index c3c843154e5..8bb77ad43a0 100644 --- a/source/blender/editors/include/ED_mesh.h +++ b/source/blender/editors/include/ED_mesh.h @@ -169,9 +169,9 @@ void EM_project_snap_verts(struct bContext *C, struct ARegion *ar, struct Object extern unsigned int em_vertoffs, em_solidoffs, em_wireoffs; void EM_cache_x_mirror_vert(struct Object *ob, struct EditMesh *em); -int mouse_mesh(struct bContext *C, const short mval[2], short extend); +int mouse_mesh(struct bContext *C, const int mval[2], short extend); int EM_check_backbuf(unsigned int index); -int EM_mask_init_backbuf_border(struct ViewContext *vc, short mcords[][2], short tot, short xmin, short ymin, short xmax, short ymax); +int EM_mask_init_backbuf_border(struct ViewContext *vc, int mcords[][2], short tot, short xmin, short ymin, short xmax, short ymax); void EM_free_backbuf(void); int EM_init_backbuf_border(struct ViewContext *vc, short xmin, short ymin, short xmax, short ymax); int EM_init_backbuf_circle(struct ViewContext *vc, short xs, short ys, short rads); @@ -187,10 +187,10 @@ void EM_automerge(struct Scene *scene, struct Object *obedit, int update); /* editface.c */ void paintface_flush_flags(struct Object *ob); struct MTFace *EM_get_active_mtface(struct EditMesh *em, struct EditFace **act_efa, struct MCol **mcol, int sloppy); -int paintface_mouse_select(struct bContext *C, struct Object *ob, const short mval[2], int extend); +int paintface_mouse_select(struct bContext *C, struct Object *ob, const int mval[2], int extend); int do_paintface_box_select(struct ViewContext *vc, struct rcti *rect, int select, int extend); void paintface_deselect_all_visible(struct Object *ob, int action, short flush_flags); -void paintface_select_linked(struct bContext *C, struct Object *ob, short mval[2], int mode); +void paintface_select_linked(struct bContext *C, struct Object *ob, int mval[2], int mode); int paintface_minmax(struct Object *ob, float *min, float *max); void paintface_hide(struct Object *ob, const int unselected); @@ -206,10 +206,10 @@ struct bDeformGroup *ED_vgroup_add(struct Object *ob); struct bDeformGroup *ED_vgroup_add_name(struct Object *ob, const char *name); void ED_vgroup_delete(struct Object *ob, struct bDeformGroup *defgroup); void ED_vgroup_select_by_name(struct Object *ob, const char *name); -void ED_vgroup_data_create(struct ID *id); +int ED_vgroup_data_create(struct ID *id); int ED_vgroup_give_array(struct ID *id, struct MDeformVert **dvert_arr, int *dvert_tot); int ED_vgroup_copy_array(struct Object *ob, struct Object *ob_from); -void ED_vgroup_mirror(struct Object *ob, int mirror_weights, int flip_vgroups); +void ED_vgroup_mirror(struct Object *ob, const short mirror_weights, const short flip_vgroups); int ED_vgroup_object_is_edit_mode(struct Object *ob); diff --git a/source/blender/editors/include/ED_node.h b/source/blender/editors/include/ED_node.h index 829ad3217a9..dfa457c22de 100644 --- a/source/blender/editors/include/ED_node.h +++ b/source/blender/editors/include/ED_node.h @@ -39,6 +39,7 @@ struct Tex; struct bContext; struct bNode; struct ID; +struct ScrArea; /* drawnode.c */ void ED_init_node_butfuncs(void); @@ -51,6 +52,8 @@ void ED_node_generic_update(struct Main *bmain, struct bNodeTree *ntree, struct void ED_node_shader_default(struct Material *ma); void ED_node_composit_default(struct Scene *sce); void ED_node_texture_default(struct Tex *tex); +void ED_node_link_intersect_test(struct ScrArea *sa, int test); +void ED_node_link_insert(struct ScrArea *sa); /* node ops.c */ void ED_operatormacros_node(void); diff --git a/source/blender/editors/include/ED_object.h b/source/blender/editors/include/ED_object.h index 3b27fb45f5d..28d0a9520b2 100644 --- a/source/blender/editors/include/ED_object.h +++ b/source/blender/editors/include/ED_object.h @@ -126,7 +126,7 @@ void ED_object_constraint_update(struct Object *ob); void ED_object_constraint_dependency_update(struct Main *bmain, struct Scene *scene, struct Object *ob); /* object_lattice.c */ -int mouse_lattice(struct bContext *C, const short mval[2], int extend); +int mouse_lattice(struct bContext *C, const int mval[2], int extend); void undo_push_lattice(struct bContext *C, const char *name); /* object_lattice.c */ diff --git a/source/blender/editors/include/ED_particle.h b/source/blender/editors/include/ED_particle.h index f29284fe64d..f2973d0d070 100644 --- a/source/blender/editors/include/ED_particle.h +++ b/source/blender/editors/include/ED_particle.h @@ -60,10 +60,10 @@ void PE_hide_keys_time(struct Scene *scene, struct PTCacheEdit *edit, float cfra void PE_update_object(struct Scene *scene, struct Object *ob, int useflag); /* selection tools */ -int PE_mouse_particles(struct bContext *C, const short mval[2], int extend); +int PE_mouse_particles(struct bContext *C, const int mval[2], int extend); int PE_border_select(struct bContext *C, struct rcti *rect, int select, int extend); -int PE_circle_select(struct bContext *C, int selecting, const short mval[2], float rad); -int PE_lasso_select(struct bContext *C, short mcords[][2], short moves, short extend, short select); +int PE_circle_select(struct bContext *C, int selecting, const int mval[2], float rad); +int PE_lasso_select(struct bContext *C, int mcords[][2], short moves, short extend, short select); void PE_deselect_all_visible(struct PTCacheEdit *edit); /* undo */ @@ -71,8 +71,9 @@ void PE_undo_push(struct Scene *scene, const char *str); void PE_undo_step(struct Scene *scene, int step); void PE_undo(struct Scene *scene); void PE_redo(struct Scene *scene); -void PE_undo_menu(struct Scene *scene, struct Object *ob); int PE_undo_valid(struct Scene *scene); +void PE_undo_number(struct Scene *scene, int nr); +char *PE_undo_get_name(struct Scene *scene, int nr, int *active); #endif /* ED_PARTICLE_H */ diff --git a/source/blender/editors/include/ED_screen.h b/source/blender/editors/include/ED_screen.h index 93ce82fa483..f2ef4e16852 100644 --- a/source/blender/editors/include/ED_screen.h +++ b/source/blender/editors/include/ED_screen.h @@ -90,6 +90,7 @@ void ED_area_headerprint(ScrArea *sa, const char *str); void ED_area_newspace(struct bContext *C, ScrArea *sa, int type); void ED_area_prevspace(struct bContext *C, ScrArea *sa); void ED_area_swapspace(struct bContext *C, ScrArea *sa1, ScrArea *sa2); +int ED_area_headersize(void); /* screens */ void ED_screens_initialize(struct wmWindowManager *wm); @@ -106,7 +107,7 @@ void ED_screen_set_subwinactive(struct bContext *C, struct wmEvent *event); void ED_screen_exit(struct bContext *C, struct wmWindow *window, struct bScreen *screen); void ED_screen_animation_timer(struct bContext *C, int redraws, int refresh, int sync, int enable); void ED_screen_animation_timer_update(struct bScreen *screen, int redraws, int refresh); -int ED_screen_full_newspace(struct bContext *C, ScrArea *sa, int type); +ScrArea *ED_screen_full_newspace(struct bContext *C, ScrArea *sa, int type); void ED_screen_full_prevspace(struct bContext *C, ScrArea *sa); void ED_screen_full_restore(struct bContext *C, ScrArea *sa); struct ScrArea *ED_screen_full_toggle(struct bContext *C, struct wmWindow *win, struct ScrArea *sa); diff --git a/source/blender/editors/include/ED_types.h b/source/blender/editors/include/ED_types.h index 0218b8d9c2d..c1c31372011 100644 --- a/source/blender/editors/include/ED_types.h +++ b/source/blender/editors/include/ED_types.h @@ -40,10 +40,6 @@ #define SELECT 1 #define ACTIVE 2 -/* buttons */ -#define XIC 20 -#define YIC 20 - /* proposal = put scene pointers on function calls? */ // #define BASACT (scene->basact) // #define OBACT (BASACT? BASACT->object: NULL) diff --git a/source/blender/editors/include/ED_util.h b/source/blender/editors/include/ED_util.h index 77b754519fb..5e004fd8d47 100644 --- a/source/blender/editors/include/ED_util.h +++ b/source/blender/editors/include/ED_util.h @@ -59,6 +59,7 @@ void ED_undo_redo (struct bContext *C); void ED_OT_undo (struct wmOperatorType *ot); void ED_OT_undo_push (struct wmOperatorType *ot); void ED_OT_redo (struct wmOperatorType *ot); +void ED_OT_undo_history (struct wmOperatorType *ot); int ED_undo_operator_repeat(struct bContext *C, struct wmOperator *op); /* convenience since UI callbacks use this mostly*/ @@ -76,17 +77,12 @@ void undo_editmode_push(struct bContext *C, const char *name, int (*validate_undo)(void *, void *)); -void *undo_editmode_get_prev (struct Object *ob); -struct uiBlock *editmode_undohistorymenu(struct bContext *C, struct ARegion *ar, void *arg_unused); -void undo_editmode_menu (struct bContext *C); void undo_editmode_clear (void); -void undo_editmode_step (struct bContext *C, int step); /* crazyspace.c */ float *crazyspace_get_mapped_editverts(struct Scene *scene, struct Object *obedit); void crazyspace_set_quats_editmesh(struct EditMesh *em, float *origcos, float *mappedcos, float *quats); void crazyspace_set_quats_mesh(struct Mesh *me, float *origcos, float *mappedcos, float *quats); -int editmesh_get_first_deform_matrices(struct Scene *scene, struct Object *ob, struct EditMesh *em, float (**deformmats)[3][3], float (**deformcos)[3]); int sculpt_get_first_deform_matrices(struct Scene *scene, struct Object *ob, float (**deformmats)[3][3], float (**deformcos)[3]); void crazyspace_build_sculpt(struct Scene *scene, struct Object *ob, float (**deformmats)[3][3], float (**deformcos)[3]); diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h index 297bd234edd..dfe0a304748 100644 --- a/source/blender/editors/include/ED_view3d.h +++ b/source/blender/editors/include/ED_view3d.h @@ -64,7 +64,7 @@ typedef struct ViewContext { struct View3D *v3d; struct RegionView3D *rv3d; struct EditMesh *em; - short mval[2]; + int mval[2]; } ViewContext; typedef struct ViewDepths { @@ -80,20 +80,123 @@ typedef struct ViewDepths { float *give_cursor(struct Scene *scene, struct View3D *v3d); int initgrabz(struct RegionView3D *rv3d, float x, float y, float z); -void window_to_3d(struct ARegion *ar, float out[3], short mx, short my); -void window_to_3d_delta(struct ARegion *ar, float out[3], short mx, short my); -void window_to_3d_vector(struct ARegion *ar, float out[3], short mx, short my); + +/** + * Calculate a 3d location from 2d window coordinates. + * @param ar The region (used for the window width and height). + * @param depth_pt The reference location used to calculate the Z depth. + * @param mval The area relative location (such as event->mval converted to floats). + * @param out The resulting world-space location. + */ +void ED_view3d_win_to_3d(struct ARegion *ar, const float depth_pt[3], const float mval[2], float out[3]); + +/** + * Calculate a 3d difference vector from 2d window offset. + * note that initgrabz() must be called first to determine + * the depth used to calculate the delta. + * @param ar The region (used for the window width and height). + * @param mval The area relative 2d difference (such as event->mval[0] - other_x). + * @param out The resulting world-space delta. + */ +void ED_view3d_win_to_delta(struct ARegion *ar, const float mval[2], float out[3]); + +/** + * Calculate a 3d direction vector from 2d window coordinates. + * This direction vector starts and the view in the direction of the 2d window coordinates. + * In orthographic view all window coordinates yield the same vector. + * @param ar The region (used for the window width and height). + * @param mval The area relative 2d location (such as event->mval converted to floats). + * @param out The resulting normalized world-space direction vector. + */ +void ED_view3d_win_to_vector(struct ARegion *ar, const float mval[2], float out[3]); + +/** + * Calculate a 3d segment from 2d window coordinates. + * This ray_start is located at the viewpoint, ray_end is a far point. + * ray_start and ray_end are clipped by the view near and far limits + * so points along this line are always in view. + * In orthographic view all resulting segments will be parallel. + * @param ar The region (used for the window width and height). + * @param v3d The 3d viewport (used for near and far clipping range). + * @param mval The area relative 2d location (such as event->mval, converted into float[2]). + * @param ray_start The world-space starting point of the segment. + * @param ray_end The world-space end point of the segment. + */ +void ED_view3d_win_to_segment_clip(struct ARegion *ar, struct View3D *v3d, const float mval[2], float ray_start[3], float ray_end[3]); + +/** + * Calculate a 3d viewpoint and direction vector from 2d window coordinates. + * This ray_start is located at the viewpoint, ray_normal is the direction towards mval. + * ray_start is clipped by the view near limit so points in front of it are always in view. + * In orthographic view the resulting ray_normal will match the view vector. + * @param ar The region (used for the window width and height). + * @param v3d The 3d viewport (used for near clipping value). + * @param out The resulting normalized world-space direction vector. + * @param mval The area relative 2d location (such as event->mval, converted into float[2]). + * @param ray_start The world-space starting point of the segment. + * @param ray_normal The normalized world-space direction of towards mval. + */ +void ED_view3d_win_to_ray(struct ARegion *ar, struct View3D *v3d, const float mval[2], float ray_start[3], float ray_normal[3]); + +/** + * Calculate a normalized 3d direction vector from the viewpoint towards a global location. + * In orthographic view the resulting vector will match the view vector. + * @param ar The region (used for the window width and height). + * @param coord The world-space location. + * @param vec The resulting normalized vector. + */ +void ED_view3d_global_to_vector(struct RegionView3D *rv3d, const float coord[3], float vec[3]); + +/** + * Calculate the view transformation matrix from RegionView3D input. + * The resulting matrix is equivilent to RegionView3D.viewinv + * @param mat The view 4x4 transformation matrix to calculate. + * @param ofs The view offset, normally from RegionView3D.ofs. + * @param quat The view rotation, quaternion normally from RegionView3D.viewquat. + * @param dist The view distance from ofs, normally from RegionView3D.dist. + */ +void ED_view3d_to_m4(float mat[][4], const float ofs[3], const float quat[4], const float dist); + +/** + * Set the view transformation from a 4x4 matrix. + * @param mat The view 4x4 transformation matrix to assign. + * @param ofs The view offset, normally from RegionView3D.ofs. + * @param quat The view rotation, quaternion normally from RegionView3D.viewquat. + * @param dist The view distance from ofs, normally from RegionView3D.dist. + */ +void ED_view3d_from_m4(float mat[][4], float ofs[3], float quat[4], float *dist); + +/** + * Set the RegionView3D members from an objects transformation and optionally lens. + * @param ob The object to set the view to. + * @param ofs The view offset to be set, normally from RegionView3D.ofs. + * @param quat The view rotation to be set, quaternion normally from RegionView3D.viewquat. + * @param dist The view distance from ofs to be set, normally from RegionView3D.dist. + */ +void ED_view3d_from_object(struct Object *ob, float ofs[3], float quat[4], float *dist, float *lens); + +/** + * Set the object transformation from RegionView3D members. + * @param ob The object which has the transformation assigned. + * @param ofs The view offset, normally from RegionView3D.ofs. + * @param quat The view rotation, quaternion normally from RegionView3D.viewquat. + * @param dist The view distance from ofs, normally from RegionView3D.dist. + */ +void ED_view3d_to_object(struct Object *ob, const float ofs[3], const float quat[4], const float dist); + +#if 0 /* UNUSED */ void view3d_unproject(struct bglMats *mats, float out[3], const short x, const short y, const float z); +#endif /* Depth buffer */ -void view3d_update_depths(struct ARegion *ar); -float read_cached_depth(struct ViewContext *vc, int x, int y); -void request_depth_update(struct RegionView3D *rv3d); +void ED_view3d_depth_update(struct ARegion *ar); +float ED_view3d_depth_read_cached(struct ViewContext *vc, int x, int y); +void ED_view3d_depth_tag_update(struct RegionView3D *rv3d); /* Projection */ #define IS_CLIPPED 12000 -void view3d_calculate_clipping(struct BoundBox *bb, float planes[4][4], struct bglMats *mats, struct rcti *rect); +void ED_view3d_calc_clipping(struct BoundBox *bb, float planes[4][4], struct bglMats *mats, struct rcti *rect); void project_short(struct ARegion *ar, const float vec[3], short adr[2]); void project_short_noclip(struct ARegion *ar, const float vec[3], short adr[2]); @@ -104,17 +207,12 @@ void project_int_noclip(struct ARegion *ar, const float vec[3], int adr[2]); void project_float(struct ARegion *ar, const float vec[3], float adr[2]); void project_float_noclip(struct ARegion *ar, const float vec[3], float adr[2]); -void viewvector(struct RegionView3D *rv3d, float coord[3], float vec[3]); - -void viewline(struct ARegion *ar, struct View3D *v3d, float mval[2], float ray_start[3], float ray_end[3]); -void viewray(struct ARegion *ar, struct View3D *v3d, float mval[2], float ray_start[3], float ray_normal[3]); - -int get_view3d_cliprange(struct View3D *v3d, struct RegionView3D *rv3d, float *clipsta, float *clipend); -int get_view3d_viewplane(struct View3D *v3d, struct RegionView3D *rv3d, int winxi, int winyi, struct rctf *viewplane, float *clipsta, float *clipend, float *pixsize); -int get_view3d_ortho(struct View3D *v3d, struct RegionView3D *rv3d); -void view3d_get_object_project_mat(struct RegionView3D *v3d, struct Object *ob, float pmat[4][4]); -void view3d_project_float(struct ARegion *a, const float vec[3], float adr[2], float mat[4][4]); -void view3d_calc_camera_border(struct Scene *scene, struct ARegion *ar, struct RegionView3D *rv3d, struct View3D *v3d, struct rctf *viewborder_r, short do_shift); +void ED_view3d_ob_clip_range_get(struct Object *ob, float *lens, float *clipsta, float *clipend); +int ED_view3d_clip_range_get(struct View3D *v3d, struct RegionView3D *rv3d, float *clipsta, float *clipend); +int ED_view3d_viewplane_get(struct View3D *v3d, struct RegionView3D *rv3d, int winxi, int winyi, struct rctf *viewplane, float *clipsta, float *clipend, float *pixsize); +void ED_view3d_ob_project_mat_get(struct RegionView3D *v3d, struct Object *ob, float pmat[4][4]); +void ED_view3d_project_float(struct ARegion *a, const float vec[3], float adr[2], float mat[4][4]); +void ED_view3d_calc_camera_border(struct Scene *scene, struct ARegion *ar, struct View3D *v3d, struct RegionView3D *rv3d, struct rctf *viewborder_r, short do_shift); /* drawobject.c iterators */ void mesh_foreachScreenVert(struct ViewContext *vc, void (*func)(void *userData, struct EditVert *eve, int x, int y, int index), void *userData, int clipVerts); @@ -124,27 +222,27 @@ void nurbs_foreachScreenVert(struct ViewContext *vc, void (*func)(void *userData void lattice_foreachScreenVert(struct ViewContext *vc, void (*func)(void *userData, struct BPoint *bp, int x, int y), void *userData); void ED_view3d_local_clipping(struct RegionView3D *rv3d, float mat[][4]); -int view3d_test_clipping(struct RegionView3D *rv3d, const float vec[3], const int local); -void view3d_align_axis_to_vector(struct View3D *v3d, struct RegionView3D *rv3d, int axisidx, float vec[3]); -float view3d_pixel_size(struct RegionView3D *rv3d, const float co[3]); +int ED_view3d_test_clipping(struct RegionView3D *rv3d, const float vec[3], const int local); +void ED_view3d_align_axis_to_vector(struct View3D *v3d, struct RegionView3D *rv3d, int axisidx, float vec[3]); +float ED_view3d_pixel_size(struct RegionView3D *rv3d, const float co[3]); void drawcircball(int mode, const float cent[3], float rad, float tmat[][4]); /* backbuffer select and draw support */ void view3d_validate_backbuf(struct ViewContext *vc); struct ImBuf *view3d_read_backbuf(struct ViewContext *vc, short xmin, short ymin, short xmax, short ymax); -unsigned int view3d_sample_backbuf_rect(struct ViewContext *vc, const short mval[2], int size, unsigned int min, unsigned int max, int *dist, short strict, +unsigned int view3d_sample_backbuf_rect(struct ViewContext *vc, const int mval[2], int size, unsigned int min, unsigned int max, int *dist, short strict, void *handle, unsigned int (*indextest)(void *handle, unsigned int index)); unsigned int view3d_sample_backbuf(struct ViewContext *vc, int x, int y); /* draws and does a 4x4 sample */ -int view_autodist(struct Scene *scene, struct ARegion *ar, struct View3D *v3d, const short mval[2], float mouse_worldloc[3]); +int ED_view3d_autodist(struct Scene *scene, struct ARegion *ar, struct View3D *v3d, const int mval[2], float mouse_worldloc[3]); -/* only draw so view_autodist_simple can be called many times after */ -int view_autodist_init(struct Scene *scene, struct ARegion *ar, struct View3D *v3d, int mode); -int view_autodist_simple(struct ARegion *ar, const short mval[2], float mouse_worldloc[3], int margin, float *force_depth); -int view_autodist_depth(struct ARegion *ar, const short mval[2], int margin, float *depth); -int view_autodist_depth_segment(struct ARegion *ar, const short mval_sta[2], const short mval_end[2], int margin, float *depth); +/* only draw so ED_view3d_autodist_simple can be called many times after */ +int ED_view3d_autodist_init(struct Scene *scene, struct ARegion *ar, struct View3D *v3d, int mode); +int ED_view3d_autodist_simple(struct ARegion *ar, const int mval[2], float mouse_worldloc[3], int margin, float *force_depth); +int ED_view3d_autodist_depth(struct ARegion *ar, const int mval[2], int margin, float *depth); +int ED_view3d_autodist_depth_seg(struct ARegion *ar, const int mval_sta[2], const int mval_end[2], int margin, float *depth); /* select */ #define MAXPICKBUF 10000 @@ -153,13 +251,13 @@ short view3d_opengl_select(struct ViewContext *vc, unsigned int *buffer, unsigne void view3d_set_viewcontext(struct bContext *C, struct ViewContext *vc); void view3d_operator_needs_opengl(const struct bContext *C); void view3d_region_operator_needs_opengl(struct wmWindow *win, struct ARegion *ar); -int view3d_get_view_aligned_coordinate(struct ViewContext *vc, float fp[3], const short mval[2], const short do_fallback); +int view3d_get_view_aligned_coordinate(struct ViewContext *vc, float fp[3], const int mval[2], const short do_fallback); void view3d_get_transformation(struct ARegion *ar, struct RegionView3D *rv3d, struct Object *ob, struct bglMats *mats); /* XXX should move to BLI_math */ int edge_inside_circle(short centx, short centy, short rad, short x1, short y1, short x2, short y2); -int lasso_inside(short mcords[][2], short moves, short sx, short sy); -int lasso_inside_edge(short mcords[][2], short moves, int x0, int y0, int x1, int y1); +int lasso_inside(int mcords[][2], short moves, int sx, int sy); +int lasso_inside_edge(int mcords[][2], short moves, int x0, int y0, int x1, int y1); /* get 3d region from context, also if mouse is in header or toolbar */ struct RegionView3D *ED_view3d_context_rv3d(struct bContext *C); @@ -167,6 +265,7 @@ struct ARegion *ED_view3d_context_region_unlock(struct bContext *C); int ED_operator_rv3d_unlock_poll(struct bContext *C); void ED_view3d_init_mats_rv3d(struct Object *ob, struct RegionView3D *rv3d); +void ED_view3d_init_mats_rv3d_gl(struct Object *ob, struct RegionView3D *rv3d); int ED_view3d_scene_layer_set(int lay, const int *values, int *active); @@ -178,18 +277,18 @@ struct ImBuf *ED_view3d_draw_offscreen_imbuf(struct Scene *scene, struct View3D struct ImBuf *ED_view3d_draw_offscreen_imbuf_simple(Scene *scene, struct Object *camera, int width, int height, unsigned int flag, int drawtype, char err_out[256]); -Base *ED_view3d_give_base_under_cursor(struct bContext *C, const short mval[2]); +Base *ED_view3d_give_base_under_cursor(struct bContext *C, const int mval[2]); void ED_view3d_quadview_update(struct ScrArea *sa, struct ARegion *ar, short do_clip); int ED_view3d_lock(struct RegionView3D *rv3d); unsigned int ED_view3d_datamask(struct Scene *scene, struct View3D *v3d); unsigned int ED_viewedit_datamask(struct bScreen *screen); - -/* assigning view matrix */ -void view3d_apply_mat4(float mat[][4], float *ofs, float *quat, float *dist); -void view3d_apply_ob(struct Object *ob, float *ofs, float *quat, float *dist, float *lens); -int view3d_is_ortho(struct View3D *v3d, struct RegionView3D *rv3d); +/* camera lock functions */ +int ED_view3d_camera_lock_check(struct View3D *v3d, struct RegionView3D *rv3d); +/* copy the camera to the view before starting a view transformation */ +void ED_view3d_camera_lock_init(struct View3D *v3d, struct RegionView3D *rv3d); +/* copy the view to the camera */ +void ED_view3d_camera_lock_sync(struct View3D *v3d, struct RegionView3D *rv3d); #endif /* ED_VIEW3D_H */ - diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index d6988aa9618..61e19655f8d 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -35,6 +35,7 @@ #define UI_INTERFACE_H #include "RNA_types.h" +#include "DNA_userdef_types.h" /* Struct Declarations */ @@ -100,8 +101,8 @@ typedef struct uiLayout uiLayout; #define UI_BLOCK_RET_1 4 /* XXX 2.5 not implemented */ #define UI_BLOCK_NUMSELECT 8 /*#define UI_BLOCK_ENTER_OK 16*/ /*UNUSED*/ -/*#define UI_BLOCK_NOSHADOW 32*/ /*UNUSED*/ -/*#define UI_BLOCK_UNUSED 64*/ /*UNUSED*/ +#define UI_BLOCK_CLIPBOTTOM 32 +#define UI_BLOCK_CLIPTOP 64 #define UI_BLOCK_MOVEMOUSE_QUIT 128 #define UI_BLOCK_KEEP_OPEN 256 #define UI_BLOCK_POPUP 512 @@ -297,10 +298,12 @@ void uiPupMenuInvoke(struct bContext *C, const char *idname); /* popup registere * but allow using all button types and creating an own layout. */ typedef uiBlock* (*uiBlockCreateFunc)(struct bContext *C, struct ARegion *ar, void *arg1); +typedef void (*uiBlockCancelFunc)(void *arg1); void uiPupBlock(struct bContext *C, uiBlockCreateFunc func, void *arg); void uiPupBlockO(struct bContext *C, uiBlockCreateFunc func, void *arg, const char *opname, int opcontext); -void uiPupBlockOperator(struct bContext *C, uiBlockCreateFunc func, struct wmOperator *op, int opcontext); +void uiPupBlockEx(struct bContext *C, uiBlockCreateFunc func, uiBlockCancelFunc cancel_func, void *arg); +/* void uiPupBlockOperator(struct bContext *C, uiBlockCreateFunc func, struct wmOperator *op, int opcontext); */ /* UNUSED */ void uiPupBlockClose(struct bContext *C, uiBlock *block); @@ -622,8 +625,8 @@ void UI_exit(void); #define UI_LAYOUT_MENU 2 #define UI_LAYOUT_TOOLBAR 3 -#define UI_UNIT_X 20 -#define UI_UNIT_Y 20 +#define UI_UNIT_X U.widget_unit +#define UI_UNIT_Y U.widget_unit #define UI_LAYOUT_ALIGN_EXPAND 0 #define UI_LAYOUT_ALIGN_LEFT 1 diff --git a/source/blender/editors/include/UI_interface_icons.h b/source/blender/editors/include/UI_interface_icons.h index 50b14cb832a..b6837a4b3c9 100644 --- a/source/blender/editors/include/UI_interface_icons.h +++ b/source/blender/editors/include/UI_interface_icons.h @@ -49,6 +49,10 @@ typedef struct IconFile { #define ICON_DEFAULT_HEIGHT 16 #define ICON_DEFAULT_WIDTH 16 + +#define ICON_DEFAULT_HEIGHT_SCALE (UI_UNIT_Y * 0.8f) +#define ICON_DEFAULT_WIDTH_SCALE (UI_UNIT_X * 0.8f) + #define PREVIEW_DEFAULT_HEIGHT 96 /* |