talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit fd6149254aaebd40e2ac74d8c2c6f1a54d71d0f3
parent abed0c4a511d0d247eaa17cd235f433863dc3025
Author: Jonathan Boeing <jonathan@claws-mail.org>
Date:   Mon,  9 Oct 2023 22:42:31 -0700

Build fixes

Diffstat:
Msrc/plugins/litehtml_viewer/container_linux.cpp | 7++++---
Msrc/plugins/litehtml_viewer/container_linux.h | 1-
Msrc/plugins/litehtml_viewer/container_linux_images.cpp | 14+++-----------
Asrc/plugins/litehtml_viewer/container_linux_images.h | 35+++++++++++++++++++++++++++++++++++
4 files changed, 42 insertions(+), 15 deletions(-)

diff --git a/src/plugins/litehtml_viewer/container_linux.cpp b/src/plugins/litehtml_viewer/container_linux.cpp @@ -21,6 +21,7 @@ #endif #include "container_linux.h" +#include "container_linux_images.h" #include <cmath> #include "lh_prefs.h" @@ -411,18 +412,18 @@ void container_linux::draw_background( litehtml::uint_ptr hdc, const std::vector switch(bg.repeat) { case litehtml::background_repeat_no_repeat: - draw_pixbuf(cr, bgbmp, bg.position_x, bg.position_y, bgbmp->get_width(), bgbmp->get_height()); + draw_pixbuf(cr, bgbmp, bg.position_x, bg.position_y, gdk_pixbuf_get_width(bgbmp), gdk_pixbuf_get_height(bgbmp)); break; case litehtml::background_repeat_repeat_x: cairo_set_source(cr, pattern); - cairo_rectangle(cr, bg.clip_box.left(), bg.position_y, bg.clip_box.width, bgbmp->get_height()); + cairo_rectangle(cr, bg.clip_box.left(), bg.position_y, bg.clip_box.width, gdk_pixbuf_get_height(bgbmp)); cairo_fill(cr); break; case litehtml::background_repeat_repeat_y: cairo_set_source(cr, pattern); - cairo_rectangle(cr, bg.position_x, bg.clip_box.top(), bgbmp->get_width(), bg.clip_box.height); + cairo_rectangle(cr, bg.position_x, bg.clip_box.top(), gdk_pixbuf_get_width(bgbmp), bg.clip_box.height); cairo_fill(cr); break; diff --git a/src/plugins/litehtml_viewer/container_linux.h b/src/plugins/litehtml_viewer/container_linux.h @@ -104,7 +104,6 @@ public: void del_clip() override; virtual void make_url( const char* url, const char* basepath, litehtml::string& out ); - virtual Glib::RefPtr<Gdk::Pixbuf> get_image(const char* url, bool redraw_on_ready) = 0; void clear_images(); diff --git a/src/plugins/litehtml_viewer/container_linux_images.cpp b/src/plugins/litehtml_viewer/container_linux_images.cpp @@ -20,14 +20,11 @@ #include "claws-features.h" #endif -#include <set> #include "common/utils.h" -#include "container_linux.h" +#include "container_linux_images.h" #include "http.h" -typedef std::pair<litehtml::string, struct timeval> lru_entry; - static GdkPixbuf *lh_get_image(const char *url) { GError *error = NULL; @@ -59,12 +56,7 @@ theend: return pixbuf; } -struct FetchCtx { - container_linux *container; - gchar *url; -}; - -static void get_image_threaded(GTask *task, gpointer source, gpointer task_data, GCancellable *cancellable) +void get_image_threaded(GTask *task, gpointer source, gpointer task_data, GCancellable *cancellable) { struct FetchCtx *ctx = (struct FetchCtx *)task_data; GdkPixbuf *pixbuf = lh_get_image(ctx->url); @@ -72,7 +64,7 @@ static void get_image_threaded(GTask *task, gpointer source, gpointer task_data, g_task_return_pointer(task, pixbuf, NULL); } -static void get_image_callback(GObject *source, GAsyncResult *res, gpointer user_data) +void get_image_callback(GObject *source, GAsyncResult *res, gpointer user_data) { GdkPixbuf *pixbuf; struct FetchCtx *ctx = (struct FetchCtx *)user_data; diff --git a/src/plugins/litehtml_viewer/container_linux_images.h b/src/plugins/litehtml_viewer/container_linux_images.h @@ -0,0 +1,35 @@ +/* + * Claws Mail -- A GTK based, lightweight, and fast e-mail client + * Copyright(C) 2023 the Claws Mail Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program; if not, write tothe Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef CONTAINER_LINUX_IMAGES_H +#define CONTAINER_LINUX_IMAGES_H + +#include <set> + +#include "container_linux.h" + +typedef std::pair<litehtml::string, struct timeval> lru_entry; + +struct FetchCtx { + container_linux *container; + gchar *url; +}; + +void get_image_threaded(GTask *task, gpointer source, gpointer task_data, GCancellable *cancellable); +void get_image_callback(GObject *source, GAsyncResult *res, gpointer user_data); + +#endif