chiark / gitweb /
split up queue.c to remove -ldl dependency from clients
[disorder] / disobedience / misc.c
index 4ce3a430e5033b7ee8ca3d9fc2d2f04b957db135..f87f4a0339c25c80121da97d2be2e70e7e67e735 100644 (file)
  * 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;