Cleanup: use doxy sections
This commit is contained in:
@@ -63,7 +63,9 @@
|
||||
* giving more room for the text at the expense of nicely aligned text. */
|
||||
#define UI_PROP_SEP_ICON_WIDTH_EXCEPTION
|
||||
|
||||
/************************ Structs and Defines *************************/
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Structs and Defines
|
||||
* \{ */
|
||||
|
||||
#define UI_OPERATOR_ERROR_RET(_ot, _opname, return_statement) \
|
||||
if (ot == NULL) { \
|
||||
@@ -211,7 +213,11 @@ typedef struct uiLayoutItemRoot {
|
||||
uiLayout litem;
|
||||
} uiLayoutItemRoot;
|
||||
|
||||
/************************** Item ***************************/
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Item
|
||||
* \{ */
|
||||
|
||||
static const char *ui_item_name_add_colon(const char *name, char namestr[UI_MAX_NAME_STR])
|
||||
{
|
||||
@@ -408,7 +414,11 @@ static void ui_item_move(uiItem *item, int delta_xmin, int delta_xmax)
|
||||
}
|
||||
}
|
||||
|
||||
/******************** Special RNA Items *********************/
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Special RNA Items
|
||||
* \{ */
|
||||
|
||||
int uiLayoutGetLocalDir(const uiLayout *layout)
|
||||
{
|
||||
@@ -1088,7 +1098,11 @@ void UI_context_active_but_prop_get_filebrowser(const bContext *C,
|
||||
}
|
||||
}
|
||||
|
||||
/********************* Button Items *************************/
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Button Items
|
||||
* \{ */
|
||||
|
||||
/**
|
||||
* Update a buttons tip with an enum's description if possible.
|
||||
@@ -3235,7 +3249,11 @@ void uiItemTabsEnumR_prop(
|
||||
ui_item_enum_expand_tabs(layout, C, block, ptr, prop, NULL, UI_UNIT_Y, icon_only);
|
||||
}
|
||||
|
||||
/**************************** Layout Items ***************************/
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Layout Items
|
||||
* \{ */
|
||||
|
||||
/* single-row layout */
|
||||
static void ui_litem_estimate_row(uiLayout *litem)
|
||||
@@ -4733,7 +4751,11 @@ int uiLayoutGetEmboss(uiLayout *layout)
|
||||
}
|
||||
}
|
||||
|
||||
/********************** Layout *******************/
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Layout
|
||||
* \{ */
|
||||
|
||||
static void ui_item_scale(uiLayout *litem, const float scale[2])
|
||||
{
|
||||
@@ -5267,3 +5289,5 @@ void UI_paneltype_draw(bContext *C, PanelType *pt, uiLayout *layout)
|
||||
CTX_store_set(C, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
/** \} */
|
||||
|
||||
@@ -105,6 +105,10 @@ void UI_template_fix_linking(void)
|
||||
{
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Search Menu Helpers
|
||||
* \{ */
|
||||
|
||||
/**
|
||||
* Add a block button for the search menu for templateID and templateSearch.
|
||||
*/
|
||||
@@ -265,7 +269,11 @@ static uiBlock *template_common_search_menu(const bContext *C,
|
||||
return block;
|
||||
}
|
||||
|
||||
/********************** Header Template *************************/
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Header Template
|
||||
* \{ */
|
||||
|
||||
void uiTemplateHeader(uiLayout *layout, bContext *C)
|
||||
{
|
||||
@@ -275,7 +283,11 @@ void uiTemplateHeader(uiLayout *layout, bContext *C)
|
||||
ED_area_header_switchbutton(C, block, 0);
|
||||
}
|
||||
|
||||
/********************** Search Callbacks *************************/
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Search Callbacks
|
||||
* \{ */
|
||||
|
||||
typedef struct TemplateID {
|
||||
PointerRNA ptr;
|
||||
@@ -451,7 +463,12 @@ static uiBlock *id_search_menu(bContext *C, ARegion *ar, void *arg_litem)
|
||||
template_ui.scale);
|
||||
}
|
||||
|
||||
/************************ ID Template ***************************/
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name ID Template
|
||||
* \{ */
|
||||
|
||||
/* This is for browsing and editing the ID-blocks used */
|
||||
|
||||
/* for new/open operators */
|
||||
@@ -1368,7 +1385,11 @@ void uiTemplateIDTabs(uiLayout *layout,
|
||||
false);
|
||||
}
|
||||
|
||||
/************************ ID Chooser Template ***************************/
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name ID Chooser Template
|
||||
* \{ */
|
||||
|
||||
/**
|
||||
* This is for selecting the type of ID-block to use,
|
||||
@@ -1441,7 +1462,11 @@ void uiTemplateAnyID(uiLayout *layout,
|
||||
uiItemFullR(sub, ptr, propID, 0, 0, 0, "", ICON_NONE);
|
||||
}
|
||||
|
||||
/********************* Search Template ********************/
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Search Template
|
||||
* \{ */
|
||||
|
||||
typedef struct TemplateSearch {
|
||||
uiRNACollectionSearch search_data;
|
||||
@@ -1687,7 +1712,11 @@ void uiTemplateSearchPreview(uiLayout *layout,
|
||||
}
|
||||
}
|
||||
|
||||
/********************* RNA Path Builder Template ********************/
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name RNA Path Builder Template
|
||||
* \{ */
|
||||
|
||||
/* ---------- */
|
||||
|
||||
@@ -1724,7 +1753,11 @@ void uiTemplatePathBuilder(uiLayout *layout,
|
||||
* searching of nested properties to 'build' the path */
|
||||
}
|
||||
|
||||
/************************ Modifier Template *************************/
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Modifier Template
|
||||
* \{ */
|
||||
|
||||
#define ERROR_LIBDATA_MESSAGE TIP_("Can't edit external library data")
|
||||
|
||||
@@ -2069,7 +2102,11 @@ uiLayout *uiTemplateModifier(uiLayout *layout, bContext *C, PointerRNA *ptr)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/************************ Grease Pencil Modifier Template *************************/
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Grease Pencil Modifier Template
|
||||
* \{ */
|
||||
|
||||
static uiLayout *gpencil_draw_modifier(uiLayout *layout, Object *ob, GpencilModifierData *md)
|
||||
{
|
||||
@@ -2204,7 +2241,11 @@ uiLayout *uiTemplateGpencilModifier(uiLayout *layout, bContext *UNUSED(C), Point
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/************************ Shader FX Template *************************/
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Grease Pencil Shader FX Template
|
||||
* \{ */
|
||||
|
||||
static uiLayout *gpencil_draw_shaderfx(uiLayout *layout, Object *ob, ShaderFxData *md)
|
||||
{
|
||||
@@ -2322,7 +2363,11 @@ uiLayout *uiTemplateShaderFx(uiLayout *layout, bContext *UNUSED(C), PointerRNA *
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/************************ Redo Buttons Template *************************/
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Operator Redo Buttons Template
|
||||
* \{ */
|
||||
|
||||
static void template_operator_redo_property_buts_draw(
|
||||
const bContext *C, wmOperator *op, uiLayout *layout, int layout_flags, bool *r_has_advanced)
|
||||
@@ -2388,7 +2433,11 @@ void uiTemplateOperatorRedoProperties(uiLayout *layout, const bContext *C)
|
||||
}
|
||||
}
|
||||
|
||||
/************************ Constraint Template *************************/
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Constraint Template
|
||||
* \{ */
|
||||
|
||||
static void constraint_active_func(bContext *UNUSED(C), void *ob_v, void *con_v)
|
||||
{
|
||||
@@ -2604,7 +2653,11 @@ uiLayout *uiTemplateConstraint(uiLayout *layout, PointerRNA *ptr)
|
||||
return draw_constraint(layout, ob, con);
|
||||
}
|
||||
|
||||
/************************* Preview Template ***************************/
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Preview Template
|
||||
* \{ */
|
||||
|
||||
#include "DNA_light_types.h"
|
||||
#include "DNA_material_types.h"
|
||||
@@ -2866,7 +2919,11 @@ void uiTemplatePreview(uiLayout *layout,
|
||||
}
|
||||
}
|
||||
|
||||
/********************** ColorRamp Template **************************/
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name ColorRamp Template
|
||||
* \{ */
|
||||
|
||||
typedef struct RNAUpdateCb {
|
||||
PointerRNA ptr;
|
||||
@@ -3297,7 +3354,12 @@ void uiTemplateColorRamp(uiLayout *layout, PointerRNA *ptr, const char *propname
|
||||
MEM_freeN(cb);
|
||||
}
|
||||
|
||||
/********************* Icon Template ************************/
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Icon Template
|
||||
* \{ */
|
||||
|
||||
/**
|
||||
* \param icon_scale: Scale of the icon, 1x == button height.
|
||||
*/
|
||||
@@ -3324,7 +3386,12 @@ void uiTemplateIcon(uiLayout *layout, int icon_value, float icon_scale)
|
||||
ui_def_but_icon(but, icon_value, UI_HAS_ICON | UI_BUT_ICON_PREVIEW);
|
||||
}
|
||||
|
||||
/********************* Icon viewer Template ************************/
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Icon viewer Template
|
||||
* \{ */
|
||||
|
||||
typedef struct IconViewMenuArgs {
|
||||
PointerRNA ptr;
|
||||
PropertyRNA *prop;
|
||||
@@ -3484,7 +3551,11 @@ void uiTemplateIconView(uiLayout *layout,
|
||||
}
|
||||
}
|
||||
|
||||
/********************* Histogram Template ************************/
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Histogram Template
|
||||
* \{ */
|
||||
|
||||
void uiTemplateHistogram(uiLayout *layout, PointerRNA *ptr, const char *propname)
|
||||
{
|
||||
@@ -3534,7 +3605,11 @@ void uiTemplateHistogram(uiLayout *layout, PointerRNA *ptr, const char *propname
|
||||
"");
|
||||
}
|
||||
|
||||
/********************* Waveform Template ************************/
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Waveform Template
|
||||
* \{ */
|
||||
|
||||
void uiTemplateWaveform(uiLayout *layout, PointerRNA *ptr, const char *propname)
|
||||
{
|
||||
@@ -3596,7 +3671,11 @@ void uiTemplateWaveform(uiLayout *layout, PointerRNA *ptr, const char *propname)
|
||||
"");
|
||||
}
|
||||
|
||||
/********************* Vectorscope Template ************************/
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Vectorscope Template
|
||||
* \{ */
|
||||
|
||||
void uiTemplateVectorscope(uiLayout *layout, PointerRNA *ptr, const char *propname)
|
||||
{
|
||||
@@ -3658,7 +3737,11 @@ void uiTemplateVectorscope(uiLayout *layout, PointerRNA *ptr, const char *propna
|
||||
"");
|
||||
}
|
||||
|
||||
/********************* CurveMapping Template ************************/
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name CurveMapping Template
|
||||
* \{ */
|
||||
|
||||
static void curvemap_buttons_zoom_in(bContext *C, void *cumap_v, void *UNUSED(arg))
|
||||
{
|
||||
@@ -4419,7 +4502,11 @@ void uiTemplateCurveMapping(uiLayout *layout,
|
||||
MEM_freeN(cb);
|
||||
}
|
||||
|
||||
/********************* ColorPicker Template ************************/
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name ColorPicker Template
|
||||
* \{ */
|
||||
|
||||
#define WHEEL_SIZE (5 * U.widget_unit)
|
||||
|
||||
@@ -4766,7 +4853,11 @@ void uiTemplateCryptoPicker(uiLayout *layout, PointerRNA *ptr, const char *propn
|
||||
RNA_boolean_set(opptr, "use_accumulate", false);
|
||||
}
|
||||
|
||||
/********************* Layer Buttons Template ************************/
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Layer Buttons Template
|
||||
* \{ */
|
||||
|
||||
static void handle_layer_buttons(bContext *C, void *arg1, void *arg2)
|
||||
{
|
||||
@@ -4871,7 +4962,12 @@ void uiTemplateLayers(uiLayout *layout,
|
||||
}
|
||||
}
|
||||
|
||||
/************************* List Template **************************/
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name List Template
|
||||
* \{ */
|
||||
|
||||
static void uilist_draw_item_default(struct uiList *ui_list,
|
||||
struct bContext *UNUSED(C),
|
||||
struct uiLayout *layout,
|
||||
@@ -5756,7 +5852,11 @@ void uiTemplateList(uiLayout *layout,
|
||||
}
|
||||
}
|
||||
|
||||
/************************* Operator Search Template **************************/
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Operator Search Template
|
||||
* \{ */
|
||||
|
||||
static void operator_call_cb(bContext *C, void *UNUSED(arg1), void *arg2)
|
||||
{
|
||||
@@ -5861,7 +5961,11 @@ void uiTemplateOperatorSearch(uiLayout *layout)
|
||||
UI_but_func_operator_search(but);
|
||||
}
|
||||
|
||||
/************************* Operator Redo Properties Template **************************/
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Operator Redo Properties Template
|
||||
* \{ */
|
||||
|
||||
#ifdef USE_OP_RESET_BUT
|
||||
static void ui_layout_operator_buts__reset_cb(bContext *UNUSED(C),
|
||||
@@ -6037,7 +6141,11 @@ eAutoPropButsReturn uiTemplateOperatorPropertyButs(const bContext *C,
|
||||
return return_info;
|
||||
}
|
||||
|
||||
/************************* Running Jobs Template **************************/
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Running Jobs Template
|
||||
* \{ */
|
||||
|
||||
#define B_STOPRENDER 1
|
||||
#define B_STOPCAST 2
|
||||
@@ -6312,7 +6420,11 @@ void uiTemplateRunningJobs(uiLayout *layout, bContext *C)
|
||||
}
|
||||
}
|
||||
|
||||
/************************* Reports for Last Operator Template **************************/
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Reports for Last Operator Template
|
||||
* \{ */
|
||||
|
||||
void uiTemplateReportsBanner(uiLayout *layout, bContext *C)
|
||||
{
|
||||
@@ -6448,7 +6560,11 @@ void uiTemplateInputStatus(uiLayout *layout, struct bContext *C)
|
||||
}
|
||||
}
|
||||
|
||||
/********************************* Keymap *************************************/
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Keymap Template
|
||||
* \{ */
|
||||
|
||||
static void keymap_item_modified(bContext *UNUSED(C), void *kmi_p, void *UNUSED(unused))
|
||||
{
|
||||
@@ -6537,7 +6653,11 @@ void uiTemplateKeymapItemProperties(uiLayout *layout, PointerRNA *ptr)
|
||||
}
|
||||
}
|
||||
|
||||
/********************************* Color management *************************************/
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Color Management Template
|
||||
* \{ */
|
||||
|
||||
void uiTemplateColorspaceSettings(uiLayout *layout, PointerRNA *ptr, const char *propname)
|
||||
{
|
||||
@@ -6597,7 +6717,11 @@ void uiTemplateColormanagedViewSettings(uiLayout *layout,
|
||||
}
|
||||
}
|
||||
|
||||
/********************************* Component Menu *************************************/
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Component Menu
|
||||
* \{ */
|
||||
|
||||
typedef struct ComponentMenuArgs {
|
||||
PointerRNA ptr;
|
||||
@@ -6655,7 +6779,11 @@ void uiTemplateComponentMenu(uiLayout *layout,
|
||||
UI_block_align_end(block);
|
||||
}
|
||||
|
||||
/************************* Node Socket Icon **************************/
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Node Socket Icon Template
|
||||
* \{ */
|
||||
|
||||
void uiTemplateNodeSocket(uiLayout *layout, bContext *UNUSED(C), float *color)
|
||||
{
|
||||
@@ -6676,7 +6804,11 @@ void uiTemplateNodeSocket(uiLayout *layout, bContext *UNUSED(C), float *color)
|
||||
UI_block_align_end(block);
|
||||
}
|
||||
|
||||
/********************************* Cache File *********************************/
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Cache File Template
|
||||
* \{ */
|
||||
|
||||
void uiTemplateCacheFile(uiLayout *layout, bContext *C, PointerRNA *ptr, const char *propname)
|
||||
{
|
||||
@@ -6756,7 +6888,11 @@ void uiTemplateCacheFile(uiLayout *layout, bContext *C, PointerRNA *ptr, const c
|
||||
#endif
|
||||
}
|
||||
|
||||
/******************************* Recent Files *******************************/
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Recent Files Template
|
||||
* \{ */
|
||||
|
||||
int uiTemplateRecentFiles(uiLayout *layout, int rows)
|
||||
{
|
||||
@@ -6781,7 +6917,11 @@ int uiTemplateRecentFiles(uiLayout *layout, int rows)
|
||||
return i;
|
||||
}
|
||||
|
||||
/******************************* FileSelectParams Path Button *******************************/
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name FileSelectParams Path Button Template
|
||||
* \{ */
|
||||
|
||||
void uiTemplateFileSelectPath(uiLayout *layout, bContext *C, FileSelectParams *params)
|
||||
{
|
||||
@@ -6790,3 +6930,5 @@ void uiTemplateFileSelectPath(uiLayout *layout, bContext *C, FileSelectParams *p
|
||||
|
||||
ED_file_path_button(screen, sfile, params, uiLayoutGetBlock(layout));
|
||||
}
|
||||
|
||||
/** \} */
|
||||
|
||||
@@ -58,6 +58,10 @@
|
||||
# include "WM_types.h"
|
||||
#endif
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Local Enums/Defines
|
||||
* \{ */
|
||||
|
||||
/* icons are 80% of height of button (16 pixels inside 20 height) */
|
||||
#define ICON_SIZE_FROM_BUTRECT(rect) (0.8f * BLI_rcti_size_y(rect))
|
||||
|
||||
@@ -126,7 +130,12 @@ enum {
|
||||
#define UI_BUT_UPDATE_DELAY ((void)0)
|
||||
#define UI_BUT_UNDO ((void)0)
|
||||
|
||||
/* ************** widget base functions ************** */
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Widget Base Functions
|
||||
* \{ */
|
||||
|
||||
/**
|
||||
* - in: roundbox codes for corner types and radius
|
||||
* - return: array of `[size][2][x, y]` points, the edges of the roundbox, + UV coords
|
||||
@@ -193,7 +202,11 @@ typedef struct uiWidgetType {
|
||||
|
||||
} uiWidgetType;
|
||||
|
||||
/* *********************** draw data ************************** */
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Shape Preset Data
|
||||
* \{ */
|
||||
|
||||
static const float cornervec[WIDGET_CURVE_RESOLU][2] = {
|
||||
{0.0, 0.0},
|
||||
@@ -220,10 +233,6 @@ const float ui_pixel_jitter[UI_PIXEL_AA_JITTER][2] = {
|
||||
#define WIDGET_AA_JITTER UI_PIXEL_AA_JITTER
|
||||
#define jit ui_pixel_jitter
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Shape Preset Data
|
||||
* \{ */
|
||||
|
||||
static const float g_shape_preset_number_arrow_vert[3][2] = {
|
||||
{-0.352077, 0.532607},
|
||||
{-0.352077, -0.549313},
|
||||
@@ -307,12 +316,14 @@ static const uint g_shape_preset_hold_action_face[2][3] = {{2, 0, 1}, {3, 5, 4}}
|
||||
|
||||
/** \} */
|
||||
|
||||
/* **************** Batch creations ****************** */
|
||||
/**
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name #GPUBatch Creation
|
||||
*
|
||||
* In order to speed up UI drawing we create some batches that are then
|
||||
* modified by specialized shaders to draw certain elements really fast.
|
||||
* TODO: find a better place. Maybe it's own file?
|
||||
*/
|
||||
*
|
||||
* \{ */
|
||||
|
||||
/* offset in triavec[] in shader per type */
|
||||
static const int tria_ofs[ROUNDBOX_TRIA_MAX] = {
|
||||
@@ -596,7 +607,11 @@ GPUBatch *ui_batch_roundbox_shadow_get(void)
|
||||
#undef EMBOSS
|
||||
#undef NO_AA
|
||||
|
||||
/* ************************************************* */
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Draw Triangle Arrow
|
||||
* \{ */
|
||||
|
||||
void UI_draw_anti_tria(
|
||||
float x1, float y1, float x2, float y2, float x3, float y3, const float color[4])
|
||||
@@ -696,6 +711,12 @@ static void widget_init(uiWidgetBase *wtb)
|
||||
wtb->uniform_params.alpha_discard = 1.0f;
|
||||
}
|
||||
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Draw Round Box
|
||||
* \{ */
|
||||
|
||||
/* helper call, makes shadow rect, with 'sun' above menu, so only shadow to left/right/bottom */
|
||||
/* return tot */
|
||||
static int round_box_shadow_edges(
|
||||
@@ -954,6 +975,8 @@ static void round_box_edges(uiWidgetBase *wt, int roundboxalign, const rcti *rec
|
||||
round_box__edges(wt, roundboxalign, rect, rad, rad - U.pixelsize);
|
||||
}
|
||||
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Shape Preset Mini API
|
||||
* \{ */
|
||||
@@ -1133,6 +1156,10 @@ static void shape_preset_trias_from_rect_checkmark(uiWidgetTrias *tria, const rc
|
||||
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Widget Base Mini API
|
||||
* \{ */
|
||||
|
||||
/* prepares shade colors */
|
||||
static void shadecolors4(
|
||||
uchar coltop[4], uchar coldown[4], const uchar *color, short shadetop, short shadedown)
|
||||
@@ -1400,7 +1427,11 @@ static void widgetbase_draw(uiWidgetBase *wtb, const uiWidgetColors *wcol)
|
||||
widgetbase_draw_ex(wtb, wcol, false);
|
||||
}
|
||||
|
||||
/* *********************** text/icon ************************************** */
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Text/Icon Drawing
|
||||
* \{ */
|
||||
|
||||
#define UI_TEXT_CLIP_MARGIN (0.25f * U.widget_unit / but->block->aspect)
|
||||
|
||||
@@ -2471,9 +2502,13 @@ static void widget_draw_text_icon(const uiFontStyle *fstyle,
|
||||
|
||||
#undef UI_TEXT_CLIP_MARGIN
|
||||
|
||||
/* *********************** widget types ************************************* */
|
||||
/** \} */
|
||||
|
||||
/* ************ button callbacks, state ***************** */
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Widget State Management
|
||||
*
|
||||
* Adjust widget display based on animated, driven, overridden ... etc.
|
||||
* \{ */
|
||||
|
||||
static void widget_state_blend(uchar cp[3], const uchar cpstate[3], const float fac)
|
||||
{
|
||||
@@ -2623,6 +2658,12 @@ static void widget_state(uiWidgetType *wt, int state, int drawflag)
|
||||
}
|
||||
}
|
||||
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Widget Types
|
||||
* \{ */
|
||||
|
||||
/* sliders use special hack which sets 'item' as inner when drawing filling */
|
||||
static void widget_state_numslider(uiWidgetType *wt, int state, int drawflag)
|
||||
{
|
||||
@@ -2735,7 +2776,11 @@ static void widget_state_menu_item(uiWidgetType *wt, int state, int UNUSED(drawf
|
||||
}
|
||||
}
|
||||
|
||||
/* ************ menu backdrop ************************* */
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Menu Backdrop
|
||||
* \{ */
|
||||
|
||||
/* outside of rect, rad to left/bottom/right */
|
||||
static void widget_softshadow(const rcti *rect, int roundboxalign, const float radin)
|
||||
@@ -2986,7 +3031,11 @@ static void ui_draw_but_HSVCIRCLE(uiBut *but, const uiWidgetColors *wcol, const
|
||||
ui_hsv_cursor(xpos, ypos);
|
||||
}
|
||||
|
||||
/* ************ custom buttons, old stuff ************** */
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Custom Buttons
|
||||
* \{ */
|
||||
|
||||
/* draws in resolution of 48x4 colors */
|
||||
void ui_draw_gradient(const rcti *rect, const float hsv[3], const int type, const float alpha)
|
||||
@@ -3272,7 +3321,7 @@ static void ui_draw_but_HSV_v(uiBut *but, const rcti *rect)
|
||||
ui_hsv_cursor(x, y);
|
||||
}
|
||||
|
||||
/* ************ separator, for menus etc ***************** */
|
||||
/** Separator for menus. */
|
||||
static void ui_draw_separator(const rcti *rect, const uiWidgetColors *wcol)
|
||||
{
|
||||
int y = rect->ymin + BLI_rcti_size_y(rect) / 2 - 1;
|
||||
@@ -3300,7 +3349,12 @@ static void ui_draw_separator(const rcti *rect, const uiWidgetColors *wcol)
|
||||
immUnbindProgram();
|
||||
}
|
||||
|
||||
/* ************ button callbacks, draw ***************** */
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Button Draw Callbacks
|
||||
* \{ */
|
||||
|
||||
static void widget_numbut_draw(
|
||||
uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign, bool emboss)
|
||||
{
|
||||
|
||||
@@ -61,7 +61,9 @@
|
||||
|
||||
static void ui_view2d_curRect_validate_resize(View2D *v2d, bool resize, bool mask_scrollers);
|
||||
|
||||
/* *********************************************************************** */
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Internal Utilities
|
||||
* \{ */
|
||||
|
||||
BLI_INLINE int clamp_float_to_int(const float f)
|
||||
{
|
||||
@@ -94,6 +96,12 @@ BLI_INLINE void clamp_rctf_to_rcti(rcti *dst, const rctf *src)
|
||||
/* XXX still unresolved: scrolls hide/unhide vs region mask handling */
|
||||
/* XXX there's V2D_SCROLL_HORIZONTAL_HIDE and V2D_SCROLL_HORIZONTAL_FULLR ... */
|
||||
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Internal Scroll & Mask Utilities
|
||||
* \{ */
|
||||
|
||||
/**
|
||||
* helper to allow scrollbars to dynamically hide
|
||||
* - returns a copy of the scrollbar settings with the flags to display
|
||||
@@ -219,7 +227,11 @@ static void view2d_masks(View2D *v2d, bool check_scrollers, const rcti *mask_scr
|
||||
}
|
||||
}
|
||||
|
||||
/* Refresh and Validation */
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name View2D Refresh and Validation (Spatial)
|
||||
* \{ */
|
||||
|
||||
/**
|
||||
* Initialize all relevant View2D data (including view rects if first time)
|
||||
@@ -1123,8 +1135,11 @@ void UI_view2d_zoom_cache_reset(void)
|
||||
BLF_cache_clear();
|
||||
}
|
||||
|
||||
/* *********************************************************************** */
|
||||
/* View Matrix Setup */
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name View2D Matrix Setup
|
||||
* \{ */
|
||||
|
||||
/* mapping function to ensure 'cur' draws extended over the area where sliders are */
|
||||
static void view2d_map_cur_using_mask(const View2D *v2d, rctf *r_curmasked)
|
||||
@@ -1245,8 +1260,11 @@ void UI_view2d_view_restore(const bContext *C)
|
||||
// ED_region_pixelspace(CTX_wm_region(C));
|
||||
}
|
||||
|
||||
/* *********************************************************************** */
|
||||
/* Gridlines */
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Gridline Drawing
|
||||
* \{ */
|
||||
|
||||
/* Draw a constant grid in given 2d-region */
|
||||
void UI_view2d_constant_grid_draw(View2D *v2d, float step)
|
||||
@@ -1405,8 +1423,11 @@ void UI_view2d_multi_grid_draw(View2D *v2d, int colorid, float step, int level_s
|
||||
immUnbindProgram();
|
||||
}
|
||||
|
||||
/* *********************************************************************** */
|
||||
/* Scrollers */
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Scrollers
|
||||
* \{ */
|
||||
|
||||
/**
|
||||
* View2DScrollers is typedef'd in UI_view2d.h
|
||||
@@ -1648,8 +1669,11 @@ void UI_view2d_scrollers_free(View2DScrollers *scrollers)
|
||||
MEM_freeN(scrollers);
|
||||
}
|
||||
|
||||
/* *********************************************************************** */
|
||||
/* List View Utilities */
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name List View Utilities
|
||||
* \{ */
|
||||
|
||||
/**
|
||||
* Get the 'cell' (row, column) that the given 2D-view coordinates
|
||||
@@ -1693,8 +1717,11 @@ void UI_view2d_listview_view_to_cell(float columnwidth,
|
||||
}
|
||||
}
|
||||
|
||||
/* *********************************************************************** */
|
||||
/* Coordinate Conversions */
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Coordinate Conversions
|
||||
* \{ */
|
||||
|
||||
float UI_view2d_region_to_view_x(const struct View2D *v2d, float x)
|
||||
{
|
||||
@@ -1872,8 +1899,11 @@ bool UI_view2d_view_to_region_rcti_clip(View2D *v2d, const rctf *rect_src, rcti
|
||||
}
|
||||
}
|
||||
|
||||
/* *********************************************************************** */
|
||||
/* Utilities */
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Utilities
|
||||
* \{ */
|
||||
|
||||
/* View2D data by default resides in region, so get from region stored in context */
|
||||
View2D *UI_view2d_fromcontext(const bContext *C)
|
||||
@@ -2075,7 +2105,11 @@ char UI_view2d_rect_in_scrollers(const ARegion *ar, const View2D *v2d, const rct
|
||||
return UI_view2d_rect_in_scrollers_ex(ar, v2d, rect, &scroll_dummy);
|
||||
}
|
||||
|
||||
/* ******************* view2d text drawing cache ******************** */
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name View2D Text Drawing Cache
|
||||
* \{ */
|
||||
|
||||
typedef struct View2DString {
|
||||
struct View2DString *next;
|
||||
@@ -2205,4 +2239,4 @@ void UI_view2d_text_cache_draw(ARegion *ar)
|
||||
}
|
||||
}
|
||||
|
||||
/* ******************************************************** */
|
||||
/** \} */
|
||||
|
||||
Reference in New Issue
Block a user