From def5999f9b04368aa21485b514c0931f6fb43d8e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 2 Apr 2014 18:42:08 +1100 Subject: UI: support for dragging popups title area --- source/blender/windowmanager/intern/wm_subwindow.c | 14 ++++++++++++++ source/blender/windowmanager/wm_subwindow.h | 1 + 2 files changed, 15 insertions(+) (limited to 'source/blender/windowmanager') diff --git a/source/blender/windowmanager/intern/wm_subwindow.c b/source/blender/windowmanager/intern/wm_subwindow.c index 1c20fe34a90..ecf22fea454 100644 --- a/source/blender/windowmanager/intern/wm_subwindow.c +++ b/source/blender/windowmanager/intern/wm_subwindow.c @@ -180,6 +180,20 @@ void wm_subwindow_rect_get(wmWindow *win, int swinid, rcti *r_rect) } +static void wm_swin_rect_set(wmSubWindow *swin, const rcti *rect) +{ + swin->winrct = *rect; +} +void wm_subwindow_rect_set(wmWindow *win, int swinid, const rcti *rect) +{ + wmSubWindow *swin = swin_from_swinid(win, swinid); + + if (swin) { + wm_swin_rect_set(swin, rect); + } +} + + /* always sets pixel-precise 2D window/view matrices */ /* coords is in whole pixels. xmin = 15, xmax = 16: means window is 2 pix big */ int wm_subwindow_open(wmWindow *win, const rcti *winrct) diff --git a/source/blender/windowmanager/wm_subwindow.h b/source/blender/windowmanager/wm_subwindow.h index c1d0f9a9cac..bf7b99433c6 100644 --- a/source/blender/windowmanager/wm_subwindow.h +++ b/source/blender/windowmanager/wm_subwindow.h @@ -46,6 +46,7 @@ void wm_subwindow_size_get(wmWindow *win, int swinid, int *x, int *y); void wm_subwindow_origin_get(wmWindow *win, int swinid, int *x, int *y); void wm_subwindow_matrix_get(wmWindow *win, int swinid, float mat[4][4]); void wm_subwindow_rect_get(wmWindow *win, int swinid, struct rcti *r_rect); +void wm_subwindow_rect_set(wmWindow *win, int swinid, const rcti *rect); unsigned int index_to_framebuffer(int index); -- cgit v1.2.3