+This version:
+ - win32 portability code (contributed by Dirk Gerrits)
+
Version 0.4.5 (Oct 2, 2009):
- bugfixes for GTK+ 2.16/2.17 issues with xinput events
- various minor UI bugfixes
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
subdir = .
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/config.h.in \
$(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \
- depcomp install-sh missing mkinstalldirs
+ config.guess config.sub depcomp install-sh missing \
+ mkinstalldirs
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
+build = @build@
build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
+host = @host@
host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
MSGFMT
USE_NLS
GETTEXT_PACKAGE
+WIN32_FALSE
+WIN32_TRUE
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
PACKAGE_LIBS
PACKAGE_CFLAGS
PKG_CONFIG
--program-prefix=PREFIX prepend PREFIX to installed program names
--program-suffix=SUFFIX append SUFFIX to installed program names
--program-transform-name=PROGRAM run sed PROGRAM on installed program names
+
+System types:
+ --build=BUILD configure for building on BUILD [guessed]
+ --host=HOST cross-compile to build programs to run on HOST [BUILD]
_ACEOF
fi
fi
-pkg_modules="gtk+-2.0 >= 2.10.0 libgnomecanvas-2.0 >= 2.4.0 poppler-glib >= 0.5.4"
+pkg_modules="gtk+-2.0 >= 2.10.0 libgnomecanvas-2.0 >= 2.4.0 poppler-glib >= 0.5.4 pangoft2 >= 1.0"
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+ { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
+$as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
+ { (exit 1); exit 1; }; }
+
+{ $as_echo "$as_me:$LINENO: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if test "${ac_cv_build+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+ ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+ { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
+$as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+ { (exit 1); exit 1; }; }
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+ { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
+$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
+ { (exit 1); exit 1; }; }
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
+$as_echo "$as_me: error: invalid value of canonical build" >&2;}
+ { (exit 1); exit 1; }; };;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:$LINENO: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if test "${ac_cv_host+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test "x$host_alias" = x; then
+ ac_cv_host=$ac_cv_build
+else
+ ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+ { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
+$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
+$as_echo "$as_me: error: invalid value of canonical host" >&2;}
+ { (exit 1); exit 1; }; };;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:$LINENO: checking for Win32 environment" >&5
+$as_echo_n "checking for Win32 environment... " >&6; }
+case "$host" in
+ *-*-mingw*)
+ os_win32=yes;;
+ *)
+ os_win32=no;;
+esac
+{ $as_echo "$as_me:$LINENO: result: $os_win32" >&5
+$as_echo "$os_win32" >&6; }
+ if test "$os_win32" = "yes"; then
+ WIN32_TRUE=
+ WIN32_FALSE='#'
+else
+ WIN32_TRUE='#'
+ WIN32_FALSE=
+fi
+
+
GETTEXT_PACKAGE=xournal
Usually this means the macro was only invoked conditionally." >&2;}
{ (exit 1); exit 1; }; }
fi
+if test -z "${WIN32_TRUE}" && test -z "${WIN32_FALSE}"; then
+ { { $as_echo "$as_me:$LINENO: error: conditional \"WIN32\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"WIN32\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
: ${CONFIG_STATUS=./config.status}
ac_write_fail=0
AC_PROG_RANLIB
AC_HEADER_STDC
-pkg_modules="gtk+-2.0 >= 2.10.0 libgnomecanvas-2.0 >= 2.4.0 poppler-glib >= 0.5.4"
+pkg_modules="gtk+-2.0 >= 2.10.0 libgnomecanvas-2.0 >= 2.4.0 poppler-glib >= 0.5.4 pangoft2 >= 1.0"
PKG_CHECK_MODULES(PACKAGE, [$pkg_modules])
AC_SUBST(PACKAGE_CFLAGS)
AC_SUBST(PACKAGE_LIBS)
+dnl detect Win32 environment...
+AC_CANONICAL_HOST
+AC_MSG_CHECKING([for Win32 environment])
+case "$host" in
+ *-*-mingw*)
+ os_win32=yes;;
+ *)
+ os_win32=no;;
+esac
+AC_MSG_RESULT([$os_win32])
+AM_CONDITIONAL(WIN32, test "$os_win32" = "yes")
+
GETTEXT_PACKAGE=xournal
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package.])
## Process this file with automake to produce Makefile.in
-SUBDIRS = ttsubset
+if WIN32
+ SUBDIRS = ttsubset win32
+else
+ SUBDIRS = ttsubset
+endif
INCLUDES = \
-DPACKAGE_DATA_DIR=\""$(datadir)"\" \
xo-callbacks.c xo-callbacks.h \
xo-shapes.c xo-shapes.h
-xournal_LDADD = ttsubset/libttsubset.a @PACKAGE_LIBS@ $(INTLLIBS)
+if WIN32
+ xournal_LDFLAGS = -mwindows
+ xournal_LDADD = win32/xournal.res ttsubset/libttsubset.a @PACKAGE_LIBS@ $(INTLLIBS) -lz
+else
+ xournal_LDADD = ttsubset/libttsubset.a @PACKAGE_LIBS@ $(INTLLIBS)
+endif
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
bin_PROGRAMS = xournal$(EXEEXT)
subdir = src
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in TODO
xo-callbacks.$(OBJEXT) xo-shapes.$(OBJEXT)
xournal_OBJECTS = $(am_xournal_OBJECTS)
am__DEPENDENCIES_1 =
-xournal_DEPENDENCIES = ttsubset/libttsubset.a $(am__DEPENDENCIES_1)
+@WIN32_FALSE@xournal_DEPENDENCIES = ttsubset/libttsubset.a \
+@WIN32_FALSE@ $(am__DEPENDENCIES_1)
+@WIN32_TRUE@xournal_DEPENDENCIES = win32/xournal.res \
+@WIN32_TRUE@ ttsubset/libttsubset.a $(am__DEPENDENCIES_1)
+xournal_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(xournal_LDFLAGS) \
+ $(LDFLAGS) -o $@
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
distdir
ETAGS = etags
CTAGS = ctags
-DIST_SUBDIRS = $(SUBDIRS)
+DIST_SUBDIRS = ttsubset win32
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
am__relativize = \
dir0=`pwd`; \
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
+build = @build@
build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
+host = @host@
host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-SUBDIRS = ttsubset
+@WIN32_FALSE@SUBDIRS = ttsubset
+@WIN32_TRUE@SUBDIRS = ttsubset win32
INCLUDES = \
-DPACKAGE_DATA_DIR=\""$(datadir)"\" \
-DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
xo-callbacks.c xo-callbacks.h \
xo-shapes.c xo-shapes.h
-xournal_LDADD = ttsubset/libttsubset.a @PACKAGE_LIBS@ $(INTLLIBS)
+@WIN32_TRUE@xournal_LDFLAGS = -mwindows
+@WIN32_FALSE@xournal_LDADD = ttsubset/libttsubset.a @PACKAGE_LIBS@ $(INTLLIBS)
+@WIN32_TRUE@xournal_LDADD = win32/xournal.res ttsubset/libttsubset.a @PACKAGE_LIBS@ $(INTLLIBS) -lz
all: all-recursive
.SUFFIXES:
-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
xournal$(EXEEXT): $(xournal_OBJECTS) $(xournal_DEPENDENCIES)
@rm -f xournal$(EXEEXT)
- $(LINK) $(xournal_OBJECTS) $(xournal_LDADD) $(LIBS)
+ $(xournal_LINK) $(xournal_OBJECTS) $(xournal_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
List of features to be implemented (not in any particular order)
----------------------------------------------------------------
-THINGS DONE IN THIS RELEASE:
-
-DONE: fix GTK+ 2.16/2.17 XInput issues with scrollbars and menus
-DONE: fix bug 2826845 (shape recognizer accel doesn't work in fullscreen mode)
-DONE: bug affecting resize zone in statusbar
-DONE: page spinbutton wide enough for 3 digits; avoid "deprecated" warning
-DONE: edit->paste command should refresh toolbar to unselect color/thickness
- (so can repaint sel)
-DONE: cursor doesn't reset properly after selection operation if primary
- tool is select mode (stays with arrow cursor instead of pointer)
-DONE: device with "eraser" at the end of its name is of type ERASER
- (Edward Yang)
-DONE: fix_xinput_coords() replaces buggy xinput events by core pointer
- coordinates
-DONE: use poppler to render PDF backgrounds (after patches contributed
- by Mike Ter Louw and Bob McElrath)
-DONE: gettext internationalization (contributed by David Planella)
-DONE: Catalan translation (by David Planella); French translation
-DONE: fix unresponsiveness to button events in text edition box (GTK+ 2.17)
- and segfaults when dragging text or using Layers combobox (GTK+ 2.17)
-DONE: Esc leaves text box if editing; and leaves fullscreen mode
-DONE: package our own copy of the ttsubset library (to remove a dependency
- on libgnomeprint), and create TT subfonts in memory
-DONE: use gtk-print instead of libgnomeprint
-DONE: remove deprecated "antialias bg" option
-DONE: fix fix_xinput_coords so it works ok without ENABLE_XINPUT_BUGFIX ?
-DONE: disable ctrl-left/right accelerators during text edition
-DONE: custom color chooser button (after a patch contributed by Alex Ray)
-DONE: remember last used directory (after a patch contributed by Lu Zhihe)
-DONE: discard Alt-click and Control-click events
-DONE: option to have buttons *toggle* the tool rather than act as tool
- (ie button 2 causes button 1 to map to tool 2) [Dylan Thurston]
-DONE: patch to fix focus + allow up/dn in single page mode (Bob McElrath)
-DONE: patch to fix underscores in MRU filename display (Bob McElrath)
-DONE: patch to avoid tiny file dialogs (Bob McElrath)
-DONE: further fixes for focus; can Esc out of page selection box
-DONE: further fixes for xinput under GTK+ 2.17
-DONE: option to auto-load *.pdf.xoj instead of *.pdf (Bob McElrath)
-DONE: look for PDF backgrounds in path of xoj file before prompting user
-DONE: paper color chooser (after a patch by ojb)
-DONE: remove "Discard core events" from options menu
-DONE: get_pressure_multiplier() accesses correct members of event union
-DONE: address recognizer bug on single-segment strokes (division by 0)
-DONE: remove binary installer (poppler is binary incompatible across versions)
- but provide configure script
-
-REMAINING THINGS TO DO:
-
- collaborative editing (see discussion with Erik Demaine)
-- porting to Win32 and MacOS; merge Nokia port
+- porting to MacOS; merge Nokia port
- multiple-scenario undo history
- collaborative: allow non-x86 endianness (for ints, for floats?)
or see if removing the GTK bugfix would help? -- e.g. by recalling an
internal gtk init function?
+BUGS:
+** lingering issues with synaptics touchpads? (#2872667)
+ - add patch 0.4.5-fix-synaptics-v1.patch (fix ButtonDown events)
+ - set device to Absolute mode at startup? (GDK doesn't expose API,
+ cf XSetDeviceMode() in /usr/include/X11/extensions/XInput.h)
+** color picker into canvas doesn't work in GTK+ 2.16 (should disable
+ xinput first?)
+
+WIN32:
+- test further
+- write an installer
+
+PATCHES TO INCORPORATE:
+** Italian translation (add_it_po.patch unless updated on tracker)
+ (by Marco Poletti)
** patch: ortho/snap (revised Apr 13 2009)
xournal_ortho_snap_patch_4 (by Josef Pavlicek)
** patch (Ian-Woo Kim): multicolumn mode + LASSO SELECTION
xournal_lasso_multipage_zoom_button_20090620.patch
-** autosave patch (Edward Yang) (fix: optional only, w/ menu + cfgfile
+** autosave patch (Edward Yang) (should fix: optional only, w/ menu + cfgfile
entries; fix: should clean up autosave.xoj.bg* files too; config interval)
0001-Implement-autosave-for-documents-revised.patch (2 seconds after
modification, vs original 5 seconds)
+ *** NEW VERSION: #2881919 (autosave for 0.4.5, w/ some changes)
+ NB: last modif should be triggered by prepare_new_undo() and undo/redo?
- PDF bg memory usage throttling / delete oldest pdf backgrounds
- replace ttsubset by something more modern? (eg. from cairo ?)
- allow toolbar to go vertical
- toolbar buttons should react to button 2/3 click to modify settings
- for that tool?
+ for that tool!!
- paste text directly into xournal, from xournal?
(instead of starting a text item and pasting into/from it)
- insert links (to URLs; within document/to other xoj? hand mode navigates)
-- increase width of spinPageNo to fit 3 digits
-- should escape '_' to '__' in MRU menu entries (else become mnemonics)
- a command + keyboard shortcut to switch mappings (1<->2, 1<->3, 2<->3)
(A. Rechnitzer Sept 11, 2007)
- modify encoding of TrueType font subsets or provide cmap so pdf text
- export as SVG, as bitmap (use Cairo for this)
- improved PDF viewer features (search text, hyperlink, page borders...)
(using full poppler api ?)
+- search text: among PDF background (using poppler); among text annotations
- use system paper size as default (/etc/papersize)
-- autoload *.pdf.xoj if present when opening *.pdf ???
- sticky notes (anchor visually text box to a bg location)
- use relative paths for bg documents (e.g. annotated PDF)
- flush display queue when drawing over a slow X server?
- lasso selection tool (see shoffsta patch)
(http://shoffsta.afraid.org/Projects/Xournal/)
- flatten (incl undo/redo...) - enabled only if nlayers>1
-- color chooser (papercolor, pen color); maybe more default colors
- cf. ojb patch #2083103 adds paper color chooser
+- color chooser (papercolor, pen color); have default colors and a history
+ appear as palette in there!
- printing: print-options, save printer settings (throughout a session,
and on disk) (maybe a separate config file .xournal/gnome-print-settings)
- help index
--- /dev/null
+all: xournal.res
+all-recursive: all
+install-recursive:
+install:
+
+xournal.res: xournal.rc
+ windres xournal.rc -O coff -o xournal.res
--- /dev/null
+id ICON "xournal.ico"
}
else {
curtime = time(NULL);
- strftime(stime, 30, "%F-Note-%H-%M.xoj", localtime(&curtime));
+ strftime(stime, 30, "%Y-%m-%d-Note-%H-%M.xoj", localtime(&curtime));
if (ui.default_path!=NULL)
gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER (dialog), ui.default_path);
gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER (dialog), stime);
gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER (dialog), g_basename(in_fn));
} else {
curtime = time(NULL);
- strftime(stime, 30, "%F-Note-%H-%M.pdf", localtime(&curtime));
+ strftime(stime, 30, "%Y-%m-%d-Note-%H-%M.pdf", localtime(&curtime));
if (ui.default_path!=NULL)
gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER (dialog), ui.default_path);
gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER (dialog), stime);
aboutDialog = create_aboutDialog ();
labelTitle = GTK_LABEL(g_object_get_data(G_OBJECT(aboutDialog), "labelTitle"));
gtk_label_set_markup(labelTitle,
- "<span size=\"xx-large\" weight=\"bold\">Xournal " VERSION "</span>");
+ "<span size=\"xx-large\" weight=\"bold\">Xournal " VERSION_STRING "</span>");
gtk_dialog_run (GTK_DIALOG(aboutDialog));
gtk_widget_destroy(aboutDialog);
}
}
if ((event->state & (GDK_CONTROL_MASK|GDK_MOD1_MASK)) != 0) return FALSE;
// no control-clicking or alt-clicking
+ if (!is_core) gdk_device_get_state(event->device, event->window, event->axes, NULL);
+ // synaptics touchpads send bogus axis values with ButtonDown
if (!is_core)
fix_xinput_coords((GdkEvent *)event);
ui.which_mouse_button = event->button;
switch_mapping(mapping);
+#ifdef WIN32
+ update_cursor();
+#endif
// in text tool, clicking in a text area edits it
if (ui.toolno[mapping] == TOOL_TEXT) {
#include <libgnomecanvas/libgnomecanvas.h>
#include <zlib.h>
#include <math.h>
-#include <gdk/gdkx.h>
-#include <X11/Xlib.h>
#include <locale.h>
#include <glib.h>
#include <glib/gstdio.h>
#include <poppler/glib/poppler.h>
+#ifndef WIN32
+ #include <gdk/gdkx.h>
+ #include <X11/Xlib.h>
+#endif
+
#include "xournal.h"
#include "xo-interface.h"
#include "xo-support.h"
GList *pagelist, *layerlist, *itemlist, *list;
GtkWidget *dialog;
- f = gzopen(filename, "w");
+ f = gzopen(filename, "wb");
if (f==NULL) return FALSE;
chk_attach_names();
success = FALSE;
if (bgpdf.status != STATUS_NOT_INIT && bgpdf.file_contents != NULL)
{
- tmpf = fopen(tmpfn, "w");
+ tmpf = fopen(tmpfn, "wb");
if (tmpf != NULL && fwrite(bgpdf.file_contents, 1, bgpdf.file_length, tmpf) == bgpdf.file_length)
success = TRUE;
fclose(tmpf);
}
g_free(tmpfn);
- f = gzopen(filename, "r");
+ f = gzopen(filename, "rb");
if (f==NULL) return FALSE;
if (filename[0]=='/') {
if (ui.default_path != NULL) g_free(ui.default_path);
char *pipename;
int buflen, remnlen, file_pageno;
- f = fopen(filename, "r");
+ f = fopen(filename, "rb");
if (f == NULL) return NULL;
buf = g_malloc(BUFSIZE); // a reasonable buffer size
if (fread(buf, 1, 4, f) !=4 ||
fclose(f);
pipename = g_strdup_printf(GS_CMDLINE, (double)GS_BITMAP_DPI, filename);
- gs_pipe = popen(pipename, "r");
+ gs_pipe = popen(pipename, "rb");
g_free(pipename);
bg_list = NULL;
struct Background *attempt_screenshot_bg(void)
{
+#ifndef WIN32
struct Background *bg;
GdkPixbuf *pix;
XEvent x_event;
bg->filename = new_refstring(NULL);
bg->file_domain = DOMAIN_ATTACH;
return bg;
+#else
+ // not implemented under WIN32
+ return FALSE;
+#endif
}
/************** pdf annotation ***************/
#include <gtk/gtk.h>
#include <libgnomecanvas/libgnomecanvas.h>
#include <gdk/gdkkeysyms.h>
-#include <X11/Xlib.h>
#include "xournal.h"
#include "xo-interface.h"
if (gtk_check_version(2, 10, 0)) {
gtk_widget_hide(GET_COMPONENT("filePrint"));
}
+
+ /* screenshot feature doesn't work yet in Win32 */
+#ifdef WIN32
+ gtk_widget_hide(GET_COMPONENT("journalScreenshot"));
+#endif
}
// toggle fullscreen mode
gtk_toggle_tool_button_set_active(
GTK_TOGGLE_TOOL_BUTTON(GET_COMPONENT("buttonFullscreen")), ui.fullscreen);
- if (ui.fullscreen) gtk_window_fullscreen(GTK_WINDOW(winMain));
- else gtk_window_unfullscreen(GTK_WINDOW(winMain));
-
+ if (ui.fullscreen) {
+#ifdef WIN32
+ gtk_window_get_size(GTK_WINDOW(winMain), &ui.pre_fullscreen_width, &ui.pre_fullscreen_height);
+ gtk_widget_set_size_request(GTK_WIDGET(winMain), gdk_screen_width(),
+ gdk_screen_height());
+#endif
+ gtk_window_fullscreen(GTK_WINDOW(winMain));
+ }
+ else {
+#ifdef WIN32
+ gtk_widget_set_size_request(GTK_WIDGET(winMain), -1, -1);
+ gtk_window_resize(GTK_WINDOW(winMain), ui.pre_fullscreen_width,
+ ui.pre_fullscreen_height);
+#endif
+ gtk_window_unfullscreen(GTK_WINDOW(winMain));
+ }
+
update_vbox_order(ui.vertical_order[ui.fullscreen?1:0]);
}
#include "xo-misc.h"
#include "xo-paint.h"
+/***** Win32 fix for gdk_cursor_new_from_pixmap() by Dirk Gerrits ****/
+
+#ifdef WIN32
+gboolean colors_too_similar(const GdkColor *colora, const GdkColor *colorb)
+{
+ return (abs(colora->red - colorb->red) < 256 &&
+ abs(colora->green - colorb->green) < 256 &&
+ abs(colora->blue - colorb->blue) < 256);
+}
+
+/* gdk_cursor_new_from_pixmap is broken on Windows.
+ this is a workaround using gdk_cursor_new_from_pixbuf. */
+GdkCursor* fixed_gdk_cursor_new_from_pixmap(GdkPixmap *source, GdkPixmap *mask,
+ const GdkColor *fg, const GdkColor *bg,
+ gint x, gint y)
+{
+ GdkPixmap *rgb_pixmap;
+ GdkGC *gc;
+ GdkPixbuf *rgb_pixbuf, *rgba_pixbuf;
+ GdkCursor *cursor;
+ int width, height;
+
+ /* HACK! It seems impossible to work with RGBA pixmaps directly in
+ GDK-Win32. Instead we pick some third color, different from fg
+ and bg, and use that as the 'transparent color'. We do this using
+ colors_too_similar (see above) because two colors could be
+ unequal in GdkColor's 16-bit/sample, but equal in GdkPixbuf's
+ 8-bit/sample. */
+ GdkColor candidates[3] = {{0,65535,0,0}, {0,0,65535,0}, {0,0,0,65535}};
+ GdkColor *trans = &candidates[0];
+ if (colors_too_similar(trans, fg) || colors_too_similar(trans, bg)) {
+ trans = &candidates[1];
+ if (colors_too_similar(trans, fg) || colors_too_similar(trans, bg)) {
+ trans = &candidates[2];
+ }
+ } /* trans is now guaranteed to be unique from fg and bg */
+
+ /* create an empty pixmap to hold the cursor image */
+ gdk_drawable_get_size(source, &width, &height);
+ rgb_pixmap = gdk_pixmap_new(NULL, width, height, 24);
+
+ /* blit the bitmaps defining the cursor onto a transparent background */
+ gc = gdk_gc_new(rgb_pixmap);
+ gdk_gc_set_fill(gc, GDK_SOLID);
+ gdk_gc_set_rgb_fg_color(gc, trans);
+ gdk_draw_rectangle(rgb_pixmap, gc, TRUE, 0, 0, width, height);
+ gdk_gc_set_fill(gc, GDK_OPAQUE_STIPPLED);
+ gdk_gc_set_stipple(gc, source);
+ gdk_gc_set_clip_mask(gc, mask);
+ gdk_gc_set_rgb_fg_color(gc, fg);
+ gdk_gc_set_rgb_bg_color(gc, bg);
+ gdk_draw_rectangle(rgb_pixmap, gc, TRUE, 0, 0, width, height);
+ gdk_gc_unref(gc);
+
+ /* create a cursor out of the created pixmap */
+ rgb_pixbuf = gdk_pixbuf_get_from_drawable(
+ NULL, rgb_pixmap, gdk_colormap_get_system(), 0, 0, 0, 0, width, height);
+ gdk_pixmap_unref(rgb_pixmap);
+ rgba_pixbuf = gdk_pixbuf_add_alpha(
+ rgb_pixbuf, TRUE, trans->red, trans->green, trans->blue);
+ gdk_pixbuf_unref(rgb_pixbuf);
+ cursor = gdk_cursor_new_from_pixbuf(gdk_display_get_default(), rgba_pixbuf, x, y);
+ gdk_pixbuf_unref(rgba_pixbuf);
+
+ return cursor;
+}
+#define gdk_cursor_new_from_pixmap fixed_gdk_cursor_new_from_pixmap
+#endif
+
+
/************** drawing nice cursors *********/
static char cursor_pen_bits[] = {
struct PdfFont *font;
char *tmpbuf;
- f = fopen(filename, "w");
+ f = fopen(filename, "wb");
if (f == NULL) return FALSE;
setlocale(LC_NUMERIC, "C");
annot = FALSE;
#define MRU_SIZE 8
#define CONFIG_FILE "config"
+// version string for about box
+
+#ifdef WIN32
+#define VERSION_STRING VERSION "-win32"
+#else
+#define VERSION_STRING VERSION
+#endif
+
// DATA STRUCTURES AND CONSTANTS
#define PIXEL_MOTION_THRESHOLD 0.3
gboolean shorten_menus; // shorten menus ?
gchar *shorten_menu_items; // which items to hide
gboolean is_sel_cursor; // displaying a selection-related cursor
+ gint pre_fullscreen_width, pre_fullscreen_height; // for win32 fullscreen
#if GTK_CHECK_VERSION(2,10,0)
GtkPrintSettings *print_settings;
#endif