7625 Commits

Author SHA1 Message Date
Jiří Techet
43b8ab8d23 Only keep the minimal set of parameter in the TM API calls
Avoid "utility" parameters like do_free for which we already have API calls
and which actually don't perform any free if the source file isn't
in TM. Clarify when to set the update_workspace parameter.
2014-10-30 22:08:17 +01:00
Jiří Techet
0285ec28a5 Move tm_source_file_update() to tm_workspace.c
The placement of this function in tm_source_file is not right - by moving
it to the workspace we can make the source file unaware of the existence
of the workspace (no inclusion of tm_workspace.h in tm_source_file any
more). Also change tm_source_file_new() so it doesn't offer the source file
update.

After this change
* TMWorkspace knows TMSourceFile and TMTag
* TMSourceFile knows TMTag
* TMTag knows TMSourceFile
2014-10-30 22:08:17 +01:00
Nick Treleaven
cfcbc6a205 Make Next/Previous Message keybindings work without a document open 2014-10-30 16:34:00 +00:00
Colomban Wendling
4546b6f7a6 Merge pull request #363 from techee/prj_dialog
Always set project description and file patterns in the dialog
2014-10-27 21:19:57 +01:00
Jiří Techet
41dcde623d Always set project description and file patterns in the dialog
Set them also when they are NULL in the project (which happens when new
project is created) because otherwise there are left-over values from
the previous project.
2014-10-27 20:58:59 +01:00
Colomban Wendling
fc5d8d145a Merge pull request #362 from ntrel/fb-cmd
Make File Browser use explorer as default open command on Windows
2014-10-27 19:24:09 +01:00
Enrico Tröger
a7a893a22f Set -O2 compiler flag by default for gcc
But only if no other optimization flags could be found.
2014-10-26 23:44:19 +01:00
Nick Treleaven
36c155cbe8 Make File Browser use explorer as default open command on Windows 2014-10-26 15:06:16 +00:00
Jiří Techet
233ca08e88 Add project_write_config() to force project file rewrite
Since plugins don't have direct access to the project file,
only through the project-save signal, they need some way to emit this
signal when saving their preferences outside the project dialog,
which is what this function does.
2014-10-25 22:30:54 +02:00
Jiří Techet
a183d9cb97 Move the refcount TMTag member up in the structure and don't document it for plugins 2014-10-22 16:58:38 +02:00
Jiří Techet
11866938cc Remove unused return value 2014-10-22 16:23:07 +02:00
Jiří Techet
6ef41c65a9 Various cleanups in the merge algorithm
Remove the continue statement and use if/else instead. Initialize the
val1 variable only with the value used for the chosen path (normal/fast).
2014-10-22 16:14:59 +02:00
Jiří Techet
9a2a55a252 Reinclude tm_tag.h in tm_workspace.c
To make Colomban happy.
2014-10-22 16:04:06 +02:00
Jiří Techet
d8b178e4cb Whitespace changes 2014-10-22 15:59:36 +02:00
Colomban Wendling
11ea0ed637 Remove some dead code 2014-10-22 15:06:14 +02:00
Colomban Wendling
a671c1e26d Fix signed vs unsigned comparisons 2014-10-22 15:05:35 +02:00
Colomban Wendling
d4135c9842 Add prototypes for all plugin symbols
This allows the compilers to check that the plugin's symbols have the
proper prototype.  Doing so can avoid subtle and hard-to-find bugs in
case a plugin's symbol has incorrect signature as dlsym() can't check
if the signature is actually the one we expect.

As a bonus, it helps when using -Wmissing-prototypes as it provides the
prototypes.
2014-10-20 17:55:32 +02:00
Colomban Wendling
c35dedf35f Rename internal plugin_init() to avoid confusion with plugins entry point 2014-10-20 16:18:05 +02:00
Jiří Techet
62332e19aa Since lang is now always part of TMTag, always set its value
This makes it less confusing for code accessing TMTag so it can always
find the language in tag->lang and there is no need to access it through
tag->file.lang.
2014-10-18 21:40:11 +02:00
Jiří Techet
54a9fd83ea Get rid of the nested members in TMTag
The only real change is the removal of struct and union in TMTag, the
rest is purely mechanical removal of "atts.entry." everywhere.
2014-10-18 21:40:11 +02:00
Jiří Techet
48725e4188 Get rid of the file struct in TMTag, preparation for the union removal
The union on TMTag is very confusing and rather dangerous. The fields
file/timestamp and line/lang overlap. Some implicit assumptions are made
in the code - timestamp is never set so when file is NULL, the file
struct should be used to get the lang member. Rather avoid using unions
and move the lang member to the entry struct together with the other
attributes.
2014-10-18 21:40:10 +02:00
Jiří Techet
a7c6e0733f Remove tm_tag_file_t and all its uses
File tags aren't used for anything in geany and neither the existing
global tag files seem to use them - remove this concept from geany.
2014-10-18 21:40:10 +02:00
Jiří Techet
0f9b778ae5 Fix division by 0 2014-10-18 21:40:10 +02:00
Jiří Techet
9eefdb0efc Where possible, convert functions to static in TM 2014-10-18 21:40:10 +02:00
Jiří Techet
034ef6d79d Remove the unused (and misleading) tm_tag_free()
It just calls unref() which might not actually free the tag if the refnum
is more than 1.
2014-10-18 21:40:10 +02:00
Jiří Techet
344eca0204 Add #if 0 around unused TM functions and move them to the end of the file
Similarly, add #if TM_DEBUG around various unused debugging functions.

