* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#include "main.h"
#include "layout-image.h"
+#include <cstring>
+
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <gdk/gdk.h>
+#include <gio/gio.h>
+#include <glib-object.h>
+#include <pango/pango.h>
+
+#include <config.h>
+
+#include "archives.h"
#include "collect.h"
+#include "debug.h"
#include "dnd.h"
#include "editors.h"
#include "exif.h"
#include "filedata.h"
#include "fullscreen.h"
#include "history-list.h"
-#include "image.h"
#include "image-overlay.h"
+#include "image.h"
#include "img-view.h"
+#include "intl.h"
#include "layout-util.h"
+#include "layout.h"
+#include "main-defines.h"
#include "menu.h"
#include "metadata.h"
#include "misc.h"
-#include "pixbuf-util.h"
+#include "options.h"
#include "pixbuf-renderer.h"
#include "slideshow.h"
#include "ui-fileops.h"
#include "ui-menu.h"
+#include "ui-utildlg.h"
#include "uri-utils.h"
#include "utilops.h"
#include "view-file.h"
-#define FILE_COLUMN_POINTER 0
-
static GtkWidget *layout_image_pop_menu(LayoutWindow *lw);
static void layout_image_set_buttons(LayoutWindow *lw);
static gboolean layout_image_animate_new_file(LayoutWindow *lw);
*----------------------------------------------------------------------------
*/
+struct AnimationData
+{
+ ImageWindow *iw;
+ LayoutWindow *lw;
+ GdkPixbufAnimation *gpa;
+ GdkPixbufAnimationIter *iter;
+ GdkPixbuf *gpb;
+ FileData *data_adr;
+ gint delay;
+ gboolean valid;
+ GCancellable *cancellable;
+ GFile *in_file;
+ GFileInputStream *gfstream;
+};
+
static void image_animation_data_free(AnimationData *fd)
{
if(!fd) return;
file_util_copy_path_to_clipboard(layout_image_get_fd(lw), FALSE);
}
+#if HAVE_GTK4
+static void li_pop_menu_copy_image_cb(GtkWidget *, gpointer data)
+{
+/* @FIXME GTK4 stub */
+}
+#else
static void li_pop_menu_copy_image_cb(GtkWidget *, gpointer data)
{
auto lw = static_cast<LayoutWindow *>(data);
if (!pixbuf) return;
gtk_clipboard_set_image(gtk_clipboard_get(GDK_SELECTION_CLIPBOARD), pixbuf);
}
+#endif
static void li_pop_menu_move_cb(GtkWidget *widget, gpointer data)
{
}
else
{
- warning_dialog(_("Cannot open archive file"), _("See the Log Window"), GTK_STOCK_DIALOG_WARNING, nullptr);
+ warning_dialog(_("Cannot open archive file"), _("See the Log Window"), GQ_ICON_DIALOG_WARNING, nullptr);
}
}
item = menu_item_add_check(menu, _("Hide file _list"), lw->options.tools_hidden,
G_CALLBACK(li_pop_menu_hide_cb), lw);
+
+ item = menu_item_add_check(menu, _("Hide Selectable Bars"), lw->options.selectable_toolbars_hidden, G_CALLBACK(layout_selectable_toolbars_toggle), lw);
if (fullscreen) gtk_widget_set_sensitive(item, FALSE);
return menu;
{
tpath = static_cast<GtkTreePath *>(work->data);
gtk_tree_model_get_iter(store, &iter, tpath);
- gtk_tree_model_get(store, &iter, FILE_COLUMN_POINTER, &fd_n, -1);
+ gtk_tree_model_get(store, &iter, VIEW_FILE_COLUMN_POINTER, &fd_n, -1);
work = work->next;
}
{
tpath = static_cast<GtkTreePath *>(work->data);
gtk_tree_model_get_iter(store, &iter, tpath);
- gtk_tree_model_get(store, &iter, FILE_COLUMN_POINTER, &fd_n, -1);
+ gtk_tree_model_get(store, &iter, VIEW_FILE_COLUMN_POINTER, &fd_n, -1);
work = work->next;
}
#pragma GCC diagnostic ignored "-Wunused-function"
const gchar *layout_image_get_name_unused(LayoutWindow *lw)
{
- if (!layout_valid(&lw)) return NULL;
+ if (!layout_valid(&lw)) return nullptr;
return image_get_name(lw->image);
}
}
else
{
- warning_dialog(_("Cannot open archive file"), _("See the Log Window"), GTK_STOCK_DIALOG_WARNING, nullptr);
+ warning_dialog(_("Cannot open archive file"), _("See the Log Window"), GQ_ICON_DIALOG_WARNING, nullptr);
}
}
else if (options->image_l_click_video && options->image_l_click_video_editor && imd-> image_fd && imd->image_fd->format_class == FORMAT_CLASS_VIDEO)
{
gint i;
auto lw = static_cast<LayoutWindow *>(data);
- gdouble sx, sy;
+ gdouble sx;
+ gdouble sy;
if (lw->full_screen && lw->image != lw->full_screen->imd &&
imd != lw->full_screen->imd)
void layout_status_update_pixel_cb(PixbufRenderer *pr, gpointer data)
{
auto lw = static_cast<LayoutWindow *>(data);
- gint x_pixel, y_pixel;
- gint width, height;
+ gint x_pixel;
+ gint y_pixel;
+ gint width;
+ gint height;
gchar *text;
PangoAttrList *attrs;
if(x_pixel >= 0 && y_pixel >= 0)
{
- gint r_mouse, g_mouse, b_mouse;
+ gint r_mouse;
+ gint g_mouse;
+ gint b_mouse;
pixbuf_renderer_get_pixel_colors(pr, x_pixel, y_pixel,
&r_mouse, &g_mouse, &b_mouse);
if (img_fd)
{
- gdouble sx, sy;
+ gdouble sx;
+ gdouble sy;
image_change_fd(lw->split_images[i], img_fd, zoom);
image_get_scroll_center(lw->image, &sx, &sy);
image_set_scroll_center(lw->split_images[i], sx, sy);