X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fplugins%2Fsvg%2Fsvgwin.C;h=9931a8ddc218c5fa3f86f05b3a6d0401ce9c1b04;hb=15df6cbff7373d232ae0b8dcaecd9aa51ff5c388;hp=d5f8b97824f09d9a19d1babd254eccc1a3d32864;hpb=7be8c7f90868895abddcbafda66ede5632752a70;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/plugins/svg/svgwin.C b/cinelerra-5.1/plugins/svg/svgwin.C index d5f8b978..9931a8dd 100644 --- a/cinelerra-5.1/plugins/svg/svgwin.C +++ b/cinelerra-5.1/plugins/svg/svgwin.C @@ -2,21 +2,21 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * + * */ #include "svgwin.h" @@ -135,17 +135,6 @@ void SvgWin::update_gui(SvgConfig &config) unlock_window(); } -static void flicker(BC_GenericButton *btn, int n, int clr) -{ - int color = btn->get_color(); - while( --n >= 0 ) { - btn->text_color(clr); btn->draw_face(1); - btn->sync_display(); usleep(100000); - btn->text_color(color); btn->draw_face(1); - btn->sync_display(); usleep(100000); - } -} - SvgCoord::SvgCoord(SvgWin *win, SvgMain *client, int x, int y, float *value) : BC_TumbleTextBox(win, *value, (float)0, (float)3000, x, y, 100) { @@ -182,7 +171,7 @@ int NewSvgButton::handle_event() start(); } else { - flicker(this, 5, RED); + flicker(); window->editing_lock.unlock(); } @@ -239,7 +228,7 @@ void NewSvgButton::run() } } } while(result); // file doesn't exist so repeat - + strcpy(client->config.svg_file, filename); struct stat st; client->config.ms_time = stat(filename, &st) ? 0 : @@ -282,7 +271,7 @@ void EditSvgButton::stop() int EditSvgButton::handle_event() { - + window->editing_lock.lock(); if( !window->editing && client->config.svg_file[0] != 0 ) { window->editing = 1; @@ -290,7 +279,7 @@ int EditSvgButton::handle_event() start(); } else { - flicker(this, 5, RED); + flicker(); window->editing_lock.unlock(); } return 1; @@ -305,7 +294,7 @@ void EditSvgButton::run() strcat(filename_png, ".png"); remove(filename_png); strcpy(filename_fifo, filename_png); - strcat(filename_fifo, ".fifo"); + strcat(filename_fifo, ".fifo"); remove(filename_fifo); if( !mkfifo(filename_fifo, S_IRWXU) && (fh_fifo = ::open(filename_fifo, O_RDWR+O_NONBLOCK)) >= 0 ) { @@ -369,7 +358,8 @@ void SvgInkscapeThread::run() { // Runs the inkscape char command[1024]; - sprintf(command, "inkscape --with-gui %s", edit->client->config.svg_file); + snprintf(command, sizeof(command), + "inkscape --with-gui %s", edit->client->config.svg_file); printf(_("Running external SVG editor: %s\n"), command); enable_cancel();