2011-02-21 07:25:24 +00:00
|
|
|
/*
|
2008-01-01 18:29:19 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
2018-06-01 18:19:39 +02:00
|
|
|
* of the License, or (at your option) any later version.
|
2008-01-01 18:29:19 +00:00
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
2010-02-12 13:34:04 +00:00
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2008-01-01 18:29:19 +00:00
|
|
|
*
|
|
|
|
|
* The Original Code is Copyright (C) 2008 Blender Foundation.
|
|
|
|
|
* All rights reserved.
|
|
|
|
|
*/
|
2.5 Branch
==========
* Changed wmOperatorType, removing init/exit callbacks and adding cancel
callback, removed default storage in favor of properties. Defined return
values for exec/invoke/modal/cancel.
* Don't allocate operator on the stack, and removed operator copy for
handlers. Now it frees based on return values from callbacks, and just
keeps a wmOperator on the heap. Also it now registers after the operator
is fully finished, to get the correct final properties.
* Changed OP_get_* functions to return 1 if the property is found and 0
otherwise, gives more readable code in my opinion. Added OP_verify_*
functions to quickly check if the property is available and set if it's
not, that's common for exec/invoke.
* Removed WM_operatortypelist_append in favor of WM_operatortype_append
which takes a function pointer instead of a list, avoids macro's and
duplicating code.
* Fix a crash where the handler would still be used while it was freed by
the operator.
* Spacetypes now have operatortypes() and keymap() callbacks to abstract
them a bit more.
* Renamed C->curarea to C->area for consistency. Removed View3D/View2D/
SpaceIpo from bContext, seems bad to keep these.
* Set context variables like window/screen/area/region to NULL again when
leaving that context, instead of leaving the pointers there.
* Added if(G.f & G_DEBUG) for many of the prints, makes output a bit
cleaner and easier to debug.
* Fixed priority of the editors/interface module in scons, would otherwise
give link errors.
* Added start of generic view2d api.
* Added space_time with some basic drawing and a single operator to change
the frame.
2008-06-11 10:10:31 +00:00
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
|
* \ingroup editors
|
2011-02-21 07:25:24 +00:00
|
|
|
*/
|
|
|
|
|
|
2020-08-07 09:50:34 +02:00
|
|
|
#pragma once
|
2008-01-01 18:29:19 +00:00
|
|
|
|
2020-03-02 15:09:10 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
2.5
New: Custom region draw callbacks.
For Martin: an example is now in space_view3d/view3d_edit.c
On middlemouse rotate view, it draws a small square in center.
It works likes this:
#include "ED_space_api.h"
handle= ED_region_draw_cb_activate(region->type, drawfunc, type)
and to stop it:
ED_region_draw_cb_exit(region->type, handle)
drawfunc is of type (const bContext *C, ARegion *ar)
currently it gets called only as type REGION_DRAW_POST, later we
can add more (PRE, POST_XRAY, POST_2D, etc).
For correct usage, these calls should return leaving view transform
unaltered.
2009-01-09 15:04:52 +00:00
|
|
|
struct ARegionType;
|
|
|
|
|
struct bContext;
|
|
|
|
|
|
2013-03-11 20:27:38 +00:00
|
|
|
void ED_spacetypes_init(void);
|
Pie Menus C code backend.
This commit merges the code in the pie-menu branch.
As per decisions taken the last few days, there are no pie menus
included and there will be an official add-on including overrides of
some keys with pie menus. However, people will now be able to use the
new code in python.
Full Documentation is in http://wiki.blender.org/index.php/Dev:Ref/
Thanks:
Campbell Barton, Dalai Felinto and Ton Roosendaal for the code review
and design comments
Jonathan Williamson, Pawel Lyczkowski, Pablo Vazquez among others for
suggestions during the development.
Special Thanks to Sean Olson, for his support, suggestions, testing and
merciless bugging so that I would finish the pie menu code. Without him
we wouldn't be here. Also to the rest of the developers of the original
python add-on, Patrick Moore and Dan Eicher and finally to Matt Ebb, who
did the research and first implementation and whose code I used to get
started.
2014-08-11 10:39:59 +02:00
|
|
|
void ED_spacemacros_init(void);
|
2013-03-11 20:27:38 +00:00
|
|
|
|
2008-01-07 18:03:41 +00:00
|
|
|
/* the pluginnable API for export to editors */
|
2008-01-01 18:29:19 +00:00
|
|
|
|
2008-01-07 18:03:41 +00:00
|
|
|
/* calls for registering default spaces */
|
2008-11-14 17:05:25 +00:00
|
|
|
void ED_spacetype_outliner(void);
|
2008-01-07 18:03:41 +00:00
|
|
|
void ED_spacetype_view3d(void);
|
2008-12-12 18:47:12 +00:00
|
|
|
void ED_spacetype_ipo(void);
|
2008-12-13 17:44:30 +00:00
|
|
|
void ED_spacetype_image(void);
|
2008-12-13 18:09:49 +00:00
|
|
|
void ED_spacetype_node(void);
|
2008-12-13 19:00:54 +00:00
|
|
|
void ED_spacetype_buttons(void);
|
2008-12-14 10:52:48 +00:00
|
|
|
void ED_spacetype_info(void);
|
2008-12-14 11:25:00 +00:00
|
|
|
void ED_spacetype_file(void);
|
2008-12-14 14:43:08 +00:00
|
|
|
void ED_spacetype_action(void);
|
|
|
|
|
void ED_spacetype_nla(void);
|
|
|
|
|
void ED_spacetype_script(void);
|
|
|
|
|
void ED_spacetype_text(void);
|
|
|
|
|
void ED_spacetype_sequencer(void);
|
2009-06-16 13:09:36 +00:00
|
|
|
void ED_spacetype_logic(void);
|
2009-07-16 00:50:27 +00:00
|
|
|
void ED_spacetype_console(void);
|
2009-08-18 12:58:51 +00:00
|
|
|
void ED_spacetype_userpref(void);
|
2011-11-07 12:55:18 +00:00
|
|
|
void ED_spacetype_clip(void);
|
2018-05-23 22:38:25 +02:00
|
|
|
void ED_spacetype_statusbar(void);
|
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_spacetype_topbar(void);
|
2008-01-01 18:29:19 +00:00
|
|
|
|
2018-06-04 09:31:30 +02:00
|
|
|
/* calls for instancing and freeing spacetype static data
|
2012-03-03 16:31:46 +00:00
|
|
|
* called in WM_init_exit */
|
2009-01-06 14:42:54 +00:00
|
|
|
/* in space_file.c */
|
|
|
|
|
void ED_file_init(void);
|
|
|
|
|
void ED_file_exit(void);
|
|
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
#define REGION_DRAW_POST_VIEW 0
|
|
|
|
|
#define REGION_DRAW_POST_PIXEL 1
|
|
|
|
|
#define REGION_DRAW_PRE_VIEW 2
|
2019-04-23 09:15:45 -06:00
|
|
|
#define REGION_DRAW_BACKDROP 3
|
2.5
New: Custom region draw callbacks.
For Martin: an example is now in space_view3d/view3d_edit.c
On middlemouse rotate view, it draws a small square in center.
It works likes this:
#include "ED_space_api.h"
handle= ED_region_draw_cb_activate(region->type, drawfunc, type)
and to stop it:
ED_region_draw_cb_exit(region->type, handle)
drawfunc is of type (const bContext *C, ARegion *ar)
currently it gets called only as type REGION_DRAW_POST, later we
can add more (PRE, POST_XRAY, POST_2D, etc).
For correct usage, these calls should return leaving view transform
unaltered.
2009-01-09 15:04:52 +00:00
|
|
|
|
2020-09-04 20:59:13 +02:00
|
|
|
void *ED_region_draw_cb_activate(struct ARegionType *art,
|
2012-05-12 20:39:39 +00:00
|
|
|
void (*draw)(const struct bContext *, struct ARegion *, void *),
|
2020-09-04 20:59:13 +02:00
|
|
|
void *customdata,
|
2019-04-17 06:17:24 +02:00
|
|
|
int type);
|
2.5
New: Custom region draw callbacks.
For Martin: an example is now in space_view3d/view3d_edit.c
On middlemouse rotate view, it draws a small square in center.
It works likes this:
#include "ED_space_api.h"
handle= ED_region_draw_cb_activate(region->type, drawfunc, type)
and to stop it:
ED_region_draw_cb_exit(region->type, handle)
drawfunc is of type (const bContext *C, ARegion *ar)
currently it gets called only as type REGION_DRAW_POST, later we
can add more (PRE, POST_XRAY, POST_2D, etc).
For correct usage, these calls should return leaving view transform
unaltered.
2009-01-09 15:04:52 +00:00
|
|
|
void ED_region_draw_cb_draw(const struct bContext *, struct ARegion *, int);
|
|
|
|
|
void ED_region_draw_cb_exit(struct ARegionType *, void *);
|
2013-04-02 10:48:11 +00:00
|
|
|
/* generic callbacks */
|
|
|
|
|
/* ed_util.c */
|
2020-03-06 16:56:42 +01:00
|
|
|
void ED_region_draw_mouse_line_cb(const struct bContext *C,
|
|
|
|
|
struct ARegion *region,
|
|
|
|
|
void *arg_info);
|
2.5
New: Custom region draw callbacks.
For Martin: an example is now in space_view3d/view3d_edit.c
On middlemouse rotate view, it draws a small square in center.
It works likes this:
#include "ED_space_api.h"
handle= ED_region_draw_cb_activate(region->type, drawfunc, type)
and to stop it:
ED_region_draw_cb_exit(region->type, handle)
drawfunc is of type (const bContext *C, ARegion *ar)
currently it gets called only as type REGION_DRAW_POST, later we
can add more (PRE, POST_XRAY, POST_2D, etc).
For correct usage, these calls should return leaving view transform
unaltered.
2009-01-09 15:04:52 +00:00
|
|
|
|
2020-03-02 15:09:10 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|