+Version 0.3 (Jul 23, 2006):
+ - new PDF rendering engine: export to PDF generates optimized files
+ (smaller and more accurate)
+ - export to PDF handles PDF backgrounds (up to PDF-1.4) natively
+ (without conversion to bitmap)
+ - default thickness of erasers and highlighters slightly increased
+ - zoom dialog box with input box and "fit to page height" option
+ - file format documentation added to the user's manual
+
Version 0.2.2 (Jun 5, 2006):
- mapping of tools to stylus buttons (the options menu has new entries
to allow the mapping of buttons 2 and 3 to arbitrary tools; the tools
-Version 0.2.2 (June 5, 2006)
+Version 0.3 (July 23, 2006)
Installation: see INSTALL
User's manual: see html-doc/manual.html
-Version 0.2.2 (June 5, 2006)
+Version 0.3 (July 23, 2006)
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.2.2)
+AM_INIT_AUTOMAKE(xournal, 0.3)
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE
Xournal User's Manual
</h2>
<p style="font-size: 0.95em; text-align: center; color: rgb(0,0,0)">
- Version 0.2.2
+ Version 0.3
</p>
<hr />
<p>
<h2 class="subtitle">Printing</h2>
<p>
Xournal uses the gnome-print architecture for printing. While it is very
-powerful, some aspects of the API leave to be desired,
-and future versions of Xournal will probably also include a native
-Postscript/PDF printing feature.
+powerful, some aspects of the API leave to be desired. As of version 0.3,
+Xournal also includes a native PDF printing feature.
</p>
+<h3 class="subsub">Printing via gnome-print</h3>
<p>
The "Printer" tab of the print dialog box lets you select a printer
(either one of the printers installed on your system, or the generic
this often fails due to gnome-print API issues).
</p>
<p>
-The "Print to PDF" entry of the File menu directly generates a PDF file
-using the PDF virtual printer, without bringing up the dialog box
-(the page size is the default one for that printer, usually A4).
Note that the PDF virtual printer produces files that are very large
-and far from optimal, so in the current state of things it is better
-to generate a Postscript file and use a converter such as ps2pdf.
-</p>
-<p>
+and far from optimal, so its use is not recommended.
The gnome-print architecture also forces page backgrounds (bitmaps
and PDF) to be generated as uncompressed bitmaps, which leads to gigantic
-print job files. An alternative to gnome-print will be
-implemented in a future release of Xournal.
+print job files. A better alternative is to export a PDF file, and
+print the PDF file.
+</p>
+<h3 class="subsub">Exporting to PDF</h3>
+<p>
+Starting with version 0.3, Xournal provides its own PDF rendering
+engine. The "Export to PDF" command (in the File menu) produces a
+PDF-1.4 file from the currently loaded document. The resulting PDF
+file is much more compact than those produced via gnome-print, and
+its pages have the same size as in Xournal. Highlighter strokes
+are rendered in a partially transparent manner (note however that
+applications such as xpdf and ghostview do not always handle
+PDF transparency properly).
+</p>
+<p>
+Xournal also includes a PDF file parser compatible with PDF format
+version 1.4; the compression features of PDF 1.5 (Acrobat 6) are
+not supported. When exporting a document that uses PDF
+backgrounds, Xournal attempts to preserve most of the structure of
+the original PDF file (however, auxiliary data such as thumbnails, hyperlinks,
+and annotations are lost). If Xournal is unable to parse the PDF
+file, the backgrounds are converted to (compressed) bitmaps and a new
+PDF file is generated from scratch.
+</p>
<hr />
<a name="author"></a>
<h2 class="subtitle">Author information, license, bug-reports</h2>
</p>
<p>Feel free to contact me with bug reports and suggestions; I apologize
in advance if I am unable to respond properly to some requests.
-List of known bugs/misfeatures (no need to report them again):
-<ul>
- <li> highlighter strokes become opaque on printouts (apparently a bug in
- libgnomeprint).</li>
- <li> print settings are not saved from one print command to the next.</li>
- <li> printing to PDF and/or printing page backgrounds generates large files.</li>
- <li> preferences are not saved on disk.</li>
-</ul>
+</p><p>
If you find a sequence of operations which crashes Xournal in a reproducible
manner, please send detailed instructions on how to reproduce the crash.
A core file may also be helpful.
<a name="changelog"></a>
<h2 class="subtitle">Version history</h2>
<p>
+Version 0.3 (July 23, 2006):
+<ul>
+ <li>new PDF rendering engine: export to PDF generates optimized files
+ (smaller and more accurate)</li>
+ <li>export to PDF handles PDF backgrounds (up to PDF-1.4) natively
+ (without conversion to bitmap)</li>
+ <li>default thickness of erasers and highlighters slightly increased</li>
+ <li>zoom dialog box with input box and "fit to page height" option</li>
+ <li>file format documentation added to the user's manual</li>
+</ul>
+</p>
+<p>
Version 0.2.2 (June 5, 2006):
<ul>
<li>mapping of tools to stylus buttons (the options menu has new entries
<ul>
<li>freeform selection tool</li>
<li>preferences file; persistent printer settings</li>
- <li>native PDF print feature</li>
<li>various functionalities (flatten layers, ...)</li>
</ul>
</p>
<hr />
<a name="file-format"></a>
<h2 class="subtitle">The file format</h2>
+<h3 class="subsub">Overall structure</h3>
<p>
-XOJ files are gzipped XML-like files. A more precise documentation of
-the file format will be added at a later date. Meanwhile, most of the
-format should be easy to figure out by trial-and-error or by looking
-at the source; if some details are unclear, feel free to ask.
+Xournal stores its data in gzipped XML-like files. The gzipped data consists
+of a succession of XML tags describing the document. By convention, the
+first few lines contain a header in the following format:
+<pre>
+<?xml version="1.0" standalone="no"?>
+<title>Xournal document - see http://math.mit.edu/~auroux/software/xournal/</title>
+<xournal version="..."/>
+</pre>
+The <title> and <xournal> tags may only appear within the file
+header (not within the pages of the document). The <i>version</i> attribute of
+the <xournal> tag indicates which version of Xournal was used to
+create the document; it is currently ignored, but may be used in a later
+release if the file format changes in an incompatible manner.
+</p>
+<p>
+The rest of the file is a sequence of pages, specified by a
+<page> tag, whose attributes <i>width</i> and <i>height</i> specify the
+physical size of the page in points (1/72 in). The width and height
+parameters are floating point values. The format of a page is therefore:
+<pre>
+<page width="..." height="...">
+... page contents ...
+</page>
+</pre>
+</p>
+<h3 class="subsub">Page background</h3>
+<p>
+The first entry within a page describes the page background.
+It consists of a <background> tag followed by several mandatory
+XML attributes. The first attribute is always <i>type</i>, which
+can take three possible values: "solid" for a solid background, "pixmap"
+for a bitmap background, and "pdf" if the background is a page of a PDF
+document. The rest of the attributes depends on the type of background.
+<ul>
+<li><p> Solid background: <tt><background type="solid" color="..."
+style="..." /></tt> <br />The <i>color</i> attribute takes one of
+the standard values "white", "yellow", "pink", "orange", "blue", "green",
+or can specify a hexadecimal RGBA value in the format "#rrggbbaa". The
+<i>style</i> attribute takes one of the standard values "plain", "lined",
+"ruled", or "graph".</p>
+</li>
+<li><p> Bitmap background: <tt><background type="pixmap" domain="..."
+filename="..." /></tt> <br />
+The <i>domain</i> attribute takes one of the standard values "absolute",
+"attach", or "clone". A value of "absolute" indicates that the bitmap is
+found in the file specified by <i>filename</i>. The bitmap can be in any
+format recognized by the gdk-pixbuf library; this includes most of the
+common bitmap formats (JPEG, PNG, BMP, GIF, PCX, PNM, TIFF, ...).
+<br />A value
+of "attach" indicates that the bitmap is an attachment to the Xournal file.
+The bitmap is in PNG format, and resides in a file whose name is derived
+from that of the main Xournal file by appending to it a dot and the contents
+of the <i>filename</i> attribute. For example, if the Xournal file is in
+<tt>file.xoj</tt> and the <i>filename</i> attribute is <tt>"bg_1.png"</tt>
+then the bitmap file is <tt>file.xoj.bg_1.png</tt> (Xournal saves attached
+bitmaps sequentially in files ...bg_1.png, ...bg_2.png, etc.)
+<br />A value of "clone" indicates that the bitmap is identical to the
+background of a previous page of the journal; the <i>filename</i> attribute
+then specifies the page number, starting with 0 for the first page. For
+example, if a <i>filename</i> value of <tt>"1"</tt> indicates that the
+background bitmap is identical to that of the second page.
+</p>
+</li>
+<li><p> PDF background: <tt><background type="pdf" domain="..."
+filename="..." pageno="..." /></tt> or
+<tt><background type="pdf" pageno="..." /></tt>
+<br />The <i>domain</i> and <i>filename</i> attributes must be specified
+for the first page of the journal that uses a PDF background, and must
+be omitted subsequently for every other page that uses a PDF background.
+The <i>domain</i> attribute takes one of the standard values
+"absolute" and "attach"; the PDF document is to be found in the file
+specified by <i>filename</i> (if <i>domain</i> is "absolute"), or in the
+file whose name is obtained by appending a dot and the contents of the
+<i>filename</i> attribute to the name of the main Xournal file (if
+<i>domain</i> is "attach"). The <i>pageno</i> attribute specifies which
+page of the PDF file is used as background, starting with 1 for the first
+page of the PDF file.
+</p>
+</li>
+</ul>
+</p>
+<h3 class="subsub">Layers and strokes</h3>
+<p>
+After the line specifying the background, the remainder of a <page>
+section is occupied by one or more layer sections
+<pre><layer> ... </layer></pre>
+describing the various strokes within a layer. Every page must
+contain at least one layer; a layer may be empty. The successive layers
+are listed in their stacking order, from bottom to top.
+</p>
+<p>
+A layer consist of a collection of items, listed in the order in which
+they should be drawn
+(from bottom-most to top-most).
+As of the current version, the only legal contents within a layer are
+strokes. The format of a stroke is:
+<pre><stroke tool="..." color="..." width="...">
+... list of coordinates ...
+</stroke>
+</pre>
+The <i>tool</i> attribute can take the values "pen", "highlighter", or
+"eraser" depending on the tool used to create the stroke (pen, highlighter,
+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).
+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).
+</p>
+<p>
+The list of coordinates is simply a succession of floating-point values,
+separated by whitespace.
+The number of given values must be even; consecutive pairs of values give
+the <i>x</i> and <i>y</i> coordinates of each point along the stroke.
+These values are expressed in points (1/72 in). The coordinates (0,0)
+represent the top-left corner of the page: hence x is measured from the left
+of the page, and y is measured from the top of the page.
+</p>
+<p>
+Every stroke must contain at least two points (four floating point values).
+Moreover, two consecutive points on the stroke should be spaced no more
+than 5 units apart or so; longer line segments should be subdivided as
+appropriate (otherwise the eraser tool will not interact properly with the
+stroke). The default precision used by Xournal for the x,y coordinates is
+0.01 unit (1/7200 in).
</p>
<hr />
<a name="installation"></a>
- resize selection
- text tool, font chooser, default font
- color chooser (papercolor, pen color); maybe more default colors
-- printing: print-to-PDF? (with & without pdf background to merge)
- opacity issue for highlighter strokes (maybe print them below ?)
- save gnome printer settings (throughout a session, and on disk)
- (maybe a separate config file .xournal/gnome-print-settings)
-- file print-options, own print-to-ps/pdf
+- 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),
- convert to/from Jarnal format; to/from MS Journal format???
- recalibration upon screen resize / compensation for miscalibration
- find a better behavior for vertical space tool across page boundaries ?
-- document the file format
-
+- key mappings (pgup/dn for full page, up/dn for scroll)
gpointer user_data)
{
- GtkWidget *dialog;
+ GtkWidget *dialog, *warning_dialog;
GtkFileFilter *filt_all, *filt_pdf;
char *filename, *in_fn;
char stime[30];
time_t curtime;
- GnomePrintJob *gpj;
- GnomePrintConfig *config;
-
+ int response;
+ gboolean warn;
- dialog = gtk_file_chooser_dialog_new("Print to PDF", GTK_WINDOW (winMain),
+ dialog = gtk_file_chooser_dialog_new("Export to PDF", GTK_WINDOW (winMain),
GTK_FILE_CHOOSER_ACTION_SAVE, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, NULL);
gtk_file_filter_add_pattern(filt_pdf, "*.pdf");
gtk_file_chooser_add_filter(GTK_FILE_CHOOSER (dialog), filt_pdf);
gtk_file_chooser_add_filter(GTK_FILE_CHOOSER (dialog), filt_all);
-
- // somehow this doesn't seem to be set by default
gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_ACCEPT);
-
- if (gtk_dialog_run(GTK_DIALOG(dialog)) != GTK_RESPONSE_ACCEPT) {
- g_free(in_fn);
- gtk_widget_destroy(dialog);
- return;
- }
- filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
g_free(in_fn);
- gtk_widget_destroy(dialog);
- config = gnome_print_config_default();
- gnome_print_config_set(config, (guchar *)"Printer", (guchar *)"PDF");
- gpj = gnome_print_job_new(config);
- gnome_print_job_print_to_file(gpj, filename);
-
- print_job_render(gpj, 0, journal.npages-1);
- gnome_print_config_unref(config);
+ do {
+ if (gtk_dialog_run(GTK_DIALOG(dialog)) != GTK_RESPONSE_ACCEPT) {
+ gtk_widget_destroy(dialog);
+ return;
+ }
+ filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
+ warn = g_file_test(filename, G_FILE_TEST_EXISTS);
+ if (warn) {
+ warning_dialog = gtk_message_dialog_new(GTK_WINDOW(winMain),
+ GTK_DIALOG_MODAL, GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO,
+ "Should the file %s be overwritten?", filename);
+ if (gtk_dialog_run(GTK_DIALOG(warning_dialog)) == GTK_RESPONSE_YES)
+ warn = FALSE;
+ gtk_widget_destroy(warning_dialog);
+ }
+ } while(warn);
+
+ gtk_widget_destroy(dialog);
+ set_cursor_busy(TRUE);
+ if (!print_to_pdf(filename)) {
+ set_cursor_busy(FALSE);
+ dialog = gtk_message_dialog_new(GTK_WINDOW (winMain), GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "Error creating file '%s'", filename);
+ gtk_dialog_run(GTK_DIALOG(dialog));
+ gtk_widget_destroy(dialog);
+ }
+ set_cursor_busy(FALSE);
g_free(filename);
}
if (active == ui.fullscreen) return;
ui.fullscreen = active;
+ gtk_check_menu_item_set_active(
+ GTK_CHECK_MENU_ITEM(GET_COMPONENT("viewFullscreen")), ui.fullscreen);
+ gtk_toggle_tool_button_set_active(
+ GTK_TOGGLE_TOOL_BUTTON(GET_COMPONENT("buttonFullscreen")), ui.fullscreen);
if (ui.fullscreen) {
gtk_window_fullscreen(GTK_WINDOW(winMain));
ui.ruler[2] = FALSE;
}
+// the set zoom dialog
+
+GtkWidget *zoom_dialog;
+double zoom_percent;
+
+void
+on_viewSetZoom_activate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ int response;
+ double test_w, test_h;
+
+ zoom_dialog = create_zoomDialog();
+ zoom_percent = 100*ui.zoom / DEFAULT_ZOOM;
+ gtk_spin_button_set_value(GTK_SPIN_BUTTON(g_object_get_data(
+ G_OBJECT(zoom_dialog), "spinZoom")), zoom_percent);
+ test_w = 100*(GTK_WIDGET(canvas))->allocation.width/ui.cur_page->width/DEFAULT_ZOOM;
+ test_h = 100*(GTK_WIDGET(canvas))->allocation.height/ui.cur_page->height/DEFAULT_ZOOM;
+ if (zoom_percent > 99.9 && zoom_percent < 100.1)
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(g_object_get_data(
+ G_OBJECT(zoom_dialog), "radioZoom100")), TRUE);
+ else if (zoom_percent > test_w-0.1 && zoom_percent < test_w+0.1)
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(g_object_get_data(
+ G_OBJECT(zoom_dialog), "radioZoomWidth")), TRUE);
+ else if (zoom_percent > test_h-0.1 && zoom_percent < test_h+0.1)
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(g_object_get_data(
+ G_OBJECT(zoom_dialog), "radioZoomHeight")), TRUE);
+ else gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(g_object_get_data(
+ G_OBJECT(zoom_dialog), "radioZoom")), TRUE);
+ gtk_widget_show(zoom_dialog);
+
+ do {
+ response = gtk_dialog_run(GTK_DIALOG(zoom_dialog));
+ if (response == GTK_RESPONSE_OK || response == GTK_RESPONSE_APPLY) {
+ ui.zoom = DEFAULT_ZOOM*zoom_percent/100;
+ gnome_canvas_set_pixels_per_unit(canvas, ui.zoom);
+ rescale_bg_pixmaps();
+ }
+ } while (response == GTK_RESPONSE_APPLY);
+
+ gtk_widget_destroy(zoom_dialog);
+}
+
+
+void
+on_spinZoom_value_changed (GtkSpinButton *spinbutton,
+ gpointer user_data)
+{
+ double val;
+
+ val = gtk_spin_button_get_value(GTK_SPIN_BUTTON(g_object_get_data(
+ G_OBJECT(zoom_dialog), "spinZoom")));
+ if (val<1) return;
+ if (val<10) val=10.;
+ if (val>1500) val=1500.;
+ if (val<zoom_percent-1 || val>zoom_percent+1)
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(g_object_get_data(
+ G_OBJECT(zoom_dialog), "radioZoom")), TRUE);
+ zoom_percent = val;
+}
+
+
+void
+on_radioZoom_toggled (GtkToggleButton *togglebutton,
+ gpointer user_data)
+{
+ // nothing to do
+}
+
+
+void
+on_radioZoom100_toggled (GtkToggleButton *togglebutton,
+ gpointer user_data)
+{
+ if (!gtk_toggle_button_get_active(togglebutton)) return;
+ zoom_percent = 100.;
+ gtk_spin_button_set_value(GTK_SPIN_BUTTON(g_object_get_data(
+ G_OBJECT(zoom_dialog), "spinZoom")), zoom_percent);
+}
+
+
+void
+on_radioZoomWidth_toggled (GtkToggleButton *togglebutton,
+ gpointer user_data)
+{
+ if (!gtk_toggle_button_get_active(togglebutton)) return;
+ zoom_percent = 100*(GTK_WIDGET(canvas))->allocation.width/ui.cur_page->width/DEFAULT_ZOOM;
+ gtk_spin_button_set_value(GTK_SPIN_BUTTON(g_object_get_data(
+ G_OBJECT(zoom_dialog), "spinZoom")), zoom_percent);
+}
+
+
+void
+on_radioZoomHeight_toggled (GtkToggleButton *togglebutton,
+ gpointer user_data)
+{
+ if (!gtk_toggle_button_get_active(togglebutton)) return;
+ zoom_percent = 100*(GTK_WIDGET(canvas))->allocation.height/ui.cur_page->height/DEFAULT_ZOOM;
+ gtk_spin_button_set_value(GTK_SPIN_BUTTON(g_object_get_data(
+ G_OBJECT(zoom_dialog), "spinZoom")), zoom_percent);
+}
+
on_button3CopyBrush_activate (GtkMenuItem *menuitem,
gpointer user_data);
+
+void
+on_viewSetZoom_activate (GtkMenuItem *menuitem,
+ gpointer user_data);
+
+void
+on_spinZoom_value_changed (GtkSpinButton *spinbutton,
+ gpointer user_data);
+
+void
+on_radioZoom_toggled (GtkToggleButton *togglebutton,
+ gpointer user_data);
+
+void
+on_radioZoom100_toggled (GtkToggleButton *togglebutton,
+ gpointer user_data);
+
+void
+on_radioZoomWidth_toggled (GtkToggleButton *togglebutton,
+ gpointer user_data);
+
+void
+on_radioZoomHeight_toggled (GtkToggleButton *togglebutton,
+ gpointer user_data);
tmpf = fopen(tmpfn, "w");
if (tmpf != NULL && fwrite(pdfbuf, 1, pdflen, tmpf) == pdflen)
success = TRUE;
+ g_free(pdfbuf);
fclose(tmpf);
}
if (!success) {
GtkWidget *menuFile_menu;
GtkWidget *fileNew;
GtkWidget *fileNewBackground;
- GtkWidget *image577;
+ GtkWidget *image599;
GtkWidget *fileOpen;
GtkWidget *fileSave;
GtkWidget *fileSaveAs;
GtkWidget *mru7;
GtkWidget *separator22;
GtkWidget *filePrintOptions;
- GtkWidget *image578;
+ GtkWidget *image600;
GtkWidget *filePrint;
GtkWidget *filePrintPDF;
GtkWidget *separator2;
GtkWidget *viewZoomOut;
GtkWidget *viewNormalSize;
GtkWidget *viewPageWidth;
- GtkWidget *image579;
+ GtkWidget *image601;
+ GtkWidget *viewSetZoom;
GtkWidget *separator5;
GtkWidget *viewFirstPage;
- GtkWidget *image580;
+ GtkWidget *image602;
GtkWidget *viewPreviousPage;
- GtkWidget *image581;
+ GtkWidget *image603;
GtkWidget *viewNextPage;
- GtkWidget *image582;
+ GtkWidget *image604;
GtkWidget *viewLastPage;
- GtkWidget *image583;
+ GtkWidget *image605;
GtkWidget *separator6;
GtkWidget *viewShowLayer;
- GtkWidget *image584;
+ GtkWidget *image606;
GtkWidget *viewHideLayer;
- GtkWidget *image585;
+ GtkWidget *image607;
GtkWidget *menuJournal;
GtkWidget *menuJournal_menu;
GtkWidget *journalNewPageBefore;
GtkWidget *journalApplyAllPages;
GtkWidget *separator23;
GtkWidget *journalLoadBackground;
- GtkWidget *image586;
+ GtkWidget *image608;
GtkWidget *journalScreenshot;
GtkWidget *separator19;
GtkWidget *journalDefaultBackground;
GtkWidget *toolsVerticalSpace;
GtkWidget *separator16;
GtkWidget *toolsColor;
- GtkWidget *image587;
+ GtkWidget *image609;
GtkWidget *toolsColor_menu;
GSList *colorBlack_group = NULL;
GtkWidget *colorBlack;
GtkWidget *highlighterMedium;
GtkWidget *highlighterThick;
GtkWidget *toolsTextFont;
- GtkWidget *image588;
+ GtkWidget *image610;
GtkWidget *separator10;
GtkWidget *toolsDefaultPen;
GtkWidget *toolsDefaultEraser;
GtkWidget *buttonPageWidth;
GtkWidget *buttonZoomIn;
GtkWidget *buttonNormalSize;
+ GtkWidget *buttonZoomSet;
GtkWidget *tmp_image;
GtkWidget *buttonFullscreen;
GtkWidget *toolbarPen;
gtk_widget_show (fileNewBackground);
gtk_container_add (GTK_CONTAINER (menuFile_menu), fileNewBackground);
- image577 = gtk_image_new_from_stock ("gtk-open", GTK_ICON_SIZE_MENU);
- gtk_widget_show (image577);
- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (fileNewBackground), image577);
+ image599 = gtk_image_new_from_stock ("gtk-open", GTK_ICON_SIZE_MENU);
+ gtk_widget_show (image599);
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (fileNewBackground), image599);
fileOpen = gtk_image_menu_item_new_from_stock ("gtk-open", accel_group);
gtk_widget_show (fileOpen);
gtk_widget_show (filePrintOptions);
gtk_container_add (GTK_CONTAINER (menuFile_menu), filePrintOptions);
- image578 = gtk_image_new_from_stock ("gtk-preferences", GTK_ICON_SIZE_MENU);
- gtk_widget_show (image578);
- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (filePrintOptions), image578);
+ image600 = gtk_image_new_from_stock ("gtk-preferences", GTK_ICON_SIZE_MENU);
+ gtk_widget_show (image600);
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (filePrintOptions), image600);
filePrint = gtk_image_menu_item_new_from_stock ("gtk-print", accel_group);
gtk_widget_show (filePrint);
gtk_container_add (GTK_CONTAINER (menuFile_menu), filePrint);
- filePrintPDF = gtk_menu_item_new_with_mnemonic ("Print to PDF");
+ filePrintPDF = gtk_menu_item_new_with_mnemonic ("Export to PDF");
gtk_widget_show (filePrintPDF);
gtk_container_add (GTK_CONTAINER (menuFile_menu), filePrintPDF);
viewContinuous_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (viewContinuous));
gtk_widget_show (viewContinuous);
gtk_container_add (GTK_CONTAINER (menuView_menu), viewContinuous);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (viewContinuous), TRUE);
viewOnePage = gtk_radio_menu_item_new_with_mnemonic (viewContinuous_group, "One Page");
viewContinuous_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (viewOnePage));
gtk_widget_show (viewPageWidth);
gtk_container_add (GTK_CONTAINER (menuView_menu), viewPageWidth);
- image579 = gtk_image_new_from_stock ("gtk-zoom-fit", GTK_ICON_SIZE_MENU);
- gtk_widget_show (image579);
- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (viewPageWidth), image579);
+ image601 = gtk_image_new_from_stock ("gtk-zoom-fit", GTK_ICON_SIZE_MENU);
+ gtk_widget_show (image601);
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (viewPageWidth), image601);
+
+ viewSetZoom = gtk_menu_item_new_with_mnemonic ("Set Zoom");
+ gtk_widget_show (viewSetZoom);
+ gtk_container_add (GTK_CONTAINER (menuView_menu), viewSetZoom);
separator5 = gtk_separator_menu_item_new ();
gtk_widget_show (separator5);
gtk_widget_show (viewFirstPage);
gtk_container_add (GTK_CONTAINER (menuView_menu), viewFirstPage);
- image580 = gtk_image_new_from_stock ("gtk-goto-first", GTK_ICON_SIZE_MENU);
- gtk_widget_show (image580);
- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (viewFirstPage), image580);
+ image602 = gtk_image_new_from_stock ("gtk-goto-first", GTK_ICON_SIZE_MENU);
+ gtk_widget_show (image602);
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (viewFirstPage), image602);
viewPreviousPage = gtk_image_menu_item_new_with_mnemonic ("Previous Page");
gtk_widget_show (viewPreviousPage);
gtk_container_add (GTK_CONTAINER (menuView_menu), viewPreviousPage);
- image581 = gtk_image_new_from_stock ("gtk-go-back", GTK_ICON_SIZE_MENU);
- gtk_widget_show (image581);
- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (viewPreviousPage), image581);
+ image603 = gtk_image_new_from_stock ("gtk-go-back", GTK_ICON_SIZE_MENU);
+ gtk_widget_show (image603);
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (viewPreviousPage), image603);
viewNextPage = gtk_image_menu_item_new_with_mnemonic ("Next Page");
gtk_widget_show (viewNextPage);
gtk_container_add (GTK_CONTAINER (menuView_menu), viewNextPage);
- image582 = gtk_image_new_from_stock ("gtk-go-forward", GTK_ICON_SIZE_MENU);
- gtk_widget_show (image582);
- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (viewNextPage), image582);
+ image604 = gtk_image_new_from_stock ("gtk-go-forward", GTK_ICON_SIZE_MENU);
+ gtk_widget_show (image604);
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (viewNextPage), image604);
viewLastPage = gtk_image_menu_item_new_with_mnemonic ("Last Page");
gtk_widget_show (viewLastPage);
gtk_container_add (GTK_CONTAINER (menuView_menu), viewLastPage);
- image583 = gtk_image_new_from_stock ("gtk-goto-last", GTK_ICON_SIZE_MENU);
- gtk_widget_show (image583);
- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (viewLastPage), image583);
+ image605 = gtk_image_new_from_stock ("gtk-goto-last", GTK_ICON_SIZE_MENU);
+ gtk_widget_show (image605);
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (viewLastPage), image605);
separator6 = gtk_separator_menu_item_new ();
gtk_widget_show (separator6);
gtk_widget_show (viewShowLayer);
gtk_container_add (GTK_CONTAINER (menuView_menu), viewShowLayer);
- image584 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU);
- gtk_widget_show (image584);
- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (viewShowLayer), image584);
+ image606 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU);
+ gtk_widget_show (image606);
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (viewShowLayer), image606);
viewHideLayer = gtk_image_menu_item_new_with_mnemonic ("Hide Layer");
gtk_widget_show (viewHideLayer);
gtk_container_add (GTK_CONTAINER (menuView_menu), viewHideLayer);
- image585 = gtk_image_new_from_stock ("gtk-remove", GTK_ICON_SIZE_MENU);
- gtk_widget_show (image585);
- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (viewHideLayer), image585);
+ image607 = gtk_image_new_from_stock ("gtk-remove", GTK_ICON_SIZE_MENU);
+ gtk_widget_show (image607);
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (viewHideLayer), image607);
menuJournal = gtk_menu_item_new_with_mnemonic ("_Journal");
gtk_widget_show (menuJournal);
papercolorWhite_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (papercolorWhite));
gtk_widget_show (papercolorWhite);
gtk_container_add (GTK_CONTAINER (journalPaperColor_menu), papercolorWhite);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (papercolorWhite), TRUE);
papercolorYellow = gtk_radio_menu_item_new_with_mnemonic (papercolorWhite_group, "yellow paper");
papercolorWhite_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (papercolorYellow));
gtk_widget_show (papercolorYellow);
gtk_container_add (GTK_CONTAINER (journalPaperColor_menu), papercolorYellow);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (papercolorYellow), TRUE);
papercolorPink = gtk_radio_menu_item_new_with_mnemonic (papercolorWhite_group, "pink paper");
papercolorWhite_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (papercolorPink));
gtk_widget_show (papercolorPink);
gtk_container_add (GTK_CONTAINER (journalPaperColor_menu), papercolorPink);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (papercolorPink), TRUE);
papercolorOrange = gtk_radio_menu_item_new_with_mnemonic (papercolorWhite_group, "orange paper");
papercolorWhite_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (papercolorOrange));
gtk_widget_show (papercolorOrange);
gtk_container_add (GTK_CONTAINER (journalPaperColor_menu), papercolorOrange);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (papercolorOrange), TRUE);
papercolorBlue = gtk_radio_menu_item_new_with_mnemonic (papercolorWhite_group, "blue paper");
papercolorWhite_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (papercolorBlue));
gtk_widget_show (papercolorBlue);
gtk_container_add (GTK_CONTAINER (journalPaperColor_menu), papercolorBlue);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (papercolorBlue), TRUE);
papercolorGreen = gtk_radio_menu_item_new_with_mnemonic (papercolorWhite_group, "green paper");
papercolorWhite_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (papercolorGreen));
gtk_widget_show (papercolorGreen);
gtk_container_add (GTK_CONTAINER (journalPaperColor_menu), papercolorGreen);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (papercolorGreen), TRUE);
papercolorOther = gtk_radio_menu_item_new_with_mnemonic (papercolorWhite_group, "other...");
papercolorWhite_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (papercolorOther));
gtk_widget_show (papercolorOther);
gtk_container_add (GTK_CONTAINER (journalPaperColor_menu), papercolorOther);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (papercolorOther), TRUE);
papercolorNA = gtk_radio_menu_item_new_with_mnemonic (papercolorWhite_group, "NA");
papercolorWhite_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (papercolorNA));
paperstylePlain_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (paperstylePlain));
gtk_widget_show (paperstylePlain);
gtk_container_add (GTK_CONTAINER (journalPaperStyle_menu), paperstylePlain);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (paperstylePlain), TRUE);
paperstyleLined = gtk_radio_menu_item_new_with_mnemonic (paperstylePlain_group, "lined");
paperstylePlain_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (paperstyleLined));
gtk_widget_show (paperstyleLined);
gtk_container_add (GTK_CONTAINER (journalPaperStyle_menu), paperstyleLined);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (paperstyleLined), TRUE);
paperstyleRuled = gtk_radio_menu_item_new_with_mnemonic (paperstylePlain_group, "ruled");
paperstylePlain_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (paperstyleRuled));
gtk_widget_show (paperstyleRuled);
gtk_container_add (GTK_CONTAINER (journalPaperStyle_menu), paperstyleRuled);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (paperstyleRuled), TRUE);
paperstyleGraph = gtk_radio_menu_item_new_with_mnemonic (paperstylePlain_group, "graph");
paperstylePlain_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (paperstyleGraph));
gtk_widget_show (paperstyleGraph);
gtk_container_add (GTK_CONTAINER (journalPaperStyle_menu), paperstyleGraph);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (paperstyleGraph), TRUE);
paperstyleNA = gtk_radio_menu_item_new_with_mnemonic (paperstylePlain_group, "NA");
paperstylePlain_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (paperstyleNA));
gtk_widget_show (journalLoadBackground);
gtk_container_add (GTK_CONTAINER (menuJournal_menu), journalLoadBackground);
- image586 = gtk_image_new_from_stock ("gtk-open", GTK_ICON_SIZE_MENU);
- gtk_widget_show (image586);
- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (journalLoadBackground), image586);
+ image608 = gtk_image_new_from_stock ("gtk-open", GTK_ICON_SIZE_MENU);
+ gtk_widget_show (image608);
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (journalLoadBackground), image608);
journalScreenshot = gtk_menu_item_new_with_mnemonic ("Background Screenshot");
gtk_widget_show (journalScreenshot);
toolsPen_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (toolsPen));
gtk_widget_show (toolsPen);
gtk_container_add (GTK_CONTAINER (menuTools_menu), toolsPen);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (toolsPen), TRUE);
toolsEraser = gtk_radio_menu_item_new_with_mnemonic (toolsPen_group, "_Eraser");
toolsPen_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (toolsEraser));
gtk_widget_show (toolsEraser);
gtk_container_add (GTK_CONTAINER (menuTools_menu), toolsEraser);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (toolsEraser), TRUE);
toolsHighlighter = gtk_radio_menu_item_new_with_mnemonic (toolsPen_group, "_Highlighter");
toolsPen_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (toolsHighlighter));
gtk_widget_show (toolsHighlighter);
gtk_container_add (GTK_CONTAINER (menuTools_menu), toolsHighlighter);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (toolsHighlighter), TRUE);
toolsText = gtk_radio_menu_item_new_with_mnemonic (toolsPen_group, "_Text");
toolsPen_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (toolsText));
gtk_widget_show (toolsText);
gtk_container_add (GTK_CONTAINER (menuTools_menu), toolsText);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (toolsText), TRUE);
separator9 = gtk_separator_menu_item_new ();
gtk_widget_show (separator9);
toolsPen_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (toolsSelectRegion));
gtk_widget_show (toolsSelectRegion);
gtk_container_add (GTK_CONTAINER (menuTools_menu), toolsSelectRegion);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (toolsSelectRegion), TRUE);
toolsSelectRectangle = gtk_radio_menu_item_new_with_mnemonic (toolsPen_group, "Select Rectangle");
toolsPen_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (toolsSelectRectangle));
gtk_widget_show (toolsSelectRectangle);
gtk_container_add (GTK_CONTAINER (menuTools_menu), toolsSelectRectangle);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (toolsSelectRectangle), TRUE);
toolsVerticalSpace = gtk_radio_menu_item_new_with_mnemonic (toolsPen_group, "Vertical Space");
toolsPen_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (toolsVerticalSpace));
gtk_widget_show (toolsColor);
gtk_container_add (GTK_CONTAINER (menuTools_menu), toolsColor);
- image587 = gtk_image_new_from_stock ("gtk-select-color", GTK_ICON_SIZE_MENU);
- gtk_widget_show (image587);
- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (toolsColor), image587);
+ image609 = gtk_image_new_from_stock ("gtk-select-color", GTK_ICON_SIZE_MENU);
+ gtk_widget_show (image609);
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (toolsColor), image609);
toolsColor_menu = gtk_menu_new ();
gtk_menu_item_set_submenu (GTK_MENU_ITEM (toolsColor), toolsColor_menu);
colorBlack_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (colorBlack));
gtk_widget_show (colorBlack);
gtk_container_add (GTK_CONTAINER (toolsColor_menu), colorBlack);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (colorBlack), TRUE);
colorBlue = gtk_radio_menu_item_new_with_mnemonic (colorBlack_group, "blue");
colorBlack_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (colorBlue));
gtk_widget_show (colorBlue);
gtk_container_add (GTK_CONTAINER (toolsColor_menu), colorBlue);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (colorBlue), TRUE);
colorRed = gtk_radio_menu_item_new_with_mnemonic (colorBlack_group, "red");
colorBlack_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (colorRed));
gtk_widget_show (colorRed);
gtk_container_add (GTK_CONTAINER (toolsColor_menu), colorRed);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (colorRed), TRUE);
colorGreen = gtk_radio_menu_item_new_with_mnemonic (colorBlack_group, "green");
colorBlack_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (colorGreen));
gtk_widget_show (colorGreen);
gtk_container_add (GTK_CONTAINER (toolsColor_menu), colorGreen);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (colorGreen), TRUE);
colorGray = gtk_radio_menu_item_new_with_mnemonic (colorBlack_group, "gray");
colorBlack_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (colorGray));
gtk_widget_show (colorGray);
gtk_container_add (GTK_CONTAINER (toolsColor_menu), colorGray);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (colorGray), TRUE);
separator17 = gtk_separator_menu_item_new ();
gtk_widget_show (separator17);
colorBlack_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (colorLightBlue));
gtk_widget_show (colorLightBlue);
gtk_container_add (GTK_CONTAINER (toolsColor_menu), colorLightBlue);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (colorLightBlue), TRUE);
colorLightGreen = gtk_radio_menu_item_new_with_mnemonic (colorBlack_group, "light green");
colorBlack_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (colorLightGreen));
gtk_widget_show (colorLightGreen);
gtk_container_add (GTK_CONTAINER (toolsColor_menu), colorLightGreen);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (colorLightGreen), TRUE);
colorMagenta = gtk_radio_menu_item_new_with_mnemonic (colorBlack_group, "magenta");
colorBlack_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (colorMagenta));
gtk_widget_show (colorMagenta);
gtk_container_add (GTK_CONTAINER (toolsColor_menu), colorMagenta);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (colorMagenta), TRUE);
colorOrange = gtk_radio_menu_item_new_with_mnemonic (colorBlack_group, "orange");
colorBlack_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (colorOrange));
gtk_widget_show (colorOrange);
gtk_container_add (GTK_CONTAINER (toolsColor_menu), colorOrange);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (colorOrange), TRUE);
colorYellow = gtk_radio_menu_item_new_with_mnemonic (colorBlack_group, "yellow");
colorBlack_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (colorYellow));
gtk_widget_show (colorYellow);
gtk_container_add (GTK_CONTAINER (toolsColor_menu), colorYellow);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (colorYellow), TRUE);
colorWhite = gtk_radio_menu_item_new_with_mnemonic (colorBlack_group, "white");
colorBlack_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (colorWhite));
gtk_widget_show (colorWhite);
gtk_container_add (GTK_CONTAINER (toolsColor_menu), colorWhite);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (colorWhite), TRUE);
colorOther = gtk_radio_menu_item_new_with_mnemonic (colorBlack_group, "other...");
colorBlack_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (colorOther));
gtk_widget_show (colorOther);
gtk_container_add (GTK_CONTAINER (toolsColor_menu), colorOther);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (colorOther), TRUE);
colorNA = gtk_radio_menu_item_new_with_mnemonic (colorBlack_group, "NA");
colorBlack_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (colorNA));
penthicknessVeryFine_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (penthicknessVeryFine));
gtk_widget_show (penthicknessVeryFine);
gtk_container_add (GTK_CONTAINER (toolsPenOptions_menu), penthicknessVeryFine);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (penthicknessVeryFine), TRUE);
penthicknessFine = gtk_radio_menu_item_new_with_mnemonic (penthicknessVeryFine_group, "fine");
penthicknessVeryFine_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (penthicknessFine));
gtk_widget_show (penthicknessFine);
gtk_container_add (GTK_CONTAINER (toolsPenOptions_menu), penthicknessFine);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (penthicknessFine), TRUE);
penthicknessMedium = gtk_radio_menu_item_new_with_mnemonic (penthicknessVeryFine_group, "medium");
penthicknessVeryFine_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (penthicknessMedium));
gtk_widget_show (penthicknessMedium);
gtk_container_add (GTK_CONTAINER (toolsPenOptions_menu), penthicknessMedium);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (penthicknessMedium), TRUE);
penthicknessThick = gtk_radio_menu_item_new_with_mnemonic (penthicknessVeryFine_group, "thick");
penthicknessVeryFine_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (penthicknessThick));
gtk_widget_show (penthicknessThick);
gtk_container_add (GTK_CONTAINER (toolsPenOptions_menu), penthicknessThick);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (penthicknessThick), TRUE);
penthicknessVeryThick = gtk_radio_menu_item_new_with_mnemonic (penthicknessVeryFine_group, "very thick");
penthicknessVeryFine_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (penthicknessVeryThick));
eraserFine_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (eraserFine));
gtk_widget_show (eraserFine);
gtk_container_add (GTK_CONTAINER (toolsEraserOptions_menu), eraserFine);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (eraserFine), TRUE);
eraserMedium = gtk_radio_menu_item_new_with_mnemonic (eraserFine_group, "medium");
eraserFine_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (eraserMedium));
gtk_widget_show (eraserMedium);
gtk_container_add (GTK_CONTAINER (toolsEraserOptions_menu), eraserMedium);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (eraserMedium), TRUE);
eraserThick = gtk_radio_menu_item_new_with_mnemonic (eraserFine_group, "thick");
eraserFine_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (eraserThick));
eraserStandard_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (eraserStandard));
gtk_widget_show (eraserStandard);
gtk_container_add (GTK_CONTAINER (toolsEraserOptions_menu), eraserStandard);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (eraserStandard), TRUE);
eraserWhiteout = gtk_radio_menu_item_new_with_mnemonic (eraserStandard_group, "whiteout");
eraserStandard_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (eraserWhiteout));
gtk_widget_show (eraserWhiteout);
gtk_container_add (GTK_CONTAINER (toolsEraserOptions_menu), eraserWhiteout);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (eraserWhiteout), TRUE);
eraserDeleteStrokes = gtk_radio_menu_item_new_with_mnemonic (eraserStandard_group, "delete strokes");
eraserStandard_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (eraserDeleteStrokes));
highlighterFine_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (highlighterFine));
gtk_widget_show (highlighterFine);
gtk_container_add (GTK_CONTAINER (toolsHighlighterOptions_menu), highlighterFine);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (highlighterFine), TRUE);
highlighterMedium = gtk_radio_menu_item_new_with_mnemonic (highlighterFine_group, "medium");
highlighterFine_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (highlighterMedium));
gtk_widget_show (highlighterMedium);
gtk_container_add (GTK_CONTAINER (toolsHighlighterOptions_menu), highlighterMedium);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (highlighterMedium), TRUE);
highlighterThick = gtk_radio_menu_item_new_with_mnemonic (highlighterFine_group, "thick");
highlighterFine_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (highlighterThick));
gtk_widget_show (toolsTextFont);
gtk_container_add (GTK_CONTAINER (menuTools_menu), toolsTextFont);
- image588 = gtk_image_new_from_stock ("gtk-select-font", GTK_ICON_SIZE_MENU);
- gtk_widget_show (image588);
- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (toolsTextFont), image588);
+ image610 = gtk_image_new_from_stock ("gtk-select-font", GTK_ICON_SIZE_MENU);
+ gtk_widget_show (image610);
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (toolsTextFont), image610);
separator10 = gtk_separator_menu_item_new ();
gtk_widget_show (separator10);
button2Pen_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (button2Eraser));
gtk_widget_show (button2Eraser);
gtk_container_add (GTK_CONTAINER (button2_mapping_menu), button2Eraser);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (button2Eraser), TRUE);
button2Highlighter = gtk_radio_menu_item_new_with_mnemonic (button2Pen_group, "Highlighter");
button2Pen_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (button2Highlighter));
gtk_widget_show (button2Highlighter);
gtk_container_add (GTK_CONTAINER (button2_mapping_menu), button2Highlighter);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (button2Highlighter), TRUE);
button2Text = gtk_radio_menu_item_new_with_mnemonic (button2Pen_group, "Text");
button2Pen_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (button2Text));
gtk_widget_show (button2Text);
gtk_container_add (GTK_CONTAINER (button2_mapping_menu), button2Text);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (button2Text), TRUE);
button2SelectRegion = gtk_radio_menu_item_new_with_mnemonic (button2Pen_group, "Select Region");
button2Pen_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (button2SelectRegion));
gtk_widget_show (button2SelectRegion);
gtk_container_add (GTK_CONTAINER (button2_mapping_menu), button2SelectRegion);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (button2SelectRegion), TRUE);
button2SelectRectangle = gtk_radio_menu_item_new_with_mnemonic (button2Pen_group, "Select Rectangle");
button2Pen_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (button2SelectRectangle));
gtk_widget_show (button2SelectRectangle);
gtk_container_add (GTK_CONTAINER (button2_mapping_menu), button2SelectRectangle);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (button2SelectRectangle), TRUE);
button2VerticalSpace = gtk_radio_menu_item_new_with_mnemonic (button2Pen_group, "Vertical Space");
button2Pen_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (button2VerticalSpace));
gtk_widget_show (button2VerticalSpace);
gtk_container_add (GTK_CONTAINER (button2_mapping_menu), button2VerticalSpace);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (button2VerticalSpace), TRUE);
separator24 = gtk_separator_menu_item_new ();
gtk_widget_show (separator24);
button2LinkBrush_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (button2LinkBrush));
gtk_widget_show (button2LinkBrush);
gtk_container_add (GTK_CONTAINER (button2_mapping_menu), button2LinkBrush);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (button2LinkBrush), TRUE);
button2CopyBrush = gtk_radio_menu_item_new_with_mnemonic (button2LinkBrush_group, "Copy of Current Brush");
button2LinkBrush_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (button2CopyBrush));
gtk_widget_show (button2CopyBrush);
gtk_container_add (GTK_CONTAINER (button2_mapping_menu), button2CopyBrush);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (button2CopyBrush), TRUE);
button2NABrush = gtk_radio_menu_item_new_with_mnemonic (button2LinkBrush_group, "NA");
button2LinkBrush_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (button2NABrush));
gtk_container_add (GTK_CONTAINER (button2_mapping_menu), button2NABrush);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (button2NABrush), TRUE);
button3_mapping = gtk_menu_item_new_with_mnemonic ("Button 3 Mapping");
gtk_widget_show (button3_mapping);
button3Pen_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (button3Eraser));
gtk_widget_show (button3Eraser);
gtk_container_add (GTK_CONTAINER (button3_mapping_menu), button3Eraser);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (button3Eraser), TRUE);
button3Highlighter = gtk_radio_menu_item_new_with_mnemonic (button3Pen_group, "Highlighter");
button3Pen_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (button3Highlighter));
gtk_widget_show (button3Highlighter);
gtk_container_add (GTK_CONTAINER (button3_mapping_menu), button3Highlighter);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (button3Highlighter), TRUE);
button3Text = gtk_radio_menu_item_new_with_mnemonic (button3Pen_group, "Text");
button3Pen_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (button3Text));
gtk_widget_show (button3Text);
gtk_container_add (GTK_CONTAINER (button3_mapping_menu), button3Text);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (button3Text), TRUE);
button3SelectRegion = gtk_radio_menu_item_new_with_mnemonic (button3Pen_group, "Select Region");
button3Pen_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (button3SelectRegion));
gtk_widget_show (button3SelectRegion);
gtk_container_add (GTK_CONTAINER (button3_mapping_menu), button3SelectRegion);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (button3SelectRegion), TRUE);
button3SelectRectangle = gtk_radio_menu_item_new_with_mnemonic (button3Pen_group, "Select Rectangle");
button3Pen_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (button3SelectRectangle));
gtk_widget_show (button3SelectRectangle);
gtk_container_add (GTK_CONTAINER (button3_mapping_menu), button3SelectRectangle);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (button3SelectRectangle), TRUE);
button3VerticalSpace = gtk_radio_menu_item_new_with_mnemonic (button3Pen_group, "Vertical Space");
button3Pen_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (button3VerticalSpace));
gtk_widget_show (button3VerticalSpace);
gtk_container_add (GTK_CONTAINER (button3_mapping_menu), button3VerticalSpace);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (button3VerticalSpace), TRUE);
separator25 = gtk_separator_menu_item_new ();
gtk_widget_show (separator25);
button3LinkBrush_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (button3LinkBrush));
gtk_widget_show (button3LinkBrush);
gtk_container_add (GTK_CONTAINER (button3_mapping_menu), button3LinkBrush);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (button3LinkBrush), TRUE);
button3CopyBrush = gtk_radio_menu_item_new_with_mnemonic (button3LinkBrush_group, "Copy of Current Brush");
button3LinkBrush_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (button3CopyBrush));
gtk_widget_show (button3CopyBrush);
gtk_container_add (GTK_CONTAINER (button3_mapping_menu), button3CopyBrush);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (button3CopyBrush), TRUE);
button3NABrush = gtk_radio_menu_item_new_with_mnemonic (button3LinkBrush_group, "NA");
button3LinkBrush_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (button3NABrush));
gtk_container_add (GTK_CONTAINER (button3_mapping_menu), button3NABrush);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (button3NABrush), TRUE);
separator18 = gtk_separator_menu_item_new ();
gtk_widget_show (separator18);
gtk_container_add (GTK_CONTAINER (toolbarMain), buttonNormalSize);
gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (buttonNormalSize), tooltips, "Normal Size", NULL);
+ buttonZoomSet = (GtkWidget*) gtk_tool_button_new_from_stock ("gtk-find");
+ gtk_widget_show (buttonZoomSet);
+ gtk_container_add (GTK_CONTAINER (toolbarMain), buttonZoomSet);
+ gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (buttonZoomSet), tooltips, "Set Zoom", NULL);
+
buttonFullscreen = (GtkWidget*) gtk_toggle_tool_button_new ();
gtk_tool_button_set_label (GTK_TOOL_BUTTON (buttonFullscreen), "");
tmp_image = create_pixmap (winMain, "fullscreen.png");
g_signal_connect ((gpointer) viewPageWidth, "activate",
G_CALLBACK (on_viewPageWidth_activate),
NULL);
+ g_signal_connect ((gpointer) viewSetZoom, "activate",
+ G_CALLBACK (on_viewSetZoom_activate),
+ NULL);
g_signal_connect ((gpointer) viewFirstPage, "activate",
G_CALLBACK (on_viewFirstPage_activate),
NULL);
g_signal_connect ((gpointer) buttonNormalSize, "clicked",
G_CALLBACK (on_viewNormalSize_activate),
NULL);
+ g_signal_connect ((gpointer) buttonZoomSet, "clicked",
+ G_CALLBACK (on_viewSetZoom_activate),
+ NULL);
g_signal_connect ((gpointer) buttonFullscreen, "toggled",
G_CALLBACK (on_viewFullscreen_activate),
NULL);
GLADE_HOOKUP_OBJECT (winMain, menuFile_menu, "menuFile_menu");
GLADE_HOOKUP_OBJECT (winMain, fileNew, "fileNew");
GLADE_HOOKUP_OBJECT (winMain, fileNewBackground, "fileNewBackground");
- GLADE_HOOKUP_OBJECT (winMain, image577, "image577");
+ GLADE_HOOKUP_OBJECT (winMain, image599, "image599");
GLADE_HOOKUP_OBJECT (winMain, fileOpen, "fileOpen");
GLADE_HOOKUP_OBJECT (winMain, fileSave, "fileSave");
GLADE_HOOKUP_OBJECT (winMain, fileSaveAs, "fileSaveAs");
GLADE_HOOKUP_OBJECT (winMain, mru7, "mru7");
GLADE_HOOKUP_OBJECT (winMain, separator22, "separator22");
GLADE_HOOKUP_OBJECT (winMain, filePrintOptions, "filePrintOptions");
- GLADE_HOOKUP_OBJECT (winMain, image578, "image578");
+ GLADE_HOOKUP_OBJECT (winMain, image600, "image600");
GLADE_HOOKUP_OBJECT (winMain, filePrint, "filePrint");
GLADE_HOOKUP_OBJECT (winMain, filePrintPDF, "filePrintPDF");
GLADE_HOOKUP_OBJECT (winMain, separator2, "separator2");
GLADE_HOOKUP_OBJECT (winMain, viewZoomOut, "viewZoomOut");
GLADE_HOOKUP_OBJECT (winMain, viewNormalSize, "viewNormalSize");
GLADE_HOOKUP_OBJECT (winMain, viewPageWidth, "viewPageWidth");
- GLADE_HOOKUP_OBJECT (winMain, image579, "image579");
+ GLADE_HOOKUP_OBJECT (winMain, image601, "image601");
+ GLADE_HOOKUP_OBJECT (winMain, viewSetZoom, "viewSetZoom");
GLADE_HOOKUP_OBJECT (winMain, separator5, "separator5");
GLADE_HOOKUP_OBJECT (winMain, viewFirstPage, "viewFirstPage");
- GLADE_HOOKUP_OBJECT (winMain, image580, "image580");
+ GLADE_HOOKUP_OBJECT (winMain, image602, "image602");
GLADE_HOOKUP_OBJECT (winMain, viewPreviousPage, "viewPreviousPage");
- GLADE_HOOKUP_OBJECT (winMain, image581, "image581");
+ GLADE_HOOKUP_OBJECT (winMain, image603, "image603");
GLADE_HOOKUP_OBJECT (winMain, viewNextPage, "viewNextPage");
- GLADE_HOOKUP_OBJECT (winMain, image582, "image582");
+ GLADE_HOOKUP_OBJECT (winMain, image604, "image604");
GLADE_HOOKUP_OBJECT (winMain, viewLastPage, "viewLastPage");
- GLADE_HOOKUP_OBJECT (winMain, image583, "image583");
+ GLADE_HOOKUP_OBJECT (winMain, image605, "image605");
GLADE_HOOKUP_OBJECT (winMain, separator6, "separator6");
GLADE_HOOKUP_OBJECT (winMain, viewShowLayer, "viewShowLayer");
- GLADE_HOOKUP_OBJECT (winMain, image584, "image584");
+ GLADE_HOOKUP_OBJECT (winMain, image606, "image606");
GLADE_HOOKUP_OBJECT (winMain, viewHideLayer, "viewHideLayer");
- GLADE_HOOKUP_OBJECT (winMain, image585, "image585");
+ GLADE_HOOKUP_OBJECT (winMain, image607, "image607");
GLADE_HOOKUP_OBJECT (winMain, menuJournal, "menuJournal");
GLADE_HOOKUP_OBJECT (winMain, menuJournal_menu, "menuJournal_menu");
GLADE_HOOKUP_OBJECT (winMain, journalNewPageBefore, "journalNewPageBefore");
GLADE_HOOKUP_OBJECT (winMain, journalApplyAllPages, "journalApplyAllPages");
GLADE_HOOKUP_OBJECT (winMain, separator23, "separator23");
GLADE_HOOKUP_OBJECT (winMain, journalLoadBackground, "journalLoadBackground");
- GLADE_HOOKUP_OBJECT (winMain, image586, "image586");
+ GLADE_HOOKUP_OBJECT (winMain, image608, "image608");
GLADE_HOOKUP_OBJECT (winMain, journalScreenshot, "journalScreenshot");
GLADE_HOOKUP_OBJECT (winMain, separator19, "separator19");
GLADE_HOOKUP_OBJECT (winMain, journalDefaultBackground, "journalDefaultBackground");
GLADE_HOOKUP_OBJECT (winMain, toolsVerticalSpace, "toolsVerticalSpace");
GLADE_HOOKUP_OBJECT (winMain, separator16, "separator16");
GLADE_HOOKUP_OBJECT (winMain, toolsColor, "toolsColor");
- GLADE_HOOKUP_OBJECT (winMain, image587, "image587");
+ GLADE_HOOKUP_OBJECT (winMain, image609, "image609");
GLADE_HOOKUP_OBJECT (winMain, toolsColor_menu, "toolsColor_menu");
GLADE_HOOKUP_OBJECT (winMain, colorBlack, "colorBlack");
GLADE_HOOKUP_OBJECT (winMain, colorBlue, "colorBlue");
GLADE_HOOKUP_OBJECT (winMain, highlighterMedium, "highlighterMedium");
GLADE_HOOKUP_OBJECT (winMain, highlighterThick, "highlighterThick");
GLADE_HOOKUP_OBJECT (winMain, toolsTextFont, "toolsTextFont");
- GLADE_HOOKUP_OBJECT (winMain, image588, "image588");
+ GLADE_HOOKUP_OBJECT (winMain, image610, "image610");
GLADE_HOOKUP_OBJECT (winMain, separator10, "separator10");
GLADE_HOOKUP_OBJECT (winMain, toolsDefaultPen, "toolsDefaultPen");
GLADE_HOOKUP_OBJECT (winMain, toolsDefaultEraser, "toolsDefaultEraser");
GLADE_HOOKUP_OBJECT (winMain, buttonPageWidth, "buttonPageWidth");
GLADE_HOOKUP_OBJECT (winMain, buttonZoomIn, "buttonZoomIn");
GLADE_HOOKUP_OBJECT (winMain, buttonNormalSize, "buttonNormalSize");
+ GLADE_HOOKUP_OBJECT (winMain, buttonZoomSet, "buttonZoomSet");
GLADE_HOOKUP_OBJECT (winMain, buttonFullscreen, "buttonFullscreen");
GLADE_HOOKUP_OBJECT (winMain, toolbarPen, "toolbarPen");
GLADE_HOOKUP_OBJECT (winMain, buttonPen, "buttonPen");
return aboutDialog;
}
+GtkWidget*
+create_zoomDialog (void)
+{
+ GtkWidget *zoomDialog;
+ GtkWidget *dialog_vbox3;
+ GtkWidget *vbox1;
+ GtkWidget *hbox4;
+ GtkWidget *radioZoom;
+ GSList *radioZoom_group = NULL;
+ GtkObject *spinZoom_adj;
+ GtkWidget *spinZoom;
+ GtkWidget *label1;
+ GtkWidget *radioZoom100;
+ GtkWidget *radioZoomWidth;
+ GtkWidget *radioZoomHeight;
+ GtkWidget *dialog_action_area3;
+ GtkWidget *cancelbutton2;
+ GtkWidget *button1;
+ GtkWidget *button2;
+
+ zoomDialog = gtk_dialog_new ();
+ gtk_window_set_title (GTK_WINDOW (zoomDialog), "Set Zoom");
+ gtk_window_set_modal (GTK_WINDOW (zoomDialog), TRUE);
+ gtk_window_set_type_hint (GTK_WINDOW (zoomDialog), GDK_WINDOW_TYPE_HINT_DIALOG);
+
+ dialog_vbox3 = GTK_DIALOG (zoomDialog)->vbox;
+ gtk_widget_show (dialog_vbox3);
+
+ vbox1 = gtk_vbox_new (FALSE, 2);
+ gtk_widget_show (vbox1);
+ gtk_box_pack_start (GTK_BOX (dialog_vbox3), vbox1, FALSE, FALSE, 0);
+ gtk_container_set_border_width (GTK_CONTAINER (vbox1), 8);
+
+ hbox4 = gtk_hbox_new (FALSE, 0);
+ gtk_widget_show (hbox4);
+ gtk_box_pack_start (GTK_BOX (vbox1), hbox4, FALSE, FALSE, 0);
+
+ radioZoom = gtk_radio_button_new_with_mnemonic (NULL, "Zoom: ");
+ gtk_widget_show (radioZoom);
+ gtk_box_pack_start (GTK_BOX (hbox4), radioZoom, FALSE, FALSE, 0);
+ gtk_container_set_border_width (GTK_CONTAINER (radioZoom), 4);
+ gtk_radio_button_set_group (GTK_RADIO_BUTTON (radioZoom), radioZoom_group);
+ radioZoom_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radioZoom));
+
+ spinZoom_adj = gtk_adjustment_new (100, 10, 1500, 5, 20, 20);
+ spinZoom = gtk_spin_button_new (GTK_ADJUSTMENT (spinZoom_adj), 1, 0);
+ gtk_widget_show (spinZoom);
+ gtk_box_pack_start (GTK_BOX (hbox4), spinZoom, FALSE, TRUE, 5);
+ gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinZoom), TRUE);
+
+ label1 = gtk_label_new ("%");
+ gtk_widget_show (label1);
+ gtk_box_pack_start (GTK_BOX (hbox4), label1, FALSE, TRUE, 0);
+ gtk_misc_set_alignment (GTK_MISC (label1), 0.48, 0.5);
+
+ radioZoom100 = gtk_radio_button_new_with_mnemonic (NULL, "Normal size (100%)");
+ gtk_widget_show (radioZoom100);
+ gtk_box_pack_start (GTK_BOX (vbox1), radioZoom100, FALSE, FALSE, 0);
+ gtk_container_set_border_width (GTK_CONTAINER (radioZoom100), 4);
+ gtk_radio_button_set_group (GTK_RADIO_BUTTON (radioZoom100), radioZoom_group);
+ radioZoom_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radioZoom100));
+
+ radioZoomWidth = gtk_radio_button_new_with_mnemonic (NULL, "Page Width");
+ gtk_widget_show (radioZoomWidth);
+ gtk_box_pack_start (GTK_BOX (vbox1), radioZoomWidth, FALSE, FALSE, 0);
+ gtk_container_set_border_width (GTK_CONTAINER (radioZoomWidth), 4);
+ gtk_radio_button_set_group (GTK_RADIO_BUTTON (radioZoomWidth), radioZoom_group);
+ radioZoom_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radioZoomWidth));
+
+ radioZoomHeight = gtk_radio_button_new_with_mnemonic (NULL, "Page Height");
+ gtk_widget_show (radioZoomHeight);
+ gtk_box_pack_start (GTK_BOX (vbox1), radioZoomHeight, FALSE, FALSE, 0);
+ gtk_container_set_border_width (GTK_CONTAINER (radioZoomHeight), 4);
+ gtk_radio_button_set_group (GTK_RADIO_BUTTON (radioZoomHeight), radioZoom_group);
+ radioZoom_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radioZoomHeight));
+
+ dialog_action_area3 = GTK_DIALOG (zoomDialog)->action_area;
+ gtk_widget_show (dialog_action_area3);
+ gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area3), GTK_BUTTONBOX_END);
+
+ cancelbutton2 = gtk_button_new_from_stock ("gtk-cancel");
+ gtk_widget_show (cancelbutton2);
+ gtk_dialog_add_action_widget (GTK_DIALOG (zoomDialog), cancelbutton2, GTK_RESPONSE_CANCEL);
+ GTK_WIDGET_SET_FLAGS (cancelbutton2, GTK_CAN_DEFAULT);
+
+ button1 = gtk_button_new_from_stock ("gtk-apply");
+ gtk_widget_show (button1);
+ gtk_dialog_add_action_widget (GTK_DIALOG (zoomDialog), button1, GTK_RESPONSE_APPLY);
+ GTK_WIDGET_SET_FLAGS (button1, GTK_CAN_DEFAULT);
+
+ button2 = gtk_button_new_from_stock ("gtk-ok");
+ gtk_widget_show (button2);
+ gtk_dialog_add_action_widget (GTK_DIALOG (zoomDialog), button2, GTK_RESPONSE_OK);
+ GTK_WIDGET_SET_FLAGS (button2, GTK_CAN_DEFAULT);
+
+ g_signal_connect ((gpointer) radioZoom, "toggled",
+ G_CALLBACK (on_radioZoom_toggled),
+ NULL);
+ g_signal_connect ((gpointer) spinZoom, "value_changed",
+ G_CALLBACK (on_spinZoom_value_changed),
+ NULL);
+ g_signal_connect ((gpointer) radioZoom100, "toggled",
+ G_CALLBACK (on_radioZoom100_toggled),
+ NULL);
+ g_signal_connect ((gpointer) radioZoomWidth, "toggled",
+ G_CALLBACK (on_radioZoomWidth_toggled),
+ NULL);
+ g_signal_connect ((gpointer) radioZoomHeight, "toggled",
+ G_CALLBACK (on_radioZoomHeight_toggled),
+ NULL);
+
+ /* Store pointers to all widgets, for use by lookup_widget(). */
+ GLADE_HOOKUP_OBJECT_NO_REF (zoomDialog, zoomDialog, "zoomDialog");
+ GLADE_HOOKUP_OBJECT_NO_REF (zoomDialog, dialog_vbox3, "dialog_vbox3");
+ GLADE_HOOKUP_OBJECT (zoomDialog, vbox1, "vbox1");
+ GLADE_HOOKUP_OBJECT (zoomDialog, hbox4, "hbox4");
+ GLADE_HOOKUP_OBJECT (zoomDialog, radioZoom, "radioZoom");
+ GLADE_HOOKUP_OBJECT (zoomDialog, spinZoom, "spinZoom");
+ GLADE_HOOKUP_OBJECT (zoomDialog, label1, "label1");
+ GLADE_HOOKUP_OBJECT (zoomDialog, radioZoom100, "radioZoom100");
+ GLADE_HOOKUP_OBJECT (zoomDialog, radioZoomWidth, "radioZoomWidth");
+ GLADE_HOOKUP_OBJECT (zoomDialog, radioZoomHeight, "radioZoomHeight");
+ GLADE_HOOKUP_OBJECT_NO_REF (zoomDialog, dialog_action_area3, "dialog_action_area3");
+ GLADE_HOOKUP_OBJECT (zoomDialog, cancelbutton2, "cancelbutton2");
+ GLADE_HOOKUP_OBJECT (zoomDialog, button1, "button1");
+ GLADE_HOOKUP_OBJECT (zoomDialog, button2, "button2");
+
+ return zoomDialog;
+}
+
GtkWidget* create_colorChooserDialog (void);
GtkWidget* create_papersizeDialog (void);
GtkWidget* create_aboutDialog (void);
+GtkWidget* create_zoomDialog (void);
+// comment out the line below if you want the thickness settings of v 0.2
+#define NEW_THICKNESS
+
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
0xffffffff, 0xa0e8ffff, 0x80ffc0ff, 0xffc0d4ff,
0xffc080ff, 0xffff80ff, 0xffffffff };
+#ifdef NEW_THICKNESS
+double predef_thickness[NUM_STROKE_TOOLS][THICKNESS_MAX] =
+ { { 0.42, 0.85, 1.41, 2.26, 5.67 }, // pen thicknesses = 0.15, 0.3, 0.5, 0.8, 2 mm
+ { 2.83, 2.83, 8.50, 19.84, 19.84 }, // eraser thicknesses = 1, 2.5, 5 mm
+ { 2.83, 2.83, 8.50, 19.84, 19.84 }, // highlighter thicknesses = 1, 2.5, 5 mm
+ };
+#else
double predef_thickness[NUM_STROKE_TOOLS][THICKNESS_MAX] =
{ { 0.42, 0.85, 1.41, 2.26, 5.67 }, // pen thicknesses = 0.15, 0.3, 0.5, 0.8, 2 mm
{ 2.83, 2.83, 7.08, 14.17, 14.17 }, // eraser thicknesses = 1, 2.5, 5 mm
{ 2.83, 2.83, 7.08, 14.17, 14.17 }, // highlighter thicknesses = 1, 2.5, 5 mm
};
+#endif
// some manipulation functions
#define RULING_MARGIN_COLOR 0xff0080ff
#define RULING_COLOR 0x40a0ffff
#define RULING_THICKNESS 0.5
-#define RULING_LEFTMARGIN 72
-#define RULING_TOPMARGIN 80
-#define RULING_SPACING 24
+#define RULING_LEFTMARGIN 72.0
+#define RULING_TOPMARGIN 80.0
+#define RULING_SPACING 24.0
#define RULING_BOTTOMMARGIN RULING_SPACING
#define RULING_GRAPHSPACING 14.17
gdk_cursor_unref(ui.cursor);
ui.cursor = NULL;
}
- if (ui.cur_item_type == ITEM_MOVESEL) {
- if (ui.toolno[ui.cur_mapping] == TOOL_VERTSPACE)
- ui.cursor = gdk_cursor_new(GDK_SB_V_DOUBLE_ARROW);
- else
- ui.cursor = gdk_cursor_new(GDK_FLEUR);
- }
+ if (ui.cur_item_type == ITEM_MOVESEL_VERT)
+ ui.cursor = gdk_cursor_new(GDK_SB_V_DOUBLE_ARROW);
+ else if (ui.cur_item_type == ITEM_MOVESEL)
+ ui.cursor = gdk_cursor_new(GDK_FLEUR);
else if (ui.toolno[ui.cur_mapping] == TOOL_PEN) {
fg.red = (ui.cur_brush->color_rgba >> 16) & 0xff00;
fg.green = (ui.cur_brush->color_rgba >> 8) & 0xff00;
#include <gtk/gtk.h>
#include <libgnomecanvas/libgnomecanvas.h>
#include <libgnomeprint/gnome-print-job.h>
+#include <zlib.h>
+#include <string.h>
#include "xournal.h"
#include "xo-misc.h"
#define RGBA_ALPHA(rgba) (((rgba>>0)&0xff)/255.0)
#define RGBA_RGB(rgba) RGBA_RED(rgba), RGBA_GREEN(rgba), RGBA_BLUE(rgba)
+/*********** Printing to PDF ************/
+
+gboolean ispdfspace(char c)
+{
+ return (c==0 || c==9 || c==10 || c==12 || c==13 || c==' ');
+}
+
+gboolean ispdfdelim(char c)
+{
+ return (c=='(' || c==')' || c=='<' || c=='>' || c=='[' || c==']' ||
+ c=='{' || c=='}' || c=='/' || c=='%');
+}
+
+void skipspace(char **p, char *eof)
+{
+ while (ispdfspace(**p) || **p=='%') {
+ if (**p=='%') while (*p!=eof && **p!=10 && **p!=13) (*p)++;
+ if (*p==eof) return;
+ (*p)++;
+ }
+}
+
+void free_pdfobj(struct PdfObj *obj)
+{
+ int i;
+
+ if (obj==NULL) return;
+ if ((obj->type == PDFTYPE_STRING || obj->type == PDFTYPE_NAME ||
+ obj->type == PDFTYPE_STREAM) && obj->str!=NULL)
+ g_free(obj->str);
+ if ((obj->type == PDFTYPE_ARRAY || obj->type == PDFTYPE_DICT ||
+ obj->type == PDFTYPE_STREAM) && obj->num>0) {
+ for (i=0; i<obj->num; i++)
+ free_pdfobj(obj->elts[i]);
+ g_free(obj->elts);
+ }
+ if ((obj->type == PDFTYPE_DICT || obj->type == PDFTYPE_STREAM) && obj->num>0) {
+ for (i=0; i<obj->num; i++)
+ g_free(obj->names[i]);
+ g_free(obj->names);
+ }
+ g_free(obj);
+}
+
+struct PdfObj *dup_pdfobj(struct PdfObj *obj)
+{
+ struct PdfObj *dup;
+ int i;
+
+ if (obj==NULL) return NULL;
+ dup = g_memdup(obj, sizeof(struct PdfObj));
+ if ((obj->type == PDFTYPE_STRING || obj->type == PDFTYPE_NAME ||
+ obj->type == PDFTYPE_STREAM) && obj->str!=NULL) {
+ if (obj->type == PDFTYPE_NAME) obj->len = strlen(obj->str);
+ dup->str = g_memdup(obj->str, obj->len+1);
+ }
+ if ((obj->type == PDFTYPE_ARRAY || obj->type == PDFTYPE_DICT ||
+ obj->type == PDFTYPE_STREAM) && obj->num>0) {
+ dup->elts = g_malloc(obj->num*sizeof(struct PdfObj *));
+ for (i=0; i<obj->num; i++)
+ dup->elts[i] = dup_pdfobj(obj->elts[i]);
+ }
+ if ((obj->type == PDFTYPE_DICT || obj->type == PDFTYPE_STREAM) && obj->num>0) {
+ dup->names = g_malloc(obj->num*sizeof(char *));
+ for (i=0; i<obj->num; i++)
+ dup->names[i] = g_strdup(obj->names[i]);
+ }
+ return dup;
+}
+
+void show_pdfobj(struct PdfObj *obj, GString *str)
+{
+ int i;
+ if (obj==NULL) return;
+ switch(obj->type) {
+ case PDFTYPE_CST:
+ if (obj->intval==1) g_string_append(str, "true");
+ if (obj->intval==0) g_string_append(str, "false");
+ if (obj->intval==-1) g_string_append(str, "null");
+ break;
+ case PDFTYPE_INT:
+ g_string_append_printf(str, "%d", obj->intval);
+ break;
+ case PDFTYPE_REAL:
+ g_string_append_printf(str, "%f", obj->realval);
+ break;
+ case PDFTYPE_STRING:
+ g_string_append_len(str, obj->str, obj->len);
+ break;
+ case PDFTYPE_NAME:
+ g_string_append(str, obj->str);
+ break;
+ case PDFTYPE_ARRAY:
+ g_string_append_c(str, '[');
+ for (i=0;i<obj->num;i++) {
+ if (i) g_string_append_c(str, ' ');
+ show_pdfobj(obj->elts[i], str);
+ }
+ g_string_append_c(str, ']');
+ break;
+ case PDFTYPE_DICT:
+ g_string_append(str, "<<");
+ for (i=0;i<obj->num;i++) {
+ g_string_append_printf(str, " %s ", obj->names[i]);
+ show_pdfobj(obj->elts[i], str);
+ }
+ g_string_append(str, " >>");
+ break;
+ case PDFTYPE_REF:
+ g_string_append_printf(str, "%d %d R", obj->intval, obj->num);
+ break;
+ }
+}
+
+void DEBUG_PRINTOBJ(struct PdfObj *obj)
+{
+ GString *s = g_string_new("");
+ show_pdfobj(obj, s);
+ puts(s->str);
+ g_string_free(s, TRUE);
+}
+
+// parse a PDF object; returns NULL if fails
+// THIS PARSER DOES NOT RECOGNIZE STREAMS YET
+
+struct PdfObj *parse_pdf_object(char **ptr, char *eof)
+{
+ struct PdfObj *obj, *elt;
+ char *p, *q, *r, *eltname;
+ int stack;
+
+ obj = g_malloc(sizeof(struct PdfObj));
+ p = *ptr;
+ skipspace(&p, eof);
+ if (p==eof) { g_free(obj); return NULL; }
+
+ // maybe a constant
+ if (!strncmp(p, "true", 4)) {
+ obj->type = PDFTYPE_CST;
+ obj->intval = 1;
+ *ptr = p+4;
+ return obj;
+ }
+ if (!strncmp(p, "false", 5)) {
+ obj->type = PDFTYPE_CST;
+ obj->intval = 0;
+ *ptr = p+5;
+ return obj;
+ }
+ if (!strncmp(p, "null", 4)) {
+ obj->type = PDFTYPE_CST;
+ obj->intval = -1;
+ *ptr = p+4;
+ return obj;
+ }
+
+ // or a number ?
+ obj->intval = strtol(p, &q, 10);
+ *ptr = q;
+ if (q!=p) {
+ if (*q == '.') {
+ obj->type = PDFTYPE_REAL;
+ obj->realval = strtod(p, ptr);
+ return obj;
+ }
+ if (ispdfspace(*q)) {
+ // check for indirect reference
+ skipspace(&q, eof);
+ obj->num = strtol(q, &r, 10);
+ if (r!=q) {
+ skipspace(&r, eof);
+ if (*r=='R') {
+ *ptr = r+1;
+ obj->type = PDFTYPE_REF;
+ return obj;
+ }
+ }
+ }
+ obj->type = PDFTYPE_INT;
+ return obj;
+ }
+
+ // a string ?
+ if (*p=='(') {
+ q=p+1; stack=1;
+ while (stack>0 && q!=eof) {
+ if (*q=='(') stack++;
+ if (*q==')') stack--;
+ if (*q=='\\') q++;
+ if (q!=eof) q++;
+ }
+ if (q==eof) { g_free(obj); return NULL; }
+ obj->type = PDFTYPE_STRING;
+ obj->len = q-p;
+ obj->str = g_malloc(obj->len+1);
+ obj->str[obj->len] = 0;
+ g_memmove(obj->str, p, obj->len);
+ *ptr = q;
+ return obj;
+ }
+ if (*p=='<' && p[1]!='<') {
+ q=p+1;
+ while (*q!='>' && q!=eof) q++;
+ if (q==eof) { g_free(obj); return NULL; }
+ q++;
+ obj->type = PDFTYPE_STRING;
+ obj->len = q-p;
+ obj->str = g_malloc(obj->len+1);
+ obj->str[obj->len] = 0;
+ g_memmove(obj->str, p, obj->len);
+ *ptr = q;
+ return obj;
+ }
+
+ // a name ?
+ if (*p=='/') {
+ q=p+1;
+ while (!ispdfspace(*q) && !ispdfdelim(*q)) q++;
+ obj->type = PDFTYPE_NAME;
+ obj->str = g_strndup(p, q-p);
+ *ptr = q;
+ return obj;
+ }
+
+ // an array ?
+ if (*p=='[') {
+ obj->type = PDFTYPE_ARRAY;
+ obj->num = 0;
+ obj->elts = NULL;
+ q=p+1; skipspace(&q, eof);
+ while (*q!=']') {
+ elt = parse_pdf_object(&q, eof);
+ if (elt==NULL) { free_pdfobj(obj); return NULL; }
+ obj->num++;
+ obj->elts = g_realloc(obj->elts, obj->num*sizeof(struct PdfObj *));
+ obj->elts[obj->num-1] = elt;
+ skipspace(&q, eof);
+ }
+ *ptr = q+1;
+ return obj;
+ }
+
+ // a dictionary ?
+ if (*p=='<' && p[1]=='<') {
+ obj->type = PDFTYPE_DICT;
+ obj->num = 0;
+ obj->elts = NULL;
+ obj->names = NULL;
+ q=p+2; skipspace(&q, eof);
+ while (*q!='>' || q[1]!='>') {
+ if (*q!='/') { free_pdfobj(obj); return NULL; }
+ r=q+1;
+ while (!ispdfspace(*r) && !ispdfdelim(*r)) r++;
+ eltname = g_strndup(q, r-q);
+ q=r; skipspace(&q, eof);
+ elt = parse_pdf_object(&q, eof);
+ if (elt==NULL) { g_free(eltname); free_pdfobj(obj); return NULL; }
+ obj->num++;
+ obj->elts = g_realloc(obj->elts, obj->num*sizeof(struct PdfObj *));
+ obj->names = g_realloc(obj->names, obj->num*sizeof(char *));
+ obj->elts[obj->num-1] = elt;
+ obj->names[obj->num-1] = eltname;
+ skipspace(&q, eof);
+ }
+ *ptr = q+2;
+ return obj;
+ }
+
+ // DOES NOT RECOGNIZE STREAMS YET (handle as subcase of dictionary)
+
+ g_free(obj);
+ return NULL;
+}
+
+struct PdfObj *get_dict_entry(struct PdfObj *dict, char *name)
+{
+ int i;
+
+ if (dict==NULL) return NULL;
+ if (dict->type != PDFTYPE_DICT) return NULL;
+ for (i=0; i<dict->num; i++)
+ if (!strcmp(dict->names[i], name)) return dict->elts[i];
+ return NULL;
+}
+
+struct PdfObj *get_pdfobj(GString *pdfbuf, struct XrefTable *xref, struct PdfObj *obj)
+{
+ char *p, *eof;
+ int offs, n;
+
+ if (obj==NULL) return NULL;
+ if (obj->type!=PDFTYPE_REF) return dup_pdfobj(obj);
+ if (obj->intval>xref->last) return NULL;
+ offs = xref->data[obj->intval];
+ if (offs<=0 || offs >= pdfbuf->len) return NULL;
+
+ p = pdfbuf->str + offs;
+ eof = pdfbuf->str + pdfbuf->len;
+ n = strtol(p, &p, 10);
+ if (n!=obj->intval) return NULL;
+ skipspace(&p, eof);
+ n = strtol(p, &p, 10);
+ skipspace(&p, eof);
+ if (strncmp(p, "obj", 3)) return NULL;
+ p+=3;
+ return parse_pdf_object(&p, eof);
+}
+
+// read the xref table of a PDF file in memory, and return the trailerdict
+
+struct PdfObj *parse_xref_table(GString *pdfbuf, struct XrefTable *xref, int offs)
+{
+ char *p, *q, *eof;
+ struct PdfObj *trailerdict, *obj;
+ int start, len, i;
+
+ if (strncmp(pdfbuf->str+offs, "xref", 4)) return NULL;
+ p = strstr(pdfbuf->str+offs, "trailer");
+ eof = pdfbuf->str + pdfbuf->len;
+ if (p==NULL) return NULL;
+ p+=8;
+ trailerdict = parse_pdf_object(&p, eof);
+ obj = get_dict_entry(trailerdict, "/Size");
+ if (obj!=NULL && obj->type == PDFTYPE_INT && obj->intval-1>xref->last)
+ make_xref(xref, obj->intval-1, 0);
+ obj = get_dict_entry(trailerdict, "/Prev");
+ if (obj!=NULL && obj->type == PDFTYPE_INT && obj->intval>0 && obj->intval!=offs) {
+ // recurse into older xref table
+ obj = parse_xref_table(pdfbuf, xref, obj->intval);
+ free_pdfobj(obj);
+ }
+ p = pdfbuf->str+offs+4;
+ skipspace(&p, eof);
+ if (*p<'0' || *p>'9') { free_pdfobj(trailerdict); return NULL; }
+ while (*p>='0' && *p<='9') {
+ start = strtol(p, &p, 10);
+ skipspace(&p, eof);
+ len = strtol(p, &p, 10);
+ skipspace(&p, eof);
+ if (len <= 0 || 20*len > eof-p) break;
+ if (start+len-1 > xref->last) make_xref(xref, start+len-1, 0);
+ for (i=start; i<start+len; i++) {
+ xref->data[i] = strtol(p, NULL, 10);
+ p+=20;
+ }
+ skipspace(&p, eof);
+ }
+ if (*p!='t') { free_pdfobj(trailerdict); return NULL; }
+ return trailerdict;
+}
+
+// parse the page tree
+
+int pdf_getpageinfo(GString *pdfbuf, struct XrefTable *xref,
+ struct PdfObj *pgtree, int nmax, struct PdfPageDesc *pages)
+{
+ struct PdfObj *obj, *kid;
+ int i, count, j;
+
+ obj = get_pdfobj(pdfbuf, xref, get_dict_entry(pgtree, "/Type"));
+ if (obj == NULL || obj->type != PDFTYPE_NAME)
+ return 0;
+ if (!strcmp(obj->str, "/Page")) {
+ free_pdfobj(obj);
+ pages->contents = dup_pdfobj(get_dict_entry(pgtree, "/Contents"));
+ obj = get_pdfobj(pdfbuf, xref, get_dict_entry(pgtree, "/Resources"));
+ if (obj!=NULL) {
+ free_pdfobj(pages->resources);
+ pages->resources = obj;
+ }
+ obj = get_pdfobj(pdfbuf, xref, get_dict_entry(pgtree, "/MediaBox"));
+ if (obj!=NULL) {
+ free_pdfobj(pages->mediabox);
+ pages->mediabox = obj;
+ }
+ obj = get_pdfobj(pdfbuf, xref, get_dict_entry(pgtree, "/Rotate"));
+ if (obj!=NULL && obj->type == PDFTYPE_INT)
+ pages->rotate = obj->intval;
+ free_pdfobj(obj);
+ return 1;
+ }
+ else if (!strcmp(obj->str, "/Pages")) {
+ free_pdfobj(obj);
+ obj = get_pdfobj(pdfbuf, xref, get_dict_entry(pgtree, "/Count"));
+ if (obj!=NULL && obj->type == PDFTYPE_INT &&
+ obj->intval>0 && obj->intval<=nmax) count = obj->intval;
+ else count = 0;
+ free_pdfobj(obj);
+ obj = get_pdfobj(pdfbuf, xref, get_dict_entry(pgtree, "/Resources"));
+ if (obj!=NULL)
+ for (i=0; i<count; i++) {
+ free_pdfobj(pages[i].resources);
+ pages[i].resources = dup_pdfobj(obj);
+ }
+ free_pdfobj(obj);
+ obj = get_pdfobj(pdfbuf, xref, get_dict_entry(pgtree, "/MediaBox"));
+ if (obj!=NULL)
+ for (i=0; i<count; i++) {
+ free_pdfobj(pages[i].mediabox);
+ pages[i].mediabox = dup_pdfobj(obj);
+ }
+ free_pdfobj(obj);
+ obj = get_pdfobj(pdfbuf, xref, get_dict_entry(pgtree, "/Rotate"));
+ if (obj!=NULL && obj->type == PDFTYPE_INT)
+ for (i=0; i<count; i++)
+ pages[i].rotate = obj->intval;
+ free_pdfobj(obj);
+ obj = get_pdfobj(pdfbuf, xref, get_dict_entry(pgtree, "/Kids"));
+ if (obj!=NULL && obj->type == PDFTYPE_ARRAY) {
+ for (i=0; i<obj->num; i++) {
+ kid = get_pdfobj(pdfbuf, xref, obj->elts[i]);
+ if (kid!=NULL) {
+ j = pdf_getpageinfo(pdfbuf, xref, kid, nmax, pages);
+ nmax -= j;
+ pages += j;
+ free_pdfobj(kid);
+ }
+ }
+ }
+ free_pdfobj(obj);
+ return count;
+ }
+ return 0;
+}
+
+// parse a PDF file in memory
+
+gboolean pdf_parse_info(GString *pdfbuf, struct PdfInfo *pdfinfo, struct XrefTable *xref)
+{
+ char *p;
+ int i, offs;
+ struct PdfObj *obj, *pages;
+
+ xref->n_alloc = xref->last = 0;
+ xref->data = NULL;
+ p = pdfbuf->str + pdfbuf->len-1;
+
+ while (*p!='s' && p!=pdfbuf->str) p--;
+ if (strncmp(p, "startxref", 9)) return FALSE; // fail
+ p+=9;
+ while (ispdfspace(*p) && p!=pdfbuf->str+pdfbuf->len) p++;
+ offs = strtol(p, NULL, 10);
+ if (offs <= 0 || offs > pdfbuf->len) return FALSE; // fail
+ pdfinfo->startxref = offs;
+
+ pdfinfo->trailerdict = parse_xref_table(pdfbuf, xref, offs);
+ if (pdfinfo->trailerdict == NULL) return FALSE; // fail
+
+ obj = get_pdfobj(pdfbuf, xref,
+ get_dict_entry(pdfinfo->trailerdict, "/Root"));
+ if (obj == NULL)
+ { free_pdfobj(pdfinfo->trailerdict); return FALSE; }
+ pages = get_pdfobj(pdfbuf, xref, get_dict_entry(obj, "/Pages"));
+ free_pdfobj(obj);
+ if (pages == NULL)
+ { free_pdfobj(pdfinfo->trailerdict); return FALSE; }
+ obj = get_pdfobj(pdfbuf, xref, get_dict_entry(pages, "/Count"));
+ if (obj == NULL || obj->type != PDFTYPE_INT || obj->intval<=0)
+ { free_pdfobj(pdfinfo->trailerdict); free_pdfobj(pages);
+ free_pdfobj(obj); return FALSE; }
+ pdfinfo->npages = obj->intval;
+ free_pdfobj(obj);
+
+ pdfinfo->pages = g_malloc0(pdfinfo->npages*sizeof(struct PdfPageDesc));
+ pdf_getpageinfo(pdfbuf, xref, pages, pdfinfo->npages, pdfinfo->pages);
+ free_pdfobj(pages);
+
+ return TRUE;
+}
+
+// add an entry to the xref table
+
+void make_xref(struct XrefTable *xref, int nobj, int offset)
+{
+ if (xref->n_alloc <= nobj) {
+ xref->n_alloc = nobj + 10;
+ xref->data = g_realloc(xref->data, xref->n_alloc*sizeof(int));
+ }
+ if (xref->last < nobj) xref->last = nobj;
+ xref->data[nobj] = offset;
+}
+
+// a wrapper for deflate
+
+GString *do_deflate(char *in, int len)
+{
+ GString *out;
+ z_stream zs;
+
+ zs.zalloc = Z_NULL;
+ zs.zfree = Z_NULL;
+ deflateInit(&zs, Z_DEFAULT_COMPRESSION);
+ zs.next_in = (Bytef *)in;
+ zs.avail_in = len;
+ zs.avail_out = deflateBound(&zs, len);
+ out = g_string_sized_new(zs.avail_out);
+ zs.next_out = (Bytef *)out->str;
+ deflate(&zs, Z_FINISH);
+ out->len = zs.total_out;
+ deflateEnd(&zs);
+ return out;
+}
+
+// prefix to scale the original page
+
+GString *make_pdfprefix(struct PdfPageDesc *pgdesc, double width, double height)
+{
+ GString *str;
+ double v[4], t, xscl, yscl;
+ int i;
+
+ str = g_string_new("q ");
+ if (pgdesc->rotate == 90) {
+ g_string_append_printf(str, "0 -1 1 0 0 %.2f cm ", height);
+ t = height; height = width; width = t;
+ }
+ if (pgdesc->rotate == 270) {
+ g_string_append_printf(str, "0 1 -1 0 %.2f 0 cm ", width);
+ t = height; height = width; width = t;
+ }
+ if (pgdesc->rotate == 180) {
+ g_string_append_printf(str, "-1 0 0 -1 %.2f %.2f cm ", width, height);
+ }
+ if (pgdesc->mediabox==NULL || pgdesc->mediabox->type != PDFTYPE_ARRAY ||
+ pgdesc->mediabox->num != 4) return str;
+ for (i=0; i<4; i++) {
+ if (pgdesc->mediabox->elts[i]->type == PDFTYPE_INT)
+ v[i] = pgdesc->mediabox->elts[i]->intval;
+ else if (pgdesc->mediabox->elts[i]->type == PDFTYPE_REAL)
+ v[i] = pgdesc->mediabox->elts[i]->realval;
+ else return str;
+ }
+ if (v[0]>v[2]) { t = v[0]; v[0] = v[2]; v[2] = t; }
+ if (v[1]>v[3]) { t = v[1]; v[1] = v[3]; v[3] = t; }
+ if (v[2]-v[0] < 1. || v[3]-v[1] < 1.) return str;
+ xscl = width/(v[2]-v[0]);
+ yscl = height/(v[3]-v[1]);
+ g_string_append_printf(str, "%.4f 0 0 %.4f %.2f %.2f cm ",
+ xscl, yscl, -v[0]*xscl, -v[1]*yscl);
+ return str;
+}
+
+// add an entry to a subentry of a directory
+
+struct PdfObj *mk_pdfname(char *name)
+{
+ struct PdfObj *obj;
+
+ obj = g_malloc(sizeof(struct PdfObj));
+ obj->type = PDFTYPE_NAME;
+ obj->str = g_strdup(name);
+ return obj;
+}
+
+struct PdfObj *mk_pdfref(int num)
+{
+ struct PdfObj *obj;
+
+ obj = g_malloc(sizeof(struct PdfObj));
+ obj->type = PDFTYPE_REF;
+ obj->intval = num;
+ obj->num = 0;
+ return obj;
+}
+
+gboolean iseq_obj(struct PdfObj *a, struct PdfObj *b)
+{
+ if (a==NULL || b==NULL) return (a==b);
+ if (a->type!=b->type) return FALSE;
+ if (a->type == PDFTYPE_CST || a->type == PDFTYPE_INT)
+ return (a->intval == b->intval);
+ if (a->type == PDFTYPE_REAL)
+ return (a->realval == b->realval);
+ if (a->type == PDFTYPE_NAME)
+ return !strcmp(a->str, b->str);
+ if (a->type == PDFTYPE_REF)
+ return (a->intval == b->intval && a->num == b->num);
+ return FALSE;
+}
+
+void add_dict_subentry(GString *pdfbuf, struct XrefTable *xref,
+ struct PdfObj *obj, char *section, int type, char *name, struct PdfObj *entry)
+{
+ struct PdfObj *sec;
+ int i, subpos;
+
+ subpos = -1;
+ for (i=0; i<obj->num; i++)
+ if (!strcmp(obj->names[i], section)) subpos = i;
+ if (subpos == -1) {
+ subpos = obj->num;
+ obj->num++;
+ obj->elts = g_realloc(obj->elts, obj->num*sizeof(struct PdfObj*));
+ obj->names = g_realloc(obj->names, obj->num*sizeof(char *));
+ obj->names[subpos] = g_strdup(section);
+ obj->elts[subpos] = NULL;
+ }
+ if (obj->elts[subpos]!=NULL && obj->elts[subpos]->type==PDFTYPE_REF) {
+ sec = get_pdfobj(pdfbuf, xref, obj->elts[subpos]);
+ free_pdfobj(obj->elts[subpos]);
+ obj->elts[subpos] = sec;
+ }
+ if (obj->elts[subpos]!=NULL && obj->elts[subpos]->type!=type)
+ { free_pdfobj(obj->elts[subpos]); obj->elts[subpos] = NULL; }
+ if (obj->elts[subpos] == NULL) {
+ obj->elts[subpos] = sec = g_malloc(sizeof(struct PdfObj));
+ sec->type = type;
+ sec->num = 0;
+ sec->elts = NULL;
+ sec->names = NULL;
+ }
+ sec = obj->elts[subpos];
+
+ subpos = -1;
+ if (type==PDFTYPE_DICT) {
+ for (i=0; i<sec->num; i++)
+ if (!strcmp(sec->names[i], name)) subpos = i;
+ if (subpos == -1) {
+ subpos = sec->num;
+ sec->num++;
+ sec->elts = g_realloc(sec->elts, sec->num*sizeof(struct PdfObj*));
+ sec->names = g_realloc(sec->names, sec->num*sizeof(char *));
+ sec->names[subpos] = g_strdup(name);
+ sec->elts[subpos] = NULL;
+ }
+ free_pdfobj(sec->elts[subpos]);
+ sec->elts[subpos] = entry;
+ }
+ if (type==PDFTYPE_ARRAY) {
+ for (i=0; i<sec->num; i++)
+ if (iseq_obj(sec->elts[i], entry)) subpos = i;
+ if (subpos == -1) {
+ subpos = sec->num;
+ sec->num++;
+ sec->elts = g_realloc(sec->elts, sec->num*sizeof(struct PdfObj*));
+ sec->elts[subpos] = entry;
+ }
+ else free_pdfobj(entry);
+ }
+}
+
+// draw a page's background
+
+void pdf_draw_solid_background(struct Page *pg, GString *str)
+{
+ double x, y;
+
+ g_string_append_printf(str,
+ "%.2f %.2f %.2f rg 0 0 %.2f %.2f re f ",
+ RGBA_RGB(pg->bg->color_rgba), pg->width, pg->height);
+ if (pg->bg->ruling == RULING_NONE) return;
+ g_string_append_printf(str,
+ "%.2f %.2f %.2f RG %.2f w ",
+ RGBA_RGB(RULING_COLOR), RULING_THICKNESS);
+ if (pg->bg->ruling == RULING_GRAPH) {
+ for (x=RULING_GRAPHSPACING; x<pg->width-1; x+=RULING_GRAPHSPACING)
+ g_string_append_printf(str, "%.2f 0 m %.2f %.2f l S ",
+ x, x, pg->height);
+ for (y=RULING_GRAPHSPACING; y<pg->height-1; y+=RULING_GRAPHSPACING)
+ g_string_append_printf(str, "0 %.2f m %.2f %.2f l S ",
+ y, pg->width, y);
+ return;
+ }
+ for (y=RULING_TOPMARGIN; y<pg->height-1; y+=RULING_SPACING)
+ g_string_append_printf(str, "0 %.2f m %.2f %.2f l S ",
+ y, pg->width, y);
+ if (pg->bg->ruling == RULING_LINED)
+ g_string_append_printf(str,
+ "%.2f %.2f %.2f RG %.2f 0 m %.2f %.2f l S ",
+ RGBA_RGB(RULING_MARGIN_COLOR),
+ RULING_LEFTMARGIN, RULING_LEFTMARGIN, pg->height);
+}
+
+int pdf_draw_bitmap_background(struct Page *pg, GString *str,
+ struct XrefTable *xref, GString *pdfbuf)
+{
+ BgPdfPage *pgpdf;
+ GdkPixbuf *pix;
+ GString *zpix;
+ char *buf, *p1, *p2;
+ int height, width, stride, x, y, chan;
+
+ if (pg->bg->type == BG_PDF) {
+ pgpdf = (struct BgPdfPage *)g_list_nth_data(bgpdf.pages, pg->bg->file_page_seq-1);
+ if (pgpdf == NULL) return -1;
+ if (pgpdf->dpi != PDFTOPPM_PRINTING_DPI) {
+ add_bgpdf_request(pg->bg->file_page_seq, 0, TRUE);
+ while (pgpdf->dpi != PDFTOPPM_PRINTING_DPI && bgpdf.status == STATUS_RUNNING)
+ gtk_main_iteration();
+ }
+ pix = pgpdf->pixbuf;
+ }
+ else pix = pg->bg->pixbuf;
+
+ if (gdk_pixbuf_get_bits_per_sample(pix) != 8) return -1;
+ if (gdk_pixbuf_get_colorspace(pix) != GDK_COLORSPACE_RGB) return -1;
+
+ width = gdk_pixbuf_get_width(pix);
+ height = gdk_pixbuf_get_height(pix);
+ stride = gdk_pixbuf_get_rowstride(pix);
+ chan = gdk_pixbuf_get_n_channels(pix);
+ if (chan!=3 && chan!=4) return -1;
+
+ g_string_append_printf(str, "q %.2f 0 0 %.2f 0 %.2f cm /ImBg Do Q ",
+ pg->width, -pg->height, pg->height);
+
+ p2 = buf = (char *)g_malloc(3*width*height);
+ for (y=0; y<height; y++) {
+ p1 = (char *)gdk_pixbuf_get_pixels(pix)+stride*y;
+ for (x=0; x<width; x++) {
+ *(p2++)=*(p1++); *(p2++)=*(p1++); *(p2++)=*(p1++);
+ if (chan==4) p1++;
+ }
+ }
+ zpix = do_deflate(buf, 3*width*height);
+ g_free(buf);
+
+ make_xref(xref, xref->last+1, pdfbuf->len);
+ g_string_append_printf(pdfbuf,
+ "%d 0 obj\n<< /Length %d /Filter /FlateDecode /Type /Xobject "
+ "/Subtype /Image /Width %d /Height %d /ColorSpace /DeviceRGB "
+ "/BitsPerComponent 8 >> stream\n",
+ xref->last, zpix->len, width, height);
+ g_string_append_len(pdfbuf, zpix->str, zpix->len);
+ g_string_free(zpix, TRUE);
+ g_string_append(pdfbuf, "endstream\nendobj\n");
+
+ return xref->last;
+}
+
+// draw a page's graphics
+
+void pdf_draw_page(struct Page *pg, GString *str, gboolean *use_hiliter)
+{
+ GList *layerlist, *itemlist;
+ struct Layer *l;
+ struct Item *item;
+ guint old_rgba;
+ double old_thickness;
+ double *pt;
+ int i;
+
+ old_rgba = 0x12345678; // not any values we use, so we'll reset them
+ old_thickness = 0.0;
+
+ for (layerlist = pg->layers; layerlist!=NULL; layerlist = layerlist->next) {
+ l = (struct Layer *)layerlist->data;
+ for (itemlist = l->items; itemlist!=NULL; itemlist = itemlist->next) {
+ item = (struct Item *)itemlist->data;
+ if (item->type == ITEM_STROKE) {
+ if ((item->brush.color_rgba & ~0xff) != old_rgba)
+ g_string_append_printf(str, "%.2f %.2f %.2f RG ",
+ RGBA_RGB(item->brush.color_rgba));
+ if (item->brush.thickness != old_thickness)
+ g_string_append_printf(str, "%.2f w ", item->brush.thickness);
+ if ((item->brush.color_rgba & 0xf0) != 0xf0) { // transparent
+ g_string_append(str, "q /XoHi gs ");
+ *use_hiliter = TRUE;
+ }
+ 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.color_rgba & 0xf0) != 0xf0) // undo transparent
+ g_string_append(str, "Q ");
+ }
+ }
+ }
+}
+
+// main printing function
+
+/* we use the following object numbers, starting with n_obj_catalog:
+ 0 the document catalog
+ 1 the page tree
+ 2 the GS for the hiliters
+ 3 ... the page objects
+*/
+
+gboolean print_to_pdf(char *filename)
+{
+ FILE *f;
+ GString *pdfbuf, *pgstrm, *zpgstrm, *tmpstr;
+ int n_obj_catalog, n_obj_pages_offs, n_page, n_obj_bgpix, n_obj_prefix;
+ int i, startxref;
+ struct XrefTable xref;
+ GList *pglist;
+ struct Page *pg;
+ char *buf;
+ unsigned int len;
+ gboolean annot, uses_pdf;
+ gboolean use_hiliter;
+ struct PdfInfo pdfinfo;
+ struct PdfObj *obj;
+
+ f = fopen(filename, "w");
+ if (f == NULL) return FALSE;
+ annot = FALSE;
+ xref.data = NULL;
+ uses_pdf = FALSE;
+ for (pglist = journal.pages; pglist!=NULL; pglist = pglist->next) {
+ pg = (struct Page *)pglist->data;
+ if (pg->bg->type == BG_PDF) uses_pdf = TRUE;
+ }
+
+ if (uses_pdf && bgpdf.status != STATUS_NOT_INIT &&
+ g_file_get_contents(bgpdf.tmpfile_copy, &buf, &len, NULL) &&
+ !strncmp(buf, "%PDF-1.", 7)) {
+ // parse the existing PDF file
+ pdfbuf = g_string_new_len(buf, len);
+ g_free(buf);
+ if (pdfbuf->str[7]<'4') pdfbuf->str[7] = '4'; // upgrade to 1.4
+ annot = pdf_parse_info(pdfbuf, &pdfinfo, &xref);
+ if (!annot) {
+ g_string_free(pdfbuf, TRUE);
+ if (xref.data != NULL) g_free(xref.data);
+ }
+ }
+
+ if (!annot) {
+ pdfbuf = g_string_new("%PDF-1.4\n%\370\357\365\362\n");
+ xref.n_alloc = xref.last = 0;
+ xref.data = NULL;
+ }
+
+ // catalog and page tree
+ n_obj_catalog = xref.last+1;
+ n_obj_pages_offs = xref.last+4;
+ make_xref(&xref, n_obj_catalog, pdfbuf->len);
+ g_string_append_printf(pdfbuf,
+ "%d 0 obj\n<< /Type /Catalog /Pages %d 0 R >> endobj\n",
+ n_obj_catalog, n_obj_catalog+1);
+ make_xref(&xref, n_obj_catalog+1, pdfbuf->len);
+ g_string_append_printf(pdfbuf,
+ "%d 0 obj\n<< /Type /Pages /Kids [", n_obj_catalog+1);
+ for (i=0;i<journal.npages;i++)
+ g_string_append_printf(pdfbuf, "%d 0 R ", n_obj_pages_offs+i);
+ g_string_append_printf(pdfbuf, "] /Count %d >> endobj\n", journal.npages);
+ make_xref(&xref, n_obj_catalog+2, pdfbuf->len);
+ g_string_append_printf(pdfbuf,
+ "%d 0 obj\n<< /Type /ExtGState /CA 0.5 >> endobj\n",
+ n_obj_catalog+2);
+ xref.last = n_obj_pages_offs + journal.npages-1;
+
+ for (pglist = journal.pages, n_page = 0; pglist!=NULL;
+ pglist = pglist->next, n_page++) {
+ pg = (struct Page *)pglist->data;
+
+ // draw the background and page into pgstrm
+ pgstrm = g_string_new("");
+ g_string_printf(pgstrm, "q 1 0 0 -1 0 %.2f cm 1 J 1 j ", pg->height);
+ n_obj_bgpix = -1;
+ n_obj_prefix = -1;
+ if (pg->bg->type == BG_SOLID)
+ pdf_draw_solid_background(pg, pgstrm);
+ else if (pg->bg->type == BG_PDF && annot &&
+ pdfinfo.pages[pg->bg->file_page_seq-1].contents!=NULL) {
+ make_xref(&xref, xref.last+1, pdfbuf->len);
+ n_obj_prefix = xref.last;
+ tmpstr = make_pdfprefix(pdfinfo.pages+(pg->bg->file_page_seq-1),
+ pg->width, pg->height);
+ g_string_append_printf(pdfbuf,
+ "%d 0 obj\n<< /Length %d >> stream\n%s\nendstream\nendobj\n",
+ n_obj_prefix, tmpstr->len, tmpstr->str);
+ g_string_free(tmpstr, TRUE);
+ g_string_prepend(pgstrm, "Q ");
+ }
+ else if (pg->bg->type == BG_PIXMAP || pg->bg->type == BG_PDF)
+ n_obj_bgpix = pdf_draw_bitmap_background(pg, pgstrm, &xref, pdfbuf);
+ // draw the page contents
+ use_hiliter = FALSE;
+ pdf_draw_page(pg, pgstrm, &use_hiliter);
+ g_string_append_printf(pgstrm, "Q\n");
+
+ // deflate pgstrm and write it
+ zpgstrm = do_deflate(pgstrm->str, pgstrm->len);
+ g_string_free(pgstrm, TRUE);
+
+ make_xref(&xref, xref.last+1, pdfbuf->len);
+ g_string_append_printf(pdfbuf,
+ "%d 0 obj\n<< /Length %d /Filter /FlateDecode>> stream\n",
+ xref.last, zpgstrm->len);
+ g_string_append_len(pdfbuf, zpgstrm->str, zpgstrm->len);
+ g_string_free(zpgstrm, TRUE);
+ g_string_append(pdfbuf, "endstream\nendobj\n");
+
+ // write the page object
+
+ make_xref(&xref, n_obj_pages_offs+n_page, pdfbuf->len);
+ g_string_append_printf(pdfbuf,
+ "%d 0 obj\n<< /Type /Page /Parent %d 0 R /MediaBox [0 0 %.2f %.2f] ",
+ n_obj_pages_offs+n_page, n_obj_catalog+1, pg->width, pg->height);
+ if (n_obj_prefix>0) {
+ obj = get_pdfobj(pdfbuf, &xref, pdfinfo.pages[pg->bg->file_page_seq-1].contents);
+ if (obj->type != PDFTYPE_ARRAY) {
+ free_pdfobj(obj);
+ obj = dup_pdfobj(pdfinfo.pages[pg->bg->file_page_seq-1].contents);
+ }
+ g_string_append_printf(pdfbuf, "/Contents [%d 0 R ", n_obj_prefix);
+ if (obj->type == PDFTYPE_REF)
+ g_string_append_printf(pdfbuf, "%d %d R ", obj->intval, obj->num);
+ if (obj->type == PDFTYPE_ARRAY) {
+ for (i=0; i<obj->num; i++) {
+ show_pdfobj(obj->elts[i], pdfbuf);
+ g_string_append_c(pdfbuf, ' ');
+ }
+ }
+ free_pdfobj(obj);
+ g_string_append_printf(pdfbuf, "%d 0 R] ", xref.last);
+ }
+ else g_string_append_printf(pdfbuf, "/Contents %d 0 R ", xref.last);
+ g_string_append(pdfbuf, "/Resources ");
+
+ if (n_obj_prefix>0)
+ obj = dup_pdfobj(pdfinfo.pages[pg->bg->file_page_seq-1].resources);
+ else obj = NULL;
+ if (obj!=NULL && obj->type!=PDFTYPE_DICT)
+ { free_pdfobj(obj); obj=NULL; }
+ if (obj==NULL) {
+ obj = g_malloc(sizeof(struct PdfObj));
+ obj->type = PDFTYPE_DICT;
+ obj->num = 0;
+ obj->elts = NULL;
+ obj->names = NULL;
+ }
+ add_dict_subentry(pdfbuf, &xref,
+ obj, "/ProcSet", PDFTYPE_ARRAY, NULL, mk_pdfname("/PDF"));
+ if (n_obj_bgpix>0)
+ add_dict_subentry(pdfbuf, &xref,
+ obj, "/ProcSet", PDFTYPE_ARRAY, NULL, mk_pdfname("/ImageC"));
+ if (use_hiliter)
+ add_dict_subentry(pdfbuf, &xref,
+ obj, "/ExtGState", PDFTYPE_DICT, "/XoHi", mk_pdfref(n_obj_catalog+2));
+ if (n_obj_bgpix>0)
+ add_dict_subentry(pdfbuf, &xref,
+ obj, "/XObject", PDFTYPE_DICT, "/ImBg", mk_pdfref(n_obj_bgpix));
+ show_pdfobj(obj, pdfbuf);
+ free_pdfobj(obj);
+ g_string_append(pdfbuf, " >> endobj\n");
+ }
+
+ // PDF trailer
+ startxref = pdfbuf->len;
+ if (annot) g_string_append_printf(pdfbuf,
+ "xref\n%d %d\n", n_obj_catalog, xref.last-n_obj_catalog+1);
+ else g_string_append_printf(pdfbuf,
+ "xref\n0 %d\n0000000000 65535 f \n", xref.last+1);
+ for (i=n_obj_catalog; i<=xref.last; i++)
+ g_string_append_printf(pdfbuf, "%010d 00000 n \n", xref.data[i]);
+ g_string_append_printf(pdfbuf,
+ "trailer\n<< /Size %d /Root %d 0 R ", xref.last+1, n_obj_catalog);
+ if (annot) {
+ g_string_append_printf(pdfbuf, "/Prev %d ", pdfinfo.startxref);
+ // keeping encryption info somehow doesn't work.
+ // xournal can't annotate encrypted PDFs anyway...
+/*
+ obj = get_dict_entry(pdfinfo.trailerdict, "/Encrypt");
+ if (obj!=NULL) {
+ g_string_append_printf(pdfbuf, "/Encrypt ");
+ show_pdfobj(obj, pdfbuf);
+ }
+*/
+ }
+ g_string_append_printf(pdfbuf,
+ ">>\nstartxref\n%d\n%%%%EOF\n", startxref);
+
+ g_free(xref.data);
+ if (annot) {
+ free_pdfobj(pdfinfo.trailerdict);
+ // ...
+ }
+
+ if (fwrite(pdfbuf->str, 1, pdfbuf->len, f) < pdfbuf->len) {
+ fclose(f);
+ g_string_free(pdfbuf, TRUE);
+ return FALSE;
+ }
+ fclose(f);
+ g_string_free(pdfbuf, TRUE);
+ return TRUE;
+}
+
+/*********** Printing via libgnomeprint **********/
+
// does the same job as update_canvas_bg(), but to a print context
void print_background(GnomePrintContext *gpc, struct Page *pg, gboolean *abort)
+typedef struct XrefTable {
+ int *data;
+ int last;
+ int n_alloc;
+} XrefTable;
+
+typedef struct PdfPageDesc {
+ struct PdfObj *resources, *mediabox, *contents;
+ int rotate;
+} PdfPageDesc;
+
+typedef struct PdfInfo {
+ int startxref;
+ struct PdfObj *trailerdict;
+ int npages;
+ struct PdfPageDesc *pages;
+} PdfInfo;
+
+typedef struct PdfObj {
+ int type;
+ int intval;
+ double realval;
+ char *str;
+ int len, num;
+ struct PdfObj **elts;
+ char **names;
+} PdfObj;
+
+#define PDFTYPE_CST 0 // intval: true=1, false=0, null=-1
+#define PDFTYPE_INT 1 // intval
+#define PDFTYPE_REAL 2 // realval
+#define PDFTYPE_STRING 3 // str, len
+#define PDFTYPE_NAME 4 // str
+#define PDFTYPE_ARRAY 5 // num, elts
+#define PDFTYPE_DICT 6 // num, elts, names
+#define PDFTYPE_STREAM 7 // dict: num, elts, names; data: str, len
+#define PDFTYPE_REF 8 // intval, num
+
+struct PdfObj *parse_pdf_object(char **ptr, char *eof);
+void free_pdfobj(struct PdfObj *obj);
+struct PdfObj *dup_pdfobj(struct PdfObj *obj);
+struct PdfObj *get_pdfobj(GString *pdfbuf, struct XrefTable *xref, struct PdfObj *obj);
+void make_xref(struct XrefTable *xref, int nobj, int offset);
+
+gboolean pdf_parse_info(GString *pdfbuf, struct PdfInfo *pdfinfo, struct XrefTable *xref);
+
+// main printing functions
+
+gboolean print_to_pdf(char *filename);
+
void print_job_render(GnomePrintJob *gpj, int fromPage, int toPage);
#define PIXEL_MOTION_THRESHOLD 0.3
#define MAX_AXES 12
#define EPSILON 1E-7
-#define MAX_ZOOM 20
+#define MAX_ZOOM 20.0
#define DEFAULT_ZOOM 1.3333333333
#define MIN_ZOOM 0.2
<signal name="activate" handler="on_fileNewBackground_activate" last_modification_time="Wed, 30 Nov 2005 18:39:59 GMT"/>
<child internal-child="image">
- <widget class="GtkImage" id="image577">
+ <widget class="GtkImage" id="image599">
<property name="visible">True</property>
<property name="stock">gtk-open</property>
<property name="icon_size">1</property>
<signal name="activate" handler="on_filePrintOptions_activate" last_modification_time="Wed, 30 Nov 2005 18:44:18 GMT"/>
<child internal-child="image">
- <widget class="GtkImage" id="image578">
+ <widget class="GtkImage" id="image600">
<property name="visible">True</property>
<property name="stock">gtk-preferences</property>
<property name="icon_size">1</property>
<child>
<widget class="GtkMenuItem" id="filePrintPDF">
<property name="visible">True</property>
- <property name="label" translatable="yes">Print to PDF</property>
+ <property name="label" translatable="yes">Export to PDF</property>
<property name="use_underline">True</property>
<signal name="activate" handler="on_filePrintPDF_activate" last_modification_time="Wed, 30 Nov 2005 18:44:18 GMT"/>
</widget>
<property name="visible">True</property>
<property name="label" translatable="yes">Continuous</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<signal name="toggled" handler="on_viewContinuous_activate" last_modification_time="Wed, 30 Nov 2005 19:31:48 GMT"/>
</widget>
</child>
<signal name="activate" handler="on_viewPageWidth_activate" last_modification_time="Wed, 30 Nov 2005 19:31:48 GMT"/>
<child internal-child="image">
- <widget class="GtkImage" id="image579">
+ <widget class="GtkImage" id="image601">
<property name="visible">True</property>
<property name="stock">gtk-zoom-fit</property>
<property name="icon_size">1</property>
</widget>
</child>
+ <child>
+ <widget class="GtkMenuItem" id="viewSetZoom">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Set Zoom</property>
+ <property name="use_underline">True</property>
+ <signal name="activate" handler="on_viewSetZoom_activate" last_modification_time="Sat, 22 Jul 2006 21:30:29 GMT"/>
+ </widget>
+ </child>
+
<child>
<widget class="GtkSeparatorMenuItem" id="separator5">
<property name="visible">True</property>
<signal name="activate" handler="on_viewFirstPage_activate" last_modification_time="Wed, 30 Nov 2005 19:33:03 GMT"/>
<child internal-child="image">
- <widget class="GtkImage" id="image580">
+ <widget class="GtkImage" id="image602">
<property name="visible">True</property>
<property name="stock">gtk-goto-first</property>
<property name="icon_size">1</property>
<signal name="activate" handler="on_viewPreviousPage_activate" last_modification_time="Wed, 30 Nov 2005 19:35:41 GMT"/>
<child internal-child="image">
- <widget class="GtkImage" id="image581">
+ <widget class="GtkImage" id="image603">
<property name="visible">True</property>
<property name="stock">gtk-go-back</property>
<property name="icon_size">1</property>
<signal name="activate" handler="on_viewNextPage_activate" last_modification_time="Wed, 30 Nov 2005 19:35:41 GMT"/>
<child internal-child="image">
- <widget class="GtkImage" id="image582">
+ <widget class="GtkImage" id="image604">
<property name="visible">True</property>
<property name="stock">gtk-go-forward</property>
<property name="icon_size">1</property>
<signal name="activate" handler="on_viewLastPage_activate" last_modification_time="Wed, 30 Nov 2005 19:35:41 GMT"/>
<child internal-child="image">
- <widget class="GtkImage" id="image583">
+ <widget class="GtkImage" id="image605">
<property name="visible">True</property>
<property name="stock">gtk-goto-last</property>
<property name="icon_size">1</property>
<signal name="activate" handler="on_viewShowLayer_activate" last_modification_time="Wed, 30 Nov 2005 19:40:23 GMT"/>
<child internal-child="image">
- <widget class="GtkImage" id="image584">
+ <widget class="GtkImage" id="image606">
<property name="visible">True</property>
<property name="stock">gtk-add</property>
<property name="icon_size">1</property>
<signal name="activate" handler="on_viewHideLayer_activate" last_modification_time="Wed, 30 Nov 2005 19:40:23 GMT"/>
<child internal-child="image">
- <widget class="GtkImage" id="image585">
+ <widget class="GtkImage" id="image607">
<property name="visible">True</property>
<property name="stock">gtk-remove</property>
<property name="icon_size">1</property>
<property name="visible">True</property>
<property name="label" translatable="yes">white paper</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<signal name="toggled" handler="on_papercolorWhite_activate" last_modification_time="Wed, 30 Nov 2005 19:58:26 GMT"/>
</widget>
</child>
<property name="visible">True</property>
<property name="label" translatable="yes">yellow paper</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<property name="group">papercolorWhite</property>
<signal name="toggled" handler="on_papercolorYellow_activate" last_modification_time="Wed, 30 Nov 2005 19:58:26 GMT"/>
</widget>
<property name="visible">True</property>
<property name="label" translatable="yes">pink paper</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<property name="group">papercolorWhite</property>
<signal name="toggled" handler="on_papercolorPink_activate" last_modification_time="Wed, 30 Nov 2005 19:58:26 GMT"/>
</widget>
<property name="visible">True</property>
<property name="label" translatable="yes">orange paper</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<property name="group">papercolorWhite</property>
<signal name="toggled" handler="on_papercolorOrange_activate" last_modification_time="Wed, 30 Nov 2005 20:06:31 GMT"/>
</widget>
<property name="visible">True</property>
<property name="label" translatable="yes">blue paper</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<property name="group">papercolorWhite</property>
<signal name="toggled" handler="on_papercolorBlue_activate" last_modification_time="Wed, 30 Nov 2005 20:06:31 GMT"/>
</widget>
<property name="visible">True</property>
<property name="label" translatable="yes">green paper</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<property name="group">papercolorWhite</property>
<signal name="toggled" handler="on_papercolorGreen_activate" last_modification_time="Wed, 30 Nov 2005 20:06:31 GMT"/>
</widget>
<property name="visible">True</property>
<property name="label" translatable="yes">other...</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<property name="group">papercolorWhite</property>
<signal name="toggled" handler="on_papercolorOther_activate" last_modification_time="Thu, 01 Dec 2005 22:00:06 GMT"/>
</widget>
<property name="visible">True</property>
<property name="label" translatable="yes">plain</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<signal name="toggled" handler="on_paperstylePlain_activate" last_modification_time="Wed, 30 Nov 2005 20:06:31 GMT"/>
</widget>
</child>
<property name="visible">True</property>
<property name="label" translatable="yes">lined</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<property name="group">paperstylePlain</property>
<signal name="toggled" handler="on_paperstyleLined_activate" last_modification_time="Wed, 30 Nov 2005 20:06:31 GMT"/>
</widget>
<property name="visible">True</property>
<property name="label" translatable="yes">ruled</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<property name="group">paperstylePlain</property>
<signal name="toggled" handler="on_paperstyleRuled_activate" last_modification_time="Wed, 30 Nov 2005 20:06:31 GMT"/>
</widget>
<property name="visible">True</property>
<property name="label" translatable="yes">graph</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<property name="group">paperstylePlain</property>
<signal name="toggled" handler="on_paperstyleGraph_activate" last_modification_time="Wed, 30 Nov 2005 20:06:31 GMT"/>
</widget>
<signal name="activate" handler="on_journalLoadBackground_activate" last_modification_time="Wed, 30 Nov 2005 20:06:31 GMT"/>
<child internal-child="image">
- <widget class="GtkImage" id="image586">
+ <widget class="GtkImage" id="image608">
<property name="visible">True</property>
<property name="stock">gtk-open</property>
<property name="icon_size">1</property>
<property name="visible">True</property>
<property name="label" translatable="yes">_Pen</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<signal name="toggled" handler="on_toolsPen_activate" last_modification_time="Thu, 01 Dec 2005 05:36:05 GMT"/>
</widget>
</child>
<property name="visible">True</property>
<property name="label" translatable="yes">_Eraser</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<property name="group">toolsPen</property>
<signal name="toggled" handler="on_toolsEraser_activate" last_modification_time="Thu, 01 Dec 2005 05:36:05 GMT"/>
</widget>
<property name="visible">True</property>
<property name="label" translatable="yes">_Highlighter</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<property name="group">toolsPen</property>
<signal name="toggled" handler="on_toolsHighlighter_activate" last_modification_time="Thu, 01 Dec 2005 05:36:05 GMT"/>
</widget>
<property name="visible">True</property>
<property name="label" translatable="yes">_Text</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<property name="group">toolsPen</property>
<signal name="toggled" handler="on_toolsText_activate" last_modification_time="Thu, 01 Dec 2005 20:54:08 GMT"/>
</widget>
<property name="visible">True</property>
<property name="label" translatable="yes">_Select Region</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<property name="group">toolsPen</property>
<signal name="toggled" handler="on_toolsSelectRegion_activate" last_modification_time="Thu, 01 Dec 2005 20:54:08 GMT"/>
</widget>
<property name="visible">True</property>
<property name="label" translatable="yes">Select Rectangle</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<property name="group">toolsPen</property>
<signal name="toggled" handler="on_toolsSelectRectangle_activate" last_modification_time="Thu, 01 Dec 2005 20:54:08 GMT"/>
</widget>
<property name="use_underline">True</property>
<child internal-child="image">
- <widget class="GtkImage" id="image587">
+ <widget class="GtkImage" id="image609">
<property name="visible">True</property>
<property name="stock">gtk-select-color</property>
<property name="icon_size">1</property>
<property name="visible">True</property>
<property name="label" translatable="yes">black</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<signal name="toggled" handler="on_colorBlack_activate" last_modification_time="Thu, 01 Dec 2005 21:56:57 GMT"/>
</widget>
</child>
<property name="visible">True</property>
<property name="label" translatable="yes">blue</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<property name="group">colorBlack</property>
<signal name="toggled" handler="on_colorBlue_activate" last_modification_time="Thu, 01 Dec 2005 21:56:57 GMT"/>
</widget>
<property name="visible">True</property>
<property name="label" translatable="yes">red</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<property name="group">colorBlack</property>
<signal name="toggled" handler="on_colorRed_activate" last_modification_time="Thu, 01 Dec 2005 21:56:57 GMT"/>
</widget>
<property name="visible">True</property>
<property name="label" translatable="yes">green</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<property name="group">colorBlack</property>
<signal name="toggled" handler="on_colorGreen_activate" last_modification_time="Thu, 01 Dec 2005 21:56:57 GMT"/>
</widget>
<property name="visible">True</property>
<property name="label" translatable="yes">gray</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<property name="group">colorBlack</property>
<signal name="toggled" handler="on_colorGray_activate" last_modification_time="Thu, 01 Dec 2005 21:56:57 GMT"/>
</widget>
<property name="visible">True</property>
<property name="label" translatable="yes">light blue</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<property name="group">colorBlack</property>
<signal name="toggled" handler="on_colorLightBlue_activate" last_modification_time="Thu, 01 Dec 2005 21:56:57 GMT"/>
</widget>
<property name="visible">True</property>
<property name="label" translatable="yes">light green</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<property name="group">colorBlack</property>
<signal name="toggled" handler="on_colorLightGreen_activate" last_modification_time="Thu, 01 Dec 2005 21:56:57 GMT"/>
</widget>
<property name="visible">True</property>
<property name="label" translatable="yes">magenta</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<property name="group">colorBlack</property>
<signal name="toggled" handler="on_colorMagenta_activate" last_modification_time="Thu, 01 Dec 2005 21:56:57 GMT"/>
</widget>
<property name="visible">True</property>
<property name="label" translatable="yes">orange</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<property name="group">colorBlack</property>
<signal name="toggled" handler="on_colorOrange_activate" last_modification_time="Thu, 01 Dec 2005 21:56:57 GMT"/>
</widget>
<property name="visible">True</property>
<property name="label" translatable="yes">yellow</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<property name="group">colorBlack</property>
<signal name="toggled" handler="on_colorYellow_activate" last_modification_time="Thu, 01 Dec 2005 21:56:57 GMT"/>
</widget>
<property name="visible">True</property>
<property name="label" translatable="yes">white</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<property name="group">colorBlack</property>
<signal name="toggled" handler="on_colorWhite_activate" last_modification_time="Thu, 01 Dec 2005 21:56:57 GMT"/>
</widget>
<property name="visible">True</property>
<property name="label" translatable="yes">other...</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<property name="group">colorBlack</property>
<signal name="toggled" handler="on_colorOther_activate" last_modification_time="Thu, 01 Dec 2005 21:56:57 GMT"/>
</widget>
<property name="visible">True</property>
<property name="label" translatable="yes">very fine</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<signal name="toggled" handler="on_penthicknessVeryFine_activate" last_modification_time="Thu, 01 Dec 2005 19:29:18 GMT"/>
</widget>
</child>
<property name="visible">True</property>
<property name="label" translatable="yes">fine</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<property name="group">penthicknessVeryFine</property>
<signal name="toggled" handler="on_penthicknessFine_activate" last_modification_time="Thu, 01 Dec 2005 19:29:18 GMT"/>
</widget>
<property name="visible">True</property>
<property name="label" translatable="yes">medium</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<property name="group">penthicknessVeryFine</property>
<signal name="toggled" handler="on_penthicknessMedium_activate" last_modification_time="Thu, 01 Dec 2005 05:36:05 GMT"/>
</widget>
<property name="visible">True</property>
<property name="label" translatable="yes">thick</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<property name="group">penthicknessVeryFine</property>
<signal name="toggled" handler="on_penthicknessThick_activate" last_modification_time="Thu, 01 Dec 2005 05:36:05 GMT"/>
</widget>
<property name="visible">True</property>
<property name="label" translatable="yes">fine</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<signal name="toggled" handler="on_eraserFine_activate" last_modification_time="Thu, 01 Dec 2005 19:29:18 GMT"/>
</widget>
</child>
<property name="visible">True</property>
<property name="label" translatable="yes">medium</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<property name="group">eraserFine</property>
<signal name="toggled" handler="on_eraserMedium_activate" last_modification_time="Thu, 01 Dec 2005 19:29:18 GMT"/>
</widget>
<property name="visible">True</property>
<property name="label" translatable="yes">standard</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<signal name="toggled" handler="on_eraserStandard_activate" last_modification_time="Thu, 01 Dec 2005 19:29:18 GMT"/>
</widget>
</child>
<property name="visible">True</property>
<property name="label" translatable="yes">whiteout</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<property name="group">eraserStandard</property>
<signal name="toggled" handler="on_eraserWhiteout_activate" last_modification_time="Thu, 01 Dec 2005 19:29:18 GMT"/>
</widget>
<property name="visible">True</property>
<property name="label" translatable="yes">fine</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<signal name="toggled" handler="on_highlighterFine_activate" last_modification_time="Thu, 01 Dec 2005 05:36:05 GMT"/>
</widget>
</child>
<property name="visible">True</property>
<property name="label" translatable="yes">medium</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<property name="group">highlighterFine</property>
<signal name="toggled" handler="on_highlighterMedium_activate" last_modification_time="Thu, 01 Dec 2005 05:36:05 GMT"/>
</widget>
<signal name="activate" handler="on_toolsTextFont_activate" last_modification_time="Thu, 01 Dec 2005 20:54:08 GMT"/>
<child internal-child="image">
- <widget class="GtkImage" id="image588">
+ <widget class="GtkImage" id="image610">
<property name="visible">True</property>
<property name="stock">gtk-select-font</property>
<property name="icon_size">1</property>
<property name="visible">True</property>
<property name="label" translatable="yes">Eraser</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<property name="group">button2Pen</property>
<signal name="activate" handler="on_button2Eraser_activate" last_modification_time="Sun, 04 Jun 2006 14:33:10 GMT"/>
</widget>
<property name="visible">True</property>
<property name="label" translatable="yes">Highlighter</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<property name="group">button2Pen</property>
<signal name="activate" handler="on_button2Highlighter_activate" last_modification_time="Sun, 04 Jun 2006 14:33:10 GMT"/>
</widget>
<property name="visible">True</property>
<property name="label" translatable="yes">Text</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<property name="group">button2Pen</property>
<signal name="activate" handler="on_button2Text_activate" last_modification_time="Sun, 04 Jun 2006 14:33:10 GMT"/>
</widget>
<property name="visible">True</property>
<property name="label" translatable="yes">Select Region</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<property name="group">button2Pen</property>
<signal name="activate" handler="on_button2SelectRegion_activate" last_modification_time="Sun, 04 Jun 2006 14:33:10 GMT"/>
</widget>
<property name="visible">True</property>
<property name="label" translatable="yes">Select Rectangle</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<property name="group">button2Pen</property>
<signal name="activate" handler="on_button2SelectRectangle_activate" last_modification_time="Sun, 04 Jun 2006 14:33:10 GMT"/>
</widget>
<property name="visible">True</property>
<property name="label" translatable="yes">Vertical Space</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<property name="group">button2Pen</property>
<signal name="activate" handler="on_button2VerticalSpace_activate" last_modification_time="Sun, 04 Jun 2006 14:33:10 GMT"/>
</widget>
<property name="visible">True</property>
<property name="label" translatable="yes">Link to Primary Brush</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<signal name="activate" handler="on_button2LinkBrush_activate" last_modification_time="Sun, 04 Jun 2006 14:33:10 GMT"/>
</widget>
</child>
<property name="visible">True</property>
<property name="label" translatable="yes">Copy of Current Brush</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<property name="group">button2LinkBrush</property>
<signal name="activate" handler="on_button2CopyBrush_activate" last_modification_time="Sun, 04 Jun 2006 14:33:10 GMT"/>
</widget>
<widget class="GtkRadioMenuItem" id="button2NABrush">
<property name="label" translatable="yes">NA</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<property name="group">button2LinkBrush</property>
</widget>
</child>
<property name="visible">True</property>
<property name="label" translatable="yes">Eraser</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<property name="group">button3Pen</property>
<signal name="activate" handler="on_button3Eraser_activate" last_modification_time="Sun, 04 Jun 2006 14:33:10 GMT"/>
</widget>
<property name="visible">True</property>
<property name="label" translatable="yes">Highlighter</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<property name="group">button3Pen</property>
<signal name="activate" handler="on_button3Highlighter_activate" last_modification_time="Sun, 04 Jun 2006 14:33:10 GMT"/>
</widget>
<property name="visible">True</property>
<property name="label" translatable="yes">Text</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<property name="group">button3Pen</property>
<signal name="activate" handler="on_button3Text_activate" last_modification_time="Sun, 04 Jun 2006 14:33:10 GMT"/>
</widget>
<property name="visible">True</property>
<property name="label" translatable="yes">Select Region</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<property name="group">button3Pen</property>
<signal name="activate" handler="on_button3SelectRegion_activate" last_modification_time="Sun, 04 Jun 2006 14:33:10 GMT"/>
</widget>
<property name="visible">True</property>
<property name="label" translatable="yes">Select Rectangle</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<property name="group">button3Pen</property>
<signal name="activate" handler="on_button3SelectRectangle_activate" last_modification_time="Sun, 04 Jun 2006 14:33:10 GMT"/>
</widget>
<property name="visible">True</property>
<property name="label" translatable="yes">Vertical Space</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<property name="group">button3Pen</property>
<signal name="activate" handler="on_button3VerticalSpace_activate" last_modification_time="Sun, 04 Jun 2006 14:33:10 GMT"/>
</widget>
<property name="visible">True</property>
<property name="label" translatable="yes">Link to Primary Brush</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<signal name="activate" handler="on_button3LinkBrush_activate" last_modification_time="Sun, 04 Jun 2006 14:33:10 GMT"/>
</widget>
</child>
<property name="visible">True</property>
<property name="label" translatable="yes">Copy of Current Brush</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<property name="group">button3LinkBrush</property>
<signal name="activate" handler="on_button3CopyBrush_activate" last_modification_time="Sun, 04 Jun 2006 14:33:10 GMT"/>
</widget>
<widget class="GtkRadioMenuItem" id="button3NABrush">
<property name="label" translatable="yes">NA</property>
<property name="use_underline">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<property name="group">button3LinkBrush</property>
</widget>
</child>
</packing>
</child>
+ <child>
+ <widget class="GtkToolButton" id="buttonZoomSet">
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Set Zoom</property>
+ <property name="stock_id">gtk-find</property>
+ <property name="visible_horizontal">True</property>
+ <property name="visible_vertical">True</property>
+ <property name="is_important">False</property>
+ <signal name="clicked" handler="on_viewSetZoom_activate" last_modification_time="Sat, 22 Jul 2006 21:30:54 GMT"/>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+
<child>
<widget class="GtkToggleToolButton" id="buttonFullscreen">
<property name="visible">True</property>
</child>
</widget>
+<widget class="GtkDialog" id="zoomDialog">
+ <property name="visible">True</property>
+ <property name="title" translatable="yes">Set Zoom</property>
+ <property name="type">GTK_WINDOW_TOPLEVEL</property>
+ <property name="window_position">GTK_WIN_POS_NONE</property>
+ <property name="modal">True</property>
+ <property name="resizable">True</property>
+ <property name="destroy_with_parent">False</property>
+ <property name="decorated">True</property>
+ <property name="skip_taskbar_hint">False</property>
+ <property name="skip_pager_hint">False</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+ <property name="focus_on_map">True</property>
+ <property name="has_separator">True</property>
+
+ <child internal-child="vbox">
+ <widget class="GtkVBox" id="dialog-vbox3">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+
+ <child internal-child="action_area">
+ <widget class="GtkHButtonBox" id="dialog-action_area3">
+ <property name="visible">True</property>
+ <property name="layout_style">GTK_BUTTONBOX_END</property>
+
+ <child>
+ <widget class="GtkButton" id="cancelbutton2">
+ <property name="visible">True</property>
+ <property name="can_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-cancel</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="response_id">-6</property>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkButton" id="button1">
+ <property name="visible">True</property>
+ <property name="can_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-apply</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="response_id">-10</property>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkButton" id="button2">
+ <property name="visible">True</property>
+ <property name="can_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-ok</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="response_id">-5</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkVBox" id="vbox1">
+ <property name="border_width">8</property>
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">2</property>
+
+ <child>
+ <widget class="GtkHBox" id="hbox4">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+
+ <child>
+ <widget class="GtkRadioButton" id="radioZoom">
+ <property name="border_width">4</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Zoom: </property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="on_radioZoom_toggled" last_modification_time="Sat, 22 Jul 2006 21:53:23 GMT"/>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkSpinButton" id="spinZoom">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="climb_rate">1</property>
+ <property name="digits">0</property>
+ <property name="numeric">True</property>
+ <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+ <property name="snap_to_ticks">False</property>
+ <property name="wrap">False</property>
+ <property name="adjustment">100 10 1500 5 20 20</property>
+ <signal name="value_changed" handler="on_spinZoom_value_changed" last_modification_time="Sat, 22 Jul 2006 21:04:21 GMT"/>
+ </widget>
+ <packing>
+ <property name="padding">5</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">%</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.479999989271</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkRadioButton" id="radioZoom100">
+ <property name="border_width">4</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Normal size (100%)</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">radioZoom</property>
+ <signal name="toggled" handler="on_radioZoom100_toggled" last_modification_time="Sat, 22 Jul 2006 21:53:30 GMT"/>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkRadioButton" id="radioZoomWidth">
+ <property name="border_width">4</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Page Width</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">radioZoom</property>
+ <signal name="toggled" handler="on_radioZoomWidth_toggled" last_modification_time="Sat, 22 Jul 2006 21:53:37 GMT"/>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkRadioButton" id="radioZoomHeight">
+ <property name="border_width">4</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Page Height</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">radioZoom</property>
+ <signal name="toggled" handler="on_radioZoomHeight_toggled" last_modification_time="Sat, 22 Jul 2006 21:53:45 GMT"/>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+</widget>
+
</glade-interface>