This repository has been archived on 2023-10-09. You can view files and clone it, but cannot push or open issues or pull requests.
Files
blender-archive/source/blender/windowmanager/wm.h

92 lines
2.6 KiB
C++
Raw Normal View History

/*
2010-03-21 01:14:04 +00:00
* $Id$
2002-10-12 11:37:38 +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
* 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
*
* The Original Code is Copyright (C) 2007 Blender Foundation.
2002-10-12 11:37:38 +00:00
* All rights reserved.
*
*
* Contributor(s): Blender Foundation
2002-10-12 11:37:38 +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
*/
#ifndef WM_H
#define WM_H
struct wmWindow;
struct ReportList;
typedef struct wmPaintCursor {
struct wmPaintCursor *next, *prev;
void *customdata;
int (*poll)(struct bContext *C);
void (*draw)(bContext *C, int, int, void *customdata);
} wmPaintCursor;
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);
extern void wm_clear_default_size(bContext *C);
/* register to windowmanager for redo or macro */
void wm_operator_register(bContext *C, wmOperator *op);
extern void wm_report_free(wmReport *report);
/* wm_operator.c, for init/exit */
void wm_operatortype_free(void);
void wm_operatortype_init(void);
void wm_window_keymap(wmKeyConfig *keyconf);
2.5 Sanitized the 'tweak' event. Original idea was to have WM event system generating it automatically. However, I first tested it via a handler and operator, to check what kind of configurations would be useful. It appeared to not work nice, also because that inserting a tweak operator in a keymap is confusing. Now 'tweaks' are generated automatically, and can be catched by keymaps as any event. The current definition of tweak is: - if Left/Middle/Rightmouse pressed if event wasn't handled by window queue (modal handlers) start checking mousepositions - while mousepositions are checked - escape on any event other than mouse - on mouse events: - add tweak event if mousemove > 10 pixels - stop checking for tweak if mousebutton released - Tweak events have a define indicating mousebutton used EVT_TWEAK_L, EVT_TWEAK_M, EVT_TWEAK_R - In keymap definitions you can use _S or _A to map to action or select mouse userdef. - Event value in keymap should be KM_ANY for all tweaks, or use one of the eight directions: EVT_GESTURE_E, _SE, _S, _SW, _W, _NW, _N, _NE - And of course you can add modifier checks in keymaps for it. - Because tweaks are a result of mouse events, the handlers get both to evaluate. That means that RMB-select + tweak will work correctly. In case you don't want both to be handled, for example the CTRL+LMB 'extrude' and CTRL+LMB-tweak 'lasso select', you will need to set the first acting on a EVT_RELEASE, this event only gets passed on when tweak fails. The current system allows all options, configurable, we had in 2.48, and many more! A diagram of what's possible is on the todo. :) Also in this commit: lasso select editmesh failed with 'zbuffer occluded select'. Also circle-select failed.
2009-02-02 14:13:14 +00:00
void wm_tweakevent_test(bContext *C, wmEvent *event, int action);
/* wm_gesture.c */
#define WM_LASSO_MIN_POINTS 1024
void wm_gesture_draw(struct wmWindow *win);
int wm_gesture_evaluate(wmGesture *gesture);
void wm_gesture_tag_redraw(bContext *C);
2002-10-12 11:37:38 +00:00
/* wm_jobs.c */
void wm_jobs_timer(const bContext *C, wmWindowManager *wm, wmTimer *wt);
void wm_jobs_timer_ended(wmWindowManager *wm, wmTimer *wt);
2009-01-22 14:59:49 +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);
void wm_autosave_location(char *filename);
/* hack to store circle select size - campbell, must replace with nice operator memory */
#define GESTURE_MEMORY
#ifdef GESTURE_MEMORY
extern int circle_select_size;
#endif
#endif /* WM_H */