2011-02-23 10:52:22 +00:00
|
|
|
/*
|
2007-12-24 18:27:28 +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
|
2007-12-24 18:27:28 +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,
|
2010-02-12 13:34:04 +00:00
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2002-10-12 11:37:38 +00:00
|
|
|
*
|
2007-12-24 18:27:28 +00:00
|
|
|
* The Original Code is Copyright (C) 2007 Blender Foundation.
|
2002-10-12 11:37:38 +00:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
2007-12-24 18:27:28 +00:00
|
|
|
*
|
|
|
|
* Contributor(s): Blender Foundation
|
2002-10-12 11:37:38 +00:00
|
|
|
*
|
2007-12-24 18:27:28 +00:00
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
2002-10-12 11:37:38 +00:00
|
|
|
*/
|
2011-02-25 14:04:21 +00:00
|
|
|
|
|
|
|
/** \file blender/windowmanager/wm.h
|
|
|
|
* \ingroup wm
|
|
|
|
*/
|
|
|
|
|
2012-02-17 18:59:41 +00:00
|
|
|
#ifndef __WM_H__
|
|
|
|
#define __WM_H__
|
2007-12-24 18:27:28 +00:00
|
|
|
|
2.5: gesture code in WM
- Simplified and cleaned previous border code
It was a bit too complex, too many data manipulations
Original idea was to have WM API calls to manage border, circle, lines,
lasso, etc. This now means that WM provides callbacks for custom operators,
so it's very easy to make them. Check bottom of screen_edit.c for an
example.
Currently two borders were coded; with and without cross hair.
Press Bkey in any area-region to test it (note: time window has wrong matrix!)
Some specs to note:
- gestures are in region space, and draw 'over'. That latter still needs some
work when we do real composites.
- only the active region is redrawn.
- on todo is the generic gesture engine for 'tweak' or like how currently grab
gestures in Blender work. These will be configurable per area-region, and WM
then will send the proper "Gesture Event" with properties (N, S, E, W, etc)
to which you then can assign operators. Such events will be generated with low
priority, so other handlers who swallowed mouse events have preference.
2008-11-19 13:16:05 +00:00
|
|
|
struct wmWindow;
|
2009-10-20 13:58:53 +00:00
|
|
|
struct ReportList;
|
2.5: gesture code in WM
- Simplified and cleaned previous border code
It was a bit too complex, too many data manipulations
Original idea was to have WM API calls to manage border, circle, lines,
lasso, etc. This now means that WM provides callbacks for custom operators,
so it's very easy to make them. Check bottom of screen_edit.c for an
example.
Currently two borders were coded; with and without cross hair.
Press Bkey in any area-region to test it (note: time window has wrong matrix!)
Some specs to note:
- gestures are in region space, and draw 'over'. That latter still needs some
work when we do real composites.
- only the active region is redrawn.
- on todo is the generic gesture engine for 'tweak' or like how currently grab
gestures in Blender work. These will be configurable per area-region, and WM
then will send the proper "Gesture Event" with properties (N, S, E, W, etc)
to which you then can assign operators. Such events will be generated with low
priority, so other handlers who swallowed mouse events have preference.
2008-11-19 13:16:05 +00:00
|
|
|
|
2016-10-07 16:34:55 +02:00
|
|
|
#include "manipulators/wm_manipulator_wmapi.h"
|
|
|
|
|
2.5
Vertex Paint back!
Added WM level "paint cursor" system, which manages a custom painting
cursor for tools or modes.
- Activate it with WM_paint_cursor_activate(). That function wants two
callbacks, a poll(C) to check whether there's a cursor in given context
and ARegion, and a draw(C, x, y) which gets called when appropriate.
- While paintcursor is active, the WM handles necessary redrawing events
for all regions, also to nicely clear the cursor on region exit.
- WM_paint_cursor_activate returns a handle, which you have to use to
end the paint cursor. This handle also means you can register as many
custom cursors as you want.
At the moment, vertex paint mode registers only a mousemove handler,
all other events are still normally handled. This is stuff for the
future todo.
2009-01-09 13:55:45 +00:00
|
|
|
typedef struct wmPaintCursor {
|
|
|
|
struct wmPaintCursor *next, *prev;
|
2009-01-24 16:59:55 +00:00
|
|
|
|
|
|
|
void *customdata;
|
2.5
Vertex Paint back!
Added WM level "paint cursor" system, which manages a custom painting
cursor for tools or modes.
- Activate it with WM_paint_cursor_activate(). That function wants two
callbacks, a poll(C) to check whether there's a cursor in given context
and ARegion, and a draw(C, x, y) which gets called when appropriate.
- While paintcursor is active, the WM handles necessary redrawing events
for all regions, also to nicely clear the cursor on region exit.
- WM_paint_cursor_activate returns a handle, which you have to use to
end the paint cursor. This handle also means you can register as many
custom cursors as you want.
At the moment, vertex paint mode registers only a mousemove handler,
all other events are still normally handled. This is stuff for the
future todo.
2009-01-09 13:55:45 +00:00
|
|
|
|
|
|
|
int (*poll)(struct bContext *C);
|
2009-01-24 16:59:55 +00:00
|
|
|
void (*draw)(bContext *C, int, int, void *customdata);
|
2.5
Vertex Paint back!
Added WM level "paint cursor" system, which manages a custom painting
cursor for tools or modes.
- Activate it with WM_paint_cursor_activate(). That function wants two
callbacks, a poll(C) to check whether there's a cursor in given context
and ARegion, and a draw(C, x, y) which gets called when appropriate.
- While paintcursor is active, the WM handles necessary redrawing events
for all regions, also to nicely clear the cursor on region exit.
- WM_paint_cursor_activate returns a handle, which you have to use to
end the paint cursor. This handle also means you can register as many
custom cursors as you want.
At the moment, vertex paint mode registers only a mousemove handler,
all other events are still normally handled. This is stuff for the
future todo.
2009-01-09 13:55:45 +00:00
|
|
|
} wmPaintCursor;
|
|
|
|
|
2007-12-24 18:27:28 +00:00
|
|
|
extern void wm_close_and_free(bContext *C, wmWindowManager *);
|
|
|
|
extern void wm_close_and_free_all(bContext *C, ListBase *);
|
|
|
|
|
|
|
|
extern void wm_add_default(bContext *C);
|
2009-05-30 04:16:24 +00:00
|
|
|
extern void wm_clear_default_size(bContext *C);
|
2008-01-07 18:03:41 +00:00
|
|
|
|
|
|
|
/* register to windowmanager for redo or macro */
|
2009-07-16 00:50:27 +00:00
|
|
|
void wm_operator_register(bContext *C, wmOperator *op);
|
2007-12-24 18:27:28 +00:00
|
|
|
|
|
|
|
/* wm_operator.c, for init/exit */
|
|
|
|
void wm_operatortype_free(void);
|
|
|
|
void wm_operatortype_init(void);
|
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 wm_window_keymap(wmKeyConfig *keyconf);
|
2007-12-24 18:27:28 +00:00
|
|
|
|
2.5: gesture code in WM
- Simplified and cleaned previous border code
It was a bit too complex, too many data manipulations
Original idea was to have WM API calls to manage border, circle, lines,
lasso, etc. This now means that WM provides callbacks for custom operators,
so it's very easy to make them. Check bottom of screen_edit.c for an
example.
Currently two borders were coded; with and without cross hair.
Press Bkey in any area-region to test it (note: time window has wrong matrix!)
Some specs to note:
- gestures are in region space, and draw 'over'. That latter still needs some
work when we do real composites.
- only the active region is redrawn.
- on todo is the generic gesture engine for 'tweak' or like how currently grab
gestures in Blender work. These will be configurable per area-region, and WM
then will send the proper "Gesture Event" with properties (N, S, E, W, etc)
to which you then can assign operators. Such events will be generated with low
priority, so other handlers who swallowed mouse events have preference.
2008-11-19 13:16:05 +00:00
|
|
|
/* wm_gesture.c */
|
|
|
|
void wm_gesture_draw(struct wmWindow *win);
|
2010-10-16 02:40:31 +00:00
|
|
|
int wm_gesture_evaluate(wmGesture *gesture);
|
2008-12-27 16:09:56 +00:00
|
|
|
void wm_gesture_tag_redraw(bContext *C);
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2017-10-17 15:09:29 +11:00
|
|
|
/* wm_gesture_ops.c */
|
|
|
|
void wm_tweakevent_test(bContext *C, const wmEvent *event, int action);
|
|
|
|
|
2009-10-20 13:58:53 +00:00
|
|
|
/* wm_jobs.c */
|
|
|
|
void wm_jobs_timer(const bContext *C, wmWindowManager *wm, wmTimer *wt);
|
2009-07-24 12:43:59 +00:00
|
|
|
void wm_jobs_timer_ended(wmWindowManager *wm, wmTimer *wt);
|
2.5
Added WM Jobs manager
- WM can manage threaded jobs for you; just provide a couple
of components to get it work:
- customdata, free callback for it
- timer step, notifier code
- start callback, update callback
- Once started, each job runs an own timer, and will for
every time step check necessary updates, or close the
job when ready.
- No drawing happens in jobs, that's for notifiers!
- Every job stores an owner pointer, and based on this owner
it will prevent multiple jobs to enter the stack.
Instead it will re-use a running job, signal it to stop
and allow caller to re-initialize it even.
- Check new wm_jobs.c for more explanation. Jobs API is still
under construction.
Fun: BLI_addtail(&wm->jobs, steve); :)
Put Node shader previews back using wmJobs
- Preview calculating is now fully threaded (1 thread still)
- Thanks to new event system + notifiers, you can see
previews update even while dragging sliders!
- Currently it only starts when you change a node setting.
Warning: the thread render shares Node data, so don't delete
nodes while it renders! This topic is on the todo to make safe.
Also:
- bug in region initialize (do_versions) showed channel list in
node editor wrong.
- flagged the channel list 'hidden' now, it was really in the
way! This is for later to work on anyway.
- recoded Render API callbacks so it gets handlers passed on,
no globals to use anymore, remember?
- previewrender code gets now so much nicer! Will remove a lot
of stuff from code soon.
2009-01-22 14:59:49 +00:00
|
|
|
|
2009-10-20 13:58:53 +00:00
|
|
|
/* wm_files.c */
|
|
|
|
void wm_autosave_timer(const bContext *C, wmWindowManager *wm, wmTimer *wt);
|
|
|
|
void wm_autosave_timer_ended(wmWindowManager *wm);
|
|
|
|
void wm_autosave_delete(void);
|
|
|
|
void wm_autosave_read(bContext *C, struct ReportList *reports);
|
2011-05-18 06:27:32 +00:00
|
|
|
void wm_autosave_location(char *filepath);
|
2009-10-20 13:58:53 +00:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
/* wm_stereo.c */
|
|
|
|
void wm_method_draw_stereo3d(const bContext *C, wmWindow *win);
|
2017-03-06 00:40:48 +01:00
|
|
|
void wm_stereo3d_mouse_offset_apply(wmWindow *win, int *r_mouse_xy);
|
2015-04-06 10:40:12 -03:00
|
|
|
int wm_stereo3d_set_exec(bContext *C, wmOperator *op);
|
|
|
|
int wm_stereo3d_set_invoke(bContext *C, wmOperator *op, const wmEvent *event);
|
|
|
|
void wm_stereo3d_set_draw(bContext *C, wmOperator *op);
|
2015-04-07 15:42:44 -03:00
|
|
|
bool wm_stereo3d_set_check(bContext *C, wmOperator *op);
|
2015-04-06 10:40:12 -03:00
|
|
|
void wm_stereo3d_set_cancel(bContext *C, wmOperator *op);
|
|
|
|
|
2014-04-03 11:04:02 +11:00
|
|
|
/* init operator properties */
|
|
|
|
void wm_open_init_load_ui(wmOperator *op, bool use_prefs);
|
|
|
|
void wm_open_init_use_scripts(wmOperator *op, bool use_prefs);
|
|
|
|
|
2012-02-17 18:59:41 +00:00
|
|
|
#endif /* __WM_H__ */
|