101 Commits

Author SHA1 Message Date
Enrico Tröger
f1eb8dc22d Ellipsize tab labels and some status messages for very long filenames (closes #2777348).
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3718 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-04-21 20:52:51 +00:00
Enrico Tröger
a9dc990049 Start using G_LIKELY/G_UNLIKELY macros to gain a little more performance when building the code with gcc.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3687 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-04-05 21:07:40 +00:00
Enrico Tröger
d6c1d1e801 Add editor_get_word_at_pos() as a convenient function to retrieve the word at a given position.
Make document_get_status_color() returning a const GdkColor.
Add editor_get_word_at_pos() and document_get_status_color() to the plugin API.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3567 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-02-08 19:52:21 +00:00
Enrico Tröger
de3d3b42fb Add document_save_file_as and document_rename_file to the plugin API.
If GIO is available, use GFileMonitor to watch for file disk changes and indicate them immediately using an orange tab label colour.
Break plugin ABI for this and the last commits.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3484 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-01-18 18:19:58 +00:00
Enrico Tröger
c636728975 Fix several compiler warnings and build errors (patch by Daniel Richard G., thanks).
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3460 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-01-11 18:29:39 +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
Nick Treleaven
5e85300f65 Deprecate pluginmacros.h in favour of geanyfunctions.h.
Move geany macro to plugindata.h.
Remove geanyfunctions.h dependency on pluginmacros.h.



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3311 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-12-04 13:26:48 +00:00
Nick Treleaven
5763dfbe2d Add document_index(), filetypes_index() array accessor functions to
the plugin API.



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3310 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-12-03 18:03:54 +00:00
Enrico Tröger
ac52e42417 Show the full filename of a document as tooltip on the tab labels.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3248 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-11-18 20:13:29 +00:00
Nick Treleaven
46cae47182 Use GeanyDocumentPrivate instead of using inheritance for non-public
fields (this was unnecessary and meant using ugly casts).


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3010 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-09-26 17:28:50 +00:00
Enrico Tröger
437fafd46e Move document_apply_update_prefs() in editor.c.
Refactor get_indent_guides_from_lexer() from sciwrappers.c in editor_set_indentation_guides().

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2979 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-09-21 16:43:45 +00:00
Nick Treleaven
82399858ee Add more dox explaining how to use documents_array (moved from
document.h, to minimise rebuilding after adding dox).
Remove some mentions of document indexes in document.c comments.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2812 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-07-24 15:17:55 +00:00
Nick Treleaven
c5fb6b34bc Add new Files pref 'Allow new documents from the command-line'.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2796 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-07-21 14:28:46 +00:00
Nick Treleaven
000e8fcc9b Merge the editor-struct branch:
Note: this breaks the plugin API for editor-related document fields
and functions.
Split new GeanyEditor struct type from GeanyDocument fields sci,
line_wrapping, auto_indent, scroll_percent, use_tabs, line_breaking.
GeanyEditor::document allows access back to document fields.
Add GeanyDocument::editor field; this is only valid when the
document is valid, and NULL otherwise. This means any checks for
doc->editor->scintilla != NULL will segfault for invalid
documents - check against doc->is_valid or doc->editor != NULL
instead.
Change plugin API EditorFuncs to use GeanyEditor pointers.
Make editor_set_font() take a pango-style font string, and use a
GeanyEditor pointer.
Use GeanyEditor* instead of GeanyDocument* in editor.c (most global
editor functions still need conversion though, but this may be done
gradually or as required).
Move utils_get_current_function() to symbols.c.
Move utils_replace_filename() to document.c.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2779 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-07-15 14:29:41 +00:00
Nick Treleaven
bceab8d3e2 Note: this breaks the plugin API for editor-related document fields.
Split new GeanyEditor struct type from GeanyDocument fields.
Add GeanyDocument::editor field.
GeanyEditor::document allows access back to document fields.
GeanyEditor::scintilla replaces GeanyDocument::sci.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/editor-struct@2763 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-07-08 10:50:13 +00:00
Nick Treleaven
2c5a71f054 Add function document_close().
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2740 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-07-01 14:20:16 +00:00
Nick Treleaven
a85c71ee9b Remove document_delay_colourise(), document_colourise_all().
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2719 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-06-20 14:19:57 +00:00
Nick Treleaven
652d073d62 Merge the document-pointer branch.
Note: this breaks the plugin API for document functions,
document signal callbacks, msgwin_msg_add() and navqueue_goto_line().
Make all DocumentFuncs use a GeanyDocument* instead of an integer
index, so there's no need to access the documents array or use
DOC_IDX_VALID() - usually just check for non-NULL.
Pass a document pointer to the callbacks of all document-* signals.
Add GeanyDocument::index field for use with the documents array.
Remove DocumentFuncs::get_cur_idx() - use get_current() instead.
Replace DocumentFuncs::get_n_idx() with get_from_page().
Rename DocumentFuncs::find_by_realpath() to find_by_real_path().
Replace DocumentFuncs::remove() with remove_page().
Add 'changed' argument for DocumentFuncs::set_text_changed().
Make NavQueueFuncs and MsgWinFuncs use a GeanyDocument* instead of an
integer index.
Add DOC_VALID() macro.
Add deprecated DOC_IDX() macro to get the document index from a
possibly NULL pointer; deprecate macro DOC_IDX_VALID. These macros
can make porting outside plugins easier; of course, it is better to
rewrite the code to use document pointers.
Use document pointer instead of an index to the documents array
everywhere in the core code.
Rename utils_check_disk_status() in document_check_disk_status() and
move it into document.c.
Adjust plugins to work with these changes.
Add dox for document_set_filetype().
Rename debugging function doc() doc_at() to avoid conflicts.
Update plugin signals dox.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2705 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-06-18 17:03:08 +00:00
Nick Treleaven
56e77de794 Bring back GeanyDocument::is_valid field as it is clearer and more
descriptive than using doc->index != -1.
Add deprecated macros DOC_IDX_VALID and DOC_IDX in plugindata.h,
which can make porting outside plugins easier; of course, it is
better to rewrite the code to use document pointers.
Use is_valid instead of the DOC_VALID macro when iterating over
documents_array, as there are never NULL pointers in it.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/document-pointer@2704 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-06-18 14:18:26 +00:00
Enrico Tröger
d03f72122a Get rid of GeanyDocument::is_valid, use the index value instead.
Remove DOC_IDX_* macros.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/document-pointer@2693 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-06-15 15:24:44 +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
Nick Treleaven
45af150af0 Move DOC_VALID() macro to document.h, add dox.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/document-pointer@2691 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-06-13 15:02:29 +00:00
Nick Treleaven
98550fa246 Note: this breaks the plugin API for document functions.
Make all DocumentFuncs use a GeanyDocument* instead of an integer
index, so there's no need to access the documents array or (in most
cases) use DOC_IDX_VALID() - just check for non-NULL.
Add GeanyDocument::index field for use with the documents array.
Add DOC_IDX() macro to get the document index from a possibly NULL
pointer.
Note: the new functions in the core have a documents_ prefix where
they would conflict with the old names, which are still present and
used in the core (but will be removed soon).
Remove DocumentFuncs::get_cur_idx() - use get_current() instead.
Replace DocumentFuncs::get_n_idx() with get_from_page().
Rename DocumentFuncs::find_by_realpath() to find_by_real_path().
Replace DocumentFuncs::remove() with remove_page().
Add 'changed' argument for DocumentFuncs::set_text_changed().
Add dox for document_set_filetype().
Rename debugging function doc() doc_at() to avoid conflicts.
Rename document_find_by_realpath() in the core also.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/document-pointer@2687 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-06-12 16:50:01 +00:00
Nick Treleaven
6e91b0aba1 Update documentation for real_path, minor edit of file_name.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2647 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-06-05 16:07:39 +00:00
Nick Treleaven
50b0a10654 Note: this breaks the plugin API for plugins using
document_find_by_filename().
Make document_find_by_filename() take only a utf8_filename argument,
and now match any documents that have a filename set but aren't saved
on disk.
Add document_find_by_realpath() to the plugin API.
Add filename argument for document_save_file_as().
Add GeanyDocument::real_path field, which if non-NULL indicates the
file once existed on disk (not just as an unsaved document filename).


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2637 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-06-03 17:22:04 +00:00
Nick Treleaven
37e0d1f3f1 Move GeanyDocument GUI elements and saved_encoding to private
Document struct which inherits from GeanyDocument. This is to hide
implementation fields from the plugin API, so that we can change
them if necessary.
Add DOCUMENT() macro to convert a GeanyDocument* to a Document*.
Also move UNDO_*, FileEncoding to documentprivate.h.
Move undo_action struct to document.c.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2631 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-06-02 15:31:59 +00:00
Enrico Tröger
6ca0d4c471 Remove underscore prefix from some struct names.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2626 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-05-29 18:02:20 +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
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
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
beb68832b3 Move several editing related functions from document.c to editor.c.
Fix two compiler warnings about non-literal format strings.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2588 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-05-15 13:43:29 +00:00
Enrico Tröger
b2cddc87a0 Move indicator functions from document.c into editor.c.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2587 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-05-14 17:58:56 +00:00
Enrico Tröger
c151befff3 Add new function document_set_indicator_on_line() for future use.
Add some functions to the plugin API for the upcoming spell check plugin.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2581 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-05-14 15:46:48 +00:00
Enrico Tröger
392d1f863f Add preferences for default end of line characters for new files (closes #1895362) and to disable the automatic continuation of multi-line comments in C-like languages.
Enable multi-line continuation also for CSS files.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2580 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-05-14 15:36:27 +00:00
Nick Treleaven
d131023fe7 Add basic Line Breaking option in the Document menu. Line breaking
only works when typing characters past the line breaking column
number.
Add 'Line breaking column' editor pref.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2562 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-05-09 12:13:29 +00:00
Nick Treleaven
3afebc701c Move Close All functions to document.c.
Add document_account_for_unsaved().


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2526 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-04-24 14:33:12 +00:00
Nick Treleaven
dc398a3b59 Add document_close_all() and use it in project.c.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2521 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-04-23 17:07:52 +00:00
Enrico Tröger
9024500f92 Add document_new_file_if_non_open() to open new documents if no other documents are open.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2453 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-04-08 14:07:17 +00:00
Nick Treleaven
c248368faf Only use filetype detection after Save As, not on every save when the
filetype is None (fixes #1891778).


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2377 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-03-21 14:02:59 +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
85f73129c0 Apply patch from Daniel Richard G. to fix to fix several compiler warnings, C89 violations and minor code problems (thanks).
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2267 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-02-20 11:24:23 +00:00
Enrico Tröger
0e65cff820 Add support for generating API reference documentation using doxygen.
This is the first step, it is far away from being complete.
Add make target "api-doc" to generate the reference documentation.
Add documentation comments to a few functions.
Move basic plugin documentation from plugindata.h to doc/plugins.dox.	       


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2263 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-02-17 18:00:42 +00:00
Enrico Tröger
e3201062c6 Update copyright information and change format of email addresses in source files.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2150 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-01-06 18:11:57 +00:00
Enrico Tröger
80532b616d Store more document-related settings session-based in the configuration file(including the file encoding).
Detect in-file specified file encoding by scanning the file using regular expressions.	    


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2093 ea778897-0a13-0410-b9d1-a72fbfd435f5
2007-12-07 14:13:05 +00:00
Enrico Tröger
fff66178da Add native GTK printing support.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2050 ea778897-0a13-0410-b9d1-a72fbfd435f5
2007-11-17 14:04:27 +00:00
Nick Treleaven
5f688c6294 Apply patch from Catalin Marinas to add a 'newline strips trailing
spaces' pref (thanks).


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1956 ea778897-0a13-0410-b9d1-a72fbfd435f5
2007-10-18 11:52:47 +00:00
Nick Treleaven
a2589f87fa Add Indent Type option in the Document menu.
Add 'Detect from file' Editor indentation pref.
Show TAB or SP for current document's indent type.
Minor editing of Document menu and editor Indentation prefs group.
Use GString for statusbar statistics.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1953 ea778897-0a13-0410-b9d1-a72fbfd435f5
2007-10-17 12:27:07 +00:00
Nick Treleaven
b7113bfa7a Add reload_file() document function to the plugin API.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1869 ea778897-0a13-0410-b9d1-a72fbfd435f5
2007-09-11 16:05:03 +00:00
Nick Treleaven
274058eb7a Neaten up the plugin API:
Make document_open_file() now wrap document_open_file_full(),
without the idx for reloading or pos arguments.
Replace str_replace() with string_replace_all() in the plugin API.
Add utils_string_replace_all(), taking a GString argument.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1868 ea778897-0a13-0410-b9d1-a72fbfd435f5
2007-09-11 15:21:11 +00:00
Nick Treleaven
1887a20df4 Add text argument for document_new_file(), so that it's independent
from filetype templates.
Make File->New create a blank document, rather than using the None
filetype template.
Add None option for the 'New with Template' menu commands.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1848 ea778897-0a13-0410-b9d1-a72fbfd435f5
2007-09-03 16:09:53 +00:00