6384 Commits

Author SHA1 Message Date
Colomban Wendling
f735e6800b Add GTK3 version of our custom styles
Although GTK3 still have gtk_rc_parse_string(), it doesn't work anymore
for our overrides, so register proper CSS for them.
2012-10-09 13:25:12 +02:00
Colomban Wendling
7d0adef31b Use GtkFontChooserDialog on GTK >= 3.2 for consistency
GtkFontButton uses GtkFontChooserDialog on GTK 3.2 so the UI is more
consistent if we use it explicitly too, and GtkFontSelectionDialog
is somewhat broken on 3.4.
2012-10-09 13:25:12 +02:00
Colomban Wendling
d6fba7ac82 Make GeanyWrapLabel work with GTK3
Although theoretically GtkLabel from GTK3 should be able to replace
GeanyWrapLabel altogether, a bug [1] with it makes it use way too much
space in our about dialog (and possibly other places), making it not
really usable.

So, port the GeanyWrapLabel hack to GTK3, with the appropriate
additional hacks for it to work.  At least it looks good and don't
seem to have resizing issues now.

[1] https://bugzilla.gnome.org/show_bug.cgi?id=657621
2012-10-09 13:25:12 +02:00
Colomban Wendling
caf207c36a Don't use old GTK1-style typesystem
This fixes the SCINTILLA_CLASS() and IS_SCINTILLA() macros on GTK3.
No harm on GTK2, those macros are available since 2.0.

This also makes those macros more consistent with the SCINTILLA()
macro that already uses the proper GObject calls.

Backported from Scintilla HG: 9cd7cf1d9af73d50b0423ed34a6693bbf7f57ac8
2012-10-09 13:25:12 +02:00
Colomban Wendling
1839451363 Fix a packing issue on GTK3
GTK3 changed the default for expand and fill, so explicitly set them.
2012-10-09 13:25:12 +02:00
Colomban Wendling
6c942c1436 Prevent plugins built against GTK2 Geany from loading in GTK3 Geany 2012-10-09 13:24:42 +02:00
Colomban Wendling
394f223b49 Load GTK3 version of the VTE library when built against GTK3 2012-10-08 20:08:07 +02:00
Colomban Wendling
3ae884c13f Make X11 backend specific code GTK3-proof 2012-10-08 20:08:07 +02:00
Colomban Wendling
c5985f0cd1 Add ::draw handler for GTK3 where we have ::expose-event handlers 2012-10-08 20:08:07 +02:00
Colomban Wendling
fa5a00b48b Map GeanyWrapLabel to GtkLabel on GTK3
The GTK3 version of GtkLabel provides what GeanyWrapLabel is for given
the appropriate settings are set, so no need to our own widget -- that
would require being updated to support GTK3 anyway.
2012-10-08 20:08:07 +02:00
Colomban Wendling
3e649dddef Prevent most GTK3 deprecation warnings that can't be fixed on GTK2
Map the various horizontal and vertical deprecated constructors
to their GtkOrientation-based equivalents on GTK3 to prevent most
deprecation warnings.
2012-10-08 20:08:07 +02:00
Colomban Wendling
6409840d4a Get rid of GtkComboBoxEntry API and use GtkComboBoxText API
Use the GtkComboBoxText API and the GtkComboBoxEntry replacement API
and map those to the old equivalents if not available.

This changes the type exposed by ui_combo_box_add_to_history() from
GtkComboBoxEntry to either GtkComboBox (under GTK2) or GtkComboBoxText
(under GTK3).  This should not be too much of an issue since
GtkComboBoxEntry and GtkComboBoxtext are subclasses of GtkComboBox,
but this will still emit warnings when when the calling code passes
a GtkComboBoxEntry pointer to ui_combo_box_add_to_history().

However, this requires the calling code to use the same mapping as we
do (GtkComboBoxText = GtkComboBox on GTK2, even on 2.24), or things
will blow and it'll be hard to understand why.  This wouldn't be an
issue if the calling code includes our gtkcompat.h header everywhere
it deals with combo boxes, which will be the case if it includes the
Geany headers everywhere but probably won't otherwise.  Oh dear.

A possible kind of workaround may be for ui_combo_box_add_to_history()
to do type-checking on its argument and use the actually correct API
for that type.
2012-10-08 20:08:06 +02:00
Colomban Wendling
5ec0eb477d Guard removed dialog separators on GTK3
GtkDialog separators sere deprecated on GTK 2.22 and remove on 3.0,
so define them to dummy values on GTK3.

