+ struct stat st;
+ if( stat(png_path, &st) ) return 0;
+ if( !S_ISREG(st.st_mode) ) return 0;
+ if( st.st_size == 0 ) return 0;
+ return st.st_size;
+}
+
+int PluginServer::get_theme_png_path(char *png_path, Theme *theme)
+{
+ char *bp = strrchr(theme->path, '/');
+ if( !bp ) bp = theme->path; else ++bp;
+ char *sp = strrchr(bp,'.');
+ if( !sp || ( strcmp(sp, ".plugin") && strcmp(sp,".so") ) ) return 0;
+ char theme_dir[BCTEXTLEN], *cp = theme_dir;
+ while( bp < sp ) *cp++ = *bp++;
+ *cp = 0;
+ return get_theme_png_path(png_path, theme_dir);
+}
+
+int PluginServer::get_plugin_png_path(char *png_path)
+{
+ int len = get_theme_png_path(png_path, mwindow->theme);
+ if( !len )
+ len = get_theme_png_path(png_path, "picon");
+ return len;