Skip to content

Commit

Permalink
Simplify things related to ViewFileInfoList * and ViewFileInfoIcon * …
Browse files Browse the repository at this point in the history
…type casting:

- drop VFICON_INFO() and VFLIST_INFO() macros
- rename VFLIST_INFO_POINTER() and VFICON_INFO_POINTER() to shorter VFLIST() and VFICON().
- replace all related occurrences by shorter expressions.

For example:
VFICON_INFO(vf, columns) becomes VFICON(vf)->columns
VFLIST_INFO(vf, click_fd) becomes VFLIST(vf)->click_fd
  • Loading branch information
Laurent Monin committed Aug 17, 2008
1 parent 728c032 commit 3e3a0a4
Show file tree
Hide file tree
Showing 4 changed files with 211 additions and 214 deletions.
10 changes: 5 additions & 5 deletions src/view_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -496,11 +496,11 @@ GtkWidget *vf_pop_menu(ViewFile *vf)
switch(vf->type)
{
case FILEVIEW_LIST:
vflist_color_set(vf, VFLIST_INFO(vf, click_fd), TRUE);
active = (VFLIST_INFO(vf, click_fd) != NULL);
vflist_color_set(vf, VFLIST(vf)->click_fd, TRUE);
active = (VFLIST(vf)->click_fd != NULL);
break;
case FILEVIEW_ICON:
active = (VFICON_INFO(vf, click_id) != NULL);
active = (VFICON(vf)->click_id != NULL);
break;
}

Expand Down Expand Up @@ -594,11 +594,11 @@ GtkWidget *vf_pop_menu(ViewFile *vf)
switch(vf->type)
{
case FILEVIEW_LIST:
menu_item_add_check(menu, _("Show _thumbnails"), VFLIST_INFO(vf, thumbs_enabled),
menu_item_add_check(menu, _("Show _thumbnails"), VFLIST(vf)->thumbs_enabled,
G_CALLBACK(vflist_pop_menu_thumbs_cb), vf);
break;
case FILEVIEW_ICON:
menu_item_add_check(menu, _("Show filename _text"), VFICON_INFO(vf, show_text),
menu_item_add_check(menu, _("Show filename _text"), VFICON(vf)->show_text,
G_CALLBACK(vficon_pop_menu_show_names_cb), vf);
break;
}
Expand Down
7 changes: 2 additions & 5 deletions src/view_file.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,8 @@

#define VIEW_FILE_TYPES_COUNT 2

#define VFLIST_INFO_POINTER(_vf_) ((ViewFileInfoList *)(_vf_->info))
#define VFLIST_INFO(_vf_, _part_) (VFLIST_INFO_POINTER(_vf_)->_part_)

#define VFICON_INFO_POINTER(_vf_) ((ViewFileInfoIcon *)(_vf_->info))
#define VFICON_INFO(_vf_, _part_) (VFICON_INFO_POINTER(_vf_)->_part_)
#define VFLIST(_vf_) ((ViewFileInfoList *)(_vf_->info))
#define VFICON(_vf_) ((ViewFileInfoIcon *)(_vf_->info))

void vf_send_update(ViewFile *vf);

Expand Down
Loading

0 comments on commit 3e3a0a4

Please sign in to comment.