We don't get rid of them altogether because GTK 2.16 we depend on
probably has separators enabled by default and we want to remove them.
2012-10-08 20:08:06 +02:00
Colomban Wendling
c54639c0e1 Include keysyms compatibility header on GTK3 2012-10-08 20:08:06 +02:00
Colomban Wendling
a763e307f7 Don't access GtkWidget fields directly
Since many accessor are new in GTK versions we don't depend on, add
a header that defines them to the direct access if they aren't
available.
2012-10-08 20:08:06 +02:00
Colomban Wendling
484cc3adac Add configure flag --enable-gtk3 to build against GTK 3.x 2012-10-08 20:08:06 +02:00
Colomban Wendling
eeddd6f720 Move custom styles to a resource file 2012-10-08 17:51:19 +02:00
Colomban Wendling
3070738df8 Make wordchars have precedence over whitespacechars
This makes the "wordchars" setting from filetypes.common and each
specific filetype override filetype.common's "whitespace_chars"
setting, rather than it overriding filetype-specific "wordchars".

This makes the it easy to chose filetype-specific "wordchars", where
before user had not only to update this setting, but also the
filetype.common "whitespace_chars" setting if it listed one or more of
the new characters for the change to actually have an effect -- and
changing "whitespace_chars" for every filetype.

Closes #3429368.
2012-10-06 01:32:54 +02:00
Colomban Wendling
565c917688 Consider dash (-) when looking for the word to complete for CSS 2012-10-06 00:55:03 +02:00
Colomban Wendling
2297badbd7 Use "scala" extension for Scala
Closes #3574723.
2012-10-05 12:43:10 +02:00
Colomban Wendling
64a47b9cb6 Allow to switch message window orientation to place it on the right 2012-10-01 21:38:56 +02:00
trongthanh
474e60b6fa Add more CSS3 keywords 2012-09-30 11:13:43 -07:00
trongthanh
85cb6d527c Improve CSS highlighting 2012-09-30 11:08:13 -07:00
trongthanh
e70d9e5e05 Fix JavaScript ident/keyword highlighting in HTML filetype 2012-09-30 10:57:38 -07:00
Colomban Wendling
2c6c210c6f Fix detection of keywords when followed by a semicolon
Closes #2130612.
2012-09-30 15:46:59 +02:00
Colomban Wendling
c1a7b1b475 Fix various packing issue affecting GTK3 but compatible with GTK2 2012-09-28 18:06:58 +02:00
Colomban Wendling
972b34e49a Keep caret and anchor position upon indent and unindent
Closes #3167355.
2012-09-28 16:19:06 +02:00
Frank Lanitz
d6bbdab166 Update of Basque translation 2012-09-26 21:07:59 +02:00
Frank Lanitz
00ccac5b78 Update of Italian translation 2012-09-25 19:58:39 +02:00
Colomban Wendling
bf233bc055 JavaScript parser: create class tag for variable with children methods
If we generated methods, properties or class children tags for a
variable, generate a class tag for the variable itself so the children
aren't orphaned.
2012-09-25 16:48:10 +02:00
Colomban Wendling
5df551b1ce JavaScript parser: fix parsing non-method properties
If a property value had more than one token, the parser choked on it
and failed to parse further properties of the object.  Fix that by
properly skipping the property's value.  If that value is a sub-object,
parse it recursively.

Closes #3470609.
2012-09-25 16:47:42 +02:00
Colomban Wendling
dc6e4f2723 JavaScript parser: lowercase "object" isn't a keyword
Closes #3036476.
2012-09-25 02:11:58 +02:00
Colomban Wendling
b9ca95c381 JavaScript parser: fix some unterminated statement corner case issues
This fixes parsing of the following unterminated statements:

	if () {
		foo = 42
	}

	if () {
		foo = new Object()
	}

	if () {
		foo = ({a:1,b:2})
	}
2012-09-25 01:31:11 +02:00
Colomban Wendling
205bab83d7 JavaScript parser: properly consume closing brace after a block in findCmdTerm() 2012-09-25 01:29:33 +02:00
Colomban Wendling
74890cc308 JavaScript parser: Simplify parseJfFile() code (no functional changes) 2012-09-24 19:51:37 +02:00
Colomban Wendling
297bca3799 JavaScript parser: Don't drop the token after an unbraced if
If an `if` haven't had braces, the code used to check itself for an
`else` after it, eating the next token if it wasn't actually an `else`.

