Blender V5.0
ed_draw.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2008 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#include <cmath>
10#include <cstdlib>
11#include <cstring>
12
13#include "MEM_guardedalloc.h"
14
15#include "BLI_listbase.h"
16#include "BLI_math_vector.h"
17#include "BLI_rect.h"
18#include "BLI_string_utf8.h"
19#include "BLI_utildefines.h"
20
21#include "BLT_translation.hh"
22
23#include "BKE_context.hh"
24#include "BKE_global.hh"
25#include "BKE_image.hh"
26#include "BKE_screen.hh"
27
28#include "BLF_api.hh"
29
30#include "IMB_imbuf_types.hh"
31#include "IMB_metadata.hh"
32
33#include "ED_screen.hh"
34#include "ED_space_api.hh"
35#include "ED_util.hh"
36
37#include "GPU_immediate.hh"
38#include "GPU_matrix.hh"
39#include "GPU_state.hh"
40
41#include "UI_interface.hh"
42#include "UI_resources.hh"
43
44#include "WM_api.hh"
45#include "WM_types.hh"
46
47/* -------------------------------------------------------------------- */
57
58#define SLIDE_PIXEL_DISTANCE (300.0f * UI_SCALE_FAC)
59#define OVERSHOOT_RANGE_DELTA 0.2f
60#define SLIDER_UNIT_STRING_SIZE 64
61
62struct tSlider {
65
68
71
74
76 float factor;
77
79 float last_cursor[2];
80
82 float factor_bounds[2];
83
86
87 /* How the factor number is drawn. When drawing percent it is factor*100. */
89
90 /* Optional string that will display next to the slider to indicate which property is modified
91 * right now. */
92 std::string property_label;
93
94 /* What unit to add to the slider. */
96
102
106
110
113
116};
117
118static void draw_overshoot_triangle(const uint8_t color[4],
119 const bool facing_right,
120 const float x,
121 const float y)
122{
123 const uint shdr_pos_2d = GPU_vertformat_attr_add(
124 immVertexFormat(), "pos", blender::gpu::VertAttrType::SFLOAT_32_32);
127 GPU_polygon_smooth(true);
128 immUniformColor3ubvAlpha(color, 225);
129 const float triangle_side_length = facing_right ? 6 * U.pixelsize : -6 * U.pixelsize;
130 const float triangle_offset = facing_right ? 2 * U.pixelsize : -2 * U.pixelsize;
131
133 immVertex2f(shdr_pos_2d, x + triangle_offset + triangle_side_length, y);
134 immVertex2f(shdr_pos_2d, x + triangle_offset, y + triangle_side_length / 2);
135 immVertex2f(shdr_pos_2d, x + triangle_offset, y - triangle_side_length / 2);
136 immEnd();
137
138 GPU_polygon_smooth(false);
141}
142
143static void draw_ticks(const float start_factor,
144 const float end_factor,
145 const float line_start[2],
146 const float base_tick_height,
147 const float line_width,
148 const uint8_t color_overshoot[4],
149 const uint8_t color_line[4])
150{
151 /* Use factor represented as 0-100 int to avoid floating point precision problems. */
152 const int tick_increment = 10;
153
154 /* Round initial_tick_factor up to the next tick_increment. */
155 int tick_percentage = ceil((start_factor * 100) / tick_increment) * tick_increment;
156
157 while (tick_percentage <= int(end_factor * 100)) {
158 float tick_height;
159 /* Different ticks have different heights. Multiples of 100% are the tallest, 50% is a bit
160 * smaller and the rest is the minimum size. */
161 if (tick_percentage % 100 == 0) {
162 tick_height = base_tick_height;
163 }
164 else if (tick_percentage % 50 == 0) {
165 tick_height = base_tick_height * 0.8;
166 }
167 else {
168 tick_height = base_tick_height * 0.5;
169 }
170
171 const float x = line_start[0] +
172 ((float(tick_percentage) / 100) - start_factor) * SLIDE_PIXEL_DISTANCE;
173 rctf tick_rect{};
174 tick_rect.xmin = x - (line_width / 2);
175 tick_rect.xmax = x + (line_width / 2);
176 tick_rect.ymin = line_start[1] - (tick_height / 2);
177 tick_rect.ymax = line_start[1] + (tick_height / 2);
178
179 if (tick_percentage < 0 || tick_percentage > 100) {
180 UI_draw_roundbox_3ub_alpha(&tick_rect, true, 1, color_overshoot, 255);
181 }
182 else {
183 UI_draw_roundbox_3ub_alpha(&tick_rect, true, 1, color_line, 255);
184 }
185 tick_percentage += tick_increment;
186 }
187}
188
189static void draw_main_line(const rctf *main_line_rect,
190 const float factor,
191 const bool overshoot,
192 const uint8_t color_overshoot[4],
193 const uint8_t color_line[4])
194{
195 if (overshoot) {
196 /* In overshoot mode, draw the 0-100% range differently to provide a visual reference. */
197 const float line_zero_percent = main_line_rect->xmin -
198 ((factor - 0.5f - OVERSHOOT_RANGE_DELTA) *
200
201 const float clamped_line_zero_percent = clamp_f(
202 line_zero_percent, main_line_rect->xmin, main_line_rect->xmax);
203 const float clamped_line_hundred_percent = clamp_f(
204 line_zero_percent + SLIDE_PIXEL_DISTANCE, main_line_rect->xmin, main_line_rect->xmax);
205
206 rctf left_overshoot_line_rect{};
207 left_overshoot_line_rect.xmin = main_line_rect->xmin;
208 left_overshoot_line_rect.xmax = clamped_line_zero_percent;
209 left_overshoot_line_rect.ymin = main_line_rect->ymin;
210 left_overshoot_line_rect.ymax = main_line_rect->ymax;
211
212 rctf right_overshoot_line_rect{};
213 right_overshoot_line_rect.xmin = clamped_line_hundred_percent;
214 right_overshoot_line_rect.xmax = main_line_rect->xmax;
215 right_overshoot_line_rect.ymin = main_line_rect->ymin;
216 right_overshoot_line_rect.ymax = main_line_rect->ymax;
217
218 UI_draw_roundbox_3ub_alpha(&left_overshoot_line_rect, true, 0, color_overshoot, 255);
219 UI_draw_roundbox_3ub_alpha(&right_overshoot_line_rect, true, 0, color_overshoot, 255);
220
221 rctf non_overshoot_line_rect{};
222 non_overshoot_line_rect.xmin = clamped_line_zero_percent;
223 non_overshoot_line_rect.xmax = clamped_line_hundred_percent;
224 non_overshoot_line_rect.ymin = main_line_rect->ymin;
225 non_overshoot_line_rect.ymax = main_line_rect->ymax;
226 UI_draw_roundbox_3ub_alpha(&non_overshoot_line_rect, true, 0, color_line, 255);
227 }
228 else {
229 UI_draw_roundbox_3ub_alpha(main_line_rect, true, 0, color_line, 255);
230 }
231}
232
233static void draw_backdrop(const int fontid,
234 const rctf *main_line_rect,
235 const uint8_t color_bg[4],
236 const short region_y_size,
237 const float base_tick_height,
238 const std::string &property_label)
239{
240 float percent_string_pixel_size[2];
241 const char *percentage_string_placeholder = "000%%";
243 percentage_string_placeholder,
244 sizeof(percentage_string_placeholder),
245 &percent_string_pixel_size[0],
246 &percent_string_pixel_size[1]);
247
248 float property_name_pixel_size[2];
250 property_label.c_str(),
251 property_label.size(),
252 &property_name_pixel_size[0],
253 &property_name_pixel_size[1]);
254 const float pad[2] = {(region_y_size - base_tick_height) / 2 + 12.0f * U.pixelsize,
255 2.0f * U.pixelsize};
256 rctf backdrop_rect{};
257 backdrop_rect.xmin = main_line_rect->xmin - property_name_pixel_size[0] - pad[0];
258 backdrop_rect.xmax = main_line_rect->xmax + percent_string_pixel_size[0] + pad[0];
259 backdrop_rect.ymin = pad[1];
260 backdrop_rect.ymax = region_y_size - pad[1];
261 UI_draw_roundbox_3ub_alpha(&backdrop_rect, true, 4.0f, color_bg, color_bg[3]);
262}
263
267static void slider_draw(const bContext * /*C*/, ARegion *region, void *arg)
268{
269 tSlider *slider = static_cast<tSlider *>(arg);
270
271 /* Only draw in region from which the Operator was started. */
272 if (region != slider->region_header) {
273 return;
274 }
275
276 uint8_t color_text[4];
277 uint8_t color_line[4];
278 uint8_t color_handle[4];
279 uint8_t color_overshoot[4];
280 uint8_t color_bg[4];
281
282 /* Get theme colors. */
286 UI_GetThemeColor4ubv(TH_HEADER_TEXT, color_overshoot);
288
289 color_overshoot[0] = color_overshoot[0] * 0.8;
290 color_overshoot[1] = color_overshoot[1] * 0.8;
291 color_overshoot[2] = color_overshoot[2] * 0.8;
292 color_bg[3] = 160;
293
294 /* Get the default font. */
295 const uiStyle *style = UI_style_get();
296 const uiFontStyle *fstyle = &style->widget;
297 const int fontid = fstyle->uifont_id;
298 BLF_color3ubv(fontid, color_text);
299 BLF_rotation(fontid, 0.0f);
300
301 const float line_width = 1.5 * U.pixelsize;
302 const float base_tick_height = 12.0 * U.pixelsize;
303 const float line_y = region->winy / 2;
304
305 rctf main_line_rect{};
306 main_line_rect.xmin = (region->winx / 2) - (SLIDE_PIXEL_DISTANCE / 2);
307 main_line_rect.xmax = (region->winx / 2) + (SLIDE_PIXEL_DISTANCE / 2);
308 main_line_rect.ymin = line_y - line_width / 2;
309 main_line_rect.ymax = line_y + line_width / 2;
310
311 float line_start_factor = 0;
312 int handle_pos_x;
313 if (slider->overshoot) {
314 main_line_rect.xmin = main_line_rect.xmin - SLIDE_PIXEL_DISTANCE * OVERSHOOT_RANGE_DELTA;
315 main_line_rect.xmax = main_line_rect.xmax + SLIDE_PIXEL_DISTANCE * OVERSHOOT_RANGE_DELTA;
316 line_start_factor = slider->factor - 0.5f - OVERSHOOT_RANGE_DELTA;
317 handle_pos_x = region->winx / 2;
318 }
319 else {
320 const float total_range = slider->factor_bounds[1] - slider->factor_bounds[0];
321 /* 0-1 value of the representing the position of the slider in the allowed range. */
322 const float range_factor = (slider->factor - slider->factor_bounds[0]) / total_range;
323 handle_pos_x = main_line_rect.xmin + SLIDE_PIXEL_DISTANCE * range_factor;
324 }
325
326 draw_backdrop(fontid,
327 &main_line_rect,
328 color_bg,
329 slider->region_header->winy,
330 base_tick_height,
331 slider->property_label);
332
333 draw_main_line(&main_line_rect, slider->factor, slider->overshoot, color_overshoot, color_line);
334
335 const float factor_range = slider->overshoot ? 1 + OVERSHOOT_RANGE_DELTA * 2 : 1;
336 const float line_start_position[2] = {main_line_rect.xmin, line_y};
337 draw_ticks(line_start_factor,
338 line_start_factor + factor_range,
339 line_start_position,
340 base_tick_height,
341 line_width,
342 color_overshoot,
343 color_line);
344
345 /* Draw triangles at the ends of the line in overshoot mode to indicate direction of 0-100%
346 * range. */
347 if (slider->overshoot) {
348 if (slider->factor > 1 + OVERSHOOT_RANGE_DELTA + 0.5) {
349 draw_overshoot_triangle(color_line, false, main_line_rect.xmin, line_y);
350 }
351 if (slider->factor < 0 - OVERSHOOT_RANGE_DELTA - 0.5) {
352 draw_overshoot_triangle(color_line, true, main_line_rect.xmax, line_y);
353 }
354 }
355
356 /* Draw handle indicating current factor. */
357 rctf handle_rect{};
358 handle_rect.xmin = handle_pos_x - (line_width);
359 handle_rect.xmax = handle_pos_x + (line_width);
360 handle_rect.ymin = line_y - (base_tick_height / 2);
361 handle_rect.ymax = line_y + (base_tick_height / 2);
362
363 UI_draw_roundbox_3ub_alpha(&handle_rect, true, 1, color_handle, 255);
364
365 char factor_string[256];
366 switch (slider->slider_mode) {
368 SNPRINTF_UTF8(factor_string, "%.0f %s", slider->factor * 100, slider->unit_string);
369 break;
371 SNPRINTF_UTF8(factor_string, "%.1f %s", slider->factor, slider->unit_string);
372 break;
373 }
374
375 /* Draw factor string. */
376 float factor_string_pixel_size[2];
378 factor_string,
379 sizeof(factor_string),
380 &factor_string_pixel_size[0],
381 &factor_string_pixel_size[1]);
382
383 const float text_padding = 12.0 * U.pixelsize;
384 const float factor_string_pos_x = main_line_rect.xmax + text_padding;
386 fontid, factor_string_pos_x, (region->winy / 2) - factor_string_pixel_size[1] / 2, 0.0f);
387 BLF_draw(fontid, factor_string, sizeof(factor_string));
388
389 if (!slider->property_label.empty()) {
390 float property_name_pixel_size[2];
392 slider->property_label.c_str(),
393 slider->property_label.length(),
394 &property_name_pixel_size[0],
395 &property_name_pixel_size[1]);
396 BLF_position(fontid,
397 main_line_rect.xmin - text_padding - property_name_pixel_size[0],
398 (region->winy / 2) - property_name_pixel_size[1] / 2,
399 0.0f);
400 BLF_draw(fontid, slider->property_label.c_str(), slider->property_label.length());
401 }
402}
403
404static void slider_update_factor(tSlider *slider, const wmEvent *event)
405{
406 /* Normalize so no matter the factor bounds, the mouse distance traveled from min to max is
407 * constant. */
408 const float slider_range = slider->factor_bounds[1] - slider->factor_bounds[0];
409 const float factor_delta = (event->xy[0] - slider->last_cursor[0]) /
410 (SLIDE_PIXEL_DISTANCE / slider_range);
411 /* Reduced factor delta in precision mode (shift held). */
412 slider->raw_factor += slider->precision ? (factor_delta / 8) : factor_delta;
413 slider->factor = slider->raw_factor;
414 copy_v2fl_v2i(slider->last_cursor, event->xy);
415
416 if (slider->increments) {
417 slider->factor = round(slider->factor / slider->increment_step) * slider->increment_step;
418 }
419
420 if (!slider->overshoot) {
421 slider->factor = clamp_f(slider->factor, slider->factor_bounds[0], slider->factor_bounds[1]);
422 }
423 else {
424 if (!slider->allow_overshoot_lower) {
425 slider->factor = max_ff(slider->factor, slider->factor_bounds[0]);
426 }
427 if (!slider->allow_overshoot_upper) {
428 slider->factor = min_ff(slider->factor, slider->factor_bounds[1]);
429 }
430 }
431}
432
434{
435 tSlider *slider = MEM_new<tSlider>(__func__);
436 slider->scene = CTX_data_scene(C);
437 slider->area = CTX_wm_area(C);
438 slider->region_header = CTX_wm_region(C);
439
440 /* Default is true, caller needs to manually set to false. */
441 slider->allow_overshoot_lower = true;
442 slider->allow_overshoot_upper = true;
443 slider->allow_increments = true;
444
445 slider->factor_bounds[0] = 0;
446 slider->factor_bounds[1] = 1;
447
448 slider->unit_string[0] = '%';
449
451
452 /* Set initial factor. */
453 slider->raw_factor = 0.5f;
454 slider->factor = 0.5;
455
456 slider->increment_step = 0.1f;
457
458 /* Add draw callback. Always in header. */
459 if (slider->area) {
460 LISTBASE_FOREACH (ARegion *, region, &slider->area->regionbase) {
461 if (region->regiontype == RGN_TYPE_HEADER) {
462 slider->region_header = region;
463 if (!G.background) {
465 region->runtime->type, slider_draw, slider, REGION_DRAW_POST_PIXEL);
466 }
467 }
468 }
469 }
470
471 /* Hide the area menu bar contents, as the slider will be drawn on top. */
472 ED_area_status_text(slider->area, "");
473
474 return slider;
475}
476
477void ED_slider_init(tSlider *slider, const wmEvent *event)
478{
479 copy_v2fl_v2i(slider->last_cursor, event->xy);
480}
481
482bool ED_slider_modal(tSlider *slider, const wmEvent *event)
483{
484 bool event_handled = true;
485 /* Handle key presses. */
486 switch (event->type) {
487 case EVT_EKEY:
488 if (slider->allow_overshoot_lower || slider->allow_overshoot_upper) {
489 slider->overshoot = event->val == KM_PRESS ? !slider->overshoot : slider->overshoot;
490 slider_update_factor(slider, event);
491 }
492 break;
493 case EVT_LEFTSHIFTKEY:
495 slider->precision = event->val == KM_PRESS;
496 break;
497 case EVT_LEFTCTRLKEY:
498 case EVT_RIGHTCTRLKEY:
499 slider->increments = slider->allow_increments && event->val == KM_PRESS;
500 break;
501 case MOUSEMOVE:;
502 /* Update factor. */
503 slider_update_factor(slider, event);
504 break;
505 default:
506 event_handled = false;
507 break;
508 }
509
511
512 return event_handled;
513}
514
516 char *status_string,
517 const size_t size_of_status_string)
518{
519 /* 50 characters is enough to fit the individual setting strings. Extend if message is longer. */
520 char overshoot_str[50];
521 char precision_str[50];
522 char increments_str[50];
523
524 if (slider->allow_overshoot_lower || slider->allow_overshoot_upper) {
525 if (slider->overshoot) {
526 STRNCPY_UTF8(overshoot_str, IFACE_("[E] - Disable overshoot"));
527 }
528 else {
529 STRNCPY_UTF8(overshoot_str, IFACE_("[E] - Enable overshoot"));
530 }
531 }
532 else {
533 STRNCPY_UTF8(overshoot_str, IFACE_("Overshoot disabled"));
534 }
535
536 if (slider->precision) {
537 STRNCPY_UTF8(precision_str, IFACE_("[Shift] - Precision active"));
538 }
539 else {
540 STRNCPY_UTF8(precision_str, IFACE_("Shift - Hold for precision"));
541 }
542
543 if (slider->allow_increments) {
544 if (slider->increments) {
545 STRNCPY_UTF8(increments_str, IFACE_(" | [Ctrl] - Increments active"));
546 }
547 else {
548 STRNCPY_UTF8(increments_str, IFACE_(" | Ctrl - Hold for increments"));
549 }
550 }
551 else {
552 increments_str[0] = '\0';
553 }
554
555 BLI_snprintf_utf8(status_string,
556 size_of_status_string,
557 "%s | %s%s",
558 overshoot_str,
559 precision_str,
560 increments_str);
561}
562
564{
565 if (slider->allow_overshoot_lower || slider->allow_overshoot_upper) {
566 status.item_bool(IFACE_("Overshoot"), slider->overshoot, ICON_EVENT_E);
567 }
568 else {
569 status.item(IFACE_("Overshoot Disabled"), ICON_INFO);
570 }
571
572 status.item_bool(IFACE_("Precision"), slider->precision, ICON_EVENT_SHIFT);
573
574 if (slider->allow_increments) {
575 status.item_bool(IFACE_("Snap"), slider->increments, ICON_EVENT_CTRL);
576 }
577}
578
580{
581 /* Remove draw callback. */
582 if (slider->draw_handle) {
584 }
585 ED_area_status_text(slider->area, nullptr);
586 ED_workspace_status_text(C, nullptr);
587 MEM_delete(slider);
588}
589
590/* Setters & Getters */
591
592float ED_slider_factor_get(const tSlider *slider)
593{
594 return slider->factor;
595}
596
597void ED_slider_factor_set(tSlider *slider, const float factor)
598{
599 slider->raw_factor = factor;
600 slider->factor = factor;
601 if (!slider->overshoot) {
602 slider->factor = clamp_f(slider->factor, slider->factor_bounds[0], slider->factor_bounds[1]);
603 }
604}
605
606void ED_slider_increment_step_set(tSlider *slider, const float increment_step)
607{
608 if (increment_step == 0) {
609 /* Because this value is used as a divisor, it cannot be 0. */
611 return;
612 }
613 slider->increment_step = increment_step;
614}
615
616void ED_slider_allow_overshoot_set(tSlider *slider, const bool lower, const bool upper)
617{
618 slider->allow_overshoot_lower = lower;
619 slider->allow_overshoot_upper = upper;
620}
621
623{
624 return slider->allow_increments;
625}
626
627void ED_slider_allow_increments_set(tSlider *slider, const bool value)
628{
629 slider->allow_increments = value;
630}
631
633 float factor_bound_lower,
634 float factor_bound_upper)
635{
636 slider->factor_bounds[0] = factor_bound_lower;
637 slider->factor_bounds[1] = factor_bound_upper;
638}
639
641{
642 slider->slider_mode = mode;
643}
644
646{
647 return slider->slider_mode;
648}
649
650void ED_slider_unit_set(tSlider *slider, const char *unit)
651{
652 STRNCPY_UTF8(slider->unit_string, unit);
653}
654
655void ED_slider_property_label_set(tSlider *slider, const char *property_label)
656{
657 slider->property_label.assign(property_label);
658}
659
661
662void ED_region_draw_mouse_line_cb(const bContext *C, ARegion *region, void *arg_info)
663{
664 wmWindow *win = CTX_wm_window(C);
665 const float *mval_src = (float *)arg_info;
666 const float mval_dst[2] = {
667 float(win->eventstate->xy[0] - region->winrct.xmin),
668 float(win->eventstate->xy[1] - region->winrct.ymin),
669 };
670
671 const uint shdr_pos = GPU_vertformat_attr_add(
672 immVertexFormat(), "pos", blender::gpu::VertAttrType::SFLOAT_32_32);
673
674 GPU_line_width(1.0f);
675
677
678 float viewport_size[4];
679 GPU_viewport_size_get_f(viewport_size);
680 immUniform2f("viewport_size", viewport_size[2] / UI_SCALE_FAC, viewport_size[3] / UI_SCALE_FAC);
681
682 immUniform1i("colors_len", 0); /* "simple" mode */
684 immUniform1f("dash_width", 6.0f);
685 immUniform1f("udash_factor", 0.5f);
686
688 immVertex2fv(shdr_pos, mval_src);
689 immVertex2fv(shdr_pos, mval_dst);
690 immEnd();
691
693}
694
695#define MAX_METADATA_STR 1024
696
697static const char *meta_data_list[] = {
698 "File",
699 "Strip",
700 "Date",
701 "RenderTime",
702 "Note",
703 "Marker",
704 "Time",
705 "Frame",
706 "Camera",
707 "Scene",
708};
709
710BLI_INLINE bool metadata_is_valid(const ImBuf *ibuf, char *r_str, short index, int offset)
711{
713 ibuf->metadata, meta_data_list[index], r_str + offset, MAX_METADATA_STR - offset) &&
714 r_str[0]);
715}
716
718{
719 /* Metadata field stored by Blender for multi-layer EXR images. Is rather
720 * useless to be viewed all the time. Can still be seen in the Metadata
721 * panel. */
722 if (STREQ(field, "BlenderMultiChannel")) {
723 return false;
724 }
725 /* Is almost always has value "scanlineimage", also useless to be seen
726 * all the time. */
727 if (STREQ(field, "type")) {
728 return false;
729 }
730 return !BKE_stamp_is_known_field(field);
731}
732
739
740static void metadata_custom_draw_fields(const char *field, const char *value, void *ctx_v)
741{
742 if (!metadata_is_custom_drawable(field)) {
743 return;
744 }
746 char temp_str[MAX_METADATA_STR];
747 SNPRINTF_UTF8(temp_str, "%s: %s", field, value);
748 BLF_position(ctx->fontid, ctx->xmin, ctx->ymin + ctx->current_y, 0.0f);
749 BLF_draw(ctx->fontid, temp_str, sizeof(temp_str));
750 ctx->current_y += ctx->vertical_offset;
751}
752
753static void metadata_draw_imbuf(const ImBuf *ibuf, const rctf *rect, int fontid, const bool is_top)
754{
755 char temp_str[MAX_METADATA_STR];
756 int ofs_y = 0;
757 const float height = BLF_height_max(fontid);
758 const float margin = height / 8;
759 const float vertical_offset = (height + margin);
760
761 /* values taking margins into account */
762 const float descender = BLF_descender(fontid);
763 const float xmin = (rect->xmin + margin);
764 const float xmax = (rect->xmax - margin);
765 const float ymin = (rect->ymin + margin) - descender;
766 const float ymax = (rect->ymax - margin) - descender;
767
768 if (is_top) {
769 for (int i = 0; i < 4; i++) {
770 /* first line */
771 if (i == 0) {
772 bool do_newline = false;
773 int len = SNPRINTF_UTF8_RLEN(temp_str, "%s: ", meta_data_list[0]);
774 if (metadata_is_valid(ibuf, temp_str, 0, len)) {
775 BLF_position(fontid, xmin, ymax - vertical_offset, 0.0f);
776 BLF_draw(fontid, temp_str, sizeof(temp_str));
777 do_newline = true;
778 }
779
780 len = SNPRINTF_UTF8_RLEN(temp_str, "%s: ", meta_data_list[1]);
781 if (metadata_is_valid(ibuf, temp_str, 1, len)) {
782 int line_width = BLF_width(fontid, temp_str, sizeof(temp_str));
783 BLF_position(fontid, xmax - line_width, ymax - vertical_offset, 0.0f);
784 BLF_draw(fontid, temp_str, sizeof(temp_str));
785 do_newline = true;
786 }
787
788 if (do_newline) {
789 ofs_y += vertical_offset;
790 }
791 } /* Strip */
792 else if (ELEM(i, 1, 2)) {
793 int len = SNPRINTF_UTF8_RLEN(temp_str, "%s: ", meta_data_list[i + 1]);
794 if (metadata_is_valid(ibuf, temp_str, i + 1, len)) {
795 BLF_position(fontid, xmin, ymax - vertical_offset - ofs_y, 0.0f);
796 BLF_draw(fontid, temp_str, sizeof(temp_str));
797 ofs_y += vertical_offset;
798 }
799 } /* Note (wrapped) */
800 else if (i == 3) {
801 int len = SNPRINTF_UTF8_RLEN(temp_str, "%s: ", meta_data_list[i + 1]);
802 if (metadata_is_valid(ibuf, temp_str, i + 1, len)) {
803 ResultBLF info;
804 BLF_enable(fontid, BLF_WORD_WRAP);
805 BLF_wordwrap(fontid, ibuf->x - (margin * 2));
806 BLF_position(fontid, xmin, ymax - vertical_offset - ofs_y, 0.0f);
807 BLF_draw(fontid, temp_str, sizeof(temp_str), &info);
808 BLF_wordwrap(fontid, 0);
809 BLF_disable(fontid, BLF_WORD_WRAP);
810 ofs_y += vertical_offset * info.lines;
811 }
812 }
813 else {
814 int len = SNPRINTF_UTF8_RLEN(temp_str, "%s: ", meta_data_list[i + 1]);
815 if (metadata_is_valid(ibuf, temp_str, i + 1, len)) {
816 int line_width = BLF_width(fontid, temp_str, sizeof(temp_str));
817 BLF_position(fontid, xmax - line_width, ymax - vertical_offset - ofs_y, 0.0f);
818 BLF_draw(fontid, temp_str, sizeof(temp_str));
819 ofs_y += vertical_offset;
820 }
821 }
822 }
823 }
824 else {
826 ctx.fontid = fontid;
827 ctx.xmin = xmin;
828 ctx.ymin = ymin;
829 ctx.current_y = ofs_y;
830 ctx.vertical_offset = vertical_offset;
832 int ofs_x = 0;
833 ofs_y = ctx.current_y;
834 for (int i = 5; i < 10; i++) {
835 int len = SNPRINTF_UTF8_RLEN(temp_str, "%s: ", meta_data_list[i]);
836 if (metadata_is_valid(ibuf, temp_str, i, len)) {
837 BLF_position(fontid, xmin + ofs_x, ymin + ofs_y, 0.0f);
838 BLF_draw(fontid, temp_str, sizeof(temp_str));
839
840 ofs_x += BLF_width(fontid, temp_str, sizeof(temp_str)) + UI_UNIT_X;
841 }
842 }
843 }
844}
845
849
850static void metadata_custom_count_fields(const char *field, const char * /*value*/, void *ctx_v)
851{
852 if (!metadata_is_custom_drawable(field)) {
853 return;
854 }
856 ctx->count++;
857}
858
859static float metadata_box_height_get(const ImBuf *ibuf, int fontid, const bool is_top)
860{
861 const float height = BLF_height_max(fontid);
862 const float margin = (height / 8);
863 char str[MAX_METADATA_STR] = "";
864 short count = 0;
865
866 if (is_top) {
867 if (metadata_is_valid(ibuf, str, 0, 0) || metadata_is_valid(ibuf, str, 1, 0)) {
868 count++;
869 }
870 for (int i = 2; i < 5; i++) {
871 if (metadata_is_valid(ibuf, str, i, 0)) {
872 if (i == 4) {
873 struct {
874 ResultBLF info;
875 rcti rect;
876 } wrap;
877
878 BLF_enable(fontid, BLF_WORD_WRAP);
879 BLF_wordwrap(fontid, ibuf->x - (margin * 2));
880 BLF_boundbox(fontid, str, sizeof(str), &wrap.rect, &wrap.info);
881 BLF_wordwrap(fontid, 0);
882 BLF_disable(fontid, BLF_WORD_WRAP);
883
884 count += wrap.info.lines;
885 }
886 else {
887 count++;
888 }
889 }
890 }
891 }
892 else {
893 for (int i = 5; i < 10; i++) {
894 if (metadata_is_valid(ibuf, str, i, 0)) {
895 count = 1;
896 break;
897 }
898 }
900 ctx.count = 0;
902 count += ctx.count;
903 }
904
905 if (count) {
906 return (height + margin) * count;
907 }
908
909 return 0;
910}
911
912static void text_info_row(const char *text,
913 const int text_len,
914 int col1,
915 int col2,
916 int row,
917 const int size_x,
918 const int size_y)
919{
920 const int font_id = BLF_default();
921 float text_color[4];
922
923 UI_GetThemeColor4fv(TH_TEXT_HI, text_color);
924 BLF_color4fv(font_id, text_color);
925
926 /* Ensure text is visible against bright background. */
927 const float shadow_color[4] = {0.0f, 0.0f, 0.0f, 0.8f};
928 BLF_enable(font_id, BLF_SHADOW);
929 BLF_shadow_offset(font_id, 0, 0);
930 BLF_shadow(font_id, FontShadowType::Outline, shadow_color);
931
932 BLF_position(font_id, col1, row, 0.0f);
933 BLF_draw(font_id, IFACE_(text), text_len);
934 BLF_position(font_id, col2, row, 0.0f);
935 char draw_text[MAX_NAME];
936 SNPRINTF_UTF8(draw_text, "%d x %d", size_x, size_y);
937 BLF_draw(font_id, draw_text, sizeof(draw_text));
938
939 BLF_disable(font_id, BLF_SHADOW);
940}
941
942void ED_region_image_overlay_info_text_draw(const int render_size_x,
943 const int render_size_y,
944
945 const int viewer_size_x,
946 const int viewer_size_y,
947
948 const int draw_offset_x,
949 const int draw_offset_y)
950{
952 const int font_id = BLF_default();
953 int overlay_lineheight = (UI_style_get()->widget.points * UI_SCALE_FAC * 1.6f);
954
955 const char render_size_name[MAX_NAME] = "Render Size";
956 const char viewer_size_name[MAX_NAME] = "Image Size";
957
958 const int render_size_width = BLF_width(font_id, render_size_name, sizeof(render_size_name));
959 const int viewer_size_width = BLF_width(font_id, viewer_size_name, sizeof(viewer_size_name));
960 int longest_label = max_ii(render_size_width, viewer_size_width);
961
962 int col1 = draw_offset_x;
963 int col2 = draw_offset_x + longest_label + (0.5 * U.widget_unit);
964
965 text_info_row(render_size_name,
966 sizeof(render_size_name),
967 col1,
968 col2,
969 draw_offset_y - overlay_lineheight,
970 render_size_x,
971 render_size_y);
972
973 text_info_row(viewer_size_name,
974 sizeof(viewer_size_name),
975 col1,
976 col2,
977 draw_offset_y - overlay_lineheight * 2,
978 viewer_size_x,
979 viewer_size_y);
980}
981
983 int x, int y, const rcti *frame, float zoomx, float zoomy, float passepartout_alpha)
984{
986
987 /* Offset and zoom using GPU viewport. */
988 const auto frame_width = BLI_rcti_size_x(frame);
989 const auto frame_height = BLI_rcti_size_y(frame);
991 GPU_matrix_scale_2f(zoomx, zoomy);
992
994 uint pos = GPU_vertformat_attr_add(format, "pos", blender::gpu::VertAttrType::SFLOAT_32_32);
995
998
999 const float x1 = frame->xmin - frame_width / 2;
1000 const float x2 = frame->xmax - frame_width / 2;
1001 const float y1 = frame->ymin - frame_height / 2;
1002 const float y2 = frame->ymax - frame_height / 2;
1003
1004 /* Darken the area outside the frame. */
1005 if (passepartout_alpha > 0) {
1006 /* Using a sufficiently large number instead of numeric_limits::infinity(), to avoid comparison
1007 * issues and different behavior around large numbers on different platforms. */
1008 constexpr float inf = 10e5;
1009 immUniformColor4f(0.0f, 0.0f, 0.0f, passepartout_alpha);
1010 immRectf(pos, -inf, y2, inf, inf);
1011 immRectf(pos, -inf, y1, inf, -inf);
1012 immRectf(pos, -inf, y1, x1, y2);
1013 immRectf(pos, x2, y1, inf, y2);
1014 }
1015
1016 float wire_color[3];
1017 UI_GetThemeColor3fv(TH_WIRE_EDIT, wire_color);
1018 immUniformColor4f(wire_color[0], wire_color[1], wire_color[2], 1);
1019
1020 /* The bounding box must be drawn last to ensure it remains visible
1021 * when passepartout_alpha > 0. */
1022 imm_draw_box_wire_2d(pos, x1, y1, x2, y2);
1023
1026
1028}
1029
1031 int x, int y, const ImBuf *ibuf, const rctf *frame, float zoomx, float zoomy)
1032{
1033 const uiStyle *style = UI_style_get_dpi();
1034
1035 if (!ibuf->metadata) {
1036 return;
1037 }
1038
1039 /* find window pixel coordinates of origin */
1041
1042 /* Offset and zoom using GPU viewport. */
1044 GPU_matrix_scale_2f(zoomx, zoomy);
1045
1047
1048 /* *** upper box*** */
1049
1050 /* get needed box height */
1051 float box_y = metadata_box_height_get(ibuf, blf_mono_font, true);
1052
1053 if (box_y) {
1054 /* set up rect */
1055 rctf rect;
1056 BLI_rctf_init(&rect, frame->xmin, frame->xmax, frame->ymax, frame->ymax + box_y);
1057 /* draw top box */
1059 uint pos = GPU_vertformat_attr_add(format, "pos", blender::gpu::VertAttrType::SFLOAT_32_32);
1062 immRectf(pos, rect.xmin, rect.ymin, rect.xmax, rect.ymax);
1064
1065 BLF_clipping(blf_mono_font, rect.xmin, rect.ymin, rect.xmax, rect.ymax);
1067
1069 metadata_draw_imbuf(ibuf, &rect, blf_mono_font, true);
1070
1072 }
1073
1074 /* *** lower box*** */
1075
1076 box_y = metadata_box_height_get(ibuf, blf_mono_font, false);
1077
1078 if (box_y) {
1079 /* set up box rect */
1080 rctf rect;
1081 BLI_rctf_init(&rect, frame->xmin, frame->xmax, frame->ymin - box_y, frame->ymin);
1082 /* draw top box */
1084 uint pos = GPU_vertformat_attr_add(format, "pos", blender::gpu::VertAttrType::SFLOAT_32_32);
1087 immRectf(pos, rect.xmin, rect.ymin, rect.xmax, rect.ymax);
1089
1090 BLF_clipping(blf_mono_font, rect.xmin, rect.ymin, rect.xmax, rect.ymax);
1092
1094 metadata_draw_imbuf(ibuf, &rect, blf_mono_font, false);
1095
1097 }
1098
1100}
1101
1102#undef MAX_METADATA_STR
ScrArea * CTX_wm_area(const bContext *C)
wmWindow * CTX_wm_window(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
ARegion * CTX_wm_region(const bContext *C)
bool BKE_stamp_is_known_field(const char *field_name)
int BLF_set_default()
void BLF_size(int fontid, float size)
Definition blf.cc:443
int BLF_descender(int fontid) ATTR_WARN_UNUSED_RESULT
Definition blf.cc:872
void BLF_enable(int fontid, FontFlags flag)
Definition blf.cc:320
void BLF_shadow(int fontid, FontShadowType type, const float rgba[4]=nullptr)
Definition blf.cc:934
void BLF_color3ubv(int fontid, const unsigned char rgb[3])
Definition blf.cc:476
void BLF_clipping(int fontid, int xmin, int ymin, int xmax, int ymax)
Definition blf.cc:912
void BLF_width_and_height(int fontid, const char *str, size_t str_len, float *r_width, float *r_height) ATTR_NONNULL()
Definition blf.cc:789
void BLF_color4fv(int fontid, const float rgba[4])
Definition blf.cc:505
void BLF_shadow_offset(int fontid, int x, int y)
Definition blf.cc:946
void BLF_boundbox(int fontid, const char *str, size_t str_len, rcti *r_box, ResultBLF *r_info=nullptr) ATTR_NONNULL(2)
Definition blf.cc:772
void BLF_rotation(int fontid, float angle)
Definition blf.cc:903
int BLF_default()
void BLF_draw(int fontid, const char *str, size_t str_len, ResultBLF *r_info=nullptr) ATTR_NONNULL(2)
Definition blf.cc:585
void BLF_wordwrap(int fontid, int wrap_width, BLFWrapMode mode=BLFWrapMode::Minimal)
Definition blf.cc:924
int blf_mono_font
Definition blf.cc:48
float BLF_width(int fontid, const char *str, size_t str_len, ResultBLF *r_info=nullptr) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(2)
Definition blf.cc:802
void BLF_disable(int fontid, FontFlags flag)
Definition blf.cc:329
int BLF_height_max(int fontid) ATTR_WARN_UNUSED_RESULT
Definition blf.cc:850
void BLF_position(int fontid, float x, float y, float z)
Definition blf.cc:388
@ BLF_WORD_WRAP
Definition BLF_enums.hh:39
@ BLF_SHADOW
Definition BLF_enums.hh:35
@ BLF_CLIPPING
Definition BLF_enums.hh:34
#define BLI_assert_unreachable()
Definition BLI_assert.h:93
#define BLI_INLINE
#define LISTBASE_FOREACH(type, var, list)
MINLINE float max_ff(float a, float b)
MINLINE float clamp_f(float value, float min, float max)
MINLINE float min_ff(float a, float b)
MINLINE int max_ii(int a, int b)
MINLINE void copy_v2fl_v2i(float r[2], const int a[2])
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
Definition BLI_rect.h:198
void BLI_rctf_init(struct rctf *rect, float xmin, float xmax, float ymin, float ymax)
Definition rct.cc:404
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
Definition BLI_rect.h:194
size_t size_t size_t BLI_snprintf_utf8(char *__restrict dst, size_t dst_maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
#define SNPRINTF_UTF8(dst, format,...)
#define SNPRINTF_UTF8_RLEN(dst, format,...)
#define STRNCPY_UTF8(dst, src)
unsigned int uint
#define ELEM(...)
#define STREQ(a, b)
#define IFACE_(msgid)
#define MAX_NAME
Definition DNA_defs.h:50
@ RGN_TYPE_HEADER
#define UI_SCALE_FAC
void ED_area_status_text(ScrArea *area, const char *str)
Definition area.cc:851
void ED_workspace_status_text(bContext *C, const char *str)
Definition area.cc:1024
void ED_region_tag_redraw(ARegion *region)
Definition area.cc:618
void * ED_region_draw_cb_activate(ARegionType *art, void(*draw)(const bContext *, ARegion *, void *), void *customdata, int type)
bool ED_region_draw_cb_exit(ARegionType *art, void *handle)
#define REGION_DRAW_POST_PIXEL
SliderMode
Definition ED_util.hh:95
@ SLIDER_MODE_PERCENT
Definition ED_util.hh:95
@ SLIDER_MODE_FLOAT
Definition ED_util.hh:95
void immUniformThemeColorAlpha(int color_id, float a)
void immEnd()
void immUnbindProgram()
void immBindBuiltinProgram(GPUBuiltinShader shader_id)
void immUniform2f(const char *name, float x, float y)
void immUniformColor4f(float r, float g, float b, float a)
void immVertex2f(uint attr_id, float x, float y)
void immVertex2fv(uint attr_id, const float data[2])
void immUniform1i(const char *name, int x)
void immUniformThemeColor3(int color_id)
void immUniformColor3ubvAlpha(const unsigned char rgb[3], unsigned char a)
void immUniform1f(const char *name, float x)
GPUVertFormat * immVertexFormat()
void immBegin(GPUPrimType, uint vertex_len)
void imm_draw_box_wire_2d(uint pos, float x1, float y1, float x2, float y2)
void immRectf(uint pos, float x1, float y1, float x2, float y2)
void GPU_matrix_scale_2f(float x, float y)
void GPU_matrix_push()
void GPU_matrix_pop()
void GPU_matrix_translate_2f(float x, float y)
@ GPU_PRIM_LINES
@ GPU_PRIM_TRIS
@ GPU_SHADER_3D_LINE_DASHED_UNIFORM_COLOR
@ GPU_SHADER_3D_UNIFORM_COLOR
void GPU_line_width(float width)
Definition gpu_state.cc:166
@ GPU_BLEND_NONE
Definition GPU_state.hh:85
@ GPU_BLEND_ALPHA
Definition GPU_state.hh:87
void GPU_blend(GPUBlend blend)
Definition gpu_state.cc:42
void GPU_viewport_size_get_f(float coords[4])
Definition gpu_state.cc:273
void GPU_polygon_smooth(bool enable)
Definition gpu_state.cc:83
uint GPU_vertformat_attr_add(GPUVertFormat *format, blender::StringRef name, blender::gpu::VertAttrType type)
bool IMB_metadata_get_field(const IDProperty *metadata, const char *key, char *value, size_t value_maxncpy)
Definition metadata.cc:41
void IMB_metadata_foreach(const ImBuf *ibuf, IMBMetadataForeachCb callback, void *userdata)
Definition metadata.cc:87
Read Guarded memory(de)allocation.
#define C
Definition RandGen.cpp:29
void UI_draw_roundbox_3ub_alpha(const rctf *rect, bool filled, float rad, const unsigned char col[3], unsigned char alpha)
const uiStyle * UI_style_get_dpi()
const uiStyle * UI_style_get()
#define UI_UNIT_X
void UI_GetThemeColor3fv(int colorid, float col[3])
@ TH_HEADER
@ TH_METADATA_TEXT
@ TH_HEADER_TEXT
@ TH_VIEW_OVERLAY
@ TH_HEADER_TEXT_HI
@ TH_METADATA_BG
@ TH_WIRE_EDIT
@ TH_TEXT_HI
void UI_GetThemeColor4fv(int colorid, float col[4])
void UI_FontThemeColor(int fontid, int colorid)
void UI_GetThemeColor4ubv(int colorid, unsigned char col[4])
@ KM_PRESS
Definition WM_types.hh:311
int pad[32 - sizeof(int)]
#define U
nullptr float
#define MAX_METADATA_STR
Definition ed_draw.cc:695
void ED_slider_allow_overshoot_set(tSlider *slider, const bool lower, const bool upper)
Definition ed_draw.cc:616
static void draw_overshoot_triangle(const uint8_t color[4], const bool facing_right, const float x, const float y)
Definition ed_draw.cc:118
static void metadata_draw_imbuf(const ImBuf *ibuf, const rctf *rect, int fontid, const bool is_top)
Definition ed_draw.cc:753
static void text_info_row(const char *text, const int text_len, int col1, int col2, int row, const int size_x, const int size_y)
Definition ed_draw.cc:912
void ED_slider_init(tSlider *slider, const wmEvent *event)
Definition ed_draw.cc:477
static void draw_ticks(const float start_factor, const float end_factor, const float line_start[2], const float base_tick_height, const float line_width, const uint8_t color_overshoot[4], const uint8_t color_line[4])
Definition ed_draw.cc:143
static void metadata_custom_draw_fields(const char *field, const char *value, void *ctx_v)
Definition ed_draw.cc:740
#define SLIDER_UNIT_STRING_SIZE
Definition ed_draw.cc:60
static void metadata_custom_count_fields(const char *field, const char *, void *ctx_v)
Definition ed_draw.cc:850
void ED_slider_factor_set(tSlider *slider, const float factor)
Definition ed_draw.cc:597
void ED_region_image_metadata_draw(int x, int y, const ImBuf *ibuf, const rctf *frame, float zoomx, float zoomy)
Definition ed_draw.cc:1030
SliderMode ED_slider_mode_get(const tSlider *slider)
Definition ed_draw.cc:645
void ED_slider_unit_set(tSlider *slider, const char *unit)
Definition ed_draw.cc:650
void ED_slider_mode_set(tSlider *slider, SliderMode mode)
Definition ed_draw.cc:640
void ED_slider_allow_increments_set(tSlider *slider, const bool value)
Definition ed_draw.cc:627
void ED_region_image_render_region_draw(int x, int y, const rcti *frame, float zoomx, float zoomy, float passepartout_alpha)
Definition ed_draw.cc:982
#define SLIDE_PIXEL_DISTANCE
Definition ed_draw.cc:58
void ED_slider_property_label_set(tSlider *slider, const char *property_label)
Definition ed_draw.cc:655
void ED_slider_destroy(bContext *C, tSlider *slider)
Definition ed_draw.cc:579
static const char * meta_data_list[]
Definition ed_draw.cc:697
BLI_INLINE bool metadata_is_custom_drawable(const char *field)
Definition ed_draw.cc:717
void ED_slider_increment_step_set(tSlider *slider, const float increment_step)
Definition ed_draw.cc:606
static void draw_main_line(const rctf *main_line_rect, const float factor, const bool overshoot, const uint8_t color_overshoot[4], const uint8_t color_line[4])
Definition ed_draw.cc:189
tSlider * ED_slider_create(bContext *C)
Definition ed_draw.cc:433
void ED_region_image_overlay_info_text_draw(const int render_size_x, const int render_size_y, const int viewer_size_x, const int viewer_size_y, const int draw_offset_x, const int draw_offset_y)
Definition ed_draw.cc:942
bool ED_slider_modal(tSlider *slider, const wmEvent *event)
Definition ed_draw.cc:482
#define OVERSHOOT_RANGE_DELTA
Definition ed_draw.cc:59
void ED_slider_status_get(const tSlider *slider, WorkspaceStatus &status)
Definition ed_draw.cc:563
void ED_slider_factor_bounds_set(tSlider *slider, float factor_bound_lower, float factor_bound_upper)
Definition ed_draw.cc:632
bool ED_slider_allow_increments_get(const tSlider *slider)
Definition ed_draw.cc:622
static void slider_draw(const bContext *, ARegion *region, void *arg)
Definition ed_draw.cc:267
void ED_slider_status_string_get(const tSlider *slider, char *status_string, const size_t size_of_status_string)
Definition ed_draw.cc:515
void ED_region_draw_mouse_line_cb(const bContext *C, ARegion *region, void *arg_info)
Definition ed_draw.cc:662
static void draw_backdrop(const int fontid, const rctf *main_line_rect, const uint8_t color_bg[4], const short region_y_size, const float base_tick_height, const std::string &property_label)
Definition ed_draw.cc:233
float ED_slider_factor_get(const tSlider *slider)
Definition ed_draw.cc:592
static float metadata_box_height_get(const ImBuf *ibuf, int fontid, const bool is_top)
Definition ed_draw.cc:859
BLI_INLINE bool metadata_is_valid(const ImBuf *ibuf, char *r_str, short index, int offset)
Definition ed_draw.cc:710
static void slider_update_factor(tSlider *slider, const wmEvent *event)
Definition ed_draw.cc:404
#define str(s)
uint pos
#define round
#define ceil
int count
format
#define G(x, y, z)
float wrap(float value, float max, float min)
Definition node_math.h:103
const int status
ARegionRuntimeHandle * runtime
IDProperty * metadata
int lines
Definition BLF_api.hh:453
ListBase regionbase
float xmax
float xmin
float ymax
float ymin
int ymin
int ymax
int xmin
int xmax
char unit_string[SLIDER_UNIT_STRING_SIZE]
Definition ed_draw.cc:95
float factor_bounds[2]
Definition ed_draw.cc:82
bool allow_overshoot_upper
Definition ed_draw.cc:101
float increment_step
Definition ed_draw.cc:85
bool overshoot
Definition ed_draw.cc:105
ARegion * region_header
Definition ed_draw.cc:67
bool allow_increments
Definition ed_draw.cc:109
bool precision
Definition ed_draw.cc:115
bool allow_overshoot_lower
Definition ed_draw.cc:100
float raw_factor
Definition ed_draw.cc:73
ScrArea * area
Definition ed_draw.cc:64
float last_cursor[2]
Definition ed_draw.cc:79
bool increments
Definition ed_draw.cc:112
std::string property_label
Definition ed_draw.cc:92
void * draw_handle
Definition ed_draw.cc:70
float factor
Definition ed_draw.cc:76
Scene * scene
Definition ed_draw.cc:63
SliderMode slider_mode
Definition ed_draw.cc:88
uiFontStyle widget
wmEventType type
Definition WM_types.hh:757
int xy[2]
Definition WM_types.hh:761
struct wmEvent * eventstate
i
Definition text_draw.cc:230
uint len
@ EVT_EKEY
@ EVT_RIGHTCTRLKEY
@ EVT_LEFTCTRLKEY
@ MOUSEMOVE
@ EVT_RIGHTSHIFTKEY
@ EVT_LEFTSHIFTKEY