aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mac.m47
-rw-r--r--src/win.c25
-rw-r--r--src/x11.c20
3 files changed, 0 insertions, 92 deletions
diff --git a/src/mac.m b/src/mac.m
index 6095035..ee7bb27 100644
--- a/src/mac.m
+++ b/src/mac.m
@@ -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)) {
diff --git a/src/win.c b/src/win.c
index 3689c27..3f37381 100644
--- a/src/win.c
+++ b/src/win.c
@@ -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)) {
diff --git a/src/x11.c b/src/x11.c
index bcf95b8..836152d 100644
--- a/src/x11.c
+++ b/src/x11.c
@@ -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;