diff options
Diffstat (limited to 'source/blender/editors/include')
20 files changed, 288 insertions, 253 deletions
diff --git a/source/blender/editors/include/BIF_gl.h b/source/blender/editors/include/BIF_gl.h index cd26bb22ada..2acba04368c 100644 --- a/source/blender/editors/include/BIF_gl.h +++ b/source/blender/editors/include/BIF_gl.h @@ -35,16 +35,9 @@ #include "GPU_glew.h" -#ifdef __APPLE__ - /* hacking pointsize and linewidth */ -# define glPointSize(f) glPointSize(U.pixelsize * (f)) -# define glLineWidth(f) glLineWidth(U.pixelsize * (f)) -#else - /* avoid include mismatch by referencing 'U' from both */ -# define glPointSize(f) glPointSize(((void)U.pixelsize, (f))) -# define glLineWidth(f) glLineWidth(((void)U.pixelsize, (f))) -#endif +#define glPointSize(f) glPointSize(U.pixelsize * (f)) +#define glLineWidth(f) glLineWidth(U.pixelsize * (f)) /* * these should be phased out. cpack should be replaced in diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h index 956ec308daa..cd0cfeb7e7f 100644 --- a/source/blender/editors/include/ED_anim_api.h +++ b/source/blender/editors/include/ED_anim_api.h @@ -159,6 +159,7 @@ typedef enum eAnim_ChannelType { ANIMTYPE_DSLAT, ANIMTYPE_DSLINESTYLE, ANIMTYPE_DSSPK, + ANIMTYPE_DSGPENCIL, ANIMTYPE_SHAPEKEY, diff --git a/source/blender/editors/include/ED_gpencil.h b/source/blender/editors/include/ED_gpencil.h index 05fb76b7aea..cad33c34fe3 100644 --- a/source/blender/editors/include/ED_gpencil.h +++ b/source/blender/editors/include/ED_gpencil.h @@ -30,6 +30,7 @@ #ifndef __ED_GPENCIL_H__ #define __ED_GPENCIL_H__ +struct ID; struct ListBase; struct bContext; struct bScreen; @@ -38,11 +39,11 @@ struct ARegion; struct View3D; struct SpaceNode; struct SpaceSeq; +struct Object; struct bGPdata; struct bGPDlayer; struct bGPDframe; struct PointerRNA; -struct Panel; struct ImBuf; struct wmKeyConfig; @@ -65,14 +66,26 @@ typedef struct tGPspoint { /* ----------- Grease Pencil Tools/Context ------------- */ +/* Context-dependent */ struct bGPdata **ED_gpencil_data_get_pointers(const struct bContext *C, struct PointerRNA *ptr); struct bGPdata *ED_gpencil_data_get_active(const struct bContext *C); + +/* Context independent (i.e. each required part is passed in instead) */ +struct bGPdata **ED_gpencil_data_get_pointers_direct(struct ID *screen_id, struct Scene *scene, + struct ScrArea *sa, struct Object *ob, + struct PointerRNA *ptr); +struct bGPdata *ED_gpencil_data_get_active_direct(struct ID *screen_id, struct Scene *scene, + struct ScrArea *sa, struct Object *ob); + +/* 3D View */ struct bGPdata *ED_gpencil_data_get_active_v3d(struct Scene *scene, struct View3D *v3d); /* ----------- Grease Pencil Operators ----------------- */ void ED_keymap_gpencil(struct wmKeyConfig *keyconf); + void ED_operatortypes_gpencil(void); +void ED_operatormacros_gpencil(void); /* ------------ Grease-Pencil Drawing API ------------------ */ /* drawgpencil.c */ @@ -80,10 +93,8 @@ void ED_operatortypes_gpencil(void); void ED_gpencil_draw_2dimage(const struct bContext *C); void ED_gpencil_draw_view2d(const struct bContext *C, bool onlyv2d); void ED_gpencil_draw_view3d(struct Scene *scene, struct View3D *v3d, struct ARegion *ar, bool only3d); -void ED_gpencil_draw_ex(struct bGPdata *gpd, int winx, int winy, const int cfra); - -void ED_gpencil_panel_standard_header(const struct bContext *C, struct Panel *pa); -void ED_gpencil_panel_standard(const struct bContext *C, struct Panel *pa); +void ED_gpencil_draw_ex(struct Scene *scene, struct bGPdata *gpd, int winx, int winy, + const int cfra, const char spacetype); /* ----------- Grease-Pencil AnimEdit API ------------------ */ bool ED_gplayer_frames_looper(struct bGPDlayer *gpl, struct Scene *scene, @@ -99,6 +110,8 @@ void ED_gpencil_select_frame(struct bGPDlayer *gpl, int selx, short select_mode bool ED_gplayer_frames_delete(struct bGPDlayer *gpl); void ED_gplayer_frames_duplicate(struct bGPDlayer *gpl); +void ED_gplayer_frames_keytype_set(struct bGPDlayer *gpl, short type); + void ED_gplayer_snap_frames(struct bGPDlayer *gpl, struct Scene *scene, short mode); #if 0 diff --git a/source/blender/editors/include/ED_image.h b/source/blender/editors/include/ED_image.h index a9995de068e..1188ecd0aa5 100644 --- a/source/blender/editors/include/ED_image.h +++ b/source/blender/editors/include/ED_image.h @@ -79,5 +79,7 @@ int ED_space_image_maskedit_mask_poll(struct bContext *C); void ED_image_draw_info(struct Scene *scene, struct ARegion *ar, bool color_manage, bool use_default_view, int channels, int x, int y, const unsigned char cp[4], const float fp[4], const float linearcol[4], int *zp, float *zpf); +bool ED_space_image_show_cache(struct SpaceImage *sima); + #endif /* __ED_IMAGE_H__ */ diff --git a/source/blender/editors/include/ED_keyframes_draw.h b/source/blender/editors/include/ED_keyframes_draw.h index 58a262e150a..0359153317b 100644 --- a/source/blender/editors/include/ED_keyframes_draw.h +++ b/source/blender/editors/include/ED_keyframes_draw.h @@ -120,8 +120,9 @@ void draw_object_channel(struct View2D *v2d, struct bDopeSheet *ads, struct Obje void draw_scene_channel(struct View2D *v2d, struct bDopeSheet *ads, struct Scene *sce, float ypos); /* DopeSheet Summary */ void draw_summary_channel(struct View2D *v2d, struct bAnimContext *ac, float ypos); -/* Grease Pencil Layer */ -// XXX not restored +/* Grease Pencil datablock summary */ +void draw_gpencil_channel(struct View2D *v2d, struct bDopeSheet *ads, struct bGPdata *gpd, float ypos); +/* Grease Pencil Layer */ void draw_gpl_channel(struct View2D *v2d, struct bDopeSheet *ads, struct bGPDlayer *gpl, float ypos); /* Mask Layer */ void draw_masklay_channel(struct View2D *v2d, struct bDopeSheet *ads, struct MaskLayer *masklay, float ypos); @@ -139,11 +140,11 @@ void ob_to_keylist(struct bDopeSheet *ads, struct Object *ob, struct DLRBT_Tree void scene_to_keylist(struct bDopeSheet *ads, struct Scene *sce, struct DLRBT_Tree *keys, struct DLRBT_Tree *blocks); /* DopeSheet Summary */ void summary_to_keylist(struct bAnimContext *ac, struct DLRBT_Tree *keys, struct DLRBT_Tree *blocks); +/* Grease Pencil datablock summary */ +void gpencil_to_keylist(struct bDopeSheet *ads, struct bGPdata *gpd, struct DLRBT_Tree *keys); /* Grease Pencil Layer */ -// XXX not restored void gpl_to_keylist(struct bDopeSheet *ads, struct bGPDlayer *gpl, struct DLRBT_Tree *keys); /* Mask */ -// XXX not restored void mask_to_keylist(struct bDopeSheet *UNUSED(ads), struct MaskLayer *masklay, struct DLRBT_Tree *keys); /* ActKeyColumn API ---------------- */ diff --git a/source/blender/editors/include/ED_keyframes_edit.h b/source/blender/editors/include/ED_keyframes_edit.h index c8365689803..e9b22e49ac2 100644 --- a/source/blender/editors/include/ED_keyframes_edit.h +++ b/source/blender/editors/include/ED_keyframes_edit.h @@ -58,6 +58,7 @@ typedef enum eEditKeyframes_Validate { BEZT_OK_VALUERANGE, BEZT_OK_REGION, BEZT_OK_REGION_LASSO, + BEZT_OK_REGION_CIRCLE, } eEditKeyframes_Validate; /* ------------ */ @@ -107,6 +108,14 @@ struct KeyframeEdit_LassoData { int mcords_tot; }; +/* use with BEZT_OK_REGION_CIRCLE */ +struct KeyframeEdit_CircleData { + const rctf *rectf_scaled; + const rctf *rectf_view; + float mval[2]; + float radius_squared; +}; + /* ************************************************ */ /* Non-Destuctive Editing API (keyframes_edit.c) */ @@ -233,7 +242,7 @@ short bezt_selmap_flush(KeyframeEditData *ked, struct BezTriple *bezt); /* ----------- BezTriple Callback (Assorted Utilities) ---------- */ -/* used to calculate the the average location of all relevant BezTriples by summing their locations */ +/* used to calculate the average location of all relevant BezTriples by summing their locations */ short bezt_calc_average(KeyframeEditData *ked, struct BezTriple *bezt); /* used to extract a set of cfra-elems from the keyframes */ diff --git a/source/blender/editors/include/ED_keyframing.h b/source/blender/editors/include/ED_keyframing.h index 5c7b3c531be..e5b5e79875d 100644 --- a/source/blender/editors/include/ED_keyframing.h +++ b/source/blender/editors/include/ED_keyframing.h @@ -293,7 +293,7 @@ bool ANIM_paste_driver(struct ReportList *reports, struct ID *id, const char rna (U.autokey_flag & AUTOKEY_FLAG_##flag)) /* auto-keyframing feature - checks for whether anything should be done for the current frame */ -int autokeyframe_cfra_can_key(struct Scene *scene, struct ID *id); +bool autokeyframe_cfra_can_key(struct Scene *scene, struct ID *id); /* ************ Keyframe Checking ******************** */ diff --git a/source/blender/editors/include/ED_markers.h b/source/blender/editors/include/ED_markers.h index 76d36623b60..5eaf459a4e1 100644 --- a/source/blender/editors/include/ED_markers.h +++ b/source/blender/editors/include/ED_markers.h @@ -43,10 +43,11 @@ struct TimeMarker; /* flags for drawing markers */ enum { DRAW_MARKERS_LINES = (1 << 0), - DRAW_MARKERS_LOCAL = (1 << 1) + DRAW_MARKERS_LOCAL = (1 << 1), + DRAW_MARKERS_MARGIN = (1 << 2), }; -void draw_markers_time(const struct bContext *C, int flag); +void ED_markers_draw(const struct bContext *C, int flag); /* Backend API ----------------------------- */ diff --git a/source/blender/editors/include/ED_mesh.h b/source/blender/editors/include/ED_mesh.h index 6a562da0a0e..8eb7fdf0c40 100644 --- a/source/blender/editors/include/ED_mesh.h +++ b/source/blender/editors/include/ED_mesh.h @@ -101,8 +101,8 @@ struct DerivedMesh *EDBM_mesh_deform_dm_get(struct BMEditMesh *em); * verts select/deselect edges and faces, if in edge select mode, * edges select/deselect faces and vertices, and in face select mode faces select/deselect * edges and vertices.*/ -void EDBM_select_more(struct BMEditMesh *em); -void EDBM_select_less(struct BMEditMesh *em); +void EDBM_select_more(struct BMEditMesh *em, const bool use_face_step); +void EDBM_select_less(struct BMEditMesh *em, const bool use_face_step); void EDBM_selectmode_flush_ex(struct BMEditMesh *em, const short selectmode); void EDBM_selectmode_flush(struct BMEditMesh *em); @@ -220,14 +220,8 @@ void ED_mesh_mirrtopo_free(MirrTopoStore_t *mesh_topo_store); #define WEIGHT_SUBTRACT 3 bool ED_vgroup_sync_from_pose(struct Object *ob); -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_clear(struct Object *ob); void ED_vgroup_select_by_name(struct Object *ob, const char *name); -bool ED_vgroup_data_create(struct ID *id); void ED_vgroup_data_clamp_range(struct ID *id, const int total); -bool ED_vgroup_array_get(struct ID *id, struct MDeformVert **dvert_arr, int *dvert_tot); bool ED_vgroup_array_copy(struct Object *ob, struct Object *ob_from); bool ED_vgroup_parray_alloc(struct ID *id, struct MDeformVert ***dvert_arr, int *dvert_tot, const bool use_vert_sel); @@ -244,8 +238,6 @@ void ED_vgroup_mirror(struct Object *ob, const bool all_vgroups, const bool use_topology, int *r_totmirr, int *r_totfail); -bool ED_vgroup_object_is_edit_mode(struct Object *ob); - void ED_vgroup_vert_add(struct Object *ob, struct bDeformGroup *dg, int vertnum, float weight, int assignmode); void ED_vgroup_vert_remove(struct Object *ob, struct bDeformGroup *dg, int vertnum); float ED_vgroup_vert_weight(struct Object *ob, struct bDeformGroup *dg, int vertnum); @@ -267,6 +259,7 @@ void ED_mesh_vertices_remove(struct Mesh *mesh, struct ReportList *reports, int void ED_mesh_calc_tessface(struct Mesh *mesh); void ED_mesh_update(struct Mesh *mesh, struct bContext *C, int calc_edges, int calc_tessface); +void ED_mesh_uv_texture_ensure(struct Mesh *me, const char *name); int ED_mesh_uv_texture_add(struct Mesh *me, const char *name, const bool active_set); bool ED_mesh_uv_texture_remove_index(struct Mesh *me, const int n); bool ED_mesh_uv_texture_remove_active(struct Mesh *me); diff --git a/source/blender/editors/include/ED_object.h b/source/blender/editors/include/ED_object.h index 39586039e8f..900da3ee07c 100644 --- a/source/blender/editors/include/ED_object.h +++ b/source/blender/editors/include/ED_object.h @@ -209,12 +209,6 @@ bool ED_object_multires_update_totlevels_cb(struct Object *ob, void *totlevel_v) /* object_select.c */ void ED_object_select_linked_by_id(struct bContext *C, struct ID *id); - -bool *ED_vgroup_subset_from_select_type(struct Object *ob, enum eVGroupSelect subset_type, - int *r_vgroup_tot, int *r_subset_count); -void ED_vgroup_subset_to_index_array(const bool *vgroup_validmap, const int vgroup_tot, - int *r_vgroup_subset_map); - struct EnumPropertyItem *ED_object_vgroup_selection_itemf_helper( const struct bContext *C, struct PointerRNA *ptr, diff --git a/source/blender/editors/include/ED_render.h b/source/blender/editors/include/ED_render.h index ab1dbabe793..0227ae3e85a 100644 --- a/source/blender/editors/include/ED_render.h +++ b/source/blender/editors/include/ED_render.h @@ -40,6 +40,7 @@ struct ScrArea; struct RegionView3D; struct RenderEngine; struct View3D; +struct wmWindowManager; /* render_ops.c */ @@ -52,7 +53,7 @@ void ED_render_engine_changed(struct Main *bmain); void ED_render_engine_area_exit(struct ScrArea *sa); void ED_render_scene_update(struct Main *bmain, struct Scene *scene, int updated); -void ED_viewport_render_kill_jobs(const struct bContext *C, bool free_database); +void ED_viewport_render_kill_jobs(struct wmWindowManager *wm, struct Main *bmain, bool free_database); struct Scene *ED_render_job_get_scene(const struct bContext *C); /* Render the preview @@ -72,7 +73,7 @@ void ED_preview_free_dbase(void); void ED_preview_shader_job(const struct bContext *C, void *owner, struct ID *id, struct ID *parent, struct MTex *slot, int sizex, int sizey, int method); void ED_preview_icon_job(const struct bContext *C, void *owner, struct ID *id, unsigned int *rect, int sizex, int sizey); -void ED_preview_kill_jobs(const struct bContext *C); +void ED_preview_kill_jobs(struct wmWindowManager *wm, struct Main *bmain); void ED_preview_draw(const struct bContext *C, void *idp, void *parentp, void *slot, rcti *rect); diff --git a/source/blender/editors/include/ED_screen.h b/source/blender/editors/include/ED_screen.h index d31be3e961f..ed2465647da 100644 --- a/source/blender/editors/include/ED_screen.h +++ b/source/blender/editors/include/ED_screen.h @@ -110,7 +110,7 @@ void ED_screen_animation_timer_update(struct bScreen *screen, int redraws, in 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); +struct ScrArea *ED_screen_state_toggle(struct bContext *C, struct wmWindow *win, struct ScrArea *sa, const short state); void ED_screens_header_tools_menu_create(struct bContext *C, struct uiLayout *layout, void *arg); /* anim */ diff --git a/source/blender/editors/include/ED_screen_types.h b/source/blender/editors/include/ED_screen_types.h index 2b02606c6d9..effecf43839 100644 --- a/source/blender/editors/include/ED_screen_types.h +++ b/source/blender/editors/include/ED_screen_types.h @@ -93,10 +93,13 @@ typedef struct AZone { short x1, y1, x2, y2; /* for clip */ rcti rect; + /* for fade in/out */ + float alpha; } AZone; /* actionzone type */ #define AZONE_AREA 1 /* corner widgets for splitting areas */ #define AZONE_REGION 2 /* when a region is collapsed, draw a handle to expose */ +#define AZONE_FULLSCREEN 3 /* when in editor fullscreen draw a corner to go to normal mode */ #endif /* __ED_SCREEN_TYPES_H__ */ diff --git a/source/blender/editors/include/ED_transform.h b/source/blender/editors/include/ED_transform.h index daa6864b5aa..cf848098188 100644 --- a/source/blender/editors/include/ED_transform.h +++ b/source/blender/editors/include/ED_transform.h @@ -99,6 +99,7 @@ enum TfmMode { #define CTX_MOVIECLIP (1 << 6) #define CTX_MASK (1 << 7) #define CTX_PAINT_CURVE (1 << 8) +#define CTX_GPENCIL_STROKES (1 << 9) /* Standalone call to get the transformation center corresponding to the current situation * returns 1 if successful, 0 otherwise (usually means there's no selection) @@ -146,6 +147,7 @@ int BIF_countTransformOrientation(const struct bContext *C); #define P_CORRECT_UV (1 << 8) #define P_NO_DEFAULTS (1 << 10) #define P_NO_TEXSPACE (1 << 11) +#define P_GPENCIL_EDIT (1 << 12) void Transform_Properties(struct wmOperatorType *ot, int flags); diff --git a/source/blender/editors/include/ED_uvedit.h b/source/blender/editors/include/ED_uvedit.h index 4b82fa40c6a..3e8f234e979 100644 --- a/source/blender/editors/include/ED_uvedit.h +++ b/source/blender/editors/include/ED_uvedit.h @@ -31,6 +31,7 @@ #define __ED_UVEDIT_H__ struct ARegionType; +struct BMesh; struct BMEditMesh; struct BMFace; struct BMLoop; @@ -52,6 +53,7 @@ void ED_keymap_uvedit(struct wmKeyConfig *keyconf); void ED_uvedit_assign_image(struct Main *bmain, struct Scene *scene, struct Object *obedit, struct Image *ima, struct Image *previma); bool ED_uvedit_minmax(struct Scene *scene, struct Image *ima, struct Object *obedit, float min[2], float max[2]); +void ED_uvedit_select_all(struct BMesh *bm); bool ED_object_get_active_image(struct Object *ob, int mat_nr, struct Image **r_ima, struct ImageUser **r_iuser, struct bNode **r_node, struct bNodeTree **r_ntree); @@ -92,19 +94,24 @@ void uvedit_uv_select_disable(struct BMEditMesh *em, struct Scene *scene, struct bool ED_uvedit_nearest_uv(struct Scene *scene, struct Object *obedit, struct Image *ima, const float co[2], float r_uv[2]); +void ED_uvedit_get_aspect(struct Scene *scene, struct Object *ob, struct BMesh *em, float *aspx, float *aspy); + /* uvedit_unwrap_ops.c */ void ED_uvedit_live_unwrap_begin(struct Scene *scene, struct Object *obedit); void ED_uvedit_live_unwrap_re_solve(void); void ED_uvedit_live_unwrap_end(short cancel); void ED_uvedit_live_unwrap(struct Scene *scene, struct Object *obedit); +void ED_uvedit_pack_islands(struct Scene *scene, struct Object *ob, struct BMesh *bm, bool selected, bool correct_aspect, bool do_rotate); +void ED_uvedit_unwrap_cube_project(struct Object *ob, struct BMesh *bm, float cube_size, bool use_select); /* single call up unwrap using scene settings, used for edge tag unwrapping */ void ED_unwrap_lscm(struct Scene *scene, struct Object *obedit, const short sel); + /* uvedit_draw.c */ -void draw_image_cursor(struct ARegion *ar, const float cursor[2]); -void draw_uvedit_main(struct SpaceImage *sima, struct ARegion *ar, struct Scene *scene, struct Object *obedit, struct Object *obact); +void ED_image_draw_cursor(struct ARegion *ar, const float cursor[2]); +void ED_uvedit_draw_main(struct SpaceImage *sima, struct ARegion *ar, struct Scene *scene, struct Object *obedit, struct Object *obact); /* uvedit_buttons.c */ void ED_uvedit_buttons_register(struct ARegionType *art); diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h index bd4f37cfb1e..76ad4ba7bdb 100644 --- a/source/blender/editors/include/ED_view3d.h +++ b/source/blender/editors/include/ED_view3d.h @@ -309,7 +309,7 @@ void ED_view3d_draw_offscreen(struct Scene *scene, struct View3D *v3d, struct AR struct ImBuf *ED_view3d_draw_offscreen_imbuf(struct Scene *scene, struct View3D *v3d, struct ARegion *ar, int sizex, int sizey, unsigned int flag, bool draw_background, int alpha_mode, char err_out[256]); struct ImBuf *ED_view3d_draw_offscreen_imbuf_simple(struct Scene *scene, struct Object *camera, int width, int height, unsigned int flag, int drawtype, - bool use_solid_tex, bool draw_background, int alpha_mode, char err_out[256]); + bool use_solid_tex, bool use_gpencil, bool draw_background, int alpha_mode, char err_out[256]); void ED_view3d_offscreen_sky_color_get(struct Scene *scene, float sky_color[3]); struct Base *ED_view3d_give_base_under_cursor(struct bContext *C, const int mval[2]); diff --git a/source/blender/editors/include/UI_icons.h b/source/blender/editors/include/UI_icons.h index 1d79cf749f9..618fa44349e 100644 --- a/source/blender/editors/include/UI_icons.h +++ b/source/blender/editors/include/UI_icons.h @@ -426,13 +426,11 @@ DEF_ICON(CURVE_PATH) DEF_ICON(COLOR_RED) DEF_ICON(COLOR_GREEN) DEF_ICON(COLOR_BLUE) -#ifndef DEF_ICON_BLANK_SKIP - DEF_ICON(BLANK652) - DEF_ICON(BLANK653) - DEF_ICON(BLANK654) - DEF_ICON(BLANK655) -#endif - +DEF_ICON(TRIA_RIGHT_BAR) +DEF_ICON(TRIA_DOWN_BAR) +DEF_ICON(TRIA_LEFT_BAR) +DEF_ICON(TRIA_UP_BAR) + /* EMPTY */ DEF_ICON(FORCE_FORCE) DEF_ICON(FORCE_WIND) diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index bc794bf3350..2251f3fd0e4 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -98,20 +98,23 @@ typedef struct uiLayout uiLayout; #define UI_SCREEN_MARGIN 10 /* uiBlock->dt and uiBut->dt */ -#define UI_EMBOSS 0 /* use widget style for drawing */ -#define UI_EMBOSSN 1 /* Nothing, only icon and/or text */ -#define UI_EMBOSSP 2 /* Pulldown menu style */ -#define UI_EMBOSST 3 /* Table */ -#define UI_EMBOSSR 4 /* Pie Menu */ +enum { + UI_EMBOSS = 0, /* use widget style for drawing */ + UI_EMBOSS_NONE = 1, /* Nothing, only icon and/or text */ + UI_EMBOSS_PULLDOWN = 2, /* Pulldown menu style */ + UI_EMBOSS_RADIAL = 3, /* Pie Menu */ +}; /* uiBlock->direction */ -#define UI_DIRECTION (UI_TOP | UI_DOWN | UI_LEFT | UI_RIGHT) -#define UI_TOP (1 << 0) -#define UI_DOWN (1 << 1) -#define UI_LEFT (1 << 2) -#define UI_RIGHT (1 << 3) -#define UI_CENTER (1 << 4) -#define UI_SHIFT_FLIPPED (1 << 5) +enum { + UI_DIR_UP = (1 << 0), + UI_DIR_DOWN = (1 << 1), + UI_DIR_LEFT = (1 << 2), + UI_DIR_RIGHT = (1 << 3), + UI_DIR_CENTER_Y = (1 << 4), + + UI_DIR_ALL = (UI_DIR_UP | UI_DIR_DOWN | UI_DIR_LEFT | UI_DIR_RIGHT), +}; #if 0 /* uiBlock->autofill (not yet used) */ @@ -121,8 +124,8 @@ typedef struct uiLayout uiLayout; /* uiBlock->flag (controls) */ #define UI_BLOCK_LOOP (1 << 0) -#define UI_BLOCK_REDRAW (1 << 1) -#define UI_BLOCK_SEARCH_MENU (1 << 2) +#define UI_BLOCK_IS_FLIP (1 << 1) +#define UI_BLOCK_NO_FLIP (1 << 2) #define UI_BLOCK_NUMSELECT (1 << 3) #define UI_BLOCK_NO_WIN_CLIP (1 << 4) /* don't apply window clipping */ /* was UI_BLOCK_ENTER_OK */ #define UI_BLOCK_CLIPBOTTOM (1 << 5) @@ -131,7 +134,7 @@ typedef struct uiLayout uiLayout; #define UI_BLOCK_KEEP_OPEN (1 << 8) #define UI_BLOCK_POPUP (1 << 9) #define UI_BLOCK_OUT_1 (1 << 10) -#define UI_BLOCK_NO_FLIP (1 << 11) +#define UI_BLOCK_SEARCH_MENU (1 << 11) #define UI_BLOCK_POPUP_MEMORY (1 << 12) #define UI_BLOCK_CLIP_EVENTS (1 << 13) /* stop handling mouse events */ @@ -156,8 +159,8 @@ typedef struct uiLayout uiLayout; /* but->flag - general state flags. */ enum { /* warning, the first 6 flags are internal */ - UI_ICON_SUBMENU = (1 << 6), - UI_ICON_PREVIEW = (1 << 7), + UI_BUT_ICON_SUBMENU = (1 << 6), + UI_BUT_ICON_PREVIEW = (1 << 7), UI_BUT_NODE_LINK = (1 << 8), UI_BUT_NODE_ACTIVE = (1 << 9), @@ -234,56 +237,57 @@ typedef enum { /* assigned to but->type, OR'd with the flags above when passing args */ typedef enum { - BUT = (1 << 9), - ROW = (2 << 9), - TOG = (3 << 9), - NUM = (5 << 9), - TEX = (6 << 9), - TOGN = (9 << 9), - LABEL = (10 << 9), - MENU = (11 << 9), /* Dropdown list, actually! */ - ICONTOG = (13 << 9), - NUMSLI = (14 << 9), - COLOR = (15 << 9), - SCROLL = (18 << 9), - BLOCK = (19 << 9), - BUTM = (20 << 9), - SEPR = (21 << 9), - LINK = (22 << 9), - INLINK = (23 << 9), - KEYEVT = (24 << 9), - HSVCUBE = (26 << 9), - PULLDOWN = (27 << 9), /* Menu, actually! */ - ROUNDBOX = (28 << 9), - BUT_COLORBAND = (30 << 9), - BUT_NORMAL = (31 << 9), - BUT_CURVE = (32 << 9), - ICONTOGN = (34 << 9), - LISTBOX = (35 << 9), - LISTROW = (36 << 9), - TOGBUT = (37 << 9), - OPTION = (38 << 9), - OPTIONN = (39 << 9), - TRACKPREVIEW = (40 << 9), - /* buttons with value >= SEARCH_MENU don't get undo pushes */ - SEARCH_MENU = (41 << 9), - BUT_EXTRA = (42 << 9), - HSVCIRCLE = (43 << 9), - HOTKEYEVT = (46 << 9), - BUT_IMAGE = (47 << 9), - HISTOGRAM = (48 << 9), - WAVEFORM = (49 << 9), - VECTORSCOPE = (50 << 9), - PROGRESSBAR = (51 << 9), - SEARCH_MENU_UNLINK = (52 << 9), - NODESOCKET = (53 << 9), - SEPRLINE = (54 << 9), - GRIP = (55 << 9), + UI_BTYPE_BUT = (1 << 9), + UI_BTYPE_ROW = (2 << 9), + UI_BTYPE_TEXT = (3 << 9), + UI_BTYPE_MENU = (4 << 9), /* dropdown list */ + UI_BTYPE_BUT_MENU = (5 << 9), + UI_BTYPE_NUM = (6 << 9), /* number button */ + UI_BTYPE_NUM_SLIDER = (7 << 9), /* number slider */ + UI_BTYPE_TOGGLE = (8 << 9), + UI_BTYPE_TOGGLE_N = (9 << 9), + UI_BTYPE_ICON_TOGGLE = (10 << 9), + UI_BTYPE_ICON_TOGGLE_N = (11 << 9), + UI_BTYPE_BUT_TOGGLE = (12 << 9), /* same as regular toggle, but no on/off state displayed */ + UI_BTYPE_CHECKBOX = (13 << 9), /* similar to toggle, display a 'tick' */ + UI_BTYPE_CHECKBOX_N = (14 << 9), + UI_BTYPE_COLOR = (15 << 9), + UI_BTYPE_SCROLL = (18 << 9), + UI_BTYPE_BLOCK = (19 << 9), + UI_BTYPE_LABEL = (20 << 9), + UI_BTYPE_LINK = (22 << 9), + UI_BTYPE_INLINK = (23 << 9), + UI_BTYPE_KEY_EVENT = (24 << 9), + UI_BTYPE_HSVCUBE = (26 << 9), + UI_BTYPE_PULLDOWN = (27 << 9), /* menu (often used in headers), **_MENU /w different draw-type */ + UI_BTYPE_ROUNDBOX = (28 << 9), + UI_BTYPE_COLORBAND = (30 << 9), + UI_BTYPE_UNITVEC = (31 << 9), /* sphere widget (used to input a unit-vector, aka normal) */ + UI_BTYPE_CURVE = (32 << 9), + UI_BTYPE_LISTBOX = (36 << 9), + UI_BTYPE_LISTROW = (37 << 9), + UI_BTYPE_HSVCIRCLE = (38 << 9), + UI_BTYPE_TRACK_PREVIEW = (40 << 9), + + /* buttons with value >= UI_BTYPE_SEARCH_MENU don't get undo pushes */ + UI_BTYPE_SEARCH_MENU = (41 << 9), + UI_BTYPE_EXTRA = (42 << 9), + UI_BTYPE_HOTKEY_EVENT = (46 << 9), + UI_BTYPE_IMAGE = (47 << 9), /* non-interactive image, used for splash screen */ + UI_BTYPE_HISTOGRAM = (48 << 9), + UI_BTYPE_WAVEFORM = (49 << 9), + UI_BTYPE_VECTORSCOPE = (50 << 9), + UI_BTYPE_PROGRESS_BAR = (51 << 9), + UI_BTYPE_SEARCH_MENU_UNLINK = (52 << 9), + UI_BTYPE_NODE_SOCKET = (53 << 9), + UI_BTYPE_SEPR = (54 << 9), + UI_BTYPE_SEPR_LINE = (55 << 9), + UI_BTYPE_GRIP = (56 << 9), /* resize handle (resize uilist) */ } eButType; #define BUTTYPE (63 << 9) -/* gradient types, for color picker HSVCUBE etc */ +/* gradient types, for color picker UI_BTYPE_HSVCUBE etc */ #define UI_GRAD_SV 0 #define UI_GRAD_HV 1 #define UI_GRAD_HS 2 @@ -301,35 +305,36 @@ typedef enum { * Functions to draw various shapes, taking theme settings into account. * Used for code that draws its own UI style elements. */ -void uiRoundBox(float minx, float miny, float maxx, float maxy, float rad); -void uiSetRoundBox(int type); -int uiGetRoundBox(void); -void uiRoundRect(float minx, float miny, float maxx, float maxy, float rad); -void uiDrawBoxShadow(unsigned char alpha, float minx, float miny, float maxx, float maxy); -void uiDrawBox(int mode, float minx, float miny, float maxx, float maxy, float rad); -void uiDrawBoxShade(int mode, float minx, float miny, float maxx, float maxy, float rad, float shadetop, float shadedown); -void uiDrawBoxVerticalShade(int mode, float minx, float miny, float maxx, float maxy, float rad, float shadeLeft, float shadeRight); +void UI_draw_roundbox(float minx, float miny, float maxx, float maxy, float rad); +void UI_draw_roundbox_corner_set(int type); +int UI_draw_roundbox_corner_get(void); +void UI_draw_roundbox_unfilled(float minx, float miny, float maxx, float maxy, float rad); +void UI_draw_box_shadow(unsigned char alpha, float minx, float miny, float maxx, float maxy); +void UI_draw_roundbox_gl_mode(int mode, float minx, float miny, float maxx, float maxy, float rad); +void UI_draw_roundbox_shade_x(int mode, float minx, float miny, float maxx, float maxy, float rad, float shadetop, float shadedown); +void UI_draw_roundbox_shade_y(int mode, float minx, float miny, float maxx, float maxy, float rad, float shadeLeft, float shadeRight); +void UI_draw_text_underline(int pos_x, int pos_y, int len, int height); /* state for scrolldrawing */ #define UI_SCROLL_PRESSED (1 << 0) #define UI_SCROLL_ARROWS (1 << 1) #define UI_SCROLL_NO_OUTLINE (1 << 2) -void uiWidgetScrollDraw(struct uiWidgetColors *wcol, const struct rcti *rect, const struct rcti *slider, int state); +void UI_draw_widget_scroll(struct uiWidgetColors *wcol, const struct rcti *rect, const struct rcti *slider, int state); /* Callbacks * - * uiBlockSetHandleFunc/ButmFunc are for handling events through a callback. + * UI_block_func_handle_set/ButmFunc are for handling events through a callback. * HandleFunc gets the retval passed on, and ButmFunc gets a2. The latter is * mostly for compatibility with older code. * - * uiButSetCompleteFunc is for tab completion. + * UI_but_func_complete_set is for tab completion. * * uiButSearchFunc is for name buttons, showing a popup with matches * - * uiBlockSetFunc and uiButSetFunc are callbacks run when a button is used, + * UI_block_func_set and UI_but_func_set are callbacks run when a button is used, * in case events, operators or RNA are not sufficient to handle the button. * - * uiButSetNFunc will free the argument with MEM_freeN. */ + * UI_but_funcN_set will free the argument with MEM_freeN. */ typedef struct uiSearchItems uiSearchItems; @@ -348,30 +353,35 @@ typedef void (*uiMenuHandleFunc)(struct bContext *C, void *arg, int event); /* Popup Menus * * Functions used to create popup menus. For more extended menus the - * uiPupMenuBegin/End functions can be used to define own items with + * UI_popup_menu_begin/End functions can be used to define own items with * the uiItem functions in between. If it is a simple confirmation menu * or similar, popups can be created with a single function call. */ typedef struct uiPopupMenu uiPopupMenu; -struct uiPopupMenu *uiPupMenuBegin(struct bContext *C, const char *title, int icon) ATTR_NONNULL(); -void uiPupMenuEnd(struct bContext *C, struct uiPopupMenu *head); -struct uiLayout *uiPupMenuLayout(uiPopupMenu *head); +struct uiPopupMenu *UI_popup_menu_begin(struct bContext *C, const char *title, int icon) ATTR_NONNULL(); +void UI_popup_menu_end(struct bContext *C, struct uiPopupMenu *head); +struct uiLayout *UI_popup_menu_layout(uiPopupMenu *head); -void uiPupMenuReports(struct bContext *C, struct ReportList *reports) ATTR_NONNULL(); -bool uiPupMenuInvoke(struct bContext *C, const char *idname, struct ReportList *reports) ATTR_NONNULL(1, 2); +void UI_popup_menu_reports(struct bContext *C, struct ReportList *reports) ATTR_NONNULL(); +int UI_popup_menu_invoke(struct bContext *C, const char *idname, struct ReportList *reports) ATTR_NONNULL(1, 2); /* Pie menus */ typedef struct uiPieMenu uiPieMenu; -void uiPieMenuInvoke(struct bContext *C, const char *idname, const struct wmEvent *event); -void uiPieOperatorEnumInvoke(struct bContext *C, const char *title, const char *opname, - const char *propname, const struct wmEvent *event); -void uiPieEnumInvoke(struct bContext *C, const char *title, const char *path, const struct wmEvent *event); - -struct uiPieMenu *uiPieMenuBegin(struct bContext *C, const char *title, int icon, const struct wmEvent *event) ATTR_NONNULL(); -void uiPieMenuEnd(struct bContext *C, uiPieMenu *pie); -struct uiLayout *uiPieMenuLayout(struct uiPieMenu *pie); +int UI_pie_menu_invoke(struct bContext *C, const char *idname, const struct wmEvent *event); +int UI_pie_menu_invoke_from_operator_enum( + struct bContext *C, const char *title, const char *opname, + const char *propname, const struct wmEvent *event); +int UI_pie_menu_invoke_from_rna_enum( + struct bContext *C, const char *title, + const char *path, const struct wmEvent *event); + +struct uiPieMenu *UI_pie_menu_begin( + struct bContext *C, const char *title, int icon, + const struct wmEvent *event) ATTR_NONNULL(); +void UI_pie_menu_end(struct bContext *C, uiPieMenu *pie); +struct uiLayout *UI_pie_menu_layout(struct uiPieMenu *pie); /* Popup Blocks * * Functions used to create popup blocks. These are like popup menus @@ -380,12 +390,12 @@ struct uiLayout *uiPieMenuLayout(struct uiPieMenu *pie); typedef uiBlock * (*uiBlockCreateFunc)(struct bContext *C, struct ARegion *ar, void *arg1); typedef void (*uiBlockCancelFunc)(struct bContext *C, 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 uiPupBlockEx(struct bContext *C, uiBlockCreateFunc func, uiBlockHandleFunc popup_func, uiBlockCancelFunc cancel_func, void *arg); +void UI_popup_block_invoke(struct bContext *C, uiBlockCreateFunc func, void *arg); +void UI_popup_block_invoke_ex(struct bContext *C, uiBlockCreateFunc func, void *arg, const char *opname, int opcontext); +void UI_popup_block_ex(struct bContext *C, uiBlockCreateFunc func, uiBlockHandleFunc popup_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); +void UI_popup_block_close(struct bContext *C, uiBlock *block); /* Blocks * @@ -398,29 +408,29 @@ void uiPupBlockClose(struct bContext *C, uiBlock *block); * * */ -uiBlock *uiBeginBlock(const struct bContext *C, struct ARegion *region, const char *name, short dt); -void uiEndBlock_ex(const struct bContext *C, uiBlock *block, const int xy[2]); -void uiEndBlock(const struct bContext *C, uiBlock *block); -void uiDrawBlock(const struct bContext *C, struct uiBlock *block); -void uiBlockUpdateFromOld(const struct bContext *C, struct uiBlock *block); +uiBlock *UI_block_begin(const struct bContext *C, struct ARegion *region, const char *name, short dt); +void UI_block_end_ex(const struct bContext *C, uiBlock *block, const int xy[2]); +void UI_block_end(const struct bContext *C, uiBlock *block); +void UI_block_draw(const struct bContext *C, struct uiBlock *block); +void UI_block_update_from_old(const struct bContext *C, struct uiBlock *block); -uiBlock *uiGetBlock(const char *name, struct ARegion *ar); +uiBlock *UI_block_find_in_region(const char *name, struct ARegion *ar); -void uiBlockSetEmboss(uiBlock *block, char dt); +void UI_block_emboss_set(uiBlock *block, char dt); -void uiFreeBlock(const struct bContext *C, uiBlock *block); -void uiFreeBlocks(const struct bContext *C, struct ListBase *lb); -void uiFreeInactiveBlocks(const struct bContext *C, struct ListBase *lb); -void uiFreeActiveButtons(const struct bContext *C, struct bScreen *screen); +void UI_block_free(const struct bContext *C, uiBlock *block); +void UI_blocklist_free(const struct bContext *C, struct ListBase *lb); +void UI_blocklist_free_inactive(const struct bContext *C, struct ListBase *lb); +void UI_screen_free_active_but(const struct bContext *C, struct bScreen *screen); -void uiBlockSetRegion(uiBlock *block, struct ARegion *region); +void UI_block_region_set(uiBlock *block, struct ARegion *region); -void uiBlockSetButLock(uiBlock *block, bool val, const char *lockstr); -void uiBlockClearButLock(uiBlock *block); +void UI_block_lock_set(uiBlock *block, bool val, const char *lockstr); +void UI_block_lock_clear(uiBlock *block); /* automatic aligning, horiz or verical */ -void uiBlockBeginAlign(uiBlock *block); -void uiBlockEndAlign(uiBlock *block); +void UI_block_align_begin(uiBlock *block); +void UI_block_align_end(uiBlock *block); /* block bounds/position calculation */ typedef enum { @@ -433,44 +443,44 @@ typedef enum { UI_BLOCK_BOUNDS_PIE_CENTER, } eBlockBoundsCalc; -void uiBoundsBlock(struct uiBlock *block, int addval); -void uiTextBoundsBlock(uiBlock *block, int addval); -void uiPopupBoundsBlock(uiBlock *block, int addval, int mx, int my); -void uiMenuPopupBoundsBlock(uiBlock *block, int addvall, int mx, int my); -void uiCenteredBoundsBlock(uiBlock *block, int addval); -void uiExplicitBoundsBlock(uiBlock *block, int minx, int miny, int maxx, int maxy); +void UI_block_bounds_set_normal(struct uiBlock *block, int addval); +void UI_block_bounds_set_text(uiBlock *block, int addval); +void UI_block_bounds_set_popup(uiBlock *block, int addval, int mx, int my); +void UI_block_bounds_set_menu(uiBlock *block, int addvall, int mx, int my); +void UI_block_bounds_set_centered(uiBlock *block, int addval); +void UI_block_bounds_set_explicit(uiBlock *block, int minx, int miny, int maxx, int maxy); -int uiBlocksGetYMin(struct ListBase *lb); +int UI_blocklist_min_y_get(struct ListBase *lb); -void uiBlockSetDirection(uiBlock *block, char direction); -void uiBlockFlipOrder(uiBlock *block); -void uiBlockSetFlag(uiBlock *block, int flag); -void uiBlockClearFlag(uiBlock *block, int flag); +void UI_block_direction_set(uiBlock *block, char direction); +void UI_block_order_flip(uiBlock *block); +void UI_block_flag_enable(uiBlock *block, int flag); +void UI_block_flag_disable(uiBlock *block, int flag); -int uiButGetRetVal(uiBut *but); +int UI_but_return_value_get(uiBut *but); -void uiButSetDragID(uiBut *but, struct ID *id); -void uiButSetDragRNA(uiBut *but, struct PointerRNA *ptr); -void uiButSetDragPath(uiBut *but, const char *path); -void uiButSetDragName(uiBut *but, const char *name); -void uiButSetDragValue(uiBut *but); -void uiButSetDragImage(uiBut *but, const char *path, int icon, struct ImBuf *ima, float scale); +void UI_but_drag_set_id(uiBut *but, struct ID *id); +void UI_but_drag_set_rna(uiBut *but, struct PointerRNA *ptr); +void UI_but_drag_set_path(uiBut *but, const char *path); +void UI_but_drag_set_name(uiBut *but, const char *name); +void UI_but_drag_set_value(uiBut *but); +void UI_but_drag_set_image(uiBut *but, const char *path, int icon, struct ImBuf *ima, float scale); bool UI_but_active_drop_name(struct bContext *C); bool UI_but_active_drop_color(struct bContext *C); -void uiButSetFlag(uiBut *but, int flag); -void uiButClearFlag(uiBut *but, int flag); +void UI_but_flag_enable(uiBut *but, int flag); +void UI_but_flag_disable(uiBut *but, int flag); -void uiButSetDrawFlag(uiBut *but, int flag); -void uiButClearDrawFlag(uiBut *but, int flag); +void UI_but_drawflag_enable(uiBut *but, int flag); +void UI_but_drawflag_disable(uiBut *but, int flag); -void uiButSetMenuFromPulldown(uiBut *but); +void UI_but_type_set_menu_from_pulldown(uiBut *but); /* special button case, only draw it when used actively, for outliner etc */ -bool uiButActiveOnly(const struct bContext *C, struct ARegion *ar, uiBlock *block, uiBut *but); +bool UI_but_active_only(const struct bContext *C, struct ARegion *ar, uiBlock *block, uiBut *but); -void uiButExecute(const struct bContext *C, uiBut *but); +void UI_but_execute(const struct bContext *C, uiBut *but); /* Buttons @@ -544,10 +554,10 @@ uiBut *uiDefIconTextButO(uiBlock *block, int type, const char *opname, int opcon uiBut *uiDefIconTextButO_ptr(uiBlock *block, int type, struct wmOperatorType *ot, int opcontext, int icon, const char *str, int x, int y, short width, short height, const char *tip); /* for passing inputs to ButO buttons */ -struct PointerRNA *uiButGetOperatorPtrRNA(uiBut *but); +struct PointerRNA *UI_but_operator_ptr_get(uiBut *but); -void uiButSetUnitType(uiBut *but, const int unit_type); -int uiButGetUnitType(const uiBut *but); +void UI_but_unit_type_set(uiBut *but, const int unit_type); +int UI_but_unit_type_get(const uiBut *but); enum { BUT_GET_RNAPROP_IDENTIFIER = 1, @@ -572,7 +582,7 @@ typedef struct uiStringInfo { /* Note: Expects pointers to uiStringInfo structs as parameters. * Will fill them with translated strings, when possible. * Strings in uiStringInfo must be MEM_freeN'ed by caller. */ -void uiButGetStrInfo(struct bContext *C, uiBut *but, ...) ATTR_SENTINEL(0); +void UI_but_string_info_get(struct bContext *C, uiBut *but, ...) ATTR_SENTINEL(0); /* Edit i18n stuff. */ /* Name of the main py op from i18n addon. */ @@ -602,8 +612,8 @@ void uiButGetStrInfo(struct bContext *C, uiBut *but, ...) ATTR_SENTINEL(0); #define UI_ID_PREVIEWS (1 << 11) #define UI_ID_FULL (UI_ID_RENAME | UI_ID_BROWSE | UI_ID_ADD_NEW | UI_ID_OPEN | UI_ID_ALONE | UI_ID_DELETE | UI_ID_LOCAL) -int uiIconFromID(struct ID *id); -int uiIconFromReportType(int type); +int UI_icon_from_id(struct ID *id); +int UI_icon_from_report_type(int type); uiBut *uiDefPulldownBut(uiBlock *block, uiBlockCreateFunc func, void *arg, const char *str, int x, int y, short width, short height, const char *tip); uiBut *uiDefMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, const char *str, int x, int y, short width, short height, const char *tip); @@ -632,41 +642,42 @@ int uiDefAutoButsRNA(uiLayout *layout, struct PointerRNA *ptr, bool (*check_prop * Game engine logic brick links. Non-functional currently in 2.5, * code to handle and draw these is disabled internally. */ -void uiSetButLink(struct uiBut *but, void **poin, void ***ppoin, short *tot, int from, int to); +void UI_but_link_set(struct uiBut *but, void **poin, void ***ppoin, short *tot, int from, int to); -void uiComposeLinks(uiBlock *block); -uiBut *uiFindInlink(uiBlock *block, void *poin); +void UI_block_links_compose(uiBlock *block); +uiBut *UI_block_links_find_inlink(uiBlock *block, void *poin); /* use inside searchfunc to add items */ -bool uiSearchItemAdd(uiSearchItems *items, const char *name, void *poin, int iconid); +bool UI_search_item_add(uiSearchItems *items, const char *name, void *poin, int iconid); /* bfunc gets search item *poin as arg2, or if NULL the old string */ -void uiButSetSearchFunc(uiBut *but, uiButSearchFunc sfunc, void *arg1, uiButHandleFunc bfunc, void *active); +void UI_but_func_search_set(uiBut *but, uiButSearchFunc sfunc, void *arg1, uiButHandleFunc bfunc, void *active); /* height in pixels, it's using hardcoded values still */ -int uiSearchBoxHeight(void); -int uiSearchBoxWidth(void); +int UI_searchbox_size_y(void); +int UI_searchbox_size_x(void); /* check if a string is in an existing search box */ -int uiSearchItemFindIndex(uiSearchItems *items, const char *name); +int UI_search_items_find_index(uiSearchItems *items, const char *name); -void uiBlockSetHandleFunc(uiBlock *block, uiBlockHandleFunc func, void *arg); -void uiBlockSetButmFunc(uiBlock *block, uiMenuHandleFunc func, void *arg); -void uiBlockSetFunc(uiBlock *block, uiButHandleFunc func, void *arg1, void *arg2); -void uiBlockSetNFunc(uiBlock *block, uiButHandleNFunc funcN, void *argN, void *arg2); +void UI_block_func_handle_set(uiBlock *block, uiBlockHandleFunc func, void *arg); +void UI_block_func_butmenu_set(uiBlock *block, uiMenuHandleFunc func, void *arg); +void UI_block_func_set(uiBlock *block, uiButHandleFunc func, void *arg1, void *arg2); +void UI_block_funcN_set(uiBlock *block, uiButHandleNFunc funcN, void *argN, void *arg2); -void uiButSetRenameFunc(uiBut *but, uiButHandleRenameFunc func, void *arg1); -void uiButSetFunc(uiBut *but, uiButHandleFunc func, void *arg1, void *arg2); -void uiButSetNFunc(uiBut *but, uiButHandleNFunc funcN, void *argN, void *arg2); +void UI_but_func_rename_set(uiBut *but, uiButHandleRenameFunc func, void *arg1); +void UI_but_func_set(uiBut *but, uiButHandleFunc func, void *arg1, void *arg2); +void UI_but_funcN_set(uiBut *but, uiButHandleNFunc funcN, void *argN, void *arg2); -void uiButSetCompleteFunc(uiBut *but, uiButCompleteFunc func, void *arg); +void UI_but_func_complete_set(uiBut *but, uiButCompleteFunc func, void *arg); -void uiBlockSetDrawExtraFunc(uiBlock *block, - void (*func)(const struct bContext *C, void *, void *, void *, struct rcti *rect), - void *arg1, void *arg2); +void UI_but_func_drawextra_set( + uiBlock *block, + void (*func)(const struct bContext *C, void *, void *, void *, struct rcti *rect), + void *arg1, void *arg2); bool UI_textbutton_activate_rna(const struct bContext *C, struct ARegion *ar, const void *rna_poin_data, const char *rna_prop_id); bool UI_textbutton_activate_but(const struct bContext *C, uiBut *but); -void uiButSetFocusOnEnter(struct wmWindow *win, uiBut *but); +void UI_but_focus_on_enter_event(struct wmWindow *win, uiBut *but); /* Autocomplete * @@ -680,9 +691,9 @@ typedef struct AutoComplete AutoComplete; #define AUTOCOMPLETE_FULL_MATCH 1 #define AUTOCOMPLETE_PARTIAL_MATCH 2 -AutoComplete *autocomplete_begin(const char *startname, size_t maxlen); -void autocomplete_do_name(AutoComplete *autocpl, const char *name); -int autocomplete_end(AutoComplete *autocpl, char *autoname); +AutoComplete *UI_autocomplete_begin(const char *startname, size_t maxlen); +void UI_autocomplete_update_name(AutoComplete *autocpl, const char *name); +int UI_autocomplete_end(AutoComplete *autocpl, char *autoname); /* Panels * @@ -690,15 +701,15 @@ int autocomplete_end(AutoComplete *autocpl, char *autoname); * could use a good cleanup, though how they will function in 2.5 is * not clear yet so we postpone that. */ -void uiBeginPanels(const struct bContext *C, struct ARegion *ar); -void uiEndPanels(const struct bContext *C, struct ARegion *ar, int *x, int *y); -void uiDrawPanels(const struct bContext *C, struct ARegion *ar); +void UI_panels_begin(const struct bContext *C, struct ARegion *ar); +void UI_panels_end(const struct bContext *C, struct ARegion *ar, int *x, int *y); +void UI_panels_draw(const struct bContext *C, struct ARegion *ar); -struct Panel *uiPanelFindByType(struct ARegion *ar, struct PanelType *pt); -struct Panel *uiBeginPanel(struct ScrArea *sa, struct ARegion *ar, uiBlock *block, - struct PanelType *pt, struct Panel *pa, bool *r_open); -void uiEndPanel(uiBlock *block, int width, int height); -void uiScalePanels(struct ARegion *ar, float new_width); +struct Panel *UI_panel_find_by_type(struct ARegion *ar, struct PanelType *pt); +struct Panel *UI_panel_begin(struct ScrArea *sa, struct ARegion *ar, uiBlock *block, + struct PanelType *pt, struct Panel *pa, bool *r_open); +void UI_panel_end(uiBlock *block, int width, int height); +void UI_panels_scale(struct ARegion *ar, float new_width); bool UI_panel_category_is_visible(struct ARegion *ar); void UI_panel_category_add(struct ARegion *ar, const char *name); @@ -717,10 +728,10 @@ void UI_panel_category_draw_all(struct ARegion *ar, const * handling WM events. Mostly this is done automatic by modules such * as screen/ if ED_KEYMAP_UI is set, or internally in popup functions. */ -void UI_add_region_handlers(struct ListBase *handlers); -void UI_add_popup_handlers(struct bContext *C, struct ListBase *handlers, uiPopupBlockHandle *popup, const bool accept_dbl_click); -void UI_remove_popup_handlers(struct ListBase *handlers, uiPopupBlockHandle *popup); -void UI_remove_popup_handlers_all(struct bContext *C, struct ListBase *handlers); +void UI_region_handlers_add(struct ListBase *handlers); +void UI_popup_handlers_add(struct bContext *C, struct ListBase *handlers, uiPopupBlockHandle *popup, const bool accept_dbl_click); +void UI_popup_handlers_remove(struct ListBase *handlers, uiPopupBlockHandle *popup); +void UI_popup_handlers_remove_all(struct bContext *C, struct ListBase *handlers); /* Module * @@ -797,9 +808,9 @@ enum { /* not apart of the corner flags but mixed in some functions */ #define UI_RB_ALPHA (UI_CNR_ALL + 1) -uiLayout *uiBlockLayout(uiBlock *block, int dir, int type, int x, int y, int size, int em, int padding, struct uiStyle *style); -void uiBlockSetCurLayout(uiBlock *block, uiLayout *layout); -void uiBlockLayoutResolve(uiBlock *block, int *x, int *y); +uiLayout *UI_block_layout(uiBlock *block, int dir, int type, int x, int y, int size, int em, int padding, struct uiStyle *style); +void UI_block_layout_set_current(uiBlock *block, uiLayout *layout); +void UI_block_layout_resolve(uiBlock *block, int *x, int *y); uiBlock *uiLayoutGetBlock(uiLayout *layout); @@ -810,7 +821,7 @@ const char *uiLayoutIntrospect(uiLayout *layout); // XXX - testing void uiLayoutOperatorButs(const struct bContext *C, struct uiLayout *layout, struct wmOperator *op, bool (*check_prop)(struct PointerRNA *, struct PropertyRNA *), const char label_align, const short flag); -struct MenuType *uiButGetMenuType(uiBut *but); +struct MenuType *UI_but_menutype_get(uiBut *but); void uiLayoutSetOperatorContext(uiLayout *layout, int opcontext); void uiLayoutSetActive(uiLayout *layout, bool active); @@ -877,7 +888,7 @@ void uiTemplateImage(uiLayout *layout, struct bContext *C, struct PointerRNA *pt void uiTemplateImageSettings(uiLayout *layout, struct PointerRNA *imfptr, int color_management); void uiTemplateImageLayers(uiLayout *layout, struct bContext *C, struct Image *ima, struct ImageUser *iuser); void uiTemplateRunningJobs(uiLayout *layout, struct bContext *C); -void uiOperatorSearch_But(uiBut *but); +void UI_but_func_operator_search(uiBut *but); void uiTemplateOperatorSearch(uiLayout *layout); void uiTemplateHeader3D(uiLayout *layout, struct bContext *C); void uiTemplateEditModeSelection(uiLayout *layout, struct bContext *C); @@ -935,6 +946,7 @@ void uiItemS(uiLayout *layout); /* separator */ void uiItemMenuF(uiLayout *layout, const char *name, int icon, uiMenuCreateFunc func, void *arg); void uiItemMenuEnumO(uiLayout *layout, struct bContext *C, const char *opname, const char *propname, const char *name, int icon); +void uiItemMenuEnumR_prop(uiLayout *layout, struct PointerRNA *ptr, PropertyRNA *prop, const char *name, int icon); void uiItemMenuEnumR(uiLayout *layout, struct PointerRNA *ptr, const char *propname, const char *name, int icon); /* UI Operators */ @@ -943,32 +955,33 @@ typedef struct uiDragColorHandle { bool gamma_corrected; } uiDragColorHandle; -void UI_buttons_operatortypes(void); +void ED_button_operatortypes(void); void UI_drop_color_copy(struct wmDrag *drag, struct wmDropBox *drop); int UI_drop_color_poll(struct bContext *C, struct wmDrag *drag, const struct wmEvent *event); /* Helpers for Operators */ -uiBut *uiContextActiveButton(const struct bContext *C); -void uiContextActiveProperty(const struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA **prop, int *index); -void uiContextActivePropertyHandle(struct bContext *C); -struct wmOperator *uiContextActiveOperator(const struct bContext *C); -void uiContextAnimUpdate(const struct bContext *C); -void uiFileBrowseContextProperty(const struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA **prop); -void uiIDContextProperty(struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA **prop); +uiBut *UI_context_active_but_get(const struct bContext *C); +void UI_context_active_but_prop_get(const struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA **prop, int *index); +void UI_context_active_but_prop_handle(struct bContext *C); +struct wmOperator *UI_context_active_operator_get(const struct bContext *C); +void UI_context_update_anim_flag(const struct bContext *C); +void UI_context_active_but_prop_get_filebrowser(const struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA **prop); +void UI_context_active_but_prop_get_templateID(struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA **prop); /* Styled text draw */ -void uiStyleFontSet(struct uiFontStyle *fs); -void uiStyleFontDrawExt(struct uiFontStyle *fs, const struct rcti *rect, const char *str, - size_t len, float *r_xofs, float *r_yofs); -void uiStyleFontDraw(struct uiFontStyle *fs, const struct rcti *rect, const char *str); -void uiStyleFontDrawRotated(struct uiFontStyle *fs, const struct rcti *rect, const char *str); +void UI_fontstyle_set(struct uiFontStyle *fs); +void UI_fontstyle_draw_ex( + struct uiFontStyle *fs, const struct rcti *rect, const char *str, + size_t len, float *r_xofs, float *r_yofs); +void UI_fontstyle_draw(struct uiFontStyle *fs, const struct rcti *rect, const char *str); +void UI_fontstyle_draw_rotated(struct uiFontStyle *fs, const struct rcti *rect, const char *str); -int UI_GetStringWidth(const char *str); // XXX temp -void UI_DrawString(float x, float y, const char *str); // XXX temp -void UI_DrawTriIcon(float x, float y, char dir); +int UI_fontstyle_string_width(const char *str); // XXX temp +void UI_draw_string(float x, float y, const char *str); // XXX temp +void UI_draw_icon_tri(float x, float y, char dir); -uiStyle *UI_GetStyle(void); /* use for fonts etc */ -uiStyle *UI_GetStyleDraw(void); /* DPI scaled settings for drawing */ +uiStyle *UI_style_get(void); /* use for fonts etc */ +uiStyle *UI_style_get_dpi(void); /* DPI scaled settings for drawing */ /* linker workaround ack! */ void UI_template_fix_linking(void); @@ -988,12 +1001,13 @@ void UI_butstore_free(uiBlock *block, uiButStore *bs); bool UI_butstore_is_valid(uiButStore *bs); bool UI_butstore_is_registered(uiBlock *block, uiBut *but); void UI_butstore_register(uiButStore *bs_handle, uiBut **but_p); +bool UI_butstore_register_update(uiBlock *block, uiBut *but_dst, const uiBut *but_src); void UI_butstore_unregister(uiButStore *bs_handle, uiBut **but_p); /* Float precision helpers */ #define UI_PRECISION_FLOAT_MAX 7 -int uiFloatPrecisionCalc(int prec, double value); +int UI_calc_float_precision(int prec, double value); #endif /* __UI_INTERFACE_H__ */ diff --git a/source/blender/editors/include/UI_resources.h b/source/blender/editors/include/UI_resources.h index 5b61e76f514..c3d6dd5da38 100644 --- a/source/blender/editors/include/UI_resources.h +++ b/source/blender/editors/include/UI_resources.h @@ -266,6 +266,8 @@ enum { TH_NLA_SOUND, TH_NLA_SOUND_SEL, + TH_WIDGET_EMBOSS, + TH_AXIS_X, /* X/Y/Z Axis */ TH_AXIS_Y, TH_AXIS_Z, diff --git a/source/blender/editors/include/UI_view2d.h b/source/blender/editors/include/UI_view2d.h index cb7cf3ee404..4d7446a7a81 100644 --- a/source/blender/editors/include/UI_view2d.h +++ b/source/blender/editors/include/UI_view2d.h @@ -162,7 +162,7 @@ void UI_view2d_zoom_cache_reset(void); /* view matrix operations */ void UI_view2d_view_ortho(struct View2D *v2d); -void UI_view2d_view_orthoSpecial(struct ARegion *ar, struct View2D *v2d, short xaxis); +void UI_view2d_view_orthoSpecial(struct ARegion *ar, struct View2D *v2d, const bool xaxis); void UI_view2d_view_restore(const struct bContext *C); /* grid drawing */ @@ -234,5 +234,6 @@ void ED_keymap_view2d(struct wmKeyConfig *keyconf); void UI_view2d_smooth_view(struct bContext *C, struct ARegion *ar, const struct rctf *cur, const int smooth_viewtx); -#endif /* __UI_VIEW2D_H__ */ +#define UI_MARKER_MARGIN_Y (42 * UI_DPI_FAC) +#endif /* __UI_VIEW2D_H__ */ |