The #if 0 surrounded functions are good candidate for future removal
if decided they are not needed any more.
2014-10-18 21:40:10 +02:00
Jiří Techet
2c09333b6a Remove unused tm_tags_custom_sort() and tm_tags_custom_dedup() and friends 2014-10-18 21:40:10 +02:00
Jiří Techet
4e98021689 Swap the merge arguments if len(small_array) > len(big_array) 2014-10-18 21:40:10 +02:00
Jiří Techet
fe98ea6156 Use the new merge implementation also for global tags 2014-10-18 21:40:10 +02:00
Jiří Techet
0470f45e0c TM: move function descriptions from headers to sources
To make it consistent with the rest of Geany.
2014-10-18 21:40:10 +02:00
Jiří Techet
4903d79dcc TM: use the same format of docstrings as in the rest of Geany 2014-10-18 21:40:10 +02:00
Jiří Techet
74706374eb Remove the unused inactive flag in TM
It is set only when read from a file but it never gets written to the file
with the TRUE value.
2014-10-18 21:40:10 +02:00
Jiří Techet
d686674eca On single file update only merge the file's tags into workspace tags
Since both the file tags and workspace tags are sorted, it is unnecessary
to completely resort the tags for the workspace - instead, remove the
tags belonging to the file from the workspace tags and merge the updated
file's tags into the workspace tags.

The merge is optimized for merging small number of tags into a large array.
For instance, the total number of tags in linux kernel is about 2300000
while the average number of tags per file is about 65 (35000 source files).
Most of the time merge won't be performed so we can avoid expensive
string comparisons and try to make bigger jumps to see if some merge is
needed or not (more details in the source file comments).
2014-10-18 21:40:10 +02:00
Jiří Techet
8c25ff871c Make tm_workspace_update() public 2014-10-18 21:40:10 +02:00
Jiří Techet
52076d19e8 Remove unused tm_file_entry.[ch] 2014-10-18 21:40:10 +02:00
Jiří Techet
26587454b0 Remove TmWorkObject and all the OO related stuff
In addition, rename all functions, parameters, comments etc. mentioning
work_object and remove unnecessary parameters of various functions.
Delete dead code paths.

Also move common functions like tm_get_real_path() from tm_work_object to
tm_source_file.
2014-10-18 21:40:10 +02:00
Frank Lanitz
94a7762f91 Small update of German translation 2014-10-18 19:52:38 +02:00
Colomban Wendling
d42837f021 Merge pull request #351 from techee/guards
Protect private definitions by the GEANY_PRIVATE macro in headers
2014-10-18 18:13:45 +02:00
Enrico Tröger
5a243fd224 Explicitly define Windows version for older Mingw environments 2014-10-15 17:33:57 +02:00
Colomban Wendling
608ab0f60c Document the fact utils_spawn_sync() accepts NULL for all output arguments 2014-10-14 23:23:13 +02:00
Colomban Wendling
c38f59bbc4 autotools: Only uninstall what we actually installed
Only manually uninstall the files we manually installed, as
uninstall-local might be run in parallel to Automake's own uninstall
targets.

We don't uninstall the directories as some docs seems to suggest
`rmdir` isn't really portable.  Anyway, Automake don't uninstall
directories either so it's not a real problem.

An alternative solution would be to keep the recursive removal of
`$(DOCDIR)` but move it to `uninstall-hook`, which is guaranteed to be
run after other uninstall rules.  However, recursive deletion is not
always sensible as it might remove files we didn't install, e.g. if the
user added them manually.
2014-10-13 23:59:40 +02:00
Colomban Wendling
16716e498d autotools: Remove new Doxygen temporary files 2014-10-13 23:59:40 +02:00
Colomban Wendling
0650e707f1 autotools: Properly clean up hacking.html
We don't distribute it, so we need to clean it.
2014-10-13 23:59:40 +02:00
elextr
75af73875f Add note about -D_FILE_OFFSET_BITS=64 2014-10-13 12:41:05 +11:00
Jiří Techet
6242d19471 Add all headers to libtagmanager_a_SOURCES in tag manager makefile
So they become part of tarball.
2014-10-12 23:49:52 +02:00
Jiří Techet
dbcf67d449 Define the GEANY_PRIVATE macro for tag manager in makefile.win32 2014-10-12 23:37:00 +02:00
Jiří Techet
6d6dd7444b Fix doxygen warnings
Make documents_array public and accessible by doxygen and describe all
parameters of tm_source_file_new().
2014-10-12 23:33:51 +02:00
Colomban Wendling
f5230f334e Fix moving editor tabs through keybindings 2014-10-12 18:00:12 +02:00
Enrico Tröger
9caa0046bd Prepare Windows installer for embedded GTK 2.24 2014-10-12 16:40:12 +02:00
Enrico Tröger
3966ba8c4b Query GdkWindow reference only if available
On startup, the Geany main window doesn't have a GdkWindow yet
(probably because it is not yet mapped). This causes many
'gdkdrawable-win32.c:2013 drawable is not a pixmap or window'
warnings when resolving shortcuts on Windows.
Since we pass the SLR_NO_UI to the Windows API, we probably
don't need the parent hWnd reference at all.
2014-10-12 16:35:46 +02:00