summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 50e0e76)
raw | patch | inline | side by side (parent: 50e0e76)
author | kidproto <kidproto@users.sourceforge.net> | |
Thu, 13 Jul 2006 23:00:57 +0000 (23:00 +0000) | ||
committer | kidproto <kidproto@users.sourceforge.net> | |
Thu, 13 Jul 2006 23:00:57 +0000 (23:00 +0000) |
slideshows
ChangeLog | patch | blob | history | |
src/inkview.cpp | patch | blob | history |
diff --git a/ChangeLog b/ChangeLog
index b1aa38089c6bf0c63ea1219036537ab0a06b0813..1c2d2df1f7a4c769e1fc4ab411a2b68fa06e54fd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
+2006-07-13 Jon Phillips <jon@rejon.org>
+
+ * src/inkview: Added commandline option capability to inkview and
+ got code ready to add a timer for an automatic slideshow capability.
+
+
2006-07-02 Colin Marquardt <colin@marquardt-home.de>
* AUTHORS, src/ui/dialog/aboutbox.cpp: Add Niko, Hugo, Dale and
diff --git a/src/inkview.cpp b/src/inkview.cpp
index 0e2179283e30be504534cb503c29f4d66757b10f..495a943b75ee91fd87f162a9a8a333a5899806b5 100644 (file)
--- a/src/inkview.cpp
+++ b/src/inkview.cpp
#include <glib/gmem.h>
#include <libnr/nr-macros.h>
+// #include <stropts.h>
+
#include <libxml/tree.h>
#include <gdk/gdkkeysyms.h>
#include <gtk/gtkmain.h>
#define bind_textdomain_codeset(p,c)
#endif
+extern char *optarg;
+extern int optind, opterr;
+
struct SPSlideShow {
char **slides;
int size;
GtkWidget *view;
GtkWindow *window;
bool fullscreen;
+ int timer;
};
static GtkWidget *sp_svgview_control_show (struct SPSlideShow *ss);
struct SPSlideShow ss;
+ int option,
+ num_parsed_options = 0;
+
+ // the list of arguments is in the net line
+ while ((option = getopt(argc, (char* const* )argv, "t:")) != -1)
+ {
+ switch(option) {
+ case 't': // for timer
+ // fprintf(stderr, "set timer arg %s\n", optarg );
+ ss.timer = int(optarg);
+ num_parsed_options += 2; // 2 because of flag + option
+ break;
+ case '?':
+ default:
+ usage();
+ }
+ }
+
GtkWidget *w;
int i;
inkscape = (Inkscape::Application *)g_object_new (SP_TYPE_INKSCAPE, NULL);
Inkscape::Preferences::load();
-
- for (i = 1; i < argc; i++) {
+
+ // starting at where the commandline options stopped parsing because
+ // we want all the files to be in the list
+ for (i = num_parsed_options + 1 ; i < argc; i++) {
struct stat st;
if (stat (argv[i], &st)
|| !S_ISREG (st.st_mode)
static void usage()
{
fprintf(stderr,
- "Usage: inkview [FILES ...]\n"
+ "Usage: inkview [OPTIONS...] [FILES ...]\n"
"\twhere FILES are SVG (.svg or .svgz)"
#ifdef WITH_INKJAR
- "or archives of SVGs (.sxw, .jar)"
+ " or archives of SVGs (.sxw, .jar)"
#endif
+ "\n\n"
+ "Available options:\n"
+ "\t-t\t\tTimer for automatically changing slides in seconds.\n"
"\n");
exit(1);
}