From: auroux
- Version 0.4.0.1
+ Version 0.4.1
@@ -555,6 +555,19 @@ Bug reports and suggestions can also be submitted on Xournal's
+Version 0.4.1 (Sep 15, 2007):
+
Version history
+
+
Version 0.4.0.1 (September 3, 2007):
@@ -880,6 +894,7 @@ make ./configure --prefix=$HOME make make install +make home-desktop-install
Configure error message:
diff --git a/install-binary b/install-binary
index 63a1fa3..3e8df6a 100755
--- a/install-binary
+++ b/install-binary
@@ -6,14 +6,17 @@ if test `id -u` = 0; then
echo "Press Control-C to abort, or Enter to proceed."
read
+ echo "Installing xournal in /usr/local/bin..."
test -z /usr/local/bin || mkdir -p /usr/local/bin
install -c src/xournal /usr/local/bin/xournal
+ echo "Installing pixmaps in /usr/local/share/xournal/pixmaps..."
install -d /usr/local/share/xournal/pixmaps
for pixmap in pixmaps/*; do
install -c -m 644 $pixmap /usr/local/share/xournal/pixmaps
done
+ echo "Installing html-doc in /usr/local/share/xournal/html-doc..."
install -d /usr/local/share/xournal/html-doc
for docfile in html-doc/*; do
if test -f $docfile; then
@@ -23,6 +26,24 @@ if test `id -u` = 0; then
if test ! -e /usr/local/share/xournal/html-doc/pixmaps; then
ln -s ../pixmaps /usr/local/share/xournal/html-doc/pixmaps
fi
+
+ echo "Installing desktop files and MIME info in /usr/local/share and /usr/share/mimelnk..."
+ install -d /usr/local/share/icons/hicolor/scalable/apps
+ install -d /usr/local/share/icons/hicolor/scalable/mimetypes
+ install -d /usr/share/mimelnk/application
+ install -d /usr/local/share/mime/packages
+ install -d /usr/local/share/applications
+ install -c -m 644 pixmaps/xournal.svg /usr/local/share/icons/hicolor/scalable/apps
+ install -c -m 644 pixmaps/xoj.svg /usr/local/share/icons/hicolor/scalable/mimetypes
+ if test ! -e /usr/local/share/icons/hicolor/scalable/mimetypes/gnome-mime-application-x-xoj.svg; then
+ ln -s xoj.svg /usr/local/share/icons/hicolor/scalable/mimetypes/gnome-mime-application-x-xoj.svg
+ fi
+ install -c -m 644 x-xoj.desktop /usr/share/mimelnk/application
+ install -c -m 644 xournal.xml /usr/local/share/mime/packages
+ install -c -m 644 xournal.desktop /usr/local/share/applications
+ update-desktop-database
+ update-mime-database /usr/local/share/mime
+ gtk-update-icon-cache -f -t /usr/local/share/icons/hicolor
else
echo "To install xournal in /usr/local, you must run this installer as root."
echo "This installer will now attempt to install xournal in your home directory."
@@ -36,14 +57,17 @@ else
location=$HOME/bin
fi
+ echo "Installing xournal in $location..."
test -z $location || mkdir -p $location
install -c src/xournal $location/xournal
+ echo "Installing pixmaps in $location/pixmaps..."
install -d $location/pixmaps
for pixmap in pixmaps/*; do
install -c -m 644 $pixmap $location/pixmaps
done
+ echo "Installing html-doc in $location/html-doc..."
install -d $location/html-doc
for docfile in html-doc/*; do
if test -f $docfile; then
@@ -53,4 +77,22 @@ else
if test ! -e $location/html-doc/pixmaps; then
ln -s ../pixmaps $location/html-doc/pixmaps
fi
+
+ echo "Installing desktop files and MIME info in $HOME/.local..."
+ install -d $HOME/.local/share/icons/hicolor/scalable/apps
+ install -d $HOME/.local/share/icons/hicolor/scalable/mimetypes
+ install -d $HOME/.kde/share/mimelnk/application
+ install -d $HOME/.local/share/mime/packages
+ install -d $HOME/.local/share/applications
+ install -c -m 644 pixmaps/xournal.svg $HOME/.local/share/icons/hicolor/scalable/apps
+ install -c -m 644 pixmaps/xoj.svg $HOME/.local/share/icons/hicolor/scalable/mimetypes
+ if test ! -e $HOME/.local/share/icons/hicolor/scalable/mimetypes/gnome-mime-application-x-xoj.svg; then
+ ln -s xoj.svg $HOME/.local/share/icons/hicolor/scalable/mimetypes/gnome-mime-application-x-xoj.svg
+ fi
+ install -c -m 644 x-xoj.desktop $HOME/.kde/share/mimelnk/application
+ install -c -m 644 xournal.xml $HOME/.local/share/mime/packages
+ install -c -m 644 xournal.desktop $HOME/.local/share/applications
+ XDG_DATA_DIRS=$HOME/.local/share update-desktop-database
+ update-mime-database $HOME/.local/share/mime
+ gtk-update-icon-cache -f -t $HOME/.local/share/icons/hicolor
fi
diff --git a/pixmaps/xoj.svg b/pixmaps/xoj.svg
new file mode 100644
index 0000000..0951969
--- /dev/null
+++ b/pixmaps/xoj.svg
@@ -0,0 +1,434 @@
+
+
+
\ No newline at end of file
diff --git a/src/TODO b/src/TODO
index dc0975c..fef98ae 100644
--- a/src/TODO
+++ b/src/TODO
@@ -1,12 +1,10 @@
List of features to be implemented (not in any particular order)
----------------------------------------------------------------
-- hand tool bug: upon page change, keeps scrolling till end of document
- paste text directly into xournal, from xournal?
(instead of starting a text item and pasting into/from it)
- internationalization / translation of interface
-- fix: & in bgpdf file name must be quoted to & in save_journal()
-- integration into desktop environment (document icons/previews?
- mime type? click on xoj opens it? list app in start menu?)
+- a command + keyboard shortcut to switch between mappings (1<->2, 1<->3)
+ (A. Rechnitzer Sept 11, 2007)
- rewrite printing using GtkPrint + Cairo as GnomePrint replacement
(keep GnomePrint option for compatibility with GTK+ <2.10)
- xournal_page-shadow.diff (Martin Kiefel Feb 5 2007)
@@ -59,20 +57,23 @@ List of features to be implemented (not in any particular order)
pages by parsing pdf info rather than generating bitmaps for all of them.
- win32 port (Matteo Abrate)
- snap-to-grid tool? (Matteo Abrate)
-- option to auto-save preferences on exit (Michele Codutti)
- EPOS 7/24/07: Thumbnails pane
- EPOS: Connect to EPOS api which sends A4 mapped points
- EPOS: Cut and Paste into OpenOffice applications and the GIMP (as bitmap??)
- EPOS: Export pages to pictures in the Jpg and Png formats.
- EPOS: Rotate Ink in custom angle.
+- handwriting recognition???? (cellwriter?) unlikely. we don't have grids
+- handwritten stroke search in document (see cellwriter?)
- option: export to PDF with incremental pages for successive layers
(for presentations) (Daniel Brugarth 8/18/07)
- render page to bitmap: for export, preview, and copy-paste
-- cut-and-paste of selection into other apps (as bitmap)
+ (render using libart, see how gnomecanvas does it?)
+ (copy-paste: config option to render only current layer or all below?)
+- cut-and-paste of selection into other apps (as bitmap; as SVG?)
+- ability to select entire page for copy-paste (as bitmap / reorder xournal)
- Lukasz Kaiser 8/15/07 shapes patch (approximate stroke by geometric shapes)
(make it an optional mode of the pen, like the ruler)
(rewrite without gsl dependency?)
- (config file should be in share/...)
+ (config file should be loaded from share/... and .xournal/...)
(disconnected shapes: add timestamps to strokes?)
- Samuel Hoffstaetter: lasso, gettext localization, sidebar thumbnails, ...
-- left-hand patch: Uwe Winter 8/27/07 (xournal-lefthand.patch)
diff --git a/src/main.c b/src/main.c
index 59afa6c..cbe9415 100644
--- a/src/main.c
+++ b/src/main.c
@@ -23,19 +23,6 @@ struct UndoItem *undo, *redo; // the undo and redo stacks
double DEFAULT_ZOOM;
-void hide_unimplemented(void)
-{
- gtk_widget_hide(GET_COMPONENT("filePrintOptions"));
- gtk_widget_hide(GET_COMPONENT("journalFlatten"));
- gtk_widget_hide(GET_COMPONENT("papercolorOther"));
- gtk_widget_hide(GET_COMPONENT("toolsSelectRegion"));
- gtk_widget_hide(GET_COMPONENT("buttonSelectRegion"));
- gtk_widget_hide(GET_COMPONENT("button2SelectRegion"));
- gtk_widget_hide(GET_COMPONENT("button3SelectRegion"));
- gtk_widget_hide(GET_COMPONENT("colorOther"));
- gtk_widget_hide(GET_COMPONENT("helpIndex"));
-}
-
void init_stuff (int argc, char *argv[])
{
GtkWidget *w;
@@ -189,25 +176,22 @@ void init_stuff (int argc, char *argv[])
gtk_widget_set_sensitive(GET_COMPONENT("optionsUseXInput"), FALSE);
ui.use_xinput = ui.allow_xinput && can_xinput;
- gtk_widget_set_extension_events(GTK_WIDGET (canvas),
- ui.use_xinput?GDK_EXTENSION_EVENTS_ALL:GDK_EXTENSION_EVENTS_NONE);
- gtk_check_menu_item_set_active(
- GTK_CHECK_MENU_ITEM(GET_COMPONENT("optionsUseXInput")), ui.use_xinput);
gtk_check_menu_item_set_active(
GTK_CHECK_MENU_ITEM(GET_COMPONENT("optionsAntialiasBG")), ui.antialias_bg);
gtk_check_menu_item_set_active(
GTK_CHECK_MENU_ITEM(GET_COMPONENT("optionsProgressiveBG")), ui.progressive_bg);
gtk_check_menu_item_set_active(
GTK_CHECK_MENU_ITEM(GET_COMPONENT("optionsPrintRuling")), ui.print_ruling);
-
- hide_unimplemented();
+ gtk_check_menu_item_set_active(
+ GTK_CHECK_MENU_ITEM(GET_COMPONENT("optionsLeftHanded")), ui.left_handed);
+ gtk_check_menu_item_set_active(
+ GTK_CHECK_MENU_ITEM(GET_COMPONENT("optionsShortenMenus")), ui.shorten_menus);
+ gtk_check_menu_item_set_active(
+ GTK_CHECK_MENU_ITEM(GET_COMPONENT("optionsAutoSavePrefs")), ui.auto_save_prefs);
- /* config file only works with glib 2.6 */
- if (glib_minor_version<6) {
- gtk_widget_hide(GET_COMPONENT("optionsSavePreferences"));
- }
-
+ hide_unimplemented();
+
update_undo_redo_enabled();
update_copy_paste_enabled();
update_vbox_order(ui.vertical_order[ui.fullscreen?1:0]);
@@ -217,6 +201,11 @@ void init_stuff (int argc, char *argv[])
gtk_widget_show (winMain);
update_cursor();
+
+ /* this will cause extension events to get enabled/disabled, but
+ we need the windows to be mapped first */
+ gtk_check_menu_item_set_active(
+ GTK_CHECK_MENU_ITEM(GET_COMPONENT("optionsUseXInput")), ui.use_xinput);
// load the MRU
@@ -281,6 +270,7 @@ main (int argc, char *argv[])
if (bgpdf.status != STATUS_NOT_INIT) end_bgpdf_shutdown();
save_mru_list();
+ if (ui.auto_save_prefs) save_config_to_file();
return 0;
}
diff --git a/src/xo-callbacks.c b/src/xo-callbacks.c
index 49b3bd1..5e3a3cd 100644
--- a/src/xo-callbacks.c
+++ b/src/xo-callbacks.c
@@ -770,7 +770,7 @@ on_editRedo_activate (GtkMenuItem *menuitem,
}
journal.pages = g_list_remove(journal.pages, redo->page);
journal.npages--;
- if (ui.pageno > undo->val || ui.pageno == journal.npages) ui.pageno--;
+ if (ui.pageno > redo->val || ui.pageno == journal.npages) ui.pageno--;
ui.cur_page = NULL;
// so do_switch_page() won't try to remap the layers of the defunct page
do_switch_page(ui.pageno, TRUE, TRUE);
@@ -2418,6 +2418,8 @@ on_canvas_button_press_event (GtkWidget *widget,
if (ui.toolno[mapping] == TOOL_HAND) {
ui.cur_item_type = ITEM_HAND;
get_pointer_coords((GdkEvent *)event, ui.hand_refpt);
+ ui.hand_refpt[0] += ui.cur_page->hoffset;
+ ui.hand_refpt[1] += ui.cur_page->voffset;
}
else if (ui.toolno[mapping] == TOOL_PEN || ui.toolno[mapping] == TOOL_HIGHLIGHTER ||
(ui.toolno[mapping] == TOOL_ERASER && ui.cur_brush->tool_options == TOOLOPT_ERASER_WHITEOUT)) {
@@ -2617,8 +2619,29 @@ on_optionsUseXInput_activate (GtkMenuItem *menuitem,
reset_focus();
ui.allow_xinput = ui.use_xinput =
gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM (menuitem));
- gtk_widget_set_extension_events(GTK_WIDGET (canvas),
+
+/* Important note: we'd like ONLY the canvas window itself to receive
+ XInput events, while its child window in the GDK hierarchy (also
+ associated to the canvas widget) receives the core events.
+ This way on_canvas_... will get both types of events -- otherwise,
+ the proximity detection code in GDK is broken and we'll lose core
+ events.
+
+ Up to GTK+ 2.10, gtk_widget_set_extension_events() only sets
+ extension events for the widget's main window itself; in GTK+ 2.11
+ also traverses GDK child windows that belong to the widget
+ and sets their extension events too. We want to avoid that.
+ So we use gdk_input_set_extension_events() directly on the canvas.
+*/
+
+/* // this causes GTK+ 2.11 bugs
+ gtk_widget_set_extension_events(GTK_WIDGET (canvas),
ui.use_xinput?GDK_EXTENSION_EVENTS_ALL:GDK_EXTENSION_EVENTS_NONE);
+*/
+ gdk_input_set_extension_events(GTK_WIDGET(canvas)->window,
+ GDK_POINTER_MOTION_MASK | GDK_BUTTON_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK,
+ ui.use_xinput?GDK_EXTENSION_EVENTS_ALL:GDK_EXTENSION_EVENTS_NONE);
+
update_mappings_menu();
}
@@ -3311,3 +3334,58 @@ on_fontButton_font_set (GtkFontButton *fontbutton,
process_font_sel(str);
}
+void
+on_optionsLeftHanded_activate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ end_text();
+ reset_focus();
+ ui.left_handed = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM (menuitem));
+ gtk_scrolled_window_set_placement(GTK_SCROLLED_WINDOW(GET_COMPONENT("scrolledwindowMain")),
+ ui.left_handed?GTK_CORNER_TOP_RIGHT:GTK_CORNER_TOP_LEFT);
+}
+
+void
+on_optionsShortenMenus_activate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ gchar *item, *nextptr;
+ GtkWidget *w;
+
+ end_text();
+ reset_focus();
+ ui.shorten_menus = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM (menuitem));
+
+ /* go over the item list */
+ item = ui.shorten_menu_items;
+ while (*item==' ') item++;
+ while (*item) {
+ nextptr = strchr(item, ' ');
+ if (nextptr!=NULL) *nextptr = 0;
+ // hide or show the item
+ w = GET_COMPONENT(item);
+ if (w != NULL) {
+ if (ui.shorten_menus) gtk_widget_hide(w);
+ else gtk_widget_show(w);
+ }
+ // next item
+ if (nextptr==NULL) break;
+ *nextptr = ' ';
+ item = nextptr;
+ while (*item==' ') item++;
+ }
+
+ // just in case someone tried to unhide stuff they shouldn't be seeing
+ hide_unimplemented();
+ // maybe we should also make sure the drawing area stays visible ?
+}
+
+void
+on_optionsAutoSavePrefs_activate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ end_text();
+ reset_focus();
+ ui.auto_save_prefs = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM (menuitem));
+}
+
diff --git a/src/xo-callbacks.h b/src/xo-callbacks.h
index eb7b58f..73593f9 100644
--- a/src/xo-callbacks.h
+++ b/src/xo-callbacks.h
@@ -606,5 +606,14 @@ on_fontButton_font_set (GtkFontButton *fontbutton,
gpointer user_data);
void
-on_toggletoolClicked (GtkToolButton *toolbutton,
+on_optionsLeftHanded_activate (GtkMenuItem *menuitem,
gpointer user_data);
+
+void
+on_optionsShortenMenus_activate (GtkMenuItem *menuitem,
+ gpointer user_data);
+
+void
+on_optionsAutoSavePrefs_activate (GtkMenuItem *menuitem,
+ gpointer user_data);
+
diff --git a/src/xo-file.c b/src/xo-file.c
index 2ac09fd..97f3bcf 100644
--- a/src/xo-file.c
+++ b/src/xo-file.c
@@ -124,8 +124,10 @@ gboolean save_journal(const char *filename)
}
g_free(tmpfn);
}
+ tmpstr = g_markup_escape_text(pg->bg->filename->s, -1);
gzprintf(f, "domain=\"%s\" filename=\"%s\" ",
- file_domain_names[pg->bg->file_domain], pg->bg->filename->s);
+ file_domain_names[pg->bg->file_domain], tmpstr);
+ g_free(tmpstr);
}
}
else if (pg->bg->type == BG_PDF) {
@@ -156,8 +158,10 @@ gboolean save_journal(const char *filename)
}
g_free(tmpfn);
}
+ tmpstr = g_markup_escape_text(pg->bg->filename->s, -1);
gzprintf(f, "domain=\"%s\" filename=\"%s\" ",
- file_domain_names[pg->bg->file_domain], pg->bg->filename->s);
+ file_domain_names[pg->bg->file_domain], tmpstr);
+ g_free(tmpstr);
}
gzprintf(f, "pageno=\"%d\" ", pg->bg->file_page_seq);
}
@@ -180,8 +184,10 @@ gboolean save_journal(const char *filename)
gzprintf(f, "\n\n");
}
if (item->type == ITEM_TEXT) {
+ tmpstr = g_markup_escape_text(item->font_name, -1);
gzprintf(f, "