]> git.donarmstrong.com Git - xournal.git/commitdiff
Commit of current source code (post 0.2 release) - Denis.
authorauroux <auroux>
Thu, 23 Mar 2006 05:19:23 +0000 (05:19 +0000)
committerauroux <auroux>
Thu, 23 Mar 2006 05:19:23 +0000 (05:19 +0000)
ChangeLog
configure.in
html-doc/manual.html
src/TODO
src/main.c
src/xo-callbacks.c
src/xo-file.c

index 190f6d1915c0450c64f328e2731fc8182f74cb90..7627fdd3f76d15535b39ce891270e8f14f7df7a8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Version ?:
+  - can specify on command line a PDF file to annotate
+  - fixed a bug in XInput initialization (thanks to Luca de Cicco)
+
 Version 0.2 (Jan 29, 2006):
   - PDF file annotation using xpdf's pdftoppm
      (PDF backgrounds updated asynchronously at all resolutions) 
@@ -5,7 +9,7 @@ Version 0.2 (Jan 29, 2006):
   - option to antialias and filter bitmap backgrounds when zooming
   - option to emulate eraser tip with right mouse button
   - binary installer allows non-root installation without compiling
-  - full-screen mode
+  - full-screen mode (patch contributed by Luca De Cicco)
 
 Version 0.1.1 (Jan 5, 2006): 
   - two bugfixes
index 84d40c46932099a822fbeb9f66daa7fdeeb261fa..d7e52a97e54b4dcab1331e9b87f6e59e435000c0 100644 (file)
@@ -1,7 +1,7 @@
 dnl Process this file with autoconf to produce a configure script.
 
 AC_INIT(configure.in)
-AM_INIT_AUTOMAKE(xournal, 0.2)
+AM_INIT_AUTOMAKE(xournal, 0.2.1)
 AM_CONFIG_HEADER(config.h)
 AM_MAINTAINER_MODE
 
index 44681d3577ce4fddc4fb5bb1428ccbeee5e5d60f..a7bfcc44a0bc3d1ccc2957641cf92955fb9811f2 100644 (file)
@@ -44,8 +44,7 @@ Xournal can be downloaded at
  Xournal aims to provide superior graphical quality (subpixel resolution) and overall
  functionality; however it lacks the collaborative features of Jarnal.
  Since Xournal is still in its early development stages, it may not
- be fully stable, and some features have not been implemented yet
- (in particular, freeform selection and PDF backgrounds are missing).
+ be fully stable, and some features have not been implemented yet.
 </p>
 <h2 class="subtitle">Table of contents</h2>
 <p>
@@ -458,7 +457,7 @@ Version 0.2 (January 29, 2006):
  <li>option to antialias and filter bitmap backgrounds when zooming</li>
  <li>option to emulate eraser tip with right mouse button</li>
  <li>binary installer allows non-root installation without compiling</li>
- <li>full-screen mode</li>
+ <li>full-screen mode (patch contributed by Luca De Cicco)</li>
 </ul>
 </p>
 <p>
index 659ceab54fcdbb8dfb7041a824fdb47a349fbbd4..39ab5a655a1be3320db6a3ae8aaf207cc6284af1 100644 (file)
--- a/src/TODO
+++ b/src/TODO
@@ -1,3 +1,4 @@
+- non-attached annotation => suggest a derived filename for save-as
 - lasso selection tool
 - prefs file, save prefs
 - recent files list
@@ -5,12 +6,13 @@
 - flatten (incl undo/redo...) - enabled only if nlayers>1
 - bg: apply to all pages
 - recolor selection
+- resize selection
 - move selection to another page by drag-drop
    (should apply to vertspacer when origin moves to another page,
      but in the up direction only do so when all the stuff fits on prev page)
 
 - text tool, font chooser, default font
-- color chooser (papercolor, pen color)
+- color chooser (papercolor, pen color); maybe more default colors
 - printing: print-to-PDF? (with & without pdf background to merge)
             opacity issue for highlighter strokes (maybe print them below ?)
             save gnome printer settings (throughout a session, and on disk)
@@ -19,4 +21,7 @@
 - file print-options, own print-to-ps/pdf 
 - help index
 - pressure sensitivity
+- insert images (screen capture or from file), not as full-page backgrounds
+- more pen/highlighter shapes (chisel)
 - convert to/from Jarnal format
