118 Commits

Author SHA1 Message Date
Nick Treleaven
4837030ca1 Fix compilation.
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/branches/editor-struct@2766 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-07-08 16:30:37 +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
1a1361db57 In templates_free_templates() destroy also file template menu items.
Add reload argument to filetypes_load_config() to allow re-reading of the settings.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2737 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-06-30 15:59:00 +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
1e8d82f46a Note: this breaks the plugin API for msgwin and navqueue functions.
Make NavQueueFuncs and MsgWinFuncs use a GeanyDocument* instead of an integer index.
Adjust plugins to work with these changes.            


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/document-pointer@2688 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-06-12 20:09:57 +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
7986d13d40 Add shebang detection for Makefiles.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2584 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-05-14 16:13:16 +00:00
Nick Treleaven
ef8ffb8872 Add source_only argument for filetypes_find_source() and rename.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2568 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-05-09 17:14:35 +00:00
Nick Treleaven
bd103e1d2f Set filetype::id automatically in filetype_add().
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2567 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-05-09 17:07:20 +00:00
Nick Treleaven
a260b25515 Fix C headers getting detected as C++ files (iterate through
filetypes_array, not filetypes_hash as the order is not consistent
with the filetype_id enum).
Add static function filetypes_find_source().


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2561 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-05-08 14:16:35 +00:00
Nick Treleaven
eb8e2a1a65 Rename static functions for filetype creation & addition.
Make filetypes_add(), filetypes_remove() static.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/custom-filetypes@2558 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-05-07 14:09:12 +00:00
Nick Treleaven
00c722966c Rename GEANY_FILETYPES_ALL GEANY_FILETYPES_NONE.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/custom-filetypes@2556 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-05-07 13:54:21 +00:00
Nick Treleaven
a0aa89cbe9 Make Open dialog file filter work for custom filetypes.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/custom-filetypes@2554 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-05-07 12:13:58 +00:00
Nick Treleaven
67316db4c5 Remove GEANY_MAX_FILE_TYPES and replace most uses of it with
filetypes_array->len.
Highlighting and templates now use GEANY_MAX_BUILT_IN_FILETYPES.
Move print_filetypes() out of parse_command_line_options();


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/custom-filetypes@2553 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-05-07 11:34:38 +00:00
Nick Treleaven
a4cf5607a6 Remove unused filetype::item field.
Create FullFileType private type that 'inherits' from filetype
(FullFileType* can be cast to filetype*). This is used in
filetypes_new() to hide filetype struct fields from the API.
Remove radio_items[] and use FullFileType::menu_item instead.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/custom-filetypes@2552 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-05-06 17:04:06 +00:00
Nick Treleaven
f82d979dbd Add filetypes_array to GeanyData for plugins to access a dynamic
array of filetype pointers.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/custom-filetypes@2547 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-05-01 17:25:18 +00:00
Nick Treleaven
21eb6bd989 Remove filetypes_find(), which will be replaced with a dynamic array
of filetype pointers (more flexible and backwards compatible with
existing code).


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/custom-filetypes@2546 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-05-01 17:01:32 +00:00
Nick Treleaven
75a1cf7f03 Add filetypes_new() to create and initialize a new filetype.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/custom-filetypes@2545 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-05-01 14:51:47 +00:00
Nick Treleaven
59fb39390a Add filetypes_find() that calls a predicate function for each
filetype in filetypes_hash until TRUE is returned.
Make filetypes_detect_from_extension() work for all filetypes
in filetypes_hash.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/custom-filetypes@2544 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-05-01 14:30:20 +00:00
Nick Treleaven
d5e39530df Store filetype::name instead of unique ID when saving sessions.
Remove all filetype UID code.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/custom-filetypes@2543 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-05-01 12:10:46 +00:00
Nick Treleaven
18789117f1 Refactor create_set_filetype_menu() from filetypes_init().
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/custom-filetypes@2540 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-04-28 16:52:20 +00:00
Nick Treleaven
7ede716a9c Add GEANY_MAX_BUILT_IN_FILETYPES for accessing built_in_filetypes[].
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/custom-filetypes@2539 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-04-28 16:15:08 +00:00
Nick Treleaven
5340f2b9c8 Remove filetypes array from API.
Replace filetypes_get_from_uid() with filetypes_lookup_by_name().
Use a hash table for filetypes, but keep the old filetypes array
available for now.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/custom-filetypes@2538 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-04-28 14:41:09 +00:00
Enrico Tröger
02ea9a08d8 Revert the translatable filetype name of filetype All, add a workaround in ui_update_statusbar() instead.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2472 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-04-11 15:39:44 +00:00
Frank Lanitz
4b975c8f39 Make another string translatable
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2469 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-04-10 21:02:42 +00:00
Enrico Tröger
bd9881d162 Add ".xhtml" extension for filetype XML (#1914587).
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2362 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-03-18 16:38:01 +00:00
Enrico Tröger
c0990b5e71 Add HTML parser to get h1, h2, h3 symbols as well as link anchors and JavaScript functions (closes #1896068).
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2317 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-03-09 18:50:41 +00:00
Enrico Tröger
b7f834dbc0 Apply patch from Yura Siamashka to use she-bang filetype detection also in filetypes_detect_from_filename() which let plugins benefit from this feature.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2306 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-03-05 17:09:57 +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
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
5d3801fe30 Add *.vala extension to CSharp filetype to support the Vala language.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2131 ea778897-0a13-0410-b9d1-a72fbfd435f5
2007-12-25 14:19:47 +00:00
Frank Lanitz
414afe3f37 Added .ltx as extension for LaTeX-documents
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2081 ea778897-0a13-0410-b9d1-a72fbfd435f5
2007-11-30 18:04:25 +00:00
Enrico Tröger
dc4bc34e36 Add support for env wrapper in shebang detection (inspired by a patch from Yura Siamashka).
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2013 ea778897-0a13-0410-b9d1-a72fbfd435f5
2007-11-04 10:06:06 +00:00
Nick Treleaven
046d5ef796 Fix bug with using the default extension, not the user set one, if
'New with template' is used before any documents of the same filetype
are open.
Load filetype keyfiles from filetypes_load_config(), not from
styleset_foo_init().
Add highlighting_init_styles(), highlighting_set_styles(),
simplifying a lot of styleset function code.
Remove filetype::style_func_ptr field.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2011 ea778897-0a13-0410-b9d1-a72fbfd435f5
2007-11-02 17:44:05 +00:00
Nick Treleaven
79ff87713a Add configurable default file extension setting for filetype
definition files.
Note: There is a bug with using the default extension, not the user
set one, if 'New with template' is used before any documents of the
same filetype are open.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2006 ea778897-0a13-0410-b9d1-a72fbfd435f5
2007-11-01 16:33:06 +00:00
Nick Treleaven
deb7a04d14 Only translate '%s source file' instead of whole title for filetypes
(easier for new translations).


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1999 ea778897-0a13-0410-b9d1-a72fbfd435f5
2007-10-31 16:41:01 +00:00
Nick Treleaven
f836bbcd7f Set reStructuredText default file extension .rst.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1994 ea778897-0a13-0410-b9d1-a72fbfd435f5
2007-10-31 12:16:48 +00:00
Nick Treleaven
51f619f0ec Rewrite filetypes_get_from_uid() for easier maintenance.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1794 ea778897-0a13-0410-b9d1-a72fbfd435f5
2007-08-14 15:36:12 +00:00
Nick Treleaven
5be30988c8 Add comment about generating filetype_extensions.conf.
Update filetype_extensions.conf.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1793 ea778897-0a13-0410-b9d1-a72fbfd435f5
2007-08-14 15:24:01 +00:00
Nick Treleaven
b9c0dcdc8b Sort filetype groups alphabetically.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1792 ea778897-0a13-0410-b9d1-a72fbfd435f5
2007-08-14 15:11:54 +00:00
Nick Treleaven
2e454f7af5 Add reStructuredText filetype and parser.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1791 ea778897-0a13-0410-b9d1-a72fbfd435f5
2007-08-14 11:50:03 +00:00
Enrico Tröger
75c74284f8 Add filetype Haxe (patch by blackdog, thank you).
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1744 ea778897-0a13-0410-b9d1-a72fbfd435f5
2007-07-26 09:50:12 +00:00
Nick Treleaven
ae6de4f5c6 Use extern 'app' and 'filetypes' global variables in headers, so that
G_MODULE_BIND_LOCAL can later be used when loading plugins to detect
any unresolved symbols.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1725 ea778897-0a13-0410-b9d1-a72fbfd435f5
2007-07-19 11:49:53 +00:00
Enrico Tröger
f158ea71a1 Fix compiler warnings.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1712 ea778897-0a13-0410-b9d1-a72fbfd435f5
2007-07-17 08:39:17 +00:00
Enrico Tröger
7f1dd7dacc Add shebang-like detection for PHP files starting with "<?php".
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1697 ea778897-0a13-0410-b9d1-a72fbfd435f5
2007-07-12 18:07:49 +00:00
Enrico Tröger
f7d95e736e Change name of XML filetype to "XML document".
Add sub menus to "Set Filetype" menu.      


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1680 ea778897-0a13-0410-b9d1-a72fbfd435f5
2007-07-09 12:46:16 +00:00
Enrico Tröger
693649f955 Add new filetypes CSharp and FreeBasic.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1635 ea778897-0a13-0410-b9d1-a72fbfd435f5
2007-06-22 17:34:31 +00:00
Nick Treleaven
5492a6d99b Use filetype_has_tags().
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1580 ea778897-0a13-0410-b9d1-a72fbfd435f5
2007-05-26 15:26:05 +00:00