2011-02-21 07:25:24 +00:00
|
|
|
/*
|
2010-03-21 01:14:04 +00:00
|
|
|
* $Id$
|
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
|
|
|
|
|
*/
|
|
|
|
|
|
2009-01-06 10:31:25 +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;
|
|
|
|
|
|
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_sound(void);
|
|
|
|
|
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);
|
2008-01-01 18:29:19 +00:00
|
|
|
|
2009-01-06 14:42:54 +00:00
|
|
|
/* calls for instancing and freeing spacetype static data
|
|
|
|
|
called in WM_init_exit */
|
|
|
|
|
/* in space_file.c */
|
|
|
|
|
void ED_file_init(void);
|
|
|
|
|
void ED_file_exit(void);
|
|
|
|
|
|
2009-10-20 21:05:22 +00:00
|
|
|
#define REGION_DRAW_POST_VIEW 0
|
|
|
|
|
#define REGION_DRAW_POST_PIXEL 1
|
2010-02-03 20:45:35 +00:00
|
|
|
#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 *,
|
2009-01-10 16:49:22 +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);
|
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
|
|
|
|
2009-01-06 10:31:25 +00:00
|
|
|
#endif /* ED_SPACE_API_H */
|
2008-01-01 18:29:19 +00:00
|
|
|
|