+- recalibration upon screen resize / compensation for miscalibration
index 125ebb60901f435b521384ebab86caf3a5244c5c..52b889c78710a50e9dc45316cf6edc2a1257e7ef 100644 (file)
@@ -174,7 +174,7 @@ void init_stuff (int argc, char *argv[])
   dev_list = gdk_devices_list();
   while (dev_list != NULL) {
     device = (GdkDevice *)dev_list->data;
-    if (device->source == GDK_SOURCE_PEN || device->source == GDK_SOURCE_ERASER) {
+    if (device->source != GDK_SOURCE_MOUSE) {
       /* get around a GDK bug: map the valuator range CORRECTLY to [0,1] */
 #if ENABLE_XINPUT_BUGFIX
       gdk_device_set_axis_use(device, 0, GDK_AXIS_IGNORE);
@@ -183,6 +183,7 @@ void init_stuff (int argc, char *argv[])
       gdk_device_set_mode(device, GDK_MODE_SCREEN);
       can_xinput = TRUE;
     }
+    else gdk_device_set_mode(device, GDK_MODE_DISABLED);
     dev_list = dev_list->next;
   }
   if (!can_xinput)
index f2e6e3f72094128d14c76b14d3d52fa42fefba62..88b61acca5f007b3c678e746addc6c7b995da10c 100644 (file)
@@ -134,7 +134,7 @@ on_fileOpen_activate                   (GtkMenuItem     *menuitem,
   set_cursor_busy(TRUE);
   success = open_journal(filename);
   set_cursor_busy(FALSE);
-  if (success) return;
+  if (success) { g_free(filename); return; }
   
   /* open failed */
   dialog = gtk_message_dialog_new(GTK_WINDOW (winMain), GTK_DIALOG_DESTROY_WITH_PARENT,
index 23678eb09a6589c5fd285a31d37a38eb2dce4ec3..a052475c94b7c217f6d5b14b67f348ea284d9563 100644 (file)
@@ -560,6 +560,7 @@ gboolean open_journal(char *filename)
   char buffer[1000];
   int len;
   gchar *tmpfn;
+  gboolean maybe_pdf;
   
   f = gzopen(filename, "r");
   if (f==NULL) return FALSE;
@@ -575,10 +576,14 @@ gboolean open_journal(char *filename)
   tmpFilename = filename;
   error = NULL;
   tmpBg_pdf = NULL;
+  maybe_pdf = TRUE;
 
   while (valid && !gzeof(f)) {
     len = gzread(f, buffer, 1000);
     if (len<0) valid = FALSE;
+    if (maybe_pdf && len>=4 && !strncmp(buffer, "%PDF", 4))
+      { valid = FALSE; break; } // most likely pdf
+    else maybe_pdf = FALSE;
     if (len<=0) break;
     valid = g_markup_parse_context_parse(context, buffer, len, &error);
   }
@@ -586,9 +591,19 @@ gboolean open_journal(char *filename)
   if (valid) valid = g_markup_parse_context_end_parse(context, &error);
   if (tmpJournal.npages == 0) valid = FALSE;
   g_markup_parse_context_free(context);
+  
   if (!valid) {
     delete_journal(&tmpJournal);
-    return FALSE;
+    if (!maybe_pdf) return FALSE;
+    // essentially same as on_fileNewBackground from here on
+    ui.saved = TRUE;
+    close_journal();
+    while (bgpdf.status != STATUS_NOT_INIT) gtk_main_iteration();
+    new_journal();
+    ui.zoom = DEFAULT_ZOOM;
+    gnome_canvas_set_pixels_per_unit(canvas, ui.zoom);
+    update_page_stuff();
+    return init_bgpdf(filename, TRUE, DOMAIN_ABSOLUTE);
   }
   
   ui.saved = TRUE; // force close_journal() to do its job
@@ -631,7 +646,7 @@ gboolean open_journal(char *filename)
   ui.cur_layer = (struct Layer *)(g_list_last(ui.cur_page->layers)->data);
   ui.saved = TRUE;
   ui.zoom = DEFAULT_ZOOM;
-  update_file_name(filename);
+  update_file_name(g_strdup(filename));
   gnome_canvas_set_pixels_per_unit(canvas, ui.zoom);
   make_canvas_items();
   update_page_stuff();
@@ -781,8 +796,11 @@ struct Background *attempt_screenshot_bg(void)
 void end_bgpdf_shutdown(void)
 {
   if (bgpdf.tmpdir!=NULL) {
-    g_unlink(bgpdf.tmpfile_copy);
-    g_free(bgpdf.tmpfile_copy);
+    if (bgpdf.tmpfile_copy!=NULL) {
+      g_unlink(bgpdf.tmpfile_copy);
+      g_free(bgpdf.tmpfile_copy);
+      bgpdf.tmpfile_copy = NULL;
+    }
     g_rmdir(bgpdf.tmpdir);  
     g_free(bgpdf.tmpdir);
     bgpdf.tmpdir = NULL;
@@ -1006,16 +1024,18 @@ gboolean init_bgpdf(char *pdfname, gboolean create_pages, int file_domain)
   gsize filelen;
   
   if (bgpdf.status != STATUS_NOT_INIT) return FALSE;
+  bgpdf.tmpfile_copy = NULL;
   bgpdf.tmpdir = mkdtemp(g_strdup(TMPDIR_TEMPLATE));
   if (!bgpdf.tmpdir) return FALSE;
   // make a local copy and check if it's a PDF
-  if (!g_file_get_contents(pdfname, &filebuf, &filelen, NULL)) return FALSE;
+  if (!g_file_get_contents(pdfname, &filebuf, &filelen, NULL))
+    { end_bgpdf_shutdown(); return FALSE; }
   if (filelen < 4 || strncmp(filebuf, "%PDF", 4))
-    { g_free(filebuf); return FALSE; }
+    { g_free(filebuf); end_bgpdf_shutdown(); return FALSE; }
   bgpdf.tmpfile_copy = g_strdup_printf("%s/bg.pdf", bgpdf.tmpdir);
   f = fopen(bgpdf.tmpfile_copy, "w");
   if (f == NULL || fwrite(filebuf, 1, filelen, f) != filelen) 
-    { g_free(filebuf); return FALSE; }
+    { g_free(filebuf); end_bgpdf_shutdown(); return FALSE; }
   fclose(f);
   g_free(filebuf);
   bgpdf.status = STATUS_IDLE;