4638 Commits

Author SHA1 Message Date
Matthew Brush
9f587e9c26 Pack Scintilla widgets into a GtkVBox and use it as the notebook page.
This is to allow stacking widgets such as GtkInfoBar above the Scintilla
widget in each tab.

notebook.c need to be changed because the document isn't the direct widget
anymore which was assumed for tab closing.
2014-05-24 14:46:49 +02:00
Enrico Tröger
f3ac7480c5 Re-order header includes and cleanup unused imports 2014-05-24 13:33:27 +02:00
Matthew Brush
238ab56279 Re-order win32.[ch] includes a little bit to unbreak build 2014-05-24 04:01:09 -07:00
Colomban Wendling
7d38f05121 Initial support for single-line regular expressions matching 2014-05-22 15:49:01 +02:00
Matthew Brush
4d22aa4850 Merge branch 'header-cleanup'
Closes #272
2014-05-21 15:43:40 -07:00
Matthew Brush
50feb0e05c Improve support of compiling without gettext
* If GETTEXT_PACKAGE is not defined (ex. by build system/user) then
  define it to NULL. Most GLib gettext-functions allow passing NULL
  to use the domain set with textdomain().
* Improve the ngettext() wrapper macro.
* Improve/fix bind_textdomain_codeset() wrapper macro.
* Fix argument in bindtextdomain()
* Cast bind*textdomain*() results with (void) to get rid of compiler
  warnings when building without GETTEXT_PACKAGE defined.
2014-05-21 15:38:16 -07:00
Matthew Brush
4efcbab332 Include what you use
This is a mega-commit - because most of it had to be done in one go
otherwise some commits would fail to compile - that attempts to fix a
few problems with Geany's includes as well as various other related
cleanups. After this change it's easier to use includes and there's
little worry about which order things are included in or who includes
what.

Overview of changes:

* Include config.h at the start of each source file if HAVE_CONFIG_H
  is defined (and never in headers).
* Go through each source file and make the includes section generally
  like this:
  - Always config.h first as above
  - Then if the file has a header with the same name, include that
  - Then include in alphabetical order each other internal/geany header.
  - Then include standard headers
  - Then include non-standard system headers
  - Then include GLib/GTK+ related stuff
* Doing as above makes it easier to find implicit header include
  dependencies and it exposed quite a few weird problems with includes
  or forward declarations, fix those.
* Make geany.h contain not much besides some defines.
  - Add a little header file "app.h" for GeanyApp and move it there
  - Move "app" global to new "app.h" file
  - Move "ignore_callback" global to "callbacks.h"
  - Move "geany_object" global to "geanyobject.h"
* Add an include in "geany.h" for "app.h" since GeanyApp used to be
  defined there and some plugins included this header to access
  GeanyApp.
