2002-10-12 11:37:38 +00:00
|
|
|
/**
|
|
|
|
|
* blenlib/BKE_screen.h (mar-2001 nzc)
|
|
|
|
|
*
|
|
|
|
|
* $Id$
|
|
|
|
|
*
|
2008-01-07 18:03:41 +00:00
|
|
|
* ***** BEGIN GPL LICENSE BLOCK *****
|
2002-10-12 11:37:38 +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
|
2008-04-16 22:40:48 +00:00
|
|
|
* of the License, or (at your option) any later version.
|
2002-10-12 11:37:38 +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,
|
|
|
|
|
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
|
*
|
|
|
|
|
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
|
|
|
|
* All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
* The Original Code is: all of this file.
|
|
|
|
|
*
|
|
|
|
|
* Contributor(s): none yet.
|
|
|
|
|
*
|
2008-01-07 18:03:41 +00:00
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
2002-10-12 11:37:38 +00:00
|
|
|
*/
|
|
|
|
|
#ifndef BKE_SCREEN_H
|
|
|
|
|
#define BKE_SCREEN_H
|
|
|
|
|
|
2008-01-07 18:03:41 +00:00
|
|
|
struct ARegion;
|
2008-12-18 02:56:48 +00:00
|
|
|
struct bContext;
|
|
|
|
|
struct bContextDataResult;
|
|
|
|
|
struct bScreen;
|
|
|
|
|
struct ListBase;
|
2009-03-29 19:44:39 +00:00
|
|
|
struct Panel;
|
2009-04-19 17:12:16 +00:00
|
|
|
struct Header;
|
2009-04-22 18:39:44 +00:00
|
|
|
struct Menu;
|
2008-12-18 02:56:48 +00:00
|
|
|
struct ScrArea;
|
|
|
|
|
struct SpaceType;
|
2008-01-07 18:03:41 +00:00
|
|
|
struct wmNotifier;
|
2008-12-15 16:54:47 +00:00
|
|
|
struct wmWindow;
|
2008-12-18 02:56:48 +00:00
|
|
|
struct wmWindowManager;
|
Key Configuration
Keymaps are now saveable and configurable from the user preferences, note
that editing one item in a keymap means the whole keymap is now defined by
the user and will not be updated by Blender, an option for syncing might be
added later. The outliner interface is still there, but I will probably
remove it.
There's actually 3 levels now:
* Default builtin key configuration.
* Key configuration loaded from .py file, for configs like Blender 2.4x
or other 3D applications.
* Keymaps edited by the user and saved in .B.blend. These can be saved
to .py files as well to make creating distributable configurations
easier.
Also, user preferences sections were reorganized a bit, now there is:
Interface, Editing, Input, Files and System.
Implementation notes:
* wmKeyConfig was added which represents a key configuration containing
keymaps.
* wmKeymapItem was renamed to wmKeyMapItem for consistency with wmKeyMap.
* Modal maps are not wrapped yet.
* User preferences DNA file reading did not support newdataadr() yet,
added this now for reading keymaps.
* Key configuration related settings are now RNA wrapped.
* is_property_set and is_property_hidden python methods were added.
2009-10-08 18:40:03 +00:00
|
|
|
struct wmKeyConfig;
|
2009-03-29 19:44:39 +00:00
|
|
|
struct uiLayout;
|
|
|
|
|
struct uiMenuItem;
|
2009-07-21 20:05:16 +00:00
|
|
|
|
|
|
|
|
#include "RNA_types.h"
|
2008-01-07 18:03:41 +00:00
|
|
|
|
|
|
|
|
/* spacetype has everything stored to get an editor working, it gets initialized via
|
2008-12-08 15:02:57 +00:00
|
|
|
ED_spacetypes_init() in editors/area/spacetypes.c */
|
2008-01-07 18:03:41 +00:00
|
|
|
/* an editor in Blender is a combined ScrArea + SpaceType + SpaceData */
|
|
|
|
|
|
2008-12-08 15:02:57 +00:00
|
|
|
#define BKE_ST_MAXNAME 32
|
|
|
|
|
|
2008-01-07 18:03:41 +00:00
|
|
|
typedef struct SpaceType {
|
|
|
|
|
struct SpaceType *next, *prev;
|
|
|
|
|
|
2008-12-08 15:02:57 +00:00
|
|
|
char name[BKE_ST_MAXNAME]; /* for menus */
|
2008-01-07 18:03:41 +00:00
|
|
|
int spaceid; /* unique space identifier */
|
|
|
|
|
int iconid; /* icon lookup for menus */
|
|
|
|
|
|
2008-12-10 13:56:54 +00:00
|
|
|
/* initial allocation, after this WM will call init() too */
|
2008-12-22 10:09:56 +00:00
|
|
|
struct SpaceLink *(*new)(const struct bContext *C);
|
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
|
|
|
/* not free spacelink itself */
|
|
|
|
|
void (*free)(struct SpaceLink *);
|
2008-01-07 18:03:41 +00:00
|
|
|
|
2008-12-10 13:56:54 +00:00
|
|
|
/* init is to cope with file load, screen (size) changes, check handlers */
|
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
|
|
|
void (*init)(struct wmWindowManager *, struct ScrArea *);
|
2008-12-10 13:56:54 +00:00
|
|
|
/* Listeners can react to bContext changes */
|
2009-01-04 17:45:54 +00:00
|
|
|
void (*listener)(struct ScrArea *, struct wmNotifier *);
|
|
|
|
|
|
|
|
|
|
/* refresh context, called after filereads, ED_area_tag_refresh() */
|
|
|
|
|
void (*refresh)(const struct bContext *, struct ScrArea *);
|
2008-01-07 18:03:41 +00:00
|
|
|
|
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
|
|
|
/* after a spacedata copy, an init should result in exact same situation */
|
|
|
|
|
struct SpaceLink *(*duplicate)(struct SpaceLink *);
|
|
|
|
|
|
|
|
|
|
/* register operator types on startup */
|
|
|
|
|
void (*operatortypes)(void);
|
2008-12-08 15:02:57 +00:00
|
|
|
/* add default items to WM keymap */
|
Key Configuration
Keymaps are now saveable and configurable from the user preferences, note
that editing one item in a keymap means the whole keymap is now defined by
the user and will not be updated by Blender, an option for syncing might be
added later. The outliner interface is still there, but I will probably
remove it.
There's actually 3 levels now:
* Default builtin key configuration.
* Key configuration loaded from .py file, for configs like Blender 2.4x
or other 3D applications.
* Keymaps edited by the user and saved in .B.blend. These can be saved
to .py files as well to make creating distributable configurations
easier.
Also, user preferences sections were reorganized a bit, now there is:
Interface, Editing, Input, Files and System.
Implementation notes:
* wmKeyConfig was added which represents a key configuration containing
keymaps.
* wmKeymapItem was renamed to wmKeyMapItem for consistency with wmKeyMap.
* Modal maps are not wrapped yet.
* User preferences DNA file reading did not support newdataadr() yet,
added this now for reading keymaps.
* Key configuration related settings are now RNA wrapped.
* is_property_set and is_property_hidden python methods were added.
2009-10-08 18:40:03 +00:00
|
|
|
void (*keymap)(struct wmKeyConfig *);
|
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
|
|
|
|
2008-12-18 02:56:48 +00:00
|
|
|
/* return context data */
|
2009-03-19 19:03:38 +00:00
|
|
|
int (*context)(const struct bContext *, const char*, struct bContextDataResult *);
|
2008-12-18 02:56:48 +00:00
|
|
|
|
2008-12-08 15:02:57 +00:00
|
|
|
/* region type definitions */
|
|
|
|
|
ListBase regiontypes;
|
|
|
|
|
|
2009-07-02 11:23:19 +00:00
|
|
|
/* tool shelf definitions */
|
|
|
|
|
ListBase toolshelf;
|
|
|
|
|
|
2008-01-07 18:03:41 +00:00
|
|
|
/* read and write... */
|
|
|
|
|
|
2008-12-10 13:56:54 +00:00
|
|
|
/* default keymaps to add */
|
|
|
|
|
int keymapflag;
|
|
|
|
|
|
2008-01-07 18:03:41 +00:00
|
|
|
} SpaceType;
|
|
|
|
|
|
2008-12-08 15:02:57 +00:00
|
|
|
/* region types are also defined using spacetypes_init, via a callback */
|
|
|
|
|
|
2008-01-07 18:03:41 +00:00
|
|
|
typedef struct ARegionType {
|
2008-12-08 15:02:57 +00:00
|
|
|
struct ARegionType *next, *prev;
|
|
|
|
|
|
|
|
|
|
int regionid; /* unique identifier within this space */
|
2008-01-07 18:03:41 +00:00
|
|
|
|
2008-12-10 13:56:54 +00:00
|
|
|
/* add handlers, stuff you only do once or on area/region type/size changes */
|
|
|
|
|
void (*init)(struct wmWindowManager *, struct ARegion *);
|
|
|
|
|
/* draw entirely, view changes should be handled here */
|
|
|
|
|
void (*draw)(const struct bContext *, struct ARegion *);
|
|
|
|
|
/* contextual changes should be handled here */
|
2008-01-07 18:03:41 +00:00
|
|
|
void (*listener)(struct ARegion *, struct wmNotifier *);
|
2008-12-10 13:56:54 +00:00
|
|
|
|
Various changes made in the process of working on the UI code:
* Added functions to generate Timer events. There was some unfinished code to
create one timer per window, this replaces that with a way to let operators
or other handlers add/remove their own timers as needed. This is currently
delivered as an event with the timer handle, perhaps this should be a notifier
instead? Also includes some fixes in ghost for timer events that were not
delivered in time, due to passing negative timeout.
* Added a Message event, which is a generic event that can be added by any
operator. This is used in the UI code to communicate the results of opened
blocks. Again, this may be better as a notifier.
* These two events should not be blocked as they are intended for a specific
operator or handler, so there were exceptions added for this, which is one
of the reasons they might work better as notifiers, but currently these
things can't listen to notifier yet.
* Added an option to events to indicate if the customdata should be freed or
not.
* Added a free() callback for area regions, and added a free function for
area regions in blenkernel since it was already there for screens and areas.
* Added ED_screen/area/region_exit functions to clean up things like operators
and handlers when they are closed.
* Added screen level regions, these will draw over areas boundaries, with the
last created region on top. These are useful for tooltips, menus, etc, and
are not saved to file. It's using the same ARegion struct as areas to avoid
code duplication, but perhaps that should be renamed then. Note that redraws
currently go correct, because only full window redraws are used, for partial
redraws without any frontbuffer drawing, the window manager needs to get
support for compositing subwindows.
* Minor changes in the subwindow code to retrieve the matrix, and moved
setlinestyle to glutil.c.
* Reversed argument order in WM_event_add/remove_keymap_handler to be consistent
with modal_handler.
* Operators can now block events but not necessarily cancel/finish.
* Modal operators are now stored in a list in the window/area/region they were
created in. This means for example that when a transform operator is invoked
from a region but registers a handler at the window level (since mouse motion
across areas should work), it will still get removed when the region is closed
while the operator is running.
2008-11-11 15:18:21 +00:00
|
|
|
void (*free)(struct ARegion *);
|
2008-12-08 15:02:57 +00:00
|
|
|
|
2.5
View3D has been split now in a local part (RegionView3D) and a
per-area part (old View3D). Currently local is:
- view transform
- camera zoom/offset
- gpencil (todo)
- custom clipping planes
Rest is in Area still, like active camera, draw type, layers,
localview, custom centers, around-settings, transform widget,
gridlines, and so on (mostly stuff as available in header).
To see it work; also added new feature for region split,
press SHIFT+ALT+CTRL+S for four-split.
The idea is to make a preset 4-split, configured to stick
to top/right/front views for three views.
Another cool idea to explore is to then box-clip all drawing
based on these 3 views.
Note about the code:
- currently view3d still stores some depricated settings, to
convert from older files. Not all settings are copied over
though, like custom clip planes or the 'lock view to object'.
- since some view3d ops are now on area level, the operators
for it should keep track of that.
Bugfix in transform: quat initialize in operator-invoke missed
one zero.
Als brought back GE to compile for missing Ipos and channels.
2009-01-19 16:54:41 +00:00
|
|
|
/* split region, copy data optionally */
|
|
|
|
|
void *(*duplicate)(void *);
|
|
|
|
|
|
|
|
|
|
|
2008-12-08 15:02:57 +00:00
|
|
|
/* register operator types on startup */
|
|
|
|
|
void (*operatortypes)(void);
|
2008-12-10 13:56:54 +00:00
|
|
|
/* add own items to keymap */
|
Key Configuration
Keymaps are now saveable and configurable from the user preferences, note
that editing one item in a keymap means the whole keymap is now defined by
the user and will not be updated by Blender, an option for syncing might be
added later. The outliner interface is still there, but I will probably
remove it.
There's actually 3 levels now:
* Default builtin key configuration.
* Key configuration loaded from .py file, for configs like Blender 2.4x
or other 3D applications.
* Keymaps edited by the user and saved in .B.blend. These can be saved
to .py files as well to make creating distributable configurations
easier.
Also, user preferences sections were reorganized a bit, now there is:
Interface, Editing, Input, Files and System.
Implementation notes:
* wmKeyConfig was added which represents a key configuration containing
keymaps.
* wmKeymapItem was renamed to wmKeyMapItem for consistency with wmKeyMap.
* Modal maps are not wrapped yet.
* User preferences DNA file reading did not support newdataadr() yet,
added this now for reading keymaps.
* Key configuration related settings are now RNA wrapped.
* is_property_set and is_property_hidden python methods were added.
2009-10-08 18:40:03 +00:00
|
|
|
void (*keymap)(struct wmKeyConfig *);
|
2009-01-04 19:17:34 +00:00
|
|
|
/* allows default cursor per region */
|
|
|
|
|
void (*cursor)(struct wmWindow *, struct ScrArea *, struct ARegion *ar);
|
|
|
|
|
|
2008-12-18 02:56:48 +00:00
|
|
|
/* return context data */
|
2009-03-19 19:03:38 +00:00
|
|
|
int (*context)(const struct bContext *, const char *, struct bContextDataResult *);
|
2008-12-18 02:56:48 +00:00
|
|
|
|
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
|
|
|
/* custom drawing callbacks */
|
|
|
|
|
ListBase drawcalls;
|
|
|
|
|
|
2009-03-29 19:44:39 +00:00
|
|
|
/* panels type definitions */
|
|
|
|
|
ListBase paneltypes;
|
|
|
|
|
|
|
|
|
|
/* header type definitions */
|
|
|
|
|
ListBase headertypes;
|
2009-07-02 11:23:19 +00:00
|
|
|
|
2008-12-10 13:56:54 +00:00
|
|
|
/* hardcoded constraints, smaller than these values region is not visible */
|
|
|
|
|
int minsizex, minsizey;
|
|
|
|
|
/* default keymaps to add */
|
|
|
|
|
int keymapflag;
|
2008-01-07 18:03:41 +00:00
|
|
|
} ARegionType;
|
|
|
|
|
|
2009-03-29 19:44:39 +00:00
|
|
|
/* panel types */
|
|
|
|
|
|
|
|
|
|
typedef struct PanelType {
|
|
|
|
|
struct PanelType *next, *prev;
|
|
|
|
|
|
2009-04-19 13:37:59 +00:00
|
|
|
char idname[BKE_ST_MAXNAME]; /* unique name */
|
|
|
|
|
char label[BKE_ST_MAXNAME]; /* for panel header */
|
|
|
|
|
char context[BKE_ST_MAXNAME]; /* for buttons window */
|
2009-04-19 17:12:16 +00:00
|
|
|
int space_type;
|
|
|
|
|
int region_type;
|
2009-03-29 19:44:39 +00:00
|
|
|
|
2009-06-16 01:08:39 +00:00
|
|
|
int flag;
|
|
|
|
|
|
2009-03-29 19:44:39 +00:00
|
|
|
/* verify if the panel should draw or not */
|
2009-04-19 13:37:59 +00:00
|
|
|
int (*poll)(const struct bContext *, struct PanelType *);
|
2009-05-19 17:13:33 +00:00
|
|
|
/* draw header (optional) */
|
|
|
|
|
void (*draw_header)(const struct bContext *, struct Panel *);
|
2009-03-29 19:44:39 +00:00
|
|
|
/* draw entirely, view changes should be handled here */
|
|
|
|
|
void (*draw)(const struct bContext *, struct Panel *);
|
|
|
|
|
|
2009-07-21 20:05:16 +00:00
|
|
|
/* RNA integration */
|
|
|
|
|
ExtensionRNA ext;
|
2009-03-29 19:44:39 +00:00
|
|
|
} PanelType;
|
|
|
|
|
|
|
|
|
|
/* header types */
|
|
|
|
|
|
|
|
|
|
typedef struct HeaderType {
|
|
|
|
|
struct HeaderType *next, *prev;
|
|
|
|
|
|
2009-04-19 17:12:16 +00:00
|
|
|
char idname[BKE_ST_MAXNAME]; /* unique name */
|
|
|
|
|
int space_type;
|
2009-03-29 19:44:39 +00:00
|
|
|
|
|
|
|
|
/* draw entirely, view changes should be handled here */
|
2009-04-19 17:12:16 +00:00
|
|
|
void (*draw)(const struct bContext *, struct Header *);
|
2009-03-29 19:44:39 +00:00
|
|
|
|
2009-07-21 20:05:16 +00:00
|
|
|
/* RNA integration */
|
|
|
|
|
ExtensionRNA ext;
|
2009-03-29 19:44:39 +00:00
|
|
|
} HeaderType;
|
2008-01-07 18:03:41 +00:00
|
|
|
|
2009-07-21 01:14:55 +00:00
|
|
|
typedef struct Header {
|
|
|
|
|
struct HeaderType *type; /* runtime */
|
|
|
|
|
struct uiLayout *layout; /* runtime for drawing */
|
|
|
|
|
} Header;
|
|
|
|
|
|
|
|
|
|
|
2009-04-22 18:39:44 +00:00
|
|
|
/* menu types */
|
|
|
|
|
|
|
|
|
|
typedef struct MenuType {
|
|
|
|
|
struct MenuType *next, *prev;
|
|
|
|
|
|
|
|
|
|
char idname[BKE_ST_MAXNAME]; /* unique name */
|
|
|
|
|
char label[BKE_ST_MAXNAME]; /* for button text */
|
|
|
|
|
|
|
|
|
|
/* verify if the menu should draw or not */
|
|
|
|
|
int (*poll)(const struct bContext *, struct MenuType *);
|
|
|
|
|
/* draw entirely, view changes should be handled here */
|
|
|
|
|
void (*draw)(const struct bContext *, struct Menu *);
|
|
|
|
|
|
2009-07-21 20:05:16 +00:00
|
|
|
/* RNA integration */
|
|
|
|
|
ExtensionRNA ext;
|
2009-04-22 18:39:44 +00:00
|
|
|
} MenuType;
|
|
|
|
|
|
2009-07-21 01:14:55 +00:00
|
|
|
typedef struct Menu {
|
|
|
|
|
struct MenuType *type; /* runtime */
|
|
|
|
|
struct uiLayout *layout; /* runtime for drawing */
|
|
|
|
|
} Menu;
|
|
|
|
|
|
2008-12-08 15:02:57 +00:00
|
|
|
/* spacetypes */
|
2008-01-07 18:03:41 +00:00
|
|
|
struct SpaceType *BKE_spacetype_from_id(int spaceid);
|
2.5
View3D has been split now in a local part (RegionView3D) and a
per-area part (old View3D). Currently local is:
- view transform
- camera zoom/offset
- gpencil (todo)
- custom clipping planes
Rest is in Area still, like active camera, draw type, layers,
localview, custom centers, around-settings, transform widget,
gridlines, and so on (mostly stuff as available in header).
To see it work; also added new feature for region split,
press SHIFT+ALT+CTRL+S for four-split.
The idea is to make a preset 4-split, configured to stick
to top/right/front views for three views.
Another cool idea to explore is to then box-clip all drawing
based on these 3 views.
Note about the code:
- currently view3d still stores some depricated settings, to
convert from older files. Not all settings are copied over
though, like custom clip planes or the 'lock view to object'.
- since some view3d ops are now on area level, the operators
for it should keep track of that.
Bugfix in transform: quat initialize in operator-invoke missed
one zero.
Als brought back GE to compile for missing Ipos and channels.
2009-01-19 16:54:41 +00:00
|
|
|
struct ARegionType *BKE_regiontype_from_id(struct SpaceType *st, int regionid);
|
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
|
|
|
const struct ListBase *BKE_spacetypes_list(void);
|
2008-01-07 18:03:41 +00:00
|
|
|
void BKE_spacetype_register(struct SpaceType *st);
|
2008-12-08 15:02:57 +00:00
|
|
|
void BKE_spacetypes_free(void); /* only for quitting blender */
|
|
|
|
|
|
2009-10-08 19:06:32 +00:00
|
|
|
// MenuType *BKE_spacemenu_find(const char *idname, int spacetype);
|
2009-10-06 13:04:31 +00:00
|
|
|
|
2008-12-08 15:02:57 +00:00
|
|
|
/* spacedata */
|
2008-01-07 18:03:41 +00:00
|
|
|
void BKE_spacedata_freelist(ListBase *lb);
|
|
|
|
|
void BKE_spacedata_copylist(ListBase *lb1, ListBase *lb2);
|
2009-03-11 20:22:06 +00:00
|
|
|
void BKE_spacedata_copyfirst(ListBase *lb1, ListBase *lb2);
|
2008-01-07 18:03:41 +00:00
|
|
|
|
2008-12-14 17:25:46 +00:00
|
|
|
/* area/regions */
|
2.5
View3D has been split now in a local part (RegionView3D) and a
per-area part (old View3D). Currently local is:
- view transform
- camera zoom/offset
- gpencil (todo)
- custom clipping planes
Rest is in Area still, like active camera, draw type, layers,
localview, custom centers, around-settings, transform widget,
gridlines, and so on (mostly stuff as available in header).
To see it work; also added new feature for region split,
press SHIFT+ALT+CTRL+S for four-split.
The idea is to make a preset 4-split, configured to stick
to top/right/front views for three views.
Another cool idea to explore is to then box-clip all drawing
based on these 3 views.
Note about the code:
- currently view3d still stores some depricated settings, to
convert from older files. Not all settings are copied over
though, like custom clip planes or the 'lock view to object'.
- since some view3d ops are now on area level, the operators
for it should keep track of that.
Bugfix in transform: quat initialize in operator-invoke missed
one zero.
Als brought back GE to compile for missing Ipos and channels.
2009-01-19 16:54:41 +00:00
|
|
|
struct ARegion *BKE_area_region_copy(struct SpaceType *st, struct ARegion *ar);
|
|
|
|
|
void BKE_area_region_free(struct SpaceType *st, struct ARegion *ar);
|
2009-09-14 12:26:34 +00:00
|
|
|
void BKE_screen_area_free(struct ScrArea *sa);
|
2008-12-14 17:25:46 +00:00
|
|
|
|
2009-09-14 12:26:34 +00:00
|
|
|
/* screen */
|
2008-12-14 17:25:46 +00:00
|
|
|
void free_screen(struct bScreen *sc);
|
2009-09-14 12:26:34 +00:00
|
|
|
unsigned int BKE_screen_visible_layers(struct bScreen *screen);
|
2008-12-14 17:25:46 +00:00
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
#endif
|
2002-10-30 02:07:20 +00:00
|
|
|
|