Blender V4.5
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.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(
127 GPU_polygon_smooth(true);
128 immUniformColor3ubvAlpha(color, 225);
129 const float triangle_side_length = facing_right ? 6 * UI_SCALE_FAC : -6 * UI_SCALE_FAC;
130 const float triangle_offset = facing_right ? 2 * UI_SCALE_FAC : -2 * UI_SCALE_FAC;
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 * UI_SCALE_FAC,
255 3.0f * UI_SCALE_FAC};
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];
262 UI_draw_roundbox_3ub_alpha(&backdrop_rect, true, 4.0f, color_bg, color_bg[3]);
263}
264
268static void slider_draw(const bContext * /*C*/, ARegion *region, void *arg)
269{
270 tSlider *slider = static_cast<tSlider *>(arg);
271
272 /* Only draw in region from which the Operator was started. */
273 if (region != slider->region_header) {
274 return;
275 }
276
277 uint8_t color_text[4];
278 uint8_t color_line[4];
279 uint8_t color_handle[4];
280 uint8_t color_overshoot[4];
281 uint8_t color_bg[4];
282
283 /* Get theme colors. */
287 UI_GetThemeColor4ubv(TH_HEADER_TEXT, color_overshoot);
289
290 color_overshoot[0] = color_overshoot[0] * 0.8;
291 color_overshoot[1] = color_overshoot[1] * 0.8;
292 color_overshoot[2] = color_overshoot[2] * 0.8;
293 color_bg[3] = 160;
294
295 /* Get the default font. */
296 const uiStyle *style = UI_style_get();
297 const uiFontStyle *fstyle = &style->widget;
298 const int fontid = fstyle->uifont_id;
299 BLF_color3ubv(fontid, color_text);
300 BLF_rotation(fontid, 0.0f);
301
302 const float line_width = 1.5 * UI_SCALE_FAC;
303 const float base_tick_height = 12.0 * UI_SCALE_FAC;
304 const float line_y = region->winy / 2;
305
306 rctf main_line_rect{};
307 main_line_rect.xmin = (region->winx / 2) - (SLIDE_PIXEL_DISTANCE / 2);
308 main_line_rect.xmax = (region->winx / 2) + (SLIDE_PIXEL_DISTANCE / 2);
309 main_line_rect.ymin = line_y - line_width / 2;
310 main_line_rect.ymax = line_y + line_width / 2;
311
312 float line_start_factor = 0;
313 int handle_pos_x;
314 if (slider->overshoot) {
315 main_line_rect.xmin = main_line_rect.xmin - SLIDE_PIXEL_DISTANCE * OVERSHOOT_RANGE_DELTA;
316 main_line_rect.xmax = main_line_rect.xmax + SLIDE_PIXEL_DISTANCE * OVERSHOOT_RANGE_DELTA;
317 line_start_factor = slider->factor - 0.5f - OVERSHOOT_RANGE_DELTA;
318 handle_pos_x = region->winx / 2;
319 }
320 else {
321 const float total_range = slider->factor_bounds[1] - slider->factor_bounds[0];
322 /* 0-1 value of the representing the position of the slider in the allowed range. */
323 const float range_factor = (slider->factor - slider->factor_bounds[0]) / total_range;
324 handle_pos_x = main_line_rect.xmin + SLIDE_PIXEL_DISTANCE * range_factor;
325 }
326
327 draw_backdrop(fontid,
328 &main_line_rect,
329 color_bg,
330 slider->region_header->winy,
331 base_tick_height,
332 slider->property_label);
333
334 draw_main_line(&main_line_rect, slider->factor, slider->overshoot, color_overshoot, color_line);
335
336 const float factor_range = slider->overshoot ? 1 + OVERSHOOT_RANGE_DELTA * 2 : 1;
337 const float line_start_position[2] = {main_line_rect.xmin, line_y};
338 draw_ticks(line_start_factor,
339 line_start_factor + factor_range,
340 line_start_position,
341 base_tick_height,
342 line_width,
343 color_overshoot,
344 color_line);
345
346 /* Draw triangles at the ends of the line in overshoot mode to indicate direction of 0-100%
347 * range. */
348 if (slider->overshoot) {
349 if (slider->factor > 1 + OVERSHOOT_RANGE_DELTA + 0.5) {
350 draw_overshoot_triangle(color_line, false, main_line_rect.xmin, line_y);
351 }
352 if (slider->factor < 0 - OVERSHOOT_RANGE_DELTA - 0.5) {
353 draw_overshoot_triangle(color_line, true, main_line_rect.xmax, line_y);
354 }
355 }
356
357 /* Draw handle indicating current factor. */
358 rctf handle_rect{};
359 handle_rect.xmin = handle_pos_x - (line_width);
360 handle_rect.xmax = handle_pos_x + (line_width);
361 handle_rect.ymin = line_y - (base_tick_height / 2);
362 handle_rect.ymax = line_y + (base_tick_height / 2);
363
364 UI_draw_roundbox_3ub_alpha(&handle_rect, true, 1, color_handle, 255);
365
366 char factor_string[256];
367 switch (slider->slider_mode) {
369 SNPRINTF(factor_string, "%.0f %s", slider->factor * 100, slider->unit_string);
370 break;
372 SNPRINTF(factor_string, "%.1f %s", slider->factor, slider->unit_string);
373 break;
374 }
375
376 /* Draw factor string. */
377 float factor_string_pixel_size[2];
379 factor_string,
380 sizeof(factor_string),
381 &factor_string_pixel_size[0],
382 &factor_string_pixel_size[1]);
383
384 const float text_padding = 12.0 * UI_SCALE_FAC;
385 const float factor_string_pos_x = main_line_rect.xmax + text_padding;
387 fontid, factor_string_pos_x, (region->winy / 2) - factor_string_pixel_size[1] / 2, 0.0f);
388 BLF_draw(fontid, factor_string, sizeof(factor_string));
389
390 if (!slider->property_label.empty()) {
391 float property_name_pixel_size[2];
393 slider->property_label.c_str(),
394 slider->property_label.length(),
395 &property_name_pixel_size[0],
396 &property_name_pixel_size[1]);
397 BLF_position(fontid,
398 main_line_rect.xmin - text_padding - property_name_pixel_size[0],
399 (region->winy / 2) - property_name_pixel_size[1] / 2,
400 0.0f);
401 BLF_draw(fontid, slider->property_label.c_str(), slider->property_label.length());
402 }
403}
404
405static void slider_update_factor(tSlider *slider, const wmEvent *event)
406{
407 /* Normalize so no matter the factor bounds, the mouse distance traveled from min to max is
408 * constant. */
409 const float slider_range = slider->factor_bounds[1] - slider->factor_bounds[0];
410 const float factor_delta = (event->xy[0] - slider->last_cursor[0]) /
411 (SLIDE_PIXEL_DISTANCE / slider_range);
412 /* Reduced factor delta in precision mode (shift held). */
413 slider->raw_factor += slider->precision ? (factor_delta / 8) : factor_delta;
414 slider->factor = slider->raw_factor;
415 copy_v2fl_v2i(slider->last_cursor, event->xy);
416
417 if (slider->increments) {
418 slider->factor = round(slider->factor / slider->increment_step) * slider->increment_step;
419 }
420
421 if (!slider->overshoot) {
422 slider->factor = clamp_f(slider->factor, slider->factor_bounds[0], slider->factor_bounds[1]);
423 }
424 else {
425 if (!slider->allow_overshoot_lower) {
426 slider->factor = max_ff(slider->factor, slider->factor_bounds[0]);
427 }
428 if (!slider->allow_overshoot_upper) {
429 slider->factor = min_ff(slider->factor, slider->factor_bounds[1]);
430 }
431 }
432}
433
435{
436 tSlider *slider = MEM_new<tSlider>(__func__);
437 slider->scene = CTX_data_scene(C);
438 slider->area = CTX_wm_area(C);
439 slider->region_header = CTX_wm_region(C);
440
441 /* Default is true, caller needs to manually set to false. */
442 slider->allow_overshoot_lower = true;
443 slider->allow_overshoot_upper = true;
444 slider->allow_increments = true;
445
446 slider->factor_bounds[0] = 0;
447 slider->factor_bounds[1] = 1;
448
449 slider->unit_string[0] = '%';
450
452
453 /* Set initial factor. */
454 slider->raw_factor = 0.5f;
455 slider->factor = 0.5;
456
457 slider->increment_step = 0.1f;
458
459 /* Add draw callback. Always in header. */
460 if (slider->area) {
461 LISTBASE_FOREACH (ARegion *, region, &slider->area->regionbase) {
462 /* Keep logic in sync with ED_area_status_text. */
463 if (region->regiontype == RGN_TYPE_HEADER && region->runtime->visible) {
464 slider->region_header = region;
465 /* Hide the area menu bar contents, as the slider will be drawn on top. Only for the header
466 * since the tool header is already empty in the center.*/
467 ED_area_status_text(slider->area, "");
468 }
469 else if (region->regiontype == RGN_TYPE_TOOL_HEADER && region->runtime->visible) {
470 slider->region_header = region;
471 break;
472 }
473 }
474 if (slider->region_header && !G.background) {
477 }
478 }
479
480 return slider;
481}
482
483void ED_slider_init(tSlider *slider, const wmEvent *event)
484{
485 copy_v2fl_v2i(slider->last_cursor, event->xy);
486}
487
488bool ED_slider_modal(tSlider *slider, const wmEvent *event)
489{
490 bool event_handled = true;
491 /* Handle key presses. */
492 switch (event->type) {
493 case EVT_EKEY:
494 if (slider->allow_overshoot_lower || slider->allow_overshoot_upper) {
495 slider->overshoot = event->val == KM_PRESS ? !slider->overshoot : slider->overshoot;
496 slider_update_factor(slider, event);
497 }
498 break;
499 case EVT_LEFTSHIFTKEY:
501 slider->precision = event->val == KM_PRESS;
502 break;
503 case EVT_LEFTCTRLKEY:
504 case EVT_RIGHTCTRLKEY:
505 slider->increments = slider->allow_increments && event->val == KM_PRESS;
506 break;
507 case MOUSEMOVE:;
508 /* Update factor. */
509 slider_update_factor(slider, event);
510 break;
511 default:
512 event_handled = false;
513 break;
514 }
515
517
518 return event_handled;
519}
520
522 char *status_string,
523 const size_t size_of_status_string)
524{
525 /* 50 characters is enough to fit the individual setting strings. Extend if message is longer. */
526 char overshoot_str[50];
527 char precision_str[50];
528 char increments_str[50];
529
530 if (slider->allow_overshoot_lower || slider->allow_overshoot_upper) {
531 if (slider->overshoot) {
532 STRNCPY(overshoot_str, IFACE_("[E] - Disable overshoot"));
533 }
534 else {
535 STRNCPY(overshoot_str, IFACE_("[E] - Enable overshoot"));
536 }
537 }
538 else {
539 STRNCPY(overshoot_str, IFACE_("Overshoot disabled"));
540 }
541
542 if (slider->precision) {
543 STRNCPY(precision_str, IFACE_("[Shift] - Precision active"));
544 }
545 else {
546 STRNCPY(precision_str, IFACE_("Shift - Hold for precision"));
547 }
548
549 if (slider->allow_increments) {
550 if (slider->increments) {
551 STRNCPY(increments_str, IFACE_(" | [Ctrl] - Increments active"));
552 }
553 else {
554 STRNCPY(increments_str, IFACE_(" | Ctrl - Hold for increments"));
555 }
556 }
557 else {
558 increments_str[0] = '\0';
559 }
560
561 BLI_snprintf(status_string,
562 size_of_status_string,
563 "%s | %s%s",
564 overshoot_str,
565 precision_str,
566 increments_str);
567}
568
569void ED_slider_status_get(const tSlider *slider, WorkspaceStatus &status)
570{
571 if (slider->allow_overshoot_lower || slider->allow_overshoot_upper) {
572 status.item_bool(IFACE_("Overshoot"), slider->overshoot, ICON_EVENT_E);
573 }
574 else {
575 status.item(IFACE_("Overshoot Disabled"), ICON_INFO);
576 }
577
578 status.item_bool(IFACE_("Precision"), slider->precision, ICON_EVENT_SHIFT);
579
580 if (slider->allow_increments) {
581 status.item_bool(IFACE_("Snap"), slider->increments, ICON_EVENT_CTRL);
582 }
583}
584
586{
587 /* Remove draw callback. */
588 if (slider->draw_handle) {
590 }
591 ED_area_status_text(slider->area, nullptr);
592 ED_workspace_status_text(C, nullptr);
593 MEM_delete(slider);
594}
595
596/* Setters & Getters */
597
598float ED_slider_factor_get(const tSlider *slider)
599{
600 return slider->factor;
601}
602
603void ED_slider_factor_set(tSlider *slider, const float factor)
604{
605 slider->raw_factor = factor;
606 slider->factor = factor;
607 if (!slider->overshoot) {
608 slider->factor = clamp_f(slider->factor, slider->factor_bounds[0], slider->factor_bounds[1]);
609 }
610}
611
612void ED_slider_increment_step_set(tSlider *slider, const float increment_step)
613{
614 if (increment_step == 0) {
615 /* Because this value is used as a divisor, it cannot be 0. */
617 return;
618 }
619 slider->increment_step = increment_step;
620}
621
622void ED_slider_allow_overshoot_set(tSlider *slider, const bool lower, const bool upper)
623{
624 slider->allow_overshoot_lower = lower;
625 slider->allow_overshoot_upper = upper;
626}
627
629{
630 return slider->allow_increments;
631}
632
633void ED_slider_allow_increments_set(tSlider *slider, const bool value)
634{
635 slider->allow_increments = value;
636}
637
639 float factor_bound_lower,
640 float factor_bound_upper)
641{
642 slider->factor_bounds[0] = factor_bound_lower;
643 slider->factor_bounds[1] = factor_bound_upper;
644}
645
647{
648 slider->slider_mode = mode;
649}
650
652{
653 return slider->slider_mode;
654}
655
656void ED_slider_unit_set(tSlider *slider, const char *unit)
657{
658 STRNCPY(slider->unit_string, unit);
659}
660
661void ED_slider_property_label_set(tSlider *slider, const char *property_label)
662{
663 slider->property_label.assign(property_label);
664}
665
667
668void ED_region_draw_mouse_line_cb(const bContext *C, ARegion *region, void *arg_info)
669{
670 wmWindow *win = CTX_wm_window(C);
671 const float *mval_src = (float *)arg_info;
672 const float mval_dst[2] = {
673 float(win->eventstate->xy[0] - region->winrct.xmin),
674 float(win->eventstate->xy[1] - region->winrct.ymin),
675 };
676
677 const uint shdr_pos = GPU_vertformat_attr_add(
679
680 GPU_line_width(1.0f);
681
683
684 float viewport_size[4];
685 GPU_viewport_size_get_f(viewport_size);
686 immUniform2f("viewport_size", viewport_size[2] / UI_SCALE_FAC, viewport_size[3] / UI_SCALE_FAC);
687
688 immUniform1i("colors_len", 0); /* "simple" mode */
690 immUniform1f("dash_width", 6.0f);
691 immUniform1f("udash_factor", 0.5f);
692
694 immVertex2fv(shdr_pos, mval_src);
695 immVertex2fv(shdr_pos, mval_dst);
696 immEnd();
697
699}
700
701#define MAX_METADATA_STR 1024
702
703static const char *meta_data_list[] = {
704 "File",
705 "Strip",
706 "Date",
707 "RenderTime",
708 "Note",
709 "Marker",
710 "Time",
711 "Frame",
712 "Camera",
713 "Scene",
714};
715
716BLI_INLINE bool metadata_is_valid(const ImBuf *ibuf, char *r_str, short index, int offset)
717{
719 ibuf->metadata, meta_data_list[index], r_str + offset, MAX_METADATA_STR - offset) &&
720 r_str[0]);
721}
722
724{
725 /* Metadata field stored by Blender for multi-layer EXR images. Is rather
726 * useless to be viewed all the time. Can still be seen in the Metadata
727 * panel. */
728 if (STREQ(field, "BlenderMultiChannel")) {
729 return false;
730 }
731 /* Is almost always has value "scanlineimage", also useless to be seen
732 * all the time. */
733 if (STREQ(field, "type")) {
734 return false;
735 }
736 return !BKE_stamp_is_known_field(field);
737}
738
745
746static void metadata_custom_draw_fields(const char *field, const char *value, void *ctx_v)
747{
748 if (!metadata_is_custom_drawable(field)) {
749 return;
750 }
752 char temp_str[MAX_METADATA_STR];
753 SNPRINTF(temp_str, "%s: %s", field, value);
754 BLF_position(ctx->fontid, ctx->xmin, ctx->ymin + ctx->current_y, 0.0f);
755 BLF_draw(ctx->fontid, temp_str, sizeof(temp_str));
756 ctx->current_y += ctx->vertical_offset;
757}
758
759static void metadata_draw_imbuf(const ImBuf *ibuf, const rctf *rect, int fontid, const bool is_top)
760{
761 char temp_str[MAX_METADATA_STR];
762 int ofs_y = 0;
763 const float height = BLF_height_max(fontid);
764 const float margin = height / 8;
765 const float vertical_offset = (height + margin);
766
767 /* values taking margins into account */
768 const float descender = BLF_descender(fontid);
769 const float xmin = (rect->xmin + margin);
770 const float xmax = (rect->xmax - margin);
771 const float ymin = (rect->ymin + margin) - descender;
772 const float ymax = (rect->ymax - margin) - descender;
773
774 if (is_top) {
775 for (int i = 0; i < 4; i++) {
776 /* first line */
777 if (i == 0) {
778 bool do_newline = false;
779 int len = SNPRINTF_RLEN(temp_str, "%s: ", meta_data_list[0]);
780 if (metadata_is_valid(ibuf, temp_str, 0, len)) {
781 BLF_position(fontid, xmin, ymax - vertical_offset, 0.0f);
782 BLF_draw(fontid, temp_str, sizeof(temp_str));
783 do_newline = true;
784 }
785
786 len = SNPRINTF_RLEN(temp_str, "%s: ", meta_data_list[1]);
787 if (metadata_is_valid(ibuf, temp_str, 1, len)) {
788 int line_width = BLF_width(fontid, temp_str, sizeof(temp_str));
789 BLF_position(fontid, xmax - line_width, ymax - vertical_offset, 0.0f);
790 BLF_draw(fontid, temp_str, sizeof(temp_str));
791 do_newline = true;
792 }
793
794 if (do_newline) {
795 ofs_y += vertical_offset;
796 }
797 } /* Strip */
798 else if (ELEM(i, 1, 2)) {
799 int len = SNPRINTF_RLEN(temp_str, "%s: ", meta_data_list[i + 1]);
800 if (metadata_is_valid(ibuf, temp_str, i + 1, len)) {
801 BLF_position(fontid, xmin, ymax - vertical_offset - ofs_y, 0.0f);
802 BLF_draw(fontid, temp_str, sizeof(temp_str));
803 ofs_y += vertical_offset;
804 }
805 } /* Note (wrapped) */
806 else if (i == 3) {
807 int len = SNPRINTF_RLEN(temp_str, "%s: ", meta_data_list[i + 1]);
808 if (metadata_is_valid(ibuf, temp_str, i + 1, len)) {
809 ResultBLF info;
810 BLF_enable(fontid, BLF_WORD_WRAP);
811 BLF_wordwrap(fontid, ibuf->x - (margin * 2));
812 BLF_position(fontid, xmin, ymax - vertical_offset - ofs_y, 0.0f);
813 BLF_draw(fontid, temp_str, sizeof(temp_str), &info);
814 BLF_wordwrap(fontid, 0);
815 BLF_disable(fontid, BLF_WORD_WRAP);
816 ofs_y += vertical_offset * info.lines;
817 }
818 }
819 else {
820 int len = SNPRINTF_RLEN(temp_str, "%s: ", meta_data_list[i + 1]);
821 if (metadata_is_valid(ibuf, temp_str, i + 1, len)) {
822 int line_width = BLF_width(fontid, temp_str, sizeof(temp_str));
823 BLF_position(fontid, xmax - line_width, ymax - vertical_offset - ofs_y, 0.0f);
824 BLF_draw(fontid, temp_str, sizeof(temp_str));
825 ofs_y += vertical_offset;
826 }
827 }
828 }
829 }
830 else {
832 ctx.fontid = fontid;
833 ctx.xmin = xmin;
834 ctx.ymin = ymin;
835 ctx.current_y = ofs_y;
836 ctx.vertical_offset = vertical_offset;
838 int ofs_x = 0;
839 ofs_y = ctx.current_y;
840 for (int i = 5; i < 10; i++) {
841 int len = SNPRINTF_RLEN(temp_str, "%s: ", meta_data_list[i]);
842 if (metadata_is_valid(ibuf, temp_str, i, len)) {
843 BLF_position(fontid, xmin + ofs_x, ymin + ofs_y, 0.0f);
844 BLF_draw(fontid, temp_str, sizeof(temp_str));
845
846 ofs_x += BLF_width(fontid, temp_str, sizeof(temp_str)) + UI_UNIT_X;
847 }
848 }
849 }
850}
851
855
856static void metadata_custom_count_fields(const char *field, const char * /*value*/, void *ctx_v)
857{
858 if (!metadata_is_custom_drawable(field)) {
859 return;
860 }
862 ctx->count++;
863}
864
865static float metadata_box_height_get(const ImBuf *ibuf, int fontid, const bool is_top)
866{
867 const float height = BLF_height_max(fontid);
868 const float margin = (height / 8);
869 char str[MAX_METADATA_STR] = "";
870 short count = 0;
871
872 if (is_top) {
873 if (metadata_is_valid(ibuf, str, 0, 0) || metadata_is_valid(ibuf, str, 1, 0)) {
874 count++;
875 }
876 for (int i = 2; i < 5; i++) {
877 if (metadata_is_valid(ibuf, str, i, 0)) {
878 if (i == 4) {
879 struct {
880 ResultBLF info;
881 rcti rect;
882 } wrap;
883
884 BLF_enable(fontid, BLF_WORD_WRAP);
885 BLF_wordwrap(fontid, ibuf->x - (margin * 2));
886 BLF_boundbox(fontid, str, sizeof(str), &wrap.rect, &wrap.info);
887 BLF_wordwrap(fontid, 0);
888 BLF_disable(fontid, BLF_WORD_WRAP);
889
890 count += wrap.info.lines;
891 }
892 else {
893 count++;
894 }
895 }
896 }
897 }
898 else {
899 for (int i = 5; i < 10; i++) {
900 if (metadata_is_valid(ibuf, str, i, 0)) {
901 count = 1;
902 break;
903 }
904 }
906 ctx.count = 0;
908 count += ctx.count;
909 }
910
911 if (count) {
912 return (height + margin) * count;
913 }
914
915 return 0;
916}
917
918static void text_info_row(const char *text,
919 const int text_len,
920 int col1,
921 int col2,
922 int row,
923 const int size_x,
924 const int size_y)
925{
926 const int font_id = BLF_default();
927 float text_color[4];
928
929 UI_GetThemeColor4fv(TH_TEXT_HI, text_color);
930 BLF_color4fv(font_id, text_color);
931
932 /* Ensure text is visible against bright background. */
933 const float shadow_color[4] = {0.0f, 0.0f, 0.0f, 0.8f};
934 BLF_enable(font_id, BLF_SHADOW);
935 BLF_shadow_offset(font_id, 0, 0);
936 BLF_shadow(font_id, FontShadowType::Outline, shadow_color);
937
938 BLF_position(font_id, col1, row, 0.0f);
939 BLF_draw(font_id, IFACE_(text), text_len);
940 BLF_position(font_id, col2, row, 0.0f);
941 char draw_text[MAX_NAME];
942 SNPRINTF(draw_text, "%d x %d", size_x, size_y);
943 BLF_draw(font_id, draw_text, sizeof(draw_text));
944
945 BLF_disable(font_id, BLF_SHADOW);
946}
947
948void ED_region_image_overlay_info_text_draw(const int render_size_x,
949 const int render_size_y,
950
951 const int viewer_size_x,
952 const int viewer_size_y,
953
954 const int draw_offset_x,
955 const int draw_offset_y)
956{
958 const int font_id = BLF_default();
959 int overlay_lineheight = (UI_style_get()->widget.points * UI_SCALE_FAC * 1.6f);
960
961 const char render_size_name[MAX_NAME] = "Render Size";
962 const char viewer_size_name[MAX_NAME] = "Image Size";
963
964 const int render_size_width = BLF_width(font_id, render_size_name, sizeof(render_size_name));
965 const int viewer_size_width = BLF_width(font_id, viewer_size_name, sizeof(viewer_size_name));
966 int longest_label = max_ii(render_size_width, viewer_size_width);
967
968 int col1 = draw_offset_x;
969 int col2 = draw_offset_x + longest_label + (0.5 * U.widget_unit);
970
971 text_info_row(render_size_name,
972 sizeof(render_size_name),
973 col1,
974 col2,
975 draw_offset_y - overlay_lineheight,
976 render_size_x,
977 render_size_y);
978
979 text_info_row(viewer_size_name,
980 sizeof(viewer_size_name),
981 col1,
982 col2,
983 draw_offset_y - overlay_lineheight * 2,
984 viewer_size_x,
985 viewer_size_y);
986}
987
989 int x, int y, const rcti *frame, float zoomx, float zoomy, float passepartout_alpha)
990{
992
993 /* Offset and zoom using GPU viewport. */
994 const auto frame_width = BLI_rcti_size_x(frame);
995 const auto frame_height = BLI_rcti_size_y(frame);
997 GPU_matrix_scale_2f(zoomx, zoomy);
998
1001
1004
1005 const float x1 = frame->xmin - frame_width / 2;
1006 const float x2 = frame->xmax - frame_width / 2;
1007 const float y1 = frame->ymin - frame_height / 2;
1008 const float y2 = frame->ymax - frame_height / 2;
1009
1010 /* Darken the area outside the frame. */
1011 if (passepartout_alpha > 0) {
1012 /* Using a sufficiently large number instead of numeric_limits::infinity(), to avoid comparison
1013 * issues and different behavior around large numbers on different platforms. */
1014 constexpr float inf = 10e5;
1015 immUniformColor4f(0.0f, 0.0f, 0.0f, passepartout_alpha);
1016 immRectf(pos, -inf, y2, inf, inf);
1017 immRectf(pos, -inf, y1, inf, -inf);
1018 immRectf(pos, -inf, y1, x1, y2);
1019 immRectf(pos, x2, y1, inf, y2);
1020 }
1021
1022 float wire_color[3];
1023 UI_GetThemeColor3fv(TH_WIRE_EDIT, wire_color);
1024 immUniformColor4f(wire_color[0], wire_color[1], wire_color[2], 1);
1025
1026 /* The bounding box must be drawn last to ensure it remains visible
1027 * when passepartout_alpha > 0. */
1028 imm_draw_box_wire_2d(pos, x1, y1, x2, y2);
1029
1032
1034}
1035
1037 int x, int y, const ImBuf *ibuf, const rctf *frame, float zoomx, float zoomy)
1038{
1039 const uiStyle *style = UI_style_get_dpi();
1040
1041 if (!ibuf->metadata) {
1042 return;
1043 }
1044
1045 /* find window pixel coordinates of origin */
1047
1048 /* Offset and zoom using GPU viewport. */
1050 GPU_matrix_scale_2f(zoomx, zoomy);
1051
1053
1054 /* *** upper box*** */
1055
1056 /* get needed box height */
1057 float box_y = metadata_box_height_get(ibuf, blf_mono_font, true);
1058
1059 if (box_y) {
1060 /* set up rect */
1061 rctf rect;
1062 BLI_rctf_init(&rect, frame->xmin, frame->xmax, frame->ymax, frame->ymax + box_y);
1063 /* draw top box */
1068 immRectf(pos, rect.xmin, rect.ymin, rect.xmax, rect.ymax);
1070
1071 BLF_clipping(blf_mono_font, rect.xmin, rect.ymin, rect.xmax, rect.ymax);
1073
1075 metadata_draw_imbuf(ibuf, &rect, blf_mono_font, true);
1076
1078 }
1079
1080 /* *** lower box*** */
1081
1082 box_y = metadata_box_height_get(ibuf, blf_mono_font, false);
1083
1084 if (box_y) {
1085 /* set up box rect */
1086 rctf rect;
1087 BLI_rctf_init(&rect, frame->xmin, frame->xmax, frame->ymin - box_y, frame->ymin);
1088 /* draw top box */
1093 immRectf(pos, rect.xmin, rect.ymin, rect.xmax, rect.ymax);
1095
1096 BLF_clipping(blf_mono_font, rect.xmin, rect.ymin, rect.xmax, rect.ymax);
1098
1100 metadata_draw_imbuf(ibuf, &rect, blf_mono_font, false);
1101
1103 }
1104
1106}
1107
1108#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:440
int BLF_descender(int fontid) ATTR_WARN_UNUSED_RESULT
Definition blf.cc:875
void BLF_shadow(int fontid, FontShadowType type, const float rgba[4]=nullptr)
Definition blf.cc:928
void BLF_color3ubv(int fontid, const unsigned char rgb[3])
Definition blf.cc:473
void BLF_clipping(int fontid, int xmin, int ymin, int xmax, int ymax)
Definition blf.cc:906
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:792
void BLF_color4fv(int fontid, const float rgba[4])
Definition blf.cc:502
void BLF_shadow_offset(int fontid, int x, int y)
Definition blf.cc:940
@ BLF_WORD_WRAP
Definition BLF_api.hh:439
@ BLF_SHADOW
Definition BLF_api.hh:435
@ BLF_CLIPPING
Definition BLF_api.hh:434
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:775
void BLF_disable(int fontid, int option)
Definition blf.cc:329
void BLF_rotation(int fontid, float angle)
Definition blf.cc:897
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:582
void BLF_wordwrap(int fontid, int wrap_width, BLFWrapMode mode=BLFWrapMode::Minimal)
Definition blf.cc:918
int blf_mono_font
Definition blf.cc:48
void BLF_enable(int fontid, int option)
Definition blf.cc:320
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:805
int BLF_height_max(int fontid) ATTR_WARN_UNUSED_RESULT
Definition blf.cc:853
void BLF_position(int fontid, float x, float y, float z)
Definition blf.cc:385
#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
#define SNPRINTF(dst, format,...)
Definition BLI_string.h:599
char * STRNCPY(char(&dst)[N], const char *src)
Definition BLI_string.h:688
size_t BLI_snprintf(char *__restrict dst, size_t dst_maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
#define SNPRINTF_RLEN(dst, format,...)
Definition BLI_string.h:600
unsigned int uint
#define ELEM(...)
#define STREQ(a, b)
#define IFACE_(msgid)
@ RGN_TYPE_TOOL_HEADER
@ RGN_TYPE_HEADER
#define UI_SCALE_FAC
void ED_area_status_text(ScrArea *area, const char *str)
Definition area.cc:872
void ED_workspace_status_text(bContext *C, const char *str)
Definition area.cc:1040
void ED_region_tag_redraw(ARegion *region)
Definition area.cc:639
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 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 immBindBuiltinProgram(eGPUBuiltinShader shader_id)
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
@ GPU_BLEND_NONE
Definition GPU_state.hh:85
@ GPU_BLEND_ALPHA
Definition GPU_state.hh:87
void GPU_blend(eGPUBlend blend)
Definition gpu_state.cc:42
void GPU_line_width(float width)
Definition gpu_state.cc:166
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
@ GPU_FETCH_FLOAT
uint GPU_vertformat_attr_add(GPUVertFormat *, blender::StringRef name, GPUVertCompType, uint comp_len, GPUVertFetchMode)
@ GPU_COMP_F32
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()
void UI_draw_roundbox_corner_set(int type)
@ UI_CNR_ALL
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:308
int pad[32 - sizeof(int)]
#define U
void item_bool(std::string text, bool inverted, int icon1, int icon2=0)
Definition area.cc:995
void item(std::string text, int icon1, int icon2=0)
Definition area.cc:979
#define MAX_METADATA_STR
Definition ed_draw.cc:701
void ED_slider_allow_overshoot_set(tSlider *slider, const bool lower, const bool upper)
Definition ed_draw.cc:622
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:759
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:918
void ED_slider_init(tSlider *slider, const wmEvent *event)
Definition ed_draw.cc:483
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:746
#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:856
void ED_slider_factor_set(tSlider *slider, const float factor)
Definition ed_draw.cc:603
void ED_region_image_metadata_draw(int x, int y, const ImBuf *ibuf, const rctf *frame, float zoomx, float zoomy)
Definition ed_draw.cc:1036
SliderMode ED_slider_mode_get(const tSlider *slider)
Definition ed_draw.cc:651
void ED_slider_unit_set(tSlider *slider, const char *unit)
Definition ed_draw.cc:656
void ED_slider_mode_set(tSlider *slider, SliderMode mode)
Definition ed_draw.cc:646
void ED_slider_allow_increments_set(tSlider *slider, const bool value)
Definition ed_draw.cc:633
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:988
#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:661
void ED_slider_destroy(bContext *C, tSlider *slider)
Definition ed_draw.cc:585
static const char * meta_data_list[]
Definition ed_draw.cc:703
BLI_INLINE bool metadata_is_custom_drawable(const char *field)
Definition ed_draw.cc:723
void ED_slider_increment_step_set(tSlider *slider, const float increment_step)
Definition ed_draw.cc:612
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:434
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:948
bool ED_slider_modal(tSlider *slider, const wmEvent *event)
Definition ed_draw.cc:488
#define OVERSHOOT_RANGE_DELTA
Definition ed_draw.cc:59
void ED_slider_status_get(const tSlider *slider, WorkspaceStatus &status)
Definition ed_draw.cc:569
void ED_slider_factor_bounds_set(tSlider *slider, float factor_bound_lower, float factor_bound_upper)
Definition ed_draw.cc:638
bool ED_slider_allow_increments_get(const tSlider *slider)
Definition ed_draw.cc:628
static void slider_draw(const bContext *, ARegion *region, void *arg)
Definition ed_draw.cc:268
void ED_slider_status_string_get(const tSlider *slider, char *status_string, const size_t size_of_status_string)
Definition ed_draw.cc:521
void ED_region_draw_mouse_line_cb(const bContext *C, ARegion *region, void *arg_info)
Definition ed_draw.cc:668
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:598
static float metadata_box_height_get(const ImBuf *ibuf, int fontid, const bool is_top)
Definition ed_draw.cc:865
BLI_INLINE bool metadata_is_valid(const ImBuf *ibuf, char *r_str, short index, int offset)
Definition ed_draw.cc:716
static void slider_update_factor(tSlider *slider, const wmEvent *event)
Definition ed_draw.cc:405
#define str(s)
uint pos
#define round
#define ceil
#define MAX_NAME
int count
format
#define G(x, y, z)
float wrap(float value, float max, float min)
Definition node_math.h:71
ARegionRuntimeHandle * runtime
IDProperty * metadata
int lines
Definition BLF_api.hh:481
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:754
int xy[2]
Definition WM_types.hh:758
struct wmEvent * eventstate
i
Definition text_draw.cc:230
uint len
@ EVT_EKEY
@ EVT_RIGHTCTRLKEY
@ EVT_LEFTCTRLKEY
@ MOUSEMOVE
@ EVT_RIGHTSHIFTKEY
@ EVT_LEFTSHIFTKEY