* Include "gtkcompat.h" everywhere instead of gtk/gtk.h so that
  everywhere sees the same definitions (not a problem in practice AFAIK
  so this could be changed back if better that way.
* Remove forward declarations from previous commits as some people
  apparently consider this bad style, despite that it reduces inter-
  header dependencies.

TODO:
* As always, to test on win32
* As always, to test with not Autotools
* Test plugins better, both builtin and geany-plugins, likely API/ABI bump
* Test with various defines/flags that may change what is included
* win32.[ch] not really touched since I couldn't test
2014-05-21 15:37:19 -07:00
Matthew Brush
6f87aac118 Normalize use of header guards and extern "C" guards
* Always define GEANY_FOO_H to 1 in the header guards
* Always put a G_BEGIN_DECLS/G_END_DECLS guard in every header for
consistency, even private ones where it doesn't matter.
* Always include either <glib.h>, <gtk/gtk.h> or some other header
that will provide G_BEGIN_DECLS before using it. In a lot of headers
that use glib.h and gtk/gtk.h stuff anyway, this resolves an implicit
dependency they had on them being included before that header.
* Always put a comment at the #endif part of the guard so it's
easier to see what it applies to.
* Always use an underscore between the header guard identifier's words
even though the filename doesn't have one.
2014-05-21 12:18:26 -07:00
Matthew Brush
fec15c61c4 Move typedefs out of geany.h and into their own headers
This helps to avoid the requirement that geany.h be included before
using any of the changed headers.
2014-05-21 12:18:25 -07:00
Matthew Brush
23d9cad7dc Start to make it easier to compile the core in isolation
This is for work on making the files scannable by GObject-Introspection
but is still useful otherwise (even fixes a FIXME in the comments). I
made this by using a simple GNU Make file and trying to compile the
sources each on their own without all the build system infrastructure.

* Add keybindingsprivate.h file to hold private GeanyKeyGroup structure
and remove it from the GEANY_PRIVATE guard in keybindings.h.
* Move private members that were guarded by GEANY_PRIVATE from
GeanyFiletypes to GeanyFiletypesPrivate and remove guarded build.h
include.
* Move private members that were guarded by GEANY_PRIVATE from
GeanyProject to GeanyProjectPrivate.
2014-05-21 12:17:59 -07:00
Colomban Wendling
3d549f59e8 Fix a sign comparison warning 2014-05-21 16:13:22 +02:00
Colomban Wendling
894207d0e3 Don't use deprecated gdk_get_display() 2014-05-21 16:08:38 +02:00
Colomban Wendling
67329f2b98 Update for new Scintilla styles
The new C styles escapesequence and taskmarker are currently mapped
conservatively, and may benefit from a more visible mapping.
2014-05-17 22:17:44 +02:00
Colomban Wendling
a6b1433e66 Fix modulo by zero, resulting in FPE
Fix modulo zero error resulting in floating point exception, and then
crash. This was introduced in fd6ce2da11e9f2d20cb96236753662c23feaecb4.

Closes #265.
2014-05-07 16:00:49 +02:00
Colomban Wendling
de57548a71 Fix a few unlikely corner-case leaks
Fix a few leaks that can only happen in case of programming error.

Thanks to Pavel Roschin and his cppcheck for spotting them!
2014-05-05 16:03:25 +02:00
Colomban Wendling
f366150f7a Fix return with no value within a function returning non-void (oops) 2014-05-05 14:52:05 +02:00
Colomban Wendling
1e405ce88e Keep exact menu item string as keybinding label
Using the exact same string avoids duplicate translation, and here only
mnemonic changes were introduced with commit
95306ac8db4fc38ad7ba7e172328cef5117efaf0.
2014-05-05 05:09:13 +02:00
Colomban Wendling
1e50962de2 Fix some conflicting mnemonics in the menus 2014-05-05 05:09:13 +02:00
Matt Copperwaite
e61bba1bc3 Reword "replace by tabs/spaces" as "replace with" 2014-05-05 05:09:13 +02:00
Igor Shaula
007d5395c2 Disable commenting out blank lines by 'Toggle line commentation' 2014-05-04 01:05:09 +02:00
Colomban Wendling
fd6ce2da11 Fix UI updating after loading a project
When loading a project and focusing the last document, the UI wouldn't
get properly updated for the displayed file -- because for performance
reasons we disable notebook page switch handlers when loading session
files.  Fix this by synthesizing a notebook page switch event when done
loading.
2014-05-03 00:52:23 +02:00
Colomban Wendling
cc64ee7578 Merge branch 'plugin-dialog-cleanup' 2014-05-01 15:12:42 +02:00
Colomban Wendling
a13b033d42 Hide column headers in plugin manager dialog
They are not very useful and waste both vertical (the headers
themselves) and horizontal (first column wider because of title)
screen space.
2014-05-01 03:18:04 +02:00
Nick Treleaven
5ff38b4daa Fix document pointer documentation
Improve clarity and remove wrong documentation about using `is_valid` to
check if a document still exists.
2014-04-28 12:34:13 +01:00
Colomban Wendling
5eb526f9d0 Improve implementation of utils_str_equal() 2014-04-27 22:36:25 +02:00
Colomban Wendling
63a2f075f6 Merge branch 'ntrel/doc-macro-examples' 2014-04-27 18:06:01 +02:00
Nick Treleaven
916b65b661 Fix sign comparison warning 2014-04-27 16:38:37 +01:00
Nick Treleaven
5758b9ca67 Add foreach_document(), documents[] examples 2014-04-27 16:14:09 +01:00
Colomban Wendling
bc4e76582b Merge branch 'scriptum/sidebar-middle-button-close' 2014-04-27 02:43:20 +02:00
Pavel Roschin
b28e5db7ce Close documents in sidebar with middle mouse button 2014-04-26 23:02:38 +04:00
Colomban Wendling
605ec0b02e Cleanup Plugin Manager dialog
Merge "Name" and "Description" columns, and move plugin details to
tooltips.
2014-04-25 18:46:14 +02:00
Colomban Wendling
5217d683ca Reword "Detect from file extension" from the open dialog
We don't actually detect from file extension only, and other references
of the feature always use "Detect from file", so use it also in the
open dialog.
2014-04-15 15:58:08 +02:00
Colomban Wendling
bb61dfcdc3 Add a translation context to the open dialog's "View" button
The "View" button string is the same as the View menu one, but one is
an action (verb) and the other a noun, and as such might need to be
translated differently.
2014-04-15 15:58:04 +02:00
Colomban Wendling
45f193a17a Merge branch 'cleaner-filetype-combo-box' 2014-04-15 15:57:26 +02:00
Colomban Wendling
aeab183ef2 Merge branch 'unified-encoding-combo-boxes' 2014-04-15 15:57:13 +02:00
Colomban Wendling
420891ae81 Group filetypes in the Open dialog filetype combo box
Display the filetypes in the Open dialog filetype combo box grouped,
as they are in the filetypes menu.

This makes it easier to select a filetype, because they are better
sorted and follows the filetypes menu layout.
2014-04-15 15:52:59 +02:00
Colomban Wendling
8c5e198cf1 Unify encoding combo boxes
Make all encoding combo box display a list with encodings grouped by
categories into sub-menus, making it easier to find the appropriate
encoding than in a big single-level list.

This is what was used in the Open dialog, but not in the Preferences
dialog or the Find in Files dialog.  This also makes the encoding
combo boxes behave more like the encoding menus.
2014-04-15 15:51:49 +02:00
Colomban Wendling
1abee90434 Plug a memory leak 2014-04-14 20:27:35 +02:00
Colomban Wendling
3ec0369f47 Merge branch 'wip/configurable-mime-type--gicon' into wip/configurable-mime-type-gicon 2014-04-14 20:27:20 +02:00
Colomban Wendling
9a41f919c1 Update mappings for new Scintilla 2014-04-14 16:36:05 +02:00
Colomban Wendling
b81c35e4e3 Fix const promotion with updated Scintilla 2014-04-14 16:34:19 +02:00
Colomban Wendling
d32ae83202 Apply filetype-specific indentation settings for newly opened files
Fix the check enabling filetype-specific indentation settings to also
pass if the document has no filetype set yet, e.g. when opening it.
2014-04-14 02:46:11 +02:00
Colomban Wendling
8f713377c4 Merge branch '1.25/safer-plugin_signal_connect' 2014-04-13 20:07:26 +02:00
Colomban Wendling
75542c6d3c Add defensive checks on plugin_signal_connect()'s sensitive arguments 2014-04-13 19:59:37 +02:00
Colomban Wendling
27a073f1a6 Make plugin_signal_connect() safe on any object
Watch the lifetime of objects referenced in plugin->signal_ids and
remove our references to them if they get destroyed.  This avoids
possibly trying to disconnect signals on destroyed objects when the
plugin is unloaded.

Supporting this case is safer, and is useful for objects that may or
may not outlive the plugin (like ScintillaObjects), because in such
cases plugin_signal_connect() is handy to make sure the signals are
disconnected if the object is still alive, but used to crash if the
object was destroyed.
2014-04-13 19:59:37 +02:00
Colomban Wendling
24f2363fb7 Post release version bump
Say hello to Geany 1.25 "Veed"!
2014-04-13 19:33:23 +02:00
Colomban Wendling
187e06bcb1 Use proper argument lists 2014-04-13 16:19:32 +02:00
Colomban Wendling
8fe9fa68c1 Update displayed copyright years 2014-04-13 15:51:06 +02:00
Enrico Tröger
e802194ad3 Re-add the previous workaround to remember the directory Geany was started from
My previous fix (e1ce9cfbec) didn't fix all possible use cases (opening
files from CLI when starting Geany). This one should close the gap.
2014-04-13 15:14:35 +02:00
Colomban Wendling
148283356d Fix a missing cast (oops) 2014-04-12 16:17:52 +02:00