]> git.donarmstrong.com Git - xournal.git/commitdiff
Release 0.3.3 (minor enhancements)
authorauroux <auroux>
Wed, 31 Jan 2007 19:36:01 +0000 (19:36 +0000)
committerauroux <auroux>
Wed, 31 Jan 2007 19:36:01 +0000 (19:36 +0000)
15 files changed:
ChangeLog
NEWS
README
configure.in
html-doc/manual.html
src/TODO
src/main.c
src/xo-callbacks.c
src/xo-callbacks.h
src/xo-file.c
src/xo-interface.c
src/xo-misc.c
src/xo-misc.h
src/xournal.h
xournal.glade

index 7eb69120786aedabf6c98ac0081b65b0aa16ee3f..2a215d13b6b8c9b7c7d7132ce7a42eaf0806c699 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Version 0.3.3 (Jan 31, 2007):
+  - bugfix: upon loading a new file, zoom is set to default startup zoom
+  - config option to allow input from a mouse or other core pointer device
+  - config file entry to specify a default location for open/save
+    (patch contributed by Andy Neitzke)
+  - config file entries to customize visibility and position of toolbars
+  - icon (thanks to Michele Codutti)
+
 Version 0.3.2 (Nov 25, 2006):
   - preferences file and Save Preferences command
   - extra customization (via preferences file)
diff --git a/NEWS b/NEWS
index 24c081a97f626b2ac6c616e6c8125641bdc28b05..b8e6d5b12715151da91777da5ac5905afdcea0f1 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,7 +1,9 @@
-Version 0.3.2 (November 25, 2006)
+Version 0.3.3 (January 31, 2007)
 
 Installation:  see INSTALL
 User's manual: see html-doc/manual.html
-Updates:       see http://math.mit.edu/~auroux/software/xournal/
+Updates:       see http://xournal.sourceforge.net/
+               or  http://math.mit.edu/~auroux/software/xournal/
+                
 
 See also: http://sourceforge.net/projects/xournal
diff --git a/README b/README
index 24c081a97f626b2ac6c616e6c8125641bdc28b05..b8e6d5b12715151da91777da5ac5905afdcea0f1 100644 (file)
--- a/README
+++ b/README
@@ -1,7 +1,9 @@
-Version 0.3.2 (November 25, 2006)
+Version 0.3.3 (January 31, 2007)
 
 Installation:  see INSTALL
 User's manual: see html-doc/manual.html
-Updates:       see http://math.mit.edu/~auroux/software/xournal/
+Updates:       see http://xournal.sourceforge.net/
+               or  http://math.mit.edu/~auroux/software/xournal/
+                
 
 See also: http://sourceforge.net/projects/xournal
index 29093ca2fe0e3b842a2820438dcc64fe98c0a673..2da33643c7b0276e640e9d66adf35de885e16add 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.3.2)
+AM_INIT_AUTOMAKE(xournal, 0.3.3)
 AM_CONFIG_HEADER(config.h)
 AM_MAINTAINER_MODE
 
index 7ff525516258f2fc64e45ce36f448f33092156d3..f748b5cab871de454aa0c65473f274121f9a2624 100644 (file)
@@ -24,7 +24,7 @@
   Xournal User's Manual
 </h2>
 <p style="font-size: 0.95em; text-align: center; color: rgb(0,0,0)">
- Version 0.3.2
+ Version 0.3.3
 </p>
 <hr />
 <p>
@@ -38,6 +38,7 @@
 </p>
 <p>
 Xournal can be downloaded at
+<a href="http://xournal.sourceforge.net/">http://xournal.sourceforge.net/</a> or 
 <a href="http://math.mit.edu/~auroux/software/xournal/">http://math.mit.edu/~auroux/software/xournal/</a>
 </p>
 <p>
@@ -503,7 +504,8 @@ The configuration file also gives access to additional customization
 options which cannot be set from the user interface, such as: the
 display resolution in pixels per inch, the step increment in zoom factors,
 the tool selected at startup, the thickness of the various drawing tools,
-...
+the default directory for opening and saving files, the visibility and
+position of the menu and toolbars, ...
 </p>
 <hr />
 <a name="author"></a>
@@ -528,6 +530,17 @@ Bug reports and suggestions can also be submitted on Xournal's
 <a name="changelog"></a>
 <h2 class="subtitle">Version history</h2>
 <p>
+Version 0.3.3 (January 31, 2007):
+<ul>
+ <li>bugfix: upon loading a new file, zoom is set to default startup zoom</li>
+ <li>config option to allow input from a mouse or other core pointer device</li>
+ <li>config file entry to specify a default location for open/save
+     (patch contributed by Andy Neitzke)</li>
+ <li>config file entries to customize visibility and position of toolbars</li>
+ <li>icon (thanks to Michele Codutti)</li>
+</ul>
+</p>
+<p>
 Version 0.3.2 (November 25, 2006):
 <ul>
  <li>preferences file and Save Preferences command</li>
@@ -883,6 +896,20 @@ installation instructions specific to your model: for example, the
 use USB instead; the BottomX and BottomY values correspond to the physical
 resolution of the tablet and will vary from one model to another.
 </p>
