Blender  V3.3
Public Attributes | List of all members
wmDropBox Struct Reference

#include <WM_types.h>

Public Attributes

struct wmDropBoxnext
 
struct wmDropBoxprev
 
bool(* poll )(struct bContext *C, struct wmDrag *drag, const wmEvent *event)
 
void(* on_drag_start )(struct bContext *C, struct wmDrag *drag)
 
void(* copy )(struct bContext *C, struct wmDrag *drag, struct wmDropBox *drop)
 
void(* cancel )(struct Main *bmain, struct wmDrag *drag, struct wmDropBox *drop)
 
void(* draw_droptip )(struct bContext *C, struct wmWindow *win, struct wmDrag *drag, const int xy[2])
 
void(* draw_in_view )(struct bContext *C, struct wmWindow *win, struct wmDrag *drag, const int xy[2])
 
void(* draw_activate )(struct wmDropBox *drop, struct wmDrag *drag)
 
void(* draw_deactivate )(struct wmDropBox *drop, struct wmDrag *drag)
 
voiddraw_data
 
WMDropboxTooltipFunc tooltip
 
wmOperatorTypeot
 
struct IDPropertyproperties
 
struct PointerRNAptr
 

Detailed Description

Drop-boxes are like key-maps, part of the screen/area/region definition. Allocation and free is on startup and exit.

The operator is polled and invoked with the current context (WM_OP_INVOKE_DEFAULT), there is no way to override that (by design, since drop-boxes should act on the exact mouse position). So the drop-boxes are supposed to check the required area and region context in their poll.

Definition at line 1175 of file WM_types.h.

Member Data Documentation

◆ cancel

void(* wmDropBox::cancel) (struct Main *bmain, struct wmDrag *drag, struct wmDropBox *drop)

If the operator is canceled (returns OPERATOR_CANCELLED), this can be used for cleanup of copy() resources.

Definition at line 1193 of file WM_types.h.

Referenced by WM_dropbox_add().

◆ copy

void(* wmDropBox::copy) (struct bContext *C, struct wmDrag *drag, struct wmDropBox *drop)

Before exec, this copies drag info to #wmDrop properties.

Definition at line 1187 of file WM_types.h.

Referenced by wm_drop_prepare(), and WM_dropbox_add().

◆ draw_activate

void(* wmDropBox::draw_activate) (struct wmDropBox *drop, struct wmDrag *drag)

Called when poll returns true the first time.

Definition at line 1217 of file WM_types.h.

Referenced by sequencer_dropboxes_add_to_lb(), view3d_dropboxes(), and wm_drop_update_active().

◆ draw_data

void* wmDropBox::draw_data

◆ draw_deactivate

void(* wmDropBox::draw_deactivate) (struct wmDropBox *drop, struct wmDrag *drag)

Called when poll returns false the first time or when the drag event ends.

Definition at line 1220 of file WM_types.h.

Referenced by sequencer_dropboxes_add_to_lb(), view3d_dropboxes(), WM_drag_free(), and wm_drop_update_active().

◆ draw_droptip

void(* wmDropBox::draw_droptip) (struct bContext *C, struct wmWindow *win, struct wmDrag *drag, const int xy[2])

Override the default cursor overlay drawing function. Can be used to draw text or thumbnails. IE a tooltip for drag and drop.

Parameters
xyCursor location in window coordinates (wmEvent.xy compatible).

Definition at line 1200 of file WM_types.h.

Referenced by sequencer_dropboxes_add_to_lb(), and view3d_dropboxes().

◆ draw_in_view

void(* wmDropBox::draw_in_view) (struct bContext *C, struct wmWindow *win, struct wmDrag *drag, const int xy[2])

Called with the draw buffer (GPUViewport) set up for drawing into the region's view.

Note
Only setups the drawing buffer for drawing in view, not the GPU transform matrices. The callback has to do that itself, with for example UI_view2d_view_ortho.
Parameters
xyCursor location in window coordinates (wmEvent.xy compatible).

Definition at line 1211 of file WM_types.h.

Referenced by sequencer_dropboxes_add_to_lb().

◆ next

struct wmDropBox* wmDropBox::next

Definition at line 1176 of file WM_types.h.

◆ on_drag_start

void(* wmDropBox::on_drag_start) (struct bContext *C, struct wmDrag *drag)

Called when the drag action starts. Can be used to prefetch data for previews.

Note
The dropbox that will be called eventually is not known yet when starting the drag. So this callback is called on every dropbox that is registered in the current screen.

Definition at line 1184 of file WM_types.h.

Referenced by sequencer_dropboxes_add_to_lb().

◆ ot

wmOperatorType* wmDropBox::ot

If poll succeeds, operator is called. Not saved in file, so can be pointer.

Definition at line 1232 of file WM_types.h.

Referenced by dropbox_tooltip(), wm_drop_prepare(), and WM_dropbox_add().

◆ poll

bool(* wmDropBox::poll) (struct bContext *C, struct wmDrag *drag, const wmEvent *event)

Test if the dropbox is active.

Definition at line 1179 of file WM_types.h.

Referenced by WM_dropbox_add().

◆ prev

struct wmDropBox * wmDropBox::prev

Definition at line 1176 of file WM_types.h.

◆ properties

struct IDProperty* wmDropBox::properties

Operator properties, assigned to ptr->data and can be written to a file.

Definition at line 1235 of file WM_types.h.

Referenced by WM_dropbox_add().

◆ ptr

struct PointerRNA* wmDropBox::ptr

◆ tooltip

WMDropboxTooltipFunc wmDropBox::tooltip

Custom tooltip shown during dragging.

Definition at line 1226 of file WM_types.h.

Referenced by dropbox_tooltip(), and WM_dropbox_add().


The documentation for this struct was generated from the following file: