summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2013-02-23Track original URI of file for savingHEADmasterDan Nicholson3-22/+32
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.
2013-02-23mime: Use G_N_ELEMENTS instead of separate variableDan Nicholson1-2/+1
2013-02-23Avoid Gtk[HV]Box warnings on gtk3Dan Nicholson1-0/+4
2013-02-23evbp: Initialize gtk to avoid g_thread_init warningsDan Nicholson1-4/+2
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.
2013-02-23plug: Destroy child to avoid bugs in removing plug from socketDan Nicholson1-0/+15
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.
2013-02-23evbp: Handle destruction appropriatelyDan Nicholson1-1/+5
Without referencing the objects, the lifetimes of the plug and viewer were difficult to manage and the pointers could become invalid unexpectedly.
2013-02-23evbp: Protect against SetWindow after plug has been destroyedDan Nicholson1-4/+8
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.
2013-02-23plug: Begin custom EvbpPlug classDan Nicholson4-1/+114
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.
2013-02-12Add a print button to the toolbarDan Nicholson1-0/+57
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).
2013-01-19Only force redrawing when the plugin is in-processDan Nicholson1-1/+2
Out-of-process GtkPlug seems to work fine, so let's reserve this hack only for when it's needed.
2013-01-19Track whether the plugin is in- or out-of processDan Nicholson1-0/+8
GtkPlug behaves differently in each instance, so we need to keep track of how the plugin is being run.
2013-01-19mime: Add a bunch more types from newer evinceDan Nicholson1-1/+13
2013-01-19mime: Workaround ABI breakage in newer evinceDan Nicholson1-0/+5
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.
2013-01-19mime: Use g_list_free_full instead of separate loopDan Nicholson1-2/+1
2013-01-19ev-page-action-widget: Use g_signal_connect instead of g_signal_connect_objectCarlos Garcia Campos1-4/+4
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.
2013-01-19Set appropriate size request on plug creationDan Nicholson1-0/+2
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.
2013-01-19Move forced redraw out of widget into pluginDan Nicholson2-6/+12
The EvbpViewer widget normally works fine, and the forced resizing only seems to be needed on Epiphany.
2013-01-19Resize plug window rather than returning after initial SetWindowDan Nicholson1-15/+14
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.
2013-01-19Log plugin and Evince version during initializationDan Nicholson1-0/+3
2013-01-19Add Evince major version to description stringDan Nicholson1-2/+9
2013-01-19Destroy the GtkPlug when the plugin is destroyedDan Nicholson1-0/+4
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.
2013-01-19Keep track of the GtkPlugDan Nicholson1-4/+5
This is our toplevel widget and we really need to keep tabs on its interactions with the embedder.
2012-10-31Resize the EvbpViewer widget according to its parent containerJames Collier1-0/+6
Doing this upon opening a new document in epiphany ensures the widget is the correct size and is scrollable.
2012-10-30Respond to NPPVpluginWantsAllNetworkStreams query from browserDan Nicholson1-0/+4
Apparently NPPVpluginWantsAllNetworkStreams is always queried, so tell the browser that we don't need all the network streams.
2012-08-21Limit exported symbols to just those needed for NPAPIDan Nicholson2-1/+9
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.
2012-08-18Allow plugin installation directories to be specifiedDan Nicholson1-4/+2
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.
2012-08-08Allow building both gtk2 and gtk3 versions of pluginDan Nicholson1-9/+25
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.
2012-06-06Optionally build against gtk3 and evince3Dan Nicholson1-3/+6
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.
2012-06-06Change library name to libevince-pluginDan Nicholson1-4/+4
This is a little more in line with other NPAPI plugins and more descriptive than libevbp.
2012-05-27Add EvbpViewer convenience library to use in testsDan Nicholson1-5/+9
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.
2012-05-27Add suffix to default save filename from mime rulesDan Nicholson3-6/+15
When we try to construct the filename from the document title, use the mime type mappings to get a suffix.
2012-05-27Rename mime function to match module betterDan Nicholson3-3/+3
2012-05-26Add a Open in Evince toolbar buttonDan Nicholson1-0/+41
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.
2012-05-26Add a Save Copy toolbar buttonDan Nicholson1-0/+83
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.
2012-03-20viewer: Add accelerator to focus page selectorDan Nicholson2-0/+44
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.
2012-03-20viewer: Connect accelerators and add to toplevel windowDan Nicholson1-25/+48
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
2012-03-20viewer: Add page selector to toolbarDan Nicholson6-3/+882
This adds the page selector widget to the toolbar with actions. The code is copied directly from evince's libmisc.
2012-03-17Drop explicit grab focus on EvViewDan Nicholson1-1/+0
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.
2012-03-16viewer: Add continuous view toggle buttonDan Nicholson1-1/+37
Similar code as the best fit/page width toggle buttons.
2012-03-14viewer: Add toggle buttons for setting the sizing modeDan Nicholson1-0/+72
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.
2012-03-13plugin: Remove redundant debug messageDan Nicholson1-1/+0
2012-03-13viewer: Add toolbar just with page up/down buttons for nowDan Nicholson3-0/+67
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.
2012-03-11Begin EvbpViewer widgetDan Nicholson4-27/+170
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.
2012-03-06plugin: Initialize only evince prior to NP_InitializeDan Nicholson1-18/+30
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.
2012-03-06config: Rework Mozilla dependencies so we don't link in librariesDan Nicholson1-2/+2
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.
2012-03-06plugin: Drop unused filename memberDan Nicholson1-2/+0
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.
2012-03-06Add 2011 to copyright statementsDan Nicholson3-3/+3
I wrote a lot of this last year.
2012-03-05Add GPLv2+ licenses to the codeDan Nicholson3-0/+57
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.
2012-03-05plugin: Drop unneeded headerDan Nicholson1-1/+0
I'm pretty sure glib.h pulls everything necessary in.
2012-03-04plugin: Add a couple more debugging messagesDan Nicholson1-1/+5