inkview.cpp revision 52cad88e59adf0342e9294b9249b96bffe8fbe9e
/*
* Inkscape - an ambitious vector drawing program
*
* Authors:
* Lauris Kaplinski <lauris@kaplinski.com>
* Frank Felfe <innerspace@iname.com>
* Davide Puricelli <evo@debian.org>
* Mitsuru Oka <oka326@parkcity.ne.jp>
* Masatake YAMATO <jet@gyve.org>
* F.J.Franklin <F.J.Franklin@sheffield.ac.uk>
* Michael Meeks <michael@helixcode.com>
* Chema Celorio <chema@celorio.com>
* Pawel Palucha
* ... and various people who have worked with various projects
* Abhishek Sharma
*
* Copyright (C) 1999-2002 authors
* Copyright (C) 2001-2002 Ximian, Inc.
*
* Inkscape authors:
* Johan Ceuppens
*
* Copyright (C) 2004 Inkscape authors
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#ifdef HAVE_GETOPT_H
#include <getopt.h>
#endif
#include <cstring>
#include <locale.h>
#include <glib.h>
// #include <stropts.h>
#include <gdk/gdkkeysyms.h>
#include "gc-core.h"
#include "preferences.h"
#include "document.h"
#include "svg-view.h"
#include "svg-view-widget.h"
#ifdef WITH_INKJAR
#endif
#include "inkscape.h"
#include <iostream>
#ifndef HAVE_BIND_TEXTDOMAIN_CODESET
#define bind_textdomain_codeset(p,c)
#endif
#include "ui/icon-names.h"
extern char *optarg;
struct SPSlideShow {
char **slides;
int size;
int length;
int current;
bool fullscreen;
int timer;
};
#ifdef WITH_INKJAR
#endif
static void usage();
// Dummy functions to keep linker happy
int sp_main_gui (int, char const**) { return 0; }
int sp_main_console (int, char const**) { return 0; }
static int
{
gtk_main_quit ();
return FALSE;
}
static int
{
case GDK_KEY_Up:
case GDK_KEY_Home:
break;
case GDK_KEY_Down:
case GDK_KEY_End:
break;
case GDK_KEY_F11:
#ifdef HAVE_GTK_WINDOW_FULLSCREEN
if (ss->fullscreen) {
ss->fullscreen = false;
} else {
ss->fullscreen = true;
}
#else
#endif
break;
case GDK_KEY_Return:
break;
case GDK_KEY_KP_Page_Down:
case GDK_KEY_Page_Down:
case GDK_KEY_Right:
case GDK_KEY_space:
break;
case GDK_KEY_KP_Page_Up:
case GDK_KEY_Page_Up:
case GDK_KEY_Left:
case GDK_KEY_BackSpace:
break;
case GDK_KEY_Escape:
case GDK_KEY_q:
case GDK_KEY_Q:
break;
default:
break;
}
return TRUE;
}
int
{
if (argc == 1) {
usage();
}
// Prevents errors like "Unable to wrap GdkPixbuf..." (in nr-filter-image.cpp for example)
struct SPSlideShow ss;
int option,
num_parsed_options = 0;
// the list of arguments is in the net line
{
switch(option) {
case 't': // for timer
// fprintf(stderr, "set timer arg %s\n", optarg );
break;
case '?':
default:
usage();
}
}
GtkWidget *w;
int i;
#ifdef lalaWITH_MODULES
g_warning ("Have to autoinit modules (lauris)");
#endif /* WITH_MODULES */
/* We must set LC_NUMERIC to default, or otherwise */
/* we'll end with localised SVG files :-( */
ss.fullscreen = false;
// starting at where the commandline options stopped parsing because
// we want all the files to be in the list
} else {
#ifdef WITH_INKJAR
for (;;) {
char *c_ptr;
if (last_filename == NULL)
break;
if (*(++c_ptr) == '\0') {
continue;
}
}
//::write(1, gba->data, gba->len);
/* Append to list */
/* Expand */
}
TRUE);
}
} else
break;
}
} else {
#endif /* WITH_INKJAR */
/* Append to list */
/* Expand */
}
}
#ifdef WITH_INKJAR
}
#endif
}
}
return 1; /* none of the slides loadable */
SP_SVG_VIEW_WIDGET(ss.view)->setResize( false, ss.doc->getWidth().value("px"), ss.doc->getHeight().value("px") );
gtk_widget_show (w);
gtk_main ();
return 0;
}
static int
{
return FALSE;
}
{
if (!ctrlwin) {
#if GTK_CHECK_VERSION(3,0,0)
#else
GtkWidget *t = gtk_hbutton_box_new();
#endif
#else
GtkWidget *b = gtk_button_new();
#endif
gtk_container_add(GTK_CONTAINER(t), b);
#else
b = gtk_button_new();
#endif
gtk_container_add(GTK_CONTAINER(t), b);
#else
b = gtk_button_new();
#endif
gtk_container_add(GTK_CONTAINER(t), b);
#else
b = gtk_button_new();
#endif
gtk_container_add(GTK_CONTAINER(t), b);
} else {
}
return NULL;
}
static int
{
return FALSE;
}
static int
{
return FALSE;
}
static int
{
return FALSE;
}
static int
{
return FALSE;
}
static void
{
#if GTK_CHECK_VERSION(3,0,0)
#else
#endif
if (ctrlwin) {
#if GTK_CHECK_VERSION(3,0,0)
#else
#endif
}
while(gtk_events_pending())
}
static void
{
if (ctrlwin) {
}
}
static void
{
doc->ensureUpToDate();
}
}
static void
{
}
}
static void
{
}
}
static void
{
int current = 0;
break;
}
}
static void
{
break;
}
}
#ifdef WITH_INKJAR
static bool
{
initial string "PK\003\004" in content should suffice. */
if (filename_len < 5) {
return false;
}
}
#endif /* WITH_INKJAR */
static void usage()
{
"Usage: inkview [OPTIONS...] [FILES ...]\n"
"\twhere FILES are SVG (.svg or .svgz)"
#ifdef WITH_INKJAR
" or archives of SVGs (.sxw, .jar)"
#endif
"\n");
exit(1);
}
#ifdef XXX
/* TODO !!! make this temporary stub unnecessary */
void inkscape_ref (void) {}
void inkscape_unref (void) {}
#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 :