There is no need to expose the Glade-only callbacks in the header as
nobody uses them directly anyway; and not having them makes the header
a little less bloated.
The callback wasn't used from glade but is useful for some other places so
it's worth moving into document.c. This also fixes a bug where reload via sidebar
always reloads the current document instead of the actually clicked one.
We used to set the widget's style in a style-set handler, and despite
guarding ourselves from recursive invocations, the GTK frame clock
introduced by GTK 3.8 didn't like it very much.
So, replace the manual color modification by a simpler global widget
state modification, making the code simpler and smaller, yet achieving
the same result (or so I hope and see).
And explicitly convert backward slashes in the global
prefix to forward slashes as tools like pkg-config or
gcc could interpret the backward slashes as escape
sequences.
Since the infobar is backed in a GtkPaned that allows "shrink", if the
content is too wide, it's far end will just get cropped. Also, wrap
labels are nicer to display possibly long texts as it flows naturally.
Now document_get_from_page() supports arbitrary nesting inside the
notebook page, update document_get_notebook_page() to support it also,
by searching up for the direct notebook child rather than assuming it
is the ScintillaWidget's direct parent.
Directly use the GeanyDocument rather than pass the notebook page
widget and get the document from that. This makes the code more future
proof and less weird.
Since infobars notebook_tab_close_clicked_cb() wants a GeanyDocument as userdata.
show_tab_bar_popup_menu() on the other hand wants the actual GtkNotebook child.
This is an extension of the long-lived `document-messages` branch.
It is mostly adjusted according to the feedback on the mailing list.
There might existing some usability issues to be resolved, but this
is the first step towards non-modal document notifications.
When the info bar is shown tab/shift+tab and escape are intercepted.
* tab/shift+tab change the focus to the info bar buttons which can then be
cycled through with more tab presses
* escape closes the info bar (same as clicking cancel)
Both keys aren't needed for the document because it's read-only. Other keys,
such arrow/page up/down, remain to the document for navigating.
This avoids accidental changes the file until the infobar is ackowledged. The
document can still be viewed and scrolled through but modifications and saving
are disabled. Of course ignoring the document by changing to another one is
also possible.
The close button is removed from the dialog also since the user can easily
choose to close the document normally.
Setting default response removed since it's not working yet.
Two other related changes are that document_set_text_changed() is used to
indicate that the buffer is different from what's on disk and also that
the 'Close' button has been removed from the dialog since the user can easily
just close the document themselves the normal way.
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.
* 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.