From: Dan Winship Date: Tue, 23 Jul 2013 18:19:04 +0000 (-0400) Subject: add newtComponentGetSize and newtComponentGetPosition (#987596) X-Git-Tag: r0-52-16~8 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=c397bfc883683c815e5c0c06adb9c2c9c0ca578b;p=thirdparty%2Fnewt.git add newtComponentGetSize and newtComponentGetPosition (#987596) --- diff --git a/newt.c b/newt.c index 29bea79..be32108 100644 --- a/newt.c +++ b/newt.c @@ -1160,3 +1160,12 @@ void newtTrashScreen(void) { SLsmg_touch_lines(0, SLtt_Screen_Rows); } +void newtComponentGetPosition(newtComponent co, int * left, int * top) { + if (left) *left = co->left; + if (top) *top = co->top; +} + +void newtComponentGetSize(newtComponent co, int * width, int * height) { + if (width) *width = co->width; + if (height) *height = co->height; +} diff --git a/newt.h b/newt.h index 65a566b..9f73006 100644 --- a/newt.h +++ b/newt.h @@ -263,6 +263,9 @@ void newtScaleSetColors(newtComponent co, int empty, int full); void newtComponentAddCallback(newtComponent co, newtCallback f, void * data); void newtComponentTakesFocus(newtComponent co, int val); +void newtComponentGetPosition(newtComponent co, int * left, int * top); +void newtComponentGetSize(newtComponent co, int * width, int * height); + /* This callback is called when a component is destroyed. */ void newtComponentAddDestroyCallback(newtComponent co, newtCallback f, void * data);