So, drop the check for the else altogether since parseLine() handles
`else`s by calling parseIf() anyway.

This fixes constructs like:

	if (foo)
		bar();
	function baz() {
		// ...
	}

Closes #3568542.
2012-09-24 19:46:48 +02:00
Oleg Eterevsky
66888d580f In ctags JavaScript parser fix recognizing functions inside methods 2012-09-24 18:20:53 +02:00
Colomban Wendling
effc8ef86f Add proper scope for JS tags including their own context
This makes `Foo.bar = function()` properly report a function tag "bar"
with scope "Foo" rather than a function tag "Foo.bar" with no scope.

Part of #3570192.
2012-09-24 12:25:36 +02:00
Colomban Wendling
be45924f7c JavaScript parser: don't set token position information again and again
There is no need to set the token position information in the loop
searching for the initial token character, simply do that when we
finally found the token start.
2012-09-22 18:13:07 +02:00
Colomban Wendling
772509e898 ctags: fix improper use of "const" type qualifier
The external declaration of "File" in read.h (defined in read.c) was
improperly tagged as "const" for it not to be modifiable outside of
read.c.  Although it is good to protect this global variable against
improper modification, the use of "const" here makes it perfectly valid
for the compiler to assume that the fields in this structure never
changes during runtime, thus allowing it to do optimizations on this
assumption.  However, this assumption is wrong because this structure
actually gets modified by many read.c's functions, and thus possibly
lead to improper and unexpected behavior if the compiler sees a window
for optimizing fields access.

Moreover, protecting "File" as it was with the "const" type qualifier
required a hack to be able to include read.h in read.c since "const"
and non-"const" declarations conflicts.

Actually, at least the JavaScript parser did suffer of the issue,
because it calls getSourceLineNumber() macro (expanding to a direct
"File" member access) several times in one single function, making it
easy for the compilers to cache the value as an optimization.  Both GCC
and CLang showed this behavior with optimization enabled.  As a result,
the line numbers of JavaScript tags were often incorrect.
2012-09-22 17:52:29 +02:00
Lex Trotman
9ef34bbe0c Fix pointer warning
GCC 4.7.1 gives a incompatible pointer warning because gtk_adjustment_new
returns a GObject* not a GtkAdjustment* (new compiler default).
2012-09-22 16:05:51 +10:00
Lex Trotman
5ef6e1627c Fix multiline comments at end of file
Multiline comments did not work at end of file because there is no
style there so also check if at end of file as well as style.
Closes #3026691
2012-09-22 14:13:14 +10:00
Lex Trotman
fbb89f523a Remove illegal signal handling
The SIGTERM handler called the standard exit callback which uses
functions that are illegal in signal handlers.  Commented out as
a prelude to full removal if no use case can be made.
2012-09-22 13:40:33 +10:00
Lex Trotman
e5e3760157 Use faster squiggle underlining
Geany performance suffered with a lot of error underlining visible.
Matthew Brush developed an improved implementation that was accepted
into Scintilla, this selects that implementation.
2012-09-22 12:47:29 +10:00
Colomban Wendling
877b0477c4 Set scope information for JavaScript tags
Instead of adding the scope to the tag name, properly add it as the
tag's scope.

Closes #3570192.
2012-09-22 01:27:11 +02:00
Colomban Wendling
2d83a85eb7 Update NEWS for a few recently fixed bugs 2012-09-17 23:15:11 +02:00
Colomban Wendling
b886ac1b2e Merge branch 'improve-scope-detection' 2012-09-17 22:59:52 +02:00
Colomban Wendling
8289e8f962 Report scope including classes, namespaces and alike
Don't only match the current function as the current scope, but also
classes, namespaces and others containers.

Closes #1996778.
2012-09-17 22:51:36 +02:00
Colomban Wendling
491a45f614 Improve symbols_get_current_function() a lot and make it more flexible
Finding the current function now better handles the case the current
line is after a function but outside its scope, and many other issues
the scope reporting had.
2012-09-17 22:50:32 +02:00
Colomban Wendling
9d2dab8fcf Fix an off-by-one issue in sci_get_position_from_line()
Scintilla counts lines from 0 but TagManager from 1, so convert them.
2012-09-17 20:22:52 +02:00