summaryrefslogtreecommitdiff
path: root/prev/container_windows.c
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2016-05-30 00:14:46 -0400
committerPietro Gagliardi <[email protected]>2016-05-30 00:14:46 -0400
commit52f7d276a6bb04b8827ac019ad1e135b43819cea (patch)
tree5f0ebbfdf5885ef832e77e243b5916e59f46ba18 /prev/container_windows.c
parentc9b32c1333e4009b342eedc5f5b39127a724fb42 (diff)
Removed prev/.
Diffstat (limited to 'prev/container_windows.c')
-rw-r--r--prev/container_windows.c39
1 files changed, 0 insertions, 39 deletions
diff --git a/prev/container_windows.c b/prev/container_windows.c
deleted file mode 100644
index bbad9ec..0000000
--- a/prev/container_windows.c
+++ /dev/null
@@ -1,39 +0,0 @@
-// 17 july 2014
-
-#include "winapi_windows.h"
-#include "_cgo_export.h"
-
-RECT containerBounds(HWND hwnd)
-{
- RECT r;
-
- if (GetClientRect(hwnd, &r) == 0)
- xpanic("error getting container client rect for container.bounds()", GetLastError());
- return r;
-}
-
-void calculateBaseUnits(HWND hwnd, int *baseX, int *baseY, LONG *internalLeading)
-{
- HDC dc;
- HFONT prevFont;
- TEXTMETRICW tm;
- SIZE size;
-
- dc = GetDC(hwnd);
- if (dc == NULL)
- xpanic("error getting DC for preferred size calculations", GetLastError());
- prevFont = (HFONT) SelectObject(dc, controlFont);
- if (prevFont == NULL)
- xpanic("error loading control font into device context for preferred size calculation", GetLastError());
- if (GetTextMetricsW(dc, &tm) == 0)
- xpanic("error getting text metrics for preferred size calculations", GetLastError());
- if (GetTextExtentPoint32W(dc, L"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", 52, &size) == 0)
- xpanic("error getting text extent point for preferred size calculations", GetLastError());
- *baseX = (int) ((size.cx / 26 + 1) / 2);
- *baseY = (int) tm.tmHeight;
- *internalLeading = tm.tmInternalLeading;
- if (SelectObject(dc, prevFont) != controlFont)
- xpanic("error restoring previous font into device context after preferred size calculations", GetLastError());
- if (ReleaseDC(hwnd, dc) == 0)
- xpanic("error releasing DC for preferred size calculations", GetLastError());
-}