54 Commits

Author SHA1 Message Date
Colomban Wendling
b82134e021 printing: Fix line number margin border position 2012-08-27 21:28:46 +02:00
Colomban Wendling
4db0813a79 Rewrite GTK printing using Scintilla
We used to draw the pages to print ourselves, but it is a tedious and
error-prone task (and we did made mistakes) that Scintilla would do
better by itself.  So, rewrite the GTK (e.g. non-external) print code
to use Scintilla's built-in capabilities of drawing the buffer's
content on the pages.

Not only this makes the code a lot simpler and shorter, but it gives a
more accurate render (proper handling of tab stops, wrapping on word
boundaries, no missing character when a wrapped line spans on multiple
pages, ...), and it is noticeably faster (around 3 times).

Additionally we now paginate properly, which fixes printing starting
after page 1 or printing non-contiguous pages (we used to always print
starting from page 1 and counting, no matter what pages were selected).

However, note that obviously the render is not the same, even though
it's quite similar.
2012-07-30 03:37:00 +02:00
Colomban Wendling
5772178d3a printing: Avoid an useless allocation 2012-07-30 01:38:59 +02:00
Colomban Wendling
1c2c455b1d Update copyright information 2012-06-18 01:15:04 +02:00
Colomban Wendling
0aea05d10d Fix various integer signedness and minor styling issues
Most noteworthy change is that all build commands IDs and groups are
now unsigned everywhere negative values aren't explicitly handled with
a special meaning.  This should not change anything in behavior, only
makes clear the index won't underflow.
2011-12-18 00:32:22 +01:00
Matthew Brush
bd5fba7eb5 Remove extra whitespace at end of lines in all source files.
* Processed with rstrip-whitespace.py script added to scripts/ directory.
* Script run on all .c and .h files in src/ and plugins/ directories.
* Also remove more than one newline at the end of files.
2011-10-11 21:52:58 -07:00
Colomban Wendling
d06e9f4575 Remove $Id$ and $Date$ SVN keywords 2011-10-09 22:57:35 +02:00
Colomban Wendling
f1f7cac2fd Fix unlikely but theoretically possible use of an uninitialized variable
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5884 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-08-06 18:33:04 +00:00
Colomban Wendling
acc1ad557c Enable GTK printing support unconditionally
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5841 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-06-13 20:42:31 +00:00
Colomban Wendling
5d606ce351 Deprecate ui_widget_set_tooltip_text() in favor of gtk_widget_set_tooltip_text()
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5840 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-06-13 18:41:50 +00:00
Colomban Wendling
7698bf60a7 Improve usage of G_(UN)?LIKELY()
G_(UN)?LIKELY() should be only used on whole conditional expressions,
and only if the branching is very highly predictable, not if it is only
more probable.

