Skip to content

Commit

Permalink
Remove all references to "IconData"
Browse files Browse the repository at this point in the history
  • Loading branch information
xsdg committed Jul 7, 2017
1 parent 6c65564 commit 9828bbe
Show file tree
Hide file tree
Showing 8 changed files with 291 additions and 363 deletions.
8 changes: 2 additions & 6 deletions src/layout_image.c
Original file line number Diff line number Diff line change
Expand Up @@ -1070,7 +1070,6 @@ void layout_image_alter_orientation(LayoutWindow *lw, AlterType type)
GtkTreePath *tpath;
FileData *fd_n;
GtkTreeIter iter;
IconData *id;

if (!lw || !lw->vf) return;

Expand All @@ -1089,8 +1088,7 @@ void layout_image_alter_orientation(LayoutWindow *lw, AlterType type)
{
if (lw->vf->type == FILEVIEW_ICON)
{
id = work->data;
fd_n = id->fd;
fd_n = work->data;
work = work->next;
}
else
Expand Down Expand Up @@ -1120,7 +1118,6 @@ void layout_image_rating(LayoutWindow *lw, const gchar *rating)
GtkTreePath *tpath;
FileData *fd_n;
GtkTreeIter iter;
IconData *id;

if (!lw || !lw->vf) return;

Expand All @@ -1139,8 +1136,7 @@ void layout_image_rating(LayoutWindow *lw, const gchar *rating)
{
if (lw->vf->type == FILEVIEW_ICON)
{
id = work->data;
fd_n = id->fd;
fd_n = work->data;
work = work->next;
}
else
Expand Down
4 changes: 1 addition & 3 deletions src/layout_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,6 @@ static void layout_menu_write_rotate(GtkToggleAction *action, gpointer data, gbo
GtkTreePath *tpath;
FileData *fd_n;
GtkTreeIter iter;
IconData *id;
gchar *rotation;
gchar *command;
gint run_result;
Expand All @@ -489,8 +488,7 @@ static void layout_menu_write_rotate(GtkToggleAction *action, gpointer data, gbo
{
if (lw->vf->type == FILEVIEW_ICON)
{
id = work->data;
fd_n = id->fd;
fd_n = work->data;
work = work->next;
}
else
Expand Down
18 changes: 7 additions & 11 deletions src/typedefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,8 @@ struct _FileData {
GHashTable *modified_xmp; // hash table which contains unwritten xmp metadata in format: key->list of string values
GList *cached_metadata;
gint rating;

SelectionType selected; // Used by view_file_icon.
};

struct _LayoutOptions
Expand Down Expand Up @@ -823,6 +825,7 @@ struct _ViewDirInfoTree
struct _ViewFile
{
FileViewType type;
// TODO(xsdg): Turn this into a union (see VFLIST and VFICON from view_file.h).
gpointer info;

GtkWidget *widget;
Expand Down Expand Up @@ -883,29 +886,22 @@ typedef enum {
SELECTION_FOCUS = 1 << 2
} SelectionType;

typedef struct _IconData IconData;
struct _IconData
{
SelectionType selected;
FileData *fd;
};

struct _ViewFileInfoIcon
{
/* table stuff */
gint columns;
gint rows;

GList *selection;
struct _IconData *prev_selection;
FileData *prev_selection;

GtkWidget *tip_window;
guint tip_delay_id; /* event source id */
struct _IconData *tip_id;
FileData *tip_fd;

struct _IconData *click_id;
FileData *click_fd;

struct _IconData *focus_id;
FileData *focus_fd;
gint focus_row;
gint focus_column;

Expand Down
37 changes: 37 additions & 0 deletions src/view_file/view_file_common.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* This file is a part of Geeqie project (http://www.geeqie.org/).
* Copyright (C) 2008 - 2016 The Geeqie 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 2 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.
*/

guint vfcommon_count(ViewFile *vf, gint64 *bytes)
{
if (bytes)
{
gint64 b = 0;
GList *work;

work = vf->list;
while (work)
{
FileData *fd = work->data;
work = work->next;

b += fd->size;
}

*bytes = b;
}

return g_list_length(vf->list);
}

Loading

0 comments on commit 9828bbe

Please sign in to comment.