+ retvalue.addr != NULL) {
+ if (!config_get("theme", Config_String, &theme))
+ g_assert_not_reached(); /* where's the default!? its not set? */
+
+ button_dir = g_strdup_printf("%s_buttons", theme.string);
+
+ s = g_build_filename(g_get_home_dir(), ".openbox", "themes",
+ "openbox", button_dir, retvalue.addr, NULL);
+
+ if (XReadBitmapFileData(s, &w, &h, &b, &hx, &hy) == BitmapSuccess)
+ ret = TRUE;
+ else {
+ g_free(s);
+ s = g_build_filename(THEMEDIR, button_dir, retvalue.addr, NULL);
+
+ if (XReadBitmapFileData(s, &w, &h, &b, &hx, &hy) == BitmapSuccess)
+ ret = TRUE;
+ else {
+ g_free(s);
+ s = g_strdup_printf("%s_buttons/%s", theme.string,
+ theme.string);
+ if (XReadBitmapFileData(s, &w, &h, &b, &hx, &hy) ==
+ BitmapSuccess)
+ ret = TRUE;
+ else
+ g_message("Unable to find bitmap '%s'", s);
+ }
+ }
+
+ if (ret) {
+ *value = pixmap_mask_new(w, h, (char*)b);
+ XFree(b);
+ }
+
+ g_free(s);
+ g_free(button_dir);