-misc-non-private-member-variables-in-classes,
-misc-use-anonymous-namespace,
-modernize-avoid-c-arrays,
- -modernize-macro-to-enum,
-modernize-raw-string-literal,
-modernize-use-trailing-return-type,
-performance-no-int-to-ptr,
-readability-function-cognitive-complexity,
-readability-identifier-length,
-readability-implicit-bool-conversion,
- -readability-isolate-declaration,
-readability-magic-numbers,
-readability-named-parameter,
-readability-qualified-auto,
case EXIF_ADVCOL_FORMAT:
case EXIF_ADVCOL_ELEMENTS:
{
- gchar *s1, *s2;
+ gchar *s1;
+ gchar *s2;
gtk_tree_model_get(model, a, n, &s1, -1);
gtk_tree_model_get(model, b, n, &s2, -1);
static void bar_pane_comment_write_config(GtkWidget *pane, GString *outstr, gint indent)
{
PaneCommentData *pcd;
- gint w, h;
+ gint w;
+ gint h;
pcd = static_cast<PaneCommentData *>(g_object_get_data(G_OBJECT(pane), "pane_data"));
if (!pcd) return;
static void bar_pane_exif_update(PaneExifData *ped)
{
- GList *list, *work;
+ GList *list;
+ GList *work;
ped->all_hidden = TRUE;
{
PaneExifData *ped;
gboolean ret = FALSE;
- GList *list, *work;
+ GList *list;
+ GList *work;
ped = static_cast<PaneExifData *>(g_object_get_data(G_OBJECT(bar), "pane_data"));
if (!ped) return FALSE;
guint, gpointer)
{
PaneExifData *ped;
- GList *work, *list;
+ GList *work;
+ GList *list;
gint pos;
GtkWidget *new_entry = nullptr;
pos = 0;
while (work)
{
- gint nx, ny;
+ gint nx;
+ gint ny;
auto entry = static_cast<GtkWidget *>(work->data);
GtkAllocation allocation;
work = work->next;
static void bar_pane_exif_write_config(GtkWidget *pane, GString *outstr, gint indent)
{
PaneExifData *ped;
- GList *work, *list;
+ GList *work;
+ GList *list;
ped = static_cast<PaneExifData *>(g_object_get_data(G_OBJECT(pane), "pane_data"));
if (!ped) return;
{
PaneGPSData *pgd;
GenericDialog *gd;
- FileData *fd, *fd_found;
- GList *work, *list;
- gint count, geocoded_count;
- gdouble latitude, longitude;
+ FileData *fd;
+ FileData *fd_found;
+ GList *work;
+ GList *list;
+ gint count;
+ gint geocoded_count;
+ gdouble latitude;
+ gdouble longitude;
GString *message;
gchar *location;
gchar **latlong;
static gboolean bar_pane_gps_marker_keypress_cb(GtkWidget *widget, ClutterButtonEvent *bevent, gpointer)
{
FileData *fd;
- ClutterActor *label_marker, *parent_marker;
+ ClutterActor *label_marker;
+ ClutterActor *parent_marker;
ClutterColor marker_colour = { MARKER_COLOUR };
ClutterColor text_colour = { TEXT_COLOUR };
ClutterColor thumb_colour = { THUMB_COLOUR };
gchar *current_text;
- ClutterActor *actor, *direction;
+ ClutterActor *actor;
+ ClutterActor *direction;
ClutterActor *current_image;
GString *text;
- gint height, width;
+ gint height;
+ gint width;
GdkPixbufRotation rotate;
gchar *altitude = nullptr;
ThumbLoader *tl;
gdouble longitude;
gdouble compass;
FileData *fd;
- ClutterActor *parent_marker, *label_marker;
+ ClutterActor *parent_marker;
+ ClutterActor *label_marker;
ClutterActor *direction;
ClutterColor marker_colour = { MARKER_COLOUR };
ClutterColor thumb_colour = { THUMB_COLOUR };
const gchar *map_id;
gdouble position;
gint int_position;
- gint w, h;
+ gint w;
+ gint h;
pgd = static_cast<PaneGPSData *>(g_object_get_data(G_OBJECT(pane), "pane_data"));
if (!pgd) return;
gboolean expanded, gint height)
{
PaneGPSData *pgd;
- GtkWidget *vbox, *frame;
+ GtkWidget *vbox;
+ GtkWidget *frame;
GtkWidget *gpswidget;
- GtkWidget *status, *state, *progress, *slider;
+ GtkWidget *status;
+ GtkWidget *state;
+ GtkWidget *progress;
+ GtkWidget *slider;
ChamplainMarkerLayer *layer;
ChamplainView *view;
const gchar *slider_list[] = {GQ_ICON_ZOOM_IN, GQ_ICON_ZOOM_OUT, nullptr};
{
PaneGPSData *pgd;
gint zoom;
- gint int_longitude, int_latitude;
- gdouble longitude, latitude;
+ gint int_longitude;
+ gint int_latitude;
+ gdouble longitude;
+ gdouble latitude;
pgd = static_cast<PaneGPSData *>(g_object_get_data(G_OBJECT(pane), "pane_data"));
if (!pgd)
static void keyword_list_push(GtkWidget *textview, GList *list)
{
GtkTextBuffer *buffer;
- GtkTextIter start, end;
+ GtkTextIter start;
+ GtkTextIter end;
buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(textview));
gtk_text_buffer_get_bounds(buffer, &start, &end);
{
GList *keywords = nullptr;
GList *orig_keywords = nullptr;
- GList *work1, *work2;
+ GList *work1;
+ GList *work2;
GtkTextBuffer *keyword_buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(pkd->keyword_view));
keywords = metadata_read_list(pkd->fd, KEYWORD_KEY, METADATA_PLAIN);
{
PaneKeywordsData *pkd;
GList *path_expanded = nullptr;
- gint w, h;
+ gint w;
+ gint h;
pkd = static_cast<PaneKeywordsData *>(g_object_get_data(G_OBJECT(pane), "pane_data"));
if (!pkd) return;
GtkTreeIter child_iter;
GtkTreeModel *model;
GtkTreeModel *keyword_tree;
- GList *list, *work;
+ GList *list;
+ GList *work;
GList *keywords = nullptr;
GtkTextBuffer *keyword_buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(pkd->keyword_view));
static GtkWidget *bar_pane_keywords_new(const gchar *id, const gchar *title, const gchar *key, gboolean expanded, gint height)
{
PaneKeywordsData *pkd;
- GtkWidget *hbox, *vbox;
+ GtkWidget *hbox;
+ GtkWidget *vbox;
GtkWidget *scrolled;
GtkTextBuffer *buffer;
GtkTreeModel *store;
gpointer)
{
gint ret = 0;
- gchar *name1, *name2;
+ gchar *name1;
+ gchar *name2;
gtk_tree_model_get(model, a, 0, &name1, -1);
gtk_tree_model_get(model, b, 0, &name2, -1);
GtkWidget *label;
GtkWidget *tbar;
GtkWidget *combo;
- GList *editors_list, *work;
+ GList *editors_list;
+ GList *work;
gboolean have_filter;
GtkWidget *button;
GtkWidget *window;
GtkWidget *data_box;
GList *list;
- gint x, y;
- gint w, h;
+ gint x;
+ gint y;
+ gint w;
+ gint h;
GdkDisplay *display;
GdkSeat *seat;
GdkDevice *device;
gboolean bar_event(GtkWidget *bar, GdkEvent *event)
{
BarData *bd;
- GList *list, *work;
+ GList *list;
+ GList *work;
gboolean ret = FALSE;
bd = static_cast<BarData *>(g_object_get_data(G_OBJECT(bar), "bar_data"));
GtkWidget *bar_find_pane_by_id(GtkWidget *bar, PaneType type, const gchar *id)
{
BarData *bd;
- GList *list, *work;
+ GList *list;
+ GList *work;
GtkWidget *ret = nullptr;
if (!id || !id[0]) return nullptr;
void bar_write_config(GtkWidget *bar, GString *outstr, gint indent)
{
BarData *bd;
- GList *list, *work;
+ GList *list;
+ GList *work;
if (!bar) return;
static gboolean cache_sim_write_similarity(SecureSaveInfo *ssi, CacheData *cd)
{
- guint x, y;
+ guint x;
+ guint y;
guint8 buf[3 * 32];
if (!cd || !cd->similarity || !cd->sim || !cd->sim->filled) return FALSE;
gchar b;
gchar buf[1024];
gsize p = 0;
- gint w, h;
+ gint w;
+ gint h;
b = 'X';
while (b != '[')
gchar b;
guint8 pixel_buf[3];
ImageSimilarityData *sd;
- gint x, y;
+ gint x;
+ gint y;
b = 'X';
while (b != '=')
auto cellicon = reinterpret_cast<GQvCellRendererIcon *>(cell);
gint calc_width;
gint calc_height;
- gint xpad, ypad;
- gfloat xalign, yalign;
+ gint xpad;
+ gint ypad;
+ gfloat xalign;
+ gfloat yalign;
gtk_cell_renderer_get_padding(cell, &xpad, &ypad);
gtk_cell_renderer_get_alignment(cell, &xalign, &yalign);
const gchar *text;
GdkRectangle cell_rect;
GtkStateFlags state;
- gint xpad, ypad;
+ gint xpad;
+ gint ypad;
pixbuf = cellicon->pixbuf;
GdkRectangle rect;
GdkRectangle cell_rect;
gint i;
- gint xpad, ypad;
+ gint xpad;
+ gint ypad;
gtk_cell_renderer_get_padding(cell, &xpad, &ypad);
gboolean scan_geometry(gchar *buffer, GdkRectangle &window)
{
- gint nx, ny, nw, nh;
+ gint nx;
+ gint ny;
+ gint nw;
+ gint nh;
if (sscanf(buffer, "%d %d %d %d", &nx, &ny, &nw, &nh) != 4) return FALSE;
static gboolean collection_table_find_iter(CollectTable *ct, CollectInfo *info, GtkTreeIter *iter, gint *column)
{
GtkTreeModel *store;
- gint row, col;
+ gint row;
+ gint col;
store = gtk_tree_view_get_model(GTK_TREE_VIEW(ct->listview));
if (!collection_table_find_position(ct, info, &row, &col)) return FALSE;
static void collection_table_select_region_util(CollectTable *ct, CollectInfo *start, CollectInfo *end, gboolean select)
{
- gint row1, col1;
- gint row2, col2;
+ gint row1;
+ gint col1;
+ gint row2;
+ gint col2;
gint t;
- gint i, j;
+ gint i;
+ gint j;
if (!collection_table_find_position(ct, start, &row1, &col1) ||
!collection_table_find_position(ct, end, &row2, &col2) ) return;
static void tip_show(CollectTable *ct)
{
GtkWidget *label;
- gint x, y;
+ gint x;
+ gint y;
GdkDisplay *display;
GdkSeat *seat;
GdkDevice *device;
if (ct->tip_window)
{
- gint x, y;
+ gint x;
+ gint y;
gdk_device_get_position(device, nullptr, &x, &y);
gq_gtk_window_move(GTK_WINDOW(ct->tip_window), x + 16, y + 16);
void collection_table_set_focus(CollectTable *ct, CollectInfo *info)
{
GtkTreeIter iter;
- gint row, col;
+ gint row;
+ gint col;
if (g_list_find(ct->cd->list, ct->focus_info))
{
gboolean after = FALSE;
GdkRectangle cell;
GdkWindow *parent;
- gint x_parent, y_parent;
+ gint x_parent;
+ gint y_parent;
GError *error = nullptr;
GInputStream *in_stream;
GdkPixbuf *pb;
if (info)
{
- gint x, y;
- gint w, h;
+ gint x;
+ gint y;
+ gint w;
+ gint h;
w = gdk_window_get_width(ct->marker_window);
h = gdk_window_get_height(ct->marker_window);
{
auto ct = static_cast<CollectTable *>(data);
GdkWindow *window;
- gint x, y;
- gint w, h;
+ gint x;
+ gint y;
+ gint w;
+ gint h;
GdkSeat *seat;
GdkDevice *device;
GtkTreeModel *store;
GtkTreeIter iter;
GList *work;
- gint r, c;
+ gint r;
+ gint c;
store = gtk_tree_view_get_model(GTK_TREE_VIEW(ct->listview));
void collection_table_file_update(CollectTable *ct, CollectInfo *info)
{
GtkTreeIter iter;
- gint row, col;
+ gint row;
+ gint col;
gdouble value;
if (!info)
GList *collection_list_randomize(GList *list)
{
- guint random, length, i;
+ guint random;
+ guint length;
+ guint i;
gpointer tmp;
- GList *nlist, *olist;
+ GList *nlist;
+ GList *olist;
length = g_list_length(list);
if (!length) return nullptr;
guchar *pix;
gint rs;
gint i;
- gint pixbuf_width, pixbuf_height;
+ gint pixbuf_width;
+ gint pixbuf_height;
pixbuf_width = gdk_pixbuf_get_width(pixbuf);
static gboolean color_man_idle_cb_unused(gpointer data)
{
auto *cm = static_cast<ColorMan *>(data);
- gint width, height;
+ gint width;
+ gint height;
gint rh;
if (!cm->pixbuf) return FALSE;
{
gchar *buf_nl;
regex_t regex;
- gint ret_comp, ret_exec;
+ gint ret_comp;
+ gint ret_exec;
buf_nl = g_strconcat(buf, "\n", NULL);
gchar *dir;
gchar *path;
gchar *text;
- GtkTextIter start, end;
+ GtkTextIter start;
+ GtkTextIter end;
GError *error = nullptr;
gboolean ret = TRUE;
const gchar *name = gq_gtk_entry_get_text(GTK_ENTRY(ew->entry));
{
gint n = GPOINTER_TO_INT(data);
gint ret = 0;
- gboolean bool1, bool2;
+ gboolean bool1;
+ gboolean bool2;
switch (n)
{
case DESKTOP_FILE_COLUMN_PATH:
case DESKTOP_FILE_COLUMN_HIDDEN:
{
- gchar *s1, *s2;
+ gchar *s1;
+ gchar *s2;
gtk_tree_model_get(model, a, n, &s1, -1);
gtk_tree_model_get(model, b, n, &s2, -1);
gint rs;
guchar *pix;
guchar *p;
- gint i, j;
+ gint i;
+ gint j;
alpha = gdk_pixbuf_get_has_alpha(pixbuf);
rs = gdk_pixbuf_get_rowstride(pixbuf);
void dnd_set_drag_icon(GtkWidget *widget, GdkDragContext *context, GdkPixbuf *pixbuf, gint items)
{
GdkPixbuf *dest;
- gint w, h;
- gint sw, sh;
+ gint w;
+ gint h;
+ gint sw;
+ gint sh;
PangoLayout *layout = nullptr;
- gint x, y;
+ gint x;
+ gint y;
x = y = 0;
if (items > 1)
{
gchar *buf;
- gint lw,lh;
+ gint lw;
+ gint lh;
layout = gtk_widget_create_pango_layout(widget, nullptr);
buf = g_strdup_printf("<small> %d </small>", items);
}
else if (isdir(fd->path))
{
- GList *f, *d;
+ GList *f;
+ GList *d;
dw->add_files_queue = g_list_remove(dw->add_files_queue, g_list_first(dw->add_files_queue)->data);
if (filelist_read(fd, &f, &d))
}
else if (isdir(fd->path) && recurse)
{
- GList *f, *d;
+ GList *f;
+ GList *d;
if (filelist_read(fd, &f, &d))
{
GList *work;
work = work->next;
if (isdir(fd->path) && !recurse)
{
- GList *f, *d;
+ GList *f;
+ GList *d;
if (filelist_read(fd, &f, &d))
{
{
GtkWidget *image;
GdkPixbuf *pixbuf;
- gint x, y;
+ gint x;
+ gint y;
guchar *d_pix;
guchar *dp;
gint rs;
{
auto sortable = static_cast<GtkTreeSortable *>(data);
gint ret = 0;
- gchar *rank_str_a, *rank_str_b;
+ gchar *rank_str_a;
+ gchar *rank_str_b;
gint rank_int_a;
gint rank_int_b;
gint group_a;
gchar *extensions;
gchar *type;
const gchar *key = filename_from_path(path);
- gchar **categories, **only_show_in, **not_show_in;
+ gchar **categories;
+ gchar **only_show_in;
+ gchar **not_show_in;
gchar *try_exec;
GtkTreeIter iter;
gboolean category_geeqie = FALSE;
gdouble xres = exif_get_rational_as_double(exif, "Exif.Photo.FocalPlaneXResolution");
gdouble yres = exif_get_rational_as_double(exif, "Exif.Photo.FocalPlaneYResolution");
gint res_unit;
- gint w, h;
- gdouble xsize, ysize, size, ratio;
+ gint w;
+ gint h;
+ gdouble xsize;
+ gdouble ysize;
+ gdouble size;
+ gdouble ratio;
if (xres == 0.0 || yres == 0.0) return 0.0;
if (software)
{
- gint i, j;
+ gint i;
+ gint j;
g_strstrip(software);
static gchar *exif_build_formatted_FocalLength35mmFilm(ExifData *exif)
{
gint n;
- gdouble f, c;
+ gdouble f;
+ gdouble c;
if (exif_get_integer(exif, "Exif.Photo.FocalLengthIn35mmFilm", &n) && n != 0)
{
static gchar *exif_build_formatted_Resolution(ExifData *exif)
{
- ExifRational *rx, *ry;
+ ExifRational *rx;
+ ExifRational *ry;
gchar *units;
gchar *text;
ExifRational *value;
ExifItem *item;
guint i;
- gdouble p, p3;
- gulong p1, p2;
+ gdouble p;
+ gdouble p3;
+ gulong p1;
+ gulong p2;
string = g_string_new("");
static gchar *mode_number(mode_t m)
{
- gint mb, mu, mg, mo;
+ gint mb;
+ gint mu;
+ gint mg;
+ gint mo;
gchar pbuf[12];
mb = mu = mg = mo = 0;
gchar *text_from_size(gint64 size)
{
- gchar *a, *b;
- gchar *s, *d;
- gint l, n, i;
+ gchar *a;
+ gchar *b;
+ gchar *s;
+ gchar *d;
+ gint l;
+ gint n;
+ gint i;
/* what I would like to use is printf("%'d", size)
* BUT: not supported on every libc :(
if (tmp)
{
struct tm time_str;
- uint year, month, day, hour, min, sec;
+ uint year;
+ uint month;
+ uint day;
+ uint hour;
+ uint min;
+ uint sec;
sscanf(tmp, "%4u:%2u:%2u %2u:%2u:%2u", &year, &month, &day, &hour, &min, &sec);
time_str.tm_year = year - 1900;
if (tmp)
{
struct tm time_str;
- uint year, month, day, hour, min, sec;
+ uint year;
+ uint month;
+ uint day;
+ uint hour;
+ uint min;
+ uint sec;
sscanf(tmp, "%4u:%2u:%2u %2u:%2u:%2u", &year, &month, &day, &hour, &min, &sec);
time_str.tm_year = year - 1900;
/* all files in the list have ref count > 0 */
const GList *work;
- GList *s_work, *new_sidecars;
+ GList *s_work;
+ GList *new_sidecars;
FileData *parent_fd;
if (!basename_list) return;
filter_add_if_missing("apng", "Animated Portable Network Graphic", ".apng", FORMAT_CLASS_IMAGE, FALSE, FALSE, TRUE);
/* formats supported by gdk-pixbuf */
- GSList *list, *work;
+ GSList *list;
+ GSList *work;
list = gdk_pixbuf_get_formats();
work = list;
static gboolean histmap_read(HistMap *histmap, gboolean whole)
{
- gint w, h, i, j, srs, has_alpha, step, end_line;
+ gint w;
+ gint h;
+ gint i;
+ gint j;
+ gint srs;
+ gint has_alpha;
+ gint step;
+ gint end_line;
guchar *s_pix;
GdkPixbuf *imgpixbuf = histmap->pixbuf;
explode_gray_into_buf (struct jpeg_decompress_struct *cinfo,
guchar **lines)
{
- gint i, j;
+ gint i;
+ gint j;
guint w;
g_return_if_fail (cinfo != nullptr);
*/
w = cinfo->output_width;
for (i = cinfo->rec_outbuf_height - 1; i >= 0; i--) {
- guchar *from, *to;
+ guchar *from;
+ guchar *to;
from = lines[i] + w - 1;
to = lines[i] + (w - 1) * 3;
p = lines[i];
for (j = 0; j < cinfo->output_width; j++) {
- int c, m, y, k;
+ int c;
+ int m;
+ int y;
+ int k;
c = p[0];
m = p[1];
y = p[2];
auto lj = static_cast<ImageLoaderJpeg *>(loader);
struct jpeg_decompress_struct cinfo;
struct jpeg_decompress_struct cinfo2;
- guchar *dptr, *dptr2;
+ guchar *dptr;
+ guchar *dptr2;
guint rowstride;
guchar *stereo_buf2 = nullptr;
guint stereo_length = 0;
if (mpo && mpo->num_images > 1)
{
guint i;
- gint idx1 = -1, idx2 = -1;
+ gint idx1 = -1;
+ gint idx2 = -1;
guint num2 = 1;
for (i = 0; i < mpo->num_images; i++)
ddjvu_rect_t rrect;
ddjvu_rect_t prect;
ddjvu_format_t *fmt;
- gint width, height;
+ gint width;
+ gint height;
gint stride;
gboolean alpha = FALSE;
cairo_surface_t *surface;
struct heif_error error_code;
struct heif_image_handle* handle;
guint8* data;
- gint width, height;
+ gint width;
+ gint height;
gint stride;
gboolean alpha;
gint page_total;
if (0 == len)
len = 1;
- OPJ_SIZE_T dist = static_cast<guchar *>(pcur) - static_cast<guchar *>(pbuf), n = len - dist;
+ OPJ_SIZE_T dist = static_cast<guchar *>(pcur) - static_cast<guchar *>(pbuf);
+ OPJ_SIZE_T n = len - dist;
g_assert (dist <= len);
while (n < p_nb_bytes) {
gint width;
gint height;
gint num_components;
- gint i, j, k;
+ gint i;
+ gint j;
+ gint k;
guchar *pixels;
gint bytes_per_pixel;
opj_buffer_info_t *decode_buffer;
explode_gray_into_buf (struct jpeg_decompress_struct *cinfo,
guchar **lines)
{
- gint i, j;
+ gint i;
+ gint j;
guint w;
g_return_if_fail (cinfo != nullptr);
*/
w = cinfo->output_width;
for (i = cinfo->rec_outbuf_height - 1; i >= 0; i--) {
- guchar *from, *to;
+ guchar *from;
+ guchar *to;
from = lines[i] + w - 1;
to = lines[i] + (w - 1) * 3;
p = lines[i];
for (j = 0; j < cinfo->output_width; j++) {
- int c, m, y, k;
+ int c;
+ int m;
+ int y;
+ int k;
c = p[0];
m = p[1];
y = p[2];
auto lj = static_cast<ImageLoaderJpeg *>(loader);
struct jpeg_decompress_struct cinfo;
struct jpeg_decompress_struct cinfo2;
- guchar *dptr, *dptr2;
+ guchar *dptr;
+ guchar *dptr2;
guint rowstride;
guchar *stereo_buf2 = nullptr;
guint stereo_length = 0;
if (mpo && mpo->num_images > 1)
{
guint i;
- gint idx1 = -1, idx2 = -1;
+ gint idx1 = -1;
+ gint idx2 = -1;
guint num2 = 1;
for (i = 0; i < mpo->num_images; i++)
GError *poppler_error = nullptr;
PopplerPage *page;
PopplerDocument *document;
- gdouble width, height;
+ gdouble width;
+ gdouble height;
cairo_surface_t *surface;
cairo_t *cr;
gboolean ret = FALSE;
TIFF *tiff;
guchar *pixels = nullptr;
- gint width, height, rowstride;
+ gint width;
+ gint height;
+ gint rowstride;
size_t bytes;
guint32 rowsperstrip;
gint dircount = 0;
for (row = 0; row < height; row += rowsperstrip)
{
- int rows_to_write, i_row;
+ int rows_to_write;
+ int i_row;
if (lt->abort) {
break;
*/
for (i_row = 0; i_row < rows_to_write / 2; i_row++)
{
- guchar *top_line, *bottom_line;
+ guchar *top_line;
+ guchar *bottom_line;
top_line = pixels + (row + i_row) * rowstride;
bottom_line = pixels + (row + rows_to_write - i_row - 1) * rowstride;
{
auto *ld = (ImageLoaderWEBP *) loader;
guint8* data;
- gint width, height;
+ gint width;
+ gint height;
gboolean res_info;
WebPBitstreamFeatures features;
VP8StatusCode status_code;
{
auto ld = static_cast<ImageLoaderZXSCR *>(loader);
guint8 *pixels;
- gint width, height;
- gint row, col, mrow, pxs, i;
- guint8 attr, bright, ink, paper;
+ gint width;
+ gint height;
+ gint row;
+ gint col;
+ gint mrow;
+ gint pxs;
+ gint i;
+ guint8 attr;
+ guint8 bright;
+ guint8 ink;
+ guint8 paper;
guint8 *ptr;
if (count != 6144 && count != 6912)
{
auto par = static_cast<ImageLoaderAreaParam *>(data);
ImageLoader *il = par->il;
- guint x, y, w, h;
+ guint x;
+ guint y;
+ guint w;
+ guint h;
g_mutex_lock(il->data_mutex);
il->area_param_list = g_list_remove(il->area_param_list, par);
x = par->x;
static gboolean image_loader_emit_size_cb(gpointer data)
{
- gint width, height;
+ gint width;
+ gint height;
auto il = static_cast<ImageLoader *>(data);
g_mutex_lock(il->data_mutex);
width = il->actual_width;
auto il = static_cast<ImageLoader *>(data);
GdkPixbuf *pb;
guchar *pix;
- size_t h, rs;
+ size_t h;
+ size_t rs;
/* a workaround for
https://bugzilla.gnome.org/show_bug.cgi?id=547669
g_mutex_lock(il->data_mutex);
- gint nw, nh;
+ gint nw;
+ gint nh;
if (width > il->requested_width || height > il->requested_height)
{
if (!enable)
{
/* send delayed */
- GList *list, *work;
+ GList *list;
+ GList *work;
list = g_list_reverse(il->area_param_delayed_list);
il->area_param_delayed_list = nullptr;
g_mutex_unlock(il->data_mutex);
static GdkPixbuf *image_osd_info_render(OverlayStateData *osd)
{
GdkPixbuf *pixbuf = nullptr;
- gint width, height;
+ gint width;
+ gint height;
PangoLayout *layout;
const gchar *name;
gchar *text;
name = image_get_name(imd);
if (name)
{
- gint n, t;
+ gint n;
+ gint t;
CollectionData *cd;
CollectInfo *info;
GHashTable *vars;
if (!imd->unknown)
{
- gint w, h;
+ gint w;
+ gint h;
GdkPixbuf *load_pixbuf = image_loader_get_pixbuf(imd->il);
if (imd->delay_flip &&
void image_osd_copy_status(ImageWindow *src, ImageWindow *dest)
{
- Histogram *h_src, *h_dest;
+ Histogram *h_src;
+ Histogram *h_dest;
image_osd_set(dest, image_osd_get(src));
h_src = image_osd_get_histogram(src);
{
auto imd = static_cast<ImageWindow *>(data);
LayoutWindow *lw;
- gint x_pixel, y_pixel;
+ gint x_pixel;
+ gint y_pixel;
if(options->draw_rectangle)
{
static void image_drag_cb(PixbufRenderer *pr, GdkEventMotion *event, gpointer data)
{
auto imd = static_cast<ImageWindow *>(data);
- gint width, height;
+ gint width;
+ gint height;
gint rect_width;
gint rect_height;
GdkPixbuf *rect_pixbuf;
- gint x_pixel, y_pixel;
- gint image_x_pixel, image_y_pixel;
+ gint x_pixel;
+ gint y_pixel;
+ gint image_x_pixel;
+ gint image_y_pixel;
if (options->draw_rectangle)
{
{
PixbufRenderer *pr;
gdouble zoom;
- gint width, height;
+ gint width;
+ gint height;
pr = reinterpret_cast<PixbufRenderer *>(imd->pr);
ViewWindow *vw;
GtkAllocation req_size;
GdkGeometry geometry;
- gint w, h;
+ gint w;
+ gint h;
if (!fd && !list && (!cd || !info)) return nullptr;
void layout_config_parse(gint style, const gchar *order,
LayoutLocation *a, LayoutLocation *b, LayoutLocation *c)
{
- gint na, nb, nc;
+ gint na;
+ gint nb;
+ gint nc;
layout_config_order_from_text(order, &na, &nb, &nc);
layout_config_from_data(style, na, nb, nc, a, b, c);
{
LayoutConfig *lc;
GtkWidget *button;
- gint a, b, c;
+ gint a;
+ gint b;
+ gint c;
lc = static_cast<LayoutConfig *>(g_object_get_data(G_OBJECT(widget), "layout_config"));
{
GtkWidget *button;
- gint x1, y1;
- gint x2, y2;
+ gint x1;
+ gint y1;
+ gint x2;
+ gint y2;
x1 = 0;
y1 = 0;
{
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);
GdkModifierType accel_mods,
gboolean)
{
- gchar *path, *name;
- gchar *key_name, *menu_name;
- gchar **subset_lt_arr, **subset_gt_arr;
- gchar *subset_lt, *converted_name;
+ gchar *path;
+ gchar *name;
+ gchar *key_name;
+ gchar *menu_name;
+ gchar **subset_lt_arr;
+ gchar **subset_gt_arr;
+ gchar *subset_lt;
+ gchar *converted_name;
auto array = static_cast<GPtrArray *>(data);
path = g_strescape(accel_path, nullptr);
char * tmp_file;
GError *error = nullptr;
GIOChannel *channel;
- char **pre_key, **post_key;
+ char **pre_key;
+ char **post_key;
const char *key_name;
char *converted_line;
int keymap_index;
GtkWidget *menu;
GtkWidget *sub_menu;
GtkWidget *item;
- GList *children, *iter;
+ GList *children;
+ GList *iter;
gint n;
GList *list = nullptr;
gint i = 0;
GtkWidget *menu;
GtkWidget *sub_menu;
gchar *menu_label;
- GList *children, *iter;
+ GList *children;
+ GList *iter;
gint i;
menu = gtk_ui_manager_get_widget(lw->ui_manager, options->hamburger_menu ? "/MainMenu/OpenMenu/WindowsMenu/" : "/MainMenu/WindowsMenu/");
GtkWidget *menu;
GtkWidget *sub_menu;
gchar *menu_label;
- GList *children, *iter;
+ GList *children;
+ GList *iter;
gint i;
FileData *fd;
static void layout_actions_editor_add(GString *desc, GList *path, GList *old_path)
{
- gint to_open, to_close, i;
+ gint to_open;
+ gint to_close;
+ gint i;
while (path && old_path && strcmp(static_cast<gchar *>(path->data), static_cast<gchar *>(old_path->data)) == 0)
{
path = path->next;
}
else
{
- gint width, height;
+ gint width;
+ gint height;
fd = image_get_fd(lw->image);
page_total = fd->page_total;
page_num = fd->page_num + 1;
static void layout_tools_setup(LayoutWindow *lw, GtkWidget *tools, GtkWidget *files)
{
GtkWidget *vbox;
- GtkWidget *w1, *w2;
+ GtkWidget *w1;
+ GtkWidget *w2;
gboolean vertical;
gboolean new_window = FALSE;
gint priority_location;
GtkWidget *h;
GtkWidget *v;
- GtkWidget *w1, *w2, *w3;
+ GtkWidget *w1;
+ GtkWidget *w2;
+ GtkWidget *w3;
GtkWidget *image_sb; /* image together with sidebars in utility box */
GtkWidget *tools;
if (style != -1)
{
- LayoutLocation d, f, i;
+ LayoutLocation d;
+ LayoutLocation f;
+ LayoutLocation i;
layout_config_parse(style, order, &d, &f, &i);
if (options->log_window_lines > 0 && logwindow->lines >= options->log_window_lines)
{
- GtkTextIter start, end;
+ GtkTextIter start;
+ GtkTextIter end;
gtk_text_buffer_get_start_iter(buffer, &start);
end = start;
{
GString *gstring = g_string_new(changed ? nullptr : "; ");
auto ssi = static_cast<SecureSaveInfo *>(data);
- gchar *tmp, *name;
+ gchar *tmp;
+ gchar *name;
g_string_append(gstring, "(gtk_accel_path \"");
{
gdouble coord;
gchar *endptr;
- gdouble deg, min, sec;
+ gdouble deg;
+ gdouble min;
+ gdouble sec;
gboolean ok = FALSE;
gchar *string = metadata_read_string(fd, key, METADATA_PLAIN);
if (!string) return fallback;
char *coordinate;
const char *ref;
gboolean ok = TRUE;
- char *old_locale, *saved_locale;
+ char *old_locale;
+ char *saved_locale;
param = value;
if (param < 0)
void keyword_copy(GtkTreeStore *keyword_tree, GtkTreeIter *to, GtkTreeIter *from)
{
- gchar *mark, *name, *casefold;
+ gchar *mark;
+ gchar *name;
+ gchar *casefold;
gboolean is_keyword;
/* do not copy KEYWORD_COLUMN_HIDE_IN, it fully shows the new subtree */
void keyword_tree_new_default()
{
- GtkTreeIter i1, i2;
+ GtkTreeIter i1;
+ GtkTreeIter i2;
if (!keyword_tree) keyword_tree_new();
gint utf8_compare(const gchar *s1, const gchar *s2, gboolean case_sensitive)
{
- gchar *s1_key, *s2_key;
- gchar *s1_t, *s2_t;
+ gchar *s1_key;
+ gchar *s2_key;
+ gchar *s1_t;
+ gchar *s2_t;
gint ret;
g_assert(g_utf8_validate(s1, -1, nullptr));
gchar *image_osd_mkinfo(const gchar *str, FileData *fd, GHashTable *vars)
{
- gchar delim = '%', imp = '|', sep[] = " - ";
- gchar *start, *end;
- guint pos, prev;
+ gchar delim = '%';
+ gchar imp = '|';
+ gchar sep[] = " - ";
+ gchar *start;
+ gchar *end;
+ guint pos;
+ guint prev;
gboolean want_separator = FALSE;
- gchar *name, *data;
+ gchar *name;
+ gchar *data;
GString *osd_info;
gchar *ret;
PanItem *pi;
GList *list;
GList *work;
- gint x1, y1, x2, y2, x3, y3;
- gint x, y, w, h;
+ gint x1;
+ gint y1;
+ gint x2;
+ gint y2;
+ gint x3;
+ gint y3;
+ gint x;
+ gint y;
+ gint w;
+ gint h;
gint grid;
gint column;
{
GList *list;
GList *work;
- gint x, y;
+ gint x;
+ gint y;
time_t tc;
gint count;
gint day_max;
{
FileData *fd;
PanItem *pi_day;
- gint dx, dy;
+ gint dx;
+ gint dy;
gint n = 0;
gchar fake_path[20];
static void pan_flower_size(PanWindow *pw, gint *width, gint *height)
{
GList *work;
- gint x1, y1, x2, y2;
+ gint x1;
+ gint y1;
+ gint x2;
+ gint y2;
x1 = 0;
y1 = 0;
static void pan_flower_position(FlowerGroup *group, FlowerGroup *parent,
gint *result_x, gint *result_y)
{
- gint x, y;
+ gint x;
+ gint y;
gint radius;
gdouble a;
static void pan_flower_build(PanWindow *pw, FlowerGroup *group, FlowerGroup *parent)
{
GList *work;
- gint x, y;
+ gint x;
+ gint y;
if (!group) return;
if (parent)
{
PanItem *pi;
- gint px, py, gx, gy;
- gint x1, y1, x2, y2;
+ gint px;
+ gint py;
+ gint gx;
+ gint gy;
+ gint x1;
+ gint y1;
+ gint x2;
+ gint y2;
px = parent->x + parent->width / 2;
py = parent->y + parent->height / 2;
void pan_folder_tree_compute(PanWindow *pw, FileData *dir_fd, gint *width, gint *height)
{
- gint x, y;
+ gint x;
+ gint y;
gint level;
- gint w, h;
+ gint w;
+ gint h;
level = 0;
x = PAN_BOX_BORDER;
{
GList *list;
GList *work;
- gint x, y;
+ gint x;
+ gint y;
gint grid_size;
gint next_y;
gint pan_item_box_draw(PanWindow *, PanItem *pi, GdkPixbuf *pixbuf, PixbufRenderer *,
gint x, gint y, gint width, gint height)
{
- gint bw, bh;
+ gint bw;
+ gint bh;
gint *shadow;
- gint rx, ry, rw, rh;
+ gint rx;
+ gint ry;
+ gint rw;
+ gint rh;
bw = pi->width;
bh = pi->height;
gint pan_item_tri_draw(PanWindow *, PanItem *pi, GdkPixbuf *pixbuf, PixbufRenderer *, gint x, gint y, gint width, gint height)
{
- gint rx, ry, rw, rh;
+ gint rx;
+ gint ry;
+ gint rw;
+ gint rh;
if (util_clip_region(x, y, width, height,
pi->x, pi->y, pi->width, pi->height,
gint pan_item_thumb_draw(PanWindow *pw, PanItem *pi, GdkPixbuf *pixbuf, PixbufRenderer *, gint x, gint y, gint width, gint height)
{
- gint tx, ty, tw, th;
- gint rx, ry, rw, rh;
+ gint tx;
+ gint ty;
+ gint tw;
+ gint th;
+ gint rx;
+ gint ry;
+ gint rw;
+ gint rh;
if (pi->pixbuf)
{
gint pan_item_image_draw(PanWindow *, PanItem *pi, GdkPixbuf *pixbuf, PixbufRenderer *, gint x, gint y, gint width, gint height)
{
- gint rx, ry, rw, rh;
+ gint rx;
+ gint ry;
+ gint rw;
+ gint rh;
if (util_clip_region(x, y, width, height,
pi->x, pi->y, pi->width, pi->height,
void pan_text_alignment_calc(PanTextAlignment *ta, PanItem *box)
{
- gint cw1, cw2;
- gint x, y;
+ gint cw1;
+ gint cw2;
+ gint x;
+ gint y;
GList *work1;
GList *work2;
{
GList *list;
GList *work;
- gint x, y;
+ gint x;
+ gint y;
time_t group_start_date;
gint total;
gint count;
for (i = (x / PAN_GRID_SIZE) * PAN_GRID_SIZE; i < x + width; i += PAN_GRID_SIZE)
{
- gint rx, ry, rw, rh;
+ gint rx;
+ gint ry;
+ gint rw;
+ gint rh;
if (util_clip_region(x, y, width, height,
i, y, 1, height,
}
for (i = (y / PAN_GRID_SIZE) * PAN_GRID_SIZE; i < y + height; i += PAN_GRID_SIZE)
{
- gint rx, ry, rw, rh;
+ gint rx;
+ gint ry;
+ gint rw;
+ gint rh;
if (util_clip_region(x, y, width, height,
x, i, width, 1,
static void pan_grid_build(PanWindow *pw, gint width, gint height, gint grid_size)
{
GList *work;
- gint col, row;
- gint cw, ch;
+ gint col;
+ gint row;
+ gint cw;
+ gint ch;
gint l;
- gint i, j;
+ gint i;
+ gint j;
pan_grid_clear(pw);
while (grid)
{
PanGrid *pg;
- gint rx, ry, rw, rh;
+ gint rx;
+ gint ry;
+ gint rw;
+ gint rh;
pg = static_cast<PanGrid *>(grid->data);
grid = grid->next;
while (work)
{
PanItem *pi;
- gint rx, ry, rw, rh;
+ gint rx;
+ gint ry;
+ gint rw;
+ gint rh;
pi = static_cast<PanItem *>(work->data);
work = work->next;
PanItem *pbox;
PanItem *p;
gchar *buf;
- gint x1, y1, x2, y2, x3, y3;
- gint x, y, w, h;
+ gint x1;
+ gint y1;
+ gint x2;
+ gint y2;
+ gint x3;
+ gint y3;
+ gint x;
+ gint y;
+ gint w;
+ gint h;
if (pw->click_pi == pi) return;
if (pi && !pi->fd) pi = nullptr;
if (pw->info_image_size > PAN_IMAGE_SIZE_THUMB_NONE)
{
- gint iw, ih;
+ gint iw;
+ gint ih;
if (image_load_dimensions(pi->fd, &iw, &ih))
{
gint scale = 25;
auto pw = static_cast<PanWindow *>(data);
PanItem *pi = nullptr;
GtkWidget *menu;
- gint rx, ry;
+ gint rx;
+ gint ry;
rx = ry = 0;
if (pr->scale)
static void scroll_cb(PixbufRenderer *pr, GdkEventScroll *event, gpointer)
{
- gint w, h;
+ gint w;
+ gint h;
w = pr->vis_width;
h = pr->vis_height;
auto pw = static_cast<PanWindow *>(data);
GtkAdjustment *adj;
GdkRectangle rect;
- gint width, height;
+ gint width;
+ gint height;
if (pr->scale == 0.0) return;
GtkWidget *menu;
GtkWidget *submenu;
GtkWidget *item;
- gboolean active, video;
+ gboolean active;
+ gboolean video;
GList *editmenu_fd_list;
GtkAccelGroup *accel_group;
{
GtkWidget *widget;
GtkWidget *parent;
- gint ww, wh;
+ gint ww;
+ gint wh;
GtkAllocation widget_allocation;
GtkAllocation parent_allocation;
static gboolean pr_scroller_update_cb(gpointer data)
{
auto pr = static_cast<PixbufRenderer *>(data);
- gint x, y;
- gint xinc, yinc;
+ gint x;
+ gint y;
+ gint xinc;
+ gint yinc;
/* this was a simple scroll by difference between scroller and mouse position,
* but all this math results in a smoother result and accounts for a dead zone.
if (pr->scroller_overlay == -1)
{
GdkPixbuf *pixbuf;
- gint w, h;
+ gint w;
+ gint h;
#ifdef GQ_BUILD
pixbuf = gdk_pixbuf_new_from_resource(GQ_RESOURCE_PATH_ICONS "/" PIXBUF_INLINE_SCROLLER ".png", nullptr);
static gboolean pr_source_tile_visible(PixbufRenderer *pr, SourceTile *st)
{
- gint x1, y1, x2, y2;
+ gint x1;
+ gint y1;
+ gint x2;
+ gint y2;
if (!st) return FALSE;
GList *pr_source_tile_compute_region(PixbufRenderer *pr, gint x, gint y, gint w, gint h, gboolean request)
{
- gint x1, y1;
+ gint x1;
+ gint y1;
GList *list = nullptr;
- gint sx, sy;
+ gint sx;
+ gint sy;
if (x < 0) x = 0;
if (y < 0) y = 0;
while (work)
{
SourceTile *st;
- gint rx, ry, rw, rh;
+ gint rx;
+ gint ry;
+ gint rw;
+ gint rh;
st = static_cast<SourceTile *>(work->data);
work = work->next;
static void pixbuf_renderer_sync_scroll_center(PixbufRenderer *pr)
{
- gint src_x, src_y;
+ gint src_x;
+ gint src_y;
if (!pr->width || !pr->height) return;
/*
static gboolean pr_size_clamp(PixbufRenderer *pr)
{
- gint old_vw, old_vh;
+ gint old_vw;
+ gint old_vh;
old_vw = pr->vis_width;
old_vh = pr->vis_height;
static gboolean pr_zoom_clamp(PixbufRenderer *pr, gdouble zoom,
PrZoomFlags flags)
{
- gint w, h;
+ gint w;
+ gint h;
gdouble scale;
gboolean force = !!(flags & PR_ZOOM_FORCE);
gboolean new_z = !!(flags & PR_ZOOM_NEW);
PrZoomFlags flags, gint px, gint py)
{
gdouble old_scale;
- gint old_cx, old_cy;
+ gint old_cx;
+ gint old_cy;
gboolean center_point = !!(flags & PR_ZOOM_CENTER);
gboolean force = !!(flags & PR_ZOOM_FORCE);
gboolean new_z = !!(flags & PR_ZOOM_NEW);
if (pixbuf_renderer_overlay_get(pr, pr->scroller_overlay, &pixbuf, nullptr, nullptr))
{
- gint w, h;
+ gint w;
+ gint h;
w = gdk_pixbuf_get_width(pixbuf);
h = gdk_pixbuf_get_height(pixbuf);
void pixbuf_renderer_scroll(PixbufRenderer *pr, gint x, gint y)
{
- gint old_x, old_y;
- gint x_off, y_off;
+ gint old_x;
+ gint old_y;
+ gint x_off;
+ gint y_off;
g_return_if_fail(IS_PIXBUF_RENDERER(pr));
void pixbuf_renderer_scroll_to_point(PixbufRenderer *pr, gint x, gint y,
gdouble x_align, gdouble y_align)
{
- gint px, py;
- gint ax, ay;
+ gint px;
+ gint py;
+ gint ax;
+ gint ay;
x_align = CLAMP(x_align, 0.0, 1.0);
y_align = CLAMP(y_align, 0.0, 1.0);
void pixbuf_renderer_set_scroll_center(PixbufRenderer *pr, gdouble x, gdouble y)
{
- gdouble dst_x, dst_y;
+ gdouble dst_x;
+ gdouble dst_y;
dst_x = x * pr->width - pr->vis_width / 2.0 - pr->x_scroll + CLAMP(pr->subpixel_x_scroll, -1.0, 1.0);
dst_y = y * pr->height - pr->vis_height / 2.0 - pr->y_scroll + CLAMP(pr->subpixel_y_scroll, -1.0, 1.0);
/* This is a hack, but work far the best, at least for single pointer systems.
* See https://bugzilla.gnome.org/show_bug.cgi?id=587714 for more. */
- gint x, y;
+ gint x;
+ gint y;
seat = gdk_display_get_default_seat(gdk_window_get_display(event->window));
device = gdk_seat_get_pointer(seat);
static void pr_create_anaglyph_color(GdkPixbuf *pixbuf, GdkPixbuf *right, gint x, gint y, gint w, gint h, guint mode)
{
- gint srs, drs;
- guchar *s_pix, *d_pix;
- guchar *sp, *dp;
- guchar *spi, *dpi;
- gint i, j;
+ gint srs;
+ gint drs;
+ guchar *s_pix;
+ guchar *d_pix;
+ guchar *sp;
+ guchar *dp;
+ guchar *spi;
+ guchar *dpi;
+ gint i;
+ gint j;
srs = gdk_pixbuf_get_rowstride(right);
s_pix = gdk_pixbuf_get_pixels(right);
static void pr_create_anaglyph_gray(GdkPixbuf *pixbuf, GdkPixbuf *right, gint x, gint y, gint w, gint h, guint mode)
{
- gint srs, drs;
- guchar *s_pix, *d_pix;
- guchar *sp, *dp;
- guchar *spi, *dpi;
- gint i, j;
+ gint srs;
+ gint drs;
+ guchar *s_pix;
+ guchar *d_pix;
+ guchar *sp;
+ guchar *dp;
+ guchar *spi;
+ guchar *dpi;
+ gint i;
+ gint j;
const double gc[3] = {0.299, 0.587, 0.114};
srs = gdk_pixbuf_get_rowstride(right);
static void pr_create_anaglyph_dubois(GdkPixbuf *pixbuf, GdkPixbuf *right, gint x, gint y, gint w, gint h, guint mode)
{
- gint srs, drs;
- guchar *s_pix, *d_pix;
- guchar *sp, *dp;
- guchar *spi, *dpi;
- gint i, j, k;
+ gint srs;
+ gint drs;
+ guchar *s_pix;
+ guchar *d_pix;
+ guchar *sp;
+ guchar *dp;
+ guchar *spi;
+ guchar *dpi;
+ gint i;
+ gint j;
+ gint k;
double pr_dubois_matrix[3][6];
static const double pr_dubois_matrix_RC[3][6] = {
{ 0.456, 0.500, 0.176, -0.043, -0.088, -0.002},
gint *r_mouse, gint *g_mouse, gint *b_mouse)
{
GdkPixbuf *pb = pr->pixbuf;
- gint p_alpha, prs;
- guchar *p_pix, *pp;
- gint map_x, map_y, map_w, map_h;
- size_t xoff, yoff;
+ gint p_alpha;
+ gint prs;
+ guchar *p_pix;
+ guchar *pp;
+ gint map_x;
+ gint map_y;
+ gint map_w;
+ gint map_h;
+ size_t xoff;
+ size_t yoff;
g_return_val_if_fail(IS_PIXBUF_RENDERER(pr), FALSE);
g_return_val_if_fail(r_mouse != nullptr && g_mouse != nullptr && b_mouse != nullptr, FALSE);
gboolean pixbuf_renderer_get_mouse_position(PixbufRenderer *pr, gint *x_pixel_return, gint *y_pixel_return)
{
- gint x_pixel, y_pixel, x_pixel_clamped, y_pixel_clamped;
+ gint x_pixel;
+ gint y_pixel;
+ gint x_pixel_clamped;
+ gint y_pixel_clamped;
g_return_val_if_fail(IS_PIXBUF_RENDERER(pr), FALSE);
g_return_val_if_fail(x_pixel_return != nullptr && y_pixel_return != nullptr, FALSE);
if (w > requested_width || h > requested_height)
{
- gint nw, nh;
+ gint nw;
+ gint nh;
if (pixbuf_scale_aspect(requested_width, requested_height,
w, h, &nw, &nh))
guchar *dest, gint dest_row_stride, gint w, gint h,
gint bytes_per_pixel, gboolean counter_clockwise)
{
- gint i, j;
+ gint i;
+ gint j;
guchar *sp;
guchar *dp;
{
GdkPixbuf *dest;
gboolean has_alpha;
- gint sw, sh, srs;
- gint dw, dh, drs;
+ gint sw;
+ gint sh;
+ gint srs;
+ gint dw;
+ gint dh;
+ gint drs;
guchar *s_pix;
guchar *d_pix;
- gint i, j;
+ gint i;
+ gint j;
gint a;
GdkPixbuf *buffer;
guchar *b_pix;
gint brs;
- gint w, h;
+ gint w;
+ gint h;
if (!src) return nullptr;
w = MIN(ROTATE_BUFFER_WIDTH, (sh - i));
for (j = 0; j < sw; j += ROTATE_BUFFER_HEIGHT)
{
- gint x, y;
+ gint x;
+ gint y;
h = MIN(ROTATE_BUFFER_HEIGHT, (sw - j));
pixbuf_copy_block_rotate(s_pix, srs, j, i,
{
GdkPixbuf *dest;
gboolean has_alpha;
- gint w, h, srs;
+ gint w;
+ gint h;
+ gint srs;
gint drs;
guchar *s_pix;
guchar *d_pix;
guchar *sp;
guchar *dp;
- gint i, j;
+ gint i;
+ gint j;
gint a;
if (!src) return nullptr;
gint r, gint g, gint b, gint a)
{
gboolean has_alpha;
- gint pw, ph, prs;
+ gint pw;
+ gint ph;
+ gint prs;
guchar *p_pix;
guchar *pp;
- gint i, j;
+ gint i;
+ gint j;
if (!pb) return;
gint r, gint g, gint b, gint a)
{
gboolean has_alpha;
- gint pw, ph, prs;
+ gint pw;
+ gint ph;
+ gint prs;
guchar *p_pix;
guchar *pp;
- gint i, j;
+ gint i;
+ gint j;
if (!pb) return;
gint w, gint h,
guint8 r, guint8 g, guint8 b, guint8 a)
{
- gint sw, sh, srs;
+ gint sw;
+ gint sh;
+ gint srs;
gboolean s_alpha;
gint s_step;
guchar *s_pix;
- gint dw, dh, drs;
+ gint dw;
+ gint dh;
+ gint drs;
gboolean d_alpha;
gint d_step;
guchar *d_pix;
guchar *sp;
guchar *dp;
- gint i, j;
+ gint i;
+ gint j;
if (!src || !dest) return;
guint8 r, guint8 g, guint8 b, guint8 a)
{
GdkPixbuf *buffer;
- gint w, h;
- gint sx, sy;
- gint dw, dh;
+ gint w;
+ gint h;
+ gint sx;
+ gint sy;
+ gint dw;
+ gint dh;
cairo_surface_t *source;
cairo_t *cr;
void util_clip_triangle(gint x1, gint y1, gint x2, gint y2, gint x3, gint y3,
gint *rx, gint *ry, gint *rw, gint *rh)
{
- gint tx, ty, tw, th;
+ gint tx;
+ gint ty;
+ gint tw;
+ gint th;
tx = MIN(x1, x2);
tx = MIN(tx, x3);
guint8 r, guint8 g, guint8 b, guint8 a)
{
gboolean has_alpha;
- gint pw, ph, prs;
- gint rx, ry, rw, rh;
- gint tx, ty, tw, th;
- gint fx1, fy1;
- gint fx2, fy2;
- gint fw, fh;
+ gint pw;
+ gint ph;
+ gint prs;
+ gint rx;
+ gint ry;
+ gint rw;
+ gint rh;
+ gint tx;
+ gint ty;
+ gint tw;
+ gint th;
+ gint fx1;
+ gint fy1;
+ gint fx2;
+ gint fy2;
+ gint fw;
+ gint fh;
guchar *p_pix;
guchar *pp;
gint p_step;
- gdouble slope1, slope2;
- gint slope1_x, slope1_y;
+ gdouble slope1;
+ gdouble slope2;
+ gint slope1_x;
+ gint slope1_y;
gint y;
gint t;
gboolean middle = FALSE;
for (y = fy1; y < fy2; y++)
{
- gint xa, xb;
+ gint xa;
+ gint xb;
if (!middle && y > y2)
{
guint8 r, guint8 g, guint8 b, guint8 a)
{
gboolean has_alpha;
- gint pw, ph, prs;
- gint rx, ry, rw, rh;
- gdouble rx1, ry1, rx2, ry2;
+ gint pw;
+ gint ph;
+ gint prs;
+ gint rx;
+ gint ry;
+ gint rw;
+ gint rh;
+ gdouble rx1;
+ gdouble ry1;
+ gdouble rx2;
+ gdouble ry2;
guchar *p_pix;
guchar *pp;
gint p_step;
gdouble slope;
- gdouble x, y;
- gint px, py;
- gint cx1, cy1, cx2, cy2;
+ gdouble x;
+ gdouble y;
+ gint px;
+ gint py;
+ gint cx1;
+ gint cy1;
+ gint cx2;
+ gint cy2;
if (!pb) return;
guchar *pp;
gint p_step;
guint8 n = a;
- gint i, j;
+ gint i;
+ gint j;
p_step = (has_alpha) ? 4 : 3;
for (j = y1; j < y2; j++)
{
guchar *pp;
gint p_step;
- gint i, j;
+ gint i;
+ gint j;
p_step = (has_alpha) ? 4 : 3;
for (j = y1; j < y2; j++)
guint8 r, guint8 g, guint8 b, guint8 a)
{
gint has_alpha;
- gint pw, ph, prs;
- gint rx, ry, rw, rh;
- gint fx, fy, fw, fh;
+ gint pw;
+ gint ph;
+ gint prs;
+ gint rx;
+ gint ry;
+ gint rw;
+ gint rh;
+ gint fx;
+ gint fy;
+ gint fw;
+ gint fh;
guchar *p_pix;
if (!pb) return;
gint x, gint y, gint w, gint h)
{
gboolean has_alpha;
- gint pw, ph, prs;
+ gint pw;
+ gint ph;
+ gint prs;
guchar *p_pix;
guchar *pp;
- gint i, j;
+ gint i;
+ gint j;
if (!pb) return;
void pixbuf_highlight_overunderexposed(GdkPixbuf *pb, gint x, gint y, gint w, gint h)
{
gboolean has_alpha;
- gint pw, ph, prs;
+ gint pw;
+ gint ph;
+ gint prs;
guchar *p_pix;
guchar *pp;
- gint i, j;
+ gint i;
+ gint j;
if (!pb) return;
gint x, gint y, gint w, gint h)
{
gboolean has_alpha;
- gint pw, ph, prs;
+ gint pw;
+ gint ph;
+ gint prs;
guchar *p_pix;
guchar *pp;
- gint i, j;
+ gint i;
+ gint j;
if (!pb) return;
static void slideshow_delay_hours_cb(GtkWidget *spin, gpointer)
{
- gint mins_secs_tenths, delay;
+ gint mins_secs_tenths;
+ gint delay;
mins_secs_tenths = c_options->slideshow.delay %
(3600 * SLIDESHOW_SUBSECOND_PRECISION);
static void slideshow_delay_minutes_cb(GtkWidget *spin, gpointer)
{
- gint hours, secs_tenths, delay;
+ gint hours;
+ gint secs_tenths;
+ gint delay;
hours = c_options->slideshow.delay / (3600 * SLIDESHOW_SUBSECOND_PRECISION);
secs_tenths = c_options->slideshow.delay % (60 * SLIDESHOW_SUBSECOND_PRECISION);
static void slideshow_delay_seconds_cb(GtkWidget *spin, gpointer)
{
- gint hours_mins, delay;
+ gint hours_mins;
+ gint delay;
hours_mins = c_options->slideshow.delay / (60 * SLIDESHOW_SUBSECOND_PRECISION);
static gboolean accel_apply_cb(GtkTreeModel *model, GtkTreePath *, GtkTreeIter *iter, gpointer)
{
- gchar *accel_path, *accel;
+ gchar *accel_path;
+ gchar *accel;
gtk_tree_model_get(model, iter, AE_ACCEL, &accel_path, AE_KEY, &accel, -1);
current = -1;
for (i = 0; static_cast<guint>(i) < sizeof(thumb_size_list) / sizeof(ThumbSize); i++)
{
- gint w, h;
+ gint w;
+ gint h;
gchar *buf;
w = thumb_size_list[i].w;
static void accel_store_populate()
{
LayoutWindow *lw;
- GList *groups, *actions;
+ GList *groups;
+ GList *actions;
GtkAction *action;
const gchar *accel_path;
GtkAccelKey key;
accel_path = gtk_action_get_accel_path(action);
if (accel_path && gtk_accel_map_lookup_entry(accel_path, &key))
{
- gchar *label, *label2, *tooltip, *accel;
+ gchar *label;
+ gchar *label2;
+ gchar *tooltip;
+ gchar *accel;
g_object_get(action,
"tooltip", &tooltip,
"label", &label,
GtkTreeIter iter;
gchar *acc;
gchar *accel_path;
- GtkAccelKey old_key, key;
+ GtkAccelKey old_key;
+ GtkAccelKey key;
GtkTreePath *path = gtk_tree_path_new_from_string(path_string);
gtk_tree_model_get_iter(model, &iter, path);
void accel_reset_selection(GtkTreeModel *model, GtkTreePath *, GtkTreeIter *iter, gpointer)
{
GtkAccelKey key;
- gchar *accel_path, *accel;
+ gchar *accel_path;
+ gchar *accel;
gtk_tree_model_get(model, iter, AE_ACCEL, &accel_path, -1);
gtk_accel_map_lookup_entry(accel_path, &key);
GtkWidget *ct_button;
GtkWidget *table;
GtkWidget *spin;
- gint hours, minutes, remainder;
+ gint hours;
+ gint minutes;
+ gint remainder;
gdouble seconds;
GtkWidget *star_rating_entry;
GString *str;
static void config_tab_keywords_save()
{
- GtkTextIter start, end;
+ GtkTextIter start;
+ GtkTextIter end;
GtkTextBuffer *buffer;
GList *kw_list = nullptr;
GList *work;
if (fd->pixbuf)
{
- gint w, h;
+ gint w;
+ gint h;
w = gdk_pixbuf_get_width(fd->pixbuf);
h = gdk_pixbuf_get_height(fd->pixbuf);
auto pw = static_cast<PrintWindow *>(data);
FileData *fd;
cairo_t *cr;
- gdouble context_width, context_height;
- gdouble pixbuf_image_width, pixbuf_image_height;
+ gdouble context_width;
+ gdouble context_height;
+ gdouble pixbuf_image_width;
+ gdouble pixbuf_image_height;
gdouble width_offset;
gdouble height_offset;
GdkPixbuf *pixbuf;
PangoFontDescription *desc;
GString *image_text = g_string_new(nullptr);
GString *page_text = g_string_new(nullptr);
- PangoRectangle ink_rect, logical_rect;
- gdouble w, h, scale;
- gdouble image_text_width, image_text_height, page_text_width, page_text_height;
+ PangoRectangle ink_rect;
+ PangoRectangle logical_rect;
+ gdouble w;
+ gdouble h;
+ gdouble scale;
+ gdouble image_text_width;
+ gdouble image_text_height;
+ gdouble page_text_width;
+ gdouble page_text_height;
gint image_y;
gint incr_y;
gdouble pango_height;
gdouble pango_image_height;
gdouble pango_page_height;
- GtkTextIter start, end;
+ GtkTextIter start;
+ GtkTextIter end;
gchar *tmp;
gint total;
static void print_pref_store(PrintWindow *pw)
{
gchar *tmp;
- GtkTextIter start, end;
+ GtkTextIter start;
+ GtkTextIter end;
gtk_text_buffer_get_bounds(GTK_TEXT_BUFFER(pw->page_text), &start, &end);
tmp = gtk_text_buffer_get_text(GTK_TEXT_BUFFER(pw->page_text), &start, &end, FALSE);
void write_int_unit_option(GString *str, gint, const gchar *label, gint n, gint subunits)
{
- gint l, r;
+ gint l;
+ gint r;
if (subunits > 0)
{
gboolean read_int_unit_option(const gchar *option, const gchar *label, const gchar *value, gint *n, gint subunits)
{
- gint l, r;
- gchar *ptr, *buf;
+ gint l;
+ gint r;
+ gchar *ptr;
+ gchar *buf;
if (g_ascii_strcasecmp(option, label) != 0) return FALSE;
if (!n) return FALSE;
static gboolean remote_client_send(RemoteConnection *rc, const gchar *text)
{
- struct sigaction new_action, old_action;
+ struct sigaction new_action;
+ struct sigaction old_action;
gboolean ret = FALSE;
GError *error = nullptr;
GIOChannel *channel;
static void gr_slideshow_delay(const gchar *text, GIOChannel *, gpointer)
{
- gdouble t1, t2, t3, n;
+ gdouble t1;
+ gdouble t2;
+ gdouble t3;
+ gdouble n;
gint res;
res = sscanf(text, "%lf:%lf:%lf", &t1, &t2, &t3);
static void gr_pixel_info(const gchar *, GIOChannel *channel, gpointer)
{
gchar *pixel_info;
- gint x_pixel, y_pixel;
- gint width, height;
- gint r_mouse, g_mouse, b_mouse;
+ gint x_pixel;
+ gint y_pixel;
+ gint width;
+ gint height;
+ gint r_mouse;
+ gint g_mouse;
+ gint b_mouse;
PixbufRenderer *pr;
if (!layout_valid(&lw_id)) return;
{
gchar *rectangle_info;
PixbufRenderer *pr;
- gint x1, y1, x2, y2;
+ gint x1;
+ gint y1;
+ gint x2;
+ gint y2;
if (!options->draw_rectangle) return;
if (!layout_valid(&lw_id)) return;
PixbufRenderer *pr = rt->pr;
GtkWidget *box;
GdkWindow *window;
- gint rx, ry, rw, rh;
+ gint rx;
+ gint ry;
+ gint rw;
+ gint rh;
cairo_t *cr;
box = GTK_WIDGET(pr);
static void rt_tile_invalidate_region(RendererTiles *rt, gint x, gint y, gint w, gint h)
{
- gint x1, x2;
- gint y1, y2;
+ gint x1;
+ gint x2;
+ gint y1;
+ gint y2;
GList *work;
x1 = ROUND_DOWN(x, rt->tile_width);
gint *x, gint *y, gint *w, gint *h)
{
PixbufRenderer *pr = rt->pr;
- gint px, py, pw, ph;
+ gint px;
+ gint py;
+ gint pw;
+ gint ph;
pw = gdk_pixbuf_get_width(od->pixbuf);
ph = gdk_pixbuf_get_height(od->pixbuf);
static void rt_overlay_init_window(RendererTiles *rt, OverlayData *od)
{
PixbufRenderer *pr = rt->pr;
- gint px, py, pw, ph;
+ gint px;
+ gint py;
+ gint pw;
+ gint ph;
GdkWindowAttr attributes;
gint attributes_mask;
while (work)
{
OverlayData *od;
- gint px, py, pw, ph;
- gint rx, ry, rw, rh;
+ gint px;
+ gint py;
+ gint pw;
+ gint ph;
+ gint rx;
+ gint ry;
+ gint rw;
+ gint rh;
od = static_cast<OverlayData *>(work->data);
work = work->next;
else
{
/* no ImageTile means region may be larger than our scratch buffer */
- gint sx, sy;
+ gint sx;
+ gint sy;
for (sx = rx; sx < rx + rw; sx += rt->tile_width)
for (sy = ry; sy < ry + rh; sy += rt->tile_height)
{
- gint sw, sh;
+ gint sw;
+ gint sh;
cairo_t *cr;
sw = MIN(rx + rw - sx, rt->tile_width);
static void rt_overlay_queue_draw(RendererTiles *rt, OverlayData *od, gint x1, gint y1, gint x2, gint y2)
{
PixbufRenderer *pr = rt->pr;
- gint x, y, w, h;
+ gint x;
+ gint y;
+ gint w;
+ gint h;
rt_overlay_get_position(rt, od, &x, &y, &w, &h);
if (od->flags & OVL_RELATIVE)
{
- gint x, y, w, h;
+ gint x;
+ gint y;
+ gint w;
+ gint h;
rt_overlay_get_position(rt, od, &x, &y, &w, &h);
gdk_window_move_resize(od->window, x + rt->stereo_off_x, y + rt->stereo_off_y, w, h);
{
GdkPixbuf *src = *tile;
GdkPixbuf *dest;
- gint srs, drs;
- guchar *s_pix, *d_pix;
- guchar *sp, *dp;
- guchar *ip, *spi, *dpi;
- gint i, j;
+ gint srs;
+ gint drs;
+ guchar *s_pix;
+ guchar *d_pix;
+ guchar *sp;
+ guchar *dp;
+ guchar *ip;
+ guchar *spi;
+ guchar *dpi;
+ gint i;
+ gint j;
gint tw = rt->tile_width * rt->hidpi_scale;
srs = gdk_pixbuf_get_rowstride(src);
{
GdkPixbuf *src = *tile;
GdkPixbuf *dest;
- gint srs, drs;
- guchar *s_pix, *d_pix;
- guchar *sp, *dp;
- guchar *ip, *spi, *dpi;
- gint i, j;
+ gint srs;
+ gint drs;
+ guchar *s_pix;
+ guchar *d_pix;
+ guchar *sp;
+ guchar *dp;
+ guchar *ip;
+ guchar *spi;
+ guchar *dpi;
+ gint i;
+ gint j;
gint th = rt->tile_height * rt->hidpi_scale;
srs = gdk_pixbuf_get_rowstride(src);
{
GdkPixbuf *src = *tile;
GdkPixbuf *dest;
- gint srs, drs;
- guchar *s_pix, *d_pix;
- guchar *sp, *dp;
- guchar *spi, *dpi;
- gint i, j;
+ gint srs;
+ gint drs;
+ guchar *s_pix;
+ guchar *d_pix;
+ guchar *sp;
+ guchar *dp;
+ guchar *spi;
+ guchar *dpi;
+ gint i;
+ gint j;
gint tw = rt->tile_width * rt->hidpi_scale;
{
GdkPixbuf *src = *tile;
GdkPixbuf *dest;
- gint srs, drs;
- guchar *s_pix, *d_pix;
- guchar *sp, *dp;
+ gint srs;
+ gint drs;
+ guchar *s_pix;
+ guchar *d_pix;
+ guchar *sp;
+ guchar *dp;
guchar *dpi;
- gint i, j;
+ gint i;
+ gint j;
gint tw = rt->tile_width * rt->hidpi_scale;
gint th = rt->tile_height * rt->hidpi_scale;
{
GdkPixbuf *src = *tile;
GdkPixbuf *dest;
- gint srs, drs;
- guchar *s_pix, *d_pix;
- guchar *sp, *dp;
- guchar *spi, *dpi;
+ gint srs;
+ gint drs;
+ guchar *s_pix;
+ guchar *d_pix;
+ guchar *sp;
+ guchar *dp;
+ guchar *spi;
+ guchar *dpi;
gint i;
gint th = rt->tile_height * rt->hidpi_scale;
while (work)
{
SourceTile *st;
- gint rx, ry, rw, rh;
+ gint rx;
+ gint ry;
+ gint rw;
+ gint rh;
st = static_cast<SourceTile *>(work->data);
work = work->next;
}
else
{
- gdouble scale_x, scale_y;
- gint sx, sy, sw, sh;
+ gdouble scale_x;
+ gdouble scale_y;
+ gint sx;
+ gint sy;
+ gint sw;
+ gint sh;
if (pr->image_width == 0 || pr->image_height == 0) return FALSE;
scale_x = static_cast<gdouble>(pr->width) / pr->image_width;
while (work)
{
SourceTile *st;
- gint rx, ry, rw, rh;
- gint stx, sty, stw, sth;
+ gint rx;
+ gint ry;
+ gint rw;
+ gint rh;
+ gint stx;
+ gint sty;
+ gint stw;
+ gint sth;
st = static_cast<SourceTile *>(work->data);
work = work->next;
}
else
{
- gdouble scale_x, scale_y;
- gdouble src_x, src_y;
- gint pb_x, pb_y;
- gint pb_w, pb_h;
+ gdouble scale_x;
+ gdouble scale_y;
+ gdouble src_x;
+ gdouble src_y;
+ gint pb_x;
+ gint pb_y;
+ gint pb_w;
+ gint pb_h;
if (pr->image_width == 0 || pr->image_height == 0) return;
static gboolean rt_clamp_to_visible(RendererTiles *rt, gint *x, gint *y, gint *w, gint *h)
{
PixbufRenderer *pr = rt->pr;
- gint nx, ny;
- gint nw, nh;
- gint vx, vy;
- gint vw, vh;
+ gint nx;
+ gint ny;
+ gint nw;
+ gint nh;
+ gint vx;
+ gint vy;
+ gint vw;
+ gint vh;
vw = pr->vis_width;
vh = pr->vis_height;
gboolean new_data, gboolean only_existing)
{
PixbufRenderer *pr = rt->pr;
- gint i, j;
- gint x1, x2;
- gint y1, y2;
+ gint i;
+ gint j;
+ gint x1;
+ gint x2;
+ gint y1;
+ gint y2;
if (clamp && !rt_clamp_to_visible(rt, &x, &y, &w, &h)) return FALSE;
gboolean new_data, gboolean only_existing)
{
PixbufRenderer *pr = rt->pr;
- gint nx, ny;
+ gint nx;
+ gint ny;
rt_sync_scroll(rt);
return;
}
- gint x1, y1;
- gint x2, y2;
+ gint x1;
+ gint y1;
+ gint x2;
+ gint y2;
cairo_t *cr;
cairo_surface_t *surface;
{
auto rt = static_cast<RendererTiles *>(renderer);
PixbufRenderer *pr = rt->pr;
- gint x, y, width, height, x1, y1, x2, y2;
+ gint x;
+ gint y;
+ gint width;
+ gint height;
+ gint x1;
+ gint y1;
+ gint x2;
+ gint y2;
gint orientation = rt_get_orientation(rt);
pr_coords_map_orientation_reverse(orientation,
while (work)
{
od = static_cast<OverlayData *>(work->data);
- gint px, py, pw, ph;
+ gint px;
+ gint py;
+ gint pw;
+ gint ph;
pw = gdk_pixbuf_get_width(od->pixbuf);
ph = gdk_pixbuf_get_height(od->pixbuf);
px = od->x;
static gint sort_iter_compare_func (GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b, gpointer)
{
gint ret = 0;
- gchar *label1, *label2;
+ gchar *label1;
+ gchar *label2;
gtk_tree_model_get(model, a, SAR_LABEL, &label1, -1);
gtk_tree_model_get(model, b, SAR_LABEL, &label2, -1);
static void command_store_populate(SarData* sar)
{
- GList *groups, *actions;
+ GList *groups;
+ GList *actions;
GtkAction *action;
const gchar *accel_path;
GtkAccelKey key;
GtkTreeIter iter;
GtkTreeSortable *sortable;
- gchar *label, *tooltip;
- gchar *label2, *tooltip2;
+ gchar *label;
+ gchar *tooltip;
+ gchar *label2;
+ gchar *tooltip2;
GString *new_command;
gchar *existing_command;
gboolean iter_found;
{
auto sd = static_cast<SearchData *>(data);
GList *list;
- gdouble latitude, longitude;
+ gdouble latitude;
+ gdouble longitude;
FileData *fd;
if (info == TARGET_URI_LIST)
#define MILES_EARTH_RADIUS 3959
#define NAUTICAL_MILES_EARTH_RADIUS 3440
- gdouble latitude, longitude, range, conversion;
+ gdouble latitude;
+ gdouble longitude;
+ gdouble range;
+ gdouble conversion;
if (g_strcmp0(gtk_combo_box_text_get_active_text(
GTK_COMBO_BOX_TEXT(sd->units_gps)), _("km")) == 0)
static void image_sim_channel_norm(guint8 *pix, gint len)
{
- guint8 l, h, delta;
+ guint8 l;
+ guint8 h;
+ guint8 delta;
gint i;
gdouble scale;
void image_sim_fill_data(ImageSimilarityData *sd, GdkPixbuf *pixbuf)
{
- gint w, h;
+ gint w;
+ gint h;
gint rs;
guchar *pix;
gboolean has_alpha;
guchar *p;
gint i;
gint j;
- gint x_inc, y_inc, xy_inc;
- gint xs, ys;
- gint w_left, h_left;
+ gint x_inc;
+ gint y_inc;
+ gint xy_inc;
+ gint xs;
+ gint ys;
+ gint w_left;
+ gint h_left;
gboolean x_small = FALSE; /* if less than 32 w or h, set TRUE */
gboolean y_small = FALSE;
w_left = w;
for (xs = 0; xs < 32; xs++)
{
- gint x, y;
- gint r, g, b;
+ gint x;
+ gint y;
+ gint r;
+ gint g;
+ gint b;
gint t;
guchar *xpos;
{
for (i = j; i < j + 32; i++)
{
- gint cr, cg, cb;
+ gint cr;
+ gint cg;
+ gint cb;
gint cd;
cr = abs(a->avg_r[i] - b->avg_r[i]);
gdouble image_sim_compare_transfo(ImageSimilarityData *a, ImageSimilarityData *b, gchar transfo)
{
gint sim;
- gint i1, i2, *i;
- gint j1, j2, *j;
+ gint i1;
+ gint i2;
+ gint *i;
+ gint j1;
+ gint j2;
+ gint *j;
if (!a || !b || !a->filled || !b->filled) return 0.0;
gint max_t = (options->rot_invariant_sim ? 8 : 1);
gint t;
- gdouble score, max_score = 0;
+ gdouble score;
+ gdouble max_score = 0;
for(t = 0; t < max_t; t++)
{
gdouble image_sim_compare_fast_transfo(ImageSimilarityData *a, ImageSimilarityData *b, gdouble min, gchar transfo)
{
gint sim;
- gint i1, i2, *i;
- gint j1, j2, *j;
+ gint i1;
+ gint i2;
+ gint *i;
+ gint j1;
+ gint j2;
+ gint *j;
if (options->alternate_similarity_algorithm.enabled)
{
gint max_t = (options->rot_invariant_sim ? 8 : 1);
gint t;
- gdouble score, max_score = 0;
+ gdouble score;
+ gdouble max_score = 0;
for(t = 0; t < max_t; t++)
{
static gchar *thumb_loader_std_cache_path(ThumbLoaderStd *tl, gboolean local, GdkPixbuf *pixbuf, gboolean fail)
{
const gchar *folder;
- gint w, h;
+ gint w;
+ gint h;
if (!tl->fd || !tl->thumb_uri) return nullptr;
const gchar *uri;
const gchar *mtime_str;
time_t mtime;
- gint w, h;
+ gint w;
+ gint h;
if (!pixbuf) return FALSE;
const gchar *input_file = nullptr;
guchar *profile = nullptr;
guint profile_len;
- gint sw, sh;
+ gint sw;
+ gint sh;
if (!options->thumbnails.use_color_management)
{
GdkPixbuf *pixbuf_thumb = nullptr;
GdkPixbuf *result;
GdkPixbuf *rotated = nullptr;
- gint sw, sh;
+ gint sw;
+ gint sh;
if (!tl->cache_hit && options->image.exif_rotate_enable)
{
if (!tl->cache_hit)
{
- gint cache_w, cache_h;
+ gint cache_w;
+ gint cache_h;
if (tl->requested_width > THUMB_SIZE_NORMAL || tl->requested_height > THUMB_SIZE_NORMAL)
{
if (sw > cache_w || sh > cache_h || shrunk)
{
- gint thumb_w, thumb_h;
+ gint thumb_w;
+ gint thumb_h;
struct stat st;
if (pixbuf_scale_aspect(cache_w, cache_h, sw, sh,
}
else
{
- gint thumb_w, thumb_h;
+ gint thumb_w;
+ gint thumb_h;
if (pixbuf_thumb)
{
{
auto tl = static_cast<ThumbLoader *>(data);
GdkPixbuf *pixbuf;
- gint pw, ph;
+ gint pw;
+ gint ph;
gint save;
GdkPixbuf *rotated = nullptr;
if (pw > tl->max_w || ph > tl->max_h)
{
- gint w, h;
+ gint w;
+ gint h;
if ((static_cast<gdouble>(tl->max_w) / pw) < (static_cast<gdouble>(tl->max_h) / ph))
{
if (fgets(buffer, XV_BUFFER, file) != nullptr
&& strncmp(buffer, "P7 332", 6) == 0)
{
- gint width, height, depth;
+ gint width;
+ gint height;
+ gint depth;
while (fgets(buffer, XV_BUFFER, file) && buffer[0] == '#') /* do_nothing() */;
static GdkPixbuf *get_xv_thumbnail(gchar *thumb_filename, gint max_w, gint max_h)
{
- gint width, height;
+ gint width;
+ gint height;
gchar *thumb_name;
gchar *path;
gchar *directory;
if (pixbuf)
{
GdkPixbuf *scaled;
- gint w, h;
+ gint w;
+ gint h;
w = h = 16;
gtk_icon_size_lookup(GTK_ICON_SIZE_BUTTON, &w, &h);
{
GdkPixbuf *pixbuf;
GdkModifierType mask;
- gint x, y;
+ gint x;
+ gint y;
GtkAllocation allocation;
GdkSeat *seat;
GdkDevice *device;
}
else
{
- gint w, h;
+ gint w;
+ gint h;
w = h = 16;
gtk_icon_size_lookup(GTK_ICON_SIZE_BUTTON, &w, &h);
if (pixbuf)
{
GdkPixbuf *scaled;
- gint w, h;
+ gint w;
+ gint h;
w = h = 16;
gtk_icon_size_lookup(GTK_ICON_SIZE_BUTTON, &w, &h);
scrolled = gq_gtk_scrolled_window_new(nullptr, nullptr);
PangoLayout *layout;
- gint width, height;
+ gint width;
+ gint height;
layout = gtk_widget_create_pango_layout(GTK_WIDGET(scrolled), "reasonable width");
pango_layout_get_pixel_size(layout, &width, &height);
gboolean copy_file_attributes(const gchar *s, const gchar *t, gint perms, gint mtime)
{
struct stat st;
- gchar *sl, *tl;
+ gchar *sl;
+ gchar *tl;
gboolean ret = FALSE;
if (!s || !t) return FALSE;
gboolean move_file(const gchar *s, const gchar *t)
{
- gchar *sl, *tl;
+ gchar *sl;
+ gchar *tl;
gboolean ret = TRUE;
if (!s || !t) return FALSE;
gboolean rename_file(const gchar *s, const gchar *t)
{
- gchar *sl, *tl;
+ gchar *sl;
+ gchar *tl;
gboolean ret;
if (!s || !t) return FALSE;
void parse_out_relatives(gchar *path)
{
- gint s, t;
+ gint s;
+ gint t;
if (!path) return;
{
gchar *path;
gchar *namel;
- gint p, l;
+ gint p;
+ gint l;
gboolean ret = FALSE;
if (!name) return FALSE;
gchar *needle;
GtkTextBuffer *buffer;
GtkTextIter iter;
- GtkTextIter start, end;
+ GtkTextIter start;
+ GtkTextIter end;
if (!text || !key) return;
gchar s_buf[1024];
GtkTextBuffer *buffer;
GtkTextIter iter;
- GtkTextIter start, end;
+ GtkTextIter start;
+ GtkTextIter end;
if (!text || !path) return;
gboolean popup_menu_position_clamp(GtkMenu *menu, gint *x, gint *y, gint height)
{
gboolean adjusted = FALSE;
- gint w, h;
- gint xw, xh;
+ gint w;
+ gint h;
+ gint xw;
+ gint xh;
GtkRequisition requisition;
gtk_widget_get_requisition(GTK_WIDGET(menu), &requisition);
static gboolean date_selection_popup_press_cb(GtkWidget *, GdkEventButton *event, gpointer data)
{
auto ds = static_cast<DateSelection *>(data);
- gint x, y;
- gint w, h;
- gint xr, yr;
+ gint x;
+ gint y;
+ gint w;
+ gint h;
+ gint xr;
+ gint yr;
GdkWindow *window;
xr = static_cast<gint>(event->x_root);
static void date_selection_popup(DateSelection *ds)
{
GDateTime *date;
- gint wx, wy;
- gint x, y;
+ gint wx;
+ gint wy;
+ gint x;
+ gint y;
GtkAllocation button_allocation;
GtkAllocation window_allocation;
if (GTK_IS_TEXT_VIEW(text_widget))
{
GtkTextBuffer *buffer;
- GtkTextIter start, end;
+ GtkTextIter start;
+ GtkTextIter end;
buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text_widget));
gtk_text_buffer_get_bounds(buffer, &start, &end);
if (GTK_IS_TEXT_VIEW(text_widget))
{
GtkTextBuffer *buffer;
- GtkTextIter start, end;
+ GtkTextIter start;
+ GtkTextIter end;
buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text_widget));
gtk_text_buffer_get_bounds(buffer, &start, &end);
auto dd = static_cast<Dest_Data *>(data);
GtkTreePath *tpath;
GtkTreeViewColumn *column;
- gint cell_x, cell_y;
+ gint cell_x;
+ gint cell_y;
GtkTreeModel *model;
GtkTreeIter iter;
GtkTreeSelection *selection;
auto ted = static_cast<TreeEditData *>(data);
GdkWindow *window = gtk_widget_get_window(ted->window);
- gint x, y;
- gint w, h;
+ gint x;
+ gint y;
+ gint w;
+ gint h;
- gint xr, yr;
+ gint xr;
+ gint yr;
xr = static_cast<gint>(event->x_root);
yr = static_cast<gint>(event->y_root);
{
auto ted = static_cast<TreeEditData *>(data);
GdkRectangle rect;
- gint x, y, w, h; /* geometry of cell within tree */
- gint wx, wy; /* geometry of tree from root window */
- gint sx, sw;
+ gint x;
+ gint y;
+ gint w;
+ gint h; /* geometry of cell within tree */
+ gint wx;
+ gint wy; /* geometry of tree from root window */
+ gint sx;
+ gint sw;
gtk_tree_view_get_cell_area(ted->tree, ted->path, ted->column, &rect);
gboolean tree_view_get_cell_origin(GtkTreeView *widget, GtkTreePath *tpath, gint column, gboolean text_cell_only,
gint *x, gint *y, gint *width, gint *height)
{
- gint x_origin, y_origin;
- gint x_offset, y_offset;
+ gint x_origin;
+ gint y_origin;
+ gint x_offset;
+ gint y_offset;
gint header_size;
GtkTreeViewColumn *tv_column;
GdkRectangle rect;
void tree_view_get_cell_clamped(GtkTreeView *widget, GtkTreePath *tpath, gint column, gboolean text_cell_only,
gint *x, gint *y, gint *width, gint *height)
{
- gint wx, wy, ww, wh;
+ gint wx;
+ gint wy;
+ gint ww;
+ gint wh;
GdkWindow *window;
window = gtk_widget_get_window(GTK_WIDGET(widget));
gint tree_view_row_get_visibility(GtkTreeView *widget, GtkTreeIter *iter, gboolean fully_visible)
{
GtkTreeModel *store;
- GtkTreePath *tpath, *start_path, *end_path;
+ GtkTreePath *tpath;
+ GtkTreePath *start_path;
+ GtkTreePath *end_path;
gint ret = 0;
if (!gtk_tree_view_get_visible_range(widget, &start_path, &end_path)) return -1; /* we will most probably scroll down, needed for tree_view_row_make_visible */
{
auto sd = static_cast<AutoScrollData *>(data);
GdkWindow *window;
- gint x, y;
- gint w, h;
+ gint x;
+ gint y;
+ gint w;
+ gint h;
gint amt = 0;
GdkSeat *seat;
GdkDevice *device;
gchar *ident_string;
gchar *full_title;
gchar *actual_title;
- gint x, y, h, w;
+ gint x;
+ gint y;
+ gint h;
+ gint w;
gdk_window_get_root_origin(gtk_widget_get_window (gd->dialog), &x, &y);
w = gdk_window_get_width(gtk_widget_get_window (gd->dialog));
void (*cancel_cb)(GenericDialog *, gpointer), gpointer data)
{
GtkWidget *vbox;
- gint x, y, w, h;
+ gint x;
+ gint y;
+ gint w;
+ gint h;
GtkWidget *scrolled;
gd->auto_close = auto_close;
GSocketConnectable *geeqie_github;
struct tm current_version_date;
int64_t file_github_date;
- unsigned int year, month, day;
+ unsigned int year;
+ unsigned int month;
+ unsigned int day;
/* If this is a release version, do not check for updates */
if (g_strrstr(VERSION, "git"))
{
GtkTreeModel *store;
GtkTreeSelection *selection;
- GtkTreeIter iter, iter_selected;
- GtkTreePath *path_iter, *path_selected;
+ GtkTreeIter iter;
+ GtkTreeIter iter_selected;
+ GtkTreePath *path_iter;
+ GtkTreePath *path_selected;
const gchar *front;
const gchar *end;
const gchar *format;
static GList *parts_list(const gchar *path)
{
GList *list = nullptr;
- const gchar *strb, *strp;
+ const gchar *strb;
+ const gchar *strp;
gint l;
strp = path;
if (vd_find_row(vd, fd, &iter))
{
GtkTreeModel *store;
- GtkTreePath *tpath, *old_tpath;
+ GtkTreePath *tpath;
+ GtkTreePath *old_tpath;
GtkTreeSelection *selection;
store = gtk_tree_view_get_model(GTK_TREE_VIEW(vd->view));
if (vd->drop_fd)
{
GdkWindow *window;
- gint x, y;
- gint w, h;
+ gint x;
+ gint y;
+ gint w;
+ gint h;
window = gtk_widget_get_window(vd->view);
seat = gdk_display_get_default_seat(gdk_window_get_display(window));
GtkTreeModel *store;
GtkTreeIter iter;
GtkTreePath *tpath;
- gint cw, ch;
+ gint cw;
+ gint ch;
if (!vd_find_row(vd, vd->click_fd, &iter)) return;
store = gtk_tree_view_get_model(GTK_TREE_VIEW(vd->view));
static gboolean vficon_find_iter(ViewFile *vf, FileData *fd, GtkTreeIter *iter, gint *column)
{
GtkTreeModel *store;
- gint row, col;
+ gint row;
+ gint col;
store = gtk_tree_view_get_model(GTK_TREE_VIEW(vf->listview));
if (!vficon_find_position(vf, fd, &row, &col)) return FALSE;
static void tip_show(ViewFile *vf)
{
GtkWidget *label;
- gint x, y;
+ gint x;
+ gint y;
GdkDisplay *display;
GdkSeat *seat;
GdkDevice *device;
if (VFICON(vf)->tip_window)
{
- gint x, y;
+ gint x;
+ gint y;
gdk_device_get_position(device, nullptr, &x, &y);
static void vficon_select_region_util(ViewFile *vf, FileData *start, FileData *end, gboolean select)
{
- gint row1, col1;
- gint row2, col2;
+ gint row1;
+ gint col1;
+ gint row2;
+ gint col2;
gint t;
- gint i, j;
+ gint i;
+ gint j;
if (!vficon_find_position(vf, start, &row1, &col1) ||
!vficon_find_position(vf, end, &row2, &col2) ) return;
while (work)
{
auto fd = static_cast<FileData *>(work->data);
- gboolean mark_val, selected;
+ gboolean mark_val;
+ gboolean selected;
g_assert(fd->magick == FD_MAGICK);
static void vficon_set_focus(ViewFile *vf, FileData *fd)
{
GtkTreeIter iter;
- gint row, col;
+ gint row;
+ gint col;
if (g_list_find(vf->list, VFICON(vf)->focus_fd))
{
GtkTreePath *tpath;
GList *work;
FileData *visible_fd = nullptr;
- gint r, c;
+ gint r;
+ gint c;
gboolean valid;
GtkTreeIter iter;
static gboolean vficon_refresh_real(ViewFile *vf, gboolean keep_position)
{
gboolean ret = TRUE;
- GList *work, *new_work;
+ GList *work;
+ GList *new_work;
FileData *first_selected = nullptr;
GList *new_filelist = nullptr;
GList *new_fd_list = nullptr;
void vflist_star_rating_set(ViewFile *vf, gboolean enable)
{
- GList *columns, *work;
+ GList *columns;
+ GList *work;
columns = gtk_tree_view_get_columns(GTK_TREE_VIEW(vf->listview));
gint vflist_index_by_fd(ViewFile *vf, FileData *fd)
{
gint p = 0;
- GList *work, *work2;
+ GList *work;
+ GList *work2;
work = vf->list;
while (work)
while (valid)
{
FileData *fd;
- gboolean mark_val, selected;
+ gboolean mark_val;
+ gboolean selected;
gtk_tree_model_get(GTK_TREE_MODEL(store), &iter, FILE_COLUMN_POINTER, &fd, -1);
mark_val = file_data_get_mark(fd, n);
void vflist_marks_set(ViewFile *vf, gboolean enable)
{
- GList *columns, *work;
+ GList *columns;
+ GList *work;
columns = gtk_tree_view_get_columns(GTK_TREE_VIEW(vf->listview));
for (;;)
{
char buffer[PATH_MAX < 1024 ? 1024 : PATH_MAX];
- uint64_t low, high;
+ uint64_t low;
+ uint64_t high;
char perms[5];
uint64_t offset;
- uint32_t major, minor;
+ uint32_t major;
+ uint32_t minor;
char path[PATH_MAX];
uint32_t inode;
static int ZDReaderGetPoint(struct Reader *reader, int32_t *pointLat, int32_t *pointLon)
{
- int32_t diffLat = 0, diffLon = 0;
+ int32_t diffLat = 0;
+ int32_t diffLon = 0;
while(true) {
if(reader->done > 1) {
uint32_t polygonId = 0;
uint32_t bboxIndex = library->bboxOffset;
- uint32_t metadataIndex = 0, polygonIndex = 0;
+ uint32_t metadataIndex = 0;
+ uint32_t polygonIndex = 0;
while(bboxIndex < library->metadataOffset) {
uint64_t polygonIndexDelta;
list.reserve(listLength);
while(true) {
- int32_t pointLat, pointLon;
+ int32_t pointLat;
+ int32_t pointLon;
int result = ZDReaderGetPoint(&reader, &pointLat, &pointLon);
if(result < 0) {
return {};
static ZDLookupResult ZDPointInPolygon(const ZoneDetect *library, uint32_t polygonIndex, int32_t latFixedPoint, int32_t lonFixedPoint, uint64_t *distanceSqrMin)
{
- int32_t pointLat, pointLon, prevLat = 0, prevLon = 0;
- int prevQuadrant = 0, winding = 0;
+ int32_t pointLat;
+ int32_t pointLon;
+ int32_t prevLat = 0;
+ int32_t prevLon = 0;
+ int prevQuadrant = 0;
+ int winding = 0;
uint8_t first = 1;
}
if(!first) {
- int windingNeedCompare = 0, lineIsStraight = 0;
- float a = 0, b = 0;
+ int windingNeedCompare = 0;
+ int lineIsStraight = 0;
+ float a = 0;
+ float b = 0;
/* Calculate winding number */
if(quadrant == prevQuadrant) {
/* Calculate closest point on line (if needed) */
if(distanceSqrMin) {
- float closestLon, closestLat;
+ float closestLon;
+ float closestLat;
if(!lineIsStraight) {
closestLon = (static_cast<float>(lonFixedPoint) + a * static_cast<float>(latFixedPoint) - a * b) / (a * a + 1);
closestLat = (a * (static_cast<float>(lonFixedPoint) + a * static_cast<float>(latFixedPoint)) + b) / (a * a + 1);
const int closestInBox = ZDPointInBox(pointLon, static_cast<int32_t>(closestLon), prevLon, pointLat, static_cast<int32_t>(closestLat), prevLat);
- int64_t diffLat, diffLon;
+ int64_t diffLat;
+ int64_t diffLon;
if(closestInBox) {
/* Calculate squared distance to segment. */
diffLat = static_cast<int64_t>(closestLat - static_cast<float>(latFixedPoint));
uint32_t polygonId = 0;
while(bboxIndex < library->metadataOffset) {
- int32_t minLat, minLon, maxLat, maxLon, metadataIndexDelta;
+ int32_t minLat;
+ int32_t minLon;
+ int32_t maxLat;
+ int32_t maxLon;
+ int32_t metadataIndexDelta;
uint64_t polygonIndexDelta;
if(!ZDDecodeVariableLengthSigned(library, &bboxIndex, &minLat)) break;
if(!ZDDecodeVariableLengthSigned(library, &bboxIndex, &minLon)) break;