X-Git-Url: https://git.distorted.org.uk/~mdw/disorder/blobdiff_plain/763d5e6ad88ef3ba1cd1d7742d060e4f1e54c6b8..913f2c0a04c0f943145fe387395cc4e44e42d582:/disobedience/misc.c diff --git a/disobedience/misc.c b/disobedience/misc.c index 4ce3a43..f87f4a0 100644 --- a/disobedience/misc.c +++ b/disobedience/misc.c @@ -17,13 +17,23 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA */ +/** @file disobedience/misc.c + * @brief Miscellaneous GTK+ interfacing stuff + */ #include "disobedience.h" /* Miscellaneous GTK+ stuff ------------------------------------------------ */ +WT(cached_image); + /* Functions */ +/** @brief Put scrollbars around a widget + * @param child Widget to surround + * @param widgetname Name for (both) widgets + * @return Scroll widget + */ GtkWidget *scroll_widget(GtkWidget *child, const char *widgetname) { GtkWidget *scroller = gtk_scrolled_window_new(0, 0); @@ -55,6 +65,15 @@ GtkWidget *scroll_widget(GtkWidget *child, return scroller; } +/** @brief Find an image + * @param name Relative path to image + * @return pixbuf containing image + * + * Images are cached so it's perfectly sensible to call this lots of times even + * for the same image. + * + * Images are searched for in @c pkgdatadir/static. + */ GdkPixbuf *find_image(const char *name) { static const struct cache_type image_cache_type = { INT_MAX }; @@ -68,11 +87,13 @@ GdkPixbuf *find_image(const char *name) { error(0, "%s", err->message); return 0; } + NW(cached_image); cache_put(&image_cache_type, name, pb); } return pb; } +/** @brief Pop up an error message */ void popup_error(const char *msg) { GtkWidget *w;