49#include "RNA_prototypes.hh"
96#if !(defined(WIN32) || defined(__APPLE__))
106#define GHOST_WINDOW_STATE_DEFAULT GHOST_kWindowStateMaximized
178 r_size[1] = uiheight;
189 r_size[1] = uiheight;
254 if (wt->win == win && wt->event_type ==
TIMERJOBS) {
264 if (wt->win == win) {
301 if (id <= win->
winid) {
327 const bool duplicate_layout,
345 bmain, workspace, layout_old, win_dst) :
356 const bool duplicate_layout,
435 win_other = win_other->
next)
442 if (win->
parent ==
nullptr && win_other ==
nullptr) {
449 if (iter_win->parent == win) {
474 if (screen && screen->temp) {
491 GHOST_WindowHandle handle =
static_cast<GHOST_WindowHandle
>(win->
ghostwin);
502 ScrArea *area = (screen) ?
static_cast<ScrArea *
>(screen->areabase.first) :
nullptr;
503 const char *name =
"Blender";
504 if (is_single && area && area->spacetype !=
SPACE_EMPTY) {
514 const bool has_filepath = filepath[0] !=
'\0';
515 const bool include_filepath = has_filepath && (filepath != filename) &&
525 str.append(filename, filename_no_ext_len);
535 if (include_filepath) {
541 str +=
" - Blender ";
559 auto_dpi =
max_ff(auto_dpi, 96.0f);
563 if (
U.ui_scale == 0) {
567 U.ui_scale = virtual_pixel;
570 U.ui_scale = (virtual_pixel *
U.dpi * 96.0f) / (auto_dpi * 72.0f);
573 CLAMP(
U.ui_scale, 0.25f, 4.0f);
580 U.dpi = auto_dpi *
U.ui_scale * (72.0 / 96.0f);
583 int pixelsize =
max_ii(1,
int(
U.dpi / 64));
585 pixelsize =
max_ii(1, pixelsize +
U.ui_line_width);
588 U.pixelsize = pixelsize;
590 U.scale_factor =
U.dpi / 72.0f;
591 U.inv_scale_factor = 1.0f /
U.scale_factor;
595 U.widget_unit =
int(roundf(18.0f *
U.scale_factor)) + (2 * pixelsize);
612 const uint8_t keymodifier_sided[2] = {
616 const uint8_t keymodifier = keymodifier_sided[0] | keymodifier_sided[1];
618 if (keymodifier != keymodifier_eventstate) {
621 kdata.utf8_buf[0] =
'\0';
622 kdata.is_repeat =
false;
626 for (
int side = 0; side < 2; side++) {
639 for (
int side = 0; side < 2; side++) {
677 const uint8_t keymodifier_unhandled = keymodifier_eventstate &
678 ~(keymodifier_l | keymodifier_r);
679 const uint8_t keymodifier_sided[2] = {
680 uint8_t(keymodifier_l | keymodifier_unhandled),
685 kdata.utf8_buf[0] =
'\0';
686 kdata.is_repeat =
false;
689 for (
int side = 0; side < 2; side++) {
750 posy = (scr_size[1] - win->
posy - win->
sizey);
910 if (win->ghostwin ==
nullptr) {
920 static_cast<GHOST_WindowHandle
>(win->
ghostwin));
936 posy = scr_size[1] - t - win->
sizey;
940 if (win->
sizex != sizex || win->
sizey != sizey || win->
posx != posx || win->
posy != posy) {
952 const rcti *rect_unscaled,
958 void (*area_setup_fn)(
bScreen *screen,
ScrArea *area,
void *user_data),
959 void *area_setup_user_data)
966 int x = rect_unscaled->
xmin;
967 int y = rect_unscaled->
ymin;
973 static_cast<GHOST_WindowHandle
>(win_prev->
ghostwin));
975 rect.
xmin = win_prev->
posx + (x / native_pixel_size);
976 rect.
ymin = win_prev->
posy + (y / native_pixel_size);
977 sizex /= native_pixel_size;
978 sizey /= native_pixel_size;
982 rect.
xmin -= sizex / 2;
983 rect.
ymin -= sizey / 2;
987 rect.
xmin += (win_prev->
sizex - sizex) / 2;
988 rect.
ymin += (win_prev->
sizey - sizey) / 2;
1007 if (space_type == (area->butspacetype ? area->butspacetype : area->spacetype)) {
1016 if (win ==
nullptr) {
1017 win =
wm_window_new(bmain, wm, toplevel ?
nullptr : win_prev, dialog);
1032 if (screen ==
nullptr) {
1048 screen->temp = temp;
1052 const bool new_window = (win->
ghostwin ==
nullptr);
1064 if (area_setup_fn) {
1074 area_setup_fn(screen, area, area_setup_user_data);
1127 const rcti window_rect = {
1143 nullptr) !=
nullptr);
1173 static_cast<GHOST_WindowHandle
>(window->
ghostwin));
1197 *y = (win->
sizey - 1) - *y;
1207 *y = win->
sizey - *y - 1;
1281 printf(
"%s: set drawable %d\n", __func__, win->
winid);
1299 if (wm ==
nullptr) {
1320 constexpr uint64_t event_time_ok_ms = 1000;
1322 constexpr uint64_t event_time_error_ms = 5000;
1324 static uint64_t event_ms_ref_last = std::numeric_limits<uint64_t>::max();
1326 const uint64_t event_ms_ref = event_ms_ref_last;
1329 event_ms_ref_last = event_ms;
1331 if (event_ms_ref == std::numeric_limits<uint64_t>::max()) {
1338 if (event_ms_ref < event_time_error_ms || (event_ms_ref < (now_ms - event_time_ok_ms)) ||
1339 (event_ms_ref > (now_ms + event_time_ok_ms)))
1349 double time_delta = 0.0;
1350 if (event_ms < (event_ms_ref - event_time_error_ms)) {
1352 time_delta =
double(now_ms - event_ms) / -1000.0;
1354 else if (event_ms > (event_ms_ref + event_time_error_ms)) {
1356 time_delta =
double(event_ms - now_ms) / 1000.0;
1363 const char *time_unit =
"seconds";
1367 } unit_table[] = {{
"minutes", 60}, {
"hours", 60}, {
"days", 24}, {
"weeks", 7}, {
"years", 52}};
1368 for (
int i = 0; i <
ARRAY_SIZE(unit_table); i++) {
1369 if (std::abs(time_delta) <= unit_table[i].scale) {
1372 time_delta /= unit_table[i].scale;
1373 time_unit = unit_table[i].unit;
1377 "GHOST: suspicious time-stamp from far in the %s: %.2f %s, "
1378 "absolute value is %" PRIu64 ", current time is %" PRIu64 ", for type %d\n",
1379 time_delta < 0.0f ?
"past" :
"future",
1380 std::abs(time_delta),
1436 puts(
"<!> event has no window");
1441 puts(
"<!> event has invalid window");
1499 printf(
"%s: ghost redraw %d\n", __func__, win->
winid);
1509 printf(
"%s: ghost redraw decor %d\n", __func__, win->
winid);
1526 static_cast<GHOST_WindowHandle
>(win->
ghostwin));
1545 const char *state_str;
1549 state_str =
"normal";
1552 state_str =
"minimized";
1555 state_str =
"maximized";
1558 state_str =
"full-screen";
1561 state_str =
"<unknown>";
1564 printf(
"%s: window %d state = %s\n", __func__, win->
winid, state_str);
1567 printf(
"win move event pos %d %d size %d %d\n",
1580#if defined(__APPLE__) || defined(WIN32)
1582 int dummy_sleep_ms = 0;
1604 const char *path =
static_cast<const char *
>(
data);
1657 event.customdata = &wm->
drags;
1658 event.customdata_free =
true;
1684 std::string *
str = MEM_new<std::string>(__func__,
static_cast<const char *
>(ddd->
data));
1692 float prev_pixelsize =
U.pixelsize;
1695 if (
U.pixelsize != prev_pixelsize) {
1747 bool has_event =
false;
1749 const int sleep_us = *sleep_us_p;
1751 double ntime_min = DBL_MAX;
1758 if (wt->sleep ==
true) {
1763 if (wt->time_next >= time) {
1764 if ((has_event ==
false) && (sleep_us != 0)) {
1766 if (wt->time_next < ntime_min) {
1767 ntime_min = wt->time_next;
1773 wt->time_delta = time - wt->time_last;
1774 wt->time_duration += wt->time_delta;
1775 wt->time_last =
time;
1777 wt->time_next = wt->time_start;
1778 if (wt->time_step != 0.0f) {
1779 wt->time_next += wt->time_step *
ceil(wt->time_duration / wt->time_step);
1791 else if (
wmWindow *win = wt->win) {
1795 event.type = wt->event_type;
1797 event.keymodifier = 0;
1800 event.customdata = wt;
1807 if ((has_event ==
false) && (sleep_us != 0) && (ntime_min != DBL_MAX)) {
1812 const double microseconds = 1000000.0;
1813 const double sleep_sec =
double(sleep_us) / microseconds;
1814 const double sleep_sec_next = ntime_min -
time;
1816 if (sleep_sec_next < sleep_sec) {
1817 *sleep_us_p =
int(std::ceil(sleep_sec_next * microseconds));
1839 const int sleep_us_default = 5000;
1840 int sleep_us = has_event ? 0 : sleep_us_default;
1842#ifdef WITH_XR_OPENXR
1852 if (sleep_us == sleep_us_default) {
1865 std::this_thread::sleep_for(std::chrono::microseconds(sleep_us));
1883 BLI_assert_msg(!
G.background,
"Use wm_ghost_init_background instead");
1885 GHOST_EventConsumerHandle consumer;
1896 fprintf(stderr,
"GHOST: unable to initialize, exiting!\n");
1900#if !(defined(WIN32) || defined(__APPLE__))
1952#if !(defined(WIN32) || defined(__APPLE__))
1958 return g_system ?
"DEFAULT" :
"NONE";
1964 switch (gpu_backend) {
1969#ifdef WITH_OPENGL_BACKEND
1970 return GHOST_kDrawingContextTypeOpenGL;
1975#ifdef WITH_VULKAN_BACKEND
1976 return GHOST_kDrawingContextTypeVulkan;
1981#ifdef WITH_METAL_BACKEND
1982 return GHOST_kDrawingContextTypeMetal;
2004 uiItemL_ex(
col,
RPT_(
"Python script uses OpenGL for drawing"), ICON_NONE,
true,
false);
2005 uiItemL(
col,
RPT_(
"This may lead to unexpected behavior"), ICON_NONE);
2007 RPT_(
"One of the add-ons or scripts is using OpenGL and will not work correct on Metal"),
2010 RPT_(
"Please contact the developer of the add-on to migrate to use 'gpu' module"),
2012 if (
G.opengl_deprecation_usage_filename) {
2013 char location[1024];
2015 location,
"%s:%d",
G.opengl_deprecation_usage_filename,
G.opengl_deprecation_usage_lineno);
2018 uiItemL(
col,
RPT_(
"See system tab in preferences to switch to OpenGL backend"), ICON_NONE);
2029 static bool message_shown =
false;
2032 if (!
G.opengl_deprecation_usage_detected) {
2038 if (message_shown) {
2047 "One of the add-ons or scripts is using OpenGL and will not work correct on Metal. "
2048 "Please contact the developer of the add-on to migrate to use 'gpu' module");
2062 message_shown =
true;
2076 col,
RPT_(
"Failed to load using Vulkan, using OpenGL instead."), ICON_NONE,
true,
false);
2078 uiItemL(
col,
RPT_(
"Updating GPU drivers may solve this issue."), ICON_NONE);
2080 RPT_(
"The graphics backend can be changed in the System section of the Preferences."),
2177 const int event_type,
2178 const double time_step)
2200 const double time_step)
2243 "This should only be called when freeing the window-manager");
2261 wm->
runtime->reports.reporttimer =
nullptr;
2266 if (event->customdata ==
timer) {
2267 event->customdata =
nullptr;
2320 if (buf_src ==
nullptr) {
2323 size_t size = strlen(buf_src) + 1;
2324 char *buf =
static_cast<char *
>(malloc(size));
2325 memcpy(buf, buf_src, size);
2356 const bool ensure_utf8,
2357 const bool firstline)
2370 int buf_len = strlen(buf);
2381 char *newbuf =
static_cast<char *
>(
MEM_mallocN(buf_len + 1, __func__));
2386 for (
char *p = buf; *p; p++) {
2387 if (!
ELEM(*p,
'\n',
'\r')) {
2396 for (
char *p = buf; *p; p++) {
2407 *r_len = (p2 - newbuf);
2424 if (!
G.background) {
2431 for (p = buf; *p; p++) {
2440 newbuf =
static_cast<char *
>(
MEM_callocN(newlen + 1,
"WM_clipboard_text_set"));
2442 for (p = buf, p2 = newbuf; *p; p++, p2++) {
2494 bool free_byte_buffer =
false;
2498 free_byte_buffer =
true;
2503 if (free_byte_buffer) {
2593 const int event_xy[2],
2594 int r_event_xy_other[2])
2678 switch (
U.tablet_api) {
2700 int oldx =
x, oldy =
y;
2722 return int(fac *
float(win->
sizex));
2728 return int(fac *
float(win->
sizey));
2753 rcti window_rect, screen_rect;
2756 screen_rect = window_rect;
2766 switch (global_area->global->align) {
2768 screen_rect.
ymax -= height;
2771 screen_rect.
ymin += height;
2781 *r_rect = screen_rect;
2850 bool changed =
false;
2853 if (win_parent->
scene != scene) {
2859 if (win_child->parent == win_parent && win_child->
scene != scene) {
2878 if (scene ==
nullptr) {
2905 if ((win_iter == win_parent) || (win_iter->parent == win_parent)) {
2906 STRNCPY(win_iter->view_layer_name, view_layer->
name);
2937 if (win_child->parent == win_parent) {
2974 return (screen && screen->temp != 0);
2983#ifdef WITH_INPUT_IME
2984void wm_window_IME_begin(
wmWindow *win,
int x,
int y,
int w,
int h,
bool complete)
2998 static_cast<GHOST_WindowHandle
>(win->
ghostwin), x, win->
sizey - y,
w, h, complete);
3001void wm_window_IME_end(
wmWindow *win)
3011# if defined(WIN32) || defined(__APPLE__)
3072 const char *message,
3073 const char *help_label,
3074 const char *continue_label,
const char * BKE_blender_version_string(void)
bScreen * CTX_wm_screen(const bContext *C)
wmWindow * CTX_wm_window(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
void CTX_wm_window_set(bContext *C, wmWindow *win)
Main * CTX_data_main(const bContext *C)
void CTX_wm_area_set(bContext *C, ScrArea *area)
wmWindowManager * CTX_wm_manager(const bContext *C)
ViewLayer * CTX_data_view_layer(const bContext *C)
@ G_FLAG_GPU_BACKEND_FALLBACK_QUIET
@ G_FLAG_GPU_BACKEND_FALLBACK
void BKE_icon_changed(int icon_id)
ViewLayer * BKE_view_layer_default_view(const Scene *scene)
ViewLayer * BKE_view_layer_find(const Scene *scene, const char *layer_name)
const char * BKE_main_blendfile_path_from_global()
void BKE_report(ReportList *reports, eReportType type, const char *message)
void BKE_screen_area_map_free(ScrAreaMap *area_map) ATTR_NONNULL()
ScrArea * BKE_screen_find_big_area(const bScreen *screen, int spacetype, short min)
WorkSpaceInstanceHook * BKE_workspace_instance_hook_create(const Main *bmain, int winid)
void BKE_workspace_instance_hook_free(const Main *bmain, WorkSpaceInstanceHook *hook)
bScreen * BKE_workspace_layout_screen_get(const WorkSpaceLayout *layout) GETTER_ATTRS
void BKE_workspace_active_screen_set(WorkSpaceInstanceHook *hook, int winid, WorkSpace *workspace, bScreen *screen) SETTER_ATTRS
void BKE_workspace_layout_remove(Main *bmain, WorkSpace *workspace, WorkSpaceLayout *layout) ATTR_NONNULL()
void BKE_workspace_active_layout_set(WorkSpaceInstanceHook *hook, int winid, WorkSpace *workspace, WorkSpaceLayout *layout) SETTER_ATTRS
Activate a layout.
bScreen * BKE_workspace_active_screen_get(const WorkSpaceInstanceHook *hook) GETTER_ATTRS
WorkSpace * BKE_workspace_active_get(WorkSpaceInstanceHook *hook) GETTER_ATTRS
void BKE_workspace_active_set(WorkSpaceInstanceHook *hook, WorkSpace *workspace) SETTER_ATTRS
WorkSpaceLayout * BKE_workspace_active_layout_get(const WorkSpaceInstanceHook *hook) GETTER_ATTRS
#define BLI_assert_unreachable()
#define BLI_assert_msg(a, msg)
void BLI_kdtree_nd_ free(KDTree *tree)
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
#define LISTBASE_FOREACH(type, var, list)
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
void void BLI_INLINE bool BLI_listbase_is_single(const struct ListBase *lb)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
int BLI_findindex(const struct ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void * BLI_pophead(ListBase *listbase) ATTR_NONNULL(1)
MINLINE float max_ff(float a, float b)
MINLINE int max_ii(int a, int b)
MINLINE void copy_v2_v2_int(int r[2], const int a[2])
void void void const char * BLI_path_basename(const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT
const char * BLI_path_extension_or_end(const char *filepath) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
bool BLI_rcti_is_valid(const struct rcti *rect)
void BLI_rcti_init(struct rcti *rect, int xmin, int xmax, int ymin, int ymax)
void BLI_rcti_resize_y(struct rcti *rect, int y)
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
void BLI_rcti_resize_x(struct rcti *rect, int x)
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC
#define STRNCPY(dst, src)
#define SNPRINTF(dst, format,...)
int BLI_str_utf8_invalid_strip(char *str, size_t length) ATTR_NONNULL(1)
void BLI_system_backtrace(FILE *fp)
int BLI_thread_is_main(void)
Platform independent time functions.
void BLI_time_sleep_ms(int ms)
double BLI_time_now_seconds(void)
#define ENUM_OPERATORS(_type, _max)
#define POINTER_AS_UINT(i)
#define POINTER_FROM_UINT(i)
typedef double(DMatrix)[4][4]
#define CLOG_INFO(clg_ref, level,...)
These structs are the foundation for all linked lists in the library system.
@ GLOBAL_AREA_ALIGN_BOTTOM
@ USER_NO_MULTITOUCH_GESTURES
int ED_file_extension_icon(const char *path)
void ED_render_view_layer_changed(Main *bmain, bScreen *screen)
void ED_scene_change_update(Main *bmain, Scene *scene, ViewLayer *layer) ATTR_NONNULL()
void ED_area_newspace(bContext *C, ScrArea *area, int type, bool skip_region_exit)
WorkSpaceLayout * ED_workspace_layout_add(Main *bmain, WorkSpace *workspace, wmWindow *win, const char *name) ATTR_NONNULL()
int ED_area_global_size_y(const ScrArea *area)
void ED_screen_scene_change(bContext *C, wmWindow *win, Scene *scene, bool refresh_toolsystem)
void ED_screen_refresh(bContext *C, wmWindowManager *wm, wmWindow *win)
void ED_screen_global_areas_refresh(wmWindow *win)
bool ED_screen_change(bContext *C, bScreen *screen)
Change the active screen.
void ED_screen_exit(bContext *C, wmWindow *window, bScreen *screen)
blender::StringRefNull ED_area_name(const ScrArea *area)
void ED_workspace_scene_data_sync(WorkSpaceInstanceHook *hook, Scene *scene) ATTR_NONNULL()
WorkSpaceLayout * ED_workspace_layout_duplicate(Main *bmain, WorkSpace *workspace, const WorkSpaceLayout *layout_old, wmWindow *win) ATTR_NONNULL()
bool ED_workspace_change(WorkSpace *workspace_new, bContext *C, wmWindowManager *wm, wmWindow *win) ATTR_NONNULL()
Change the active workspace.
GHOST C-API function and type declarations.
GHOST_TWindowState GHOST_GetWindowState(GHOST_WindowHandle windowhandle)
GHOST_TSuccess GHOST_putClipboardImage(uint *rgba, int width, int height)
GHOST_TSuccess GHOST_GetCursorPosition(const GHOST_SystemHandle systemhandle, const GHOST_WindowHandle windowhandle, int32_t *x, int32_t *y)
GHOST_ContextHandle GHOST_CreateGPUContext(GHOST_SystemHandle systemhandle, GHOST_GPUSettings gpuSettings)
GHOST_TSuccess GHOST_SetWindowOrder(GHOST_WindowHandle windowhandle, GHOST_TWindowOrder order)
GHOST_TUserDataPtr GHOST_GetWindowUserData(GHOST_WindowHandle windowhandle)
GHOST_TSuccess GHOST_SetClientSize(GHOST_WindowHandle windowhandle, uint32_t width, uint32_t height)
GHOST_TSuccess GHOST_hasClipboardImage(void)
GHOST_TSuccess GHOST_SetCursorPosition(GHOST_SystemHandle systemhandle, GHOST_WindowHandle windowhandle, int32_t x, int32_t y)
void GHOST_ShowMessageBox(GHOST_SystemHandle systemhandle, const char *title, const char *message, const char *help_label, const char *continue_label, const char *link, GHOST_DialogOptions dialog_options)
void GHOST_ClientToScreen(GHOST_WindowHandle windowhandle, int32_t inX, int32_t inY, int32_t *outX, int32_t *outY)
GHOST_TCapabilityFlag GHOST_GetCapabilities(void)
GHOST_WindowHandle GHOST_GetWindowUnderCursor(GHOST_SystemHandle systemhandle, int32_t x, int32_t y)
GHOST_EventConsumerHandle GHOST_CreateEventConsumer(GHOST_EventCallbackProcPtr eventCallback, GHOST_TUserDataPtr user_data)
GHOST_SystemHandle GHOST_CreateSystem(void)
GHOST_TSuccess GHOST_AddEventConsumer(GHOST_SystemHandle systemhandle, GHOST_EventConsumerHandle consumerhandle)
GHOST_SystemHandle GHOST_CreateSystemBackground(void)
GHOST_TSuccess GHOST_GetAllDisplayDimensions(GHOST_SystemHandle systemhandle, uint32_t *r_width, uint32_t *r_height)
uint16_t GHOST_GetDPIHint(GHOST_WindowHandle windowhandle)
void GHOST_DisposeRectangle(GHOST_RectangleHandle rectanglehandle)
GHOST_TSuccess GHOST_SetPath(GHOST_WindowHandle windowhandle, const char *filepath)
void GHOST_UseWindowFocus(bool use_focus)
bool GHOST_ProcessEvents(GHOST_SystemHandle systemhandle, bool waitForEvent)
void GHOST_SetTitle(GHOST_WindowHandle windowhandle, const char *title)
void GHOST_BeginIME(GHOST_WindowHandle windowhandle, int32_t x, int32_t y, int32_t w, int32_t h, bool complete)
GHOST_TSuccess GHOST_ReleaseGPUContext(GHOST_ContextHandle contexthandle)
void GHOST_ScreenToClient(GHOST_WindowHandle windowhandle, int32_t inX, int32_t inY, int32_t *outX, int32_t *outY)
char * GHOST_getClipboard(bool selection)
uint64_t GHOST_GetEventTime(GHOST_EventHandle eventhandle)
GHOST_TSuccess GHOST_SetProgressBar(GHOST_WindowHandle windowhandle, float progress)
GHOST_TSuccess GHOST_SetWindowModifiedState(GHOST_WindowHandle windowhandle, bool isUnsavedChanges)
GHOST_TSuccess GHOST_DisposeWindow(GHOST_SystemHandle systemhandle, GHOST_WindowHandle windowhandle)
GHOST_TSuccess GHOST_ActivateGPUContext(GHOST_ContextHandle contexthandle)
GHOST_TSuccess GHOST_SetWindowState(GHOST_WindowHandle windowhandle, GHOST_TWindowState state)
void GHOST_SetBacktraceHandler(GHOST_TBacktraceFn backtrace_fn)
void GHOST_SetTabletAPI(GHOST_SystemHandle systemhandle, GHOST_TTabletAPI api)
GHOST_TSuccess GHOST_SwapWindowBuffers(GHOST_WindowHandle windowhandle)
void GHOST_SetMultitouchGestures(GHOST_SystemHandle systemhandle, const bool use)
GHOST_TEventDataPtr GHOST_GetEventData(GHOST_EventHandle eventhandle)
uint * GHOST_getClipboardImage(int *r_width, int *r_height)
GHOST_TSuccess GHOST_ActivateWindowDrawingContext(GHOST_WindowHandle windowhandle)
GHOST_TSuccess GHOST_GetModifierKeyState(GHOST_SystemHandle systemhandle, GHOST_TModifierKey mask, bool *r_is_down)
GHOST_WindowHandle GHOST_CreateWindow(GHOST_SystemHandle systemhandle, GHOST_WindowHandle parent_windowhandle, const char *title, int32_t left, int32_t top, uint32_t width, uint32_t height, GHOST_TWindowState state, bool is_dialog, GHOST_GPUSettings gpuSettings)
bool GHOST_ValidWindow(GHOST_SystemHandle systemhandle, GHOST_WindowHandle windowhandle)
float GHOST_GetNativePixelSize(GHOST_WindowHandle windowhandle)
GHOST_TEventType GHOST_GetEventType(GHOST_EventHandle eventhandle)
bool GHOST_IsDialogWindow(GHOST_WindowHandle windowhandle)
void GHOST_SystemInitDebug(GHOST_SystemHandle systemhandle, GHOST_Debug debug)
void GHOST_putClipboard(const char *buffer, bool selection)
void GHOST_SetWindowUserData(GHOST_WindowHandle windowhandle, GHOST_TUserDataPtr user_data)
const char * GHOST_SystemBackend(void)
GHOST_WindowHandle GHOST_GetEventWindow(GHOST_EventHandle eventhandle)
void GHOST_GetRectangle(GHOST_RectangleHandle rectanglehandle, int32_t *l, int32_t *t, int32_t *r, int32_t *b)
void GHOST_EndIME(GHOST_WindowHandle windowhandle)
bool GHOST_UseNativePixels(void)
void GHOST_DispatchEvents(GHOST_SystemHandle systemhandle)
GHOST_TSuccess GHOST_DisposeGPUContext(GHOST_SystemHandle systemhandle, GHOST_ContextHandle contexthandle)
GHOST_TSuccess GHOST_EndProgressBar(GHOST_WindowHandle windowhandle)
GHOST_TSuccess GHOST_SetSwapInterval(GHOST_WindowHandle windowhandle, int interval)
GHOST_RectangleHandle GHOST_GetClientBounds(GHOST_WindowHandle windowhandle)
GHOST_TSuccess GHOST_DisposeSystem(GHOST_SystemHandle systemhandle)
uint64_t GHOST_GetMilliSeconds(GHOST_SystemHandle systemhandle)
GHOST_TSuccess GHOST_GetSwapInterval(GHOST_WindowHandle windowhandle, int *r_interval)
GHOST_TSuccess GHOST_GetMainDisplayDimensions(GHOST_SystemHandle systemhandle, uint32_t *r_width, uint32_t *r_height)
@ GHOST_kWindowStateMinimized
@ GHOST_kWindowStateMaximized
@ GHOST_kWindowStateNormal
@ GHOST_kWindowStateFullScreen
void * GHOST_TUserDataPtr
@ GHOST_kEventWindowClose
@ GHOST_kEventDraggingDropDone
@ GHOST_kEventNativeResolutionChange
@ GHOST_kEventOpenMainFile
@ GHOST_kEventWindowActivate
@ GHOST_kEventWindowUpdateDecor
@ GHOST_kEventWindowUpdate
@ GHOST_kEventWindowDeactivate
@ GHOST_kEventWindowDPIHintChanged
@ GHOST_kEventQuitRequest
@ GHOST_kCapabilityWindowPosition
@ GHOST_kCapabilityGPUReadFrontBuffer
@ GHOST_kCapabilityCursorWarp
@ GHOST_kCapabilityInputIME
@ GHOST_kCapabilityTrackpadPhysicalDirection
@ GHOST_kCapabilityClipboardImages
@ GHOST_kCapabilityPrimaryClipboard
@ GHOST_kCapabilityDesktopSample
const void * GHOST_TEventDataPtr
GHOST_TDrawingContextType
@ GHOST_kDrawingContextTypeNone
@ GHOST_kWindowOrderBottom
@ GHOST_kModifierKeyRightControl
@ GHOST_kModifierKeyLeftControl
@ GHOST_kModifierKeyRightAlt
@ GHOST_kModifierKeyRightShift
@ GHOST_kModifierKeyLeftAlt
@ GHOST_kModifierKeyLeftShift
@ GHOST_kModifierKeyLeftOS
@ GHOST_kModifierKeyRightOS
void(* GHOST_TBacktraceFn)(void *file_handle)
@ GHOST_kDragnDropTypeFilenames
@ GHOST_kDragnDropTypeString
@ GHOST_kTabletWinPointer
GPUContext * GPU_context_create(void *ghost_window, void *ghost_context)
eGPUBackendType GPU_backend_type_selection_get()
void GPU_context_discard(GPUContext *)
void GPU_context_active_set(GPUContext *)
void GPU_backend_ghost_system_set(void *ghost_system_handle)
GPUFrameBuffer * GPU_framebuffer_active_get()
void GPU_clear_color(float red, float green, float blue, float alpha)
GPUFrameBuffer * GPU_framebuffer_back_get()
void imb_freerectImBuf(ImBuf *ibuf)
void IMB_rect_from_float(ImBuf *ibuf)
Contains defines and structs used throughout the imbuf module.
Read Guarded memory(de)allocation.
void UI_block_theme_style_set(uiBlock *block, char theme_style)
uiLayout * uiItemsAlertBox(uiBlock *block, const uiStyle *style, const int dialog_width, const eAlertIcon icon, const int icon_size)
void uiItemL(uiLayout *layout, const char *name, int icon)
void UI_popup_block_invoke(bContext *C, uiBlockCreateFunc func, void *arg, uiFreeArgFunc arg_free)
uiBlock * UI_block_begin(const bContext *C, ARegion *region, std::string name, eUIEmbossType emboss)
void uiItemS(uiLayout *layout)
void UI_block_emboss_set(uiBlock *block, eUIEmbossType emboss)
@ UI_BLOCK_THEME_STYLE_POPUP
void UI_block_bounds_set_centered(uiBlock *block, int addval)
uiLayout * uiLayoutColumn(uiLayout *layout, bool align)
uiBut * uiItemL_ex(uiLayout *layout, const char *name, int icon, bool highlight, bool redalert)
void UI_popup_handlers_remove_all(bContext *C, ListBase *handlers)
@ WIN_ALIGN_LOCATION_CENTER
@ WIN_ALIGN_PARENT_CENTER
@ WM_CAPABILITY_PRIMARY_CLIPBOARD
@ WM_CAPABILITY_WINDOW_POSITION
@ WM_CAPABILITY_CURSOR_WARP
@ WM_CAPABILITY_INITIALIZED
@ WM_CAPABILITY_TRACKPAD_PHYSICAL_DIRECTION
@ WM_CAPABILITY_GPU_FRONT_BUFFER_READ
@ WM_CAPABILITY_CLIPBOARD_IMAGES
@ WM_CAPABILITY_DESKTOP_SAMPLE
@ WM_CAPABILITY_INPUT_IME
CLG_LogRef * WM_LOG_EVENTS
@ WM_TIMER_TAGGED_FOR_REMOVAL
@ WM_TIMER_NO_FREE_CUSTOM_DATA
struct GPUContext GPUContext
ATTR_WARN_UNUSED_RESULT const BMLoop * l
void activate(bool forceActivation=false) const
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
local_group_size(16, 16) .push_constant(Type b
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
struct ImBuf * IMB_allocFromBuffer(const uint8_t *, const float *, unsigned int, unsigned int, unsigned int)
void *(* MEM_mallocN)(size_t len, const char *str)
void MEM_freeN(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
ccl_device_inline float3 ceil(const float3 a)
VecBase< int32_t, 2 > int2
void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
unsigned __int64 uint64_t
GHOST_TDrawingContextType context_type
GHOST_GPUDevice preferred_device
GHOST_TDragnDropTypes dataType
GHOST_TDragnDropDataPtr data
ImBufByteBuffer byte_buffer
GHOST_TWindowState windowstate
eWinOverrideFlag override_flag
struct ReportList * reports
struct wmKeyConfig * defaultconf
WindowManagerRuntimeHandle * runtime
struct wmWindow * winactive
struct wmWindow * windrawable
struct wmEvent * eventstate
struct wmEvent * event_last_handled
const struct wmIMEData * ime_data
char ime_data_is_composing
struct wmEvent_ConsecutiveData * event_queue_consecutive_gesture_data
struct WorkSpaceInstanceHook * workspace_hook
void * cursor_keymap_status
struct Stereo3dFormat * stereo3d_format
void WM_check(bContext *C)
wmDragPath * WM_drag_create_path_data(blender::Span< const char * > paths)
void WM_event_start_drag(bContext *C, int icon, eWM_DragDataType type, void *poin, uint flags)
ListBase * WM_dropboxmap_find(const char *idname, int spaceid, int regionid)
void wm_draw_update(bContext *C)
wmEvent * wm_event_add(wmWindow *win, const wmEvent *event_to_add)
wmEventHandler_Dropbox * WM_event_add_dropbox_handler(ListBase *handlers, ListBase *dropboxes)
wmEventHandler_Keymap * WM_event_add_keymap_handler(ListBase *handlers, wmKeyMap *keymap)
void wm_event_do_handlers(bContext *C)
void WM_event_add_notifier_ex(wmWindowManager *wm, const wmWindow *win, uint type, void *reference)
void WM_event_consecutive_data_free(wmWindow *win)
void WM_main_add_notifier(uint type, void *reference)
void wm_event_free_all(wmWindow *win)
int WM_operator_name_call_ptr(bContext *C, wmOperatorType *ot, wmOperatorCallContext context, PointerRNA *properties, const wmEvent *event)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
void wm_event_do_notifiers(bContext *C)
void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, const int type, const void *customdata, const uint64_t event_time_ms)
void wm_event_init_from_window(wmWindow *win, wmEvent *event)
void WM_event_remove_handlers(bContext *C, ListBase *handlers)
#define ISTIMER(event_type)
bool wm_file_or_session_data_has_unsaved_changes(const Main *bmain, const wmWindowManager *wm)
void wm_autosave_timer(Main *bmain, wmWindowManager *wm, wmTimer *)
void wm_close_file_dialog(bContext *C, wmGenericCallback *post_action)
void WM_gestures_free_all(wmWindow *win)
void wm_exit_schedule_delayed(const bContext *C)
void wm_jobs_timer_end(wmWindowManager *wm, wmTimer *wt)
void wm_jobs_timer(wmWindowManager *wm, wmTimer *wt)
wmKeyMap * WM_keymap_ensure(wmKeyConfig *keyconf, const char *idname, int spaceid, int regionid)
wmOperatorType * WM_operatortype_find(const char *idname, bool quiet)
void WM_operator_properties_create_ptr(PointerRNA *ptr, wmOperatorType *ot)
void WM_operator_properties_free(PointerRNA *ptr)
static void ghost_event_proc_timestamp_warning(GHOST_EventHandle ghost_event)
ViewLayer * WM_windows_view_layer_get_from_screen(const wmWindowManager *wm, const bScreen *screen)
blender::int2 WM_window_native_pixel_size(const wmWindow *win)
wmWindow * wm_window_copy(Main *bmain, wmWindowManager *wm, wmWindow *win_src, const bool duplicate_layout, const bool child)
int wm_window_new_main_exec(bContext *C, wmOperator *op)
static void wm_window_ghostwindow_ensure(wmWindowManager *wm, wmWindow *win, bool is_dialog)
void WM_window_set_active_scene(Main *bmain, bContext *C, wmWindow *win, Scene *scene)
void wm_cursor_position_from_ghost_screen_coords(wmWindow *win, int *x, int *y)
GHOST_TKey ghost_key_pair[2]
static GHOST_SystemHandle g_system
int wm_window_close_exec(bContext *C, wmOperator *)
wmWindow * wm_window_new(const Main *bmain, wmWindowManager *wm, wmWindow *parent, bool dialog)
static void wm_clipboard_text_set_impl(const char *buf, bool selection)
void WM_clipboard_text_set(const char *buf, bool selection)
void wm_window_raise(wmWindow *win)
void WM_window_ensure_active_view_layer(wmWindow *win)
static char * wm_clipboard_text_get_impl(bool selection)
static void wm_window_check_size(rcti *rect)
void wm_window_swap_buffers(wmWindow *win)
Push rendered buffer to the screen.
ImBuf * WM_clipboard_image_get()
Scene * WM_windows_scene_get_from_screen(const wmWindowManager *wm, const bScreen *screen)
void WM_init_input_devices()
#define GHOST_WINDOW_STATE_DEFAULT
void WM_init_state_maximized_set()
void WM_window_set_active_workspace(bContext *C, wmWindow *win, WorkSpace *workspace)
void wm_cursor_position_to_ghost_client_coords(wmWindow *win, int *x, int *y)
char * WM_clipboard_text_get(bool selection, bool ensure_utf8, int *r_len)
void wm_cursor_position_from_ghost_client_coords(wmWindow *win, int *x, int *y)
void wm_test_gpu_backend_fallback(bContext *C)
void wm_cursor_position_to_ghost_screen_coords(wmWindow *win, int *x, int *y)
char * WM_clipboard_text_get_firstline(bool selection, bool ensure_utf8, int *r_len)
static char * wm_clipboard_text_get_ex(bool selection, int *r_len, const bool ensure_utf8, const bool firstline)
GHOST_TModifierKey ghost_mask_pair[2]
static struct WMInitStruct wm_init_state
static void wm_window_ensure_eventstate(wmWindow *win)
int wm_window_fullscreen_toggle_exec(bContext *C, wmOperator *)
void wm_quit_with_optional_confirmation_prompt(bContext *C, wmWindow *win)
void * WM_system_gpu_context_create()
static uint8_t wm_ghost_modifier_query(const enum ModSide side)
bool WM_clipboard_image_set(ImBuf *ibuf)
void WM_cursor_warp(wmWindow *win, int x, int y)
void wm_window_reset_drawable()
void WM_event_timers_free_all(wmWindowManager *wm)
static bool ghost_event_proc(GHOST_EventHandle ghost_event, GHOST_TUserDataPtr C_void_ptr)
bool wm_get_screensize(int r_size[2])
static void wm_window_ghostwindow_add(wmWindowManager *wm, const char *title, wmWindow *win, bool is_dialog)
void wm_window_events_process(const bContext *C)
WorkSpaceLayout * WM_window_get_active_layout(const wmWindow *win)
void WM_system_gpu_context_dispose(void *context)
void WM_event_timer_free_data(wmTimer *timer)
void WM_event_timer_sleep(wmWindowManager *wm, wmWindow *, wmTimer *timer, bool do_sleep)
void WM_window_native_pixel_coords(const wmWindow *win, int *x, int *y)
void wm_test_opengl_deprecation_warning(bContext *C)
static void wm_ghostwindow_destroy(wmWindowManager *wm, wmWindow *win)
bool wm_cursor_position_get(wmWindow *win, int *r_x, int *r_y)
bool WM_window_is_fullscreen(const wmWindow *win)
void wm_window_close(bContext *C, wmWindowManager *wm, wmWindow *win)
void wm_window_set_swap_interval(wmWindow *win, int interval)
static void wm_window_update_eventstate_modifiers(wmWindowManager *wm, wmWindow *win, const uint64_t event_time_ms)
void WM_window_set_active_screen(wmWindow *win, WorkSpace *workspace, bScreen *screen)
static bool wm_window_timers_process(const bContext *C, int *sleep_us_p)
static void wm_confirm_quit(bContext *C)
void WM_init_native_pixels(bool do_it)
void wm_window_set_size(wmWindow *win, int width, int height)
void WM_window_set_dpi(const wmWindow *win)
void wm_ghost_init_background()
WorkSpace * WM_windows_workspace_get_from_screen(const wmWindowManager *wm, const bScreen *screen)
int WM_window_native_pixel_y(const wmWindow *win)
int WM_window_native_pixel_x(const wmWindow *win)
bool wm_window_get_swap_interval(wmWindow *win, int *r_interval)
wmTimer * WM_event_timer_add_notifier(wmWindowManager *wm, wmWindow *win, const uint type, const double time_step)
void wm_window_ghostwindows_remove_invalid(bContext *C, wmWindowManager *wm)
wmWindow * WM_window_open(bContext *C, const char *title, const rcti *rect_unscaled, int space_type, bool toplevel, bool dialog, bool temp, eWindowAlignment alignment, void(*area_setup_fn)(bScreen *screen, ScrArea *area, void *user_data), void *area_setup_user_data)
void WM_system_gpu_context_activate(void *context)
void WM_event_timer_remove_notifier(wmWindowManager *wm, wmWindow *win, wmTimer *timer)
void wm_window_clear_drawable(wmWindowManager *wm)
static uiBlock * block_create_gpu_backend_fallback(bContext *C, ARegion *region, void *)
static int find_free_winid(wmWindowManager *wm)
static const struct @1388 g_modifier_table[]
void WM_progress_clear(wmWindow *win)
void WM_init_state_size_set(int stax, int stay, int sizx, int sizy)
void WM_progress_set(wmWindow *win, float progress)
void wm_window_make_drawable(wmWindowManager *wm, wmWindow *win)
wmWindow * wm_window_copy_test(bContext *C, wmWindow *win_src, const bool duplicate_layout, const bool child)
static bool wm_window_update_size_position(wmWindow *win)
bool WM_clipboard_image_available()
static uiBlock * block_create_opengl_usage_warning(bContext *C, ARegion *region, void *)
const char * WM_ghost_backend()
bool WM_window_is_temp_screen(const wmWindow *win)
wmWindow * WM_window_find_under_cursor(wmWindow *win, const int event_xy[2], int r_event_xy_other[2])
void WM_window_rect_calc(const wmWindow *win, rcti *r_rect)
eWM_CapabilitiesFlag WM_capabilities_flag()
bool WM_window_is_maximized(const wmWindow *win)
void WM_window_set_active_layout(wmWindow *win, WorkSpace *workspace, WorkSpaceLayout *layout)
wmWindow * WM_window_find_by_area(wmWindowManager *wm, const ScrArea *area)
void WM_window_screen_rect_calc(const wmWindow *win, rcti *r_rect)
void WM_window_set_active_view_layer(wmWindow *win, ViewLayer *view_layer)
ViewLayer * WM_window_get_active_view_layer(const wmWindow *win)
void WM_init_state_fullscreen_set()
static void wm_window_update_eventstate(wmWindow *win)
void WM_init_state_normal_set()
Scene * WM_window_get_active_scene(const wmWindow *win)
static void wm_save_file_on_quit_dialog_callback(bContext *C, void *)
struct @1389 * g_wm_clipboard_text_simulate
static const char * g_system_backend_id
static void wm_window_update_eventstate_modifiers_clear(wmWindowManager *wm, wmWindow *win, const uint64_t event_time_ms)
static void wm_window_set_drawable(wmWindowManager *wm, wmWindow *win, bool activate)
void wm_window_free(bContext *C, wmWindowManager *wm, wmWindow *win)
int wm_window_new_exec(bContext *C, wmOperator *op)
void WM_event_timer_remove(wmWindowManager *wm, wmWindow *, wmTimer *timer)
void WM_window_title(wmWindowManager *wm, wmWindow *win, const char *title)
void wm_ghost_init(bContext *C)
GHOST_TDrawingContextType wm_ghost_drawing_context_type(const eGPUBackendType gpu_backend)
void WM_windows_scene_data_sync(const ListBase *win_lb, Scene *scene)
void wm_window_ghostwindows_ensure(wmWindowManager *wm)
void WM_init_window_focus_set(bool do_it)
WorkSpace * WM_window_get_active_workspace(const wmWindow *win)
bool wm_get_desktopsize(int r_size[2])
void wm_window_timers_delete_removed(wmWindowManager *wm)
void wm_window_lower(wmWindow *win)
void WM_ghost_show_message_box(const char *title, const char *message, const char *help_label, const char *continue_label, const char *link, GHOST_DialogOptions dialog_options)
wmTimer * WM_event_timer_add(wmWindowManager *wm, wmWindow *win, const int event_type, const double time_step)
void WM_system_gpu_context_release(void *context)
bScreen * WM_window_get_active_screen(const wmWindow *win)
bool wm_xr_events_handle(wmWindowManager *wm)