diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mac.m | 47 | ||||
-rw-r--r-- | src/win.c | 25 | ||||
-rw-r--r-- | src/x11.c | 20 |
3 files changed, 0 insertions, 92 deletions
@@ -151,12 +151,6 @@ nsPointFromPoints(const PuglView* view, const NSPoint point) return NSMakePoint(point.x * scaleFactor, point.y * scaleFactor); } -static NSRect -rectToNsRect(const PuglRect rect) -{ - return NSMakeRect(rect.x, rect.y, rect.width, rect.height); -} - static NSSize sizePoints(PuglView* view, const PuglSpan width, const PuglSpan height) { @@ -1713,47 +1707,6 @@ puglGetScaleFactor(const PuglView* const view) } PuglStatus -puglSetFrame(PuglView* view, const PuglRect frame) -{ - PuglInternals* const impl = view->impl; - const NSRect framePx = rectToNsRect(frame); - const NSRect framePt = nsRectToPoints(view, framePx); - - if (!impl->wrapperView) { - // Set defaults to be used when realized - view->defaultX = frame.x; - view->defaultY = frame.y; - view->sizeHints[PUGL_DEFAULT_SIZE].width = (PuglSpan)frame.width; - view->sizeHints[PUGL_DEFAULT_SIZE].height = (PuglSpan)frame.height; - return PUGL_SUCCESS; - } - - if (impl->window) { - const NSRect screenPt = rectToScreen(viewScreen(view), framePt); - - // Move and resize window to fit new content rect - const NSRect winFrame = [impl->window frameRectForContentRect:screenPt]; - [impl->window setFrame:winFrame display:NO]; - - // Resize views - const NSRect sizePx = NSMakeRect(0, 0, frame.width, frame.height); - const NSRect sizePt = [impl->drawView convertRectFromBacking:sizePx]; - [impl->wrapperView setFrame:sizePt]; - [impl->drawView setFrame:sizePt]; - [impl->window dispatchCurrentConfiguration]; - return PUGL_SUCCESS; - } - - // Resize view - const NSRect sizePx = NSMakeRect(0, 0, frame.width, frame.height); - const NSRect sizePt = [impl->drawView convertRectFromBacking:sizePx]; - - [impl->wrapperView setFrame:framePt]; - [impl->drawView setFrame:sizePt]; - return dispatchCurrentChildViewConfiguration(view); -} - -PuglStatus puglSetPosition(PuglView* const view, const int x, const int y) { if (!puglIsValidPosition(x, y)) { @@ -1245,31 +1245,6 @@ puglGetScaleFactor(const PuglView* const view) } PuglStatus -puglSetFrame(PuglView* view, const PuglRect frame) -{ - if (!view->impl->hwnd) { - // Set defaults to be used when realized - view->defaultX = frame.x; - view->defaultY = frame.y; - view->sizeHints[PUGL_DEFAULT_SIZE].width = frame.width; - view->sizeHints[PUGL_DEFAULT_SIZE].height = frame.height; - return PUGL_SUCCESS; - } - - const RECT rect = - adjustedWindowRect(view, frame.x, frame.y, frame.width, frame.height); - - return puglWinStatus( - SetWindowPos(view->impl->hwnd, - HWND_TOP, - rect.left, - rect.top, - rect.right - rect.left, - rect.bottom - rect.top, - SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOZORDER)); -} - -PuglStatus puglSetPosition(PuglView* const view, const int x, const int y) { if (!puglIsValidPosition(x, y)) { @@ -1946,26 +1946,6 @@ puglGetScaleFactor(const PuglView* const view) } PuglStatus -puglSetFrame(PuglView* const view, const PuglRect frame) -{ - if (!view->impl->win) { - // Set defaults to be used when realized - view->defaultX = frame.x; - view->defaultY = frame.y; - view->sizeHints[PUGL_DEFAULT_SIZE].width = frame.width; - view->sizeHints[PUGL_DEFAULT_SIZE].height = frame.height; - return PUGL_SUCCESS; - } - - return puglX11Status(XMoveResizeWindow(view->world->impl->display, - view->impl->win, - frame.x, - frame.y, - frame.width, - frame.height)); -} - -PuglStatus puglSetPosition(PuglView* const view, const int x, const int y) { Display* const display = view->world->impl->display; |