2008-01-01 18:29:19 +00:00
|
|
|
/**
|
|
|
|
* $Id:
|
|
|
|
*
|
|
|
|
* ***** 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,
|
|
|
|
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*
|
|
|
|
* The Original Code is Copyright (C) 2008 Blender Foundation.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Contributor(s): Blender Foundation
|
|
|
|
*
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
|
|
*/
|
|
|
|
#ifndef ED_SCREEN_H
|
|
|
|
#define ED_SCREEN_H
|
|
|
|
|
|
|
|
#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"
|
|
|
|
|
|
|
|
struct wmWindowManager;
|
|
|
|
struct wmWindow;
|
|
|
|
struct wmNotifier;
|
2008-12-15 18:43:18 +00:00
|
|
|
struct wmEvent;
|
2008-12-19 14:14:43 +00:00
|
|
|
struct bContext;
|
2008-12-08 15:02:57 +00:00
|
|
|
struct SpaceType;
|
|
|
|
struct AreagionType;
|
2008-12-14 12:16:55 +00:00
|
|
|
struct uiBlock;
|
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;
|
2008-01-07 18:03:41 +00:00
|
|
|
|
|
|
|
/* regions */
|
|
|
|
void ED_region_do_listen(ARegion *ar, struct wmNotifier *note);
|
2008-12-10 17:58:18 +00:00
|
|
|
void ED_region_do_draw(struct bContext *C, struct ARegion *ar);
|
|
|
|
void ED_region_exit(struct bContext *C, struct ARegion *ar);
|
2008-12-19 14:14:43 +00:00
|
|
|
void ED_region_pixelspace(struct ARegion *ar);
|
2008-12-10 17:58:18 +00:00
|
|
|
void ED_region_init(struct bContext *C, struct ARegion *ar);
|
2008-12-16 12:28:00 +00:00
|
|
|
void ED_region_tag_redraw(struct ARegion *ar);
|
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
|
|
|
void ED_region_tag_redraw_partial(struct ARegion *ar, struct rcti *rct);
|
2008-01-07 18:03:41 +00:00
|
|
|
|
|
|
|
/* spaces */
|
|
|
|
void ED_spacetypes_init(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_spacetypes_keymap(struct wmWindowManager *wm);
|
2008-12-19 14:14:43 +00:00
|
|
|
int ED_area_header_standardbuttons(const struct bContext *C, struct uiBlock *block, int yco);
|
2008-12-16 18:42:12 +00:00
|
|
|
void ED_area_overdraw(struct bContext *C);
|
2.5: WIP commit for WM compositing.
* Drawing code from wm_event_system.c split into separate wm_draw.c file.
Now there's 3 different draw methods implemented, not sure what survives
or will be added but is useful for debugging.
* Draw All: redraws everything each time, for reference.
* Draw Overlap All: what the code did before this commit, only draw
regions marked for redraw, and anything that overlaps them.
* Triple Buffer: copies/retores all area regions into a texture, and
blits that before drawing. Menus, brushes, gestures, etc are redrawn
always on top of that.
Currently "Draw Overlap All" is set hardcoded to be used still. Triple
Buffer code is not complete, it doesn't handle window resize yet. Cards
that don't support non power of two textures can need quite large
textures as well, this could be split into multiple smaller ones.
2009-01-20 21:55:48 +00:00
|
|
|
void ED_area_overdraw_flush(struct bContext *C, struct ScrArea *sa, struct ARegion *ar);
|
2008-12-16 18:42:12 +00:00
|
|
|
|
2008-01-07 18:03:41 +00:00
|
|
|
|
|
|
|
/* areas */
|
|
|
|
void ED_area_initialize(struct wmWindowManager *wm, struct wmWindow *win, struct ScrArea *sa);
|
2008-12-10 17:58:18 +00:00
|
|
|
void ED_area_exit(struct bContext *C, struct ScrArea *sa);
|
|
|
|
int ED_screen_area_active(const struct bContext *C);
|
2009-01-04 17:45:54 +00:00
|
|
|
void ED_area_do_listen(ScrArea *sa, struct wmNotifier *note);
|
2008-12-16 12:28:00 +00:00
|
|
|
void ED_area_tag_redraw(ScrArea *sa);
|
2009-01-04 17:45:54 +00:00
|
|
|
void ED_area_tag_refresh(ScrArea *sa);
|
|
|
|
void ED_area_do_refresh(struct bContext *C, ScrArea *sa);
|
2008-12-21 17:18:36 +00:00
|
|
|
void ED_area_headerprint(ScrArea *sa, const char *str);
|
2009-01-06 18:14:37 +00:00
|
|
|
void ED_area_newspace(struct bContext *C, ScrArea *sa, int type);
|
|
|
|
void ED_area_prevspace(struct bContext *C);
|
2008-01-07 18:03:41 +00:00
|
|
|
|
|
|
|
/* screens */
|
|
|
|
void ED_screens_initialize(struct wmWindowManager *wm);
|
|
|
|
void ED_screen_draw(struct wmWindow *win);
|
|
|
|
void ED_screen_refresh(struct wmWindowManager *wm, struct wmWindow *win);
|
2008-01-19 17:54:05 +00:00
|
|
|
void ED_screen_do_listen(struct wmWindow *win, struct wmNotifier *note);
|
2008-12-10 17:58:18 +00:00
|
|
|
bScreen *ED_screen_duplicate(struct wmWindow *win, struct bScreen *sc);
|
2008-12-15 18:43:18 +00:00
|
|
|
void ED_screen_set_subwinactive(struct wmWindow *win, struct wmEvent *event);
|
2008-12-10 17:58:18 +00:00
|
|
|
void ED_screen_exit(struct bContext *C, struct wmWindow *window, struct bScreen *screen);
|
2008-12-22 12:57:53 +00:00
|
|
|
void ED_screen_animation_timer(struct bContext *C, int enable);
|
2009-01-06 18:52:18 +00:00
|
|
|
void ED_screen_full_newspace(struct bContext *C, ScrArea *sa, int type);
|
|
|
|
void ED_screen_full_prevspace(struct bContext *C);
|
|
|
|
|
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
|
|
|
void ED_operatortypes_screen(void);
|
|
|
|
void ED_keymap_screen(struct wmWindowManager *wm);
|
2008-01-01 18:29:19 +00:00
|
|
|
|
2008-01-10 17:38:17 +00:00
|
|
|
/* operators; context poll callbacks */
|
2008-06-24 14:51:02 +00:00
|
|
|
int ED_operator_screenactive(struct bContext *C);
|
|
|
|
int ED_operator_screen_mainwinactive(struct bContext *C);
|
2.5 getting-back-into-coding commit :)
- cleaned up join and split operations. Most noticable is operator callback
design, which should make a design based on user-less exec() first, then
wrap invoke() and modal() around it. The exec() should be callable with
only Context and properties.
- split now works again; and inversed as previously, if you drag from a
triangle (action zone) inside area it subdivides area as expected.
- dragging from triangle outside area, over an edge, joins areas
- split has been simplified, it had too many options... it could just work
simpler (now)
- 'action zone' now is an operator itself, a widget sending an ACTIONZONE event,
which can be handled by others (so other gestures can be added in action zone
too)
Still evaluating:
- context gets set where?
- code structure confuses... what are proper functions for operators?
- what is WM... should low level screen stuff more there?
- when do you send event, notifier?
- files grow to large, will clean
Oh yeah and docs, docs, docs. Coming! :)
2008-11-17 18:54:03 +00:00
|
|
|
int ED_operator_areaactive(struct bContext *C);
|
2008-01-10 17:38:17 +00:00
|
|
|
|
2009-01-01 14:57:04 +00:00
|
|
|
int ED_operator_scene_editable(struct bContext *C);
|
|
|
|
|
2008-12-26 19:07:31 +00:00
|
|
|
int ED_operator_view3d_active(struct bContext *C);
|
|
|
|
int ED_operator_timeline_active(struct bContext *C);
|
|
|
|
int ED_operator_outliner_active(struct bContext *C);
|
|
|
|
int ED_operator_file_active(struct bContext *C);
|
|
|
|
int ED_operator_action_active(struct bContext *C);
|
|
|
|
int ED_operator_buttons_active(struct bContext *C);
|
|
|
|
int ED_operator_node_active(struct bContext *C);
|
|
|
|
int ED_operator_ipo_active(struct bContext *C);
|
|
|
|
int ED_operator_sequencer_active(struct bContext *C);
|
|
|
|
|
2009-01-01 13:15:35 +00:00
|
|
|
int ED_operator_object_active(struct bContext *C);
|
|
|
|
int ED_operator_editmesh(struct bContext *C);
|
|
|
|
int ED_operator_editcurve(struct bContext *C);
|
2.5: Space Image ported back
Organized as follows:
uvedit/
uv editing related code
uvedit_draw.c: drawing code
uvedit_ops.c: operators, just a few done
uvedit_unwrap_ops.c: will be operators for unwrapping
uvedit_paramatrizer.c: lscm/abf/stretch/pack
space_image/
space_image.c: registration and common getter/setters
image_draw.c: drawing code, mostly functional
image_panels.c: panels, all commented out
image_render.c: render callbacks, non functional
image_ops.c: operators, only view navigation done
image_header.c: header, menus mostly done but missing buttons
Notes:
* Header menus consist only of Operator and RNA buttons, if they
are not implemented they're displayed grayed out. Ideally the full
header could work like this, but std_libbuttons looks problematic.
* Started using view2d code more than the old code, but for now it
still does own view2d management due to some very specific
requirements that the image window has. The drawing code however
is more clear hopefully, it only uses view2d, and there is no
switching between 'p' and 'f' view2d's anymore, it is always 'f'.
* In order to make uvedit operators more independent I move some
image space settings to scene toolsettings, and the current image
and its buffer is in the context. Especially sync selection and
select mode belonged there anyway as this cannot work correct with
different spaces having different settings anyway.
* Image paint is not back yet, did not want to put that together with
uvedit because there's really no code sharing.. perhaps vertex paint,
image paint and sculpt would be good to have in one module to share
brush code, partial redraw, etc better.
2009-01-15 04:38:18 +00:00
|
|
|
int ED_operator_uvedit(struct bContext *C);
|
2008-12-26 19:07:31 +00:00
|
|
|
|
2008-12-10 13:56:54 +00:00
|
|
|
/* default keymaps, bitflags */
|
|
|
|
#define ED_KEYMAP_UI 1
|
|
|
|
#define ED_KEYMAP_VIEW2D 2
|
|
|
|
#define ED_KEYMAP_MARKERS 4
|
2008-12-21 08:02:24 +00:00
|
|
|
#define ED_KEYMAP_ANIMATION 8
|
2009-01-23 14:43:25 +00:00
|
|
|
#define ED_KEYMAP_FRAMES 16
|
2008-01-10 17:38:17 +00:00
|
|
|
|
2008-01-01 18:29:19 +00:00
|
|
|
#endif /* ED_SCREEN_H */
|
|
|
|
|