26 #ifdef GDK_WINDOWING_WAYLAND
27 #include <gdk/gdkwayland.h>
74 return plugin->
newStream(type, stream, seekable, stype);
110 return plugin->
write(stream, offset, len, buffer);
119 return plugin->
print(platformPrint);
128 return plugin->
handleEvent(static_cast<XEvent *>(event));
137 return plugin->
urlNotify(url, reason, notifyData);
176 pluginFuncs->
size =
sizeof(pluginFuncs);
194 if (!browserFuncs || !pluginFuncs)
203 gtk_init(
nullptr,
nullptr);
205 #ifdef GDK_WINDOWING_WAYLAND
206 if (GDK_IS_WAYLAND_DISPLAY(gdk_display_get_default()))
210 browser = browserFuncs;
213 GBytes *resourceData = g_resources_lookup_data(
"/org/gnome/evince/browser/ui/evince-browser.css", G_RESOURCE_LOOKUP_FLAGS_NONE,
nullptr);
215 GtkCssProvider *cssProvider = gtk_css_provider_new();
217 gtk_css_provider_load_from_data(cssProvider, static_cast<const gchar *>(g_bytes_get_data(resourceData,
nullptr)), g_bytes_get_size(resourceData),
nullptr);
218 g_bytes_unref(resourceData);
220 gtk_style_context_add_provider_for_screen(gdk_screen_get_default(), GTK_STYLE_PROVIDER(cssProvider), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
221 g_object_unref(cssProvider);
233 static const struct {
237 {
"application/postscript",
"ps" },
238 {
"application/x-ext-ps",
"ps" },
239 {
"application/x-bzpostscript",
"ps.bz2" },
240 {
"application/x-gzpostscript",
"ps.gz" },
241 {
"image/x-eps",
"eps,epsi,epsf" },
242 {
"application/x-ext-eps",
"eps,epsi,epsf" },
243 {
"image/x-bzeps",
"eps.bz2,epsi.bz2,epsf.bz2" },
244 {
"image/x-gzeps",
"eps.gz,epsi.gz,epsf.gz" },
245 {
"image/tiff",
"tif,tiff" },
246 {
"application/pdf",
"pdf" },
247 {
"application/x-ext-pdf",
"pdf" },
248 {
"application/x-bzpdf",
"pdf.bz2" },
249 {
"application/x-gzpdf",
"pdf.gz" },
250 {
"application/x-xzpdf",
"pdf.xz" },
251 {
"application/x-dvi",
"dvi" },
252 {
"application/x-ext-dvi",
"dvi" },
253 {
"application/x-bzdvi",
"dvi.bz2" },
254 {
"application/x-gzdvi",
"dvi.gz" },
255 {
"application/x-cbr",
"cbr" },
256 {
"application/x-ext-cbr",
"cbr" },
257 {
"application/x-cbz",
"cbz" },
258 {
"application/x-ext-cbz",
"cbz" },
259 {
"application/x-cb7",
"cb7" },
260 {
"application/x-ext-cb7",
"cb7" },
261 {
"application/x-cbt",
"cbt" },
262 {
"application/x-ext-cbt",
"cbt" },
263 {
"image/vnd.djvu",
"djvu,djv" },
264 {
"image/vnd.djvu+multipage",
"djvu,djv" },
265 {
"application/x-ext-djv",
"djv" },
266 {
"application/x-ext-djvu",
"djvu" },
267 {
"application/oxps",
"xps,oxps" },
268 {
"application/vnd.ms-xpsdocument",
"xps,oxps" }
279 #ifdef GDK_WINDOWING_WAYLAND
280 if (GDK_IS_WAYLAND_DISPLAY(gdk_display_get_default()))
284 GString *mimeDescriptionStr = g_string_new(
nullptr);
287 for (GList *l = typesInfo; l; l = g_list_next(l)) {
290 for (
unsigned i = 0; info->mime_types[i]; ++i) {
298 }(info->mime_types[i]);
303 g_string_append_printf(mimeDescriptionStr,
"%s:%s:%s;",
309 g_list_free(typesInfo);
335 return browser->
geturl(instance, url, target);
340 return browser->
uagent(instance);