+<p>
+For historical reasons, most X servers do not allow the input device
+designated as the "core pointer" in the X server's configuration file
+to be used as an XInput extension device. Thus, your tablet input devices
+should <b>not</b> be designated as the core pointer device. Instead, they
+should be configured with the "SendCoreEvents" option, which enables them
+to simultaneously generate XInput extension events and move the cursor on
+the screen. Since high-resolution coordinates cannot be obtained for the
+core pointer device, it is disabled in Xournal by default. 
+Starting with version 0.3.3,
+it is possible to have core events processed alongside with extension
+events (uncheck "Discard Core Events" in the Options menu); however, in
+some rare cases this may lead to a loss of resolution on all devices.
+</p>
 <h3 class="subsub">The cursor doesn't appear in the right place...</h3>
 <p>
 If the mouse pointer does not follow accurately the position of the stylus,
@@ -976,10 +1003,10 @@ Exit Xournal and restart it after the display has been rotated.
 This patch fixes rotation and calibration issues with the linuxwacom driver
 version 0.7.0.
 <ul>
-<li>The <a href="http://math.mit.edu/~auroux/software/xournal/linuxwacom-0.7.0-rotate-patch">patch
+<li>The <a href="http://xournal.sourceforge.net/linuxwacom-0.7.0-rotate-patch">patch
 file</a> for the linuxwacom source code (also included with the Xournal
 distribution).</li>
-<li>The <a href="http://math.mit.edu/~auroux/software/xournal/linuxwacom-rotate-patch.tar.gz">patched
+<li>The <a href="http://xournal.sourceforge.net/linuxwacom-rotate-patch.tar.gz">patched
 binaries</a> for the X.org X server.</li>
 </ul>
 This patch has been included in version 0.7.6 of the linuxwacom driver,
index 9baaeaa22f147f0ddb47d12a7e77195ac3a98907..cabcc9a6a6f4325bece9131aaf425cc5c69f0daf 100644 (file)
--- a/src/TODO
+++ b/src/TODO
@@ -21,8 +21,17 @@ List of features to be implemented (not in any particular order)
 - recalibration upon screen resize / compensation for miscalibration
 - find a better behavior for vertical space tool across page boundaries ?
 - key mappings (pgup/dn for full page, up/dn for scroll)
+    (customize secondary mappings for tablet button use ?)
 - copy/paste of an entire page (beware if PDF bg is not compatible!)
 - simple drawing tools: rectangles, ellipses
 - option to save all annotated files within the .xoj
 - non-antialiased version for handhelds
 - customize autogenerated save file names 
+- optimize speed in hand tool (process groups of motion events)?
+   (setting 1 pixel min threshold doesn't help -- look at GTK+ scrollbar code?)
+- layer dialog box to set visibility status of each layer regardless of
+  which layer is being edited
+- display corruption on scroll down when bottom of window is obscured??
+  (probably a gnomecanvas or X bug -- expose event generated for wrong
+  region, or not processed?)
+- bitmap preview for document icon in desktop environments?
index 05693868fb5db9ed6493b456eea3d1ec32e84771..4ff98dbc132934dd90c84df332f9b73528c93bdb 100644 (file)
@@ -130,8 +130,6 @@ void init_stuff (int argc, char *argv[])
     gtk_toggle_tool_button_set_active(
       GTK_TOGGLE_TOOL_BUTTON(GET_COMPONENT("buttonFullscreen")), TRUE);
     gtk_window_fullscreen(GTK_WINDOW(winMain));
-    gtk_widget_hide(GET_COMPONENT("menubar"));
-    gtk_widget_hide(GET_COMPONENT("hbox1"));
   }
 
 
