Blender  V2.93
wm_window.c
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2007 Blender Foundation but based
17  * on ghostwinlay.c (C) 2001-2002 by NaN Holding BV
18  * All rights reserved.
19  */
20 
27 #include <math.h>
28 #include <stdio.h>
29 #include <stdlib.h>
30 #include <string.h>
31 
32 #include "DNA_listBase.h"
33 #include "DNA_screen_types.h"
35 #include "DNA_workspace_types.h"
36 
37 #include "MEM_guardedalloc.h"
38 
39 #include "GHOST_C-api.h"
40 
41 #include "BLI_blenlib.h"
42 #include "BLI_math.h"
43 #include "BLI_utildefines.h"
44 
45 #include "BLT_translation.h"
46 
47 #include "BKE_context.h"
48 #include "BKE_global.h"
49 #include "BKE_icons.h"
50 #include "BKE_layer.h"
51 #include "BKE_main.h"
52 #include "BKE_screen.h"
53 #include "BKE_workspace.h"
54 
55 #include "RNA_access.h"
56 #include "RNA_define.h"
57 #include "RNA_enum_types.h"
58 
59 #include "WM_api.h"
60 #include "WM_types.h"
61 #include "wm.h"
62 #include "wm_draw.h"
63 #include "wm_event_system.h"
64 #include "wm_files.h"
65 #include "wm_platform_support.h"
66 #include "wm_window.h"
67 #include "wm_window_private.h"
68 #ifdef WITH_XR_OPENXR
69 # include "wm_xr.h"
70 #endif
71 
72 #include "ED_anim_api.h"
73 #include "ED_fileselect.h"
74 #include "ED_render.h"
75 #include "ED_scene.h"
76 #include "ED_screen.h"
77 
78 #include "UI_interface.h"
79 #include "UI_interface_icons.h"
80 
81 #include "PIL_time.h"
82 
83 #include "BLF_api.h"
84 #include "GPU_batch.h"
85 #include "GPU_batch_presets.h"
86 #include "GPU_context.h"
87 #include "GPU_framebuffer.h"
88 #include "GPU_immediate.h"
89 #include "GPU_init_exit.h"
90 #include "GPU_platform.h"
91 #include "GPU_state.h"
92 #include "GPU_texture.h"
93 
94 #include "UI_resources.h"
95 
96 /* for assert */
97 #ifndef NDEBUG
98 # include "BLI_threads.h"
99 #endif
100 
101 /* the global to talk to ghost */
102 static GHOST_SystemHandle g_system = NULL;
103 
104 typedef enum eWinOverrideFlag {
105  WIN_OVERRIDE_GEOM = (1 << 0),
108 
109 #define GHOST_WINDOW_STATE_DEFAULT GHOST_kWindowStateMaximized
110 
115 static struct WMInitStruct {
116  /* window geometry */
119 
122 
125 } wm_init_state = {
127  .window_focus = true,
128  .native_pixels = true,
129 };
130 
131 /* -------------------------------------------------------------------- */
135 static void wm_window_set_drawable(wmWindowManager *wm, wmWindow *win, bool activate);
136 static int wm_window_timer(const bContext *C);
137 
138 /* XXX this one should correctly check for apple top header...
139  * done for Cocoa : returns window contents (and not frame) max size*/
140 void wm_get_screensize(int *r_width, int *r_height)
141 {
142  unsigned int uiwidth;
143  unsigned int uiheight;
144 
145  GHOST_GetMainDisplayDimensions(g_system, &uiwidth, &uiheight);
146  *r_width = uiwidth;
147  *r_height = uiheight;
148 }
149 
150 /* size of all screens (desktop), useful since the mouse is bound by this */
151 void wm_get_desktopsize(int *r_width, int *r_height)
152 {
153  unsigned int uiwidth;
154  unsigned int uiheight;
155 
156  GHOST_GetAllDisplayDimensions(g_system, &uiwidth, &uiheight);
157  *r_width = uiwidth;
158  *r_height = uiheight;
159 }
160 
161 /* keeps size within monitor bounds */
162 static void wm_window_check_size(rcti *rect)
163 {
164  int width, height;
166  if (BLI_rcti_size_x(rect) > width) {
167  BLI_rcti_resize_x(rect, width);
168  }
169  if (BLI_rcti_size_y(rect) > height) {
170  BLI_rcti_resize_y(rect, height);
171  }
172 }
173 
175 {
176  if (win->ghostwin) {
177  /* Prevents non-drawable state of main windows (bugs T22967,
178  * T25071 and possibly T22477 too). Always clear it even if
179  * this window was not the drawable one, because we mess with
180  * drawing context to discard the GW context. */
182 
183  if (win == wm->winactive) {
184  wm->winactive = NULL;
185  }
186 
187  /* We need this window's opengl context active to discard it. */
190 
191  /* Delete local gpu context. */
193 
195  win->ghostwin = NULL;
196  win->gpuctx = NULL;
197  }
198 }
199 
200 /* including window itself, C can be NULL.
201  * ED_screen_exit should have been called */
203 {
204  /* update context */
205  if (C) {
208 
209  if (CTX_wm_window(C) == win) {
211  }
212  }
213 
215 
216  /* end running jobs, a job end also removes its timer */
217  LISTBASE_FOREACH_MUTABLE (wmTimer *, wt, &wm->timers) {
218  if (wt->win == win && wt->event_type == TIMERJOBS) {
219  wm_jobs_timer_end(wm, wt);
220  }
221  }
222 
223  /* timer removing, need to call this api function */
224  LISTBASE_FOREACH_MUTABLE (wmTimer *, wt, &wm->timers) {
225  if (wt->win == win) {
226  WM_event_remove_timer(wm, win, wt);
227  }
228  }
229 
230  if (win->eventstate) {
231  MEM_freeN(win->eventstate);
232  }
233 
234  if (win->cursor_keymap_status) {
236  }
237 
239 
240  wm_event_free_all(win);
241 
242  wm_ghostwindow_destroy(wm, win);
243 
246 
247  MEM_freeN(win);
248 }
249 
251 {
252  int id = 1;
253 
254  LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
255  if (id <= win->winid) {
256  id = win->winid + 1;
257  }
258  }
259  return id;
260 }
261 
262 /* don't change context itself */
263 wmWindow *wm_window_new(const Main *bmain, wmWindowManager *wm, wmWindow *parent, bool dialog)
264 {
265  wmWindow *win = MEM_callocN(sizeof(wmWindow), "window");
266 
267  BLI_addtail(&wm->windows, win);
268  win->winid = find_free_winid(wm);
269 
270  /* Dialogs may have a child window as parent. Otherwise, a child must not be a parent too. */
271  win->parent = (!dialog && parent && parent->parent) ? parent->parent : parent;
272  win->stereo3d_format = MEM_callocN(sizeof(Stereo3dFormat), "Stereo 3D Format (window)");
274 
275  return win;
276 }
277 
278 /* part of wm_window.c api */
280  wmWindowManager *wm,
281  wmWindow *win_src,
282  const bool duplicate_layout,
283  const bool child)
284 {
285  const bool is_dialog = GHOST_IsDialogWindow(win_src->ghostwin);
286  wmWindow *win_parent = (child) ? win_src : win_src->parent;
287  wmWindow *win_dst = wm_window_new(bmain, wm, win_parent, is_dialog);
288  WorkSpace *workspace = WM_window_get_active_workspace(win_src);
289  WorkSpaceLayout *layout_old = WM_window_get_active_layout(win_src);
290 
291  win_dst->posx = win_src->posx + 10;
292  win_dst->posy = win_src->posy;
293  win_dst->sizex = win_src->sizex;
294  win_dst->sizey = win_src->sizey;
295 
296  win_dst->scene = win_src->scene;
297  STRNCPY(win_dst->view_layer_name, win_src->view_layer_name);
298  BKE_workspace_active_set(win_dst->workspace_hook, workspace);
299  WorkSpaceLayout *layout_new = duplicate_layout ? ED_workspace_layout_duplicate(
300  bmain, workspace, layout_old, win_dst) :
301  layout_old;
302  BKE_workspace_active_layout_set(win_dst->workspace_hook, win_dst->winid, workspace, layout_new);
303 
304  *win_dst->stereo3d_format = *win_src->stereo3d_format;
305 
306  return win_dst;
307 }
308 
314  wmWindow *win_src,
315  const bool duplicate_layout,
316  const bool child)
317 {
318  Main *bmain = CTX_data_main(C);
320 
321  wmWindow *win_dst = wm_window_copy(bmain, wm, win_src, duplicate_layout, child);
322 
323  WM_check(C);
324 
325  if (win_dst->ghostwin) {
327  return win_dst;
328  }
329  wm_window_close(C, wm, win_dst);
330  return NULL;
331 }
332 
335 /* -------------------------------------------------------------------- */
340 {
342 }
343 
349 {
350  wmGenericCallback *action = MEM_callocN(sizeof(*action), __func__);
352  wm_close_file_dialog(C, action);
353 }
354 
363 {
364  wmWindow *win_ctx = CTX_wm_window(C);
365 
366  /* The popup will be displayed in the context window which may not be set
367  * here (this function gets called outside of normal event handling loop). */
368  CTX_wm_window_set(C, win);
369 
370  if (U.uiflag & USER_SAVE_PROMPT) {
372  wm_window_raise(win);
374  }
375  else {
377  }
378  }
379  else {
381  }
382 
383  CTX_wm_window_set(C, win_ctx);
384 }
385 
388 /* this is event from ghost, or exit-blender op */
390 {
391  wmWindow *win_other;
392 
393  /* First check if there is another main window remaining. */
394  for (win_other = wm->windows.first; win_other; win_other = win_other->next) {
395  if (win_other != win && win_other->parent == NULL && !WM_window_is_temp_screen(win_other)) {
396  break;
397  }
398  }
399 
400  if (win->parent == NULL && win_other == NULL) {
402  return;
403  }
404 
405  /* Close child windows */
406  LISTBASE_FOREACH_MUTABLE (wmWindow *, iter_win, &wm->windows) {
407  if (iter_win->parent == win) {
408  wm_window_close(C, wm, iter_win);
409  }
410  }
411 
412  bScreen *screen = WM_window_get_active_screen(win);
413  WorkSpace *workspace = WM_window_get_active_workspace(win);
415 
416  BLI_remlink(&wm->windows, win);
417 
418  CTX_wm_window_set(C, win); /* needed by handlers */
421 
422  /* for regular use this will _never_ be NULL,
423  * however we may be freeing an improperly initialized window. */
424  if (screen) {
425  ED_screen_exit(C, win, screen);
426  }
427 
428  wm_window_free(C, wm, win);
429 
430  /* if temp screen, delete it after window free (it stops jobs that can access it) */
431  if (screen && screen->temp) {
432  Main *bmain = CTX_data_main(C);
433 
434  BLI_assert(BKE_workspace_layout_screen_get(layout) == screen);
435  BKE_workspace_layout_remove(bmain, workspace, layout);
437  }
438 }
439 
441 {
442  if (WM_window_is_temp_screen(win)) {
443  /* nothing to do for 'temp' windows,
444  * because WM_window_open always sets window title */
445  }
446  else if (win->ghostwin) {
447  /* this is set to 1 if you don't have startup.blend open */
448  if (G.save_over && BKE_main_blendfile_path_from_global()[0]) {
449  char str[sizeof(((Main *)NULL)->name) + 24];
451  sizeof(str),
452  "Blender%s [%s%s]",
453  wm->file_saved ? "" : "*",
455  G_MAIN->recovered ? " (Recovered)" : "");
456  GHOST_SetTitle(win->ghostwin, str);
457  }
458  else {
459  GHOST_SetTitle(win->ghostwin, "Blender");
460  }
461 
462  /* Informs GHOST of unsaved changes, to set window modified visual indicator (macOS)
463  * and to give hint of unsaved changes for a user warning mechanism in case of OS application
464  * terminate request (e.g. OS Shortcut Alt+F4, Command+Q, (...), or session end). */
466  }
467 }
468 
469 void WM_window_set_dpi(const wmWindow *win)
470 {
471  float auto_dpi = GHOST_GetDPIHint(win->ghostwin);
472 
473  /* Clamp auto DPI to 96, since our font/interface drawing does not work well
474  * with lower sizes. The main case we are interested in supporting is higher
475  * DPI. If a smaller UI is desired it is still possible to adjust UI scale. */
476  auto_dpi = max_ff(auto_dpi, 96.0f);
477 
478  /* Lazily init UI scale size, preserving backwards compatibility by
479  * computing UI scale from ratio of previous DPI and auto DPI */
480  if (U.ui_scale == 0) {
481  int virtual_pixel = (U.virtual_pixel == VIRTUAL_PIXEL_NATIVE) ? 1 : 2;
482 
483  if (U.dpi == 0) {
484  U.ui_scale = virtual_pixel;
485  }
486  else {
487  U.ui_scale = (virtual_pixel * U.dpi * 96.0f) / (auto_dpi * 72.0f);
488  }
489 
490  CLAMP(U.ui_scale, 0.25f, 4.0f);
491  }
492 
493  /* Blender's UI drawing assumes DPI 72 as a good default following macOS
494  * while Windows and Linux use DPI 96. GHOST assumes a default 96 so we
495  * remap the DPI to Blender's convention. */
496  auto_dpi *= GHOST_GetNativePixelSize(win->ghostwin);
497  int dpi = auto_dpi * U.ui_scale * (72.0 / 96.0f);
498 
499  /* Automatically set larger pixel size for high DPI. */
500  int pixelsize = max_ii(1, (int)(dpi / 64));
501  /* User adjustment for pixel size. */
502  pixelsize = max_ii(1, pixelsize + U.ui_line_width);
503 
504  /* Set user preferences globals for drawing, and for forward compatibility. */
505  U.pixelsize = pixelsize;
506  U.dpi = dpi / pixelsize;
507  U.virtual_pixel = (pixelsize == 1) ? VIRTUAL_PIXEL_NATIVE : VIRTUAL_PIXEL_DOUBLE;
508  U.dpi_fac = ((U.pixelsize * (float)U.dpi) / 72.0f);
509  U.inv_dpi_fac = 1.0f / U.dpi_fac;
510 
511  /* Set user preferences globals for drawing, and for forward compatibility. */
512  U.widget_unit = (U.pixelsize * U.dpi * 20 + 36) / 72;
513  /* If line thickness differs from scaling factor then adjustments need to be made */
514  U.widget_unit += 2 * ((int)U.pixelsize - (int)U.dpi_fac);
515 
516  /* update font drawing */
517  BLF_default_dpi(U.pixelsize * U.dpi);
518 }
519 
521 {
522  /* Update mouse position when a window is activated. */
523  wm_cursor_position_get(win, &win->eventstate->x, &win->eventstate->y);
524 }
525 
527 {
528  if (win->eventstate) {
529  return;
530  }
531 
532  win->eventstate = MEM_callocN(sizeof(wmEvent), "window event state");
534 }
535 
536 /* belongs to below */
538  const char *title,
539  wmWindow *win,
540  bool is_dialog)
541 {
542  /* a new window is created when pageflip mode is required for a window */
543  GHOST_GLSettings glSettings = {0};
545  glSettings.flags |= GHOST_glStereoVisual;
546  }
547 
548  if (G.debug & G_DEBUG_GPU) {
549  glSettings.flags |= GHOST_glDebugContext;
550  }
551 
552  int scr_w, scr_h;
553  wm_get_desktopsize(&scr_w, &scr_h);
554  int posy = (scr_h - win->posy - win->sizey);
555 
556  /* Clear drawable so we can set the new window. */
557  wmWindow *prev_windrawable = wm->windrawable;
559 
560  GHOST_WindowHandle ghostwin = GHOST_CreateWindow(g_system,
561  (win->parent) ? win->parent->ghostwin : NULL,
562  title,
563  win->posx,
564  posy,
565  win->sizex,
566  win->sizey,
568  is_dialog,
570  glSettings);
571 
572  if (ghostwin) {
573  win->gpuctx = GPU_context_create(ghostwin);
574 
575  /* needed so we can detect the graphics card below */
576  GPU_init();
577 
578  /* Set window as drawable upon creation. Note this has already been
579  * it has already been activated by GHOST_CreateWindow. */
580  wm_window_set_drawable(wm, win, false);
581 
582  win->ghostwin = ghostwin;
583  GHOST_SetWindowUserData(ghostwin, win); /* pointer back */
584 
586 
587  /* store actual window size in blender window */
588  GHOST_RectangleHandle bounds = GHOST_GetClientBounds(win->ghostwin);
589 
590  /* win32: gives undefined window size when minimized */
594  }
596 
597 #ifndef __APPLE__
598  /* set the state here, so minimized state comes up correct on windows */
601  }
602 #endif
603  /* until screens get drawn, make it nice gray */
604  GPU_clear_color(0.55f, 0.55f, 0.55f, 1.0f);
605 
606  /* needed here, because it's used before it reads userdef */
607  WM_window_set_dpi(win);
608 
610 
611  // GHOST_SetWindowState(ghostwin, GHOST_kWindowStateModified);
612  }
613  else {
614  wm_window_set_drawable(wm, prev_windrawable, false);
615  }
616 }
617 
618 static void wm_window_ghostwindow_ensure(wmWindowManager *wm, wmWindow *win, bool is_dialog)
619 {
620  if (win->ghostwin == NULL) {
621  if ((win->sizex == 0) || (wm_init_state.override_flag & WIN_OVERRIDE_GEOM)) {
622  win->posx = wm_init_state.start_x;
623  win->posy = wm_init_state.start_y;
624  win->sizex = wm_init_state.size_x;
625  win->sizey = wm_init_state.size_y;
626 
630  }
631  else {
633  }
634  }
635 
639  }
640 
641  /* without this, cursor restore may fail, T45456 */
642  if (win->cursor == 0) {
643  win->cursor = WM_CURSOR_DEFAULT;
644  }
645 
646  wm_window_ghostwindow_add(wm, "Blender", win, is_dialog);
647  }
648 
649  if (win->ghostwin != NULL) {
650  /* If we have no ghostwin this is a buggy window that should be removed.
651  * However we still need to initialize it correctly so the screen doesn't hang. */
652 
653  /* happens after fileread */
655 
656  WM_window_set_dpi(win);
657  }
658 
659  /* add keymap handlers (1 handler for all keys in map!) */
660  wmKeyMap *keymap = WM_keymap_ensure(wm->defaultconf, "Window", 0, 0);
661  WM_event_add_keymap_handler(&win->handlers, keymap);
662 
663  keymap = WM_keymap_ensure(wm->defaultconf, "Screen", 0, 0);
664  WM_event_add_keymap_handler(&win->handlers, keymap);
665 
666  keymap = WM_keymap_ensure(wm->defaultconf, "Screen Editing", 0, 0);
668 
669  /* add drop boxes */
670  {
671  ListBase *lb = WM_dropboxmap_find("Window", 0, 0);
673  }
674  wm_window_title(wm, win);
675 
676  /* add topbar */
678 }
679 
694 {
695  BLI_assert(G.background == false);
696 
697  /* No command-line prefsize? then we set this.
698  * Note that these values will be used only
699  * when there is no startup.blend yet.
700  */
701  if (wm_init_state.size_x == 0) {
703 
704  /* NOTE: this isn't quite correct, active screen maybe offset 1000s if PX,
705  * we'd need a #wm_get_screensize like function that gives offset,
706  * in practice the window manager will likely move to the correct monitor */
709  }
710 
711  LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
712  wm_window_ghostwindow_ensure(wm, win, false);
713  }
714 }
715 
721 {
722  BLI_assert(G.background == false);
723 
724  LISTBASE_FOREACH_MUTABLE (wmWindow *, win, &wm->windows) {
725  if (win->ghostwin == NULL) {
726  wm_window_close(C, wm, win);
727  }
728  }
729 }
730 
731 /* Update window size and position based on data from GHOST window. */
733 {
734  GHOST_RectangleHandle client_rect = GHOST_GetClientBounds(win->ghostwin);
735  int l, t, r, b;
736  GHOST_GetRectangle(client_rect, &l, &t, &r, &b);
737 
738  GHOST_DisposeRectangle(client_rect);
739 
740  int scr_w, scr_h;
741  wm_get_desktopsize(&scr_w, &scr_h);
742  int sizex = r - l;
743  int sizey = b - t;
744  int posx = l;
745  int posy = scr_h - t - win->sizey;
746 
747  if (win->sizex != sizex || win->sizey != sizey || win->posx != posx || win->posy != posy) {
748  win->sizex = sizex;
749  win->sizey = sizey;
750  win->posx = posx;
751  win->posy = posy;
752  return true;
753  }
754  return false;
755 }
756 
765  const char *title,
766  int x,
767  int y,
768  int sizex,
769  int sizey,
770  int space_type,
771  bool dialog,
772  bool temp,
773  WindowAlignment alignment)
774 {
775  Main *bmain = CTX_data_main(C);
777  wmWindow *win_prev = CTX_wm_window(C);
779  ViewLayer *view_layer = CTX_data_view_layer(C);
780  rcti rect;
781 
782  const float native_pixel_size = GHOST_GetNativePixelSize(win_prev->ghostwin);
783  /* convert to native OS window coordinates */
784  rect.xmin = win_prev->posx + (x / native_pixel_size);
785  rect.ymin = win_prev->posy + (y / native_pixel_size);
786  sizex /= native_pixel_size;
787  sizey /= native_pixel_size;
788 
789  if (alignment == WIN_ALIGN_LOCATION_CENTER) {
790  /* Window centered around x,y location. */
791  rect.xmin -= sizex / 2;
792  rect.ymin -= sizey / 2;
793  }
794  else if (alignment == WIN_ALIGN_PARENT_CENTER) {
795  /* Centered within parent. X,Y as offsets from there. */
796  rect.xmin += (win_prev->sizex - sizex) / 2;
797  rect.ymin += (win_prev->sizey - sizey) / 2;
798  }
799  else {
800  /* Positioned absolutely within parent bounds. */
801  }
802 
803  rect.xmax = rect.xmin + sizex;
804  rect.ymax = rect.ymin + sizey;
805 
806  /* changes rect to fit within desktop */
807  wm_window_check_size(&rect);
808 
809  /* Reuse temporary windows when they share the same title. */
810  wmWindow *win = NULL;
811  if (temp) {
812  LISTBASE_FOREACH (wmWindow *, win_iter, &wm->windows) {
813  if (WM_window_is_temp_screen(win_iter)) {
814  char *wintitle = GHOST_GetTitle(win_iter->ghostwin);
815  if (STREQ(title, wintitle)) {
816  win = win_iter;
817  }
818  free(wintitle);
819  }
820  }
821  }
822 
823  /* add new window? */
824  if (win == NULL) {
825  win = wm_window_new(bmain, wm, win_prev, dialog);
826  win->posx = rect.xmin;
827  win->posy = rect.ymin;
828  *win->stereo3d_format = *win_prev->stereo3d_format;
829  }
830 
831  bScreen *screen = WM_window_get_active_screen(win);
832 
833  win->sizex = BLI_rcti_size_x(&rect);
834  win->sizey = BLI_rcti_size_y(&rect);
835 
836  if (WM_window_get_active_workspace(win) == NULL) {
837  WorkSpace *workspace = WM_window_get_active_workspace(win_prev);
838  BKE_workspace_active_set(win->workspace_hook, workspace);
839  }
840 
841  if (screen == NULL) {
842  /* add new screen layout */
843  WorkSpace *workspace = WM_window_get_active_workspace(win);
844  WorkSpaceLayout *layout = ED_workspace_layout_add(bmain, workspace, win, "temp");
845 
846  screen = BKE_workspace_layout_screen_get(layout);
847  WM_window_set_active_layout(win, workspace, layout);
848  }
849 
850  /* Set scene and view layer to match original window. */
851  STRNCPY(win->view_layer_name, view_layer->name);
852  if (WM_window_get_active_scene(win) != scene) {
854  }
855 
856  screen->temp = temp;
857 
858  /* make window active, and validate/resize */
859  CTX_wm_window_set(C, win);
860  const bool new_window = (win->ghostwin == NULL);
861  if (new_window) {
862  wm_window_ghostwindow_ensure(wm, win, dialog);
863  }
864  WM_check(C);
865 
866  /* It's possible `win->ghostwin == NULL`.
867  * instead of attempting to cleanup here (in a half finished state),
868  * finish setting up the screen, then free it at the end of the function,
869  * to avoid having to take into account a partially-created window.
870  */
871 
872  /* ensure it shows the right spacetype editor */
873  if (space_type != SPACE_EMPTY) {
874  ScrArea *area = screen->areabase.first;
876  ED_area_newspace(C, area, space_type, false);
877  }
878 
879  ED_screen_change(C, screen);
880 
881  if (!new_window) {
882  /* Set size in GHOST window and then update size and position from GHOST,
883  * in case they where changed by GHOST to fit the monitor/screen. */
884  wm_window_set_size(win, win->sizex, win->sizey);
886  }
887 
888  /* Refresh screen dimensions, after the effective window size is known. */
889  ED_screen_refresh(wm, win);
890 
891  if (win->ghostwin) {
892  wm_window_raise(win);
893  GHOST_SetTitle(win->ghostwin, title);
894  return win;
895  }
896 
897  /* very unlikely! but opening a new window can fail */
898  wm_window_close(C, wm, win);
899  CTX_wm_window_set(C, win_prev);
900 
901  return NULL;
902 }
903 
904 /* ****************** Operators ****************** */
905 
907 {
909  wmWindow *win = CTX_wm_window(C);
910  wm_window_close(C, wm, win);
911  return OPERATOR_FINISHED;
912 }
913 
915 {
916  wmWindow *win_src = CTX_wm_window(C);
918 
919  bool ok = (WM_window_open(C,
920  IFACE_("Blender"),
921  0,
922  0,
923  win_src->sizex * 0.95f,
924  win_src->sizey * 0.9f,
925  area->spacetype,
926  false,
927  false,
929 
931 }
932 
934 {
935  wmWindow *win_src = CTX_wm_window(C);
936 
937  bool ok = (wm_window_copy_test(C, win_src, true, false) != NULL);
938 
940 }
941 
942 /* fullscreen operator callback */
944 {
945  wmWindow *window = CTX_wm_window(C);
946 
947  if (G.background) {
948  return OPERATOR_CANCELLED;
949  }
950 
954  }
955  else {
957  }
958 
959  return OPERATOR_FINISHED;
960 }
961 
962 /* ************ events *************** */
963 
965 {
966  float fac = GHOST_GetNativePixelSize(win->ghostwin);
967 
968  GHOST_ScreenToClient(win->ghostwin, *x, *y, x, y);
969  *x *= fac;
970 
971  *y = (win->sizey - 1) - *y;
972  *y *= fac;
973 }
974 
975 void wm_cursor_position_to_ghost(wmWindow *win, int *x, int *y)
976 {
977  float fac = GHOST_GetNativePixelSize(win->ghostwin);
978 
979  *x /= fac;
980  *y /= fac;
981  *y = win->sizey - *y - 1;
982 
983  GHOST_ClientToScreen(win->ghostwin, *x, *y, x, y);
984 }
985 
986 void wm_cursor_position_get(wmWindow *win, int *r_x, int *r_y)
987 {
988  if (UNLIKELY(G.f & G_FLAG_EVENT_SIMULATE)) {
989  *r_x = win->eventstate->x;
990  *r_y = win->eventstate->y;
991  return;
992  }
994  wm_cursor_position_from_ghost(win, r_x, r_y);
995 }
996 
997 typedef enum {
998  SHIFT = 's',
999  CONTROL = 'c',
1000  ALT = 'a',
1001  OS = 'C',
1002 } modifierKeyType;
1003 
1004 /* check if specified modifier key type is pressed */
1005 static int query_qual(modifierKeyType qual)
1006 {
1008  switch (qual) {
1009  case SHIFT:
1012  break;
1013  case CONTROL:
1016  break;
1017  case OS:
1019  break;
1020  case ALT:
1021  default:
1024  break;
1025  }
1026 
1027  int val = 0;
1029  if (!val) {
1031  }
1032 
1033  return val;
1034 }
1035 
1037 {
1038  BLI_assert(ELEM(wm->windrawable, NULL, win));
1039 
1040  wm->windrawable = win;
1041  if (activate) {
1043  }
1045 }
1046 
1048 {
1049  if (wm->windrawable) {
1050  wm->windrawable = NULL;
1051  }
1052 }
1053 
1055 {
1057 
1058  if (win != wm->windrawable && win->ghostwin) {
1059  // win->lmbut = 0; /* keeps hanging when mousepressed while other window opened */
1061 
1062  if (G.debug & G_DEBUG_EVENTS) {
1063  printf("%s: set drawable %d\n", __func__, win->winid);
1064  }
1065 
1066  wm_window_set_drawable(wm, win, true);
1067 
1068  /* this can change per window */
1069  WM_window_set_dpi(win);
1070  }
1071 }
1072 
1073 /* Reset active the current window opengl drawing context. */
1075 {
1078  wmWindowManager *wm = G_MAIN->wm.first;
1079 
1080  if (wm == NULL) {
1081  return;
1082  }
1083  wmWindow *win = wm->windrawable;
1084 
1085  if (win && win->ghostwin) {
1087  wm_window_set_drawable(wm, win, true);
1088  }
1089 }
1090 
1096 static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr C_void_ptr)
1097 {
1098  bContext *C = C_void_ptr;
1101 #if 0
1102  /* We may want to use time from ghost, currently `PIL_check_seconds_timer` is used instead. */
1104 #endif
1105 
1106  if (type == GHOST_kEventQuitRequest) {
1107  /* Find an active window to display quit dialog in. */
1108  GHOST_WindowHandle ghostwin = GHOST_GetEventWindow(evt);
1109 
1110  wmWindow *win;
1111  if (ghostwin && GHOST_ValidWindow(g_system, ghostwin)) {
1112  win = GHOST_GetWindowUserData(ghostwin);
1113  }
1114  else {
1115  win = wm->winactive;
1116  }
1117 
1118  /* Display quit dialog or quit immediately. */
1119  if (win) {
1121  }
1122  else {
1124  }
1125  }
1126  else {
1127  GHOST_WindowHandle ghostwin = GHOST_GetEventWindow(evt);
1129 
1130  /* Ghost now can call this function for life resizes,
1131  * but it should return if WM didn't initialize yet.
1132  * Can happen on file read (especially full size window). */
1133  if ((wm->initialized & WM_WINDOW_IS_INIT) == 0) {
1134  return 1;
1135  }
1136  if (!ghostwin) {
1137  /* XXX - should be checked, why are we getting an event here, and */
1138  /* what is it? */
1139  puts("<!> event has no window");
1140  return 1;
1141  }
1142  if (!GHOST_ValidWindow(g_system, ghostwin)) {
1143  /* XXX - should be checked, why are we getting an event here, and */
1144  /* what is it? */
1145  puts("<!> event has invalid window");
1146  return 1;
1147  }
1148  wmWindow *win = GHOST_GetWindowUserData(ghostwin);
1149 
1150  switch (type) {
1152  wm_event_add_ghostevent(wm, win, type, data);
1153  win->active = 0; /* XXX */
1154 
1155  /* clear modifiers for inactive windows */
1156  win->eventstate->alt = 0;
1157  win->eventstate->ctrl = 0;
1158  win->eventstate->shift = 0;
1159  win->eventstate->oskey = 0;
1160  win->eventstate->keymodifier = 0;
1161 
1162  break;
1164  GHOST_TEventKeyData kdata;
1165  const int keymodifier = ((query_qual(SHIFT) ? KM_SHIFT : 0) |
1166  (query_qual(CONTROL) ? KM_CTRL : 0) |
1167  (query_qual(ALT) ? KM_ALT : 0) | (query_qual(OS) ? KM_OSKEY : 0));
1168 
1169  /* Win23/GHOST modifier bug, see T40317 */
1170 #ifndef WIN32
1171 //# define USE_WIN_ACTIVATE
1172 #endif
1173 
1174  /* No context change! C->wm->windrawable is drawable, or for area queues. */
1175  wm->winactive = win;
1176 
1177  win->active = 1;
1178  // window_handle(win, INPUTCHANGE, win->active);
1179 
1180  /* bad ghost support for modifier keys... so on activate we set the modifiers again */
1181 
1182  /* TODO: This is not correct since a modifier may be held when a window is activated...
1183  * better solve this at ghost level. attempted fix r54450 but it caused bug T34255.
1184  *
1185  * For now don't send GHOST_kEventKeyDown events, just set the 'eventstate'.
1186  */
1187  kdata.ascii = '\0';
1188  kdata.utf8_buf[0] = '\0';
1189 
1190  if (win->eventstate->shift) {
1191  if ((keymodifier & KM_SHIFT) == 0) {
1192  kdata.key = GHOST_kKeyLeftShift;
1193  wm_event_add_ghostevent(wm, win, GHOST_kEventKeyUp, &kdata);
1194  }
1195  }
1196 #ifdef USE_WIN_ACTIVATE
1197  else {
1198  if (keymodifier & KM_SHIFT) {
1199  win->eventstate->shift = KM_MOD_FIRST;
1200  }
1201  }
1202 #endif
1203  if (win->eventstate->ctrl) {
1204  if ((keymodifier & KM_CTRL) == 0) {
1205  kdata.key = GHOST_kKeyLeftControl;
1206  wm_event_add_ghostevent(wm, win, GHOST_kEventKeyUp, &kdata);
1207  }
1208  }
1209 #ifdef USE_WIN_ACTIVATE
1210  else {
1211  if (keymodifier & KM_CTRL) {
1212  win->eventstate->ctrl = KM_MOD_FIRST;
1213  }
1214  }
1215 #endif
1216  if (win->eventstate->alt) {
1217  if ((keymodifier & KM_ALT) == 0) {
1218  kdata.key = GHOST_kKeyLeftAlt;
1219  wm_event_add_ghostevent(wm, win, GHOST_kEventKeyUp, &kdata);
1220  }
1221  }
1222 #ifdef USE_WIN_ACTIVATE
1223  else {
1224  if (keymodifier & KM_ALT) {
1225  win->eventstate->alt = KM_MOD_FIRST;
1226  }
1227  }
1228 #endif
1229  if (win->eventstate->oskey) {
1230  if ((keymodifier & KM_OSKEY) == 0) {
1231  kdata.key = GHOST_kKeyOS;
1232  wm_event_add_ghostevent(wm, win, GHOST_kEventKeyUp, &kdata);
1233  }
1234  }
1235 #ifdef USE_WIN_ACTIVATE
1236  else {
1237  if (keymodifier & KM_OSKEY) {
1238  win->eventstate->oskey = KM_MOD_FIRST;
1239  }
1240  }
1241 #endif
1242 
1243 #undef USE_WIN_ACTIVATE
1244 
1245  /* keymodifier zero, it hangs on hotkeys that open windows otherwise */
1246  win->eventstate->keymodifier = 0;
1247 
1248  /* entering window, update mouse pos. but no event */
1250 
1251  win->addmousemove = 1; /* enables highlighted buttons */
1252 
1253  wm_window_make_drawable(wm, win);
1254 
1255  /* window might be focused by mouse click in configuration of window manager
1256  * when focus is not following mouse
1257  * click could have been done on a button and depending on window manager settings
1258  * click would be passed to blender or not, but in any case button under cursor
1259  * should be activated, so at max next click on button without moving mouse
1260  * would trigger its handle function
1261  * currently it seems to be common practice to generate new event for, but probably
1262  * we'll need utility function for this? (sergey)
1263  */
1264  wmEvent event;
1265  wm_event_init_from_window(win, &event);
1266  event.type = MOUSEMOVE;
1267  event.prevx = event.x;
1268  event.prevy = event.y;
1269  event.is_repeat = false;
1270 
1271  wm_event_add(win, &event);
1272 
1273  break;
1274  }
1275  case GHOST_kEventWindowClose: {
1276  wm_window_close(C, wm, win);
1277  break;
1278  }
1279  case GHOST_kEventWindowUpdate: {
1280  if (G.debug & G_DEBUG_EVENTS) {
1281  printf("%s: ghost redraw %d\n", __func__, win->winid);
1282  }
1283 
1284  wm_window_make_drawable(wm, win);
1286 
1287  break;
1288  }
1290  case GHOST_kEventWindowMove: {
1292  win->windowstate = state;
1293 
1294  WM_window_set_dpi(win);
1295 
1296  /* win32: gives undefined window size when minimized */
1298  /*
1299  * Ghost sometimes send size or move events when the window hasn't changed.
1300  * One case of this is using compiz on linux. To alleviate the problem
1301  * we ignore all such event here.
1302  *
1303  * It might be good to eventually do that at Ghost level, but that is for
1304  * another time.
1305  */
1306  if (wm_window_update_size_position(win)) {
1307  const bScreen *screen = WM_window_get_active_screen(win);
1308 
1309  /* debug prints */
1310  if (G.debug & G_DEBUG_EVENTS) {
1311  const char *state_str;
1313 
1315  state_str = "normal";
1316  }
1317  else if (state == GHOST_kWindowStateMinimized) {
1318  state_str = "minimized";
1319  }
1320  else if (state == GHOST_kWindowStateMaximized) {
1321  state_str = "maximized";
1322  }
1323  else if (state == GHOST_kWindowStateFullScreen) {
1324  state_str = "fullscreen";
1325  }
1326  else {
1327  state_str = "<unknown>";
1328  }
1329 
1330  printf("%s: window %d state = %s\n", __func__, win->winid, state_str);
1331 
1332  if (type != GHOST_kEventWindowSize) {
1333  printf("win move event pos %d %d size %d %d\n",
1334  win->posx,
1335  win->posy,
1336  win->sizex,
1337  win->sizey);
1338  }
1339  }
1340 
1341  wm_window_make_drawable(wm, win);
1342  BKE_icon_changed(screen->id.icon_id);
1345 
1346 #if defined(__APPLE__) || defined(WIN32)
1347  /* OSX and Win32 don't return to the mainloop while resize */
1348  wm_window_timer(C);
1351  wm_draw_update(C);
1352 #endif
1353  }
1354  }
1355  break;
1356  }
1357 
1359  WM_window_set_dpi(win);
1360  /* font's are stored at each DPI level, without this we can easy load 100's of fonts */
1361  BLF_cache_clear();
1362 
1363  WM_main_add_notifier(NC_WINDOW, NULL); /* full redraw */
1364  WM_main_add_notifier(NC_SCREEN | NA_EDITED, NULL); /* refresh region sizes */
1365  break;
1366  }
1367 
1368  case GHOST_kEventOpenMainFile: {
1369  const char *path = GHOST_GetEventData(evt);
1370 
1371  if (path) {
1372  wmOperatorType *ot = WM_operatortype_find("WM_OT_open_mainfile", false);
1373  /* operator needs a valid window in context, ensures
1374  * it is correctly set */
1375  CTX_wm_window_set(C, win);
1376 
1377  PointerRNA props_ptr;
1379  RNA_string_set(&props_ptr, "filepath", path);
1380  RNA_boolean_set(&props_ptr, "display_file_selector", false);
1382  WM_operator_properties_free(&props_ptr);
1383 
1385  }
1386  break;
1387  }
1390 
1391  /* entering window, update mouse pos */
1393 
1394  wmEvent event;
1395  wm_event_init_from_window(win, &event); /* copy last state, like mouse coords */
1396 
1397  /* activate region */
1398  event.type = MOUSEMOVE;
1399  event.prevx = event.x;
1400  event.prevy = event.y;
1401  event.is_repeat = false;
1402 
1403  /* No context change! C->wm->windrawable is drawable, or for area queues. */
1404  wm->winactive = win;
1405 
1406  win->active = 1;
1407 
1408  wm_event_add(win, &event);
1409 
1410  /* make blender drop event with custom data pointing to wm drags */
1411  event.type = EVT_DROP;
1412  event.val = KM_RELEASE;
1413  event.custom = EVT_DATA_DRAGDROP;
1414  event.customdata = &wm->drags;
1415  event.customdatafree = 1;
1416 
1417  wm_event_add(win, &event);
1418 
1419  /* printf("Drop detected\n"); */
1420 
1421  /* add drag data to wm for paths: */
1422 
1424  GHOST_TStringArray *stra = ddd->data;
1425 
1426  for (int a = 0; a < stra->count; a++) {
1427  printf("drop file %s\n", stra->strings[a]);
1428  /* try to get icon type from extension */
1429  int icon = ED_file_extension_icon((char *)stra->strings[a]);
1430 
1431  WM_event_start_drag(C, icon, WM_DRAG_PATH, stra->strings[a], 0.0, WM_DRAG_NOP);
1432  /* void poin should point to string, it makes a copy */
1433  break; /* only one drop element supported now */
1434  }
1435  }
1436 
1437  break;
1438  }
1440  /* Only update if the actual pixel size changes. */
1441  float prev_pixelsize = U.pixelsize;
1442  WM_window_set_dpi(win);
1443 
1444  if (U.pixelsize != prev_pixelsize) {
1446 
1447  /* Close all popups since they are positioned with the pixel
1448  * size baked in and it's difficult to correct them. */
1449  CTX_wm_window_set(C, win);
1452 
1453  wm_window_make_drawable(wm, win);
1454 
1457  }
1458 
1459  break;
1460  }
1461  case GHOST_kEventTrackpad: {
1463 
1464  wm_cursor_position_from_ghost(win, &pd->x, &pd->y);
1465  wm_event_add_ghostevent(wm, win, type, data);
1466  break;
1467  }
1468  case GHOST_kEventCursorMove: {
1470 
1471  wm_cursor_position_from_ghost(win, &cd->x, &cd->y);
1472  wm_event_add_ghostevent(wm, win, type, data);
1473  break;
1474  }
1476  case GHOST_kEventButtonUp: {
1477  if (win->active == 0) {
1478  /* Entering window, update cursor and tablet state.
1479  * (ghost sends win-activate *after* the mouse-click in window!) */
1481  }
1482 
1483  wm_event_add_ghostevent(wm, win, type, data);
1484  break;
1485  }
1486  default: {
1487  wm_event_add_ghostevent(wm, win, type, data);
1488  break;
1489  }
1490  }
1491  }
1492  return 1;
1493 }
1494 
1501 static int wm_window_timer(const bContext *C)
1502 {
1503  Main *bmain = CTX_data_main(C);
1505  double time = PIL_check_seconds_timer();
1506  int retval = 0;
1507 
1508  /* Mutable in case the timer gets removed. */
1509  LISTBASE_FOREACH_MUTABLE (wmTimer *, wt, &wm->timers) {
1510  wmWindow *win = wt->win;
1511 
1512  if (wt->sleep != 0) {
1513  continue;
1514  }
1515 
1516  if (time > wt->ntime) {
1517  wt->delta = time - wt->ltime;
1518  wt->duration += wt->delta;
1519  wt->ltime = time;
1520  wt->ntime = wt->stime + wt->timestep * ceil(wt->duration / wt->timestep);
1521 
1522  if (wt->event_type == TIMERJOBS) {
1523  wm_jobs_timer(wm, wt);
1524  }
1525  else if (wt->event_type == TIMERAUTOSAVE) {
1526  wm_autosave_timer(bmain, wm, wt);
1527  }
1528  else if (wt->event_type == TIMERNOTIFIER) {
1529  WM_main_add_notifier(POINTER_AS_UINT(wt->customdata), NULL);
1530  }
1531  else if (win) {
1532  wmEvent event;
1533  wm_event_init_from_window(win, &event);
1534 
1535  event.type = wt->event_type;
1536  event.val = KM_NOTHING;
1537  event.keymodifier = 0;
1538  event.is_repeat = false;
1539  event.custom = EVT_DATA_TIMER;
1540  event.customdata = wt;
1541  wm_event_add(win, &event);
1542 
1543  retval = 1;
1544  }
1545  }
1546  }
1547  return retval;
1548 }
1549 
1551 {
1553 
1554  int hasevent = GHOST_ProcessEvents(g_system, 0); /* 0 is no wait */
1555 
1556  if (hasevent) {
1558  }
1559  hasevent |= wm_window_timer(C);
1560 #ifdef WITH_XR_OPENXR
1561  /* XR events don't use the regular window queues. So here we don't only trigger
1562  * processing/dispatching but also handling. */
1563  hasevent |= wm_xr_events_handle(CTX_wm_manager(C));
1564 #endif
1565 
1566  /* no event, we sleep 5 milliseconds */
1567  if (hasevent == 0) {
1568  PIL_sleep_ms(5);
1569  }
1570 }
1571 
1572 /* -------------------------------------------------------------------- */
1581 {
1582  if (!g_system) {
1583  GHOST_EventConsumerHandle consumer;
1584 
1585  if (C != NULL) {
1587  }
1588 
1591 
1592  if (C != NULL) {
1593  GHOST_AddEventConsumer(g_system, consumer);
1594  }
1595 
1598  }
1599 
1601  }
1602 }
1603 
1604 void wm_ghost_exit(void)
1605 {
1606  if (g_system) {
1608  }
1609  g_system = NULL;
1610 }
1611 
1614 /* -------------------------------------------------------------------- */
1618 /* to (de)activate running timers temporary */
1620  wmWindow *UNUSED(win),
1621  wmTimer *timer,
1622  bool do_sleep)
1623 {
1624  LISTBASE_FOREACH (wmTimer *, wt, &wm->timers) {
1625  if (wt == timer) {
1626  wt->sleep = do_sleep;
1627  break;
1628  }
1629  }
1630 }
1631 
1632 wmTimer *WM_event_add_timer(wmWindowManager *wm, wmWindow *win, int event_type, double timestep)
1633 {
1634  wmTimer *wt = MEM_callocN(sizeof(wmTimer), "window timer");
1635 
1636  wt->event_type = event_type;
1638  wt->ntime = wt->ltime + timestep;
1639  wt->stime = wt->ltime;
1640  wt->timestep = timestep;
1641  wt->win = win;
1642 
1643  BLI_addtail(&wm->timers, wt);
1644 
1645  return wt;
1646 }
1647 
1649  wmWindow *win,
1650  unsigned int type,
1651  double timestep)
1652 {
1653  wmTimer *wt = MEM_callocN(sizeof(wmTimer), "window timer");
1654 
1655  wt->event_type = TIMERNOTIFIER;
1657  wt->ntime = wt->ltime + timestep;
1658  wt->stime = wt->ltime;
1659  wt->timestep = timestep;
1660  wt->win = win;
1663 
1664  BLI_addtail(&wm->timers, wt);
1665 
1666  return wt;
1667 }
1668 
1670 {
1671  /* extra security check */
1672  wmTimer *wt = NULL;
1673  LISTBASE_FOREACH (wmTimer *, timer_iter, &wm->timers) {
1674  if (timer_iter == timer) {
1675  wt = timer_iter;
1676  }
1677  }
1678  if (wt == NULL) {
1679  return;
1680  }
1681 
1682  if (wm->reports.reporttimer == wt) {
1683  wm->reports.reporttimer = NULL;
1684  }
1685 
1686  BLI_remlink(&wm->timers, wt);
1687  if (wt->customdata != NULL && (wt->flags & WM_TIMER_NO_FREE_CUSTOM_DATA) == 0) {
1688  MEM_freeN(wt->customdata);
1689  }
1690  MEM_freeN(wt);
1691 
1692  /* there might be events in queue with this timer as customdata */
1693  LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
1694  LISTBASE_FOREACH (wmEvent *, event, &win->event_queue) {
1695  if (event->customdata == wt) {
1696  event->customdata = NULL;
1697  event->type = EVENT_NONE; /* Timer users customdata, don't want `NULL == NULL`. */
1698  }
1699  }
1700  }
1701 }
1702 
1704 {
1705  timer->customdata = NULL;
1706  WM_event_remove_timer(wm, win, timer);
1707 }
1708 
1711 /* -------------------------------------------------------------------- */
1715 static char *wm_clipboard_text_get_ex(bool selection, int *r_len, bool firstline)
1716 {
1717  if (G.background) {
1718  *r_len = 0;
1719  return NULL;
1720  }
1721 
1722  char *buf = (char *)GHOST_getClipboard(selection);
1723  if (!buf) {
1724  *r_len = 0;
1725  return NULL;
1726  }
1727 
1728  /* always convert from \r\n to \n */
1729  char *newbuf = MEM_mallocN(strlen(buf) + 1, __func__);
1730  char *p2 = newbuf;
1731 
1732  if (firstline) {
1733  /* will return an over-alloc'ed value in the case there are newlines */
1734  for (char *p = buf; *p; p++) {
1735  if (!ELEM(*p, '\n', '\r')) {
1736  *(p2++) = *p;
1737  }
1738  else {
1739  break;
1740  }
1741  }
1742  }
1743  else {
1744  for (char *p = buf; *p; p++) {
1745  if (*p != '\r') {
1746  *(p2++) = *p;
1747  }
1748  }
1749  }
1750 
1751  *p2 = '\0';
1752 
1753  free(buf); /* ghost uses regular malloc */
1754 
1755  *r_len = (p2 - newbuf);
1756 
1757  return newbuf;
1758 }
1759 
1765 char *WM_clipboard_text_get(bool selection, int *r_len)
1766 {
1767  return wm_clipboard_text_get_ex(selection, r_len, false);
1768 }
1769 
1773 char *WM_clipboard_text_get_firstline(bool selection, int *r_len)
1774 {
1775  return wm_clipboard_text_get_ex(selection, r_len, true);
1776 }
1777 
1778 void WM_clipboard_text_set(const char *buf, bool selection)
1779 {
1780  if (!G.background) {
1781 #ifdef _WIN32
1782  /* do conversion from \n to \r\n on Windows */
1783  const char *p;
1784  char *p2, *newbuf;
1785  int newlen = 0;
1786 
1787  for (p = buf; *p; p++) {
1788  if (*p == '\n') {
1789  newlen += 2;
1790  }
1791  else {
1792  newlen++;
1793  }
1794  }
1795 
1796  newbuf = MEM_callocN(newlen + 1, "WM_clipboard_text_set");
1797 
1798  for (p = buf, p2 = newbuf; *p; p++, p2++) {
1799  if (*p == '\n') {
1800  *(p2++) = '\r';
1801  *p2 = '\n';
1802  }
1803  else {
1804  *p2 = *p;
1805  }
1806  }
1807  *p2 = '\0';
1808 
1809  GHOST_putClipboard((GHOST_TInt8 *)newbuf, selection);
1810  MEM_freeN(newbuf);
1811 #else
1812  GHOST_putClipboard((GHOST_TInt8 *)buf, selection);
1813 #endif
1814  }
1815 }
1816 
1819 /* -------------------------------------------------------------------- */
1823 void WM_progress_set(wmWindow *win, float progress)
1824 {
1825  /* In background mode we may have windows, but not actual GHOST windows. */
1826  if (win->ghostwin) {
1827  GHOST_SetProgressBar(win->ghostwin, progress);
1828  }
1829 }
1830 
1832 {
1833  if (win->ghostwin) {
1835  }
1836 }
1837 
1840 /* -------------------------------------------------------------------- */
1844 void wm_window_get_position(wmWindow *win, int *r_pos_x, int *r_pos_y)
1845 {
1846  *r_pos_x = win->posx;
1847  *r_pos_y = win->posy;
1848 }
1849 
1851 {
1853 }
1854 
1857 /* -------------------------------------------------------------------- */
1862 {
1864 }
1865 
1867 {
1868  /* Restore window if minimized */
1871  }
1873 }
1874 
1877 /* -------------------------------------------------------------------- */
1885 {
1887 }
1888 
1889 void wm_window_set_swap_interval(wmWindow *win, int interval)
1890 {
1891  GHOST_SetSwapInterval(win->ghostwin, interval);
1892 }
1893 
1894 bool wm_window_get_swap_interval(wmWindow *win, int *intervalOut)
1895 {
1896  return GHOST_GetSwapInterval(win->ghostwin, intervalOut);
1897 }
1898 
1901 /* -------------------------------------------------------------------- */
1904 static void wm_window_desktop_pos_get(const wmWindow *win,
1905  const int screen_pos[2],
1906  int r_desk_pos[2])
1907 {
1908  /* To desktop space. */
1909  r_desk_pos[0] = screen_pos[0] + (int)(U.pixelsize * win->posx);
1910  r_desk_pos[1] = screen_pos[1] + (int)(U.pixelsize * win->posy);
1911 }
1912 
1913 static void wm_window_screen_pos_get(const wmWindow *win,
1914  const int desktop_pos[2],
1915  int r_scr_pos[2])
1916 {
1917  /* To window space. */
1918  r_scr_pos[0] = desktop_pos[0] - (int)(U.pixelsize * win->posx);
1919  r_scr_pos[1] = desktop_pos[1] - (int)(U.pixelsize * win->posy);
1920 }
1921 
1923  const wmWindow *win_ignore,
1924  const wmWindow *win,
1925  const int mval[2],
1926  wmWindow **r_win,
1927  int r_mval[2])
1928 {
1929  int desk_pos[2];
1930  wm_window_desktop_pos_get(win, mval, desk_pos);
1931 
1932  /* TODO: This should follow the order of the activated windows.
1933  * The current solution is imperfect but usable in most cases. */
1934  LISTBASE_FOREACH (wmWindow *, win_iter, &wm->windows) {
1935  if (win_iter == win_ignore) {
1936  continue;
1937  }
1938 
1939  if (win_iter->windowstate == GHOST_kWindowStateMinimized) {
1940  continue;
1941  }
1942 
1943  int scr_pos[2];
1944  wm_window_screen_pos_get(win_iter, desk_pos, scr_pos);
1945 
1946  if (scr_pos[0] >= 0 && scr_pos[1] >= 0 && scr_pos[0] <= WM_window_pixels_x(win_iter) &&
1947  scr_pos[1] <= WM_window_pixels_y(win_iter)) {
1948 
1949  *r_win = win_iter;
1950  copy_v2_v2_int(r_mval, scr_pos);
1951  return true;
1952  }
1953  }
1954 
1955  return false;
1956 }
1957 
1959  const wmWindow *win,
1960  const int pos[2],
1961  float r_col[3])
1962 {
1963  bool setup_context = wm->windrawable != win;
1964 
1965  if (setup_context) {
1968  }
1969 
1970  GPU_frontbuffer_read_pixels(pos[0], pos[1], 1, 1, 3, GPU_DATA_FLOAT, r_col);
1971 
1972  if (setup_context) {
1973  if (wm->windrawable) {
1976  }
1977  }
1978 }
1979 
1982 /* -------------------------------------------------------------------- */
1990 {
1991  bool setup_context = wm->windrawable != win;
1992 
1993  if (setup_context) {
1996  }
1997 
1998  r_size[0] = WM_window_pixels_x(win);
1999  r_size[1] = WM_window_pixels_y(win);
2000  const uint rect_len = r_size[0] * r_size[1];
2001  uint *rect = MEM_mallocN(sizeof(*rect) * rect_len, __func__);
2002 
2003  GPU_frontbuffer_read_pixels(0, 0, r_size[0], r_size[1], 4, GPU_DATA_UBYTE, rect);
2004 
2005  if (setup_context) {
2006  if (wm->windrawable) {
2009  }
2010  }
2011 
2012  /* Clear alpha, it is not set to a meaningful value in OpenGL. */
2013  uchar *cp = (uchar *)rect;
2014  uint i;
2015  for (i = 0, cp += 3; i < rect_len; i++, cp += 4) {
2016  *cp = 0xff;
2017  }
2018  return (uint *)rect;
2019 }
2020 
2023 /* -------------------------------------------------------------------- */
2027 /* called whem no ghost system was initialized */
2028 void WM_init_state_size_set(int stax, int stay, int sizx, int sizy)
2029 {
2030  wm_init_state.start_x = stax; /* left hand pos */
2031  wm_init_state.start_y = stay; /* bottom pos */
2032  wm_init_state.size_x = sizx < 640 ? 640 : sizx;
2033  wm_init_state.size_y = sizy < 480 ? 480 : sizy;
2035 }
2036 
2037 /* for borderless and border windows set from command-line */
2039 {
2042 }
2043 
2045 {
2048 }
2049 
2051 {
2054 }
2055 
2057 {
2058  wm_init_state.window_focus = do_it;
2059 }
2060 
2061 void WM_init_native_pixels(bool do_it)
2062 {
2063  wm_init_state.native_pixels = do_it;
2064 }
2065 
2068 /* -------------------------------------------------------------------- */
2073 {
2074  if (g_system) {
2075  switch (U.tablet_api) {
2076  case USER_TABLET_NATIVE:
2078  break;
2079  case USER_TABLET_WINTAB:
2081  break;
2082  case USER_TABLET_AUTOMATIC:
2083  default:
2085  break;
2086  }
2087  }
2088 }
2089 
2090 /* This function requires access to the GHOST_SystemHandle (g_system) */
2091 void WM_cursor_warp(wmWindow *win, int x, int y)
2092 {
2093  if (win && win->ghostwin) {
2094  int oldx = x, oldy = y;
2095 
2096  wm_cursor_position_to_ghost(win, &x, &y);
2098 
2099  win->eventstate->prevx = oldx;
2100  win->eventstate->prevy = oldy;
2101 
2102  win->eventstate->x = oldx;
2103  win->eventstate->y = oldy;
2104  }
2105 }
2106 
2110 void WM_cursor_compatible_xy(wmWindow *win, int *x, int *y)
2111 {
2112  float f = GHOST_GetNativePixelSize(win->ghostwin);
2113  if (f != 1.0f) {
2114  *x = (int)(*x / f) * f;
2115  *y = (int)(*y / f) * f;
2116  }
2117 }
2118 
2121 /* -------------------------------------------------------------------- */
2131 {
2132  float f = GHOST_GetNativePixelSize(win->ghostwin);
2133 
2134  return (int)(f * (float)win->sizex);
2135 }
2137 {
2138  float f = GHOST_GetNativePixelSize(win->ghostwin);
2139 
2140  return (int)(f * (float)win->sizey);
2141 }
2142 
2146 void WM_window_rect_calc(const wmWindow *win, rcti *r_rect)
2147 {
2148  BLI_rcti_init(r_rect, 0, WM_window_pixels_x(win), 0, WM_window_pixels_y(win));
2149 }
2154 void WM_window_screen_rect_calc(const wmWindow *win, rcti *r_rect)
2155 {
2156  rcti window_rect, screen_rect;
2157 
2158  WM_window_rect_calc(win, &window_rect);
2159  screen_rect = window_rect;
2160 
2161  /* Subtract global areas from screen rectangle. */
2162  LISTBASE_FOREACH (ScrArea *, global_area, &win->global_areas.areabase) {
2163  int height = ED_area_global_size_y(global_area) - 1;
2164 
2165  if (global_area->global->flag & GLOBAL_AREA_IS_HIDDEN) {
2166  continue;
2167  }
2168 
2169  switch (global_area->global->align) {
2170  case GLOBAL_AREA_ALIGN_TOP:
2171  screen_rect.ymax -= height;
2172  break;
2174  screen_rect.ymin += height;
2175  break;
2176  default:
2178  break;
2179  }
2180  }
2181 
2182  BLI_assert(BLI_rcti_is_valid(&screen_rect));
2183 
2184  *r_rect = screen_rect;
2185 }
2186 
2188 {
2190 }
2191 
2193 {
2195 }
2196 
2199 /* -------------------------------------------------------------------- */
2209 {
2210  LISTBASE_FOREACH (wmWindow *, win, win_lb) {
2211  if (WM_window_get_active_scene(win) == scene) {
2212  ED_workspace_scene_data_sync(win->workspace_hook, scene);
2213  }
2214  }
2215 }
2216 
2218 {
2219  LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
2220  if (WM_window_get_active_screen(win) == screen) {
2221  return WM_window_get_active_scene(win);
2222  }
2223  }
2224 
2225  return NULL;
2226 }
2227 
2229 {
2230  LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
2231  if (WM_window_get_active_screen(win) == screen) {
2232  return WM_window_get_active_view_layer(win);
2233  }
2234  }
2235 
2236  return NULL;
2237 }
2238 
2240 {
2241  LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
2242  if (WM_window_get_active_screen(win) == screen) {
2243  return WM_window_get_active_workspace(win);
2244  }
2245  }
2246  return NULL;
2247 }
2248 
2250 {
2251  return win->scene;
2252 }
2253 
2258 {
2260  wmWindow *win_parent = (win->parent) ? win->parent : win;
2261  bool changed = false;
2262 
2263  /* Set scene in parent and its child windows. */
2264  if (win_parent->scene != scene) {
2265  ED_screen_scene_change(C, win_parent, scene);
2266  changed = true;
2267  }
2268 
2269  LISTBASE_FOREACH (wmWindow *, win_child, &wm->windows) {
2270  if (win_child->parent == win_parent && win_child->scene != scene) {
2271  ED_screen_scene_change(C, win_child, scene);
2272  changed = true;
2273  }
2274  }
2275 
2276  if (changed) {
2277  /* Update depsgraph and renderers for scene change. */
2278  ViewLayer *view_layer = WM_window_get_active_view_layer(win_parent);
2279  ED_scene_change_update(bmain, scene, view_layer);
2280 
2281  /* Complete redraw. */
2283  }
2284 }
2285 
2287 {
2289  if (scene == NULL) {
2290  return NULL;
2291  }
2292 
2293  ViewLayer *view_layer = BKE_view_layer_find(scene, win->view_layer_name);
2294  if (view_layer) {
2295  return view_layer;
2296  }
2297 
2298  view_layer = BKE_view_layer_default_view(scene);
2299  if (view_layer) {
2300  WM_window_set_active_view_layer((wmWindow *)win, view_layer);
2301  }
2302 
2303  return view_layer;
2304 }
2305 
2307 {
2309  Main *bmain = G_MAIN;
2310 
2311  wmWindowManager *wm = bmain->wm.first;
2312  wmWindow *win_parent = (win->parent) ? win->parent : win;
2313 
2314  /* Set view layer in parent and child windows. */
2315  LISTBASE_FOREACH (wmWindow *, win_iter, &wm->windows) {
2316  if ((win_iter == win_parent) || (win_iter->parent == win_parent)) {
2317  STRNCPY(win_iter->view_layer_name, view_layer->name);
2318  bScreen *screen = BKE_workspace_active_screen_get(win_iter->workspace_hook);
2319  ED_render_view_layer_changed(bmain, screen);
2320  }
2321  }
2322 }
2323 
2325 {
2326  /* Update layer name is correct after scene changes, load without UI, etc. */
2328 
2329  if (scene && BKE_view_layer_find(scene, win->view_layer_name) == NULL) {
2331  STRNCPY(win->view_layer_name, view_layer->name);
2332  }
2333 }
2334 
2336 {
2338 }
2339 
2341 {
2343  wmWindow *win_parent = (win->parent) ? win->parent : win;
2344 
2345  ED_workspace_change(workspace, C, wm, win);
2346 
2347  LISTBASE_FOREACH (wmWindow *, win_child, &wm->windows) {
2348  if (win_child->parent == win_parent) {
2349  bScreen *screen = WM_window_get_active_screen(win_child);
2350  /* Don't change temporary screens, they only serve a single purpose. */
2351  if (screen->temp) {
2352  continue;
2353  }
2354  ED_workspace_change(workspace, C, wm, win_child);
2355  }
2356  }
2357 }
2358 
2360 {
2361  const WorkSpace *workspace = WM_window_get_active_workspace(win);
2362  return (LIKELY(workspace != NULL) ? BKE_workspace_active_layout_get(win->workspace_hook) : NULL);
2363 }
2365 {
2366  BKE_workspace_active_layout_set(win->workspace_hook, win->winid, workspace, layout);
2367 }
2368 
2373 {
2374  const WorkSpace *workspace = WM_window_get_active_workspace(win);
2375  /* May be NULL in rare cases like closing Blender */
2376  return (LIKELY(workspace != NULL) ? BKE_workspace_active_screen_get(win->workspace_hook) : NULL);
2377 }
2379 {
2380  BKE_workspace_active_screen_set(win->workspace_hook, win->winid, workspace, screen);
2381 }
2382 
2384 {
2385  const bScreen *screen = WM_window_get_active_screen(win);
2386  return (screen && screen->temp != 0);
2387 }
2388 
2391 /* -------------------------------------------------------------------- */
2395 #ifdef WITH_INPUT_IME
2399 void wm_window_IME_begin(wmWindow *win, int x, int y, int w, int h, bool complete)
2400 {
2401  BLI_assert(win);
2402 
2403  GHOST_BeginIME(win->ghostwin, x, win->sizey - y, w, h, complete);
2404 }
2405 
2406 void wm_window_IME_end(wmWindow *win)
2407 {
2408  BLI_assert(win && win->ime_data);
2409 
2410  GHOST_EndIME(win->ghostwin);
2411  win->ime_data = NULL;
2412 }
2413 #endif /* WITH_INPUT_IME */
2414 
2417 /* -------------------------------------------------------------------- */
2422 {
2423  /* On Windows there is a problem creating contexts that share lists
2424  * from one context that is current in another thread.
2425  * So we should call this function only on the main thread.
2426  */
2429 
2430  GHOST_GLSettings glSettings = {0};
2431  if (G.debug & G_DEBUG_GPU) {
2432  glSettings.flags |= GHOST_glDebugContext;
2433  }
2434  return GHOST_CreateOpenGLContext(g_system, glSettings);
2435 }
2436 
2438 {
2440  GHOST_DisposeOpenGLContext(g_system, (GHOST_ContextHandle)context);
2441 }
2442 
2444 {
2446  GHOST_ActivateOpenGLContext((GHOST_ContextHandle)context);
2447 }
2448 
2450 {
2452  GHOST_ReleaseOpenGLContext((GHOST_ContextHandle)context);
2453 }
2454 
2455 void WM_ghost_show_message_box(const char *title,
2456  const char *message,
2457  const char *help_label,
2458  const char *continue_label,
2459  const char *link,
2460  GHOST_DialogOptions dialog_options)
2461 {
2463  GHOST_ShowMessageBox(g_system, title, message, help_label, continue_label, link, dialog_options);
2464 }
typedef float(TangentPoint)[2]
struct Scene * CTX_data_scene(const bContext *C)
Definition: context.c:1034
struct wmWindowManager * CTX_wm_manager(const bContext *C)
Definition: context.c:689
struct ViewLayer * CTX_data_view_layer(const bContext *C)
Definition: context.c:1044
struct bScreen * CTX_wm_screen(const bContext *C)
Definition: context.c:709
void CTX_wm_window_set(bContext *C, struct wmWindow *win)
Definition: context.c:942
void CTX_wm_area_set(bContext *C, struct ScrArea *area)
Definition: context.c:973
struct Main * CTX_data_main(const bContext *C)
Definition: context.c:1018
struct wmWindow * CTX_wm_window(const bContext *C)
Definition: context.c:699
#define G_MAIN
Definition: BKE_global.h:232
@ G_DEBUG_GPU
Definition: BKE_global.h:151
@ G_DEBUG_GHOST
Definition: BKE_global.h:157
@ G_DEBUG_EVENTS
Definition: BKE_global.h:136
@ G_FLAG_EVENT_SIMULATE
Definition: BKE_global.h:113
void BKE_icon_changed(const int icon_id)
Definition: icons.cc:678
struct ViewLayer * BKE_view_layer_default_view(const struct Scene *scene)
struct ViewLayer * BKE_view_layer_find(const struct Scene *scene, const char *layer_name)
const char * BKE_main_blendfile_path_from_global(void)
Definition: main.c:439
void BKE_screen_area_map_free(struct ScrAreaMap *area_map) ATTR_NONNULL()
Definition: screen.c:725
struct ScrArea struct ScrArea * BKE_screen_find_big_area(struct bScreen *screen, const int spacetype, const short min)
Definition: screen.c:983
void BKE_workspace_active_layout_set(struct WorkSpaceInstanceHook *hook, const int winid, struct WorkSpace *workspace, struct WorkSpaceLayout *layout) SETTER_ATTRS
Activate a layout.
Definition: workspace.c:594
void BKE_workspace_layout_remove(struct Main *bmain, struct WorkSpace *workspace, struct WorkSpaceLayout *layout) ATTR_NONNULL()
Definition: workspace.c:386
struct WorkSpaceInstanceHook * BKE_workspace_instance_hook_create(const struct Main *bmain, const int winid)
struct WorkSpace * BKE_workspace_active_get(struct WorkSpaceInstanceHook *hook) GETTER_ATTRS
Definition: workspace.c:535
void BKE_workspace_active_screen_set(struct WorkSpaceInstanceHook *hook, const int winid, struct WorkSpace *workspace, struct bScreen *screen) SETTER_ATTRS
Definition: workspace.c:607
void BKE_workspace_instance_hook_free(const struct Main *bmain, struct WorkSpaceInstanceHook *hook)
struct bScreen * BKE_workspace_active_screen_get(const struct WorkSpaceInstanceHook *hook) GETTER_ATTRS
void BKE_workspace_active_set(struct WorkSpaceInstanceHook *hook, struct WorkSpace *workspace) SETTER_ATTRS
Definition: workspace.c:539
struct WorkSpaceLayout * BKE_workspace_active_layout_get(const struct WorkSpaceInstanceHook *hook) GETTER_ATTRS
struct bScreen * BKE_workspace_layout_screen_get(const struct WorkSpaceLayout *layout) GETTER_ATTRS
void BLF_cache_clear(void)
Definition: blf.c:105
void BLF_default_dpi(int dpi)
Definition: blf_default.c:43
#define BLI_assert_unreachable()
Definition: BLI_assert.h:96
#define BLI_assert(a)
Definition: BLI_assert.h:58
void BLI_kdtree_nd_() free(KDTree *tree)
Definition: kdtree_impl.h:116
#define LISTBASE_FOREACH(type, var, list)
Definition: BLI_listbase.h:172
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
Definition: BLI_listbase.h:188
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:110
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:133
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])
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
Definition: BLI_rect.h:157
bool BLI_rcti_is_valid(const struct rcti *rect)
void BLI_rcti_init(struct rcti *rect, int xmin, int xmax, int ymin, int ymax)
Definition: rct.c:446
void BLI_rcti_resize_y(struct rcti *rect, int y)
Definition: rct.c:632
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
Definition: BLI_rect.h:153
void BLI_rcti_resize_x(struct rcti *rect, int x)
Definition: rct.c:626
#define STRNCPY(dst, src)
Definition: BLI_string.h:163
size_t BLI_snprintf(char *__restrict dst, size_t maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
unsigned char uchar
Definition: BLI_sys_types.h:86
unsigned int uint
Definition: BLI_sys_types.h:83
int BLI_thread_is_main(void)
Definition: threads.cc:234
#define POINTER_AS_UINT(i)
#define UNUSED(x)
#define UNLIKELY(x)
#define ELEM(...)
#define POINTER_FROM_UINT(i)
#define STREQ(a, b)
#define LIKELY(x)
#define IFACE_(msgid)
These structs are the foundation for all linked lists in the library system.
@ S3D_DISPLAY_PAGEFLIP
@ GLOBAL_AREA_IS_HIDDEN
@ GLOBAL_AREA_ALIGN_BOTTOM
@ GLOBAL_AREA_ALIGN_TOP
@ SPACE_EMPTY
#define SPACE_TYPE_ANY
@ USER_SAVE_PROMPT
@ USER_TABLET_NATIVE
@ USER_TABLET_AUTOMATIC
@ USER_TABLET_WINTAB
@ VIRTUAL_PIXEL_NATIVE
@ VIRTUAL_PIXEL_DOUBLE
@ OPERATOR_CANCELLED
@ OPERATOR_FINISHED
@ WM_WINDOW_IS_INIT
int ED_file_extension_icon(const char *path)
Definition: filelist.c:2567
void ED_render_view_layer_changed(struct Main *bmain, struct bScreen *screen)
void ED_scene_change_update(struct Main *bmain, struct Scene *scene, struct ViewLayer *layer) ATTR_NONNULL()
Definition: scene_edit.c:117
void ED_screen_exit(struct bContext *C, struct wmWindow *window, struct bScreen *screen)
Definition: screen_edit.c:625
void ED_workspace_scene_data_sync(struct WorkSpaceInstanceHook *hook, Scene *scene) ATTR_NONNULL()
int ED_area_global_size_y(const ScrArea *area)
Definition: area.c:3377
struct WorkSpaceLayout * ED_workspace_layout_add(struct Main *bmain, struct WorkSpace *workspace, struct wmWindow *win, const char *name) ATTR_NONNULL()
void ED_area_newspace(struct bContext *C, ScrArea *area, int type, const bool skip_region_exit)
Definition: area.c:2375
struct WorkSpaceLayout * ED_workspace_layout_duplicate(struct Main *bmain, struct WorkSpace *workspace, const struct WorkSpaceLayout *layout_old, struct wmWindow *win) ATTR_NONNULL()
bool ED_workspace_change(struct WorkSpace *workspace_new, struct bContext *C, struct wmWindowManager *wm, struct wmWindow *win) ATTR_NONNULL()
Change the active workspace.
void ED_screen_refresh(struct wmWindowManager *wm, struct wmWindow *win)
Definition: screen_edit.c:496
void ED_screen_scene_change(struct bContext *C, struct wmWindow *win, struct Scene *scene)
Definition: screen_edit.c:1099
void ED_screen_global_areas_refresh(struct wmWindow *win)
Definition: screen_edit.c:962
bool ED_screen_change(struct bContext *C, struct bScreen *screen)
Change the active screen.
Definition: screen_edit.c:1039
GHOST C-API function and type declarations.
int GHOST_ProcessEvents(GHOST_SystemHandle systemhandle, int waitForEvent)
GHOST_TWindowState GHOST_GetWindowState(GHOST_WindowHandle windowhandle)
char * GHOST_GetTitle(GHOST_WindowHandle windowhandle)
void GHOST_UseWindowFocus(int use_focus)
GHOST_TSuccess GHOST_SetWindowOrder(GHOST_WindowHandle windowhandle, GHOST_TWindowOrder order)
GHOST_TUserDataPtr GHOST_GetWindowUserData(GHOST_WindowHandle windowhandle)
void GHOST_GetAllDisplayDimensions(GHOST_SystemHandle systemhandle, GHOST_TUns32 *width, GHOST_TUns32 *height)
GHOST_TInt32 GHOST_GetHeightRectangle(GHOST_RectangleHandle rectanglehandle)
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)
Definition: GHOST_C-api.cpp:62
void GHOST_ScreenToClient(GHOST_WindowHandle windowhandle, GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32 *outX, GHOST_TInt32 *outY)
GHOST_TUns16 GHOST_GetDPIHint(GHOST_WindowHandle windowhandle)
void GHOST_putClipboard(GHOST_TInt8 *buffer, int selection)
GHOST_SystemHandle GHOST_CreateSystem(void)
Definition: GHOST_C-api.cpp:40
GHOST_TSuccess GHOST_AddEventConsumer(GHOST_SystemHandle systemhandle, GHOST_EventConsumerHandle consumerhandle)
int GHOST_UseNativePixels(void)
void GHOST_SetWindowUserData(GHOST_WindowHandle windowhandle, GHOST_TUserDataPtr userdata)
GHOST_WindowHandle GHOST_CreateWindow(GHOST_SystemHandle systemhandle, GHOST_WindowHandle parent_windowhandle, const char *title, GHOST_TInt32 left, GHOST_TInt32 top, GHOST_TUns32 width, GHOST_TUns32 height, GHOST_TWindowState state, bool is_dialog, GHOST_TDrawingContextType type, GHOST_GLSettings glSettings)
GHOST_TSuccess GHOST_SetClientSize(GHOST_WindowHandle windowhandle, GHOST_TUns32 width, GHOST_TUns32 height)
void GHOST_DisposeRectangle(GHOST_RectangleHandle rectanglehandle)
void GHOST_SetTitle(GHOST_WindowHandle windowhandle, const char *title)
int GHOST_IsDialogWindow(GHOST_WindowHandle windowhandle)
GHOST_TSuccess GHOST_SetProgressBar(GHOST_WindowHandle windowhandle, float progress)
GHOST_TSuccess GHOST_ReleaseOpenGLContext(GHOST_ContextHandle contexthandle)
void GHOST_SystemInitDebug(GHOST_SystemHandle systemhandle, int is_debug_enabled)
Definition: GHOST_C-api.cpp:48
void GHOST_GetRectangle(GHOST_RectangleHandle rectanglehandle, GHOST_TInt32 *l, GHOST_TInt32 *t, GHOST_TInt32 *r, GHOST_TInt32 *b)
GHOST_TSuccess GHOST_DisposeWindow(GHOST_SystemHandle systemhandle, GHOST_WindowHandle windowhandle)
GHOST_TSuccess GHOST_GetSwapInterval(GHOST_WindowHandle windowhandle, int *intervalOut)
void GHOST_BeginIME(GHOST_WindowHandle windowhandle, GHOST_TInt32 x, GHOST_TInt32 y, GHOST_TInt32 w, GHOST_TInt32 h, int complete)
GHOST_TSuccess GHOST_DisposeOpenGLContext(GHOST_SystemHandle systemhandle, GHOST_ContextHandle contexthandle)
GHOST_TSuccess GHOST_SetWindowState(GHOST_WindowHandle windowhandle, GHOST_TWindowState state)
GHOST_TSuccess GHOST_ActivateOpenGLContext(GHOST_ContextHandle contexthandle)
GHOST_TUns8 * GHOST_getClipboard(int selection)
void GHOST_SetTabletAPI(GHOST_SystemHandle systemhandle, GHOST_TTabletAPI api)
GHOST_TSuccess GHOST_SetCursorPosition(GHOST_SystemHandle systemhandle, GHOST_TInt32 x, GHOST_TInt32 y)
GHOST_TInt32 GHOST_GetWidthRectangle(GHOST_RectangleHandle rectanglehandle)
GHOST_TSuccess GHOST_SwapWindowBuffers(GHOST_WindowHandle windowhandle)
GHOST_TSuccess GHOST_GetCursorPosition(GHOST_SystemHandle systemhandle, GHOST_TInt32 *x, GHOST_TInt32 *y)
GHOST_TEventDataPtr GHOST_GetEventData(GHOST_EventHandle eventhandle)
GHOST_TSuccess GHOST_ActivateWindowDrawingContext(GHOST_WindowHandle windowhandle)
GHOST_TSuccess GHOST_GetModifierKeyState(GHOST_SystemHandle systemhandle, GHOST_TModifierKeyMask mask, int *isDown)
float GHOST_GetNativePixelSize(GHOST_WindowHandle windowhandle)
GHOST_TEventType GHOST_GetEventType(GHOST_EventHandle eventhandle)
void GHOST_ClientToScreen(GHOST_WindowHandle windowhandle, GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32 *outX, GHOST_TInt32 *outY)
GHOST_WindowHandle GHOST_GetEventWindow(GHOST_EventHandle eventhandle)
void GHOST_EndIME(GHOST_WindowHandle windowhandle)
void GHOST_DispatchEvents(GHOST_SystemHandle systemhandle)
GHOST_ContextHandle GHOST_CreateOpenGLContext(GHOST_SystemHandle systemhandle, GHOST_GLSettings glSettings)
void GHOST_GetMainDisplayDimensions(GHOST_SystemHandle systemhandle, GHOST_TUns32 *width, GHOST_TUns32 *height)
GHOST_TSuccess GHOST_SetWindowModifiedState(GHOST_WindowHandle windowhandle, GHOST_TUns8 isUnsavedChanges)
GHOST_TSuccess GHOST_EndProgressBar(GHOST_WindowHandle windowhandle)
GHOST_EventConsumerHandle GHOST_CreateEventConsumer(GHOST_EventCallbackProcPtr eventCallback, GHOST_TUserDataPtr userdata)
Definition: GHOST_C-api.cpp:74
GHOST_TSuccess GHOST_SetSwapInterval(GHOST_WindowHandle windowhandle, int interval)
GHOST_TUns64 GHOST_GetEventTime(GHOST_EventHandle eventhandle)
GHOST_RectangleHandle GHOST_GetClientBounds(GHOST_WindowHandle windowhandle)
GHOST_TSuccess GHOST_DisposeSystem(GHOST_SystemHandle systemhandle)
Definition: GHOST_C-api.cpp:55
int GHOST_ValidWindow(GHOST_SystemHandle systemhandle, GHOST_WindowHandle windowhandle)
GHOST_TWindowState
Definition: GHOST_Types.h:144
@ GHOST_kWindowStateMinimized
Definition: GHOST_Types.h:147
@ GHOST_kWindowStateMaximized
Definition: GHOST_Types.h:146
@ GHOST_kWindowStateNormal
Definition: GHOST_Types.h:145
@ GHOST_kWindowStateFullScreen
Definition: GHOST_Types.h:148
void * GHOST_TUserDataPtr
Definition: GHOST_Types.h:89
GHOST_TEventType
Definition: GHOST_Types.h:177
@ GHOST_kEventWindowClose
Definition: GHOST_Types.h:197
@ GHOST_kEventWindowMove
Definition: GHOST_Types.h:202
@ GHOST_kEventWindowSize
Definition: GHOST_Types.h:201
@ GHOST_kEventDraggingDropDone
Definition: GHOST_Types.h:208
@ GHOST_kEventNativeResolutionChange
Definition: GHOST_Types.h:211
@ GHOST_kEventCursorMove
Definition: GHOST_Types.h:180
@ GHOST_kEventOpenMainFile
Definition: GHOST_Types.h:210
@ GHOST_kEventButtonUp
Mouse button event.
Definition: GHOST_Types.h:182
@ GHOST_kEventWindowActivate
Definition: GHOST_Types.h:198
@ GHOST_kEventTrackpad
Mouse wheel event.
Definition: GHOST_Types.h:184
@ GHOST_kEventWindowUpdate
Definition: GHOST_Types.h:200
@ GHOST_kEventWindowDeactivate
Definition: GHOST_Types.h:199
@ GHOST_kEventButtonDown
Mouse move event.
Definition: GHOST_Types.h:181
@ GHOST_kEventWindowDPIHintChanged
Definition: GHOST_Types.h:203
@ GHOST_kEventKeyUp
Definition: GHOST_Types.h:192
@ GHOST_kEventQuitRequest
Definition: GHOST_Types.h:195
@ GHOST_glStereoVisual
Definition: GHOST_Types.h:71
@ GHOST_glDebugContext
Definition: GHOST_Types.h:72
void * GHOST_TEventDataPtr
Definition: GHOST_Types.h:430
@ GHOST_kKeyLeftAlt
Definition: GHOST_Types.h:336
@ GHOST_kKeyLeftControl
Definition: GHOST_Types.h:334
@ GHOST_kKeyOS
Definition: GHOST_Types.h:338
@ GHOST_kKeyLeftShift
Definition: GHOST_Types.h:332
@ GHOST_kDrawingContextTypeOpenGL
Definition: GHOST_Types.h:158
char GHOST_TInt8
Definition: GHOST_Types.h:59
@ GHOST_kWindowOrderTop
Definition: GHOST_Types.h:154
@ GHOST_kWindowOrderBottom
Definition: GHOST_Types.h:154
GHOST_TModifierKeyMask
Definition: GHOST_Types.h:133
@ GHOST_kModifierKeyRightControl
Definition: GHOST_Types.h:139
@ GHOST_kModifierKeyLeftControl
Definition: GHOST_Types.h:138
@ GHOST_kModifierKeyRightAlt
Definition: GHOST_Types.h:137
@ GHOST_kModifierKeyOS
Definition: GHOST_Types.h:140
@ GHOST_kModifierKeyRightShift
Definition: GHOST_Types.h:135
@ GHOST_kModifierKeyLeftAlt
Definition: GHOST_Types.h:136
@ GHOST_kModifierKeyLeftShift
Definition: GHOST_Types.h:134
@ GHOST_kDragnDropTypeFilenames
Definition: GHOST_Types.h:479
unsigned char GHOST_TUns8
Definition: GHOST_Types.h:60
@ GHOST_kTabletNative
Definition: GHOST_Types.h:108
@ GHOST_kTabletAutomatic
Definition: GHOST_Types.h:107
@ GHOST_kTabletWintab
Definition: GHOST_Types.h:109
GHOST_DialogOptions
Definition: GHOST_Types.h:76
void GPU_context_discard(GPUContext *)
Definition: gpu_context.cc:113
GPUContext * GPU_context_create(void *ghost_window)
Definition: gpu_context.cc:99
void GPU_context_active_set(GPUContext *)
Definition: gpu_context.cc:121
GPUFrameBuffer * GPU_framebuffer_back_get(void)
GPUFrameBuffer * GPU_framebuffer_active_get(void)
void GPU_init(void)
Definition: gpu_init_exit.c:43
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble GLdouble r _GL_VOID_RET _GL_VOID GLfloat GLfloat r _GL_VOID_RET _GL_VOID GLint GLint r _GL_VOID_RET _GL_VOID GLshort GLshort r _GL_VOID_RET _GL_VOID GLdouble GLdouble r
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble right
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble t
@ GPU_DATA_UBYTE
Definition: GPU_texture.h:175
@ GPU_DATA_FLOAT
Definition: GPU_texture.h:172
Read Guarded memory(de)allocation.
Group RGB to Bright Vector Camera CLAMP
Platform independent time functions.
#define C
Definition: RandGen.cpp:39
void UI_popup_handlers_remove_all(struct bContext *C, struct ListBase *handlers)
WindowAlignment
Definition: WM_api.h:175
@ WIN_ALIGN_LOCATION_CENTER
Definition: WM_api.h:177
@ WIN_ALIGN_PARENT_CENTER
Definition: WM_api.h:178
#define NC_WINDOW
Definition: WM_types.h:277
#define WM_DRAG_PATH
Definition: WM_types.h:876
#define KM_SHIFT
Definition: WM_types.h:221
@ WM_OP_INVOKE_DEFAULT
Definition: WM_types.h:197
@ WM_DRAG_NOP
Definition: WM_types.h:883
#define NC_SCREEN
Definition: WM_types.h:278
#define NA_ADDED
Definition: WM_types.h:464
#define NA_EDITED
Definition: WM_types.h:462
#define KM_NOTHING
Definition: WM_types.h:241
#define KM_MOD_FIRST
Definition: WM_types.h:233
#define KM_CTRL
Definition: WM_types.h:222
@ WM_TIMER_NO_FREE_CUSTOM_DATA
Definition: WM_types.h:686
#define ND_LAYOUTDELETE
Definition: WM_types.h:322
#define KM_ALT
Definition: WM_types.h:223
#define KM_OSKEY
Definition: WM_types.h:224
#define KM_RELEASE
Definition: WM_types.h:243
ATTR_WARN_UNUSED_RESULT const BMLoop * l
void activate(bool forceActivation=false) const
static btDbvtVolume bounds(btDbvtNode **leaves, int count)
Definition: btDbvt.cpp:299
unsigned int U
Definition: btGjkEpa3.h:78
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition: btQuadWord.h:119
double time
Scene scene
void * user_data
#define str(s)
uint pos
void GPU_clear_color(float red, float green, float blue, float alpha)
void GPU_frontbuffer_read_pixels(int x, int y, int w, int h, int channels, eGPUDataFormat format, void *data)
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:41
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:45
void *(* MEM_mallocN)(size_t len, const char *str)
Definition: mallocn.c:47
static ulong state[N]
static int left
static unsigned a[3]
Definition: RandGen.cpp:92
static void area(int d1, int d2, int e1, int e2, float weights[2])
void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
Definition: rna_access.c:6550
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
Definition: rna_access.c:6272
struct SELECTID_Context context
Definition: select_engine.c:47
unsigned __int64 uint64_t
Definition: stdint.h:93
GHOST_TEventDataPtr data
Definition: GHOST_Types.h:492
GHOST_TDragnDropTypes dataType
Definition: GHOST_Types.h:490
GHOST_TUns8 ** strings
Definition: GHOST_Types.h:513
int icon_id
Definition: DNA_ID.h:294
void * first
Definition: DNA_listBase.h:47
Definition: BKE_main.h:116
ListBase wm
Definition: BKE_main.h:175
struct wmTimer * reporttimer
ListBase areabase
char name[64]
eWinOverrideFlag override_flag
Definition: wm_window.c:121
bool window_focus
Definition: wm_window.c:123
int windowstate
Definition: wm_window.c:120
bool native_pixels
Definition: wm_window.c:124
Wrapper for bScreen.
ListBase areabase
int ymin
Definition: DNA_vec_types.h:80
int ymax
Definition: DNA_vec_types.h:80
int xmin
Definition: DNA_vec_types.h:79
int xmax
Definition: DNA_vec_types.h:79
int y
Definition: WM_types.h:581
short shift
Definition: WM_types.h:618
short ctrl
Definition: WM_types.h:618
short oskey
Definition: WM_types.h:618
short keymodifier
Definition: WM_types.h:620
int prevy
Definition: WM_types.h:614
int x
Definition: WM_types.h:581
short alt
Definition: WM_types.h:618
int prevx
Definition: WM_types.h:614
void(* exec)(struct bContext *C, void *user_data)
Definition: WM_types.h:143
double timestep
Definition: WM_types.h:696
double stime
Definition: WM_types.h:714
int event_type
Definition: WM_types.h:698
double ltime
Definition: WM_types.h:710
wmTimerFlags flags
Definition: WM_types.h:700
void * customdata
Definition: WM_types.h:702
struct wmWindow * win
Definition: WM_types.h:693
double ntime
Definition: WM_types.h:712
struct wmKeyConfig * defaultconf
struct ReportList reports
struct wmWindow * windrawable
struct wmWindow * winactive
struct wmWindow * parent
struct wmEvent * eventstate
struct Scene * scene
struct wmIMEData * ime_data
char view_layer_name[64]
struct wmWindow * next
ScrAreaMap global_areas
struct WorkSpaceInstanceHook * workspace_hook
struct Stereo3dFormat * stereo3d_format
void PIL_sleep_ms(int ms)
Definition: time.c:100
double PIL_check_seconds_timer(void)
Definition: time.c:80
ccl_device_inline float3 ceil(const float3 &a)
#define G(x, y, z)
void WM_check(bContext *C)
Definition: wm.c:487
@ WM_CURSOR_DEFAULT
Definition: wm_cursors.h:34
ListBase * WM_dropboxmap_find(const char *idname, int spaceid, int regionid)
Definition: wm_dragdrop.c:77
wmDrag * WM_event_start_drag(struct bContext *C, int icon, int type, void *poin, double value, unsigned int flags)
Definition: wm_dragdrop.c:140
void wm_draw_update(bContext *C)
Definition: wm_draw.c:1033
wmEventHandler_Dropbox * WM_event_add_dropbox_handler(ListBase *handlers, ListBase *dropboxes)
void wm_event_do_handlers(bContext *C)
void WM_main_add_notifier(unsigned int type, void *reference)
wmEvent * wm_event_add(wmWindow *win, const wmEvent *event_to_add)
void WM_event_add_notifier_ex(wmWindowManager *wm, const wmWindow *win, uint type, void *reference)
void wm_event_free_all(wmWindow *win)
void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, void *customdata)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
wmEventHandler_Keymap * WM_event_add_keymap_handler(ListBase *handlers, wmKeyMap *keymap)
int WM_operator_name_call_ptr(bContext *C, wmOperatorType *ot, short context, PointerRNA *properties)
void wm_event_do_notifiers(bContext *C)
void wm_event_init_from_window(wmWindow *win, wmEvent *event)
void WM_event_remove_handlers(bContext *C, ListBase *handlers)
@ TIMERNOTIFIER
@ TIMERJOBS
@ TIMERAUTOSAVE
@ EVENT_NONE
@ MOUSEMOVE
@ EVT_DROP
@ EVT_DATA_DRAGDROP
@ EVT_DATA_TIMER
void wm_autosave_timer(Main *bmain, wmWindowManager *wm, wmTimer *UNUSED(wt))
Definition: wm_files.c:1708
bool wm_file_or_image_is_modified(const Main *bmain, const wmWindowManager *wm)
Definition: wm_files.c:168
wmOperatorType * ot
Definition: wm_files.c:3156
void wm_close_file_dialog(bContext *C, wmGenericCallback *post_action)
Definition: wm_files.c:3448
void WM_gestures_free_all(wmWindow *win)
Definition: wm_gesture.c:110
void wm_exit_schedule_delayed(const bContext *C)
Definition: wm_init_exit.c:457
void wm_jobs_timer_end(wmWindowManager *wm, wmTimer *wt)
Definition: wm_jobs.c:608
void wm_jobs_timer(wmWindowManager *wm, wmTimer *wt)
Definition: wm_jobs.c:619
wmKeyMap * WM_keymap_ensure(wmKeyConfig *keyconf, const char *idname, int spaceid, int regionid)
Definition: wm_keymap.c:852
wmOperatorType * WM_operatortype_find(const char *idname, bool quiet)
void WM_operator_properties_create_ptr(PointerRNA *ptr, wmOperatorType *ot)
Definition: wm_operators.c:584
void WM_operator_properties_free(PointerRNA *ptr)
Definition: wm_operators.c:711
modifierKeyType
Definition: wm_window.c:997
@ SHIFT
Definition: wm_window.c:998
@ OS
Definition: wm_window.c:1001
@ ALT
Definition: wm_window.c:1000
@ CONTROL
Definition: wm_window.c:999
eWinOverrideFlag
Definition: wm_window.c:104
@ WIN_OVERRIDE_WINSTATE
Definition: wm_window.c:106
@ WIN_OVERRIDE_GEOM
Definition: wm_window.c:105
static void wm_window_ghostwindow_ensure(wmWindowManager *wm, wmWindow *win, bool is_dialog)
Definition: wm_window.c:618
void WM_window_set_active_scene(Main *bmain, bContext *C, wmWindow *win, Scene *scene)
Definition: wm_window.c:2257
static void wm_window_screen_pos_get(const wmWindow *win, const int desktop_pos[2], int r_scr_pos[2])
Definition: wm_window.c:1913
int wm_window_new_exec(bContext *C, wmOperator *UNUSED(op))
Definition: wm_window.c:914
static GHOST_SystemHandle g_system
Definition: wm_window.c:102
int wm_window_close_exec(bContext *C, wmOperator *UNUSED(op))
Definition: wm_window.c:906
void WM_event_remove_timer(wmWindowManager *wm, wmWindow *UNUSED(win), wmTimer *timer)
Definition: wm_window.c:1669
void * WM_opengl_context_create(void)
Definition: wm_window.c:2421
void WM_clipboard_text_set(const char *buf, bool selection)
Definition: wm_window.c:1778
void wm_window_raise(wmWindow *win)
Definition: wm_window.c:1866
void WM_window_ensure_active_view_layer(wmWindow *win)
Definition: wm_window.c:2324
Scene * WM_windows_scene_get_from_screen(const wmWindowManager *wm, const bScreen *screen)
Definition: wm_window.c:2217
void wm_ghost_exit(void)
Definition: wm_window.c:1604
int WM_window_pixels_y(const wmWindow *win)
Definition: wm_window.c:2136
static void wm_window_check_size(rcti *rect)
Definition: wm_window.c:162
void wm_window_swap_buffers(wmWindow *win)
Push rendered buffer to the screen.
Definition: wm_window.c:1884
#define GHOST_WINDOW_STATE_DEFAULT
Definition: wm_window.c:109
void wm_window_reset_drawable(void)
Definition: wm_window.c:1074
void WM_window_set_active_workspace(bContext *C, wmWindow *win, WorkSpace *workspace)
Definition: wm_window.c:2340
wmWindow * wm_window_copy(Main *bmain, wmWindowManager *wm, wmWindow *win_src, const bool duplicate_layout, const bool child)
Definition: wm_window.c:279
void WM_init_state_normal_set(void)
Definition: wm_window.c:2044
char * WM_clipboard_text_get_firstline(bool selection, int *r_len)
Definition: wm_window.c:1773
void WM_opengl_context_activate(void *context)
Definition: wm_window.c:2443
static struct WMInitStruct wm_init_state
static int query_qual(modifierKeyType qual)
Definition: wm_window.c:1005
ViewLayer * WM_windows_view_layer_get_from_screen(const wmWindowManager *wm, const bScreen *screen)
Definition: wm_window.c:2228
static void wm_window_ensure_eventstate(wmWindow *win)
Definition: wm_window.c:526
int wm_window_new_main_exec(bContext *C, wmOperator *UNUSED(op))
Definition: wm_window.c:933
void WM_cursor_compatible_xy(wmWindow *win, int *x, int *y)
Definition: wm_window.c:2110
void wm_quit_with_optional_confirmation_prompt(bContext *C, wmWindow *win)
Definition: wm_window.c:362
void wm_window_title(wmWindowManager *wm, wmWindow *win)
Definition: wm_window.c:440
void WM_cursor_warp(wmWindow *win, int x, int y)
Definition: wm_window.c:2091
wmWindow * wm_window_new(const Main *bmain, wmWindowManager *wm, wmWindow *parent, bool dialog)
Definition: wm_window.c:263
static void wm_window_ghostwindow_add(wmWindowManager *wm, const char *title, wmWindow *win, bool is_dialog)
Definition: wm_window.c:537
bool wm_window_get_swap_interval(wmWindow *win, int *intervalOut)
Definition: wm_window.c:1894
WorkSpaceLayout * WM_window_get_active_layout(const wmWindow *win)
Definition: wm_window.c:2359
static void wm_ghostwindow_destroy(wmWindowManager *wm, wmWindow *win)
Definition: wm_window.c:174
void WM_opengl_context_release(void *context)
Definition: wm_window.c:2449
bool WM_window_is_fullscreen(const wmWindow *win)
Definition: wm_window.c:2187
void wm_window_close(bContext *C, wmWindowManager *wm, wmWindow *win)
Definition: wm_window.c:389
uint * WM_window_pixels_read(wmWindowManager *wm, wmWindow *win, int r_size[2])
Definition: wm_window.c:1989
void wm_window_set_swap_interval(wmWindow *win, int interval)
Definition: wm_window.c:1889
wmTimer * WM_event_add_timer_notifier(wmWindowManager *wm, wmWindow *win, unsigned int type, double timestep)
Definition: wm_window.c:1648
void WM_window_set_active_screen(wmWindow *win, WorkSpace *workspace, bScreen *screen)
Definition: wm_window.c:2378
static void wm_confirm_quit(bContext *C)
Definition: wm_window.c:348
void wm_get_desktopsize(int *r_width, int *r_height)
Definition: wm_window.c:151
static int wm_window_timer(const bContext *C)
Definition: wm_window.c:1501
void WM_init_native_pixels(bool do_it)
Definition: wm_window.c:2061
void wm_window_set_size(wmWindow *win, int width, int height)
Definition: wm_window.c:1850
void WM_init_state_maximized_set(void)
Definition: wm_window.c:2050
void WM_window_set_dpi(const wmWindow *win)
Definition: wm_window.c:469
void WM_event_timer_sleep(wmWindowManager *wm, wmWindow *UNUSED(win), wmTimer *timer, bool do_sleep)
Definition: wm_window.c:1619
void wm_window_ghostwindows_remove_invalid(bContext *C, wmWindowManager *wm)
Definition: wm_window.c:720
char * WM_clipboard_text_get(bool selection, int *r_len)
Definition: wm_window.c:1765
void wm_window_clear_drawable(wmWindowManager *wm)
Definition: wm_window.c:1047
static void wm_window_desktop_pos_get(const wmWindow *win, const int screen_pos[2], int r_desk_pos[2])
Definition: wm_window.c:1904
void wm_window_process_events(const bContext *C)
Definition: wm_window.c:1550
bScreen * WM_window_get_active_screen(const wmWindow *win)
Definition: wm_window.c:2372
static int find_free_winid(wmWindowManager *wm)
Definition: wm_window.c:250
void wm_get_screensize(int *r_width, int *r_height)
Definition: wm_window.c:140
void wm_cursor_position_to_ghost(wmWindow *win, int *x, int *y)
Definition: wm_window.c:975
void WM_progress_clear(wmWindow *win)
Definition: wm_window.c:1831
void WM_init_state_size_set(int stax, int stay, int sizx, int sizy)
Definition: wm_window.c:2028
void WM_opengl_context_dispose(void *context)
Definition: wm_window.c:2437
static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr C_void_ptr)
Definition: wm_window.c:1096
bool WM_window_find_under_cursor(const wmWindowManager *wm, const wmWindow *win_ignore, const wmWindow *win, const int mval[2], wmWindow **r_win, int r_mval[2])
Definition: wm_window.c:1922
void WM_progress_set(wmWindow *win, float progress)
Definition: wm_window.c:1823
void wm_window_make_drawable(wmWindowManager *wm, wmWindow *win)
Definition: wm_window.c:1054
void WM_init_tablet_api(void)
Definition: wm_window.c:2072
ViewLayer * WM_window_get_active_view_layer(const wmWindow *win)
Definition: wm_window.c:2286
int wm_window_fullscreen_toggle_exec(bContext *C, wmOperator *UNUSED(op))
Definition: wm_window.c:943
WorkSpace * WM_window_get_active_workspace(const wmWindow *win)
Definition: wm_window.c:2335
static bool wm_window_update_size_position(wmWindow *win)
Definition: wm_window.c:732
bool WM_window_is_temp_screen(const wmWindow *win)
Definition: wm_window.c:2383
void WM_window_rect_calc(const wmWindow *win, rcti *r_rect)
Definition: wm_window.c:2146
void wm_cursor_position_from_ghost(wmWindow *win, int *x, int *y)
Definition: wm_window.c:964
bool WM_window_is_maximized(const wmWindow *win)
Definition: wm_window.c:2192
void WM_window_set_active_layout(wmWindow *win, WorkSpace *workspace, WorkSpaceLayout *layout)
Definition: wm_window.c:2364
void WM_window_screen_rect_calc(const wmWindow *win, rcti *r_rect)
Definition: wm_window.c:2154
void WM_window_pixel_sample_read(const wmWindowManager *wm, const wmWindow *win, const int pos[2], float r_col[3])
Definition: wm_window.c:1958
void WM_window_set_active_view_layer(wmWindow *win, ViewLayer *view_layer)
Definition: wm_window.c:2306
void wm_window_get_position(wmWindow *win, int *r_pos_x, int *r_pos_y)
Definition: wm_window.c:1844
static char * wm_clipboard_text_get_ex(bool selection, int *r_len, bool firstline)
Definition: wm_window.c:1715
static void wm_window_update_eventstate(wmWindow *win)
Definition: wm_window.c:520
int WM_window_pixels_x(const wmWindow *win)
Definition: wm_window.c:2130
wmWindow * wm_window_copy_test(bContext *C, wmWindow *win_src, const bool duplicate_layout, const bool child)
Definition: wm_window.c:313
wmWindow * WM_window_open(bContext *C, const char *title, int x, int y, int sizex, int sizey, int space_type, bool dialog, bool temp, WindowAlignment alignment)
Definition: wm_window.c:764
void WM_event_remove_timer_notifier(wmWindowManager *wm, wmWindow *win, wmTimer *timer)
Definition: wm_window.c:1703
static void wm_window_set_drawable(wmWindowManager *wm, wmWindow *win, bool activate)
Definition: wm_window.c:1036
void wm_window_free(bContext *C, wmWindowManager *wm, wmWindow *win)
Definition: wm_window.c:202
WorkSpace * WM_windows_workspace_get_from_screen(const wmWindowManager *wm, const bScreen *screen)
Definition: wm_window.c:2239
void wm_ghost_init(bContext *C)
Definition: wm_window.c:1580
static void wm_save_file_on_quit_dialog_callback(bContext *C, void *UNUSED(user_data))
Definition: wm_window.c:339
void WM_init_state_fullscreen_set(void)
Definition: wm_window.c:2038
void WM_windows_scene_data_sync(const ListBase *win_lb, Scene *scene)
Definition: wm_window.c:2208
void wm_window_ghostwindows_ensure(wmWindowManager *wm)
Definition: wm_window.c:693
void WM_init_window_focus_set(bool do_it)
Definition: wm_window.c:2056
Scene * WM_window_get_active_scene(const wmWindow *win)
Definition: wm_window.c:2249
wmTimer * WM_event_add_timer(wmWindowManager *wm, wmWindow *win, int event_type, double timestep)
Definition: wm_window.c:1632
void wm_cursor_position_get(wmWindow *win, int *r_x, int *r_y)
Definition: wm_window.c:986
void wm_window_lower(wmWindow *win)
Definition: wm_window.c:1861
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)
Definition: wm_window.c:2455
bool wm_xr_events_handle(wmWindowManager *wm)
Definition: wm_xr.c:126