Cleanup: Const-correctness in ImBuf metadata drawing
This commit is contained in:
committed by
Sergey Sharybin
parent
5668cf0524
commit
24a28ea38d
@@ -75,7 +75,7 @@ void ED_region_draw_mouse_line_cb(const bContext *C, ARegion *region, void *arg_
|
||||
* \note Keep in sync with #BKE_image_stamp_buf.
|
||||
*/
|
||||
void ED_region_image_metadata_draw(
|
||||
int x, int y, ImBuf *ibuf, const rctf *frame, float zoomx, float zoomy);
|
||||
int x, int y, const ImBuf *ibuf, const rctf *frame, float zoomx, float zoomy);
|
||||
|
||||
/* Slider */
|
||||
|
||||
|
||||
@@ -707,7 +707,7 @@ static const char *meta_data_list[] = {
|
||||
"Scene",
|
||||
};
|
||||
|
||||
BLI_INLINE bool metadata_is_valid(ImBuf *ibuf, char *r_str, short index, int offset)
|
||||
BLI_INLINE bool metadata_is_valid(const ImBuf *ibuf, char *r_str, short index, int offset)
|
||||
{
|
||||
return (IMB_metadata_get_field(
|
||||
ibuf->metadata, meta_data_list[index], r_str + offset, MAX_METADATA_STR - offset) &&
|
||||
@@ -750,7 +750,7 @@ static void metadata_custom_draw_fields(const char *field, const char *value, vo
|
||||
ctx->current_y += ctx->vertical_offset;
|
||||
}
|
||||
|
||||
static void metadata_draw_imbuf(ImBuf *ibuf, const rctf *rect, int fontid, const bool is_top)
|
||||
static void metadata_draw_imbuf(const ImBuf *ibuf, const rctf *rect, int fontid, const bool is_top)
|
||||
{
|
||||
char temp_str[MAX_METADATA_STR];
|
||||
int ofs_y = 0;
|
||||
@@ -856,7 +856,7 @@ static void metadata_custom_count_fields(const char *field, const char * /*value
|
||||
ctx->count++;
|
||||
}
|
||||
|
||||
static float metadata_box_height_get(ImBuf *ibuf, int fontid, const bool is_top)
|
||||
static float metadata_box_height_get(const ImBuf *ibuf, int fontid, const bool is_top)
|
||||
{
|
||||
const float height = BLF_height_max(fontid);
|
||||
const float margin = (height / 8);
|
||||
@@ -910,7 +910,7 @@ static float metadata_box_height_get(ImBuf *ibuf, int fontid, const bool is_top)
|
||||
}
|
||||
|
||||
void ED_region_image_metadata_draw(
|
||||
int x, int y, ImBuf *ibuf, const rctf *frame, float zoomx, float zoomy)
|
||||
int x, int y, const ImBuf *ibuf, const rctf *frame, float zoomx, float zoomy)
|
||||
{
|
||||
const uiStyle *style = UI_style_get_dpi();
|
||||
|
||||
|
||||
@@ -59,4 +59,4 @@ void IMB_metadata_copy(ImBuf *ibuf_dst, const ImBuf *ibuf_src);
|
||||
|
||||
/* Invoke callback for every value stored in the metadata. */
|
||||
using IMBMetadataForeachCb = void (*)(const char *field, const char *value, void *userdata);
|
||||
void IMB_metadata_foreach(ImBuf *ibuf, IMBMetadataForeachCb callback, void *userdata);
|
||||
void IMB_metadata_foreach(const ImBuf *ibuf, IMBMetadataForeachCb callback, void *userdata);
|
||||
|
||||
@@ -84,7 +84,7 @@ void IMB_metadata_set_field(IDProperty *metadata, const char *key, const char *v
|
||||
}
|
||||
}
|
||||
|
||||
void IMB_metadata_foreach(ImBuf *ibuf, IMBMetadataForeachCb callback, void *userdata)
|
||||
void IMB_metadata_foreach(const ImBuf *ibuf, IMBMetadataForeachCb callback, void *userdata)
|
||||
{
|
||||
if (ibuf->metadata == nullptr) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user