@@ -182,7 +180,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_MOUSE) {
+    if (device != gdk_device_get_core_pointer()) {
       /* 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);
@@ -191,7 +189,6 @@ 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)
@@ -217,6 +214,7 @@ void init_stuff (int argc, char *argv[])
     
   update_undo_redo_enabled();
   update_copy_paste_enabled();
+  update_vbox_order(ui.vertical_order[ui.fullscreen?1:0]);
 
   // show everything...
   
@@ -278,6 +276,7 @@ main (int argc, char *argv[])
   winMain = create_winMain ();
   
   init_stuff (argc, argv);
+  gtk_window_set_icon(GTK_WINDOW(winMain), create_pixbuf("xournal.png"));
   
   gtk_main ();
   
index a11ce65390f4f2da300b755d285abbbab99f99d7..038507ad4724ae69c38de812836065d787d0dc2d 100644 (file)
@@ -25,7 +25,7 @@ on_fileNew_activate                    (GtkMenuItem     *menuitem,
 {
   if (close_journal()) {
     new_journal();
-    ui.zoom = DEFAULT_ZOOM;
+    ui.zoom = ui.startup_zoom;
     update_page_stuff();
     gtk_adjustment_set_value(gtk_layout_get_vadjustment(GTK_LAYOUT(canvas)), 0);
     gnome_canvas_set_pixels_per_unit(canvas, ui.zoom);
@@ -58,6 +58,8 @@ on_fileNewBackground_activate          (GtkMenuItem     *menuitem,
   gtk_file_chooser_add_filter(GTK_FILE_CHOOSER (dialog), filt_pdf);
   gtk_file_chooser_add_filter(GTK_FILE_CHOOSER (dialog), filt_all);
 
+  if (ui.default_path!=NULL) gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER (dialog), ui.default_path);
+
   attach_opt = gtk_check_button_new_with_label("Attach file to the journal");
   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(attach_opt), FALSE);
   gtk_file_chooser_set_extra_widget(GTK_FILE_CHOOSER (dialog), attach_opt);
@@ -81,7 +83,7 @@ on_fileNewBackground_activate          (GtkMenuItem     *menuitem,
     gtk_main_iteration(); 
   }
   new_journal();
-  ui.zoom = DEFAULT_ZOOM;
+  ui.zoom = ui.startup_zoom;
   gnome_canvas_set_pixels_per_unit(canvas, ui.zoom);
   update_page_stuff();
   success = init_bgpdf(filename, TRUE, file_domain);
@@ -123,7 +125,9 @@ on_fileOpen_activate                   (GtkMenuItem     *menuitem,
   gtk_file_filter_add_pattern(filt_xoj, "*.xoj");
   gtk_file_chooser_add_filter(GTK_FILE_CHOOSER (dialog), filt_xoj);
   gtk_file_chooser_add_filter(GTK_FILE_CHOOSER (dialog), filt_all);
-  
+
+  if (ui.default_path!=NULL) gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER (dialog), ui.default_path);
+
   if (gtk_dialog_run(GTK_DIALOG(dialog)) != GTK_RESPONSE_OK) {
     gtk_widget_destroy(dialog);
     return;
@@ -202,6 +206,8 @@ on_fileSaveAs_activate                 (GtkMenuItem     *menuitem,
   else {
     curtime = time(NULL);
     strftime(stime, 30, "%F-Note-%H-%M.xoj", localtime(&curtime));
+    if (ui.default_path!=NULL)
+      gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER (dialog), ui.default_path);
     gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER (dialog), stime);
   }
      
@@ -379,6 +385,8 @@ on_filePrintPDF_activate               (GtkMenuItem     *menuitem,
   } else {
     curtime = time(NULL);
     strftime(stime, 30, "%F-Note-%H-%M.pdf", localtime(&curtime));
+    if (ui.default_path!=NULL)
+      gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER (dialog), ui.default_path);
     gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER (dialog), stime);
     in_fn = NULL;
   }
@@ -1340,7 +1348,7 @@ on_journalLoadBackground_activate      (GtkMenuItem     *menuitem,
   dialog = gtk_file_chooser_dialog_new("Open Background", GTK_WINDOW (winMain),
      GTK_FILE_CHOOSER_ACTION_OPEN, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
      GTK_STOCK_OPEN, GTK_RESPONSE_OK, NULL);
-     
+
   filt_all = gtk_file_filter_new();
   gtk_file_filter_set_name(filt_all, "All files");
   gtk_file_filter_add_pattern(filt_all, "*");
@@ -1366,6 +1374,8 @@ on_journalLoadBackground_activate      (GtkMenuItem     *menuitem,
   attach_opt = gtk_check_button_new_with_label("Attach file to the journal");
   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(attach_opt), FALSE);
   gtk_file_chooser_set_extra_widget(GTK_FILE_CHOOSER (dialog), attach_opt);
+
+  if (ui.default_path!=NULL) gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER (dialog), ui.default_path);
   
   if (gtk_dialog_run(GTK_DIALOG(dialog)) != GTK_RESPONSE_OK) {
     gtk_widget_destroy(dialog);
@@ -2090,17 +2100,20 @@ on_canvas_button_press_event           (GtkWidget       *widget,
   struct Page *tmppage;
   GtkWidget *dialog;
   int mapping;
-  
+  gboolean is_core;
+
   if (ui.cur_item_type != ITEM_NONE) return FALSE; // we're already doing something
   if (event->button > 3) return FALSE; // no painting with the mouse wheel!
 
-  if (ui.use_xinput) { 
-    if (event->device->source == GDK_SOURCE_MOUSE) return FALSE;
+  is_core = (event->device == gdk_device_get_core_pointer());
+  if (!ui.use_xinput && !is_core) return FALSE;
+  if (ui.use_xinput && is_core && ui.discard_corepointer) return FALSE;
+  if (!is_core) { 
     // re-get the axis values since Synaptics sends bogus ones
     gdk_device_get_state(event->device, event->window, event->axes, NULL);
     fix_xinput_coords((GdkEvent *)event);
   }
-  else if (event->device->source != GDK_SOURCE_MOUSE) return FALSE;
+  ui.is_corestroke = is_core;
 
   if (ui.use_erasertip && event->device->source == GDK_SOURCE_ERASER)
        mapping = NUM_BUTTONS;
@@ -2180,15 +2193,16 @@ on_canvas_button_release_event         (GtkWidget       *widget,
                                         GdkEventButton  *event,
                                         gpointer         user_data)
 {
+  gboolean is_core;
+  
   if (ui.cur_item_type == ITEM_NONE) return FALSE; // not doing anything
 
   if (event->button != ui.which_mouse_button) return FALSE; // ignore
 
-  if (ui.use_xinput) {
-    if (event->device->source == GDK_SOURCE_MOUSE) return FALSE;
-    fix_xinput_coords((GdkEvent *)event);
-  }
-  else if (event->device->source != GDK_SOURCE_MOUSE) return FALSE;
+  is_core = (event->device == gdk_device_get_core_pointer());
+  if (!ui.use_xinput && !is_core) return FALSE;
+  if (ui.use_xinput && is_core && !ui.is_corestroke) return FALSE;
+  if (!is_core) fix_xinput_coords((GdkEvent *)event);
 
   if (ui.cur_item_type == ITEM_STROKE) {
     finalize_stroke();
@@ -2246,16 +2260,15 @@ on_canvas_motion_notify_event          (GtkWidget       *widget,
                                         GdkEventMotion  *event,
                                         gpointer         user_data)
 {
-  gboolean looks_wrong;
+  gboolean looks_wrong, is_core;
   double pt[2];
   
   if (ui.cur_item_type == ITEM_NONE) return FALSE; // we don't care
 
-  if (ui.use_xinput) { 
-    if (event->device->source == GDK_SOURCE_MOUSE) return FALSE;
-    fix_xinput_coords((GdkEvent *)event);
-  }
-  else if (event->device->source != GDK_SOURCE_MOUSE) return FALSE;
+  is_core = (event->device == gdk_device_get_core_pointer());
+  if (!ui.use_xinput && !is_core) return FALSE;
+  if (ui.use_xinput && is_core && !ui.is_corestroke) return FALSE;
+  if (!is_core) fix_xinput_coords((GdkEvent *)event);
 
   looks_wrong = !(event->state & (1<<(7+ui.which_mouse_button)));
   
@@ -2347,6 +2360,7 @@ on_optionsUseXInput_activate           (GtkMenuItem     *menuitem,
 {
   ui.allow_xinput = ui.use_xinput =
     gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM (menuitem));
+  update_mappings_menu();
 }
 
 void
@@ -2586,16 +2600,10 @@ on_viewFullscreen_activate             (GtkMenuItem     *menuitem,
   gtk_toggle_tool_button_set_active(
     GTK_TOGGLE_TOOL_BUTTON(GET_COMPONENT("buttonFullscreen")), ui.fullscreen);
 
-  if (ui.fullscreen) {
-    gtk_window_fullscreen(GTK_WINDOW(winMain));
-    gtk_widget_hide(GET_COMPONENT("menubar"));
-    gtk_widget_hide(GET_COMPONENT("hbox1"));
-  } 
-  else {
-    gtk_window_unfullscreen(GTK_WINDOW(winMain));
-    gtk_widget_show(GET_COMPONENT("menubar"));
-    gtk_widget_show(GET_COMPONENT("hbox1"));
-  }
+  if (ui.fullscreen) gtk_window_fullscreen(GTK_WINDOW(winMain));
+  else gtk_window_unfullscreen(GTK_WINDOW(winMain));
+  
+  update_vbox_order(ui.vertical_order[ui.fullscreen?1:0]);
 }
 
 
@@ -2989,3 +2997,11 @@ on_optionsPrintRuling_activate         (GtkMenuItem     *menuitem,
   ui.print_ruling = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM (menuitem));
 }
 
+void
+on_optionsDiscardCore_activate         (GtkMenuItem     *menuitem,
+                                        gpointer         user_data)
+{
+  ui.discard_corepointer =
+    gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM (menuitem));
+  update_mappings_menu();
+}
index 0b67562c6b89cdb8b174aced1735f1d6882fb1cc..d7754ccbecb58ebb1923361e88c97a906fb5ad39 100644 (file)
@@ -596,3 +596,7 @@ on_button3Hand_activate                (GtkMenuItem     *menuitem,
 void
 on_optionsPrintRuling_activate         (GtkMenuItem     *menuitem,
                                         gpointer         user_data);
+
+void
+on_optionsDiscardCore_activate         (GtkMenuItem     *menuitem,
+                                        gpointer         user_data);
index bff53a1a206caf18dc2b979dd3923c8f914921dd..ba2fad0f3b6390e821a6ebe5b88804fdada6e7c8 100644 (file)
@@ -619,7 +619,7 @@ gboolean open_journal(char *filename)
     close_journal();
     while (bgpdf.status != STATUS_NOT_INIT) gtk_main_iteration();
     new_journal();
-    ui.zoom = DEFAULT_ZOOM;
+    ui.zoom = ui.startup_zoom;
     gnome_canvas_set_pixels_per_unit(canvas, ui.zoom);
     update_page_stuff();
     return init_bgpdf(filename, TRUE, DOMAIN_ABSOLUTE);
@@ -664,7 +664,7 @@ gboolean open_journal(char *filename)
   ui.layerno = ui.cur_page->nlayers-1;
   ui.cur_layer = (struct Layer *)(g_list_last(ui.cur_page->layers)->data);
   ui.saved = TRUE;
-  ui.zoom = DEFAULT_ZOOM;
+  ui.zoom = ui.startup_zoom;
   update_file_name(g_strdup(filename));
   gnome_canvas_set_pixels_per_unit(canvas, ui.zoom);
   make_canvas_items();
@@ -1066,7 +1066,7 @@ gboolean init_bgpdf(char *pdfname, gboolean create_pages, int file_domain)
   bgpdf.requests = NULL;
   bgpdf.create_pages = create_pages;
   bgpdf.has_failed = FALSE;
-  add_bgpdf_request(-1, DEFAULT_ZOOM, FALSE); // request all pages
+  add_bgpdf_request(-1, ui.startup_zoom, FALSE); // request all pages
   return TRUE;
 }
 
@@ -1091,7 +1091,7 @@ void bgpdf_create_page_with_bg(int pageno, struct BgPdfPage *bgpg)
   bg->filename = refstring_ref(bgpdf.filename);
   bg->file_domain = bgpdf.file_domain;
   bg->file_page_seq = pageno;
-  bg->pixbuf_scale = DEFAULT_ZOOM;
+  bg->pixbuf_scale = ui.startup_zoom;
   bg->pixbuf_dpi = bgpg->dpi;
 
   if (journal.npages < pageno) {
@@ -1222,7 +1222,7 @@ void init_config_default(void)
   int i, j;
 
   DEFAULT_ZOOM = DISPLAY_DPI_DEFAULT/72.0;
-  ui.zoom = 1.0*DEFAULT_ZOOM;
+  ui.zoom = ui.startup_zoom = 1.0*DEFAULT_ZOOM;
   ui.default_page.height = 792.0;
   ui.default_page.width = 612.0;
   ui.default_page.bg->type = BG_SOLID;
@@ -1231,6 +1231,7 @@ void init_config_default(void)
   ui.default_page.bg->ruling = RULING_LINED;
   ui.view_continuous = TRUE;
   ui.allow_xinput = TRUE;
+  ui.discard_corepointer = TRUE;
   ui.bg_apply_all_pages = FALSE;
   ui.use_erasertip = FALSE;
   ui.window_default_width = 720;
@@ -1244,6 +1245,18 @@ void init_config_default(void)
   ui.progressive_bg = TRUE;
   ui.print_ruling = TRUE;
   ui.default_unit = UNIT_CM;
+  ui.default_path = NULL;
+  
+  // the default UI vertical order
+  ui.vertical_order[0][0] = 1; 
+  ui.vertical_order[0][1] = 2; 
+  ui.vertical_order[0][2] = 3; 
+  ui.vertical_order[0][3] = 0; 
+  ui.vertical_order[0][4] = 4;
+  ui.vertical_order[1][0] = 2;
+  ui.vertical_order[1][1] = 3;
+  ui.vertical_order[1][2] = 0;
+  ui.vertical_order[1][3] = ui.vertical_order[1][4] = -1;
 
   ui.toolno[0] = ui.startuptool = TOOL_PEN;
   ui.ruler[0] = ui.startupruler = FALSE;
@@ -1265,7 +1278,6 @@ void init_config_default(void)
       g_memmove(&(ui.brushes[j][i]), &(ui.brushes[0][i]), sizeof(struct Brush));
 
   // predef_thickness is already initialized as a global variable
-
   GS_BITMAP_DPI = 144;
   PDFTOPPM_PRINTING_DPI = 150;
 }
@@ -1284,6 +1296,23 @@ void update_keyval(const gchar *group_name, const gchar *key,
 
 #endif
 
+const char *vorder_usernames[VBOX_MAIN_NITEMS+1] = 
+  {"drawarea", "menu", "main_toolbar", "pen_toolbar", "statusbar", NULL};
+  
+gchar *verbose_vertical_order(int *order)
+{
+  gchar buf[80], *p; // longer than needed
+  int i;
+
+  p = buf;  
+  for (i=0; i<VBOX_MAIN_NITEMS; i++) {
+    if (order[i]<0 || order[i]>=VBOX_MAIN_NITEMS) continue;
+    if (p!=buf) *(p++) = ' ';
+    p = g_stpcpy(p, vorder_usernames[order[i]]);
+  }
+  return g_strdup(buf);
+}
+
 void save_config_to_file(void)
 {
   gchar *buf;
@@ -1332,9 +1361,21 @@ void save_config_to_file(void)
   update_keyval("general", "use_xinput",
     " use XInput extensions (true/false)",
     g_strdup(ui.allow_xinput?"true":"false"));
+  update_keyval("general", "discard_corepointer",
+    " discard Core Pointer events in XInput mode (true/false)",
+    g_strdup(ui.discard_corepointer?"true":"false"));
   update_keyval("general", "use_erasertip",
     " always map eraser tip to eraser (true/false)",
     g_strdup(ui.use_erasertip?"true":"false"));
+  update_keyval("general", "default_path",
+    " default path for open/save (leave blank for current directory)",
+    g_strdup((ui.default_path!=NULL)?ui.default_path:""));
+  update_keyval("general", "interface_order",
+    " interface components from top to bottom\n valid values: drawarea menu main_toolbar pen_toolbar statusbar",
+    verbose_vertical_order(ui.vertical_order[0]));
+  update_keyval("general", "interface_fullscreen",
+    " interface components in fullscreen mode, from top to bottom",
+    verbose_vertical_order(ui.vertical_order[1]));
 
   update_keyval("paper", "width",
     " the default page width, in points (1/72 in)",
@@ -1545,6 +1586,50 @@ gboolean parse_keyval_boolean(const gchar *group, const gchar *key, gboolean *va
   return FALSE;
 }
 
+gboolean parse_keyval_string(const gchar *group, const gchar *key, gchar **val)
+{
+  gchar *ret;
+  
+  ret = g_key_file_get_value(ui.config_data, group, key, NULL);
+  if (ret==NULL) return FALSE;
+  if (strlen(ret) == 0) {
+    *val = NULL;
+    g_free(ret);
+  } 
+  else *val = ret;
+  return TRUE;
+}
+
+gboolean parse_keyval_vorderlist(const gchar *group, const gchar *key, int *order)
+{
+  gchar *ret, *p;
+  int tmp[VBOX_MAIN_NITEMS];
+  int i, n, found, l;
+
+  ret = g_key_file_get_value(ui.config_data, group, key, NULL);
+  if (ret==NULL) return FALSE;
+  
+  for (i=0; i<VBOX_MAIN_NITEMS; i++) tmp[i] = -1;
+  n = 0; p = ret;
+  while (*p==' ') p++;
+  while (*p!=0) {
+    if (n>VBOX_MAIN_NITEMS) return FALSE; // too many items
+    for (i=0; i<VBOX_MAIN_NITEMS; i++) {
+      if (!g_str_has_prefix(p, vorder_usernames[i])) continue;
+      l = strlen(vorder_usernames[i]);
+      if (p[l]==' '||p[l]==0) { p+=l; break; }
+    }
+    if (i>=VBOX_MAIN_NITEMS) { g_free(ret); return FALSE; } // parse error
+    // we found item #i
+    tmp[n++] = i;
+    while (*p==' ') p++;
+  }
+  
+  for (n=0; n<VBOX_MAIN_NITEMS; n++) order[n] = tmp[n];
+  g_free(ret);
+  return TRUE;
+}
+
 #endif
 
 void load_config_from_file(void)
@@ -1573,7 +1658,7 @@ void load_config_from_file(void)
     DEFAULT_ZOOM = f/72.0;
   if (parse_keyval_float("general", "initial_zoom", &f, 
               MIN_ZOOM*100/DEFAULT_ZOOM, MAX_ZOOM*100/DEFAULT_ZOOM))
-    ui.zoom = DEFAULT_ZOOM*f/100.0;
+    ui.zoom = ui.startup_zoom = DEFAULT_ZOOM*f/100.0;
   parse_keyval_boolean("general", "window_maximize", &ui.maximize_at_start);
   parse_keyval_boolean("general", "window_fullscreen", &ui.fullscreen);
   parse_keyval_int("general", "window_width", &ui.window_default_width, 10, 5000);
@@ -1583,8 +1668,12 @@ void load_config_from_file(void)
   parse_keyval_float("general", "zoom_step_factor", &ui.zoom_step_factor, 1., 5.);
   parse_keyval_boolean("general", "view_continuous", &ui.view_continuous);
   parse_keyval_boolean("general", "use_xinput", &ui.allow_xinput);
+  parse_keyval_boolean("general", "discard_corepointer", &ui.discard_corepointer);
   parse_keyval_boolean("general", "use_erasertip", &ui.use_erasertip);
-
+  parse_keyval_string("general", "default_path", &ui.default_path);
+  parse_keyval_vorderlist("general", "interface_order", ui.vertical_order[0]);
+  parse_keyval_vorderlist("general", "interface_fullscreen", ui.vertical_order[1]);
+  
   parse_keyval_float("paper", "width", &ui.default_page.width, 1., 5000.);
   parse_keyval_float("paper", "height", &ui.default_page.height, 1., 5000.);
   parse_keyval_enum("paper", "color", &(ui.default_page.bg->color_no), bgcolor_names, COLOR_MAX);
index dccb8993c0b65521bb5816617ac42ac59bb79b8a..00114f5d9ec15706334121e3a94461f93de5ba59 100644 (file)
@@ -205,6 +205,7 @@ create_winMain (void)
   GtkWidget *menuOptions;
   GtkWidget *menuOptions_menu;
   GtkWidget *optionsUseXInput;
+  GtkWidget *optionsDiscardCoreEvents;
   GtkWidget *optionsButtonMappings;
   GtkWidget *button2_mapping;
   GtkWidget *button2_mapping_menu;
@@ -1100,6 +1101,10 @@ create_winMain (void)
   gtk_widget_show (optionsUseXInput);
   gtk_container_add (GTK_CONTAINER (menuOptions_menu), optionsUseXInput);
 
+  optionsDiscardCoreEvents = gtk_check_menu_item_new_with_mnemonic ("Discard Core Events");
+  gtk_widget_show (optionsDiscardCoreEvents);
+  gtk_container_add (GTK_CONTAINER (menuOptions_menu), optionsDiscardCoreEvents);
+
   optionsButtonMappings = gtk_check_menu_item_new_with_mnemonic ("Eraser Tip");
   gtk_widget_show (optionsButtonMappings);
   gtk_container_add (GTK_CONTAINER (menuOptions_menu), optionsButtonMappings);
@@ -2115,6 +2120,9 @@ create_winMain (void)
   g_signal_connect ((gpointer) optionsUseXInput, "toggled",
                     G_CALLBACK (on_optionsUseXInput_activate),
                     NULL);
+  g_signal_connect ((gpointer) optionsDiscardCoreEvents, "toggled",
+                    G_CALLBACK (on_optionsDiscardCore_activate),
+                    NULL);
   g_signal_connect ((gpointer) optionsButtonMappings, "activate",
                     G_CALLBACK (on_optionsButtonMappings_activate),
                     NULL);
@@ -2500,6 +2508,7 @@ create_winMain (void)
   GLADE_HOOKUP_OBJECT (winMain, menuOptions, "menuOptions");
   GLADE_HOOKUP_OBJECT (winMain, menuOptions_menu, "menuOptions_menu");
   GLADE_HOOKUP_OBJECT (winMain, optionsUseXInput, "optionsUseXInput");
+  GLADE_HOOKUP_OBJECT (winMain, optionsDiscardCoreEvents, "optionsDiscardCoreEvents");
   GLADE_HOOKUP_OBJECT (winMain, optionsButtonMappings, "optionsButtonMappings");
   GLADE_HOOKUP_OBJECT (winMain, button2_mapping, "button2_mapping");
   GLADE_HOOKUP_OBJECT (winMain, button2_mapping_menu, "button2_mapping_menu");
@@ -2836,7 +2845,7 @@ create_aboutDialog (void)
   dialog_vbox2 = GTK_DIALOG (aboutDialog)->vbox;
   gtk_widget_show (dialog_vbox2);
 
-  image387 = create_pixmap (aboutDialog, "notepad.png");
+  image387 = create_pixmap (aboutDialog, "xournal.png");
   gtk_widget_show (image387);
   gtk_box_pack_start (GTK_BOX (dialog_vbox2), image387, FALSE, TRUE, 12);
 
@@ -2845,7 +2854,7 @@ create_aboutDialog (void)
   gtk_box_pack_start (GTK_BOX (dialog_vbox2), labelTitle, FALSE, FALSE, 3);
   gtk_label_set_justify (GTK_LABEL (labelTitle), GTK_JUSTIFY_CENTER);
 
-  labelInfo = gtk_label_new ("Written by Denis Auroux\nhttp://math.mit.edu/~auroux/software/xournal/");
+  labelInfo = gtk_label_new ("Written by Denis Auroux\n       http://xournal.sourceforge.net/       ");
   gtk_widget_show (labelInfo);
   gtk_box_pack_start (GTK_BOX (dialog_vbox2), labelInfo, FALSE, FALSE, 0);
   gtk_label_set_justify (GTK_LABEL (labelInfo), GTK_JUSTIFY_CENTER);
index d9c4c18634dfd1c142ec18270fc4a23fb34115c2..7cfe98410d068ef218476d7fb5eec14090afae5d 100644 (file)
@@ -532,7 +532,7 @@ void rescale_bg_pixmaps(void)
     // in progressive mode we scale only visible pages
     if (ui.progressive_bg && !is_visible(pg)) continue;
 
-    if (pg->bg->type == BG_PIXMAP) { // do the rescaling ourselves
+    if (pg->bg->type == BG_PIXMAP && pg->bg->canvas_item!=NULL) { // do the rescaling ourselves
       if (ui.antialias_bg) {
         if (pg->bg->pixbuf_scale == ui.zoom) continue;
         set_cursor_busy(TRUE);
@@ -927,8 +927,12 @@ void update_mappings_menu_linkings(void)
 
 void update_mappings_menu(void)
 {
+  gtk_widget_set_sensitive(GET_COMPONENT("optionsButtonMappings"), ui.use_xinput);
+  gtk_widget_set_sensitive(GET_COMPONENT("optionsDiscardCoreEvents"), ui.use_xinput);
   gtk_check_menu_item_set_active(
     GTK_CHECK_MENU_ITEM(GET_COMPONENT("optionsButtonMappings")), ui.use_erasertip);
+  gtk_check_menu_item_set_active(
+    GTK_CHECK_MENU_ITEM(GET_COMPONENT("optionsDiscardCoreEvents")), ui.discard_corepointer);
 
   switch(ui.toolno[1]) {
     case TOOL_PEN:
@@ -1531,3 +1535,29 @@ void process_mapping_activate(GtkMenuItem *menuitem, int m, int tool)
     update_mappings_menu_linkings();
   }
 }
+
+// update the ordering of components in the main vbox
+
+const char *vbox_component_names[VBOX_MAIN_NITEMS]=
+ {"scrolledwindowMain", "menubar", "toolbarMain", "toolbarPen", "hbox1"};
+
+void update_vbox_order(int *order)
+{
+  int i, j;
+  GtkWidget *child;
+  GtkBox *vboxMain = GTK_BOX(GET_COMPONENT("vboxMain"));
+  gboolean present[VBOX_MAIN_NITEMS];
+  
+  for (i=0; i<VBOX_MAIN_NITEMS; i++) present[i] = FALSE;
+  j=0;
+  for (i=0; i<VBOX_MAIN_NITEMS; i++) {
+    if (order[i]<0 || order[i]>=VBOX_MAIN_NITEMS) continue;
+    present[order[i]] = TRUE;
+    child = GET_COMPONENT(vbox_component_names[order[i]]);
+    gtk_box_reorder_child(vboxMain, child, j++);
+    gtk_widget_show(child);
+  }
+  for (i=1; i<VBOX_MAIN_NITEMS; i++) // hide others, but not the drawing area!
+    if (!present[i]) gtk_widget_hide(GET_COMPONENT(vbox_component_names[i]));
+}
+
index 636f5e6b73cba5eefa8f3266b570a316b89a1c5a..a82d3716dbeabdd86bac0b03e3c89ad0a53ec0cf 100644 (file)
@@ -48,6 +48,7 @@ void update_toolbar_and_menu(void);
 void update_file_name(char *filename);
 void update_undo_redo_enabled(void);
 void update_copy_paste_enabled(void);
+void update_vbox_order(int *order);
 
 void update_mapping_linkings(int toolno);
 void do_switch_page(int pg, gboolean rescroll, gboolean refresh_all);
@@ -71,6 +72,7 @@ void move_journal_items_by(GList *itemlist, double dx, double dy,
 void switch_mapping(int m);
 void process_mapping_activate(GtkMenuItem *menuitem, int m, int tool);
 
+
 // defines for paper rulings
 
 #define RULING_MARGIN_COLOR 0xff0080ff
index 62d3dc8efb3b14e7d4c26e5b53d9a38099e366d2..6e75f2b9fae06b240163570a3fa531ae92aaa18c 100644 (file)
@@ -17,6 +17,8 @@
 #define DISPLAY_DPI_DEFAULT 96.0
 #define MIN_ZOOM 0.2
 
+#define VBOX_MAIN_NITEMS 5 // number of interface items in vboxMain
+
 /* a string (+ aux data) that maintains a refcount */
 
 typedef struct Refstring {
@@ -203,9 +205,12 @@ typedef struct UIData {
   double zoom; // zoom factor, in pixels per pt
   gboolean use_xinput; // use input devices instead of core pointer
   gboolean allow_xinput; // allow use of xinput ?
+  gboolean discard_corepointer; // discard core pointer events in XInput mode
+  gboolean is_corestroke; // this stroke is painted with core pointer
   int screen_width, screen_height; // initial screen size, for XInput events
   double hand_refpt[2];
   char *filename;
+  gchar *default_path; // default path for new notes
   gboolean view_continuous, fullscreen, maximize_at_start;
   gboolean in_update_page_stuff; // semaphore to avoid scrollbar retroaction
   struct Selection *selection;
@@ -223,9 +228,11 @@ typedef struct UIData {
   gboolean startupruler;
   int zoom_step_increment; // the increment in the zoom dialog box
   double zoom_step_factor; // the multiplicative factor in zoom in/out
+  double startup_zoom;
 #if GLIB_CHECK_VERSION(2,6,0)
   GKeyFile *config_data;
 #endif
+  int vertical_order[2][VBOX_MAIN_NITEMS]; // the order of interface components
 } UIData;
 
 #define BRUSH_LINKED 0
index c7ad3c817aa838130b0a03b5fc6a597946b40856..1752fffed024ac01dfa00ee91fb7634ddcf1c2f5 100644 (file)
                    </widget>
                  </child>
 
+                 <child>
+                   <widget class="GtkCheckMenuItem" id="optionsDiscardCoreEvents">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Discard Core Events</property>
+                     <property name="use_underline">True</property>
+                     <property name="active">False</property>
+                     <signal name="toggled" handler="on_optionsDiscardCore_activate" last_modification_time="Wed, 07 Dec 2005 22:54:39 GMT"/>
+                   </widget>
+                 </child>
+
                  <child>
                    <widget class="GtkCheckMenuItem" id="optionsButtonMappings">
                      <property name="visible">True</property>
@@ -3455,7 +3465,7 @@ points</property>
       <child>
        <widget class="GtkImage" id="image387">
          <property name="visible">True</property>
-         <property name="pixbuf">notepad.png</property>
+         <property name="pixbuf">xournal.png</property>
          <property name="xalign">0.5</property>
          <property name="yalign">0.5</property>
          <property name="xpad">0</property>
@@ -3497,7 +3507,7 @@ points</property>
        <widget class="GtkLabel" id="labelInfo">
          <property name="visible">True</property>
          <property name="label" translatable="yes">Written by Denis Auroux
-http://math.mit.edu/~auroux/software/xournal/</property>
+       http://xournal.sourceforge.net/       </property>
          <property name="use_underline">False</property>
          <property name="use_markup">False</property>
          <property name="justify">GTK_JUSTIFY_CENTER</property>