add getFrame to pub.h [ci skip]

This commit is contained in:
vcaesar 2018-08-13 08:10:54 -04:00
parent c91af647e4
commit 56bc179c39
2 changed files with 25 additions and 0 deletions

View File

@ -11,6 +11,7 @@
#include "alert_c.h"
#include "window.h"
#include "win32.h"
#include "win_sys.h"
int show_alert(const char *title, const char *msg,
const char *defaultButton, const char *cancelButton){

View File

@ -255,6 +255,30 @@ MData mData;
}
}
static Bounds GetFrame(MData win){
Bounds frame;
// Retrieve frame bounds
if (WM_EXTENTS != None) {
long* result; uint32 nItems = 0;
// Get the window extents property
result = (long*) GetWindowProperty(win, WM_EXTENTS, &nItems);
// Verify the results
if (result != NULL) {
if (nItems == 4) {
frame.X = (int32) result[0];
frame.Y = (int32) result[2]
frame.W = (int32) result[0] + (int32) result[1];
frame.H = (int32) result[2] + (int32) result[3];
}
XFree(result);
}
}
return frame;
}
#elif defined(IS_WINDOWS)
//