Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
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.
|
|
Some simple html to show both local and remote PDFs in their own
window and as objects embedded on the page. It should probably have a
couple more file types, too.
|
|
|
|
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.
|
|
A simple wrapper script setting the plugin path to include the built
library, enabling the debug messages, and loading the test pdf unless
told otherwise. An environment variable EVBP_PROFILE allows to use a
specific firefox profile rather than the default.
|
|
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.
|
|
The code is very similar to the plugin and gives an opportunity to
make sure the way we use evince still works correctly.
|
|
Without this declaration, automake uses maintainer mode all the time.
That seems like a win to me since maintainer mode always does the
right thing when the changes to the autotools files have been made.
|
|
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.
|
|
|
|
|
|
It was just holding a structure definition.
|
|
Too many things are defined by autoconf to try to support building
without it.
|
|
Unless the EVBP_DEBUG environment variable is set, install a debug
message handler that simply discards them.
|
|
I don't see a good reason to have a hand-rolled debug logger when glib
already has one. This does drop the backwards compat define for
__func__, though, which means we need C99. It's 2012 now.
|
|
When the plug is destroyed, it will take down the widgets for us.
Trying to unref after that will just cause warnings.
|
|
And it works! Instead of using the EvPreviewer object, just create the
documents and widgets straight in the plugin. This removes the toolbar
for now and just leaves a scrolled window for the view. We'll get that
back later.
|
|
|
|
|
|
Evince can't handle streamed documents, so tell Mozilla to save the file
locally and provide us the filename. This in turn is passed on to the
previewer for rendering.
Unfortunately, this causes the code to segfault, and I don't know why.
|
|
The way we want the plugin to work is to embed our previewer widget
within the browser process and have it pass through all events as if
it was a normal GTK process. This is accomplished through the XEmbed
Extension as described here:
https://developer.mozilla.org/en/XEmbed_Extension_for_Mozilla_Plugins
|
|
The Mozilla NPAPI call sequence isn't all that clear, so it's nice to
see a log of the functions.
|
|
When DEBUG is defined and we have a suitable compiler, evbp_debug will
log a message with the file, function name and the format string passed
to it. Otherwise, it just logs the format string to stderr.
|
|
Some of the plugin backends (I think evince in particular), don't react
well when they're initialized repeatedly. Since we build the MIME string
dynamically, we need to do initialization from both NP_Initialize and
NP_GetMIMEDescription. Just move all the init and shutdown code to their
own functions and make sure we only do it once.
|
|
Still not doing anything useful, but now the widget is wired up and the
backends are enabled.
|
|
Basic beginnings of a plugin for the evince previewer. Right now
basically all it does is set up the function tables and return the MIME
description.
The plugin is created as a libtool module. The mozilla-plugin and nspr
packages are dependencies to get the NPAPI SDK headers and associated
NSPR types. Hopefully that's available on most platforms.
|
|
We could hardcode a list of likely MIME types that the plugin will
support, but we can get the information directly from evince's
backends manager. A mapping from mime type to file extension (which
Mozilla wants) is used and contains all the MIME types supported by
evince as of gnome-2-30.
A small test program has been added to show the constructed MIME
description as used by Mozilla.
|
|
For GCC, allow the warning flags to enabled. Turn them on by default so
we see things ahead of time.
|
|
The test program is a just a simple exerciser for the EvPreviewer
widget, and the pdf is borrowed from evince.
|
|
|
|
In order to embed the previewer into other windows (such as the browser
window), change the widget to subclass the vbox one level down from the
window.
Some code restructuring is needed to handle things that hookup to the
window. To that effect, a toplevel member has been added that points to
the a toplevel window when the hierarchy changes. The max and min scale
also have to be delayed until the screen becomes available.
|
|
There's no reason to pass in our own document model when creating the
previewer. Just have the previewer create its own during initialization.
With all the previewer components created immediately and all properties
removed, the constructor can be dropped and all the code moved to _init.
|
|
Instead of loading the GtkUIManager XML for the previewer from an
external file that has to be found and located, embed it in the source
and load it as a string. This allows the plugin to be completely self
contained in the module. Also, this allows the PrintPreview button to
be hidden when the printing code is not enabled.
|
|
Since we intend to use the previewer as a widget rather than an app,
we can merge the app code into the object code. Likewise, the Window
part of the class is pretty superfluous.
One change is that the document loading happens as part of setting the
source file.
|
|
Adds the basic support for building the previewer code and making a
libtool convenience library.
AM_GLIB_GNU_GETTEXT is currently commented out as none of the
localization support is available.
|
|
This is a dump of the evince-previewer code from the gnome-2-30 branch
of evince (commit 38693288). This code will be converted into a widget
in a convenience library to be used from the mozilla plugin.
The source for evince's libmisc have also been copied with the
previewer code.
|