2022-02-11 09:07:11 +11:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
2017-12-12 15:16:13 +11:00
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
|
* \ingroup edinterface
|
2017-12-12 15:16:13 +11:00
|
|
|
*
|
|
|
|
|
* Share between interface_eyedropper_*.c files.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
/* interface_eyedropper.c */
|
2021-12-09 00:55:11 +11:00
|
|
|
|
2021-03-17 08:48:05 +01:00
|
|
|
void eyedropper_draw_cursor_text_window(const struct wmWindow *window, const char *name);
|
2022-01-29 20:44:27 -05:00
|
|
|
void eyedropper_draw_cursor_text_region(const int xy[2], const char *name);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Utility to retrieve a button representing a RNA property that is currently under the cursor.
|
|
|
|
|
*
|
|
|
|
|
* This is to be used by any eyedroppers which fetch properties (e.g. UI_OT_eyedropper_driver).
|
|
|
|
|
* Especially during modal operations (e.g. as with the eyedroppers), context cannot be relied
|
|
|
|
|
* upon to provide this information, as it is not updated until the operator finishes.
|
|
|
|
|
*
|
|
|
|
|
* \return A button under the mouse which relates to some RNA Property, or NULL
|
|
|
|
|
*/
|
2017-12-12 15:16:13 +11:00
|
|
|
uiBut *eyedropper_get_property_button_under_mouse(bContext *C, const wmEvent *event);
|
2021-08-26 14:12:21 -03:00
|
|
|
void datadropper_win_area_find(const struct bContext *C,
|
|
|
|
|
const int mval[2],
|
|
|
|
|
int r_mval[2],
|
|
|
|
|
struct wmWindow **r_win,
|
|
|
|
|
struct ScrArea **r_area);
|
2017-12-12 15:16:13 +11:00
|
|
|
|
|
|
|
|
/* interface_eyedropper_color.c (expose for color-band picker) */
|
2021-12-09 00:55:11 +11:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \brief get the color from the screen.
|
|
|
|
|
*
|
|
|
|
|
* Special check for image or nodes where we MAY have HDR pixels which don't display.
|
|
|
|
|
*
|
|
|
|
|
* \note Exposed by 'interface_eyedropper_intern.h' for use with color band picking.
|
|
|
|
|
*/
|
2022-01-29 20:44:27 -05:00
|
|
|
void eyedropper_color_sample_fl(bContext *C, const int m_xy[2], float r_col[3]);
|
2017-12-12 15:16:13 +11:00
|
|
|
|
|
|
|
|
/* Used for most eye-dropper operators. */
|
|
|
|
|
enum {
|
|
|
|
|
EYE_MODAL_CANCEL = 1,
|
|
|
|
|
EYE_MODAL_SAMPLE_CONFIRM,
|
|
|
|
|
EYE_MODAL_SAMPLE_BEGIN,
|
|
|
|
|
EYE_MODAL_SAMPLE_RESET,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/* Color-band point sample. */
|
|
|
|
|
enum {
|
|
|
|
|
EYE_MODAL_POINT_CANCEL = 1,
|
|
|
|
|
EYE_MODAL_POINT_SAMPLE,
|
|
|
|
|
EYE_MODAL_POINT_CONFIRM,
|
|
|
|
|
EYE_MODAL_POINT_RESET,
|
|
|
|
|
EYE_MODAL_POINT_REMOVE_LAST,
|
|
|
|
|
};
|