X-Git-Url: https://git.cinelerra-gg.org/git/?p=goodguy%2Fcinelerra.git;a=blobdiff_plain;f=cinelerra-5.1%2Fplugins%2Fsvg%2Fsvgwin.C;h=c0dc11d2b0e3c1e0097ea8dbcb506663e1ce0a94;hp=e5f5b920a95f97df0bde24c4d0d69cf9dae752e6;hb=refs%2Fheads%2Fmaster;hpb=0df48ad2d876409c5beeae2e21933a728ea76c33 diff --git a/cinelerra-5.1/plugins/svg/svgwin.C b/cinelerra-5.1/plugins/svg/svgwin.C index e5f5b920..c0dc11d2 100644 --- a/cinelerra-5.1/plugins/svg/svgwin.C +++ b/cinelerra-5.1/plugins/svg/svgwin.C @@ -1,4 +1,3 @@ - /* * CINELERRA * Copyright (C) 2008 Adam Williams @@ -35,8 +34,6 @@ #include -#include "empty_svg.h" - struct fifo_struct { int pid; // 1 = update from client, 2 = client closes, 3 = quit @@ -212,7 +209,9 @@ void NewSvgButton::run() } new_window = new NewSvgWindow(client, window, directory); new_window->create_objects(); + new_window->lock_window("NewSvgButton::run"); new_window->update_filter("*.svg"); + new_window->unlock_window(); result = new_window->run_window(); const char *filepath = new_window->get_path(0); strcpy(filename, filepath ? filepath : "" ); @@ -234,8 +233,13 @@ void NewSvgButton::run() else { FILE *out = fopen(filename,"w"); if( out ) { - unsigned long size = sizeof(empty_svg) - 4; - fwrite(empty_svg+4, size, 1, out); + extern unsigned char _binary_new_svg_start[]; + extern unsigned char _binary_new_svg_end[]; + unsigned int *ip = (unsigned int *)_binary_new_svg_start; + unsigned int hdr_sz = *ip++; + unsigned char *dp = (unsigned char *)ip + hdr_sz; + unsigned char *ep = _binary_new_svg_end; + fwrite(dp, ep - dp, 1, out); fclose(out); result = 0; } @@ -340,9 +344,9 @@ void EditSvgButton::run() if( ret != sizeof(fifo_buf) ) continue; switch( fifo_buf.action ) { case 1: break; - case 2: printf(_("Inkscape has exited\n")); + case 2: // printf(_("Inkscape has exited\n")); break; - case 3: printf(_("Plugin window has closed\n")); + case 3: // printf(_("Plugin window has closed\n")); done = 1; break; } @@ -432,7 +436,7 @@ NewSvgWindow::~NewSvgWindow() {} DpiValue::DpiValue(SvgWin *win, SvgMain *client, int x, int y, float *value) - : BC_TumbleTextBox(win, *value, (float)10, (float)1000, x, y, 100) + : BC_TumbleTextBox(win, *value, 10.f, 1000.f, x, y, xS(100), 2) { //printf("SvgWidth::SvgWidth %f\n", client->config.w); this->client = client;