diff options
Diffstat (limited to 'source/blender/editors/interface')
7 files changed, 81 insertions, 79 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 061bff7187f..b62a76ee14a 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -941,7 +941,7 @@ void uiComposeLinks(uiBlock *block) /* ************************************************ */ -void uiBlockSetButLock(uiBlock *block, int val, char *lockstr) +void uiBlockSetButLock(uiBlock *block, int val, const char *lockstr) { if(val) { block->lock= val ? 1:0; @@ -2449,7 +2449,7 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, const char *str, return but; } -static uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, const char *str, short x1, short y1, short x2, short y2, PointerRNA *ptr, const char *propname, int index, float min, float max, float a1, float a2, char *tip) +static uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, const char *str, short x1, short y1, short x2, short y2, PointerRNA *ptr, const char *propname, int index, float min, float max, float a1, float a2, const char *tip) { uiBut *but; PropertyRNA *prop; @@ -2679,7 +2679,7 @@ static uiBut *ui_def_but_operator_text(uiBlock *block, int type, const char *opn return but; } -uiBut *uiDefBut(uiBlock *block, int type, int retval, const char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefBut(uiBlock *block, int type, int retval, const char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, const char *tip) { uiBut *but= ui_def_but(block, type, retval, str, x1, y1, x2, y2, poin, min, max, a1, a2, tip); @@ -2712,10 +2712,10 @@ static int findBitIndex(unsigned int x) { struct AutoComplete { int maxlen; char *truncate; - char *startname; + const char *startname; }; -AutoComplete *autocomplete_begin(char *startname, int maxlen) +AutoComplete *autocomplete_begin(const char *startname, int maxlen) { AutoComplete *autocpl; @@ -2730,7 +2730,7 @@ AutoComplete *autocomplete_begin(char *startname, int maxlen) void autocomplete_do_name(AutoComplete *autocpl, const char *name) { char *truncate= autocpl->truncate; - char *startname= autocpl->startname; + const char *startname= autocpl->startname; int a; for(a=0; a<autocpl->maxlen-1; a++) { @@ -2788,7 +2788,7 @@ static void autocomplete_id(bContext *C, char *str, void *arg_v) } } -static uiBut *uiDefButBit(uiBlock *block, int type, int bit, int retval, char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip) +static uiBut *uiDefButBit(uiBlock *block, int type, int bit, int retval, const char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, const char *tip) { int bitIdx= findBitIndex(bit); if (bitIdx==-1) { @@ -2797,39 +2797,39 @@ static uiBut *uiDefButBit(uiBlock *block, int type, int bit, int retval, char *s return uiDefBut(block, type|BIT|bitIdx, retval, str, x1, y1, x2, y2, poin, min, max, a1, a2, tip); } } -uiBut *uiDefButF(uiBlock *block, int type, int retval, char *str, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefButF(uiBlock *block, int type, int retval, const char *str, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, const char *tip) { return uiDefBut(block, type|FLO, retval, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); } -uiBut *uiDefButBitF(uiBlock *block, int type, int bit, int retval, char *str, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefButBitF(uiBlock *block, int type, int bit, int retval, const char *str, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, const char *tip) { return uiDefButBit(block, type|FLO, bit, retval, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); } -uiBut *uiDefButI(uiBlock *block, int type, int retval, char *str, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefButI(uiBlock *block, int type, int retval, const char *str, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, const char *tip) { return uiDefBut(block, type|INT, retval, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); } -uiBut *uiDefButBitI(uiBlock *block, int type, int bit, int retval, char *str, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefButBitI(uiBlock *block, int type, int bit, int retval, const char *str, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, const char *tip) { return uiDefButBit(block, type|INT, bit, retval, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); } -uiBut *uiDefButS(uiBlock *block, int type, int retval, char *str, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefButS(uiBlock *block, int type, int retval, const char *str, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, const char *tip) { return uiDefBut(block, type|SHO, retval, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); } -uiBut *uiDefButBitS(uiBlock *block, int type, int bit, int retval, char *str, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefButBitS(uiBlock *block, int type, int bit, int retval, const char *str, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, const char *tip) { return uiDefButBit(block, type|SHO, bit, retval, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); } -uiBut *uiDefButC(uiBlock *block, int type, int retval, char *str, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefButC(uiBlock *block, int type, int retval, const char *str, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, const char *tip) { return uiDefBut(block, type|CHA, retval, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); } -uiBut *uiDefButBitC(uiBlock *block, int type, int bit, int retval, char *str, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefButBitC(uiBlock *block, int type, int bit, int retval, const char *str, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, const char *tip) { return uiDefButBit(block, type|CHA, bit, retval, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); } -uiBut *uiDefButR(uiBlock *block, int type, int retval, const char *str, short x1, short y1, short x2, short y2, PointerRNA *ptr, const char *propname, int index, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefButR(uiBlock *block, int type, int retval, const char *str, short x1, short y1, short x2, short y2, PointerRNA *ptr, const char *propname, int index, float min, float max, float a1, float a2, const char *tip) { uiBut *but; @@ -2839,7 +2839,7 @@ uiBut *uiDefButR(uiBlock *block, int type, int retval, const char *str, short x1 return but; } -uiBut *uiDefButO(uiBlock *block, int type, const char *opname, int opcontext, char *str, short x1, short y1, short x2, short y2, char *tip) +uiBut *uiDefButO(uiBlock *block, int type, const char *opname, int opcontext, const char *str, short x1, short y1, short x2, short y2, const char *tip) { uiBut *but; @@ -2850,7 +2850,7 @@ uiBut *uiDefButO(uiBlock *block, int type, const char *opname, int opcontext, ch return but; } -uiBut *uiDefButTextO(uiBlock *block, int type, const char *opname, int opcontext, char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefButTextO(uiBlock *block, int type, const char *opname, int opcontext, const char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, const char *tip) { uiBut *but= ui_def_but_operator_text(block, type, opname, opcontext, str, x1, y1, x2, y2, poin, min, max, a1, a2, tip); @@ -2861,7 +2861,7 @@ uiBut *uiDefButTextO(uiBlock *block, int type, const char *opname, int opcontext } /* if a1==1.0 then a2 is an extra icon blending factor (alpha 0.0 - 1.0) */ -uiBut *uiDefIconBut(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefIconBut(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, const char *tip) { uiBut *but= ui_def_but(block, type, retval, "", x1, y1, x2, y2, poin, min, max, a1, a2, tip); @@ -2872,7 +2872,7 @@ uiBut *uiDefIconBut(uiBlock *block, int type, int retval, int icon, short x1, sh return but; } -static uiBut *uiDefIconButBit(uiBlock *block, int type, int bit, int retval, int icon, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip) +static uiBut *uiDefIconButBit(uiBlock *block, int type, int bit, int retval, int icon, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, const char *tip) { int bitIdx= findBitIndex(bit); if (bitIdx==-1) { @@ -2882,39 +2882,39 @@ static uiBut *uiDefIconButBit(uiBlock *block, int type, int bit, int retval, int } } -uiBut *uiDefIconButF(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefIconButF(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, const char *tip) { return uiDefIconBut(block, type|FLO, retval, icon, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); } -uiBut *uiDefIconButBitF(uiBlock *block, int type, int bit, int retval, int icon, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefIconButBitF(uiBlock *block, int type, int bit, int retval, int icon, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, const char *tip) { return uiDefIconButBit(block, type|FLO, bit, retval, icon, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); } -uiBut *uiDefIconButI(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefIconButI(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, const char *tip) { return uiDefIconBut(block, type|INT, retval, icon, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); } -uiBut *uiDefIconButBitI(uiBlock *block, int type, int bit, int retval, int icon, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefIconButBitI(uiBlock *block, int type, int bit, int retval, int icon, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, const char *tip) { return uiDefIconButBit(block, type|INT, bit, retval, icon, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); } -uiBut *uiDefIconButS(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefIconButS(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, const char *tip) { return uiDefIconBut(block, type|SHO, retval, icon, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); } -uiBut *uiDefIconButBitS(uiBlock *block, int type, int bit, int retval, int icon, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefIconButBitS(uiBlock *block, int type, int bit, int retval, int icon, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, const char *tip) { return uiDefIconButBit(block, type|SHO, bit, retval, icon, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); } -uiBut *uiDefIconButC(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefIconButC(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, const char *tip) { return uiDefIconBut(block, type|CHA, retval, icon, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); } -uiBut *uiDefIconButBitC(uiBlock *block, int type, int bit, int retval, int icon, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefIconButBitC(uiBlock *block, int type, int bit, int retval, int icon, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, const char *tip) { return uiDefIconButBit(block, type|CHA, bit, retval, icon, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); } -uiBut *uiDefIconButR(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, PointerRNA *ptr, const char *propname, int index, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefIconButR(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, PointerRNA *ptr, const char *propname, int index, float min, float max, float a1, float a2, const char *tip) { uiBut *but; @@ -2929,7 +2929,7 @@ uiBut *uiDefIconButR(uiBlock *block, int type, int retval, int icon, short x1, s return but; } -uiBut *uiDefIconButO(uiBlock *block, int type, const char *opname, int opcontext, int icon, short x1, short y1, short x2, short y2, char *tip) +uiBut *uiDefIconButO(uiBlock *block, int type, const char *opname, int opcontext, int icon, short x1, short y1, short x2, short y2, const char *tip) { uiBut *but; @@ -2944,7 +2944,7 @@ uiBut *uiDefIconButO(uiBlock *block, int type, const char *opname, int opcontext } /* Button containing both string label and icon */ -uiBut *uiDefIconTextBut(uiBlock *block, int type, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefIconTextBut(uiBlock *block, int type, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, const char *tip) { uiBut *but= ui_def_but(block, type, retval, str, x1, y1, x2, y2, poin, min, max, a1, a2, tip); @@ -2957,7 +2957,7 @@ uiBut *uiDefIconTextBut(uiBlock *block, int type, int retval, int icon, const ch return but; } -static uiBut *uiDefIconTextButBit(uiBlock *block, int type, int bit, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip) +static uiBut *uiDefIconTextButBit(uiBlock *block, int type, int bit, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, const char *tip) { int bitIdx= findBitIndex(bit); if (bitIdx==-1) { @@ -2967,39 +2967,39 @@ static uiBut *uiDefIconTextButBit(uiBlock *block, int type, int bit, int retval, } } -uiBut *uiDefIconTextButF(uiBlock *block, int type, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefIconTextButF(uiBlock *block, int type, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, const char *tip) { return uiDefIconTextBut(block, type|FLO, retval, icon, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); } -uiBut *uiDefIconTextButBitF(uiBlock *block, int type, int bit, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefIconTextButBitF(uiBlock *block, int type, int bit, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, const char *tip) { return uiDefIconTextButBit(block, type|FLO, bit, retval, icon, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); } -uiBut *uiDefIconTextButI(uiBlock *block, int type, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefIconTextButI(uiBlock *block, int type, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, const char *tip) { return uiDefIconTextBut(block, type|INT, retval, icon, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); } -uiBut *uiDefIconTextButBitI(uiBlock *block, int type, int bit, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefIconTextButBitI(uiBlock *block, int type, int bit, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, const char *tip) { return uiDefIconTextButBit(block, type|INT, bit, retval, icon, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); } -uiBut *uiDefIconTextButS(uiBlock *block, int type, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefIconTextButS(uiBlock *block, int type, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, const char *tip) { return uiDefIconTextBut(block, type|SHO, retval, icon, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); } -uiBut *uiDefIconTextButBitS(uiBlock *block, int type, int bit, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefIconTextButBitS(uiBlock *block, int type, int bit, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, const char *tip) { return uiDefIconTextButBit(block, type|SHO, bit, retval, icon, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); } -uiBut *uiDefIconTextButC(uiBlock *block, int type, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefIconTextButC(uiBlock *block, int type, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, const char *tip) { return uiDefIconTextBut(block, type|CHA, retval, icon, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); } -uiBut *uiDefIconTextButBitC(uiBlock *block, int type, int bit, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefIconTextButBitC(uiBlock *block, int type, int bit, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, const char *tip) { return uiDefIconTextButBit(block, type|CHA, bit, retval, icon, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); } -uiBut *uiDefIconTextButR(uiBlock *block, int type, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, PointerRNA *ptr, const char *propname, int index, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefIconTextButR(uiBlock *block, int type, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, PointerRNA *ptr, const char *propname, int index, float min, float max, float a1, float a2, const char *tip) { uiBut *but; @@ -3015,7 +3015,7 @@ uiBut *uiDefIconTextButR(uiBlock *block, int type, int retval, int icon, const c return but; } -uiBut *uiDefIconTextButO(uiBlock *block, int type, const char *opname, int opcontext, int icon, const char *str, short x1, short y1, short x2, short y2, char *tip) +uiBut *uiDefIconTextButO(uiBlock *block, int type, const char *opname, int opcontext, int icon, const char *str, short x1, short y1, short x2, short y2, const char *tip) { uiBut *but; @@ -3246,7 +3246,7 @@ void uiButSetCompleteFunc(uiBut *but, uiButCompleteFunc func, void *arg) but->autofunc_arg= arg; } -uiBut *uiDefIDPoinBut(uiBlock *block, uiIDPoinFuncFP func, short blocktype, int retval, char *str, short x1, short y1, short x2, short y2, void *idpp, char *tip) +uiBut *uiDefIDPoinBut(uiBlock *block, uiIDPoinFuncFP func, short blocktype, int retval, const char *str, short x1, short y1, short x2, short y2, void *idpp, const char *tip) { uiBut *but= ui_def_but(block, IDPOIN, retval, str, x1, y1, x2, y2, NULL, 0.0, 0.0, 0.0, 0.0, tip); but->idpoin_func= func; @@ -3259,7 +3259,7 @@ uiBut *uiDefIDPoinBut(uiBlock *block, uiIDPoinFuncFP func, short blocktype, int return but; } -uiBut *uiDefBlockBut(uiBlock *block, uiBlockCreateFunc func, void *arg, char *str, short x1, short y1, short x2, short y2, char *tip) +uiBut *uiDefBlockBut(uiBlock *block, uiBlockCreateFunc func, void *arg, const char *str, short x1, short y1, short x2, short y2, const char *tip) { uiBut *but= ui_def_but(block, BLOCK, 0, str, x1, y1, x2, y2, arg, 0.0, 0.0, 0.0, 0.0, tip); but->block_create_func= func; @@ -3267,7 +3267,7 @@ uiBut *uiDefBlockBut(uiBlock *block, uiBlockCreateFunc func, void *arg, char *st return but; } -uiBut *uiDefBlockButN(uiBlock *block, uiBlockCreateFunc func, void *argN, char *str, short x1, short y1, short x2, short y2, char *tip) +uiBut *uiDefBlockButN(uiBlock *block, uiBlockCreateFunc func, void *argN, const char *str, short x1, short y1, short x2, short y2, const char *tip) { uiBut *but= ui_def_but(block, BLOCK, 0, str, x1, y1, x2, y2, NULL, 0.0, 0.0, 0.0, 0.0, tip); but->block_create_func= func; @@ -3279,7 +3279,7 @@ uiBut *uiDefBlockButN(uiBlock *block, uiBlockCreateFunc func, void *argN, char * } -uiBut *uiDefPulldownBut(uiBlock *block, uiBlockCreateFunc func, void *arg, char *str, short x1, short y1, short x2, short y2, char *tip) +uiBut *uiDefPulldownBut(uiBlock *block, uiBlockCreateFunc func, void *arg, const char *str, short x1, short y1, short x2, short y2, const char *tip) { uiBut *but= ui_def_but(block, PULLDOWN, 0, str, x1, y1, x2, y2, arg, 0.0, 0.0, 0.0, 0.0, tip); but->block_create_func= func; @@ -3287,7 +3287,7 @@ uiBut *uiDefPulldownBut(uiBlock *block, uiBlockCreateFunc func, void *arg, char return but; } -uiBut *uiDefMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, char *str, short x1, short y1, short x2, short y2, char *tip) +uiBut *uiDefMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, const char *str, short x1, short y1, short x2, short y2, const char *tip) { uiBut *but= ui_def_but(block, PULLDOWN, 0, str, x1, y1, x2, y2, arg, 0.0, 0.0, 0.0, 0.0, tip); but->menu_create_func= func; @@ -3295,7 +3295,7 @@ uiBut *uiDefMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, char *str, return but; } -uiBut *uiDefIconTextMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, int icon, char *str, short x1, short y1, short x2, short y2, char *tip) +uiBut *uiDefIconTextMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, int icon, const char *str, short x1, short y1, short x2, short y2, const char *tip) { uiBut *but= ui_def_but(block, PULLDOWN, 0, str, x1, y1, x2, y2, arg, 0.0, 0.0, 0.0, 0.0, tip); @@ -3311,7 +3311,7 @@ uiBut *uiDefIconTextMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, in return but; } -uiBut *uiDefIconMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, int icon, short x1, short y1, short x2, short y2, char *tip) +uiBut *uiDefIconMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, int icon, short x1, short y1, short x2, short y2, const char *tip) { uiBut *but= ui_def_but(block, PULLDOWN, 0, "", x1, y1, x2, y2, arg, 0.0, 0.0, 0.0, 0.0, tip); @@ -3326,7 +3326,7 @@ uiBut *uiDefIconMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, int ic } /* Block button containing both string label and icon */ -uiBut *uiDefIconTextBlockBut(uiBlock *block, uiBlockCreateFunc func, void *arg, int icon, char *str, short x1, short y1, short x2, short y2, char *tip) +uiBut *uiDefIconTextBlockBut(uiBlock *block, uiBlockCreateFunc func, void *arg, int icon, const char *str, short x1, short y1, short x2, short y2, const char *tip) { uiBut *but= ui_def_but(block, BLOCK, 0, str, x1, y1, x2, y2, arg, 0.0, 0.0, 0.0, 0.0, tip); @@ -3345,7 +3345,7 @@ uiBut *uiDefIconTextBlockBut(uiBlock *block, uiBlockCreateFunc func, void *arg, } /* Block button containing icon */ -uiBut *uiDefIconBlockBut(uiBlock *block, uiBlockCreateFunc func, void *arg, int retval, int icon, short x1, short y1, short x2, short y2, char *tip) +uiBut *uiDefIconBlockBut(uiBlock *block, uiBlockCreateFunc func, void *arg, int retval, int icon, short x1, short y1, short x2, short y2, const char *tip) { uiBut *but= ui_def_but(block, BLOCK, retval, "", x1, y1, x2, y2, arg, 0.0, 0.0, 0.0, 0.0, tip); @@ -3360,7 +3360,7 @@ uiBut *uiDefIconBlockBut(uiBlock *block, uiBlockCreateFunc func, void *arg, int return but; } -uiBut *uiDefKeyevtButS(uiBlock *block, int retval, char *str, short x1, short y1, short x2, short y2, short *spoin, char *tip) +uiBut *uiDefKeyevtButS(uiBlock *block, int retval, const char *str, short x1, short y1, short x2, short y2, short *spoin, const char *tip) { uiBut *but= ui_def_but(block, KEYEVT|SHO, retval, str, x1, y1, x2, y2, spoin, 0.0, 0.0, 0.0, 0.0, tip); ui_check_but(but); @@ -3369,7 +3369,7 @@ uiBut *uiDefKeyevtButS(uiBlock *block, int retval, char *str, short x1, short y1 /* short pointers hardcoded */ /* modkeypoin will be set to KM_SHIFT, KM_ALT, KM_CTRL, KM_OSKEY bits */ -uiBut *uiDefHotKeyevtButS(uiBlock *block, int retval, char *str, short x1, short y1, short x2, short y2, short *keypoin, short *modkeypoin, char *tip) +uiBut *uiDefHotKeyevtButS(uiBlock *block, int retval, const char *str, short x1, short y1, short x2, short y2, short *keypoin, short *modkeypoin, const char *tip) { uiBut *but= ui_def_but(block, HOTKEYEVT|SHO, retval, str, x1, y1, x2, y2, keypoin, 0.0, 0.0, 0.0, 0.0, tip); but->modifier_key= *modkeypoin; @@ -3380,7 +3380,7 @@ uiBut *uiDefHotKeyevtButS(uiBlock *block, int retval, char *str, short x1, short /* arg is pointer to string/name, use uiButSetSearchFunc() below to make this work */ /* here a1 and a2, if set, control thumbnail preview rows/cols */ -uiBut *uiDefSearchBut(uiBlock *block, void *arg, int retval, int icon, int maxlen, short x1, short y1, short x2, short y2, float a1, float a2, char *tip) +uiBut *uiDefSearchBut(uiBlock *block, void *arg, int retval, int icon, int maxlen, short x1, short y1, short x2, short y2, float a1, float a2, const char *tip) { uiBut *but= ui_def_but(block, SEARCH_MENU, retval, "", x1, y1, x2, y2, arg, 0.0, maxlen, a1, a2, tip); diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index 34eb78a40d8..d09be1df39a 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -303,7 +303,7 @@ struct uiBlock { short auto_open; double auto_open_last; - char *lockstr; + const char *lockstr; char lock; char active; // to keep blocks while drawing and free them afterwards @@ -436,7 +436,7 @@ void ui_set_name_menu(uiBut *but, int value); int ui_step_name_menu(uiBut *but, int step); struct AutoComplete; -struct AutoComplete *autocomplete_begin(char *startname, int maxlen); +struct AutoComplete *autocomplete_begin(const char *startname, int maxlen); void autocomplete_do_name(struct AutoComplete *autocpl, const char *name); void autocomplete_end(struct AutoComplete *autocpl, char *autoname); diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 4c166251268..e14a52ca2dc 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -439,7 +439,7 @@ static void ui_item_enum_expand(uiLayout *layout, uiBlock *block, PointerRNA *pt uiBut *but; EnumPropertyItem *item; const char *identifier; - char *name; + const char *name; int a, totitem, itemw, icon, value, free; identifier= RNA_property_identifier(prop); @@ -646,7 +646,7 @@ PointerRNA uiItemFullO(uiLayout *layout, const char *idname, const char *name, i return PointerRNA_NULL; } -static char *ui_menu_enumpropname(uiLayout *layout, const char *opname, const char *propname, int retval) +static const char *ui_menu_enumpropname(uiLayout *layout, const char *opname, const char *propname, int retval) { wmOperatorType *ot= WM_operatortype_find(opname, 0); PointerRNA ptr; @@ -676,7 +676,7 @@ static char *ui_menu_enumpropname(uiLayout *layout, const char *opname, const ch return ""; } -void uiItemEnumO(uiLayout *layout, const char *opname, char *name, int icon, const char *propname, int value) +void uiItemEnumO(uiLayout *layout, const char *opname, const char *name, int icon, const char *propname, int value) { PointerRNA ptr; @@ -759,7 +759,7 @@ void uiItemsEnumO(uiLayout *layout, const char *opname, const char *propname) } /* for use in cases where we have */ -void uiItemEnumO_string(uiLayout *layout, const char *name, int icon, const char *opname, const char *propname, char *value_str) +void uiItemEnumO_string(uiLayout *layout, const char *name, int icon, const char *opname, const char *propname, const char *value_str) { PointerRNA ptr; @@ -796,7 +796,7 @@ void uiItemEnumO_string(uiLayout *layout, const char *name, int icon, const char uiItemFullO(layout, opname, name, icon, ptr.data, layout->root->opcontext, 0); } -void uiItemBooleanO(uiLayout *layout, char *name, int icon, const char *opname, const char *propname, int value) +void uiItemBooleanO(uiLayout *layout, const char *name, int icon, const char *opname, const char *propname, int value) { PointerRNA ptr; @@ -826,7 +826,7 @@ void uiItemFloatO(uiLayout *layout, const char *name, int icon, const char *opna uiItemFullO(layout, opname, name, icon, ptr.data, layout->root->opcontext, 0); } -void uiItemStringO(uiLayout *layout, const char *name, int icon, const char *opname, const char *propname, char *value) +void uiItemStringO(uiLayout *layout, const char *name, int icon, const char *opname, const char *propname, const char *value) { PointerRNA ptr; @@ -1374,7 +1374,7 @@ void uiItemL(uiLayout *layout, const char *name, int icon) uiItemL_(layout, name, icon); } -void uiItemLDrag(uiLayout *layout, PointerRNA *ptr, char *name, int icon) +void uiItemLDrag(uiLayout *layout, PointerRNA *ptr, const char *name, int icon) { uiBut *but= uiItemL_(layout, name, icon); @@ -1385,7 +1385,7 @@ void uiItemLDrag(uiLayout *layout, PointerRNA *ptr, char *name, int icon) /* value item */ -void uiItemV(uiLayout *layout, char *name, int icon, int argval) +void uiItemV(uiLayout *layout, const char *name, int icon, int argval) { /* label */ uiBlock *block= layout->root->block; diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index 6b834c08456..df2ebd44c9c 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -71,7 +71,7 @@ /*********************** Menu Data Parsing ********************* */ typedef struct MenuEntry { - char *str; + const char *str; int retval; int icon; int sepr; @@ -79,7 +79,7 @@ typedef struct MenuEntry { typedef struct MenuData { char *instr; - char *title; + const char *title; int titleicon; MenuEntry *items; @@ -99,7 +99,7 @@ static MenuData *menudata_new(char *instr) return md; } -static void menudata_set_title(MenuData *md, char *title, int titleicon) +static void menudata_set_title(MenuData *md, const char *title, int titleicon) { if (!md->title) md->title= title; @@ -107,7 +107,7 @@ static void menudata_set_title(MenuData *md, char *title, int titleicon) md->titleicon= titleicon; } -static void menudata_add_item(MenuData *md, char *str, int retval, int icon, int sepr) +static void menudata_add_item(MenuData *md, const char *str, int retval, int icon, int sepr) { if (md->nitems==md->itemssize) { int nsize= md->itemssize?(md->itemssize<<1):1; @@ -154,7 +154,8 @@ MenuData *decompose_menu_string(char *str) { char *instr= BLI_strdup(str); MenuData *md= menudata_new(instr); - char *nitem= NULL, *s= instr; + const char *nitem= NULL; + char *s= instr; int nicon=0, nretval= 1, nitem_is_title= 0, nitem_is_sepr= 0; while (1) { @@ -2279,7 +2280,7 @@ static void confirm_cancel_operator(void *opv) WM_operator_free(opv); } -static void vconfirm_opname(bContext *C, const char *opname, char *title, char *itemfmt, va_list ap) +static void vconfirm_opname(bContext *C, const char *opname, const char *title, const char *itemfmt, va_list ap) { uiPopupBlockHandle *handle; char *s, buf[512]; @@ -2294,7 +2295,7 @@ static void vconfirm_opname(bContext *C, const char *opname, char *title, char * handle->popup_arg= (void *)opname; } -static void confirm_operator(bContext *C, wmOperator *op, char *title, char *item) +static void confirm_operator(bContext *C, wmOperator *op, const char *title, const char *item) { uiPopupBlockHandle *handle; char *s, buf[512]; @@ -2309,7 +2310,7 @@ static void confirm_operator(bContext *C, wmOperator *op, char *title, char *ite handle->cancel_func= confirm_cancel_operator; } -void uiPupMenuOkee(bContext *C, const char *opname, char *str, ...) +void uiPupMenuOkee(bContext *C, const char *opname, const char *str, ...) { va_list ap; char titlestr[256]; @@ -2321,7 +2322,7 @@ void uiPupMenuOkee(bContext *C, const char *opname, char *str, ...) va_end(ap); } -void uiPupMenuSaveOver(bContext *C, wmOperator *op, char *filename) +void uiPupMenuSaveOver(bContext *C, wmOperator *op, const char *filename) { size_t len= strlen(filename); @@ -2339,7 +2340,7 @@ void uiPupMenuSaveOver(bContext *C, wmOperator *op, char *filename) confirm_operator(C, op, "Save Over", filename); } -void uiPupMenuNotice(bContext *C, char *str, ...) +void uiPupMenuNotice(bContext *C, const char *str, ...) { va_list ap; @@ -2348,7 +2349,7 @@ void uiPupMenuNotice(bContext *C, char *str, ...) va_end(ap); } -void uiPupMenuError(bContext *C, char *str, ...) +void uiPupMenuError(bContext *C, const char *str, ...) { va_list ap; char nfmt[256]; diff --git a/source/blender/editors/interface/interface_style.c b/source/blender/editors/interface/interface_style.c index 43f11ae421e..51a54315d66 100644 --- a/source/blender/editors/interface/interface_style.c +++ b/source/blender/editors/interface/interface_style.c @@ -136,7 +136,7 @@ static uiFont *uifont_to_blfont(int id) /* *************** draw ************************ */ -void uiStyleFontDraw(uiFontStyle *fs, rcti *rect, char *str) +void uiStyleFontDraw(uiFontStyle *fs, rcti *rect, const char *str) { float height; int xofs=0, yofs; @@ -174,7 +174,7 @@ void uiStyleFontDraw(uiFontStyle *fs, rcti *rect, char *str) } /* drawn same as above, but at 90 degree angle */ -void uiStyleFontDrawRotated(uiFontStyle *fs, rcti *rect, char *str) +void uiStyleFontDrawRotated(uiFontStyle *fs, rcti *rect, const char *str) { float height; int xofs, yofs; diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index ae75bd03d86..e56aa3f7682 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -1962,7 +1962,8 @@ static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, Pointe uiBlock *block= uiLayoutGetBlock(layout); uiBut *but; uiLayout *split, *overlap, *sub, *row; - char *name, *namebuf; + char *namebuf; + const char *name; int icon; overlap= uiLayoutOverlap(layout); diff --git a/source/blender/editors/interface/interface_utils.c b/source/blender/editors/interface/interface_utils.c index 6d8aa89afb0..7d3f186d490 100644 --- a/source/blender/editors/interface/interface_utils.c +++ b/source/blender/editors/interface/interface_utils.c @@ -40,7 +40,7 @@ /*************************** RNA Utilities ******************************/ -uiBut *uiDefAutoButR(uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, int index, char *name, int icon, int x1, int y1, int x2, int y2) +uiBut *uiDefAutoButR(uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, int index, const char *name, int icon, int x1, int y1, int x2, int y2) { uiBut *but=NULL; const char *propname= RNA_property_identifier(prop); |