Commit 227bd55b authored by Barak A. Pearlmutter's avatar Barak A. Pearlmutter

Import Upstream version 0.4.2.1

parent 8e1c17e4
Denis Auroux (auroux@math.mit.edu)
- Denis Auroux (auroux@math.mit.edu)
- various patch contributors as noted in the ChangeLog
Version 0.4.2.1 (Mar 27, 2008):
- bugfix for #1926757 (crash upon pasting variable-width stroke)
- bugfix: set ruler/recognizer setting to default upon switching tools
Version 0.4.2 (Mar 25, 2008):
- bugfixes for X.org 7.3; allow XInput and core events in reverse order
- resize selection (patch contributed by Andy Neitzke)
- pressure sensitive pen (variable stroke width) (patch by Andy Neitzke)
- geometric shape recognizer (after an idea by Lukasz Kaiser) (see manual)
- clean up compiler warnings (patch contributed by Danny Kukawka)
Version 0.4.1 (Sep 15, 2007):
- bugfix: compatibility with new versions of pdftoppm (thanks to V. Ciancia)
- GTK+ 2.11 event processing bugfix
......
Version 0.4.1 (September 15, 2007)
Version 0.4.2.1 (March 27, 2008)
Installation: see INSTALL
User's manual: see html-doc/manual.html
......
Version 0.4.1 (September 15, 2007)
Version 0.4.2.1 (March 27, 2008)
Installation: see INSTALL
User's manual: see html-doc/manual.html
......
dnl Process this file with autoconf to produce a configure script.
AC_INIT(configure.in)
AM_INIT_AUTOMAKE(xournal, 0.4.1)
AM_INIT_AUTOMAKE(xournal, 0.4.2.1)
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE
......
......@@ -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.4.1
Version 0.4.2.1
</p>
<hr />
<p>
......@@ -156,6 +156,31 @@ the Tools menu):
line segments instead of curvy strokes. For simplicity, selecting the
ruler when not in pen or highlighter mode automatically selects the pen.
</p>
<a name="recognizer"></a>
<h3 class="subsub"><img src="pixmaps/shapes.png"> The shape recognizer</h3>
<p>
The shape recognizer is also a special
operating mode of the pen and highlighter tools. When it is enabled,
Xournal attempts to recognize geometric shapes as they are drawn, and
if successful will replace the drawn strokes accordingly. The shapes
that can be recognized are: line segments, circles, rectangles, arrows,
triangles and quadrilaterals. Polygonal shapes can be drawn in a single
stroke or in a sequence of consecutive strokes.
</p>
<p>
The recognizer is set to be as unobtrusive as possible, and should not
interfere too much with handwriting. (It differs in this and other ways
from another shape recognizer written for Xournal by Lukasz Kaiser).
As a result, it may only recognize shapes if you draw them carefully and
deliberately. Specific tips for better recognition: (1) for circles,
a closed curve that isn't quite round works better
than a rounder curve that doesn't close; (2) for arrows, it is better
to lift the pen before drawing the tip of the arrow, and make sure
the tip consists of two straight line segments;
(3) for very elongated rectangles,
recognition tends to be better if you lift the pen between consecutive
sides.
</p>
<h3 class="subsub"><img src="pixmaps/recycled.png"> Default tools</h3>
<p>
Each tool (pen, eraser, highlighter, text) has a default setting
......@@ -555,6 +580,24 @@ Bug reports and suggestions can also be submitted on Xournal's
<a name="changelog"></a>
<h2 class="subtitle">Version history</h2>
<p>
Version 0.4.2.1 (Mar 27, 2008):
<ul>
<li>bugfix for #1926757 (crash upon pasting variable-width stroke)</li>
<li>bugfix: set ruler/recognizer setting to default upon switching tools</li>
</ul>
</p>
<p>
Version 0.4.2 (Mar 25, 2008):
<ul>
<li>bugfixes for X.org 7.3; allow XInput and core events in reverse order</li>
<li>resize selection (patch contributed by Andy Neitzke)</li>
<li>pressure sensitive pen (variable stroke width) (patch by Andy Neitzke)</li>
<li>geometric shape recognizer (after an idea by Lukasz Kaiser)
(see <a href="manual.html#recognizer">here</a>)</li>
<li>clean up compiler warnings (patch contributed by Danny Kukawka)</li>
</ul>
</p>
<p>
Version 0.4.1 (Sep 15, 2007):
<ul>
<li> bugfix: compatibility with new versions of pdftoppm (thanks to
......@@ -790,11 +833,21 @@ The <i>tool</i> attribute can take the values "pen", "highlighter", or
or whiteout eraser); a value of "highlighter" indicates that the stroke
should be painted in a partially transparent manner (Xournal uses an alpha
coefficient of 0.5).
</p>
<p>
The <i>color</i> attribute can take one of the standard values "black",
"blue", "red", "green", "gray", "lightblue", "lightgreen", "magenta",
"orange", "yellow", "white", or can specify a hexadecimal RGBA value in
the format "#rrggbbaa". The <i>width</i> attribute is a floating-point
number and specifies the width of the stroke in points (1/72 in).
the format "#rrggbbaa".
</p>
<p>
The <i>width</i> attribute is a floating-point
number (or a sequence of floating-point numbers starting with version 0.4.2),
and specifies the width of the stroke in points (1/72 in). (For a
variable-width stroke, the <i>width</i> attribute contains a
whitespace-separated succession of floating-point values: first the
nominal brush width, and then the width of each successive segment forming
the stroke.)
</p>
<p>
The list of coordinates is simply a succession of floating-point values,
......@@ -842,7 +895,7 @@ modern Linux distributions such as Fedora Core 3 or later, or RHEL 4 or
later):
<ul>
<li> the <b>gtk+</b> libraries, version <b>2.4</b> or later
(2.6 recommended) &nbsp; (package gtk2 and dependencies)</li>
(<b>2.6</b> strongly recommended) &nbsp; (package gtk2 and dependencies)</li>
<li> <b>libgnomecanvas</b> version <b>2.4</b> or later &nbsp;
(package libgnomecanvas and dependencies)</li>
<li> <b>libgnomeprint</b> and <b>libgnomeprintui</b> version <b>2.2</b> or later &nbsp;
......@@ -1016,9 +1069,9 @@ linuxwacom driver, the tablet calibration information is often not updated
properly when using xsetwacom).
</p>
<p>
<b>Important:</b> due to issues with the linuxwacom driver, it is important
to either upgrade your driver to a <a href="manual.html#wacompatch">patched
version</a>, or restrict your choice of settings as follows:
<b>Important:</b> due to issues with old versions of the linuxwacom
driver (&lt; 0.7.6), it is important to upgrade your driver,
or restrict your choice of settings as follows:
<ul>
<li> your calibration settings should not be changed at runtime (i.e.,
insert your settings directly into your X server configuration file.
......@@ -1030,8 +1083,8 @@ Do not add a list of xsetwacom commands to your startup files).
</p>
<h3 class="subsub">Strokes aren't drawn under the cursor...</h3>
<p>
This is due to misfeatures in the linuxwacom driver in versions prior
to 0.7.6. Typically, this will happen in all of the following cases:
This is typically due to misfeatures in the linuxwacom driver in versions
prior to 0.7.6, and will happen in all of the following cases:
<ul>
<li> the calibration settings have been changed after the X server was
started (using xsetwacom) </li>
......@@ -1042,24 +1095,24 @@ Most of these issues should have been fixed in version 0.7.6 of the
wacom driver. Otherwise, you can
either disable XInput support in Xournal (in the Options menu), at a
price of a severe loss of resolution (and the eraser tip won't be detected
anymore), or apply this <a href="manual.html#wacompatch">patch</a>
to version 0.7.0 of the wacom driver.
anymore), or inspect carefully your X server configuration and make
sure the tablet devices are calibrated and configured properly.
</p>
<p>
I have also had a report that one of the workarounds used by Xournal to
bypass a calibration bug in GTK+ can actually entirely prevent strokes
from being drawn. If you are being unsuccessful at drawing in Xournal
with XInput enabled, try recompiling after changing the first line of
<tt>src/main.c</tt> to
<pre>#define ENABLE_XINPUT_BUGFIX 0</pre>
with XInput enabled, try recompiling after commenting out the line
<pre>#define ENABLE_XINPUT_BUGFIX</pre>
near the beginning of <tt>src/xournal.h</tt>.
If this modification does improve things for you, and if you have a bit
of spare time to help investigate the causes of this problem, please
contact me.
</p>
<h3 class="subsub">On-the-fly display rotation</h3>
<p>
You need an X server that supports the RANDR extension, and a
recent (0.7.6 or later) or <a href="manual.html#wacompatch">patched</a>
You need an X server that supports the RANDR extension, and a sufficiently
recent (0.7.6 or later)
version of the linuxwacom driver to support on-the-fly rotation.
</p>
<p>
......@@ -1078,20 +1131,5 @@ otherwise the tablet calibration in Xournal may (and most likely will)
become incorrect.
Exit Xournal and restart it after the display has been rotated.
</p>
<a name="wacompatch"></a>
<h3 class="subsub">Linuxwacom patch for calibration and rotation</h3>
<p>
This patch fixes rotation and calibration issues with the linuxwacom driver
version 0.7.0.
<ul>
<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://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,
and should now be obsolete.
</p>
</body>
</html>
This diff is collapsed.
......@@ -15,7 +15,8 @@ xournal_SOURCES = \
xo-print.c xo-print.h \
xo-support.c xo-support.h \
xo-interface.c xo-interface.h \
xo-callbacks.c xo-callbacks.h
xo-callbacks.c xo-callbacks.h \
xo-shapes.c xo-shapes.h
xournal_LDADD = @PACKAGE_LIBS@
List of features to be implemented (not in any particular order)
----------------------------------------------------------------
- collaborative editing (see discussion with Erik Demaine)
- porting to Win32 and MacOS
- multiple-scenario undo history
- improve recognizer: two passes for polygons (low tolerance, then higher)
to better detect elongated rectangles? (if low tolerance recognizer
doesn't get a rectangle, then use higher tolerance for everything else,
since otherwise there's too much risk of splitting a segment into 2)
- snap-to-grid (also for ruler & recognizer vertices)
and maybe also snap-to-vertices (option for ruler and recognizer)?
- allow broken PDF with some 19-byte xref entries (LF instead of CRLF).??
(Phil Rhoades 3/25/08)
- render page to bitmap: for export, preview, and copy-paste
(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?)
- navigation sidebar with bitmap page previews
- bitmap preview for document icon in desktop environments?
- "organizer" side panel (hierarchy of notes), cf. gjots
- paste text directly into xournal, from xournal?
(instead of starting a text item and pasting into/from it)
- internationalization / translation of interface
- a command + keyboard shortcut to switch between mappings (1<->2, 1<->3)
- increase width of spinPageNo to fit 3 digits
- a command + keyboard shortcut to switch mappings (1<->2, 1<->3, 2<->3)
(A. Rechnitzer Sept 11, 2007)
- lasso tool
- internationalization / translation of interface
- switch to poppler instead of pdftoppm; with exact float dpi settings
- load PDF pages only on demand (create empty pixmaps at first if can
parse PDF geometry ourselves, else try pdfinfo ??)
(and config option to limit total memory usage for PDF bitmaps)
- ability to select entire page for copy-paste (as bitmap / reorder xournal)
- copy/paste of an entire page (beware if PDF bg is not compatible!)
- rewrite printing using GtkPrint + Cairo as GnomePrint replacement
(keep GnomePrint option for compatibility with GTK+ <2.10)
- insert images (screen capture or from file or from clipboard),
not as full-page backgrounds (new ITEM type)
- convert to/from Jarnal format; to/from MS Journal format???
- sticky notes (anchor visually text box to a bg location)
- use relative paths for bg documents (e.g. annotated PDF)
- flush display queue when drawing over a slow X server?
- more paper customization (in particular, 1/2 inch graph paper)
- option to map a button to a context menu (incl. tool selection, ...)
- option to map a button to "undo"
- xournal_page-shadow.diff (Martin Kiefel Feb 5 2007)
- "organizer" side panel (hierarchy of notes), cf. gjots
- xoj2pdf on command line
- 'insert blank page after' command (more useful in PDF annot !)
- load images as bg if given on command-line (as with PDF on commandline)
- load PDF pages only on demand (create empty pixmaps at first if can
parse PDF geometry ourselves, else try pdfinfo ??)
(and config option to limit total memory usage for PDF bitmaps)
--- switch to poppler lib instead of pdftoppm
- lasso selection tool (see shoffsta patch)
(http://shoffsta.afraid.org/Projects/Xournal/)
- flatten (incl undo/redo...) - enabled only if nlayers>1
- resize selection
- color chooser (papercolor, pen color); maybe more default colors
- printing: print-options, save printer settings (throughout a session,
and on disk) (maybe a separate config file .xournal/gnome-print-settings)
- help index
- pressure sensitivity
- insert images (screen capture or from file or from clipboard),
not as full-page backgrounds (new ITEM type)
- option for highlighter to be always at bottom of its layer
- more pen/highlighter shapes (chisel)
- convert to/from Jarnal format; to/from MS Journal format???
- recalibration upon screen resize / compensation for miscalibration
(use ConfigureNotify event and XInput? cf "Bugs" tracker 08/2007)
- find a better behavior for vertical space tool across page boundaries ?
......@@ -41,8 +74,6 @@ List of features to be implemented (not in any particular order)
- move only what doesn't fit (??? looks hard)
option for vert space tool to also move the background??
(PDF: cut-and-crop by running PDF code twice with 2 different clipboxes?)
- 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
......@@ -51,7 +82,6 @@ List of features to be implemented (not in any particular order)
- 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?
- autosave at a regular interval in a given location
- keep only a few pages of a PDF file in memory at any given time; generate
pages by parsing pdf info rather than generating bitmaps for all of them.
......@@ -66,14 +96,10 @@ List of features to be implemented (not in any particular order)
- 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
(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 loaded from share/... and .xournal/...)
(disconnected shapes: add timestamps to strokes?)
- Samuel Hoffstaetter: lasso, gettext localization, sidebar thumbnails, ...
- YoYo Siska patch for desktop mode ??
- Vivek Ayer: rotate paper wrt screen (for environments where display
rotation doesn't work): gnome_canvas_item_affine_relative(canvas->root, ...)
would rotate all but text items (still need to modify scroll bbox, and
adjust event coordinates by inverse rotation).
- switch to libglade, and allow customization of key shortcuts (accels)
......@@ -2,6 +2,7 @@
# include <config.h>
#endif
#include <sys/stat.h>
#include <string.h>
#include <gtk/gtk.h>
#include <libgnomecanvas/libgnomecanvas.h>
......@@ -12,6 +13,8 @@
#include "xo-callbacks.h"
#include "xo-misc.h"
#include "xo-file.h"
#include "xo-paint.h"
#include "xo-shapes.h"
GtkWidget *winMain;
GnomeCanvas *canvas;
......@@ -75,6 +78,8 @@ void init_stuff (int argc, char *argv[])
ui.cur_path.coords = NULL;
ui.cur_path_storage_alloc = 0;
ui.cur_path.ref_count = 1;
ui.cur_widths = NULL;
ui.cur_widths_storage_alloc = 0;
ui.selection = NULL;
ui.cursor = NULL;
......@@ -94,6 +99,8 @@ void init_stuff (int argc, char *argv[])
g_memmove(ui.default_brushes+i, &(ui.brushes[0][i]), sizeof(struct Brush));
ui.cur_mapping = 0;
reset_recognizer();
// initialize various interface elements
......
This diff is collapsed.
......@@ -617,3 +617,10 @@ void
on_optionsAutoSavePrefs_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_toolsReco_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_optionsPressureSensitive_activate (GtkMenuItem *menuitem,
gpointer user_data);
This diff is collapsed.
......@@ -27,6 +27,7 @@ void add_bgpdf_request(int pageno, double zoom, gboolean printing);
void bgpdf_spawn_child(void);
void shutdown_bgpdf(void);
gboolean init_bgpdf(char *pdfname, gboolean create_pages, int file_domain);
void end_bgpdf_shutdown(void);
void bgpdf_create_page_with_bg(int pageno, struct BgPdfPage *bgpg);
void bgpdf_update_bg(int pageno, struct BgPdfPage *bgpg);
......
......@@ -143,6 +143,9 @@ create_winMain (void)
GtkWidget *toolsEraser;
GtkWidget *toolsHighlighter;
GtkWidget *toolsText;
GtkWidget *separator15;
GtkWidget *toolsReco;
GtkWidget *toolsRuler;
GtkWidget *separator9;
GtkWidget *toolsSelectRegion;
GtkWidget *toolsSelectRectangle;
......@@ -200,13 +203,12 @@ create_winMain (void)
GtkWidget *toolsDefaultHighlighter;
GtkWidget *toolsDefaultText;
GtkWidget *toolsSetAsDefault;
GtkWidget *separator15;
GtkWidget *toolsRuler;
GtkWidget *menuOptions;
GtkWidget *menuOptions_menu;
GtkWidget *optionsUseXInput;
GtkWidget *optionsDiscardCoreEvents;
GtkWidget *optionsButtonMappings;
GtkWidget *optionsPressureSensitive;
GtkWidget *button2_mapping;
GtkWidget *button2_mapping_menu;
GSList *button2Pen_group = NULL;
......@@ -287,6 +289,7 @@ create_winMain (void)
GtkWidget *buttonEraser;
GtkWidget *buttonHighlighter;
GtkWidget *buttonText;
GtkWidget *buttonReco;
GtkWidget *buttonRuler;
GtkWidget *toolitem15;
GtkWidget *vseparator5;
......@@ -873,6 +876,25 @@ create_winMain (void)
GTK_ACCEL_VISIBLE);
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (toolsText), TRUE);
separator15 = gtk_separator_menu_item_new ();
gtk_widget_show (separator15);
gtk_container_add (GTK_CONTAINER (menuTools_menu), separator15);
gtk_widget_set_sensitive (separator15, FALSE);
toolsReco = gtk_check_menu_item_new_with_mnemonic ("_Shape Recognizer");
gtk_widget_show (toolsReco);
gtk_container_add (GTK_CONTAINER (menuTools_menu), toolsReco);
gtk_widget_add_accelerator (toolsReco, "activate", accel_group,
GDK_S, (GdkModifierType) GDK_CONTROL_MASK | GDK_SHIFT_MASK,
GTK_ACCEL_VISIBLE);
toolsRuler = gtk_check_menu_item_new_with_mnemonic ("Ru_ler");
gtk_widget_show (toolsRuler);
gtk_container_add (GTK_CONTAINER (menuTools_menu), toolsRuler);
gtk_widget_add_accelerator (toolsRuler, "activate", accel_group,
GDK_L, (GdkModifierType) GDK_CONTROL_MASK | GDK_SHIFT_MASK,
GTK_ACCEL_VISIBLE);
separator9 = gtk_separator_menu_item_new ();
gtk_widget_show (separator9);
gtk_container_add (GTK_CONTAINER (menuTools_menu), separator9);
......@@ -1153,22 +1175,10 @@ create_winMain (void)
gtk_widget_show (toolsDefaultText);
gtk_container_add (GTK_CONTAINER (menuTools_menu), toolsDefaultText);
toolsSetAsDefault = gtk_menu_item_new_with_mnemonic ("_Set As Default");
toolsSetAsDefault = gtk_menu_item_new_with_mnemonic ("Set As Default");
gtk_widget_show (toolsSetAsDefault);
gtk_container_add (GTK_CONTAINER (menuTools_menu), toolsSetAsDefault);
separator15 = gtk_separator_menu_item_new ();
gtk_widget_show (separator15);
gtk_container_add (GTK_CONTAINER (menuTools_menu), separator15);
gtk_widget_set_sensitive (separator15, FALSE);
toolsRuler = gtk_check_menu_item_new_with_mnemonic ("Ru_ler");
gtk_widget_show (toolsRuler);
gtk_container_add (GTK_CONTAINER (menuTools_menu), toolsRuler);
gtk_widget_add_accelerator (toolsRuler, "activate", accel_group,
GDK_L, (GdkModifierType) GDK_CONTROL_MASK | GDK_SHIFT_MASK,
GTK_ACCEL_VISIBLE);
menuOptions = gtk_menu_item_new_with_mnemonic ("_Options");
gtk_widget_show (menuOptions);
gtk_container_add (GTK_CONTAINER (menubar), menuOptions);
......@@ -1188,6 +1198,10 @@ create_winMain (void)
gtk_widget_show (optionsButtonMappings);
gtk_container_add (GTK_CONTAINER (menuOptions_menu), optionsButtonMappings);
optionsPressureSensitive = gtk_check_menu_item_new_with_mnemonic ("_Pressure sensitivity");
gtk_widget_show (optionsPressureSensitive);
gtk_container_add (GTK_CONTAINER (menuOptions_menu), optionsPressureSensitive);
button2_mapping = gtk_menu_item_new_with_mnemonic ("Button _2 Mapping");
gtk_widget_show (button2_mapping);
gtk_container_add (GTK_CONTAINER (menuOptions_menu), button2_mapping);
......@@ -1576,6 +1590,15 @@ create_winMain (void)
gtk_radio_tool_button_set_group (GTK_RADIO_TOOL_BUTTON (buttonText), buttonPen_group);
buttonPen_group = gtk_radio_tool_button_get_group (GTK_RADIO_TOOL_BUTTON (buttonText));
buttonReco = (GtkWidget*) gtk_toggle_tool_button_new ();
gtk_tool_button_set_label (GTK_TOOL_BUTTON (buttonReco), "Shape Recognizer");
tmp_image = create_pixmap (winMain, "shapes.png");
gtk_widget_show (tmp_image);
gtk_tool_button_set_icon_widget (GTK_TOOL_BUTTON (buttonReco), tmp_image);
gtk_widget_show (buttonReco);
gtk_container_add (GTK_CONTAINER (toolbarPen), buttonReco);
gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (buttonReco), tooltips, "Shape Recognizer", NULL);
buttonRuler = (GtkWidget*) gtk_toggle_tool_button_new ();
gtk_tool_button_set_label (GTK_TOOL_BUTTON (buttonRuler), "Ruler");
tmp_image = create_pixmap (winMain, "ruler.png");
......@@ -2115,6 +2138,12 @@ create_winMain (void)
g_signal_connect ((gpointer) toolsText, "toggled",
G_CALLBACK (on_toolsText_activate),
NULL);
g_signal_connect ((gpointer) toolsReco, "toggled",
G_CALLBACK (on_toolsReco_activate),
NULL);
g_signal_connect ((gpointer) toolsRuler, "toggled",
G_CALLBACK (on_toolsRuler_activate),
NULL);
g_signal_connect ((gpointer) toolsSelectRegion, "toggled",
G_CALLBACK (on_toolsSelectRegion_activate),
NULL);
......@@ -2223,9 +2252,6 @@ create_winMain (void)
g_signal_connect ((gpointer) toolsSetAsDefault, "activate",
G_CALLBACK (on_toolsSetAsDefault_activate),
NULL);
g_signal_connect ((gpointer) toolsRuler, "toggled",
G_CALLBACK (on_toolsRuler_activate),
NULL);
g_signal_connect ((gpointer) optionsUseXInput, "toggled",
G_CALLBACK (on_optionsUseXInput_activate),
NULL);
......@@ -2235,6 +2261,9 @@ create_winMain (void)
g_signal_connect ((gpointer) optionsButtonMappings, "activate",
G_CALLBACK (on_optionsButtonMappings_activate),
NULL);
g_signal_connect ((gpointer) optionsPressureSensitive, "activate",
G_CALLBACK (on_optionsPressureSensitive_activate),
NULL);
g_signal_connect ((gpointer) button2Pen, "activate",
G_CALLBACK (on_button2Pen_activate),
NULL);
......@@ -2388,6 +2417,9 @@ create_winMain (void)
g_signal_connect ((gpointer) buttonText, "toggled",
G_CALLBACK (on_toolsText_activate),
NULL);
g_signal_connect ((gpointer) buttonReco, "toggled",
G_CALLBACK (on_toolsReco_activate),
NULL);
g_signal_connect ((gpointer) buttonRuler, "toggled",
G_CALLBACK (on_toolsRuler_activate),
NULL);
......@@ -2572,6 +2604,9 @@ create_winMain (void)
GLADE_HOOKUP_OBJECT (winMain, toolsEraser, "toolsEraser");
GLADE_HOOKUP_OBJECT (winMain, toolsHighlighter, "toolsHighlighter");
GLADE_HOOKUP_OBJECT (winMain, toolsText, "toolsText");
GLADE_HOOKUP_OBJECT (winMain, separator15, "separator15");
GLADE_HOOKUP_OBJECT (winMain, toolsReco, "toolsReco");
GLADE_HOOKUP_OBJECT (winMain, toolsRuler, "toolsRuler");
GLADE_HOOKUP_OBJECT (winMain, separator9, "separator9");
GLADE_HOOKUP_OBJECT (winMain, toolsSelectRegion, "toolsSelectRegion");
GLADE_HOOKUP_OBJECT (winMain, toolsSelectRectangle, "toolsSelectRectangle");
......@@ -2624,13 +2659,12 @@ create_winMain (void)
GLADE_HOOKUP_OBJECT (winMain, toolsDefaultHighlighter, "toolsDefaultHighlighter");
GLADE_HOOKUP_OBJECT (winMain, toolsDefaultText, "toolsDefaultText");
GLADE_HOOKUP_OBJECT (winMain, toolsSetAsDefault, "toolsSetAsDefault");
GLADE_HOOKUP_OBJECT (winMain, separator15, "separator15");
GLADE_HOOKUP_OBJECT (winMain, toolsRuler, "toolsRuler");
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, optionsPressureSensitive, "optionsPressureSensitive");
GLADE_HOOKUP_OBJECT (winMain, button2_mapping, "button2_mapping");
GLADE_HOOKUP_OBJECT (winMain, button2_mapping_menu, "button2_mapping_menu");
GLADE_HOOKUP_OBJECT (winMain, button2Pen, "button2Pen");
......@@ -2704,6 +2738,7 @@ create_winMain (void)
GLADE_HOOKUP_OBJECT (winMain, buttonEraser, "buttonEraser");
GLADE_HOOKUP_OBJECT (winMain, buttonHighlighter, "buttonHighlighter");
GLADE_HOOKUP_OBJECT (winMain, buttonText, "buttonText");
GLADE_HOOKUP_OBJECT (winMain, buttonReco, "buttonReco");
GLADE_HOOKUP_OBJECT (winMain, buttonRuler, "buttonRuler");
GLADE_HOOKUP_OBJECT (winMain, toolitem15, "toolitem15");
GLADE_HOOKUP_OBJECT (winMain, vseparator5, "vseparator5");
......
This diff is collapsed.
......@@ -3,6 +3,7 @@
struct Page *new_page(struct Page *template);
struct Page *new_page_with_bg(struct Background *bg, double width, double height);
void realloc_cur_path(int n);
void realloc_cur_widths(int n);
void clear_redo_stack(void);
void clear_undo_stack(void);
void prepare_new_undo(void);
......@@ -19,6 +20,7 @@ void refstring_unref(struct Refstring *rs);
// helper functions
void get_pointer_coords(GdkEvent *event, double *ret);
double get_pressure_multiplier(GdkEvent *event);
void fix_xinput_coords(GdkEvent *event);
void update_item_bbox(struct Item *item);
void make_page_clipbox(struct Page *pg);
......@@ -75,6 +77,9 @@ void reset_focus(void);
void reset_selection(void);
void move_journal_items_by(GList *itemlist, double dx, double dy,
struct Layer *l1, struct Layer *l2, GList *depths);
void resize_journal_items_by(GList *itemlist, double scaling_x, double scaling_y,
double offset_x, double offset_y);
// switch between mappings
......
This diff is collapsed.
void set_cursor_busy(gboolean busy);
void update_cursor(void);
void update_cursor_for_resize(double *pt);
void create_new_stroke(GdkEvent *event);
void continue_stroke(GdkEvent *event);
void finalize_stroke(void);
void do_eraser(GdkEvent *event, double radius, gboolean whole_strokes);
void finalize_erasure(void);
void do_hand(GdkEvent *event);
......@@ -15,6 +17,9 @@ gboolean start_movesel(GdkEvent *event);
void start_vertspace(GdkEvent *event);
void continue_movesel(GdkEvent *event);
void finalize_movesel(void);
gboolean start_resizesel(GdkEvent *event);
void continue_resizesel(GdkEvent *event);
void finalize_resizesel(void);
void selection_delete(void);
void selection_to_clip(void);
......
......@@ -342,7 +342,7 @@ struct PdfObj *get_pdfobj(GString *pdfbuf, struct XrefTable *xref, struct PdfObj
struct PdfObj *parse_xref_table(GString *pdfbuf, struct XrefTable *xref, int offs)
{
char *p, *q, *eof;
char *p, *eof;
struct PdfObj *trailerdict, *obj;
int start, len, i;
......@@ -460,7 +460,7 @@ int pdf_getpageinfo(GString *pdfbuf, struct XrefTable *xref,
gboolean pdf_parse_info(GString *pdfbuf, struct PdfInfo *pdfinfo, struct XrefTable *xref)
{
char *p;
int i, offs;
int offs;
struct PdfObj *obj, *pages;
xref->n_alloc = xref->last = 0;
......@@ -765,7 +765,7 @@ int pdf_draw_bitmap_background(struct Page *pg, GString *str,
// manipulate Pdf fonts
struct PdfFont *new_pdffont(struct XrefTable *xref, GList **fonts,
unsigned char *filename, int font_id, FT_Face face, int glyph_page)
char *filename, int font_id, FT_Face face, int glyph_page)
{
GList *list;
struct PdfFont *font;
......@@ -830,10 +830,11 @@ void embed_pdffont(GString *pdfbuf, struct XrefTable *xref, struct PdfFont *font
gboolean fallback, is_binary;
guchar encoding[256];
gushort glyphs[256];
int i, j, num, len, len1, len2;
int i, j, num, len1, len2;
gsize len;
TrueTypeFont *ttfnt;
char *tmpfile, *seg1, *seg2;
unsigned char *fontdata, *p;
char *fontdata, *p;
char prefix[8];
int nobj_fontprog, nobj_descr, lastchar;
......@@ -855,12 +856,12 @@ void embed_pdffont(GString *pdfbuf, struct XrefTable *xref, struct PdfFont *font
CreateTTFromTTGlyphs(ttfnt, tmpfile, glyphs, encoding, num,
0, NULL, TTCF_AutoName | TTCF_IncludeOS2);
CloseTTFont(ttfnt);
if (g_file_get_contents(tmpfile, (char **)&fontdata, &len, NULL) && len>=8) {
if (g_file_get_contents(tmpfile, &fontdata, &len, NULL) && len>=8) {
make_xref(xref, xref->last+1, pdfbuf->len);
nobj_fontprog = xref->last;
g_string_append_printf(pdfbuf,
"%d 0 obj\n<< /Length %d /Length1 %d >> stream\n",
nobj_fontprog, len, len);
nobj_fontprog, (int)len, (int)len);
g_string_append_len(pdfbuf, fontdata, len);
g_string_append(pdfbuf, "endstream\nendobj\n");
g_free(fontdata);
......@@ -872,14 +873,14 @@ void embed_pdffont(GString *pdfbuf, struct XrefTable *xref, struct PdfFont *font
else fallback = TRUE;
} else {
// embed the font file: Type1 case
if (g_file_get_contents(font->filename, (char **)&fontdata, &len, NULL) && len>=8) {
if (fontdata[0]==0x80 && fontdata[1]==0x01) {
if (g_file_get_contents(font->filename, &fontdata, &len, NULL) && len>=8) {
if (fontdata[0]==(char)0x80 && fontdata[1]==(char)0x01) {
is_binary = TRUE;
len1 = pfb_get_length(fontdata+2);
if (fontdata[len1+6]!=0x80 || fontdata[len1+7]!=0x02) fallback = TRUE;
len1 = pfb_get_length((unsigned char *)fontdata+2);
if (fontdata[len1+6]!=(char)0x80 || fontdata[len1+7]!=(char)0x02) fallback = TRUE;
else {
len2 = pfb_get_length(fontdata+len1+8);
if (fontdata[len1+len2+12]!=0x80 || fontdata[len1+len2+13]!=0x01)
len2 = pfb_get_length((unsigned char *)fontdata+len1+8);
if (fontdata[len1+len2+12]!=(char)0x80 || fontdata[len1+len2+13]!=(char)0x01)
fallback = TRUE;
}
}
......@@ -1021,7 +1022,7 @@ void pdf_draw_page(struct Page *pg, GString *str, gboolean *use_hiliter,
FcPattern *pattern;
int baseline, advance;
int glyph_no, glyph_page, current_page;
unsigned char *filename;
char *filename;
char tmpstr[200];
int font_id;
FT_Face ftface;
......@@ -1052,10 +1053,18 @@ void pdf_draw_page(struct Page *pg, GString *str, gboolean *use_hiliter,
old_rgba = item->brush.color_rgba & ~0xff;
old_thickness = item->brush.thickness;
pt = item->path->coords;
g_string_append_printf(str, "%.2f %.2f m ", pt[0], pt[1]);
for (i=1, pt+=2; i<item->path->num_points; i++, pt+=2)
g_string_append_printf(str, "%.2f %.2f l ", pt[0], pt[1]);
g_string_append_printf(str,"S\n");
if (!item->brush.variable_width) {
g_string_append_printf(str, "%.2f %.2f m ", pt[0], pt[1]);
for (i=1, pt+=2; i<item->path->num_points; i++, pt+=2)
g_string_append_printf(str, "%.2f %.2f l ", pt[0], pt[1]);
g_string_append_printf(str,"S\n");
old_thickness = item->brush.thickness;
} else {
for (i=0; i<item->path->num_points-1; i++, pt+=2)
g_string_append_printf(str, "%.2f w %.2f %.2f m %.2f %.2f l S\n",
item->widths[i], pt[0], pt[1], pt[2], pt[3]);
old_thickness = 0.0;
}
if ((item->brush.color_rgba & 0xf0) != 0xf0) // undo transparent
g_string_append(str, "Q ");
}
......@@ -1083,7 +1092,7 @@ void pdf_draw_page(struct Page *pg, GString *str, gboolean *use_hiliter,
if (!PANGO_IS_FC_FONT(run->item->analysis.font)) continue;
fcfont = PANGO_FC_FONT(run->item->analysis.font);
pattern = fcfont->font_pattern;
if (FcPatternGetString(pattern, FC_FILE, 0, &filename) != FcResultMatch ||