X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=mod_query%2Finput.c;h=57a23c53ee26b07db2292bd8dc84bd51b2f135dd;hb=2cbfb1bd74fdc6b0c3733abb07e95ba9fa334929;hp=ee190265f237494c2374a3bb04ed9510e2d0bae7;hpb=8366314611bf30a0f31d25bf5f5023186fa87692;p=ion3.git diff --git a/mod_query/input.c b/mod_query/input.c index ee19026..57a23c5 100644 --- a/mod_query/input.c +++ b/mod_query/input.c @@ -1,7 +1,7 @@ /* * 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 @@ -161,8 +161,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 +186,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 */