From 1725ab07344c038c814f91fb3d948d8c81f73f23 Mon Sep 17 00:00:00 2001 From: buliabyak Date: Thu, 22 Mar 2007 05:14:53 +0000 Subject: [PATCH] remove useless and half-broken slideshow mode in favor of inkview --- inkscape.fr.pod | 5 --- inkscape.pod | 5 --- src/Makefile_insert | 1 - src/main.cpp | 41 +++++------------ src/slideshow.cpp | 105 -------------------------------------------- src/slideshow.h | 31 ------------- 6 files changed, 10 insertions(+), 178 deletions(-) delete mode 100644 src/slideshow.cpp delete mode 100644 src/slideshow.h diff --git a/inkscape.fr.pod b/inkscape.fr.pod index 3a10bf3e2..4a76ed50a 100644 --- a/inkscape.fr.pod +++ b/inkscape.fr.pod @@ -14,7 +14,6 @@ options: -V, --version -f, --file=NOMDEFICHIER - -s, --slideshow -e, --export-png=NOMDEFICHIER -a, --export-area=x0:y0:x1:y1 @@ -148,10 +147,6 @@ Vous pouvez aussi utiliser `| COMMANDE' pour spécifier un tube de commande diff N'oubliez pas d'utiliser les guillemets appropriés pour votre shell, par exemple inkscape --print='| ps2pdf - mondoc.pdf' mondoc.svg -=item B<-s>, B<--slideshow> - -Affiche les fichiers spécifiés un par un, passant au suivant à chaque évènement clavier ou souris. - =item B<-t>, B<--export-use-hints> Utilise le nom de fichier et la PPP enregistrés avec l'objet exporté (uniquement si --export-id est spécifié). diff --git a/inkscape.pod b/inkscape.pod index b989fbe0e..33c89a2b4 100644 --- a/inkscape.pod +++ b/inkscape.pod @@ -14,7 +14,6 @@ options: -V, --version -f, --file=FILENAME - -s, --slideshow -e, --export-png=FILENAME -a, --export-area=x0:y0:x1:y1 @@ -209,10 +208,6 @@ Remember to do appropriate quoting for your shell, e.g. inkscape --print='| ps2pdf - mydoc.pdf' mydoc.svg -=item B<-s>, B<--slideshow> - -Show given files one by one, switching to the next one by any key or mouse event. - =item B<-t>, B<--export-use-hints> Use export filename and DPI hints stored in the exported object (only with --export-id). diff --git a/src/Makefile_insert b/src/Makefile_insert index e87beb031..36c6f3c32 100644 --- a/src/Makefile_insert +++ b/src/Makefile_insert @@ -130,7 +130,6 @@ libinkpre_a_SOURCES = \ seltrans.cpp seltrans.h \ shape-editor.cpp shape-editor.h \ shortcuts.cpp shortcuts.h \ - slideshow.cpp slideshow.h \ snap.cpp snap.h \ snapped-point.cpp snapped-point.h \ snapper.cpp snapper.h \ diff --git a/src/main.cpp b/src/main.cpp index dff671c63..3849be4fa 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -56,7 +56,6 @@ #include "sp-object.h" #include "interface.h" #include "print.h" -#include "slideshow.h" #include "color.h" #include "sp-item.h" #include "sp-root.h" @@ -138,7 +137,6 @@ enum { SP_ARG_EXPORT_BBOX_PAGE, SP_ARG_EXTENSIONDIR, SP_ARG_FIT_PAGE_TO_DRAWING, - SP_ARG_SLIDESHOW, SP_ARG_QUERY_X, SP_ARG_QUERY_Y, SP_ARG_QUERY_WIDTH, @@ -161,7 +159,6 @@ static void do_query_dimension (SPDocument *doc, bool extent, NR::Dim2 const axi static gchar *sp_global_printer = NULL; -static gboolean sp_global_slideshow = FALSE; static gchar *sp_export_png = NULL; static gchar *sp_export_dpi = NULL; static gchar *sp_export_area = NULL; @@ -361,11 +358,6 @@ struct poptOption options[] = { N_("Print out the extension directory and exit"), NULL}, - {"slideshow", 's', - POPT_ARG_NONE, &sp_global_slideshow, SP_ARG_SLIDESHOW, - N_("Show given files one-by-one, switch to next on any key/mouse event"), - NULL}, - {"vacuum-defs", 0, POPT_ARG_NONE, &sp_vacuum_defs, SP_ARG_VACUUM_DEFS, N_("Remove unused definitions from the defs section(s) of the document"), @@ -646,32 +638,19 @@ sp_main_gui(int argc, char const **argv) g_free (filename); filename = 0; - if (!sp_global_slideshow) { - gboolean create_new = TRUE; + gboolean create_new = TRUE; - /// \todo FIXME BROKEN - non-UTF-8 sneaks in here. - inkscape_application_init(argv[0], true); + /// \todo FIXME BROKEN - non-UTF-8 sneaks in here. + inkscape_application_init(argv[0], true); - while (fl) { - if (sp_file_open((gchar *)fl->data,NULL)) { - create_new=FALSE; - } - fl = g_slist_remove(fl, fl->data); - } - if (create_new) { - sp_file_new_default(); - } - } else { - if (fl) { - GtkWidget *ss; - /// \todo FIXME BROKEN - non-UTF-8 sneaks in here. - inkscape_application_init(argv[0], true); - ss = sp_slideshow_new(fl); - if (ss) gtk_widget_show(ss); - } else { - g_warning ("No slides to display"); - exit(0); + while (fl) { + if (sp_file_open((gchar *)fl->data,NULL)) { + create_new=FALSE; } + fl = g_slist_remove(fl, fl->data); + } + if (create_new) { + sp_file_new_default(); } Glib::signal_idle().connect(sigc::ptr_fun(&Inkscape::CmdLineAction::idle)); diff --git a/src/slideshow.cpp b/src/slideshow.cpp deleted file mode 100644 index eb07abc8c..000000000 --- a/src/slideshow.cpp +++ /dev/null @@ -1,105 +0,0 @@ -#define __SLIDESHOW_C__ - -/* - * Help/About window - * - * Authors: - * Lauris Kaplinski - * - * Copyright (C) 1999-2003 authors - * Copyright (C) 2000-2002 Ximian, Inc. - * - * Released under GNU GPL, read the file 'COPYING' for more information - */ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include -#include - -#include -#include "document.h" -#include "svg-view-widget.h" -#include "svg-view.h" - -static gint -sp_slideshow_event (SPViewWidget *vw, GdkEvent *event, GtkWidget *window) -{ - GSList *slides; - const gchar *fname, *nname; - int idx; - - slides = (GSList*)g_object_get_data (G_OBJECT (window), "slides"); - fname = (const gchar*)g_object_get_data (G_OBJECT (window), "current"); - idx = g_slist_index (slides, fname); - - switch (event->type) { - case GDK_KEY_PRESS: - switch (event->key.keyval) { - case GDK_BackSpace: - case GDK_Delete: - case GDK_Left: - idx -= 1; - break; - case GDK_Escape: - gtk_widget_destroy (window); - return TRUE; - break; - default: - idx += 1; - break; - } - break; - case GDK_BUTTON_PRESS: - idx += 1; - break; - default: - break; - } - - nname = (const gchar*)g_slist_nth_data (slides, idx); -// g_print ("Old %s new %s\n", fname, nname); - - if (nname && (nname != fname)) { - SPDocument *doc; - g_print ("Trying to load %s\n", nname); - doc = sp_document_new (nname, TRUE); - if (doc) { - reinterpret_cast(SP_VIEW_WIDGET_VIEW (vw))->setDocument (doc); - sp_document_unref (doc); - } - g_object_set_data (G_OBJECT (window), "current", (gpointer) nname); - } - - return TRUE; -} - -GtkWidget * -sp_slideshow_new (const GSList *files) -{ - SPDocument *doc; - GtkWidget *w, *v; - - doc = sp_document_new ((const gchar*)files->data, TRUE); - g_return_val_if_fail (doc != NULL, NULL); - - w = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_window_set_title (GTK_WINDOW (w), _("Inkscape slideshow")); - gtk_window_set_default_size (GTK_WINDOW (w), 480, 360); - gtk_window_set_policy (GTK_WINDOW (w), TRUE, TRUE, FALSE); - - v = sp_svg_view_widget_new (doc); - sp_svg_view_widget_set_resize (SP_SVG_VIEW_WIDGET (v), FALSE, sp_document_width (doc), sp_document_height (doc)); - sp_document_unref (doc); - gtk_widget_show (v); - gtk_container_add (GTK_CONTAINER (w), v); - - g_object_set_data (G_OBJECT (w), "slides", (gpointer) files); - g_object_set_data (G_OBJECT (w), "current", files->data); - - g_signal_connect (G_OBJECT (v), "event", G_CALLBACK (sp_slideshow_event), w); - - return w; -} diff --git a/src/slideshow.h b/src/slideshow.h deleted file mode 100644 index 0aa236bcc..000000000 --- a/src/slideshow.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef __SP_SLIDESHOW_H__ -#define __SP_SLIDESHOW_H__ - -/* - * Slideshow/About window - * - * Authors: - * Lauris Kaplinski - * - * Copyright (C) 1999-2003 authors - * Copyright (C) 2000-2002 Ximian, Inc. - * - * Released under GNU GPL, read the file 'COPYING' for more information - */ - -#include - -GtkWidget *sp_slideshow_new (const GSList *files); - -#endif - -/* - Local Variables: - mode:c++ - c-file-style:"stroustrup" - c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) - indent-tabs-mode:nil - fill-column:99 - End: -*/ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : -- 2.30.2