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:
authorTon Roosendaal <ton@blender.org>2012-12-12 22:58:11 +0400
committerTon Roosendaal <ton@blender.org>2012-12-12 22:58:11 +0400
commit12b642062c6fcef70151bd2424c2ebbc6a1a6843 (patch)
treecefb983f370b982f5e8b606c21ac884eb32a35a2 /intern/ghost
parent26ae649b01c1147ec2fbb147bb652a8bc49a0019 (diff)
Holiday coding log :)
Nice formatted version (pictures soon): http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability Short list of main changes: - Transparent region option (over main region), added code to blend in/out such panels. - Min size window now 640 x 480 - Fixed DPI for ui - lots of cleanup and changes everywhere. Icon image need correct size still, layer-in-use icon needs remake. - Macbook retina support, use command line --no-native-pixels to disable it - Timeline Marker label was drawing wrong - Trackpad and magic mouse: supports zoom (hold ctrl) - Fix for splash position: removed ghost function and made window size update after creation immediate - Fast undo buffer save now adds UI as well. Could be checked for regular file save even... Quit.blend and temp file saving use this now. - Dixed filename in window on reading quit.blend or temp saves, and they now add a warning in window title: "(Recovered)" - New Userpref option "Keep Session" - this always saves quit.blend, and loads on start. This allows keeping UI and data without actual saves, until you actually save. When you load startup.blend and quit, it recognises the quit.blend as a startup (no file name in header) - Added 3D view copy/paste buffers (selected objects). Shortcuts ctrl-c, ctrl-v (OSX, cmd-c, cmd-v). Coded partial file saving for it. Could be used for other purposes. Todo: use OS clipboards. - User preferences (themes, keymaps, user settings) now can be saved as a separate file. Old option is called "Save Startup File" the new one "Save User Settings". To visualise this difference, the 'save startup file' button has been removed from user preferences window. That option is available as CTRL+U and in File menu still. - OSX: fixed bug that stopped giving mouse events outside window. This also fixes "Continuous Grab" for OSX. (error since 2009)
Diffstat (limited to 'intern/ghost')
-rw-r--r--intern/ghost/GHOST_C-api.h10
-rw-r--r--intern/ghost/GHOST_ISystem.h7
-rw-r--r--intern/ghost/intern/GHOST_C-api.cpp13
-rw-r--r--intern/ghost/intern/GHOST_System.cpp13
-rw-r--r--intern/ghost/intern/GHOST_System.h11
-rw-r--r--intern/ghost/intern/GHOST_SystemCocoa.mm27
-rw-r--r--intern/ghost/intern/GHOST_SystemWin32.cpp4
-rw-r--r--intern/ghost/intern/GHOST_WindowCocoa.mm13
-rw-r--r--intern/ghost/intern/GHOST_WindowX11.cpp4
9 files changed, 86 insertions, 16 deletions
diff --git a/intern/ghost/GHOST_C-api.h b/intern/ghost/GHOST_C-api.h
index f886dfd9d7d..ab5feb287d8 100644
--- a/intern/ghost/GHOST_C-api.h
+++ b/intern/ghost/GHOST_C-api.h
@@ -852,6 +852,16 @@ extern int GHOST_toggleConsole(int action);
*/
extern int GHOST_confirmQuit(GHOST_WindowHandle windowhandle);
+/**
+ * Use native pixel size (MacBook pro 'retina'), if supported.
+ */
+extern int GHOST_UseNativePixels(void);
+
+/**
+ * If window was opened using native pixel size, it returns scaling factor.
+ */
+extern float GHOST_GetNativePixelSize(void);
+
#ifdef __cplusplus
}
diff --git a/intern/ghost/GHOST_ISystem.h b/intern/ghost/GHOST_ISystem.h
index ad5d2379787..dfe01521a29 100644
--- a/intern/ghost/GHOST_ISystem.h
+++ b/intern/ghost/GHOST_ISystem.h
@@ -294,6 +294,13 @@ public:
* \return The current status.
*/
virtual bool getFullScreen(void) = 0;
+
+ /**
+ * Native pixel size support (MacBook 'retina').
+ * \return The pixel size in float.
+ */
+ virtual bool useNativePixel(void) = 0;
+ virtual float getNativePixelSize(void) = 0;
/***************************************************************************************
* Event management functionality
diff --git a/intern/ghost/intern/GHOST_C-api.cpp b/intern/ghost/intern/GHOST_C-api.cpp
index 88d02c46f61..ba0a6eba36f 100644
--- a/intern/ghost/intern/GHOST_C-api.cpp
+++ b/intern/ghost/intern/GHOST_C-api.cpp
@@ -878,3 +878,16 @@ int GHOST_confirmQuit(GHOST_WindowHandle windowhandle)
GHOST_ISystem *system = GHOST_ISystem::getSystem();
return system->confirmQuit((GHOST_IWindow *) windowhandle);
}
+
+int GHOST_UseNativePixels(void)
+{
+ GHOST_ISystem *system = GHOST_ISystem::getSystem();
+ return system->useNativePixel();
+}
+
+float GHOST_GetNativePixelSize(void)
+{
+ GHOST_ISystem *system = GHOST_ISystem::getSystem();
+ return system->getNativePixelSize();
+}
+
diff --git a/intern/ghost/intern/GHOST_System.cpp b/intern/ghost/intern/GHOST_System.cpp
index 8c6491bcbfd..a008d224a20 100644
--- a/intern/ghost/intern/GHOST_System.cpp
+++ b/intern/ghost/intern/GHOST_System.cpp
@@ -373,3 +373,16 @@ int GHOST_System::confirmQuit(GHOST_IWindow *window) const
{
return 1;
}
+
+bool GHOST_System::useNativePixel(void)
+{
+ m_nativePixel = 1;
+ return 1;
+}
+
+float GHOST_System::getNativePixelSize(void)
+{
+ if (m_nativePixel)
+ return m_nativePixelSize;
+ return 1.0f;
+}
diff --git a/intern/ghost/intern/GHOST_System.h b/intern/ghost/intern/GHOST_System.h
index d2e3377f6ce..5060f22c509 100644
--- a/intern/ghost/intern/GHOST_System.h
+++ b/intern/ghost/intern/GHOST_System.h
@@ -167,6 +167,16 @@ public:
*/
virtual bool getFullScreen(void);
+
+ /**
+ * Native pixel size support (MacBook 'retina').
+ * \return The pixel size in float.
+ */
+ virtual bool useNativePixel(void);
+ bool m_nativePixel;
+
+ virtual float getNativePixelSize(void);
+ float m_nativePixelSize;
/***************************************************************************************
* Event management functionality
@@ -350,6 +360,7 @@ protected:
/** Settings of the display before the display went fullscreen. */
GHOST_DisplaySetting m_preFullScreenSetting;
+
};
inline GHOST_TimerManager *GHOST_System::getTimerManager() const
diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm
index 16edb4af575..7f6b69d9d50 100644
--- a/intern/ghost/intern/GHOST_SystemCocoa.mm
+++ b/intern/ghost/intern/GHOST_SystemCocoa.mm
@@ -1058,7 +1058,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleWindowEvent(GHOST_TEventType eventType,
pushEvent( new GHOST_Event(getMilliSeconds(), GHOST_kEventWindowSize, window) );
//Mouse up event is trapped by the resizing event loop, so send it anyway to the window manager
pushEvent(new GHOST_EventButton(getMilliSeconds(), GHOST_kEventButtonUp, window, convertButton(0)));
- m_ignoreWindowSizedMessages = true;
+ //m_ignoreWindowSizedMessages = true;
}
break;
default:
@@ -1450,13 +1450,22 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
{
NSEvent *event = (NSEvent *)eventPtr;
GHOST_WindowCocoa* window;
+ CocoaWindow *cocoawindow;
+ /* [event window] returns other windows if mouse-over, that's OSX input standard
+ however, if mouse exits window(s), the windows become inactive, until you click.
+ We then fall back to the active window from ghost */
window = (GHOST_WindowCocoa*)m_windowManager->getWindowAssociatedWithOSWindow((void*)[event window]);
if (!window) {
- //printf("\nW failure for event 0x%x",[event type]);
- return GHOST_kFailure;
+ window = (GHOST_WindowCocoa*)m_windowManager->getActiveWindow();
+ if (!window) {
+ //printf("\nW failure for event 0x%x",[event type]);
+ return GHOST_kFailure;
+ }
}
+ cocoawindow = (CocoaWindow *)window->getOSWindow();
+
switch ([event type]) {
case NSLeftMouseDown:
case NSRightMouseDown:
@@ -1509,7 +1518,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
break;
case GHOST_kGrabWrap: //Wrap cursor at area/window boundaries
{
- NSPoint mousePos = [event locationInWindow];
+ NSPoint mousePos = [cocoawindow mouseLocationOutsideOfEventStream];
GHOST_TInt32 x_mouse= mousePos.x;
GHOST_TInt32 y_mouse= mousePos.y;
GHOST_TInt32 x_accum, y_accum, x_cur, y_cur, x, y;
@@ -1555,9 +1564,9 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
default:
{
//Normal cursor operation: send mouse position in window
- NSPoint mousePos = [event locationInWindow];
+ NSPoint mousePos = [cocoawindow mouseLocationOutsideOfEventStream];
GHOST_TInt32 x, y;
-
+
window->clientToScreenIntern(mousePos.x, mousePos.y, x, y);
pushEvent(new GHOST_EventCursor([event timestamp] * 1000, GHOST_kEventCursorMove, window, x, y));
@@ -1584,7 +1593,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
pushEvent(new GHOST_EventWheel([event timestamp] * 1000, window, delta));
}
else {
- NSPoint mousePos = [event locationInWindow];
+ NSPoint mousePos = [cocoawindow mouseLocationOutsideOfEventStream];
GHOST_TInt32 x, y;
double dx = [event deltaX];
double dy = -[event deltaY];
@@ -1616,7 +1625,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
case NSEventTypeMagnify:
{
- NSPoint mousePos = [event locationInWindow];
+ NSPoint mousePos = [cocoawindow mouseLocationOutsideOfEventStream];
GHOST_TInt32 x, y;
window->clientToScreenIntern(mousePos.x, mousePos.y, x, y);
pushEvent(new GHOST_EventTrackpad([event timestamp] * 1000, window, GHOST_kTrackpadEventMagnify, x, y,
@@ -1626,7 +1635,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
case NSEventTypeRotate:
{
- NSPoint mousePos = [event locationInWindow];
+ NSPoint mousePos = [cocoawindow mouseLocationOutsideOfEventStream];
GHOST_TInt32 x, y;
window->clientToScreenIntern(mousePos.x, mousePos.y, x, y);
pushEvent(new GHOST_EventTrackpad([event timestamp] * 1000, window, GHOST_kTrackpadEventRotate, x, y,
diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp
index 46c71f57c6f..9f62ed76735 100644
--- a/intern/ghost/intern/GHOST_SystemWin32.cpp
+++ b/intern/ghost/intern/GHOST_SystemWin32.cpp
@@ -782,8 +782,8 @@ GHOST_TSuccess GHOST_SystemWin32::pushDragDropEvent(GHOST_TEventType eventType,
void GHOST_SystemWin32::processMinMaxInfo(MINMAXINFO *minmax)
{
- minmax->ptMinTrackSize.x = 320;
- minmax->ptMinTrackSize.y = 240;
+ minmax->ptMinTrackSize.x = 640;
+ minmax->ptMinTrackSize.y = 480;
}
#ifdef WITH_INPUT_NDOF
diff --git a/intern/ghost/intern/GHOST_WindowCocoa.mm b/intern/ghost/intern/GHOST_WindowCocoa.mm
index a483c030b31..2c833fcaf9d 100644
--- a/intern/ghost/intern/GHOST_WindowCocoa.mm
+++ b/intern/ghost/intern/GHOST_WindowCocoa.mm
@@ -470,8 +470,8 @@ GHOST_WindowCocoa::GHOST_WindowCocoa(
[m_window setSystemAndWindowCocoa:systemCocoa windowCocoa:this];
//Forbid to resize the window below the blender defined minimum one
- minSize.width = 320;
- minSize.height = 240;
+ minSize.width = 640;
+ minSize.height = 480;
[m_window setContentMinSize:minSize];
setTitle(title);
@@ -579,6 +579,13 @@ GHOST_WindowCocoa::GHOST_WindowCocoa(
updateDrawingContext();
activateDrawingContext();
+ if (m_systemCocoa->m_nativePixel) {
+ [m_openGLView setWantsBestResolutionOpenGLSurface:YES];
+ NSRect backingBounds = [m_openGLView convertRectToBacking:[m_openGLView bounds]];
+ m_systemCocoa->m_nativePixelSize = (float)backingBounds.size.width / (float)rect.size.width;
+ }
+
+
m_tablet.Active = GHOST_kTabletModeNone;
CocoaWindowDelegate *windowDelegate = [[CocoaWindowDelegate alloc] init];
@@ -1008,7 +1015,7 @@ GHOST_TSuccess GHOST_WindowCocoa::setState(GHOST_TWindowState state)
[tmpWindow registerForDraggedTypes:[NSArray arrayWithObjects:NSFilenamesPboardType,
NSStringPboardType, NSTIFFPboardType, nil]];
//Forbid to resize the window below the blender defined minimum one
- [tmpWindow setContentMinSize:NSMakeSize(320, 240)];
+ [tmpWindow setContentMinSize:NSMakeSize(640, 480)];
//Assign the openGL view to the new window
[tmpWindow setContentView:m_openGLView];
diff --git a/intern/ghost/intern/GHOST_WindowX11.cpp b/intern/ghost/intern/GHOST_WindowX11.cpp
index 156bc86869a..3440e3ce15a 100644
--- a/intern/ghost/intern/GHOST_WindowX11.cpp
+++ b/intern/ghost/intern/GHOST_WindowX11.cpp
@@ -363,8 +363,8 @@ GHOST_WindowX11(
xsizehints->y = top;
xsizehints->width = width;
xsizehints->height = height;
- xsizehints->min_width = 320; /* size hints, could be made apart of the ghost api */
- xsizehints->min_height = 240; /* limits are also arbitrary, but should not allow 1x1 window */
+ xsizehints->min_width = 640; /* size hints, could be made apart of the ghost api */
+ xsizehints->min_height = 480; /* limits are also arbitrary, but should not allow 1x1 window */
xsizehints->max_width = 65535;
xsizehints->max_height = 65535;
XSetWMNormalHints(m_display, m_window, xsizehints);