> "bin/applications/$(WANT_CIN).desktop"
cp -a image/cin.svg "bin/pixmaps/$(WANT_CIN)".svg
cp -a image/cin.xpm "bin/pixmaps/$(WANT_CIN)".xpm
- for d in picon*; do cp -a $$d/. bin/plugins/$$d/.; done
+ mkdir -p bin/plugins/picon/cinfinity
+ for d in picon/*; do \
+ if [ $$d = picon/cinfinity ]; then continue; fi; \
+ cp -a $$d bin/plugins/picon/.; \
+ done
cp -a db/utils/new_db "bin/cin_db"
buninstall:
$(THEME_DATA):
cd $(OBJDIR) && \
- $(GUICAST)/$(OBJDIR)/bootstrap theme_data.o $(CINELERRA)/data/mode_*.png
+ $(GUICAST)/$(OBJDIR)/bootstrap theme_data.o $(TOPDIR)/picon/cinfinity/*.png
val-%:
@echo $($(subst val-,,$@))
{
char png_path[BCTEXTLEN];
char *pp = png_path, *ep = pp + sizeof(png_path)-1;
- snprintf(pp, ep-pp, "%s/picon_%s/%s.png",
+ snprintf(pp, ep-pp, "%s/picon/%s/%s.png",
File::get_plugin_path(), plugin_icons, name);
+ if( access(png_path, R_OK) ) return 0;
return VFramePng::vframe_png(png_path,0,0);
}
VFrame *AWindowGUI::get_picon(const char *name)
{
VFrame *vframe = get_picon(name, mwindow->preferences->plugin_icons);
- if( !vframe ) vframe = get_picon(name, DEFAULT_PICON);
+ if( !vframe ) {
+ char png_name[BCSTRLEN], *pp = png_name, *ep = pp + sizeof(png_name)-1;
+ snprintf(pp, ep-pp, "%s.png", name);
+ unsigned char *data = mwindow->theme->get_image_data(png_name);
+ if( data ) vframe = new VFramePng(data, 0.);
+ }
return vframe;
}
snprintf(index_path, sizeof(index_path), "%s/%s",
mwindow->preferences->plugin_dir, PLUGIN_FILE);
remove(index_path);
+ char picon_path[BCTEXTLEN];
FileSystem fs;
- fs.update(File::get_plugin_path());
+ snprintf(picon_path, sizeof(picon_path), "%s/picon",
+ File::get_plugin_path());
+ char png_name[BCSTRLEN], png_path[BCTEXTLEN];
+ plugin->get_plugin_png_name(png_name);
+ fs.update(picon_path);
for( int i=0; i<fs.dir_list.total; ++i ) {
char *fs_path = fs.dir_list[i]->path;
if( !fs.is_dir(fs_path) ) continue;
- char *cp = strrchr(fs_path,'/');
- cp = !cp ? fs_path : cp+1;
- if( strncmp("picon_", cp, 6) ) continue;
- char png_path[BCTEXTLEN];
- if( !plugin->get_plugin_png_path(png_path, cp+6) )
- remove(png_path);
+ snprintf(png_path, sizeof(picon_path), "%s/%s",
+ fs_path, png_name);
+ remove(png_path);
}
delete plugin; plugin = 0;
awindow->gui->async_update_assets();
int pady = BC_TextBox::calculate_h(this, MEDIUMFONT, 0, 1) + 5;
int padx = BC_Title::calculate_w(this, (char*)"X", MEDIUMFONT);
int x = padx/2, y = pady/4;
- text_x = x; text_y = y;
BC_Title *title = new BC_Title(text_x, text_y, _("Text:"), MEDIUMFONT, YELLOW);
add_subwindow(title); x += title->get_w();
+ text_x = x; text_y = y;
search_text = new ChanSearchText(this, x, y, get_w()-x-10);
add_subwindow(search_text);
x = padx; y += pady + 5;
}
-int PluginServer::get_plugin_png_path(char *png_path, const char *plugin_icons)
+void PluginServer::get_plugin_png_name(char *png_name)
{
- char *pp = png_path, *ep = pp + BCTEXTLEN-1;
- pp += snprintf(pp, ep-pp, "%s/picon_%s/",
- File::get_plugin_path(), plugin_icons);
+ char *pp = png_name, *ep = pp + BCSTRLEN-1;
char *cp = strrchr(path, '/');
cp = !cp ? path : cp+1;
char *sp = strrchr(cp, '.');
if( !sp ) sp = cp+strlen(cp);
while( pp < ep && cp < sp ) *pp++ = *cp++;
snprintf(pp, ep-pp, ".png");
+}
+
+int PluginServer::get_plugin_png_path(char *png_path, const char *plugin_icons)
+{
+ char png_name[BCSTRLEN];
+ get_plugin_png_name(png_name);
+ char *pp = png_path, *ep = pp + BCTEXTLEN-1;
+ pp += snprintf(pp, ep-pp, "%s/picon_%s/%s",
+ File::get_plugin_path(), plugin_icons, png_name);
return access(png_path,R_OK) ? 1 : 0;
}
VFrame *PluginServer::get_plugin_images()
{
char png_path[BCTEXTLEN];
- if( get_plugin_png_path(png_path) ) return 0;
- return VFramePng::vframe_png(png_path,0,0);
+ if( !get_plugin_png_path(png_path) )
+ return VFramePng::vframe_png(png_path,0,0);
+ char png_name[BCSTRLEN];
+ get_plugin_png_name(png_name);
+ unsigned char *data = mwindow->theme->get_image_data(png_name);
+ return data ? new VFramePng(data, 0.) : 0;
}
VFrame *PluginServer::get_picon()
EDL *edl, Plugin *plugin);
// close the plugin
int close_plugin();
+ void get_plugin_png_name(char *png_name);
int get_plugin_png_path(char *png_path, const char *plugin_icons);
int get_plugin_png_path(char *png_path);
void dump(FILE *fp=stdout);
PLUGIN_DIR := $(BINDIR)/plugins
OUTPUT_DIR = $(PLUGIN_DIR)/$($(PLUGIN))
-PLUGIN_PNGS = $(wildcard picon_*.png)
-OUTPUT_PNGS = $(foreach png,$(PLUGIN_PNGS), $(PLUGIN_DIR)/$(basename $(png))/$(PLUGIN).png)
OUTPUT = $(OUTPUT_DIR)/$(PLUGIN).plugin
OUTPUT_G = $(OBJDIR)/$(PLUGIN).debuginfo
ifeq ($(OUTPUT_THEME),)
-$(OUTPUT): $(OBJS) $(OUTPUT_DIR) $(OUTPUT_PNGS) $(OUTPUT_BINS)
+$(OUTPUT): $(OBJS) $(OUTPUT_DIR) $(OUTPUT_BINS)
$(LDLINKER) -o $(OUTPUT) $(OBJS) $(OUTPUT_BINS) `cat $(OBJDIR)/l_flags`
$(if $(findstring -g,$(CFLAGS)),objcopy --only-keep-debug $(OUTPUT) $(OUTPUT_G))
$(if $(findstring -ggdb,$(CFLAGS)),,strip $(OUTPUT))
$(OUTPUT_DIR):
mkdir -p $@
-$(PLUGIN_DIR)/%/$(PLUGIN).png: %.png
- $(if $(wildcard $(dir $@)),,mkdir -p $(dir $@))
- cp -a $< $@
-
clean::
rm -f $(OUTPUT)
rm -rf $(OBJDIR)