2022-02-11 09:07:11 +11:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
* Copyright 2008 Blender Foundation. All rights reserved. */
|
2011-02-21 07:25:24 +00:00
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
|
* \ingroup editors
|
2011-02-21 07:25:24 +00:00
|
|
|
*/
|
|
|
|
|
|
2012-02-17 18:59:41 +00:00
|
|
|
#pragma once
|
2008-01-01 18:29:19 +00:00
|
|
|
|
|
|
|
|
#include "DNA_screen_types.h"
|
2008-01-07 18:03:41 +00:00
|
|
|
#include "DNA_space_types.h"
|
|
|
|
|
#include "DNA_view2d_types.h"
|
|
|
|
|
#include "DNA_view3d_types.h"
|
2017-10-16 17:15:03 -02:00
|
|
|
#include "DNA_workspace_types.h"
|
2008-01-07 18:03:41 +00:00
|
|
|
|
2018-02-28 23:09:33 +11:00
|
|
|
#include "DNA_object_enums.h"
|
|
|
|
|
|
2021-11-05 14:56:22 +01:00
|
|
|
#include "WM_types.h"
|
|
|
|
|
|
2016-12-01 16:43:57 +01:00
|
|
|
#include "BLI_compiler_attrs.h"
|
|
|
|
|
|
2020-03-02 15:09:10 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
2019-01-28 21:08:24 +11:00
|
|
|
struct ARegion;
|
2017-11-03 14:36:49 +01:00
|
|
|
struct Depsgraph;
|
2019-01-28 21:08:24 +11:00
|
|
|
struct IDProperty;
|
|
|
|
|
struct Main;
|
|
|
|
|
struct MenuType;
|
|
|
|
|
struct Scene;
|
2019-03-13 10:41:12 +11:00
|
|
|
struct SpaceLink;
|
Main Workspace Integration
This commit does the main integration of workspaces, which is a design we agreed on during the 2.8 UI workshop (see https://wiki.blender.org/index.php/Dev:2.8/UI/Workshop_Writeup)
Workspaces should generally be stable, I'm not aware of any remaining bugs (or I've forgotten them :) ). If you find any, let me know!
(Exception: mode switching button might get out of sync with actual mode in some cases, would consider that a limitation/ToDo. Needs to be resolved at some point.)
== Main Changes/Features
* Introduces the new Workspaces as data-blocks.
* Allow storing a number of custom workspaces as part of the user configuration. Needs further work to allow adding and deleting individual workspaces.
* Bundle a default workspace configuration with Blender (current screen-layouts converted to workspaces).
* Pressing button to add a workspace spawns a menu to select between "Duplicate Current" and the workspaces from the user configuration. If no workspaces are stored in the user configuration, the default workspaces are listed instead.
* Store screen-layouts (`bScreen`) per workspace.
* Store an active screen-layout per workspace. Changing the workspace will enable this layout.
* Store active mode in workspace. Changing the workspace will also enter the mode of the new workspace. (Note that we still store the active mode in the object, moving this completely to workspaces is a separate project.)
* Store an active render layer per workspace.
* Moved mode switch from 3D View header to Info Editor header.
* Store active scene in window (not directly workspace related, but overlaps quite a bit).
* Removed 'Use Global Scene' User Preference option.
* Compatibility with old files - a new workspace is created for every screen-layout of old files. Old Blender versions should be able to read files saved with workspace support as well.
* Default .blend only contains one workspace ("General").
* Support appending workspaces.
Opening files without UI and commandline rendering should work fine.
Note that the UI is temporary! We plan to introduce a new global topbar
that contains the workspace options and tabs for switching workspaces.
== Technical Notes
* Workspaces are data-blocks.
* Adding and removing `bScreen`s should be done through `ED_workspace_layout` API now.
* A workspace can be active in multiple windows at the same time.
* The mode menu (which is now in the Info Editor header) doesn't display "Grease Pencil Edit" mode anymore since its availability depends on the active editor. Will be fixed by making Grease Pencil an own object type (as planned).
* The button to change the active workspace object mode may get out of sync with the mode of the active object. Will either be resolved by moving mode out of object data, or we'll disable workspace modes again (there's a `#define USE_WORKSPACE_MODE` for that).
* Screen-layouts (`bScreen`) are IDs and thus stored in a main list-base. Had to add a wrapper `WorkSpaceLayout` so we can store them in a list-base within workspaces, too. On the long run we could completely replace `bScreen` by workspace structs.
* `WorkSpace` types use some special compiler trickery to allow marking structs and struct members as private. BKE_workspace API should be used for accessing those.
* Added scene operators `SCENE_OT_`. Was previously done through screen operators.
== BPY API Changes
* Removed `Screen.scene`, added `Window.scene`
* Removed `UserPreferencesView.use_global_scene`
* Added `Context.workspace`, `Window.workspace` and `BlendData.workspaces`
* Added `bpy.types.WorkSpace` containing `screens`, `object_mode` and `render_layer`
* Added Screen.layout_name for the layout name that'll be displayed in the UI (may differ from internal name)
== What's left?
* There are a few open design questions (T50521). We should find the needed answers and implement them.
* Allow adding and removing individual workspaces from workspace configuration (needs UI design).
* Get the override system ready and support overrides per workspace.
* Support custom UI setups as part of workspaces (hidden panels, hidden buttons, customizable toolbars, etc).
* Allow enabling add-ons per workspace.
* Support custom workspace keymaps.
* Remove special exception for workspaces in linking code (so they're always appended, never linked). Depends on a few things, so best to solve later.
* Get the topbar done.
* Workspaces need a proper icon, current one is just a placeholder :)
Reviewed By: campbellbarton, mont29
Tags: #user_interface, #bf_blender_2.8
Maniphest Tasks: T50521
Differential Revision: https://developer.blender.org/D2451
2017-06-01 19:56:58 +02:00
|
|
|
struct WorkSpace;
|
|
|
|
|
struct WorkSpaceInstanceHook;
|
2008-12-19 14:14:43 +00:00
|
|
|
struct bContext;
|
2009-02-08 12:16:35 +00:00
|
|
|
struct bScreen;
|
2.5: WM Compositing
* Triple Buffer is now more complete:
- Proper handling of window resize, duplicate, etc.
- It now uses 3x3 textures (or less) if the power of two sizes
do not match well. That still has a worst case wast of 23.4%,
but better than 300%.
- It can also use the ARB/NV/EXT_texture_rectangle extension
now, which may be supported on hardware that does not support
ARB_texture_non_power_of_two.
- Gesture, menu and brushe redraws now require no redraws at all
from the area regions. So even on a high poly scene just moving
the paint cursor or opening a menu should be fast.
* Testing can be done by setting the "Window Draw Method" in the
User Preferences in the outliner. "Overlap" is still default,
since "Triple Buffer" has not been tested on computers other than
mine, would like to avoid crashing Blender on startup in case
there is a common bug, but it's ready for testing now.
- For reference "Full" draws the full window each time.
- "Triple Buffer" should work for both swap copy and swap exchange
systems, the latter still need the -E command line option for
"Overlap".
- Resizing and going fullscreen still gives flicker here but no
more than "Full" drawing.
* Partial Redraw was added. ED_region_tag_redraw_partial takes a
rect in window coordinates to define a subarea of the region.
On region draw it will then set glScissor to a smaller area, and
ar->drawrct will always be set to either the partial or full
window rect. The latter can then be used for clipping in the 3D
view or clipping interface drawing. Neither is implemented yet.
2009-01-23 03:52:52 +00:00
|
|
|
struct rcti;
|
2019-01-28 21:08:24 +11:00
|
|
|
struct uiBlock;
|
2019-02-06 11:49:41 +01:00
|
|
|
struct uiLayout;
|
2019-01-28 21:08:24 +11:00
|
|
|
struct wmKeyConfig;
|
2017-11-13 19:43:34 +11:00
|
|
|
struct wmMsgSubscribeKey;
|
|
|
|
|
struct wmMsgSubscribeValue;
|
2019-01-28 21:08:24 +11:00
|
|
|
struct wmNotifier;
|
2018-06-23 16:31:28 +02:00
|
|
|
struct wmOperatorType;
|
2021-01-18 17:28:47 -06:00
|
|
|
struct wmRegionListenerParams;
|
|
|
|
|
struct wmRegionMessageSubscribeParams;
|
|
|
|
|
struct wmSpaceTypeListenerParams;
|
2019-01-28 21:08:24 +11:00
|
|
|
struct wmWindow;
|
|
|
|
|
struct wmWindowManager;
|
2008-01-07 18:03:41 +00:00
|
|
|
|
|
|
|
|
/* regions */
|
2021-12-09 00:55:11 +11:00
|
|
|
/** Only exported for WM. */
|
2021-01-18 17:28:47 -06:00
|
|
|
void ED_region_do_listen(struct wmRegionListenerParams *params);
|
2021-12-09 00:55:11 +11:00
|
|
|
/** Only exported for WM. */
|
2020-03-06 16:56:42 +01:00
|
|
|
void ED_region_do_layout(struct bContext *C, struct ARegion *region);
|
2021-12-09 00:55:11 +11:00
|
|
|
/** Only exported for WM. */
|
2020-03-06 16:56:42 +01:00
|
|
|
void ED_region_do_draw(struct bContext *C, struct ARegion *region);
|
|
|
|
|
void ED_region_exit(struct bContext *C, struct ARegion *region);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Utility to exit and free an area-region. Screen level regions (menus/popups) need to be treated
|
|
|
|
|
* slightly differently, see #ui_region_temp_remove().
|
|
|
|
|
*/
|
2020-04-03 13:25:03 +02:00
|
|
|
void ED_region_remove(struct bContext *C, struct ScrArea *area, struct ARegion *region);
|
2021-10-07 12:32:04 +11:00
|
|
|
void ED_region_pixelspace(const struct ARegion *region);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Call to move a popup window (keep OpenGL context free!)
|
|
|
|
|
*/
|
2020-03-06 16:56:42 +01:00
|
|
|
void ED_region_update_rect(struct ARegion *region);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Externally called for floating regions like menus.
|
|
|
|
|
*/
|
2020-08-01 13:02:21 +10:00
|
|
|
void ED_region_floating_init(struct ARegion *region);
|
2020-03-06 16:56:42 +01:00
|
|
|
void ED_region_tag_redraw(struct ARegion *region);
|
|
|
|
|
void ED_region_tag_redraw_partial(struct ARegion *region, const struct rcti *rct, bool rebuild);
|
|
|
|
|
void ED_region_tag_redraw_cursor(struct ARegion *region);
|
|
|
|
|
void ED_region_tag_redraw_no_rebuild(struct ARegion *region);
|
|
|
|
|
void ED_region_tag_refresh_ui(struct ARegion *region);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Tag editor overlays to be redrawn. If in doubt about which parts need to be redrawn (partial
|
|
|
|
|
* clipping rectangle set), redraw everything.
|
|
|
|
|
*/
|
2020-03-06 16:56:42 +01:00
|
|
|
void ED_region_tag_redraw_editor_overlays(struct ARegion *region);
|
|
|
|
|
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Set the temporary update flag for property search.
|
|
|
|
|
*/
|
2020-09-15 11:25:49 -05:00
|
|
|
void ED_region_search_filter_update(const struct ScrArea *area, struct ARegion *region);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Returns the search string if the space type and region type support property search.
|
|
|
|
|
*/
|
2020-09-15 11:25:49 -05:00
|
|
|
const char *ED_area_region_search_filter_get(const struct ScrArea *area,
|
|
|
|
|
const struct ARegion *region);
|
|
|
|
|
|
2020-03-06 16:56:42 +01:00
|
|
|
void ED_region_panels_init(struct wmWindowManager *wm, struct ARegion *region);
|
2020-08-19 18:55:04 -04:00
|
|
|
void ED_region_panels_ex(const struct bContext *C, struct ARegion *region, const char *contexts[]);
|
2020-03-06 16:56:42 +01:00
|
|
|
void ED_region_panels(const struct bContext *C, struct ARegion *region);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* \param contexts: A NULL terminated array of context strings to match against.
|
|
|
|
|
* Matching against any of these strings will draw the panel.
|
|
|
|
|
* Can be NULL to skip context checks.
|
|
|
|
|
*/
|
2018-06-11 19:30:48 +02:00
|
|
|
void ED_region_panels_layout_ex(const struct bContext *C,
|
2020-03-06 16:56:42 +01:00
|
|
|
struct ARegion *region,
|
2019-05-10 13:43:07 +10:00
|
|
|
struct ListBase *paneltypes,
|
2018-06-11 18:23:36 +02:00
|
|
|
const char *contexts[],
|
2019-05-10 13:43:07 +10:00
|
|
|
const char *category_override);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Build the same panel list as #ED_region_panels_layout_ex and checks whether any
|
|
|
|
|
* of the panels contain a search result based on the area / region's search filter.
|
|
|
|
|
*/
|
2020-10-13 13:10:41 -05:00
|
|
|
bool ED_region_property_search(const struct bContext *C,
|
|
|
|
|
struct ARegion *region,
|
|
|
|
|
struct ListBase *paneltypes,
|
|
|
|
|
const char *contexts[],
|
|
|
|
|
const char *category_override);
|
2019-05-10 13:43:07 +10:00
|
|
|
|
2020-03-06 16:56:42 +01:00
|
|
|
void ED_region_panels_layout(const struct bContext *C, struct ARegion *region);
|
|
|
|
|
void ED_region_panels_draw(const struct bContext *C, struct ARegion *region);
|
2018-06-11 18:23:36 +02:00
|
|
|
|
2020-03-06 16:56:42 +01:00
|
|
|
void ED_region_header_init(struct ARegion *region);
|
|
|
|
|
void ED_region_header(const struct bContext *C, struct ARegion *region);
|
|
|
|
|
void ED_region_header_layout(const struct bContext *C, struct ARegion *region);
|
|
|
|
|
void ED_region_header_draw(const struct bContext *C, struct ARegion *region);
|
2018-06-11 18:23:36 +02:00
|
|
|
|
2020-04-03 13:25:03 +02:00
|
|
|
void ED_region_cursor_set(struct wmWindow *win, struct ScrArea *area, struct ARegion *region);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Exported to all editors, uses fading default.
|
|
|
|
|
*/
|
2020-03-06 16:56:42 +01:00
|
|
|
void ED_region_toggle_hidden(struct bContext *C, struct ARegion *region);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* For use after changing visibility of regions.
|
|
|
|
|
*/
|
2019-04-18 12:16:03 +02:00
|
|
|
void ED_region_visibility_change_update(struct bContext *C,
|
2020-04-03 13:25:03 +02:00
|
|
|
struct ScrArea *area,
|
2020-03-06 16:56:42 +01:00
|
|
|
struct ARegion *region);
|
2019-04-18 12:16:03 +02:00
|
|
|
/* screen_ops.c */
|
2022-04-04 13:17:03 +10:00
|
|
|
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* \note Assumes that \a region itself is not a split version from previous region.
|
|
|
|
|
*/
|
2019-04-18 12:16:03 +02:00
|
|
|
void ED_region_visibility_change_update_animated(struct bContext *C,
|
2020-04-03 13:25:03 +02:00
|
|
|
struct ScrArea *area,
|
2020-03-06 16:56:42 +01:00
|
|
|
struct ARegion *region);
|
2019-04-18 12:16:03 +02:00
|
|
|
|
2020-03-06 16:56:42 +01:00
|
|
|
void ED_region_info_draw(struct ARegion *region,
|
2015-07-01 21:48:42 +02:00
|
|
|
const char *text,
|
|
|
|
|
float fill_color[4],
|
2022-01-07 11:38:08 +11:00
|
|
|
bool full_redraw);
|
2020-03-06 16:56:42 +01:00
|
|
|
void ED_region_info_draw_multiline(ARegion *region,
|
2017-05-04 21:56:34 +02:00
|
|
|
const char *text_array[],
|
|
|
|
|
float fill_color[4],
|
2022-01-07 11:38:08 +11:00
|
|
|
bool full_redraw);
|
2019-02-06 11:49:41 +01:00
|
|
|
void ED_region_image_metadata_panel_draw(struct ImBuf *ibuf, struct uiLayout *layout);
|
2020-03-06 16:56:42 +01:00
|
|
|
void ED_region_grid_draw(struct ARegion *region, float zoomx, float zoomy, float x0, float y0);
|
|
|
|
|
float ED_region_blend_alpha(struct ARegion *region);
|
|
|
|
|
void ED_region_visible_rect_calc(struct ARegion *region, struct rcti *rect);
|
|
|
|
|
const rcti *ED_region_visible_rect(ARegion *region);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Overlapping regions only in the following restricted cases.
|
|
|
|
|
*/
|
2018-06-01 15:04:51 +02:00
|
|
|
bool ED_region_is_overlap(int spacetype, int regiontype);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2020-03-06 16:56:42 +01:00
|
|
|
int ED_region_snap_size_test(const struct ARegion *region);
|
|
|
|
|
bool ED_region_snap_size_apply(struct ARegion *region, int snap_flag);
|
2018-04-26 12:01:44 +02:00
|
|
|
|
2017-11-13 19:43:34 +11:00
|
|
|
/* message_bus callbacks */
|
|
|
|
|
void ED_region_do_msg_notify_tag_redraw(struct bContext *C,
|
|
|
|
|
struct wmMsgSubscribeKey *msg_key,
|
|
|
|
|
struct wmMsgSubscribeValue *msg_val);
|
|
|
|
|
void ED_area_do_msg_notify_tag_refresh(struct bContext *C,
|
|
|
|
|
struct wmMsgSubscribeKey *msg_key,
|
|
|
|
|
struct wmMsgSubscribeValue *msg_val);
|
|
|
|
|
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Follow #ARegionType.message_subscribe.
|
|
|
|
|
*/
|
2021-01-19 12:59:00 +11:00
|
|
|
void ED_area_do_mgs_subscribe_for_tool_header(const struct wmRegionMessageSubscribeParams *params);
|
|
|
|
|
void ED_area_do_mgs_subscribe_for_tool_ui(const struct wmRegionMessageSubscribeParams *params);
|
2019-04-18 21:13:22 +02:00
|
|
|
|
2017-11-13 19:43:34 +11:00
|
|
|
/* message bus */
|
2021-12-09 00:55:11 +11:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Generate subscriptions for this region.
|
|
|
|
|
*/
|
2021-01-18 17:28:47 -06:00
|
|
|
void ED_region_message_subscribe(struct wmRegionMessageSubscribeParams *params);
|
2008-01-07 18:03:41 +00:00
|
|
|
|
|
|
|
|
/* spaces */
|
2021-12-09 00:55:11 +11:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \note Keymap definitions are registered only once per WM initialize,
|
|
|
|
|
* usually on file read, using the keymap the actual areas/regions add the handlers.
|
|
|
|
|
* \note Called in wm.c. */
|
2012-05-12 20:39:39 +00:00
|
|
|
void ED_spacetypes_keymap(struct wmKeyConfig *keyconf);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Returns offset for next button in header.
|
|
|
|
|
*/
|
2012-05-12 20:39:39 +00:00
|
|
|
int ED_area_header_switchbutton(const struct bContext *C, struct uiBlock *block, int yco);
|
2008-12-16 18:42:12 +00:00
|
|
|
|
2008-01-07 18:03:41 +00:00
|
|
|
/* areas */
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Called in screen_refresh, or screens_init, also area size changes.
|
|
|
|
|
*/
|
2020-08-01 13:02:21 +10:00
|
|
|
void ED_area_init(struct wmWindowManager *wm, struct wmWindow *win, struct ScrArea *area);
|
2020-04-03 13:25:03 +02:00
|
|
|
void ED_area_exit(struct bContext *C, struct ScrArea *area);
|
2012-05-12 20:39:39 +00:00
|
|
|
int ED_screen_area_active(const struct bContext *C);
|
2018-08-17 17:32:36 +02:00
|
|
|
void ED_screen_global_areas_refresh(struct wmWindow *win);
|
|
|
|
|
void ED_screen_global_areas_sync(struct wmWindow *win);
|
2021-12-09 00:55:11 +11:00
|
|
|
/** Only exported for WM. */
|
2021-01-18 17:28:47 -06:00
|
|
|
void ED_area_do_listen(struct wmSpaceTypeListenerParams *params);
|
2020-04-03 13:25:03 +02:00
|
|
|
void ED_area_tag_redraw(ScrArea *area);
|
|
|
|
|
void ED_area_tag_redraw_no_rebuild(ScrArea *area);
|
|
|
|
|
void ED_area_tag_redraw_regiontype(ScrArea *area, int type);
|
|
|
|
|
void ED_area_tag_refresh(ScrArea *area);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Only exported for WM.
|
|
|
|
|
*/
|
2020-04-03 13:25:03 +02:00
|
|
|
void ED_area_do_refresh(struct bContext *C, ScrArea *area);
|
2021-04-28 13:13:43 -05:00
|
|
|
struct AZone *ED_area_azones_update(ScrArea *area, const int mouse_xy[2]);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Use NULL to disable it.
|
|
|
|
|
*/
|
2020-04-03 13:25:03 +02:00
|
|
|
void ED_area_status_text(ScrArea *area, const char *str);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* \param skip_region_exit: Skip calling area exit callback. Set for opening temp spaces.
|
|
|
|
|
*/
|
2022-01-07 11:38:08 +11:00
|
|
|
void ED_area_newspace(struct bContext *C, ScrArea *area, int type, bool skip_region_exit);
|
2020-04-03 13:25:03 +02:00
|
|
|
void ED_area_prevspace(struct bContext *C, ScrArea *area);
|
2012-05-12 20:39:39 +00:00
|
|
|
void ED_area_swapspace(struct bContext *C, ScrArea *sa1, ScrArea *sa2);
|
|
|
|
|
int ED_area_headersize(void);
|
2019-04-05 13:48:26 +02:00
|
|
|
int ED_area_footersize(void);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* \return the final height of a global \a area, accounting for DPI.
|
|
|
|
|
*/
|
UI: New Global Top-Bar (WIP)
== Main Features/Changes for Users
* Add horizontal bar at top of all non-temp windows, consisting out of two horizontal sub-bars.
* Upper sub-bar contains global menus (File, Render, etc.), tabs for workspaces and scene selector.
* Lower sub-bar contains object mode selector, screen-layout and render-layer selector. Later operator and/or tool settings will be placed here.
* Individual sections of the topbar are individually scrollable.
* Workspace tabs can be double- or ctrl-clicked for renaming and contain 'x' icon for deleting.
* Top-bar should scale nicely with DPI.
* The lower half of the top-bar can be hided by dragging the lower top-bar edge up. Better hiding options are planned (e.g. hide in fullscreen modes).
* Info editors at the top of the window and using the full window width with be replaced by the top-bar.
* In fullscreen modes, no more info editor is added on top, the top-bar replaces it.
== Technical Features/Changes
* Adds initial support for global areas
A global area is part of the window, not part of the regular screen-layout.
I've added a macro iterator to iterate over both, global and screen-layout level areas. When iterating over areas, from now on developers should always consider if they have to include global areas.
* Adds a TOPBAR editor type
The editor type is hidden in the UI editor type menu.
* Adds a variation of the ID template to display IDs as tab buttons (template_ID_tabs in BPY)
* Does various changes to RNA button creation code to improve their appearance in the horizontal top-bar.
* Adds support for dynamically sized regions. That is, regions that scale automatically to the layout bounds.
The code for this is currently a big hack (it's based on drawing the UI multiple times). This should definitely be improved.
* Adds a template for displaying operator properties optimized for the top-bar. This will probably change a lot still and is in fact disabled in code.
Since the final top-bar design depends a lot on other 2.8 designs (mainly tool-system and workspaces), we decided to not show the operator or tool settings in the top-bar for now. That means most of the lower sub-bar is empty for the time being.
NOTE: Top-bar or global area data is not written to files or SDNA. They are simply added to the window when opening Blender or reading a file. This allows us doing changes to the top-bar without having to care for compatibility.
== ToDo's
It's a bit hard to predict all the ToDo's here are the known main ones:
* Add options for the new active-tool system and for operator redo to the topbar.
* Automatically hide the top-bar in fullscreen modes.
* General visual polish.
* Top-bar drag & drop support (WIP in temp-tab_drag_drop).
* Improve dynamic regions (should also fix some layout glitches).
* Make internal terminology consistent.
* Enable topbar file writing once design is more advanced.
* Address TODO's and XXX's in code :)
Thanks @brecht for the review! And @sergey for the complaining ;)
Differential Revision: D2758
2018-04-20 17:14:03 +02:00
|
|
|
int ED_area_global_size_y(const ScrArea *area);
|
2018-06-30 00:42:19 +02:00
|
|
|
int ED_area_global_min_size_y(const ScrArea *area);
|
|
|
|
|
int ED_area_global_max_size_y(const ScrArea *area);
|
UI: New Global Top-Bar (WIP)
== Main Features/Changes for Users
* Add horizontal bar at top of all non-temp windows, consisting out of two horizontal sub-bars.
* Upper sub-bar contains global menus (File, Render, etc.), tabs for workspaces and scene selector.
* Lower sub-bar contains object mode selector, screen-layout and render-layer selector. Later operator and/or tool settings will be placed here.
* Individual sections of the topbar are individually scrollable.
* Workspace tabs can be double- or ctrl-clicked for renaming and contain 'x' icon for deleting.
* Top-bar should scale nicely with DPI.
* The lower half of the top-bar can be hided by dragging the lower top-bar edge up. Better hiding options are planned (e.g. hide in fullscreen modes).
* Info editors at the top of the window and using the full window width with be replaced by the top-bar.
* In fullscreen modes, no more info editor is added on top, the top-bar replaces it.
== Technical Features/Changes
* Adds initial support for global areas
A global area is part of the window, not part of the regular screen-layout.
I've added a macro iterator to iterate over both, global and screen-layout level areas. When iterating over areas, from now on developers should always consider if they have to include global areas.
* Adds a TOPBAR editor type
The editor type is hidden in the UI editor type menu.
* Adds a variation of the ID template to display IDs as tab buttons (template_ID_tabs in BPY)
* Does various changes to RNA button creation code to improve their appearance in the horizontal top-bar.
* Adds support for dynamically sized regions. That is, regions that scale automatically to the layout bounds.
The code for this is currently a big hack (it's based on drawing the UI multiple times). This should definitely be improved.
* Adds a template for displaying operator properties optimized for the top-bar. This will probably change a lot still and is in fact disabled in code.
Since the final top-bar design depends a lot on other 2.8 designs (mainly tool-system and workspaces), we decided to not show the operator or tool settings in the top-bar for now. That means most of the lower sub-bar is empty for the time being.
NOTE: Top-bar or global area data is not written to files or SDNA. They are simply added to the window when opening Blender or reading a file. This allows us doing changes to the top-bar without having to care for compatibility.
== ToDo's
It's a bit hard to predict all the ToDo's here are the known main ones:
* Add options for the new active-tool system and for operator redo to the topbar.
* Automatically hide the top-bar in fullscreen modes.
* General visual polish.
* Top-bar drag & drop support (WIP in temp-tab_drag_drop).
* Improve dynamic regions (should also fix some layout glitches).
* Make internal terminology consistent.
* Enable topbar file writing once design is more advanced.
* Address TODO's and XXX's in code :)
Thanks @brecht for the review! And @sergey for the complaining ;)
Differential Revision: D2758
2018-04-20 17:14:03 +02:00
|
|
|
bool ED_area_is_global(const ScrArea *area);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* For now we just assume all global areas are made up out of horizontal bars
|
|
|
|
|
* with the same size. A fixed size could be stored in ARegion instead if needed.
|
|
|
|
|
*
|
|
|
|
|
* \return the DPI aware height of a single bar/region in global areas.
|
|
|
|
|
*/
|
UI: New Global Top-Bar (WIP)
== Main Features/Changes for Users
* Add horizontal bar at top of all non-temp windows, consisting out of two horizontal sub-bars.
* Upper sub-bar contains global menus (File, Render, etc.), tabs for workspaces and scene selector.
* Lower sub-bar contains object mode selector, screen-layout and render-layer selector. Later operator and/or tool settings will be placed here.
* Individual sections of the topbar are individually scrollable.
* Workspace tabs can be double- or ctrl-clicked for renaming and contain 'x' icon for deleting.
* Top-bar should scale nicely with DPI.
* The lower half of the top-bar can be hided by dragging the lower top-bar edge up. Better hiding options are planned (e.g. hide in fullscreen modes).
* Info editors at the top of the window and using the full window width with be replaced by the top-bar.
* In fullscreen modes, no more info editor is added on top, the top-bar replaces it.
== Technical Features/Changes
* Adds initial support for global areas
A global area is part of the window, not part of the regular screen-layout.
I've added a macro iterator to iterate over both, global and screen-layout level areas. When iterating over areas, from now on developers should always consider if they have to include global areas.
* Adds a TOPBAR editor type
The editor type is hidden in the UI editor type menu.
* Adds a variation of the ID template to display IDs as tab buttons (template_ID_tabs in BPY)
* Does various changes to RNA button creation code to improve their appearance in the horizontal top-bar.
* Adds support for dynamically sized regions. That is, regions that scale automatically to the layout bounds.
The code for this is currently a big hack (it's based on drawing the UI multiple times). This should definitely be improved.
* Adds a template for displaying operator properties optimized for the top-bar. This will probably change a lot still and is in fact disabled in code.
Since the final top-bar design depends a lot on other 2.8 designs (mainly tool-system and workspaces), we decided to not show the operator or tool settings in the top-bar for now. That means most of the lower sub-bar is empty for the time being.
NOTE: Top-bar or global area data is not written to files or SDNA. They are simply added to the window when opening Blender or reading a file. This allows us doing changes to the top-bar without having to care for compatibility.
== ToDo's
It's a bit hard to predict all the ToDo's here are the known main ones:
* Add options for the new active-tool system and for operator redo to the topbar.
* Automatically hide the top-bar in fullscreen modes.
* General visual polish.
* Top-bar drag & drop support (WIP in temp-tab_drag_drop).
* Improve dynamic regions (should also fix some layout glitches).
* Make internal terminology consistent.
* Enable topbar file writing once design is more advanced.
* Address TODO's and XXX's in code :)
Thanks @brecht for the review! And @sergey for the complaining ;)
Differential Revision: D2758
2018-04-20 17:14:03 +02:00
|
|
|
int ED_region_global_size_y(void);
|
2018-04-29 12:24:08 +02:00
|
|
|
void ED_area_update_region_sizes(struct wmWindowManager *wm,
|
|
|
|
|
struct wmWindow *win,
|
|
|
|
|
struct ScrArea *area);
|
2020-10-28 11:43:10 -06:00
|
|
|
bool ED_area_has_shared_border(struct ScrArea *a, struct ScrArea *b);
|
2021-10-05 16:54:25 +09:00
|
|
|
ScrArea *ED_area_offscreen_create(struct wmWindow *win, eSpace_Type space_type);
|
2021-10-05 15:55:57 +09:00
|
|
|
void ED_area_offscreen_free(struct wmWindowManager *wm,
|
|
|
|
|
struct wmWindow *win,
|
|
|
|
|
struct ScrArea *area);
|
UI: New Global Top-Bar (WIP)
== Main Features/Changes for Users
* Add horizontal bar at top of all non-temp windows, consisting out of two horizontal sub-bars.
* Upper sub-bar contains global menus (File, Render, etc.), tabs for workspaces and scene selector.
* Lower sub-bar contains object mode selector, screen-layout and render-layer selector. Later operator and/or tool settings will be placed here.
* Individual sections of the topbar are individually scrollable.
* Workspace tabs can be double- or ctrl-clicked for renaming and contain 'x' icon for deleting.
* Top-bar should scale nicely with DPI.
* The lower half of the top-bar can be hided by dragging the lower top-bar edge up. Better hiding options are planned (e.g. hide in fullscreen modes).
* Info editors at the top of the window and using the full window width with be replaced by the top-bar.
* In fullscreen modes, no more info editor is added on top, the top-bar replaces it.
== Technical Features/Changes
* Adds initial support for global areas
A global area is part of the window, not part of the regular screen-layout.
I've added a macro iterator to iterate over both, global and screen-layout level areas. When iterating over areas, from now on developers should always consider if they have to include global areas.
* Adds a TOPBAR editor type
The editor type is hidden in the UI editor type menu.
* Adds a variation of the ID template to display IDs as tab buttons (template_ID_tabs in BPY)
* Does various changes to RNA button creation code to improve their appearance in the horizontal top-bar.
* Adds support for dynamically sized regions. That is, regions that scale automatically to the layout bounds.
The code for this is currently a big hack (it's based on drawing the UI multiple times). This should definitely be improved.
* Adds a template for displaying operator properties optimized for the top-bar. This will probably change a lot still and is in fact disabled in code.
Since the final top-bar design depends a lot on other 2.8 designs (mainly tool-system and workspaces), we decided to not show the operator or tool settings in the top-bar for now. That means most of the lower sub-bar is empty for the time being.
NOTE: Top-bar or global area data is not written to files or SDNA. They are simply added to the window when opening Blender or reading a file. This allows us doing changes to the top-bar without having to care for compatibility.
== ToDo's
It's a bit hard to predict all the ToDo's here are the known main ones:
* Add options for the new active-tool system and for operator redo to the topbar.
* Automatically hide the top-bar in fullscreen modes.
* General visual polish.
* Top-bar drag & drop support (WIP in temp-tab_drag_drop).
* Improve dynamic regions (should also fix some layout glitches).
* Make internal terminology consistent.
* Enable topbar file writing once design is more advanced.
* Address TODO's and XXX's in code :)
Thanks @brecht for the review! And @sergey for the complaining ;)
Differential Revision: D2758
2018-04-20 17:14:03 +02:00
|
|
|
|
2022-02-22 08:57:22 -08:00
|
|
|
/**
|
|
|
|
|
* Search all screens, even non-active or overlapping (multiple windows), return the most-likely
|
|
|
|
|
* area of interest. xy is relative to active window, like all similar functions.
|
|
|
|
|
*/
|
|
|
|
|
ScrArea *ED_area_find_under_cursor(const struct bContext *C, int spacetype, const int xy[2]);
|
|
|
|
|
|
2018-04-24 19:59:48 +02:00
|
|
|
ScrArea *ED_screen_areas_iter_first(const struct wmWindow *win, const bScreen *screen);
|
|
|
|
|
ScrArea *ED_screen_areas_iter_next(const bScreen *screen, const ScrArea *area);
|
|
|
|
|
/**
|
|
|
|
|
* Iterate over all areas visible in the screen (screen as in everything
|
|
|
|
|
* visible in the window, not just bScreen).
|
|
|
|
|
* \note Skips global areas with flag GLOBAL_AREA_IS_HIDDEN.
|
|
|
|
|
*/
|
UI: New Global Top-Bar (WIP)
== Main Features/Changes for Users
* Add horizontal bar at top of all non-temp windows, consisting out of two horizontal sub-bars.
* Upper sub-bar contains global menus (File, Render, etc.), tabs for workspaces and scene selector.
* Lower sub-bar contains object mode selector, screen-layout and render-layer selector. Later operator and/or tool settings will be placed here.
* Individual sections of the topbar are individually scrollable.
* Workspace tabs can be double- or ctrl-clicked for renaming and contain 'x' icon for deleting.
* Top-bar should scale nicely with DPI.
* The lower half of the top-bar can be hided by dragging the lower top-bar edge up. Better hiding options are planned (e.g. hide in fullscreen modes).
* Info editors at the top of the window and using the full window width with be replaced by the top-bar.
* In fullscreen modes, no more info editor is added on top, the top-bar replaces it.
== Technical Features/Changes
* Adds initial support for global areas
A global area is part of the window, not part of the regular screen-layout.
I've added a macro iterator to iterate over both, global and screen-layout level areas. When iterating over areas, from now on developers should always consider if they have to include global areas.
* Adds a TOPBAR editor type
The editor type is hidden in the UI editor type menu.
* Adds a variation of the ID template to display IDs as tab buttons (template_ID_tabs in BPY)
* Does various changes to RNA button creation code to improve their appearance in the horizontal top-bar.
* Adds support for dynamically sized regions. That is, regions that scale automatically to the layout bounds.
The code for this is currently a big hack (it's based on drawing the UI multiple times). This should definitely be improved.
* Adds a template for displaying operator properties optimized for the top-bar. This will probably change a lot still and is in fact disabled in code.
Since the final top-bar design depends a lot on other 2.8 designs (mainly tool-system and workspaces), we decided to not show the operator or tool settings in the top-bar for now. That means most of the lower sub-bar is empty for the time being.
NOTE: Top-bar or global area data is not written to files or SDNA. They are simply added to the window when opening Blender or reading a file. This allows us doing changes to the top-bar without having to care for compatibility.
== ToDo's
It's a bit hard to predict all the ToDo's here are the known main ones:
* Add options for the new active-tool system and for operator redo to the topbar.
* Automatically hide the top-bar in fullscreen modes.
* General visual polish.
* Top-bar drag & drop support (WIP in temp-tab_drag_drop).
* Improve dynamic regions (should also fix some layout glitches).
* Make internal terminology consistent.
* Enable topbar file writing once design is more advanced.
* Address TODO's and XXX's in code :)
Thanks @brecht for the review! And @sergey for the complaining ;)
Differential Revision: D2758
2018-04-20 17:14:03 +02:00
|
|
|
#define ED_screen_areas_iter(win, screen, area_name) \
|
2018-04-24 19:59:48 +02:00
|
|
|
for (ScrArea *area_name = ED_screen_areas_iter_first(win, screen); area_name != NULL; \
|
|
|
|
|
area_name = ED_screen_areas_iter_next(screen, area_name))
|
UI: New Global Top-Bar (WIP)
== Main Features/Changes for Users
* Add horizontal bar at top of all non-temp windows, consisting out of two horizontal sub-bars.
* Upper sub-bar contains global menus (File, Render, etc.), tabs for workspaces and scene selector.
* Lower sub-bar contains object mode selector, screen-layout and render-layer selector. Later operator and/or tool settings will be placed here.
* Individual sections of the topbar are individually scrollable.
* Workspace tabs can be double- or ctrl-clicked for renaming and contain 'x' icon for deleting.
* Top-bar should scale nicely with DPI.
* The lower half of the top-bar can be hided by dragging the lower top-bar edge up. Better hiding options are planned (e.g. hide in fullscreen modes).
* Info editors at the top of the window and using the full window width with be replaced by the top-bar.
* In fullscreen modes, no more info editor is added on top, the top-bar replaces it.
== Technical Features/Changes
* Adds initial support for global areas
A global area is part of the window, not part of the regular screen-layout.
I've added a macro iterator to iterate over both, global and screen-layout level areas. When iterating over areas, from now on developers should always consider if they have to include global areas.
* Adds a TOPBAR editor type
The editor type is hidden in the UI editor type menu.
* Adds a variation of the ID template to display IDs as tab buttons (template_ID_tabs in BPY)
* Does various changes to RNA button creation code to improve their appearance in the horizontal top-bar.
* Adds support for dynamically sized regions. That is, regions that scale automatically to the layout bounds.
The code for this is currently a big hack (it's based on drawing the UI multiple times). This should definitely be improved.
* Adds a template for displaying operator properties optimized for the top-bar. This will probably change a lot still and is in fact disabled in code.
Since the final top-bar design depends a lot on other 2.8 designs (mainly tool-system and workspaces), we decided to not show the operator or tool settings in the top-bar for now. That means most of the lower sub-bar is empty for the time being.
NOTE: Top-bar or global area data is not written to files or SDNA. They are simply added to the window when opening Blender or reading a file. This allows us doing changes to the top-bar without having to care for compatibility.
== ToDo's
It's a bit hard to predict all the ToDo's here are the known main ones:
* Add options for the new active-tool system and for operator redo to the topbar.
* Automatically hide the top-bar in fullscreen modes.
* General visual polish.
* Top-bar drag & drop support (WIP in temp-tab_drag_drop).
* Improve dynamic regions (should also fix some layout glitches).
* Make internal terminology consistent.
* Enable topbar file writing once design is more advanced.
* Address TODO's and XXX's in code :)
Thanks @brecht for the review! And @sergey for the complaining ;)
Differential Revision: D2758
2018-04-20 17:14:03 +02:00
|
|
|
#define ED_screen_verts_iter(win, screen, vert_name) \
|
|
|
|
|
for (ScrVert *vert_name = (win)->global_areas.vertbase.first ? \
|
|
|
|
|
(win)->global_areas.vertbase.first : \
|
2020-04-05 13:53:24 +10:00
|
|
|
(screen)->vertbase.first; \
|
UI: New Global Top-Bar (WIP)
== Main Features/Changes for Users
* Add horizontal bar at top of all non-temp windows, consisting out of two horizontal sub-bars.
* Upper sub-bar contains global menus (File, Render, etc.), tabs for workspaces and scene selector.
* Lower sub-bar contains object mode selector, screen-layout and render-layer selector. Later operator and/or tool settings will be placed here.
* Individual sections of the topbar are individually scrollable.
* Workspace tabs can be double- or ctrl-clicked for renaming and contain 'x' icon for deleting.
* Top-bar should scale nicely with DPI.
* The lower half of the top-bar can be hided by dragging the lower top-bar edge up. Better hiding options are planned (e.g. hide in fullscreen modes).
* Info editors at the top of the window and using the full window width with be replaced by the top-bar.
* In fullscreen modes, no more info editor is added on top, the top-bar replaces it.
== Technical Features/Changes
* Adds initial support for global areas
A global area is part of the window, not part of the regular screen-layout.
I've added a macro iterator to iterate over both, global and screen-layout level areas. When iterating over areas, from now on developers should always consider if they have to include global areas.
* Adds a TOPBAR editor type
The editor type is hidden in the UI editor type menu.
* Adds a variation of the ID template to display IDs as tab buttons (template_ID_tabs in BPY)
* Does various changes to RNA button creation code to improve their appearance in the horizontal top-bar.
* Adds support for dynamically sized regions. That is, regions that scale automatically to the layout bounds.
The code for this is currently a big hack (it's based on drawing the UI multiple times). This should definitely be improved.
* Adds a template for displaying operator properties optimized for the top-bar. This will probably change a lot still and is in fact disabled in code.
Since the final top-bar design depends a lot on other 2.8 designs (mainly tool-system and workspaces), we decided to not show the operator or tool settings in the top-bar for now. That means most of the lower sub-bar is empty for the time being.
NOTE: Top-bar or global area data is not written to files or SDNA. They are simply added to the window when opening Blender or reading a file. This allows us doing changes to the top-bar without having to care for compatibility.
== ToDo's
It's a bit hard to predict all the ToDo's here are the known main ones:
* Add options for the new active-tool system and for operator redo to the topbar.
* Automatically hide the top-bar in fullscreen modes.
* General visual polish.
* Top-bar drag & drop support (WIP in temp-tab_drag_drop).
* Improve dynamic regions (should also fix some layout glitches).
* Make internal terminology consistent.
* Enable topbar file writing once design is more advanced.
* Address TODO's and XXX's in code :)
Thanks @brecht for the review! And @sergey for the complaining ;)
Differential Revision: D2758
2018-04-20 17:14:03 +02:00
|
|
|
vert_name != NULL; \
|
|
|
|
|
vert_name = (vert_name == (win)->global_areas.vertbase.last) ? (screen)->vertbase.first : \
|
|
|
|
|
vert_name->next)
|
2008-01-07 18:03:41 +00:00
|
|
|
|
|
|
|
|
/* screens */
|
2021-12-09 00:55:11 +11:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* File read, set all screens, ....
|
|
|
|
|
*/
|
2020-08-01 13:02:21 +10:00
|
|
|
void ED_screens_init(struct Main *bmain, struct wmWindowManager *wm);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Only for edge lines between areas.
|
|
|
|
|
*/
|
2018-01-19 17:14:27 +11:00
|
|
|
void ED_screen_draw_edges(struct wmWindow *win);
|
2021-12-09 00:55:11 +11:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Make this screen usable.
|
|
|
|
|
* for file read and first use, for scaling window, area moves.
|
|
|
|
|
*/
|
2012-05-12 20:39:39 +00:00
|
|
|
void ED_screen_refresh(struct wmWindowManager *wm, struct wmWindow *win);
|
UI: New Global Top-Bar (WIP)
== Main Features/Changes for Users
* Add horizontal bar at top of all non-temp windows, consisting out of two horizontal sub-bars.
* Upper sub-bar contains global menus (File, Render, etc.), tabs for workspaces and scene selector.
* Lower sub-bar contains object mode selector, screen-layout and render-layer selector. Later operator and/or tool settings will be placed here.
* Individual sections of the topbar are individually scrollable.
* Workspace tabs can be double- or ctrl-clicked for renaming and contain 'x' icon for deleting.
* Top-bar should scale nicely with DPI.
* The lower half of the top-bar can be hided by dragging the lower top-bar edge up. Better hiding options are planned (e.g. hide in fullscreen modes).
* Info editors at the top of the window and using the full window width with be replaced by the top-bar.
* In fullscreen modes, no more info editor is added on top, the top-bar replaces it.
== Technical Features/Changes
* Adds initial support for global areas
A global area is part of the window, not part of the regular screen-layout.
I've added a macro iterator to iterate over both, global and screen-layout level areas. When iterating over areas, from now on developers should always consider if they have to include global areas.
* Adds a TOPBAR editor type
The editor type is hidden in the UI editor type menu.
* Adds a variation of the ID template to display IDs as tab buttons (template_ID_tabs in BPY)
* Does various changes to RNA button creation code to improve their appearance in the horizontal top-bar.
* Adds support for dynamically sized regions. That is, regions that scale automatically to the layout bounds.
The code for this is currently a big hack (it's based on drawing the UI multiple times). This should definitely be improved.
* Adds a template for displaying operator properties optimized for the top-bar. This will probably change a lot still and is in fact disabled in code.
Since the final top-bar design depends a lot on other 2.8 designs (mainly tool-system and workspaces), we decided to not show the operator or tool settings in the top-bar for now. That means most of the lower sub-bar is empty for the time being.
NOTE: Top-bar or global area data is not written to files or SDNA. They are simply added to the window when opening Blender or reading a file. This allows us doing changes to the top-bar without having to care for compatibility.
== ToDo's
It's a bit hard to predict all the ToDo's here are the known main ones:
* Add options for the new active-tool system and for operator redo to the topbar.
* Automatically hide the top-bar in fullscreen modes.
* General visual polish.
* Top-bar drag & drop support (WIP in temp-tab_drag_drop).
* Improve dynamic regions (should also fix some layout glitches).
* Make internal terminology consistent.
* Enable topbar file writing once design is more advanced.
* Address TODO's and XXX's in code :)
Thanks @brecht for the review! And @sergey for the complaining ;)
Differential Revision: D2758
2018-04-20 17:14:03 +02:00
|
|
|
void ED_screen_ensure_updated(struct wmWindowManager *wm,
|
|
|
|
|
struct wmWindow *win,
|
|
|
|
|
struct bScreen *screen);
|
2022-08-27 12:50:43 +10:00
|
|
|
void ED_screen_do_listen(struct bContext *C, const struct wmNotifier *note);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* \brief Change the active screen.
|
|
|
|
|
*
|
|
|
|
|
* Operator call, WM + Window + screen already existed before
|
|
|
|
|
*
|
|
|
|
|
* \warning Do NOT call in area/region queues!
|
|
|
|
|
* \returns if screen changing was successful.
|
|
|
|
|
*/
|
2020-04-03 14:23:21 +02:00
|
|
|
bool ED_screen_change(struct bContext *C, struct bScreen *screen);
|
2021-10-22 10:12:01 +11:00
|
|
|
void ED_screen_scene_change(struct bContext *C,
|
|
|
|
|
struct wmWindow *win,
|
|
|
|
|
struct Scene *scene,
|
2022-01-07 11:38:08 +11:00
|
|
|
bool refresh_toolsystem);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Called in wm_event_system.c. sets state vars in screen, cursors.
|
|
|
|
|
* event type is mouse move.
|
|
|
|
|
*/
|
2018-05-17 10:56:36 +02:00
|
|
|
void ED_screen_set_active_region(struct bContext *C, struct wmWindow *win, const int xy[2]);
|
2012-05-12 20:39:39 +00:00
|
|
|
void ED_screen_exit(struct bContext *C, struct wmWindow *window, struct bScreen *screen);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* redraws: uses defines from `stime->redraws`
|
|
|
|
|
* \param enable: 1 - forward on, -1 - backwards on, 0 - off.
|
|
|
|
|
*/
|
2020-02-22 03:00:23 +11:00
|
|
|
void ED_screen_animation_timer(struct bContext *C, int redraws, int sync, int enable);
|
|
|
|
|
void ED_screen_animation_timer_update(struct bScreen *screen, int redraws);
|
2020-04-03 13:25:03 +02:00
|
|
|
void ED_screen_restore_temp_type(struct bContext *C, ScrArea *area);
|
|
|
|
|
ScrArea *ED_screen_full_newspace(struct bContext *C, ScrArea *area, int type);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* \a was_prev_temp for the case previous space was a temporary full-screen as well
|
|
|
|
|
*/
|
2020-04-03 13:25:03 +02:00
|
|
|
void ED_screen_full_prevspace(struct bContext *C, ScrArea *area);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Restore a screen / area back to default operation, after temp full-screen modes.
|
|
|
|
|
*/
|
2020-04-03 13:25:03 +02:00
|
|
|
void ED_screen_full_restore(struct bContext *C, ScrArea *area);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Create a new temporary screen with a maximized, empty area.
|
|
|
|
|
* This can be closed with #ED_screen_state_toggle().
|
|
|
|
|
*
|
|
|
|
|
* Use this to just create a new maximized screen/area, rather than maximizing an existing one.
|
|
|
|
|
* Otherwise, maximize with #ED_screen_state_toggle().
|
|
|
|
|
*/
|
2021-06-16 12:30:48 +10:00
|
|
|
bScreen *ED_screen_state_maximized_create(struct bContext *C);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* This function toggles: if area is maximized/full then the parent will be restored.
|
|
|
|
|
*
|
|
|
|
|
* Use #ED_screen_state_maximized_create() if you do not want the toggle behavior when changing to
|
|
|
|
|
* a maximized area. I.e. if you just want to open a new maximized screen/area, not maximize a
|
|
|
|
|
* specific area. In the former case, space data of the maximized and non-maximized area should be
|
|
|
|
|
* independent, in the latter it should be the same.
|
|
|
|
|
*
|
|
|
|
|
* \warning \a area may be freed.
|
|
|
|
|
*/
|
2014-10-14 15:05:44 -03:00
|
|
|
struct ScrArea *ED_screen_state_toggle(struct bContext *C,
|
|
|
|
|
struct wmWindow *win,
|
2020-04-03 13:25:03 +02:00
|
|
|
struct ScrArea *area,
|
2022-01-07 11:38:08 +11:00
|
|
|
short state);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
2022-09-16 18:13:19 +10:00
|
|
|
* Wrapper to open a temporary space either as full-screen space, or as separate window,
|
|
|
|
|
* as defined by \a display_type.
|
2021-12-09 00:55:11 +11:00
|
|
|
*
|
|
|
|
|
* \param title: Title to set for the window, if a window is spawned.
|
|
|
|
|
* \param x, y: Position of the window, if a window is spawned.
|
|
|
|
|
* \param sizex, sizey: Dimensions of the window, if a window is spawned.
|
|
|
|
|
*/
|
2019-09-18 14:21:32 +02:00
|
|
|
ScrArea *ED_screen_temp_space_open(struct bContext *C,
|
|
|
|
|
const char *title,
|
|
|
|
|
int x,
|
|
|
|
|
int y,
|
|
|
|
|
int sizex,
|
|
|
|
|
int sizey,
|
|
|
|
|
eSpace_Type space_type,
|
UI: Register File Browser as Child/Dialog-Window for the OS
For many users, this will make the File Browser window behave more like
what they would expect. It addresses the issue of the File Browser
becoming hidden behind the main window by clicking anywhere in the
latter. It communicates the interruptive, but temporary nature of the
operation a bit better.
Further, on tiling window managers the File Browser now opens as
floating by default, like in other applications.
Note that this also makes sure the File Browser is always opened as
separate window, so it doesn't re-use the Preferences, or any other
temporary window anymore. This seems to have been a common annoyance.
More concretely, this makes the File Browser window behave as follows:
* Stays on top of its parent Blender window, but not on top of
non-Blender windows.
* Minimizes with its parent window
* Can be moved independently
* Doesn't add an own item in task bars
* Doesn't block other Blender windows (we may want to have this though)
* Opens as floating window for tiling window managers (e.g. i3wm/Sway)
Further notes:
* When opening a file browser from the Preference window (or any
temporary window), the main window, as the file browsers parent is
moved on top of the Preferences, which makes it seem like the
Preferences were closed. This is the general issue of bad secondary
window handling as window activation changes. I made it so that the
window is moved back once the file browser is closed.
This behavior is confusing and would be nice to avoid. It's a separate
issue though.
* On most window managers on Linux the temporary window can not be
minimized and maximized, they disable that for dialog windows.
* On Windows and macOS, only minimizing is disabled, as there is no
decent way yet to restore a window if it's not shown in the taskbar.
Reviewed By: Brecht van Lommel, Campbell Barton, William Reynish
Edits and macOS implementation by Brecht.
Differential Revision: https://developer.blender.org/D5810
Part of T69652.
2019-10-03 16:59:49 +02:00
|
|
|
int display_type,
|
|
|
|
|
bool dialog);
|
2012-09-19 18:47:41 +00:00
|
|
|
void ED_screens_header_tools_menu_create(struct bContext *C, struct uiLayout *layout, void *arg);
|
2019-04-05 13:48:26 +02:00
|
|
|
void ED_screens_footer_tools_menu_create(struct bContext *C, struct uiLayout *layout, void *arg);
|
2018-10-31 00:41:03 +01:00
|
|
|
void ED_screens_navigation_bar_tools_menu_create(struct bContext *C,
|
|
|
|
|
struct uiLayout *layout,
|
|
|
|
|
void *arg);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* \return true if any active area requires to see in 3D.
|
|
|
|
|
*/
|
Main Workspace Integration
This commit does the main integration of workspaces, which is a design we agreed on during the 2.8 UI workshop (see https://wiki.blender.org/index.php/Dev:2.8/UI/Workshop_Writeup)
Workspaces should generally be stable, I'm not aware of any remaining bugs (or I've forgotten them :) ). If you find any, let me know!
(Exception: mode switching button might get out of sync with actual mode in some cases, would consider that a limitation/ToDo. Needs to be resolved at some point.)
== Main Changes/Features
* Introduces the new Workspaces as data-blocks.
* Allow storing a number of custom workspaces as part of the user configuration. Needs further work to allow adding and deleting individual workspaces.
* Bundle a default workspace configuration with Blender (current screen-layouts converted to workspaces).
* Pressing button to add a workspace spawns a menu to select between "Duplicate Current" and the workspaces from the user configuration. If no workspaces are stored in the user configuration, the default workspaces are listed instead.
* Store screen-layouts (`bScreen`) per workspace.
* Store an active screen-layout per workspace. Changing the workspace will enable this layout.
* Store active mode in workspace. Changing the workspace will also enter the mode of the new workspace. (Note that we still store the active mode in the object, moving this completely to workspaces is a separate project.)
* Store an active render layer per workspace.
* Moved mode switch from 3D View header to Info Editor header.
* Store active scene in window (not directly workspace related, but overlaps quite a bit).
* Removed 'Use Global Scene' User Preference option.
* Compatibility with old files - a new workspace is created for every screen-layout of old files. Old Blender versions should be able to read files saved with workspace support as well.
* Default .blend only contains one workspace ("General").
* Support appending workspaces.
Opening files without UI and commandline rendering should work fine.
Note that the UI is temporary! We plan to introduce a new global topbar
that contains the workspace options and tabs for switching workspaces.
== Technical Notes
* Workspaces are data-blocks.
* Adding and removing `bScreen`s should be done through `ED_workspace_layout` API now.
* A workspace can be active in multiple windows at the same time.
* The mode menu (which is now in the Info Editor header) doesn't display "Grease Pencil Edit" mode anymore since its availability depends on the active editor. Will be fixed by making Grease Pencil an own object type (as planned).
* The button to change the active workspace object mode may get out of sync with the mode of the active object. Will either be resolved by moving mode out of object data, or we'll disable workspace modes again (there's a `#define USE_WORKSPACE_MODE` for that).
* Screen-layouts (`bScreen`) are IDs and thus stored in a main list-base. Had to add a wrapper `WorkSpaceLayout` so we can store them in a list-base within workspaces, too. On the long run we could completely replace `bScreen` by workspace structs.
* `WorkSpace` types use some special compiler trickery to allow marking structs and struct members as private. BKE_workspace API should be used for accessing those.
* Added scene operators `SCENE_OT_`. Was previously done through screen operators.
== BPY API Changes
* Removed `Screen.scene`, added `Window.scene`
* Removed `UserPreferencesView.use_global_scene`
* Added `Context.workspace`, `Window.workspace` and `BlendData.workspaces`
* Added `bpy.types.WorkSpace` containing `screens`, `object_mode` and `render_layer`
* Added Screen.layout_name for the layout name that'll be displayed in the UI (may differ from internal name)
== What's left?
* There are a few open design questions (T50521). We should find the needed answers and implement them.
* Allow adding and removing individual workspaces from workspace configuration (needs UI design).
* Get the override system ready and support overrides per workspace.
* Support custom UI setups as part of workspaces (hidden panels, hidden buttons, customizable toolbars, etc).
* Allow enabling add-ons per workspace.
* Support custom workspace keymaps.
* Remove special exception for workspaces in linking code (so they're always appended, never linked). Depends on a few things, so best to solve later.
* Get the topbar done.
* Workspaces need a proper icon, current one is just a placeholder :)
Reviewed By: campbellbarton, mont29
Tags: #user_interface, #bf_blender_2.8
Maniphest Tasks: T50521
Differential Revision: https://developer.blender.org/D2451
2017-06-01 19:56:58 +02:00
|
|
|
bool ED_screen_stereo3d_required(const struct bScreen *screen, const struct Scene *scene);
|
|
|
|
|
Scene *ED_screen_scene_find(const struct bScreen *screen, const struct wmWindowManager *wm);
|
2021-12-10 21:42:06 +11:00
|
|
|
/**
|
|
|
|
|
* Find the scene displayed in \a screen.
|
|
|
|
|
* \note Assumes \a screen to be visible/active!
|
|
|
|
|
*/
|
2018-02-08 21:14:26 +11:00
|
|
|
Scene *ED_screen_scene_find_with_window(const struct bScreen *screen,
|
|
|
|
|
const struct wmWindowManager *wm,
|
|
|
|
|
struct wmWindow **r_window);
|
2019-03-18 14:40:29 +00:00
|
|
|
ScrArea *ED_screen_area_find_with_spacedata(const bScreen *screen,
|
|
|
|
|
const struct SpaceLink *sl,
|
2022-01-07 11:38:08 +11:00
|
|
|
bool only_visible);
|
2018-02-13 20:35:29 +11:00
|
|
|
struct wmWindow *ED_screen_window_find(const struct bScreen *screen,
|
|
|
|
|
const struct wmWindowManager *wm);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Render the preview for a screen layout in \a screen.
|
|
|
|
|
*/
|
2016-12-01 16:43:57 +01:00
|
|
|
void ED_screen_preview_render(const struct bScreen *screen,
|
|
|
|
|
int size_x,
|
|
|
|
|
int size_y,
|
|
|
|
|
unsigned int *r_rect) ATTR_NONNULL();
|
2009-01-06 18:52:18 +00:00
|
|
|
|
Main Workspace Integration
This commit does the main integration of workspaces, which is a design we agreed on during the 2.8 UI workshop (see https://wiki.blender.org/index.php/Dev:2.8/UI/Workshop_Writeup)
Workspaces should generally be stable, I'm not aware of any remaining bugs (or I've forgotten them :) ). If you find any, let me know!
(Exception: mode switching button might get out of sync with actual mode in some cases, would consider that a limitation/ToDo. Needs to be resolved at some point.)
== Main Changes/Features
* Introduces the new Workspaces as data-blocks.
* Allow storing a number of custom workspaces as part of the user configuration. Needs further work to allow adding and deleting individual workspaces.
* Bundle a default workspace configuration with Blender (current screen-layouts converted to workspaces).
* Pressing button to add a workspace spawns a menu to select between "Duplicate Current" and the workspaces from the user configuration. If no workspaces are stored in the user configuration, the default workspaces are listed instead.
* Store screen-layouts (`bScreen`) per workspace.
* Store an active screen-layout per workspace. Changing the workspace will enable this layout.
* Store active mode in workspace. Changing the workspace will also enter the mode of the new workspace. (Note that we still store the active mode in the object, moving this completely to workspaces is a separate project.)
* Store an active render layer per workspace.
* Moved mode switch from 3D View header to Info Editor header.
* Store active scene in window (not directly workspace related, but overlaps quite a bit).
* Removed 'Use Global Scene' User Preference option.
* Compatibility with old files - a new workspace is created for every screen-layout of old files. Old Blender versions should be able to read files saved with workspace support as well.
* Default .blend only contains one workspace ("General").
* Support appending workspaces.
Opening files without UI and commandline rendering should work fine.
Note that the UI is temporary! We plan to introduce a new global topbar
that contains the workspace options and tabs for switching workspaces.
== Technical Notes
* Workspaces are data-blocks.
* Adding and removing `bScreen`s should be done through `ED_workspace_layout` API now.
* A workspace can be active in multiple windows at the same time.
* The mode menu (which is now in the Info Editor header) doesn't display "Grease Pencil Edit" mode anymore since its availability depends on the active editor. Will be fixed by making Grease Pencil an own object type (as planned).
* The button to change the active workspace object mode may get out of sync with the mode of the active object. Will either be resolved by moving mode out of object data, or we'll disable workspace modes again (there's a `#define USE_WORKSPACE_MODE` for that).
* Screen-layouts (`bScreen`) are IDs and thus stored in a main list-base. Had to add a wrapper `WorkSpaceLayout` so we can store them in a list-base within workspaces, too. On the long run we could completely replace `bScreen` by workspace structs.
* `WorkSpace` types use some special compiler trickery to allow marking structs and struct members as private. BKE_workspace API should be used for accessing those.
* Added scene operators `SCENE_OT_`. Was previously done through screen operators.
== BPY API Changes
* Removed `Screen.scene`, added `Window.scene`
* Removed `UserPreferencesView.use_global_scene`
* Added `Context.workspace`, `Window.workspace` and `BlendData.workspaces`
* Added `bpy.types.WorkSpace` containing `screens`, `object_mode` and `render_layer`
* Added Screen.layout_name for the layout name that'll be displayed in the UI (may differ from internal name)
== What's left?
* There are a few open design questions (T50521). We should find the needed answers and implement them.
* Allow adding and removing individual workspaces from workspace configuration (needs UI design).
* Get the override system ready and support overrides per workspace.
* Support custom UI setups as part of workspaces (hidden panels, hidden buttons, customizable toolbars, etc).
* Allow enabling add-ons per workspace.
* Support custom workspace keymaps.
* Remove special exception for workspaces in linking code (so they're always appended, never linked). Depends on a few things, so best to solve later.
* Get the topbar done.
* Workspaces need a proper icon, current one is just a placeholder :)
Reviewed By: campbellbarton, mont29
Tags: #user_interface, #bf_blender_2.8
Maniphest Tasks: T50521
Differential Revision: https://developer.blender.org/D2451
2017-06-01 19:56:58 +02:00
|
|
|
/* workspaces */
|
2021-12-09 00:55:11 +11:00
|
|
|
|
Main Workspace Integration
This commit does the main integration of workspaces, which is a design we agreed on during the 2.8 UI workshop (see https://wiki.blender.org/index.php/Dev:2.8/UI/Workshop_Writeup)
Workspaces should generally be stable, I'm not aware of any remaining bugs (or I've forgotten them :) ). If you find any, let me know!
(Exception: mode switching button might get out of sync with actual mode in some cases, would consider that a limitation/ToDo. Needs to be resolved at some point.)
== Main Changes/Features
* Introduces the new Workspaces as data-blocks.
* Allow storing a number of custom workspaces as part of the user configuration. Needs further work to allow adding and deleting individual workspaces.
* Bundle a default workspace configuration with Blender (current screen-layouts converted to workspaces).
* Pressing button to add a workspace spawns a menu to select between "Duplicate Current" and the workspaces from the user configuration. If no workspaces are stored in the user configuration, the default workspaces are listed instead.
* Store screen-layouts (`bScreen`) per workspace.
* Store an active screen-layout per workspace. Changing the workspace will enable this layout.
* Store active mode in workspace. Changing the workspace will also enter the mode of the new workspace. (Note that we still store the active mode in the object, moving this completely to workspaces is a separate project.)
* Store an active render layer per workspace.
* Moved mode switch from 3D View header to Info Editor header.
* Store active scene in window (not directly workspace related, but overlaps quite a bit).
* Removed 'Use Global Scene' User Preference option.
* Compatibility with old files - a new workspace is created for every screen-layout of old files. Old Blender versions should be able to read files saved with workspace support as well.
* Default .blend only contains one workspace ("General").
* Support appending workspaces.
Opening files without UI and commandline rendering should work fine.
Note that the UI is temporary! We plan to introduce a new global topbar
that contains the workspace options and tabs for switching workspaces.
== Technical Notes
* Workspaces are data-blocks.
* Adding and removing `bScreen`s should be done through `ED_workspace_layout` API now.
* A workspace can be active in multiple windows at the same time.
* The mode menu (which is now in the Info Editor header) doesn't display "Grease Pencil Edit" mode anymore since its availability depends on the active editor. Will be fixed by making Grease Pencil an own object type (as planned).
* The button to change the active workspace object mode may get out of sync with the mode of the active object. Will either be resolved by moving mode out of object data, or we'll disable workspace modes again (there's a `#define USE_WORKSPACE_MODE` for that).
* Screen-layouts (`bScreen`) are IDs and thus stored in a main list-base. Had to add a wrapper `WorkSpaceLayout` so we can store them in a list-base within workspaces, too. On the long run we could completely replace `bScreen` by workspace structs.
* `WorkSpace` types use some special compiler trickery to allow marking structs and struct members as private. BKE_workspace API should be used for accessing those.
* Added scene operators `SCENE_OT_`. Was previously done through screen operators.
== BPY API Changes
* Removed `Screen.scene`, added `Window.scene`
* Removed `UserPreferencesView.use_global_scene`
* Added `Context.workspace`, `Window.workspace` and `BlendData.workspaces`
* Added `bpy.types.WorkSpace` containing `screens`, `object_mode` and `render_layer`
* Added Screen.layout_name for the layout name that'll be displayed in the UI (may differ from internal name)
== What's left?
* There are a few open design questions (T50521). We should find the needed answers and implement them.
* Allow adding and removing individual workspaces from workspace configuration (needs UI design).
* Get the override system ready and support overrides per workspace.
* Support custom UI setups as part of workspaces (hidden panels, hidden buttons, customizable toolbars, etc).
* Allow enabling add-ons per workspace.
* Support custom workspace keymaps.
* Remove special exception for workspaces in linking code (so they're always appended, never linked). Depends on a few things, so best to solve later.
* Get the topbar done.
* Workspaces need a proper icon, current one is just a placeholder :)
Reviewed By: campbellbarton, mont29
Tags: #user_interface, #bf_blender_2.8
Maniphest Tasks: T50521
Differential Revision: https://developer.blender.org/D2451
2017-06-01 19:56:58 +02:00
|
|
|
struct WorkSpace *ED_workspace_add(struct Main *bmain, const char *name) ATTR_NONNULL();
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* \brief Change the active workspace.
|
|
|
|
|
*
|
|
|
|
|
* Operator call, WM + Window + screen already existed before
|
|
|
|
|
* Pretty similar to #ED_screen_change since changing workspace also changes screen.
|
|
|
|
|
*
|
|
|
|
|
* \warning Do NOT call in area/region queues!
|
|
|
|
|
* \returns if workspace changing was successful.
|
|
|
|
|
*/
|
Main Workspace Integration
This commit does the main integration of workspaces, which is a design we agreed on during the 2.8 UI workshop (see https://wiki.blender.org/index.php/Dev:2.8/UI/Workshop_Writeup)
Workspaces should generally be stable, I'm not aware of any remaining bugs (or I've forgotten them :) ). If you find any, let me know!
(Exception: mode switching button might get out of sync with actual mode in some cases, would consider that a limitation/ToDo. Needs to be resolved at some point.)
== Main Changes/Features
* Introduces the new Workspaces as data-blocks.
* Allow storing a number of custom workspaces as part of the user configuration. Needs further work to allow adding and deleting individual workspaces.
* Bundle a default workspace configuration with Blender (current screen-layouts converted to workspaces).
* Pressing button to add a workspace spawns a menu to select between "Duplicate Current" and the workspaces from the user configuration. If no workspaces are stored in the user configuration, the default workspaces are listed instead.
* Store screen-layouts (`bScreen`) per workspace.
* Store an active screen-layout per workspace. Changing the workspace will enable this layout.
* Store active mode in workspace. Changing the workspace will also enter the mode of the new workspace. (Note that we still store the active mode in the object, moving this completely to workspaces is a separate project.)
* Store an active render layer per workspace.
* Moved mode switch from 3D View header to Info Editor header.
* Store active scene in window (not directly workspace related, but overlaps quite a bit).
* Removed 'Use Global Scene' User Preference option.
* Compatibility with old files - a new workspace is created for every screen-layout of old files. Old Blender versions should be able to read files saved with workspace support as well.
* Default .blend only contains one workspace ("General").
* Support appending workspaces.
Opening files without UI and commandline rendering should work fine.
Note that the UI is temporary! We plan to introduce a new global topbar
that contains the workspace options and tabs for switching workspaces.
== Technical Notes
* Workspaces are data-blocks.
* Adding and removing `bScreen`s should be done through `ED_workspace_layout` API now.
* A workspace can be active in multiple windows at the same time.
* The mode menu (which is now in the Info Editor header) doesn't display "Grease Pencil Edit" mode anymore since its availability depends on the active editor. Will be fixed by making Grease Pencil an own object type (as planned).
* The button to change the active workspace object mode may get out of sync with the mode of the active object. Will either be resolved by moving mode out of object data, or we'll disable workspace modes again (there's a `#define USE_WORKSPACE_MODE` for that).
* Screen-layouts (`bScreen`) are IDs and thus stored in a main list-base. Had to add a wrapper `WorkSpaceLayout` so we can store them in a list-base within workspaces, too. On the long run we could completely replace `bScreen` by workspace structs.
* `WorkSpace` types use some special compiler trickery to allow marking structs and struct members as private. BKE_workspace API should be used for accessing those.
* Added scene operators `SCENE_OT_`. Was previously done through screen operators.
== BPY API Changes
* Removed `Screen.scene`, added `Window.scene`
* Removed `UserPreferencesView.use_global_scene`
* Added `Context.workspace`, `Window.workspace` and `BlendData.workspaces`
* Added `bpy.types.WorkSpace` containing `screens`, `object_mode` and `render_layer`
* Added Screen.layout_name for the layout name that'll be displayed in the UI (may differ from internal name)
== What's left?
* There are a few open design questions (T50521). We should find the needed answers and implement them.
* Allow adding and removing individual workspaces from workspace configuration (needs UI design).
* Get the override system ready and support overrides per workspace.
* Support custom UI setups as part of workspaces (hidden panels, hidden buttons, customizable toolbars, etc).
* Allow enabling add-ons per workspace.
* Support custom workspace keymaps.
* Remove special exception for workspaces in linking code (so they're always appended, never linked). Depends on a few things, so best to solve later.
* Get the topbar done.
* Workspaces need a proper icon, current one is just a placeholder :)
Reviewed By: campbellbarton, mont29
Tags: #user_interface, #bf_blender_2.8
Maniphest Tasks: T50521
Differential Revision: https://developer.blender.org/D2451
2017-06-01 19:56:58 +02:00
|
|
|
bool ED_workspace_change(struct WorkSpace *workspace_new,
|
|
|
|
|
struct bContext *C,
|
2018-04-05 18:20:27 +02:00
|
|
|
struct wmWindowManager *wm,
|
|
|
|
|
struct wmWindow *win) ATTR_NONNULL();
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Duplicate a workspace including its layouts. Does not activate the workspace, but
|
|
|
|
|
* it stores the screen-layout to be activated (BKE_workspace_temp_layout_store)
|
|
|
|
|
*/
|
Main Workspace Integration
This commit does the main integration of workspaces, which is a design we agreed on during the 2.8 UI workshop (see https://wiki.blender.org/index.php/Dev:2.8/UI/Workshop_Writeup)
Workspaces should generally be stable, I'm not aware of any remaining bugs (or I've forgotten them :) ). If you find any, let me know!
(Exception: mode switching button might get out of sync with actual mode in some cases, would consider that a limitation/ToDo. Needs to be resolved at some point.)
== Main Changes/Features
* Introduces the new Workspaces as data-blocks.
* Allow storing a number of custom workspaces as part of the user configuration. Needs further work to allow adding and deleting individual workspaces.
* Bundle a default workspace configuration with Blender (current screen-layouts converted to workspaces).
* Pressing button to add a workspace spawns a menu to select between "Duplicate Current" and the workspaces from the user configuration. If no workspaces are stored in the user configuration, the default workspaces are listed instead.
* Store screen-layouts (`bScreen`) per workspace.
* Store an active screen-layout per workspace. Changing the workspace will enable this layout.
* Store active mode in workspace. Changing the workspace will also enter the mode of the new workspace. (Note that we still store the active mode in the object, moving this completely to workspaces is a separate project.)
* Store an active render layer per workspace.
* Moved mode switch from 3D View header to Info Editor header.
* Store active scene in window (not directly workspace related, but overlaps quite a bit).
* Removed 'Use Global Scene' User Preference option.
* Compatibility with old files - a new workspace is created for every screen-layout of old files. Old Blender versions should be able to read files saved with workspace support as well.
* Default .blend only contains one workspace ("General").
* Support appending workspaces.
Opening files without UI and commandline rendering should work fine.
Note that the UI is temporary! We plan to introduce a new global topbar
that contains the workspace options and tabs for switching workspaces.
== Technical Notes
* Workspaces are data-blocks.
* Adding and removing `bScreen`s should be done through `ED_workspace_layout` API now.
* A workspace can be active in multiple windows at the same time.
* The mode menu (which is now in the Info Editor header) doesn't display "Grease Pencil Edit" mode anymore since its availability depends on the active editor. Will be fixed by making Grease Pencil an own object type (as planned).
* The button to change the active workspace object mode may get out of sync with the mode of the active object. Will either be resolved by moving mode out of object data, or we'll disable workspace modes again (there's a `#define USE_WORKSPACE_MODE` for that).
* Screen-layouts (`bScreen`) are IDs and thus stored in a main list-base. Had to add a wrapper `WorkSpaceLayout` so we can store them in a list-base within workspaces, too. On the long run we could completely replace `bScreen` by workspace structs.
* `WorkSpace` types use some special compiler trickery to allow marking structs and struct members as private. BKE_workspace API should be used for accessing those.
* Added scene operators `SCENE_OT_`. Was previously done through screen operators.
== BPY API Changes
* Removed `Screen.scene`, added `Window.scene`
* Removed `UserPreferencesView.use_global_scene`
* Added `Context.workspace`, `Window.workspace` and `BlendData.workspaces`
* Added `bpy.types.WorkSpace` containing `screens`, `object_mode` and `render_layer`
* Added Screen.layout_name for the layout name that'll be displayed in the UI (may differ from internal name)
== What's left?
* There are a few open design questions (T50521). We should find the needed answers and implement them.
* Allow adding and removing individual workspaces from workspace configuration (needs UI design).
* Get the override system ready and support overrides per workspace.
* Support custom UI setups as part of workspaces (hidden panels, hidden buttons, customizable toolbars, etc).
* Allow enabling add-ons per workspace.
* Support custom workspace keymaps.
* Remove special exception for workspaces in linking code (so they're always appended, never linked). Depends on a few things, so best to solve later.
* Get the topbar done.
* Workspaces need a proper icon, current one is just a placeholder :)
Reviewed By: campbellbarton, mont29
Tags: #user_interface, #bf_blender_2.8
Maniphest Tasks: T50521
Differential Revision: https://developer.blender.org/D2451
2017-06-01 19:56:58 +02:00
|
|
|
struct WorkSpace *ED_workspace_duplicate(struct WorkSpace *workspace_old,
|
|
|
|
|
struct Main *bmain,
|
|
|
|
|
struct wmWindow *win);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* \return if succeeded.
|
|
|
|
|
*/
|
Main Workspace Integration
This commit does the main integration of workspaces, which is a design we agreed on during the 2.8 UI workshop (see https://wiki.blender.org/index.php/Dev:2.8/UI/Workshop_Writeup)
Workspaces should generally be stable, I'm not aware of any remaining bugs (or I've forgotten them :) ). If you find any, let me know!
(Exception: mode switching button might get out of sync with actual mode in some cases, would consider that a limitation/ToDo. Needs to be resolved at some point.)
== Main Changes/Features
* Introduces the new Workspaces as data-blocks.
* Allow storing a number of custom workspaces as part of the user configuration. Needs further work to allow adding and deleting individual workspaces.
* Bundle a default workspace configuration with Blender (current screen-layouts converted to workspaces).
* Pressing button to add a workspace spawns a menu to select between "Duplicate Current" and the workspaces from the user configuration. If no workspaces are stored in the user configuration, the default workspaces are listed instead.
* Store screen-layouts (`bScreen`) per workspace.
* Store an active screen-layout per workspace. Changing the workspace will enable this layout.
* Store active mode in workspace. Changing the workspace will also enter the mode of the new workspace. (Note that we still store the active mode in the object, moving this completely to workspaces is a separate project.)
* Store an active render layer per workspace.
* Moved mode switch from 3D View header to Info Editor header.
* Store active scene in window (not directly workspace related, but overlaps quite a bit).
* Removed 'Use Global Scene' User Preference option.
* Compatibility with old files - a new workspace is created for every screen-layout of old files. Old Blender versions should be able to read files saved with workspace support as well.
* Default .blend only contains one workspace ("General").
* Support appending workspaces.
Opening files without UI and commandline rendering should work fine.
Note that the UI is temporary! We plan to introduce a new global topbar
that contains the workspace options and tabs for switching workspaces.
== Technical Notes
* Workspaces are data-blocks.
* Adding and removing `bScreen`s should be done through `ED_workspace_layout` API now.
* A workspace can be active in multiple windows at the same time.
* The mode menu (which is now in the Info Editor header) doesn't display "Grease Pencil Edit" mode anymore since its availability depends on the active editor. Will be fixed by making Grease Pencil an own object type (as planned).
* The button to change the active workspace object mode may get out of sync with the mode of the active object. Will either be resolved by moving mode out of object data, or we'll disable workspace modes again (there's a `#define USE_WORKSPACE_MODE` for that).
* Screen-layouts (`bScreen`) are IDs and thus stored in a main list-base. Had to add a wrapper `WorkSpaceLayout` so we can store them in a list-base within workspaces, too. On the long run we could completely replace `bScreen` by workspace structs.
* `WorkSpace` types use some special compiler trickery to allow marking structs and struct members as private. BKE_workspace API should be used for accessing those.
* Added scene operators `SCENE_OT_`. Was previously done through screen operators.
== BPY API Changes
* Removed `Screen.scene`, added `Window.scene`
* Removed `UserPreferencesView.use_global_scene`
* Added `Context.workspace`, `Window.workspace` and `BlendData.workspaces`
* Added `bpy.types.WorkSpace` containing `screens`, `object_mode` and `render_layer`
* Added Screen.layout_name for the layout name that'll be displayed in the UI (may differ from internal name)
== What's left?
* There are a few open design questions (T50521). We should find the needed answers and implement them.
* Allow adding and removing individual workspaces from workspace configuration (needs UI design).
* Get the override system ready and support overrides per workspace.
* Support custom UI setups as part of workspaces (hidden panels, hidden buttons, customizable toolbars, etc).
* Allow enabling add-ons per workspace.
* Support custom workspace keymaps.
* Remove special exception for workspaces in linking code (so they're always appended, never linked). Depends on a few things, so best to solve later.
* Get the topbar done.
* Workspaces need a proper icon, current one is just a placeholder :)
Reviewed By: campbellbarton, mont29
Tags: #user_interface, #bf_blender_2.8
Maniphest Tasks: T50521
Differential Revision: https://developer.blender.org/D2451
2017-06-01 19:56:58 +02:00
|
|
|
bool ED_workspace_delete(struct WorkSpace *workspace,
|
|
|
|
|
struct Main *bmain,
|
|
|
|
|
struct bContext *C,
|
2017-10-06 18:01:40 +02:00
|
|
|
struct wmWindowManager *wm) ATTR_NONNULL();
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Some editor data may need to be synced with scene data (3D View camera and layers).
|
|
|
|
|
* This function ensures data is synced for editors in active layout of \a workspace.
|
|
|
|
|
*/
|
Main Workspace Integration
This commit does the main integration of workspaces, which is a design we agreed on during the 2.8 UI workshop (see https://wiki.blender.org/index.php/Dev:2.8/UI/Workshop_Writeup)
Workspaces should generally be stable, I'm not aware of any remaining bugs (or I've forgotten them :) ). If you find any, let me know!
(Exception: mode switching button might get out of sync with actual mode in some cases, would consider that a limitation/ToDo. Needs to be resolved at some point.)
== Main Changes/Features
* Introduces the new Workspaces as data-blocks.
* Allow storing a number of custom workspaces as part of the user configuration. Needs further work to allow adding and deleting individual workspaces.
* Bundle a default workspace configuration with Blender (current screen-layouts converted to workspaces).
* Pressing button to add a workspace spawns a menu to select between "Duplicate Current" and the workspaces from the user configuration. If no workspaces are stored in the user configuration, the default workspaces are listed instead.
* Store screen-layouts (`bScreen`) per workspace.
* Store an active screen-layout per workspace. Changing the workspace will enable this layout.
* Store active mode in workspace. Changing the workspace will also enter the mode of the new workspace. (Note that we still store the active mode in the object, moving this completely to workspaces is a separate project.)
* Store an active render layer per workspace.
* Moved mode switch from 3D View header to Info Editor header.
* Store active scene in window (not directly workspace related, but overlaps quite a bit).
* Removed 'Use Global Scene' User Preference option.
* Compatibility with old files - a new workspace is created for every screen-layout of old files. Old Blender versions should be able to read files saved with workspace support as well.
* Default .blend only contains one workspace ("General").
* Support appending workspaces.
Opening files without UI and commandline rendering should work fine.
Note that the UI is temporary! We plan to introduce a new global topbar
that contains the workspace options and tabs for switching workspaces.
== Technical Notes
* Workspaces are data-blocks.
* Adding and removing `bScreen`s should be done through `ED_workspace_layout` API now.
* A workspace can be active in multiple windows at the same time.
* The mode menu (which is now in the Info Editor header) doesn't display "Grease Pencil Edit" mode anymore since its availability depends on the active editor. Will be fixed by making Grease Pencil an own object type (as planned).
* The button to change the active workspace object mode may get out of sync with the mode of the active object. Will either be resolved by moving mode out of object data, or we'll disable workspace modes again (there's a `#define USE_WORKSPACE_MODE` for that).
* Screen-layouts (`bScreen`) are IDs and thus stored in a main list-base. Had to add a wrapper `WorkSpaceLayout` so we can store them in a list-base within workspaces, too. On the long run we could completely replace `bScreen` by workspace structs.
* `WorkSpace` types use some special compiler trickery to allow marking structs and struct members as private. BKE_workspace API should be used for accessing those.
* Added scene operators `SCENE_OT_`. Was previously done through screen operators.
== BPY API Changes
* Removed `Screen.scene`, added `Window.scene`
* Removed `UserPreferencesView.use_global_scene`
* Added `Context.workspace`, `Window.workspace` and `BlendData.workspaces`
* Added `bpy.types.WorkSpace` containing `screens`, `object_mode` and `render_layer`
* Added Screen.layout_name for the layout name that'll be displayed in the UI (may differ from internal name)
== What's left?
* There are a few open design questions (T50521). We should find the needed answers and implement them.
* Allow adding and removing individual workspaces from workspace configuration (needs UI design).
* Get the override system ready and support overrides per workspace.
* Support custom UI setups as part of workspaces (hidden panels, hidden buttons, customizable toolbars, etc).
* Allow enabling add-ons per workspace.
* Support custom workspace keymaps.
* Remove special exception for workspaces in linking code (so they're always appended, never linked). Depends on a few things, so best to solve later.
* Get the topbar done.
* Workspaces need a proper icon, current one is just a placeholder :)
Reviewed By: campbellbarton, mont29
Tags: #user_interface, #bf_blender_2.8
Maniphest Tasks: T50521
Differential Revision: https://developer.blender.org/D2451
2017-06-01 19:56:58 +02:00
|
|
|
void ED_workspace_scene_data_sync(struct WorkSpaceInstanceHook *hook, Scene *scene) ATTR_NONNULL();
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
2021-12-10 21:28:56 +11:00
|
|
|
* Make sure there is a non-full-screen layout to switch to that isn't used yet by an other window.
|
2021-12-09 00:55:11 +11:00
|
|
|
* Needed for workspace or screen switching to ensure valid screens.
|
|
|
|
|
*
|
|
|
|
|
* \param layout_fallback_base: As last resort, this layout is duplicated and returned.
|
|
|
|
|
*/
|
2020-08-04 19:46:38 +02:00
|
|
|
struct WorkSpaceLayout *ED_workspace_screen_change_ensure_unused_layout(
|
|
|
|
|
struct Main *bmain,
|
|
|
|
|
struct WorkSpace *workspace,
|
|
|
|
|
struct WorkSpaceLayout *layout_new,
|
|
|
|
|
const struct WorkSpaceLayout *layout_fallback_base,
|
|
|
|
|
struct wmWindow *win) ATTR_NONNULL();
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Empty screen, with 1 dummy area without space-data. Uses window size.
|
|
|
|
|
*/
|
Main Workspace Integration
This commit does the main integration of workspaces, which is a design we agreed on during the 2.8 UI workshop (see https://wiki.blender.org/index.php/Dev:2.8/UI/Workshop_Writeup)
Workspaces should generally be stable, I'm not aware of any remaining bugs (or I've forgotten them :) ). If you find any, let me know!
(Exception: mode switching button might get out of sync with actual mode in some cases, would consider that a limitation/ToDo. Needs to be resolved at some point.)
== Main Changes/Features
* Introduces the new Workspaces as data-blocks.
* Allow storing a number of custom workspaces as part of the user configuration. Needs further work to allow adding and deleting individual workspaces.
* Bundle a default workspace configuration with Blender (current screen-layouts converted to workspaces).
* Pressing button to add a workspace spawns a menu to select between "Duplicate Current" and the workspaces from the user configuration. If no workspaces are stored in the user configuration, the default workspaces are listed instead.
* Store screen-layouts (`bScreen`) per workspace.
* Store an active screen-layout per workspace. Changing the workspace will enable this layout.
* Store active mode in workspace. Changing the workspace will also enter the mode of the new workspace. (Note that we still store the active mode in the object, moving this completely to workspaces is a separate project.)
* Store an active render layer per workspace.
* Moved mode switch from 3D View header to Info Editor header.
* Store active scene in window (not directly workspace related, but overlaps quite a bit).
* Removed 'Use Global Scene' User Preference option.
* Compatibility with old files - a new workspace is created for every screen-layout of old files. Old Blender versions should be able to read files saved with workspace support as well.
* Default .blend only contains one workspace ("General").
* Support appending workspaces.
Opening files without UI and commandline rendering should work fine.
Note that the UI is temporary! We plan to introduce a new global topbar
that contains the workspace options and tabs for switching workspaces.
== Technical Notes
* Workspaces are data-blocks.
* Adding and removing `bScreen`s should be done through `ED_workspace_layout` API now.
* A workspace can be active in multiple windows at the same time.
* The mode menu (which is now in the Info Editor header) doesn't display "Grease Pencil Edit" mode anymore since its availability depends on the active editor. Will be fixed by making Grease Pencil an own object type (as planned).
* The button to change the active workspace object mode may get out of sync with the mode of the active object. Will either be resolved by moving mode out of object data, or we'll disable workspace modes again (there's a `#define USE_WORKSPACE_MODE` for that).
* Screen-layouts (`bScreen`) are IDs and thus stored in a main list-base. Had to add a wrapper `WorkSpaceLayout` so we can store them in a list-base within workspaces, too. On the long run we could completely replace `bScreen` by workspace structs.
* `WorkSpace` types use some special compiler trickery to allow marking structs and struct members as private. BKE_workspace API should be used for accessing those.
* Added scene operators `SCENE_OT_`. Was previously done through screen operators.
== BPY API Changes
* Removed `Screen.scene`, added `Window.scene`
* Removed `UserPreferencesView.use_global_scene`
* Added `Context.workspace`, `Window.workspace` and `BlendData.workspaces`
* Added `bpy.types.WorkSpace` containing `screens`, `object_mode` and `render_layer`
* Added Screen.layout_name for the layout name that'll be displayed in the UI (may differ from internal name)
== What's left?
* There are a few open design questions (T50521). We should find the needed answers and implement them.
* Allow adding and removing individual workspaces from workspace configuration (needs UI design).
* Get the override system ready and support overrides per workspace.
* Support custom UI setups as part of workspaces (hidden panels, hidden buttons, customizable toolbars, etc).
* Allow enabling add-ons per workspace.
* Support custom workspace keymaps.
* Remove special exception for workspaces in linking code (so they're always appended, never linked). Depends on a few things, so best to solve later.
* Get the topbar done.
* Workspaces need a proper icon, current one is just a placeholder :)
Reviewed By: campbellbarton, mont29
Tags: #user_interface, #bf_blender_2.8
Maniphest Tasks: T50521
Differential Revision: https://developer.blender.org/D2451
2017-06-01 19:56:58 +02:00
|
|
|
struct WorkSpaceLayout *ED_workspace_layout_add(struct Main *bmain,
|
|
|
|
|
struct WorkSpace *workspace,
|
|
|
|
|
struct wmWindow *win,
|
|
|
|
|
const char *name) ATTR_NONNULL();
|
|
|
|
|
struct WorkSpaceLayout *ED_workspace_layout_duplicate(struct Main *bmain,
|
|
|
|
|
struct WorkSpace *workspace,
|
|
|
|
|
const struct WorkSpaceLayout *layout_old,
|
|
|
|
|
struct wmWindow *win) ATTR_NONNULL();
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* \warning Only call outside of area/region loops!
|
|
|
|
|
* \return true if succeeded.
|
|
|
|
|
*/
|
Main Workspace Integration
This commit does the main integration of workspaces, which is a design we agreed on during the 2.8 UI workshop (see https://wiki.blender.org/index.php/Dev:2.8/UI/Workshop_Writeup)
Workspaces should generally be stable, I'm not aware of any remaining bugs (or I've forgotten them :) ). If you find any, let me know!
(Exception: mode switching button might get out of sync with actual mode in some cases, would consider that a limitation/ToDo. Needs to be resolved at some point.)
== Main Changes/Features
* Introduces the new Workspaces as data-blocks.
* Allow storing a number of custom workspaces as part of the user configuration. Needs further work to allow adding and deleting individual workspaces.
* Bundle a default workspace configuration with Blender (current screen-layouts converted to workspaces).
* Pressing button to add a workspace spawns a menu to select between "Duplicate Current" and the workspaces from the user configuration. If no workspaces are stored in the user configuration, the default workspaces are listed instead.
* Store screen-layouts (`bScreen`) per workspace.
* Store an active screen-layout per workspace. Changing the workspace will enable this layout.
* Store active mode in workspace. Changing the workspace will also enter the mode of the new workspace. (Note that we still store the active mode in the object, moving this completely to workspaces is a separate project.)
* Store an active render layer per workspace.
* Moved mode switch from 3D View header to Info Editor header.
* Store active scene in window (not directly workspace related, but overlaps quite a bit).
* Removed 'Use Global Scene' User Preference option.
* Compatibility with old files - a new workspace is created for every screen-layout of old files. Old Blender versions should be able to read files saved with workspace support as well.
* Default .blend only contains one workspace ("General").
* Support appending workspaces.
Opening files without UI and commandline rendering should work fine.
Note that the UI is temporary! We plan to introduce a new global topbar
that contains the workspace options and tabs for switching workspaces.
== Technical Notes
* Workspaces are data-blocks.
* Adding and removing `bScreen`s should be done through `ED_workspace_layout` API now.
* A workspace can be active in multiple windows at the same time.
* The mode menu (which is now in the Info Editor header) doesn't display "Grease Pencil Edit" mode anymore since its availability depends on the active editor. Will be fixed by making Grease Pencil an own object type (as planned).
* The button to change the active workspace object mode may get out of sync with the mode of the active object. Will either be resolved by moving mode out of object data, or we'll disable workspace modes again (there's a `#define USE_WORKSPACE_MODE` for that).
* Screen-layouts (`bScreen`) are IDs and thus stored in a main list-base. Had to add a wrapper `WorkSpaceLayout` so we can store them in a list-base within workspaces, too. On the long run we could completely replace `bScreen` by workspace structs.
* `WorkSpace` types use some special compiler trickery to allow marking structs and struct members as private. BKE_workspace API should be used for accessing those.
* Added scene operators `SCENE_OT_`. Was previously done through screen operators.
== BPY API Changes
* Removed `Screen.scene`, added `Window.scene`
* Removed `UserPreferencesView.use_global_scene`
* Added `Context.workspace`, `Window.workspace` and `BlendData.workspaces`
* Added `bpy.types.WorkSpace` containing `screens`, `object_mode` and `render_layer`
* Added Screen.layout_name for the layout name that'll be displayed in the UI (may differ from internal name)
== What's left?
* There are a few open design questions (T50521). We should find the needed answers and implement them.
* Allow adding and removing individual workspaces from workspace configuration (needs UI design).
* Get the override system ready and support overrides per workspace.
* Support custom UI setups as part of workspaces (hidden panels, hidden buttons, customizable toolbars, etc).
* Allow enabling add-ons per workspace.
* Support custom workspace keymaps.
* Remove special exception for workspaces in linking code (so they're always appended, never linked). Depends on a few things, so best to solve later.
* Get the topbar done.
* Workspaces need a proper icon, current one is just a placeholder :)
Reviewed By: campbellbarton, mont29
Tags: #user_interface, #bf_blender_2.8
Maniphest Tasks: T50521
Differential Revision: https://developer.blender.org/D2451
2017-06-01 19:56:58 +02:00
|
|
|
bool ED_workspace_layout_delete(struct WorkSpace *workspace,
|
|
|
|
|
struct WorkSpaceLayout *layout_old,
|
|
|
|
|
struct bContext *C) ATTR_NONNULL();
|
2022-01-07 11:38:08 +11:00
|
|
|
bool ED_workspace_layout_cycle(struct WorkSpace *workspace, short direction, struct bContext *C)
|
|
|
|
|
ATTR_NONNULL();
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-06-26 17:19:25 +02:00
|
|
|
void ED_workspace_status_text(struct bContext *C, const char *str);
|
|
|
|
|
|
Geometry Nodes: viewport preview
This adds support for showing geometry passed to the Viewer in the 3d
viewport (instead of just in the spreadsheet). The "viewer geometry"
bypasses the group output. So it is not necessary to change the final
output of the node group to be able to see the intermediate geometry.
**Activation and deactivation of a viewer node**
* A viewer node is activated by clicking on it.
* Ctrl+shift+click on any node/socket connects it to the viewer and
makes it active.
* Ctrl+shift+click in empty space deactivates the active viewer.
* When the active viewer is not visible anymore (e.g. another object
is selected, or the current node group is exit), it is deactivated.
* Clicking on the icon in the header of the Viewer node toggles whether
its active or not.
**Pinning**
* The spreadsheet still allows pinning the active viewer as before.
When pinned, the spreadsheet still references the viewer node even
when it becomes inactive.
* The viewport does not support pinning at the moment. It always shows
the active viewer.
**Attribute**
* When a field is linked to the second input of the viewer node it is
displayed as an overlay in the viewport.
* When possible the correct domain for the attribute is determined
automatically. This does not work in all cases. It falls back to the
face corner domain on meshes and the point domain on curves. When
necessary, the domain can be picked manually.
* The spreadsheet now only shows the "Viewer" column for the domain
that is selected in the Viewer node.
* Instance attributes are visualized as a constant color per instance.
**Viewport Options**
* The attribute overlay opacity can be controlled with the "Viewer Node"
setting in the overlays popover.
* A viewport can be configured not to show intermediate viewer-geometry
by disabling the "Viewer Node" option in the "View" menu.
**Implementation Details**
* The "spreadsheet context path" was generalized to a "viewer path" that
is used in more places now.
* The viewer node itself determines the attribute domain, evaluates the
field and stores the result in a `.viewer` attribute.
* A new "viewer attribute' overlay displays the data from the `.viewer`
attribute.
* The ground truth for the active viewer node is stored in the workspace
now. Node editors, spreadsheets and viewports retrieve the active
viewer from there unless they are pinned.
* The depsgraph object iterator has a new "viewer path" setting. When set,
the viewed geometry of the corresponding object is part of the iterator
instead of the final evaluated geometry.
* To support the instance attribute overlay `DupliObject` was extended
to contain the information necessary for drawing the overlay.
* The ctrl+shift+click operator has been refactored so that it can make
existing links to viewers active again.
* The auto-domain-detection in the Viewer node works by checking the
"preferred domain" for every field input. If there is not exactly one
preferred domain, the fallback is used.
Known limitations:
* Loose edges of meshes don't have the attribute overlay. This could be
added separately if necessary.
* Some attributes are hard to visualize as a color directly. For example,
the values might have to be normalized or some should be drawn as arrays.
For now, we encourage users to build node groups that generate appropriate
viewer-geometry. We might include some of that functionality in future versions.
Support for displaying attribute values as text in the viewport is planned as well.
* There seems to be an issue with the attribute overlay for pointclouds on
nvidia gpus, to be investigated.
Differential Revision: https://developer.blender.org/D15954
2022-09-28 17:54:59 +02:00
|
|
|
void ED_workspace_do_listen(struct bContext *C, const struct wmNotifier *note);
|
|
|
|
|
|
2009-02-04 17:40:50 +00:00
|
|
|
/* anim */
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Results in fully updated anim system.
|
|
|
|
|
*/
|
2018-04-06 11:21:20 +02:00
|
|
|
void ED_update_for_newframe(struct Main *bmain, struct Depsgraph *depsgraph);
|
2010-11-02 09:34:32 +00:00
|
|
|
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Update frame rate info for viewport drawing.
|
|
|
|
|
*/
|
2012-05-12 20:39:39 +00:00
|
|
|
void ED_refresh_viewport_fps(struct bContext *C);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Toggle operator.
|
|
|
|
|
*/
|
2012-05-25 12:37:11 +00:00
|
|
|
int ED_screen_animation_play(struct bContext *C, int sync, int mode);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Find window that owns the animation timer.
|
|
|
|
|
*/
|
2012-05-25 12:56:29 +00:00
|
|
|
bScreen *ED_screen_animation_playing(const struct wmWindowManager *wm);
|
2015-06-05 16:47:01 +02:00
|
|
|
bScreen *ED_screen_animation_no_scrub(const struct wmWindowManager *wm);
|
2008-01-07 18:03:41 +00:00
|
|
|
|
2010-02-12 00:44:26 +00:00
|
|
|
/* screen keymaps */
|
2021-12-09 00:55:11 +11:00
|
|
|
/* called in spacetypes.c */
|
2012-05-12 20:39:39 +00:00
|
|
|
void ED_operatortypes_screen(void);
|
2021-12-09 00:55:11 +11:00
|
|
|
/* called in spacetypes.c */
|
2012-05-12 20:39:39 +00:00
|
|
|
void ED_keymap_screen(struct wmKeyConfig *keyconf);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Workspace key-maps.
|
|
|
|
|
*/
|
Main Workspace Integration
This commit does the main integration of workspaces, which is a design we agreed on during the 2.8 UI workshop (see https://wiki.blender.org/index.php/Dev:2.8/UI/Workshop_Writeup)
Workspaces should generally be stable, I'm not aware of any remaining bugs (or I've forgotten them :) ). If you find any, let me know!
(Exception: mode switching button might get out of sync with actual mode in some cases, would consider that a limitation/ToDo. Needs to be resolved at some point.)
== Main Changes/Features
* Introduces the new Workspaces as data-blocks.
* Allow storing a number of custom workspaces as part of the user configuration. Needs further work to allow adding and deleting individual workspaces.
* Bundle a default workspace configuration with Blender (current screen-layouts converted to workspaces).
* Pressing button to add a workspace spawns a menu to select between "Duplicate Current" and the workspaces from the user configuration. If no workspaces are stored in the user configuration, the default workspaces are listed instead.
* Store screen-layouts (`bScreen`) per workspace.
* Store an active screen-layout per workspace. Changing the workspace will enable this layout.
* Store active mode in workspace. Changing the workspace will also enter the mode of the new workspace. (Note that we still store the active mode in the object, moving this completely to workspaces is a separate project.)
* Store an active render layer per workspace.
* Moved mode switch from 3D View header to Info Editor header.
* Store active scene in window (not directly workspace related, but overlaps quite a bit).
* Removed 'Use Global Scene' User Preference option.
* Compatibility with old files - a new workspace is created for every screen-layout of old files. Old Blender versions should be able to read files saved with workspace support as well.
* Default .blend only contains one workspace ("General").
* Support appending workspaces.
Opening files without UI and commandline rendering should work fine.
Note that the UI is temporary! We plan to introduce a new global topbar
that contains the workspace options and tabs for switching workspaces.
== Technical Notes
* Workspaces are data-blocks.
* Adding and removing `bScreen`s should be done through `ED_workspace_layout` API now.
* A workspace can be active in multiple windows at the same time.
* The mode menu (which is now in the Info Editor header) doesn't display "Grease Pencil Edit" mode anymore since its availability depends on the active editor. Will be fixed by making Grease Pencil an own object type (as planned).
* The button to change the active workspace object mode may get out of sync with the mode of the active object. Will either be resolved by moving mode out of object data, or we'll disable workspace modes again (there's a `#define USE_WORKSPACE_MODE` for that).
* Screen-layouts (`bScreen`) are IDs and thus stored in a main list-base. Had to add a wrapper `WorkSpaceLayout` so we can store them in a list-base within workspaces, too. On the long run we could completely replace `bScreen` by workspace structs.
* `WorkSpace` types use some special compiler trickery to allow marking structs and struct members as private. BKE_workspace API should be used for accessing those.
* Added scene operators `SCENE_OT_`. Was previously done through screen operators.
== BPY API Changes
* Removed `Screen.scene`, added `Window.scene`
* Removed `UserPreferencesView.use_global_scene`
* Added `Context.workspace`, `Window.workspace` and `BlendData.workspaces`
* Added `bpy.types.WorkSpace` containing `screens`, `object_mode` and `render_layer`
* Added Screen.layout_name for the layout name that'll be displayed in the UI (may differ from internal name)
== What's left?
* There are a few open design questions (T50521). We should find the needed answers and implement them.
* Allow adding and removing individual workspaces from workspace configuration (needs UI design).
* Get the override system ready and support overrides per workspace.
* Support custom UI setups as part of workspaces (hidden panels, hidden buttons, customizable toolbars, etc).
* Allow enabling add-ons per workspace.
* Support custom workspace keymaps.
* Remove special exception for workspaces in linking code (so they're always appended, never linked). Depends on a few things, so best to solve later.
* Get the topbar done.
* Workspaces need a proper icon, current one is just a placeholder :)
Reviewed By: campbellbarton, mont29
Tags: #user_interface, #bf_blender_2.8
Maniphest Tasks: T50521
Differential Revision: https://developer.blender.org/D2451
2017-06-01 19:56:58 +02:00
|
|
|
void ED_operatortypes_workspace(void);
|
2008-01-01 18:29:19 +00:00
|
|
|
|
2008-01-10 17:38:17 +00:00
|
|
|
/* operators; context poll callbacks */
|
2021-12-09 00:55:11 +11:00
|
|
|
|
2018-07-02 11:47:00 +02:00
|
|
|
bool ED_operator_screenactive(struct bContext *C);
|
2021-04-30 14:16:50 +10:00
|
|
|
bool ED_operator_screenactive_nobackground(struct bContext *C);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* When mouse is over area-edge.
|
|
|
|
|
*/
|
2018-07-02 11:47:00 +02:00
|
|
|
bool ED_operator_screen_mainwinactive(struct bContext *C);
|
|
|
|
|
bool ED_operator_areaactive(struct bContext *C);
|
|
|
|
|
bool ED_operator_regionactive(struct bContext *C);
|
2012-05-12 20:39:39 +00:00
|
|
|
|
2018-07-02 11:47:00 +02:00
|
|
|
bool ED_operator_scene(struct bContext *C);
|
|
|
|
|
bool ED_operator_scene_editable(struct bContext *C);
|
|
|
|
|
bool ED_operator_objectmode(struct bContext *C);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Same as #ED_operator_objectmode() but additionally sets a "disabled hint". That is, a message
|
|
|
|
|
* to be displayed to the user explaining why the operator can't be used in current context.
|
|
|
|
|
*/
|
2021-10-26 18:06:10 +02:00
|
|
|
bool ED_operator_objectmode_poll_msg(struct bContext *C);
|
2012-05-12 20:39:39 +00:00
|
|
|
|
2018-07-02 11:47:00 +02:00
|
|
|
bool ED_operator_view3d_active(struct bContext *C);
|
|
|
|
|
bool ED_operator_region_view3d_active(struct bContext *C);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Generic for any view2d which uses anim_ops.
|
|
|
|
|
*/
|
2018-07-02 11:47:00 +02:00
|
|
|
bool ED_operator_animview_active(struct bContext *C);
|
|
|
|
|
bool ED_operator_outliner_active(struct bContext *C);
|
|
|
|
|
bool ED_operator_outliner_active_no_editobject(struct bContext *C);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* \note Will return true for file spaces in either file or asset browsing mode! See
|
|
|
|
|
* #ED_operator_file_browsing_active() (file browsing only) and
|
|
|
|
|
* #ED_operator_asset_browsing_active() (asset browsing only).
|
|
|
|
|
*/
|
2018-07-02 11:47:00 +02:00
|
|
|
bool ED_operator_file_active(struct bContext *C);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* \note Will only return true if the file space is in file browsing mode, not asset browsing! See
|
|
|
|
|
* #ED_operator_file_active() (file or asset browsing) and
|
|
|
|
|
* #ED_operator_asset_browsing_active() (asset browsing only).
|
|
|
|
|
*/
|
2021-07-30 19:03:02 +02:00
|
|
|
bool ED_operator_file_browsing_active(struct bContext *C);
|
|
|
|
|
bool ED_operator_asset_browsing_active(struct bContext *C);
|
2021-06-18 16:33:02 -05:00
|
|
|
bool ED_operator_spreadsheet_active(struct bContext *C);
|
2018-07-02 11:47:00 +02:00
|
|
|
bool ED_operator_action_active(struct bContext *C);
|
|
|
|
|
bool ED_operator_buttons_active(struct bContext *C);
|
|
|
|
|
bool ED_operator_node_active(struct bContext *C);
|
|
|
|
|
bool ED_operator_node_editable(struct bContext *C);
|
|
|
|
|
bool ED_operator_graphedit_active(struct bContext *C);
|
|
|
|
|
bool ED_operator_sequencer_active(struct bContext *C);
|
|
|
|
|
bool ED_operator_sequencer_active_editable(struct bContext *C);
|
|
|
|
|
bool ED_operator_image_active(struct bContext *C);
|
|
|
|
|
bool ED_operator_nla_active(struct bContext *C);
|
|
|
|
|
bool ED_operator_info_active(struct bContext *C);
|
|
|
|
|
bool ED_operator_console_active(struct bContext *C);
|
2012-05-12 20:39:39 +00:00
|
|
|
|
2018-07-02 11:47:00 +02:00
|
|
|
bool ED_operator_object_active(struct bContext *C);
|
2020-07-15 13:09:06 +10:00
|
|
|
bool ED_operator_object_active_editable_ex(struct bContext *C, const Object *ob);
|
2018-07-02 11:47:00 +02:00
|
|
|
bool ED_operator_object_active_editable(struct bContext *C);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Object must be editable and fully local (i.e. not an override).
|
|
|
|
|
*/
|
2020-08-30 13:32:22 +10:00
|
|
|
bool ED_operator_object_active_local_editable_ex(struct bContext *C, const Object *ob);
|
2020-07-13 14:29:04 +02:00
|
|
|
bool ED_operator_object_active_local_editable(struct bContext *C);
|
2018-07-02 11:47:00 +02:00
|
|
|
bool ED_operator_object_active_editable_mesh(struct bContext *C);
|
|
|
|
|
bool ED_operator_object_active_editable_font(struct bContext *C);
|
2019-07-16 15:06:25 +02:00
|
|
|
bool ED_operator_editable_mesh(struct bContext *C);
|
2018-07-02 11:47:00 +02:00
|
|
|
bool ED_operator_editmesh(struct bContext *C);
|
|
|
|
|
bool ED_operator_editmesh_view3d(struct bContext *C);
|
|
|
|
|
bool ED_operator_editmesh_region_view3d(struct bContext *C);
|
2018-07-02 23:31:19 +05:30
|
|
|
bool ED_operator_editmesh_auto_smooth(struct bContext *C);
|
2018-07-02 11:47:00 +02:00
|
|
|
bool ED_operator_editarmature(struct bContext *C);
|
|
|
|
|
bool ED_operator_editcurve(struct bContext *C);
|
|
|
|
|
bool ED_operator_editcurve_3d(struct bContext *C);
|
|
|
|
|
bool ED_operator_editsurf(struct bContext *C);
|
|
|
|
|
bool ED_operator_editsurfcurve(struct bContext *C);
|
|
|
|
|
bool ED_operator_editsurfcurve_region_view3d(struct bContext *C);
|
|
|
|
|
bool ED_operator_editfont(struct bContext *C);
|
|
|
|
|
bool ED_operator_editlattice(struct bContext *C);
|
|
|
|
|
bool ED_operator_editmball(struct bContext *C);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Wrapper for #ED_space_image_show_uvedit.
|
|
|
|
|
*/
|
2018-07-02 11:47:00 +02:00
|
|
|
bool ED_operator_uvedit(struct bContext *C);
|
|
|
|
|
bool ED_operator_uvedit_space_image(struct bContext *C);
|
|
|
|
|
bool ED_operator_uvmap(struct bContext *C);
|
|
|
|
|
bool ED_operator_posemode_exclusive(struct bContext *C);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Object must be editable, fully local (i.e. not an override), and exclusively in Pose mode.
|
|
|
|
|
*/
|
2021-06-16 15:52:56 +02:00
|
|
|
bool ED_operator_object_active_local_editable_posemode_exclusive(struct bContext *C);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Allows for pinned pose objects to be used in the object buttons
|
|
|
|
|
* and the non-active pose object to be used in the 3D view.
|
|
|
|
|
*/
|
2018-07-02 11:47:00 +02:00
|
|
|
bool ED_operator_posemode_context(struct bContext *C);
|
|
|
|
|
bool ED_operator_posemode(struct bContext *C);
|
|
|
|
|
bool ED_operator_posemode_local(struct bContext *C);
|
2022-05-30 16:22:06 +02:00
|
|
|
bool ED_operator_camera_poll(struct bContext *C);
|
2009-02-01 18:07:02 +00:00
|
|
|
|
2018-06-23 16:31:28 +02:00
|
|
|
/* screen_user_menu.c */
|
|
|
|
|
|
2018-12-22 08:14:41 +11:00
|
|
|
bUserMenu **ED_screen_user_menus_find(const struct bContext *C, uint *r_len);
|
2018-06-24 16:07:34 +02:00
|
|
|
struct bUserMenu *ED_screen_user_menu_ensure(struct bContext *C);
|
|
|
|
|
|
|
|
|
|
struct bUserMenuItem_Op *ED_screen_user_menu_item_find_operator(struct ListBase *lb,
|
2018-06-30 12:08:08 +02:00
|
|
|
const struct wmOperatorType *ot,
|
|
|
|
|
struct IDProperty *prop,
|
2021-11-05 14:56:22 +01:00
|
|
|
wmOperatorCallContext opcontext);
|
2018-06-30 12:08:08 +02:00
|
|
|
struct bUserMenuItem_Menu *ED_screen_user_menu_item_find_menu(struct ListBase *lb,
|
|
|
|
|
const struct MenuType *mt);
|
2018-06-30 20:59:10 +02:00
|
|
|
struct bUserMenuItem_Prop *ED_screen_user_menu_item_find_prop(struct ListBase *lb,
|
|
|
|
|
const char *context_data_path,
|
|
|
|
|
const char *prop_id,
|
|
|
|
|
int prop_index);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-06-24 16:07:34 +02:00
|
|
|
void ED_screen_user_menu_item_add_operator(struct ListBase *lb,
|
|
|
|
|
const char *ui_name,
|
2018-06-30 12:08:08 +02:00
|
|
|
const struct wmOperatorType *ot,
|
|
|
|
|
const struct IDProperty *prop,
|
2021-11-05 14:56:22 +01:00
|
|
|
wmOperatorCallContext opcontext);
|
2018-06-30 12:08:08 +02:00
|
|
|
void ED_screen_user_menu_item_add_menu(struct ListBase *lb,
|
|
|
|
|
const char *ui_name,
|
|
|
|
|
const struct MenuType *mt);
|
2018-06-30 20:59:10 +02:00
|
|
|
void ED_screen_user_menu_item_add_prop(ListBase *lb,
|
|
|
|
|
const char *ui_name,
|
|
|
|
|
const char *context_data_path,
|
|
|
|
|
const char *prop_id,
|
|
|
|
|
int prop_index);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-06-24 16:07:34 +02:00
|
|
|
void ED_screen_user_menu_item_remove(struct ListBase *lb, struct bUserMenuItem *umi);
|
2018-06-23 16:31:28 +02:00
|
|
|
void ED_screen_user_menu_register(void);
|
2008-12-26 19:07:31 +00:00
|
|
|
|
2014-04-02 16:50:06 +06:00
|
|
|
/* Cache display helpers */
|
|
|
|
|
|
2020-03-06 16:56:42 +01:00
|
|
|
void ED_region_cache_draw_background(struct ARegion *region);
|
2022-01-07 11:38:08 +11:00
|
|
|
void ED_region_cache_draw_curfra_label(int framenr, float x, float y);
|
|
|
|
|
void ED_region_cache_draw_cached_segments(
|
|
|
|
|
struct ARegion *region, int num_segments, const int *points, int sfra, int efra);
|
2014-04-02 16:50:06 +06:00
|
|
|
|
2018-10-04 08:54:48 +10:00
|
|
|
/* area_utils.c */
|
2021-12-09 00:55:11 +11:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Callback for #ARegionType.message_subscribe
|
|
|
|
|
*/
|
2021-01-18 17:28:47 -06:00
|
|
|
void ED_region_generic_tools_region_message_subscribe(
|
2021-01-19 12:59:00 +11:00
|
|
|
const struct wmRegionMessageSubscribeParams *params);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Callback for #ARegionType.snap_size
|
|
|
|
|
*/
|
2020-03-06 16:56:42 +01:00
|
|
|
int ED_region_generic_tools_region_snap_size(const struct ARegion *region, int size, int axis);
|
2018-10-04 08:54:48 +10:00
|
|
|
|
2019-04-23 16:43:50 +10:00
|
|
|
/* area_query.c */
|
2022-04-04 13:17:03 +10:00
|
|
|
|
2022-01-07 11:38:08 +11:00
|
|
|
bool ED_region_overlap_isect_x(const ARegion *region, int event_x);
|
|
|
|
|
bool ED_region_overlap_isect_y(const ARegion *region, int event_y);
|
2020-03-06 16:56:42 +01:00
|
|
|
bool ED_region_overlap_isect_xy(const ARegion *region, const int event_xy[2]);
|
2020-03-12 19:34:59 +01:00
|
|
|
bool ED_region_overlap_isect_any_xy(const ScrArea *area, const int event_xy[2]);
|
2022-01-07 11:38:08 +11:00
|
|
|
bool ED_region_overlap_isect_x_with_margin(const ARegion *region, int event_x, int margin);
|
|
|
|
|
bool ED_region_overlap_isect_y_with_margin(const ARegion *region, int event_y, int margin);
|
2020-03-06 16:56:42 +01:00
|
|
|
bool ED_region_overlap_isect_xy_with_margin(const ARegion *region,
|
2019-04-23 16:43:50 +10:00
|
|
|
const int event_xy[2],
|
2022-01-07 11:38:08 +11:00
|
|
|
int margin);
|
2019-04-23 16:43:50 +10:00
|
|
|
|
2020-04-03 12:51:03 +02:00
|
|
|
bool ED_region_panel_category_gutter_calc_rect(const ARegion *region, rcti *r_region_gutter);
|
2020-03-06 16:56:42 +01:00
|
|
|
bool ED_region_panel_category_gutter_isect_xy(const ARegion *region, const int event_xy[2]);
|
2019-04-24 11:37:36 +10:00
|
|
|
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
2022-05-13 09:24:28 +10:00
|
|
|
* \note This may return true for multiple overlapping regions.
|
2021-12-09 00:55:11 +11:00
|
|
|
* If it matters, check overlapped regions first (#ARegion.overlap).
|
|
|
|
|
*/
|
2020-03-06 16:56:42 +01:00
|
|
|
bool ED_region_contains_xy(const struct ARegion *region, const int event_xy[2]);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Similar to #BKE_area_find_region_xy() but when \a event_xy intersects an overlapping region,
|
|
|
|
|
* this returns the region that is visually under the cursor. E.g. when over the
|
|
|
|
|
* transparent part of the region, it returns the region underneath.
|
|
|
|
|
*
|
|
|
|
|
* The overlapping region is determined using the #ED_region_contains_xy() query.
|
|
|
|
|
*/
|
2021-11-04 12:10:58 +01:00
|
|
|
ARegion *ED_area_find_region_xy_visual(const ScrArea *area, int regiontype, const int event_xy[2]);
|
2019-04-23 16:43:50 +10:00
|
|
|
|
2018-06-12 10:11:32 +02:00
|
|
|
/* interface_region_hud.c */
|
2021-12-09 00:55:11 +11:00
|
|
|
|
2018-06-12 10:11:32 +02:00
|
|
|
struct ARegionType *ED_area_type_hud(int space_type);
|
2020-04-03 13:25:03 +02:00
|
|
|
void ED_area_type_hud_clear(struct wmWindowManager *wm, ScrArea *area_keep);
|
|
|
|
|
void ED_area_type_hud_ensure(struct bContext *C, struct ScrArea *area);
|
2018-06-12 10:11:32 +02:00
|
|
|
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Default key-maps, bit-flags (matches order of evaluation).
|
|
|
|
|
*/
|
2018-11-12 18:47:24 +11:00
|
|
|
enum {
|
|
|
|
|
ED_KEYMAP_UI = (1 << 1),
|
|
|
|
|
ED_KEYMAP_GIZMO = (1 << 2),
|
2019-02-20 14:29:29 +11:00
|
|
|
ED_KEYMAP_TOOL = (1 << 3),
|
|
|
|
|
ED_KEYMAP_VIEW2D = (1 << 4),
|
2019-05-09 18:40:42 +10:00
|
|
|
ED_KEYMAP_ANIMATION = (1 << 6),
|
|
|
|
|
ED_KEYMAP_FRAMES = (1 << 7),
|
|
|
|
|
ED_KEYMAP_HEADER = (1 << 8),
|
2019-05-07 15:09:14 +02:00
|
|
|
ED_KEYMAP_FOOTER = (1 << 9),
|
2019-05-09 18:40:42 +10:00
|
|
|
ED_KEYMAP_GPENCIL = (1 << 10),
|
|
|
|
|
ED_KEYMAP_NAVBAR = (1 << 11),
|
2018-11-12 18:47:24 +11:00
|
|
|
};
|
2009-07-24 12:43:59 +00:00
|
|
|
|
2021-12-09 00:55:11 +11:00
|
|
|
/** #SCREEN_OT_space_context_cycle direction. */
|
Cleanup: use enum types for screen direction variables
The term direction was used in 3 different ways in screen editing code,
making it hard to follow:
- 0-3 for as magic numbers mapped to [west,north,east,south].
- `h`, `v` characters for [horizontal,vertical] axes.
- Cycle direction SPACE_CONTEXT_CYCLE_PREV, SPACE_CONTEXT_CYCLE_NEXT
The following changes have been made:
- Add `eScreenDir` for [west,north,east,south], use variable name `dir`.
- Add `eScreenAxis` for [horizontal,vertical] values, use variable name
`dir_axis`.
- Add `eScreenCycle` for existing enum `SPACE_CONTEXT_CYCLE_{PREV/NEXT}`.
- Add macros `SCREEN_DIR_IS_VERTICAL(dir)`,
`SCREEN_DIR_IS_HORIZONTAL(dir)`.
Replacing `ELEM(dir, 1, 3)`, `ELEM(dir, 0, 2)`.
- Move `ED_screen_draw_join_highlight`, `ED_screen_draw_split_preview`
to `screen_intern.h`.
Reviewed By: Severin
Ref D11245
2021-05-13 15:43:53 +10:00
|
|
|
typedef enum eScreenCycle {
|
2018-10-29 23:28:08 +01:00
|
|
|
SPACE_CONTEXT_CYCLE_PREV,
|
|
|
|
|
SPACE_CONTEXT_CYCLE_NEXT,
|
Cleanup: use enum types for screen direction variables
The term direction was used in 3 different ways in screen editing code,
making it hard to follow:
- 0-3 for as magic numbers mapped to [west,north,east,south].
- `h`, `v` characters for [horizontal,vertical] axes.
- Cycle direction SPACE_CONTEXT_CYCLE_PREV, SPACE_CONTEXT_CYCLE_NEXT
The following changes have been made:
- Add `eScreenDir` for [west,north,east,south], use variable name `dir`.
- Add `eScreenAxis` for [horizontal,vertical] values, use variable name
`dir_axis`.
- Add `eScreenCycle` for existing enum `SPACE_CONTEXT_CYCLE_{PREV/NEXT}`.
- Add macros `SCREEN_DIR_IS_VERTICAL(dir)`,
`SCREEN_DIR_IS_HORIZONTAL(dir)`.
Replacing `ELEM(dir, 1, 3)`, `ELEM(dir, 0, 2)`.
- Move `ED_screen_draw_join_highlight`, `ED_screen_draw_split_preview`
to `screen_intern.h`.
Reviewed By: Severin
Ref D11245
2021-05-13 15:43:53 +10:00
|
|
|
} eScreenCycle;
|
2018-10-29 23:28:08 +01:00
|
|
|
|
2020-03-02 15:09:10 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|