Logo Search packages:      
Sourcecode: inkscape version File versions  Download package

void sp_process_file_list ( GSList *  fl )

Process file list

Definition at line 996 of file main.cpp.

References Inkscape::Extension::db, do_export_ps_pdf(), Inkscape::XML::Node::document(), Inkscape::Extension::open(), Inkscape::XML::Node::root(), SP_MODULE_KEY_INPUT_SVG, and sp_repr_document_new().

Referenced by sp_main_shell().

{
    while (fl) {
        const gchar *filename = (gchar *)fl->data;

        SPDocument *doc = NULL;
        try {
            doc = Inkscape::Extension::open(NULL, filename);
        } catch (Inkscape::Extension::Input::no_extension_found &e) {
            doc = NULL;
        } catch (Inkscape::Extension::Input::open_failed &e) {
            doc = NULL;
        }

        if (doc == NULL) {
            try {
                doc = Inkscape::Extension::open(Inkscape::Extension::db.get(SP_MODULE_KEY_INPUT_SVG), filename);
            } catch (Inkscape::Extension::Input::no_extension_found &e) {
                doc = NULL;
            } catch (Inkscape::Extension::Input::open_failed &e) {
                doc = NULL;
            }
        }
        if (doc == NULL) {
            g_warning("Specified document %s cannot be opened (does not exist or not a valid SVG file)", filename);
        } else {
            if (sp_vacuum_defs) {
                vacuum_document(doc);
            }
            if (sp_vacuum_defs && !sp_export_svg) {
                // save under the name given in the command line
                sp_repr_save_file(doc->rdoc, filename, SP_SVG_NS_URI);
            }
            if (sp_global_printer) {
                sp_print_document_to_file(doc, sp_global_printer);
            }
            if (sp_export_png || (sp_export_id && sp_export_use_hints)) {
                sp_do_export_png(doc);
            }
            if (sp_export_svg) {
                Inkscape::XML::Document *rdoc;
                Inkscape::XML::Node *repr;
                rdoc = sp_repr_document_new("svg:svg");
                repr = rdoc->root();
                repr = sp_document_root(doc)->updateRepr(rdoc, repr, SP_OBJECT_WRITE_BUILD);
                sp_repr_save_rebased_file(repr->document(), sp_export_svg, SP_SVG_NS_URI,
                                          doc->base, sp_export_svg);
            }
            if (sp_export_ps) {
                do_export_ps_pdf(doc, sp_export_ps, "image/x-postscript");
            }
            if (sp_export_eps) {
                do_export_ps_pdf(doc, sp_export_eps, "image/x-e-postscript");
            }
            if (sp_export_pdf) {
                do_export_ps_pdf(doc, sp_export_pdf, "application/pdf");
            }
#ifdef WIN32
            if (sp_export_emf) {
                do_export_emf(doc, sp_export_emf, "image/x-emf");
            }
#endif //WIN32
            if (sp_query_all) {
                do_query_all (doc);
            } else if (sp_query_width || sp_query_height) {
                do_query_dimension (doc, true, sp_query_width? Geom::X : Geom::Y, sp_query_id);
            } else if (sp_query_x || sp_query_y) {
                do_query_dimension (doc, false, sp_query_x? Geom::X : Geom::Y, sp_query_id);
            }

            delete doc;
        }
        fl = g_slist_remove(fl, fl->data);
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index