Age | Commit message (Collapse) | Author | Files | Lines |
|
Use the original URI of the file when setting a default for the saved
file. This is an improvement over using the document title or the
temporary file name from the browser. As a bonus, this avoids the
deprecated ev_backends_manager_get_document_type_info API from evince.
|
|
|
|
|
|
It was assumed that gtk was already initialized, but there's no harm in
initializing it again and avoids the deprecation warnings from
g_thread_init.
|
|
When GtkPlug is in the same process as GtkSocket, a complicated pile of
code is invoked to remove the plug from the socket when the socket is
being destroyed. This leads to the plug being in some dicey intermediate
states where it is changing back to a toplevel and critical warnings are
thrown from its contained widgets. Workaround this by just destroying
the contained widget (the viewer) as soon as the plug removal can be
detected.
|
|
Without referencing the objects, the lifetimes of the plug and viewer
were difficult to manage and the pointers could become invalid
unexpectedly.
|
|
For some reason, Epiphany (WebKitGtk) likes to send a last SetWindow
even as it's in the process of destroying the widget. Check whether the
plug is still a GtkWindow before telling it to resize to the Window
we're being told about.
|
|
There are a few bugs in the usage of GtkPlug that cause critical
warnings and crashes. Using our own class to override methods might give
a chance to workaround these issues.
|
|
Print the document from the toolbar or via Ctrl-p using the
ev-print-operation backend. This is different than the Print dialog from
the browser, which has a NPAPI interface to pass back a block of
PostScript. That doesn't seem to be working from firefox, but this usage
is probably what people typically want anyway (print the document rather
than just what appears on the web page).
|
|
Out-of-process GtkPlug seems to work fine, so let's reserve this hack
only for when it's needed.
|
|
GtkPlug behaves differently in each instance, so we need to keep track
of how the plugin is being run.
|
|
|
|
Prior to 3.4, evince would allocate EvTypeInfo's in
ev_backends_manager_get_all_types_info(), but now it just returns
pointers into its own table.
|
|
|
|
g_signal_connect_object has been finally fixed in recent versions of
glib, so the signal is disconnected when the object is disposed. However
we are manually disconnecting the signal handler, which gives a runtime
warning with recent glib versions because the signal has already been
disconnected. Use g_signal_connect() and keep disocnnecting the signal
manually to make sure it still works with previous versions of glib.
This is upstream evince commit 30f23d6.
|
|
When the plug is out of process, it doesn't get appropriate allocations
from the socket. Firefox seems to handle this fine, but let's just make
use of the size information it's provided us.
|
|
The EvbpViewer widget normally works fine, and the forced resizing only
seems to be needed on Epiphany.
|
|
Epiphany seems to like to call SetWindow a lot and depends on the plugin
resizing its window appropriately. If the plug already exists, resize it
to the requested dimensions rather than just returning even if the
dimensions are the same.
|
|
|
|
|
|
Previously the GtkPlug was being implicitly destroyed when the
EvbpViewer object was destroyed. This worked fine under firefox where
the plugin code jumped through hoops to make sure the GtkPlug was
disconnected before destroying its GtkSocket, but other browsers may not
perform this trick for us.
|
|
This is our toplevel widget and we really need to keep tabs on its
interactions with the embedder.
|
|
Doing this upon opening a new document in epiphany ensures the widget is
the correct size and is scrollable.
|
|
Apparently NPPVpluginWantsAllNetworkStreams is always queried, so tell
the browser that we don't need all the network streams.
|
|
To load the plugin only NP_Initialize and friends are needed. After that
the NPPluginFuncs vtable is used to call into the plugin. This keeps the
symbols from the viewer widget and mime code from being visible outside
of the plugin.
|
|
Instead of always putting the plugins into ${libdir}/mozilla/plugins,
allow the directories to be specified by --with-gtk2-plugindir and
--with-gtk3-plugindir. This also changes the default for the gtk3 plugin
to ${libdir}/epiphany/plugins until the mozilla based browsers can
support gtk3 plugins.
|
|
To make things more useful for GNOME/epiphany, which is squarely in gtk3
land, allow building both the gtk2 and gtk3 versions of the plugin. I'm
not sure what will happen when both plugin's are in the browser's path.
A subsequent patch will allow finer grained control of the installation
directory.
|
|
The current not ideal situation for NPAPI plugins is that only gtk2 is
supported on mozilla browsers and only gtk3 is supported on epiphany.
Thus, a choice needs to be made whether to link in one gtk version or
the other depending on the intended usage.
The viewer code is entirely compatible with gtk3 and evince3, but
GtkPlug needs a little adjustment. However, the plugin immediately
crashes on firefox since it's still running gtk2 and our plugin is in
the same address space. To use gtk3 unconditionally we'll either need to
run the plugin in a separate process like totem or just wait patiently
for gtk3 to be supported by firefox. I choose the latter for now and
default to gtk2 since firefox is by far the more popular browser.
|
|
This is a little more in line with other NPAPI plugins and more
descriptive than libevbp.
|
|
Rather than build all the EvbpViewer sources twice, make a convience
library for the tests to link to. This does add the unfortunate effect
of relinking libevbp-viewer.la and libevbp.la every time there's a
change in the source, though.
|
|
When we try to construct the filename from the document title, use the
mime type mappings to get a suffix.
|
|
|
|
There are many, many features available in Evince that I have no
intention of supporting here. The purpose of this plugin is to display
documents simply in the browser. Add a button to launch the current file
in the full Evince viewer.
|
|
Allow the user to save a copy of the current document. The initial
directory is the XDG Downloads directory. The initial filename is the
document title since the current filename is likely some temporary thing
from the browser. It then falls back to the current filename, though.
|
|
An accelerator group for EvView shortcuts is added with an initial
accelerator to focus the page selector in the toolbar. Since these
accelerators are only intended to be associated with the EvView, we
set them sensitive only when it comes into focus.
|
|
The toolbar accelerators were not being activated for two reasons:
1. GtkUIManager does not connect toolbar accelerators automatically
2. The accelerators were never being connected to the toplevel window
|
|
This adds the page selector widget to the toolbar with actions. The code
is copied directly from evince's libmisc.
|
|
It turns out that the reason the toolbar was getting focus first for
my previewer and not the real evince-previewer was that the toolbar
buttons were set as sensitive when the widget was shown. If instead
the document is loaded after the window is shown like in both the
plugin and the real previewer, then the initial focus will be on the
scrolled window as desired.
|
|
Similar code as the best fit/page width toggle buttons.
|
|
Set the sizing mode to Best Fit or Page Width just like evince. This
needs a little dance to shut off the signal handlers when the mode
gets set initially or otherwise outside of the buttons themselves.
|
|
|
|
Add back the toolbar to the EvbpViewer widget. As on the previous
attempt, the UI manager XML is being kept inline so now external files
are needed. Right now this just has the page up/down buttons.
|
|
Start building up a widget object, EvbpViewer, again. Once we're doing
anything more complicated than just putting an EvView in a scrolled
window, it'll help to keep most of it in it's own widget. The widget
subclasses GtkBox so we can just put a toolbar and scrolled window in.
|
|
We need to load evince in order to get the MIME types in
NP_GetMIMEDescription, and this happens prior to
NP_Initialize. Unfortunately, evince has issues if it's shutdown and
restarted, so right now the full plugin initialization sequence is
kicked off when geting the MIME types. That's a little dirty, so just
initialize evince once and let the rest happen as normal from
NP_Initialize.
|
|
We really only need the headers for xulrunner and nspr and don't want
to link anything since the symbols will all resolve at runtime when
the plugin is loaded.
|
|
The EvDocument holds the file's uri, so there's no need to hold on to
the filename as given to us by the browser.
|
|
I wrote a lot of this last year.
|
|
GPL seems more appropriate than LGPL at this point since I can't see
anyone linking to this code. And v2+ seems like a good compromise
since so many people are anti-v3.
|
|
I'm pretty sure glib.h pulls everything necessary in.
|
|
|