From 64fbee630efe4a6a731bcc7b68855d933946b050 Mon Sep 17 00:00:00 2001
From: auroux
Date: Wed, 31 Jan 2007 19:36:01 +0000
Subject: [PATCH] Release 0.3.3 (minor enhancements)
---
ChangeLog | 8 ++++
NEWS | 6 ++-
README | 6 ++-
configure.in | 2 +-
html-doc/manual.html | 35 +++++++++++++--
src/TODO | 9 ++++
src/main.c | 7 ++-
src/xo-callbacks.c | 74 ++++++++++++++++++------------
src/xo-callbacks.h | 4 ++
src/xo-file.c | 105 +++++++++++++++++++++++++++++++++++++++----
src/xo-interface.c | 13 +++++-
src/xo-misc.c | 32 ++++++++++++-
src/xo-misc.h | 2 +
src/xournal.h | 7 +++
xournal.glade | 14 +++++-
15 files changed, 269 insertions(+), 55 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 7eb6912..2a215d1 100644
--- 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 24c081a..b8e6d5b 100644
--- 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 24c081a..b8e6d5b 100644
--- 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
diff --git a/configure.in b/configure.in
index 29093ca..2da3364 100644
--- a/configure.in
+++ b/configure.in
@@ -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
diff --git a/html-doc/manual.html b/html-doc/manual.html
index 7ff5255..f748b5c 100644
--- a/html-doc/manual.html
+++ b/html-doc/manual.html
@@ -24,7 +24,7 @@
Xournal User's Manual
- Version 0.3.2
+ Version 0.3.3
@@ -38,6 +38,7 @@
Xournal can be downloaded at
+http://xournal.sourceforge.net/ or
http://math.mit.edu/~auroux/software/xournal/
@@ -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, ...
@@ -528,6 +530,17 @@ Bug reports and suggestions can also be submitted on Xournal's
Version history
+Version 0.3.3 (January 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 (November 25, 2006):
- preferences file and Save Preferences command
@@ -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.
+
+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 not 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.
+
The cursor doesn't appear in the right place...
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.
This patch has been included in version 0.7.6 of the linuxwacom driver,
diff --git a/src/TODO b/src/TODO
index 9baaeaa..cabcc9a 100644
--- 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?
diff --git a/src/main.c b/src/main.c
index 0569386..4ff98db 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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 ();
diff --git a/src/xo-callbacks.c b/src/xo-callbacks.c
index a11ce65..038507a 100644
--- a/src/xo-callbacks.c
+++ b/src/xo-callbacks.c
@@ -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();
+}
diff --git a/src/xo-callbacks.h b/src/xo-callbacks.h
index 0b67562..d7754cc 100644
--- a/src/xo-callbacks.h
+++ b/src/xo-callbacks.h
@@ -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);
diff --git a/src/xo-file.c b/src/xo-file.c
index bff53a1..ba2fad0 100644
--- a/src/xo-file.c
+++ b/src/xo-file.c
@@ -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) 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; iVBOX_MAIN_NITEMS) return FALSE; // too many items
+ for (i=0; i=VBOX_MAIN_NITEMS) { g_free(ret); return FALSE; } // parse error
+ // we found item #i
+ tmp[n++] = i;
+ while (*p==' ') p++;
+ }
+
+ for (n=0; ncolor_no), bgcolor_names, COLOR_MAX);
diff --git a/src/xo-interface.c b/src/xo-interface.c
index dccb899..00114f5 100644
--- a/src/xo-interface.c
+++ b/src/xo-interface.c
@@ -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);
diff --git a/src/xo-misc.c b/src/xo-misc.c
index d9c4c18..7cfe984 100644
--- a/src/xo-misc.c
+++ b/src/xo-misc.c
@@ -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) 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
+
+
+
+