2011-02-21 07:25:24 +00:00
|
|
|
/*
|
2008-01-01 18:29:19 +00:00
|
|
|
* ***** BEGIN GPL LICENSE BLOCK *****
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Contributor(s): Blender Foundation
|
|
|
|
*
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
|
|
*/
|
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
|
|
|
|
2011-02-21 07:25:24 +00:00
|
|
|
/** \file ED_space_api.h
|
|
|
|
* \ingroup editors
|
|
|
|
*/
|
|
|
|
|
2012-02-17 18:59:41 +00:00
|
|
|
#ifndef __ED_SPACE_API_H__
|
|
|
|
#define __ED_SPACE_API_H__
|
2008-01-01 18:29:19 +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
|
|
|
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);
|
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 ED_spacetype_time(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);
|
2008-01-01 18:29:19 +00:00
|
|
|
|
2009-01-06 14:42:54 +00: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);
|
|
|
|
|
2012-05-12 20:39:39 +00:00
|
|
|
#define REGION_DRAW_POST_VIEW 0
|
|
|
|
#define REGION_DRAW_POST_PIXEL 1
|
|
|
|
#define REGION_DRAW_PRE_VIEW 2
|
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_activate(struct ARegionType *,
|
2012-05-12 20:39:39 +00:00
|
|
|
void (*draw)(const struct bContext *, struct ARegion *, void *),
|
|
|
|
void *custumdata, 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 *);
|
2010-02-27 13:27:06 +00:00
|
|
|
void *ED_region_draw_cb_customdata(void *handle);
|
2013-04-02 10:48:11 +00:00
|
|
|
/* generic callbacks */
|
|
|
|
/* ed_util.c */
|
|
|
|
void ED_region_draw_mouse_line_cb(const struct bContext *C, struct ARegion *ar, 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
|
|
|
|
2012-02-17 18:59:41 +00:00
|
|
|
#endif /* __ED_SPACE_API_H__ */
|