From javscript C functions cannot be called, but signals
are available through the GObject type system. So
we allow javascript to call action signals like functions.
At the same time we modify a few browser functions, so
that they are functions that are available as signals.
The new singleton holds the shared settings and trash. It is
further more used to keep track of all open windows and quits
when the last window was closed. It also watches the focus in
case you need something like a "current" browser.
At the point of loading the first page the web view
hasn't loaded anything, so we need to manually focus
the Location if the page is blank.
Incidentally midori_browser_activate_action can activate
any action, so it will probably be much more useful
in the future.
The 'browser' struct is superseded by MidoriBrowser, which actually
represents a window that holds pages, i.e. tabs. The tabs are currently
of the type MidoriWebView, which is a slightly enhanced WebView. Also
MidoriWebSettings is introduced to hold additional settings that Midori
needs.
The other two new classes are MidoriTrash, representing closed tabs and
windows and MidoriPanel, representing the side panel.
The refactoring allows for several features to be much more easily
implemented, such as full support for multiple windows and instant
saving of modified files, such as bookmarks or the session. Regressions
are expected and not everything is done yet.