Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2012-08-29 04:53:29 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2012-08-29 04:53:29 +0400
commit141dd5233ede83a6d3882713c95bba47cee90a68 (patch)
tree23cdf3e596bba784d101f9e32f234b399ffba4b1 /source/blender/windowmanager
parent22b30da565de53a0a1d34079d72b08fdb54ec8e3 (diff)
parent8321acaf439b33cca0b054565be176047d289134 (diff)
Merged changes in the trunk up to revision 50257.
Conflicts resolved: source/blender/blenkernel/CMakeLists.txt
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/WM_api.h4
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c29
-rw-r--r--source/blender/windowmanager/intern/wm_files.c6
-rw-r--r--source/blender/windowmanager/intern/wm_gesture.c4
-rw-r--r--source/blender/windowmanager/intern/wm_init_exit.c2
-rw-r--r--source/blender/windowmanager/intern/wm_playanim.c53
-rw-r--r--source/blender/windowmanager/intern/wm_subwindow.c12
-rw-r--r--source/blender/windowmanager/intern/wm_window.c14
8 files changed, 34 insertions, 90 deletions
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h
index 588be336afa..ff7c8cd2ea7 100644
--- a/source/blender/windowmanager/WM_api.h
+++ b/source/blender/windowmanager/WM_api.h
@@ -245,8 +245,8 @@ void WM_operator_py_idname(char *to, const char *from);
/* *************** menu types ******************** */
void WM_menutype_init(void);
struct MenuType *WM_menutype_find(const char *idname, int quiet);
-int WM_menutype_add(struct MenuType* mt);
-void WM_menutype_freelink(struct MenuType* mt);
+int WM_menutype_add(struct MenuType *mt);
+void WM_menutype_freelink(struct MenuType *mt);
void WM_menutype_free(void);
/* default operator callbacks for border/circle/lasso */
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index 10a383df5c9..60c61dbe88c 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -922,7 +922,7 @@ static int wm_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event,
ScrArea *sa = CTX_wm_area(C);
if (ar && ar->regiontype == RGN_TYPE_WINDOW && event &&
- BLI_in_rcti_v(&ar->winrct, &event->x))
+ BLI_rcti_isect_pt_v(&ar->winrct, &event->x))
{
winrect = &ar->winrct;
}
@@ -1642,17 +1642,17 @@ static int handler_boundbox_test(wmEventHandler *handler, wmEvent *event)
rcti rect = *handler->bblocal;
BLI_rcti_translate(&rect, handler->bbwin->xmin, handler->bbwin->ymin);
- if (BLI_in_rcti_v(&rect, &event->x))
+ if (BLI_rcti_isect_pt_v(&rect, &event->x))
return 1;
- else if (event->type == MOUSEMOVE && BLI_in_rcti_v(&rect, &event->prevx))
+ else if (event->type == MOUSEMOVE && BLI_rcti_isect_pt_v(&rect, &event->prevx))
return 1;
else
return 0;
}
else {
- if (BLI_in_rcti_v(handler->bbwin, &event->x))
+ if (BLI_rcti_isect_pt_v(handler->bbwin, &event->x))
return 1;
- else if (event->type == MOUSEMOVE && BLI_in_rcti_v(handler->bbwin, &event->prevx))
+ else if (event->type == MOUSEMOVE && BLI_rcti_isect_pt_v(handler->bbwin, &event->prevx))
return 1;
else
return 0;
@@ -1888,10 +1888,10 @@ static int wm_event_inside_i(wmEvent *event, rcti *rect)
{
if (wm_event_always_pass(event))
return 1;
- if (BLI_in_rcti_v(rect, &event->x))
+ if (BLI_rcti_isect_pt_v(rect, &event->x))
return 1;
if (event->type == MOUSEMOVE) {
- if (BLI_in_rcti_v(rect, &event->prevx)) {
+ if (BLI_rcti_isect_pt_v(rect, &event->prevx)) {
return 1;
}
return 0;
@@ -1906,7 +1906,7 @@ static ScrArea *area_event_inside(bContext *C, const int xy[2])
if (screen)
for (sa = screen->areabase.first; sa; sa = sa->next)
- if (BLI_in_rcti_v(&sa->totrct, xy))
+ if (BLI_rcti_isect_pt_v(&sa->totrct, xy))
return sa;
return NULL;
}
@@ -1919,7 +1919,7 @@ static ARegion *region_event_inside(bContext *C, const int xy[2])
if (screen && area)
for (ar = area->regionbase.first; ar; ar = ar->next)
- if (BLI_in_rcti_v(&ar->winrct, xy))
+ if (BLI_rcti_isect_pt_v(&ar->winrct, xy))
return ar;
return NULL;
}
@@ -1950,7 +1950,7 @@ static void wm_paintcursor_test(bContext *C, wmEvent *event)
wm_paintcursor_tag(C, wm->paintcursors.first, ar);
/* if previous position was not in current region, we have to set a temp new context */
- if (ar == NULL || !BLI_in_rcti_v(&ar->winrct, &event->prevx)) {
+ if (ar == NULL || !BLI_rcti_isect_pt_v(&ar->winrct, &event->prevx)) {
ScrArea *sa = CTX_wm_area(C);
CTX_wm_area_set(C, area_event_inside(C, &event->prevx));
@@ -2125,7 +2125,7 @@ void wm_event_do_handlers(bContext *C)
if (CTX_wm_window(C) == NULL)
return;
- doit |= (BLI_in_rcti_v(&ar->winrct, &event->x));
+ doit |= (BLI_rcti_isect_pt_v(&ar->winrct, &event->x));
if (action & WM_HANDLER_BREAK)
break;
@@ -2617,12 +2617,13 @@ static void attach_ndof_data(wmEvent *event, const GHOST_TEventNDOFMotionData *g
wmNDOFMotionData *data = MEM_mallocN(sizeof(wmNDOFMotionData), "customdata NDOF");
const float s = U.ndof_sensitivity;
+ const float rs = U.ndof_orbit_sensitivity;
data->tx = s * ghost->tx;
- data->rx = s * ghost->rx;
- data->ry = s * ghost->ry;
- data->rz = s * ghost->rz;
+ data->rx = rs * ghost->rx;
+ data->ry = rs * ghost->ry;
+ data->rz = rs * ghost->rz;
if (U.ndof_flag & NDOF_ZOOM_UPDOWN) {
/* rotate so Y is where Z was */
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index 979fb9425fc..f01ca9f566e 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -382,8 +382,6 @@ void WM_file_read(bContext *C, const char *filepath, ReportList *reports)
/* assume automated tasks with background, don't write recent file list */
const int do_history = (G.background == FALSE) && (CTX_wm_manager(C)->op_undo_depth == 0);
- BKE_vfont_free_global_ttf();
-
/* put aside screens to match with persistent windows later */
/* also exit screens and editors */
wm_window_match_init(C, &wmbase);
@@ -493,9 +491,7 @@ int WM_homefile_read(bContext *C, ReportList *UNUSED(reports), short from_memory
ListBase wmbase;
char tstr[FILE_MAX];
int success = 0;
-
- BKE_vfont_free_global_ttf();
-
+
G.relbase_valid = 0;
if (!from_memory) {
char *cfgdir = BLI_get_folder(BLENDER_USER_CONFIG, NULL);
diff --git a/source/blender/windowmanager/intern/wm_gesture.c b/source/blender/windowmanager/intern/wm_gesture.c
index c9f1a2587df..2928ba024e5 100644
--- a/source/blender/windowmanager/intern/wm_gesture.c
+++ b/source/blender/windowmanager/intern/wm_gesture.c
@@ -130,8 +130,8 @@ int wm_gesture_evaluate(wmGesture *gesture)
{
if (gesture->type == WM_GESTURE_TWEAK) {
rcti *rect = gesture->customdata;
- int dx = rect->xmax - rect->xmin;
- int dy = rect->ymax - rect->ymin;
+ int dx = BLI_RCT_SIZE_X(rect);
+ int dy = BLI_RCT_SIZE_Y(rect);
if (ABS(dx) + ABS(dy) > U.tweak_threshold) {
int theta = (int)floor(4.0f * atan2f((float)dy, (float)dx) / (float)M_PI + 0.5f);
int val = EVT_GESTURE_W;
diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c
index af24ea81fe6..8c2272e4707 100644
--- a/source/blender/windowmanager/intern/wm_init_exit.c
+++ b/source/blender/windowmanager/intern/wm_init_exit.c
@@ -399,8 +399,6 @@ void WM_exit_ext(bContext *C, const short do_python)
// BIF_GlobalReebFree();
// BIF_freeRetarget();
BIF_freeTemplates(C);
-
- BKE_vfont_free_global_ttf(); /* bke_font.h */
free_openrecent();
diff --git a/source/blender/windowmanager/intern/wm_playanim.c b/source/blender/windowmanager/intern/wm_playanim.c
index 3c791cb6e5d..0074d6236db 100644
--- a/source/blender/windowmanager/intern/wm_playanim.c
+++ b/source/blender/windowmanager/intern/wm_playanim.c
@@ -49,11 +49,12 @@
#include "PIL_time.h"
+#include "BLI_fileops.h"
#include "BLI_listbase.h"
-#include "BLI_string.h"
#include "BLI_path_util.h"
-#include "BLI_fileops.h"
#include "BLI_rect.h"
+#include "BLI_string.h"
+#include "BLI_utildefines.h"
#include "IMB_imbuf_types.h"
#include "IMB_imbuf.h"
@@ -65,22 +66,12 @@
#include "BIF_gl.h"
#include "BIF_glutil.h"
-#ifdef WITH_QUICKTIME
-# ifdef _WIN32
-# include <QTML.h>
-# include <Movies.h>
-# elif defined(__APPLE__)
-# include <QuickTime/Movies.h>
-# endif /* __APPLE__ */
-#endif /* WITH_QUICKTIME */
-
#include "DNA_scene_types.h"
-#include "BLI_utildefines.h"
#include "ED_datafiles.h" /* for fonts */
-#include "wm_event_types.h"
#include "GHOST_C-api.h"
#include "BLF_api.h"
+#include "wm_event_types.h"
typedef struct PlayState {
@@ -708,12 +699,6 @@ void playanim_window_open(const char *title, int posx, int posy, int sizex, int
inital_state = start_maximized ? GHOST_kWindowStateFullScreen : GHOST_kWindowStateNormal;
else
inital_state = start_maximized ? GHOST_kWindowStateMaximized : GHOST_kWindowStateNormal;
-#if defined(__APPLE__) && !defined(GHOST_COCOA)
- {
- extern int macPrefState; /* creator.c */
- initial_state += macPrefState;
- }
-#endif
g_WS.ghost_window = GHOST_CreateWindow(g_WS.ghost_system,
title,
@@ -827,26 +812,6 @@ void playanim(int argc, const char **argv)
}
}
-#ifdef WITH_QUICKTIME
-#if defined(_WIN32) || defined(__APPLE__) && !defined(GHOST_COCOA)
- /* Initialize QuickTime */
-#ifndef noErr
-#define noErr 0
-#endif
-
-#ifdef _WIN32
- if (InitializeQTML(0) != noErr)
- G.have_quicktime = FALSE;
- else
- G.have_quicktime = TRUE;
-#endif /* _WIN32 */
- if (EnterMovies() != noErr)
- G.have_quicktime = FALSE;
- else
-#endif /* _WIN32 || __APPLE__ && !defined(GHOST_COCOA)*/
- G.have_quicktime = TRUE;
-#endif /* WITH_QUICKTIME */
-
if (argc > 1) {
BLI_strncpy(filepath, argv[1], sizeof(filepath));
}
@@ -1098,16 +1063,6 @@ void playanim(int argc, const char **argv)
ps.picture = ps.picture->next;
}
-#ifdef WITH_QUICKTIME
-#if defined(_WIN32) || defined(__APPLE__) && !defined(GHOST_COCOA)
- if (G.have_quicktime) {
- ExitMovies();
-#ifdef _WIN32
- TerminateQTML();
-#endif /* _WIN32 */
- }
-#endif /* _WIN32 || __APPLE__ && !defined(GHOST_COCOA) */
-#endif /* WITH_QUICKTIME */
/* cleanup */
#ifndef USE_IMB_CACHE
diff --git a/source/blender/windowmanager/intern/wm_subwindow.c b/source/blender/windowmanager/intern/wm_subwindow.c
index c9fb2644cfa..adf54af240b 100644
--- a/source/blender/windowmanager/intern/wm_subwindow.c
+++ b/source/blender/windowmanager/intern/wm_subwindow.c
@@ -116,8 +116,8 @@ void wm_subwindow_getsize(wmWindow *win, int swinid, int *x, int *y)
wmSubWindow *swin = swin_from_swinid(win, swinid);
if (swin) {
- *x = swin->winrct.xmax - swin->winrct.xmin + 1;
- *y = swin->winrct.ymax - swin->winrct.ymin + 1;
+ *x = BLI_RCT_SIZE_X(&swin->winrct) + 1;
+ *y = BLI_RCT_SIZE_Y(&swin->winrct) + 1;
}
}
@@ -256,13 +256,13 @@ void wmSubWindowScissorSet(wmWindow *win, int swinid, rcti *srct)
win->curswin = _curswin;
_curwindow = win;
- width = _curswin->winrct.xmax - _curswin->winrct.xmin + 1;
- height = _curswin->winrct.ymax - _curswin->winrct.ymin + 1;
+ width = BLI_RCT_SIZE_X(&_curswin->winrct) + 1;
+ height = BLI_RCT_SIZE_Y(&_curswin->winrct) + 1;
glViewport(_curswin->winrct.xmin, _curswin->winrct.ymin, width, height);
if (srct) {
- width = srct->xmax - srct->xmin + 1;
- height = srct->ymax - srct->ymin + 1;
+ width = BLI_RCT_SIZE_X(srct) + 1;
+ height = BLI_RCT_SIZE_Y(srct) + 1;
glScissor(srct->xmin, srct->ymin, width, height);
}
else
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c
index c2aa99352e9..b83b93454e6 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -340,12 +340,6 @@ static void wm_window_add_ghostwindow(const char *title, wmWindow *win)
wm_get_screensize(&scr_w, &scr_h);
posy = (scr_h - win->posy - win->sizey);
-#if defined(__APPLE__) && !defined(GHOST_COCOA)
- {
- extern int macPrefState; /* creator.c */
- initial_state += macPrefState;
- }
-#endif
/* Disable AA for now, as GL_SELECT (used for border, lasso, ... select)
* doesn't work well when AA is initialized, even if not used. */
ghostwin = GHOST_CreateWindow(g_system, title,
@@ -464,8 +458,8 @@ wmWindow *WM_window_open(bContext *C, rcti *rect)
win->posx = rect->xmin;
win->posy = rect->ymin;
- win->sizex = rect->xmax - rect->xmin;
- win->sizey = rect->ymax - rect->ymin;
+ win->sizex = BLI_RCT_SIZE_X(rect);
+ win->sizey = BLI_RCT_SIZE_Y(rect);
win->drawmethod = -1;
win->drawdata = NULL;
@@ -500,8 +494,8 @@ void WM_window_open_temp(bContext *C, rcti *position, int type)
win->posy = position->ymin;
}
- win->sizex = position->xmax - position->xmin;
- win->sizey = position->ymax - position->ymin;
+ win->sizex = BLI_RCT_SIZE_X(position);
+ win->sizey = BLI_RCT_SIZE_Y(position);
if (win->ghostwin) {
wm_window_set_size(win, win->sizex, win->sizey);