]> git.ipfire.org Git - thirdparty/newt.git/commitdiff
add newtComponentGetSize and newtComponentGetPosition (#987596)
authorDan Winship <danw@gnome.org>
Tue, 23 Jul 2013 18:19:04 +0000 (14:19 -0400)
committerMiroslav Lichvar <mlichvar@redhat.com>
Wed, 31 Jul 2013 11:01:12 +0000 (13:01 +0200)
newt.c
newt.h

diff --git a/newt.c b/newt.c
index 29bea79ca116962fe185576db15cb5e1783ea37e..be321081a55813568edde9ed296e14c18eceb7a0 100644 (file)
--- 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 65a566b3a1cda96a38106c0b34ab6267adc0fe28..9f73006929d73b0727314f9ec3fba04ebc0e0385 100644 (file)
--- 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);