]> git.decadent.org.uk Git - ion3.git/blobdiff - mod_query/input.c
[svn-upgrade] Integrating new upstream version, ion3 (20070506)
[ion3.git] / mod_query / input.c
index ee190265f237494c2374a3bb04ed9510e2d0bae7..2cf1f25458597b089977c57f0baa922e276b00bd 100644 (file)
@@ -1,12 +1,9 @@
 /*
  * ion/mod_query/input.c
  *
- * Copyright (c) Tuomo Valkonen 1999-2006
+ * Copyright (c) Tuomo Valkonen 1999-2007
  *
- * Ion is free software; you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
+ * See the included file LICENSE for details.
  */
 
 #include <libmainloop/defer.h>
@@ -161,8 +158,7 @@ void input_deinit(WInput *input)
 EXTL_EXPORT_MEMBER
 void input_cancel(WInput *input)
 {
-    if(region_manager_allows_destroying((WRegion*)input))
-        mainloop_defer_destroy((Obj*)input);
+    region_defer_rqdispose((WRegion*)input);
 }
 
 
@@ -187,6 +183,29 @@ static void input_activated(WInput *input)
 /*}}}*/
 
 
+/*{{{{ Misc */
+
+
+void mod_query_get_minimum_extents(GrBrush *brush, bool with_spacing, 
+                                   int *w, int *h)
+{
+    GrBorderWidths bdw;
+    GrFontExtents fnte;
+    int spc;
+    
+    grbrush_get_border_widths(brush, &bdw);
+    grbrush_get_font_extents(brush, &fnte);
+    
+    spc=(with_spacing ? bdw.spacing : 0);
+    
+    *h=(fnte.max_height+bdw.top+bdw.bottom+spc);
+    *w=(bdw.left+bdw.right+spc);
+}
+
+
+/*}}}*/
+
+
 /*{{{ Dynamic function table and class implementation */