These macros should be used with care because a wrong prediction may
be a lot worst than what a good prediction can give.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5625 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-03-24 22:00:18 +00:00
Enrico Tröger
6ac2623208 Update copyright information.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5528 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-01-19 19:39:09 +00:00
Nick Treleaven
ed96015c98 Always use white background color when printing (except for text
with a white foreground) to save ink (should fix #2968998).



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5079 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-07-01 16:22:45 +00:00
Enrico Tröger
7ba4a81181 Update copyright information.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4518 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-01-01 22:55:18 +00:00
Enrico Tröger
d3c731575c Improve printing status texts (patch by Dominic Hopf, thanks).
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4430 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-11-17 22:56:46 +00:00
Enrico Tröger
a41e95b392 Enable embedded page setup properties in the (Unix) Print dialog on newer GTK versions (closes #2870596).
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4286 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-10-03 16:17:22 +00:00
Nick Treleaven
bc2b6829c5 Make ui_entry_add_clear_icon() take a GtkEntry, not GtkWidget.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4220 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-09-21 16:46:16 +00:00
Enrico Tröger
ba59bcd0dc Plug a small memory leak and improve function signature of add_page_header().
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4207 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-09-17 18:03:18 +00:00
Enrico Tröger
08f4d7c178 Fix wrong alignment of printed pages when page headers are disabled (closes #2856822).
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4206 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-09-17 18:00:06 +00:00
Nick Treleaven
d563da620c Rename utils_str_replace() utils_str_replace_all(), setting a
'gchar **haystack' argument instead of returning a new string.



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4014 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-07-23 16:01:45 +00:00
Nick Treleaven
87e8f51e36 Add warning when printing and editor font is not monospaced.
Fix using GtkMessageType instead of gint param for
dialogs_show_msgbox*().
Add missing G_GNUC_PRINTF macro check to API dialog funcs.



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3944 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-07-09 13:51:37 +00:00
Enrico Tröger
5c91e8aefd Add utils_color_invert() and use it in highlighting.c and printing.c.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3773 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-05-08 17:00:28 +00:00
Enrico Tröger
63dc62101a Ignore the invert syntax highlighting colours setting when printing to not print characters on a dark background (closes #2785244).
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3764 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-05-02 17:27:59 +00:00
Enrico Tröger
ab88bb8270 Minor string improvements (spotted by Jean-Philippe Moal, thanks).
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3691 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-04-06 16:01:15 +00:00
Enrico Tröger
fbbe778eeb Fix punctuation.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3621 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-03-05 13:03:51 +00:00
Enrico Tröger
49b5c0671c Allow an empty value for the date format in the print settings to omit the date/time string in the print header.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3599 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-02-24 18:27:21 +00:00
Enrico Tröger
4ffd7f2ed9 Add a clear icon to the used text entries all over the place (will be available with GTK >= 2.16).
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3570 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-02-10 21:10:50 +00:00
Enrico Tröger
644a9cfbff Add a progressbar widget to the statusbar and use it to show progress when building with the Make commands, when printing and when using Find in Files.
Add progressbar convenience functions and ui_entry_add_clear_icon() to the plugin API.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3517 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-01-27 20:19:43 +00:00
Enrico Tröger
ffebb43c8e Remove tooltips from menu items.
Don't use full stops in tooltips for short sentences.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3470 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-01-15 19:15:41 +00:00
Enrico Tröger
39a6eb455e Update copyright information.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3446 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-01-04 18:30:42 +00:00
Enrico Tröger
81ffd05aa1 dd ui_widget_set_tooltip_text() as a convenience function to easily set tooltips for widgets. It uses gtk_widget_set_tooltip_text() on GTK >= 2.12 otherwise the old tooltips API.Use ui_widget_set_tooltip_text().
Use ui_widget_set_tooltip_text() in the plugins.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3250 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-11-18 20:14:42 +00:00
Enrico Tröger
b82c2ee714 Set 'can_focus' property on some checkboxes in the prefs dialog which were missing it.
Enable 'focus_on_click' property on most checkboxes in the prefs dialog to ease keyboard navigation.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2915 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-09-01 11:11:33 +00:00
Nick Treleaven
664a1d77f0 Fix using correct display tab width when the Tabs & Spaces indent
type is set.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2865 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-08-08 14:33:23 +00:00
Enrico Tröger
19247c47b8 Fix compilation with GTK >= 2.10.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2864 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-08-08 07:47:06 +00:00
Enrico Tröger
8d67117d47 Rename "delete_event" to "delete-event".
Remove some unnecessary GObject casts in g_signal_connect() calls.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2788 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-07-18 13:40:48 +00:00
Nick Treleaven
7db4bfe493 Rename GeanyEditor::scintilla to GeanyEditor::sci.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/editor-struct@2776 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-07-14 11:13:54 +00:00
Nick Treleaven
8dcfb7e336 Update for doc->editor->scintilla.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/editor-struct@2764 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-07-08 11:26:09 +00:00
Enrico Tröger
d3439f8a17 Use document pointer instead of an index to the documents array everywhere in the core code.
Pass a document pointer to the callbacks of all "document-*" signals.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/document-pointer@2692 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-06-15 13:35:48 +00:00
Enrico Tröger
2baec0ea70 Remove code that should not have been comitted. Oops.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2627 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-05-29 18:07:18 +00:00
Enrico Tröger
d8897914a8 Fix build with GTK >= 2.10.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2625 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-05-29 17:31:27 +00:00
Nick Treleaven
be0d9e8ea7 Note: this breaks the plugin API.
Replace doc_array with documents_array, a pointer array. This is
necessary to avoid breaking the ABI every time a field is added to
GeanyDocument.
Remove deprecated pluginmacros.h documents macro, to avoid a
conflict.
Replace doc_list[] macro with documents[] macro, which returns a
GeanyDocument pointer.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2624 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-05-29 17:00:54 +00:00
Nick Treleaven
398efbd373 Note: this commit breaks the plugin API.
Split widget fields out of GeanyApp into GeanyMainWidgets, so other
data items can be added without breaking the plugin ABI.
Add GeanyData::main_widgets, and macro.
Rename treeview_notebook sidebar_notebook in GeanyMainWidgets.
Move tools_menu from GeanyData to GeanyMainWidgets.
Move statusbar out of GeanyApp (shouldn't be used directly).
Move ignore_callback out of GeanyApp.
Rename sci_goto_line() argument unfold, like sci_goto_pos().
Make utils_goto_file_pos(), utils_goto_line(),
utils_switch_document() into static functions (they are UI-related,
so shouldn't be in utils.c).
Move utils_goto_pos() to editor.c, add mark argument.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2609 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-05-22 14:41:28 +00:00
Enrico Tröger
311b82ebb2 Rename document struct to GeanyDocument.
Rename filetype struct to GeanyFiletype.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2594 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-05-16 14:17:54 +00:00
Enrico Tröger
72f6acde81 Fix compilation with GTK >= 2.10.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2593 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-05-16 13:30:41 +00:00
Nick Treleaven
3a12da9daf Note: this commit breaks the plugin API (but is necessary so that in
future the ABI can stay stable when adding preferences).
Split up prefs into interface_prefs, toolbar_prefs, file_prefs,
search_prefs, tool_prefs, template_prefs, and add these to the
plugin API.
Move suppress_search_dialogs and search_use_current_word to
search_prefs, and rename accordingly.
Rename switch_msgwin_pages pref to switch_to_status.
Remove toolbar_ prefix for toolbar_prefs items.
Remove tool_ prefix for tool_prefs items.
Remove template_ prefix for template_prefs items.
Add Geany prefix for EditorPrefs.
Add Geany prefix for SearchPrefs.
Initialize search_prefs to zero in main.c.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2591 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-05-16 12:08:39 +00:00
Enrico Tröger
b7bfb2743a Replace all C++-style comments with usual C-like multi-line comments.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2287 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-02-27 13:17:29 +00:00
Enrico Tröger
dc9ee75785 Fix losing line breaks when printing a file with LF line endings and a non-Ascii character at the end of a line.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2201 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-01-31 15:18:13 +00:00
Enrico Tröger
0bf9496a97 Fix crash on Windows when printing an untitled file.
Fix black line number margin when printing by using also pre-defined styles.	 


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2194 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-01-27 18:27:33 +00:00
Enrico Tröger
70bdbb491b Fix crash on Windows when printing an untitled file.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2193 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-01-27 17:44:18 +00:00
Enrico Tröger
3775f8f551 Avoid double status message if print dialog was cancelled.
Print status messages in status-changed handler.      


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2167 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-01-12 11:03:52 +00:00