add_global_arguments('-Wno-overlength-strings', language : 'c')
# To compile originally-C files as C++
-add_global_arguments('-fpermissive', language : 'cpp')
add_global_arguments('-Wno-error=deprecated-declarations', language : 'cpp')
add_global_arguments('-Wno-error=sign-compare', language : 'cpp')
add_global_arguments('-Wno-error=return-type', language : 'cpp')
gtk_tree_view_set_search_equal_func(GTK_TREE_VIEW(ew->listview), search_function_cb, ew, NULL);
gtk_drag_source_set(ew->listview,
- GDK_BUTTON1_MASK | GDK_BUTTON2_MASK,
+ static_cast<GdkModifierType>(GDK_BUTTON1_MASK | GDK_BUTTON2_MASK),
advanced_exif_drag_types, n_exif_drag_types,
- GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK);
+ static_cast<GdkDragAction>(GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK));
g_signal_connect(G_OBJECT(ew->listview), "drag_data_get",
G_CALLBACK(advanced_exif_dnd_get), ew);
{
gchar *comment = NULL;
gchar *orig_comment = NULL;
- gchar *comment_not_null;
+ const gchar *comment_not_null;
gshort rating;
GtkTextBuffer *comment_buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(pcd->comment_view));
static gint n_exif_entry_drag_types = 2;
static GtkTargetEntry bar_pane_exif_drop_types[] = {
- { TARGET_APP_EXIF_ENTRY_STRING, GTK_TARGET_SAME_APP, TARGET_APP_EXIF_ENTRY },
+ { const_cast<gchar *>(TARGET_APP_EXIF_ENTRY_STRING), GTK_TARGET_SAME_APP, TARGET_APP_EXIF_ENTRY },
{ const_cast<gchar *>("text/plain"), 0, TARGET_TEXT_PLAIN }
};
static gint n_exif_entry_drop_types = 2;
{
case TARGET_APP_EXIF_ENTRY:
gtk_selection_data_set(selection_data, gtk_selection_data_get_target(selection_data),
- 8, (gpointer) &entry, sizeof(entry));
+ 8, reinterpret_cast<const guchar *>(&entry), sizeof(entry));
break;
case TARGET_TEXT_PLAIN:
switch (info)
{
case TARGET_APP_EXIF_ENTRY:
- new_entry = *(gpointer *)gtk_selection_data_get_data(selection_data);
+ new_entry = GTK_WIDGET(*(gpointer *)gtk_selection_data_get_data(selection_data));
if (gtk_widget_get_parent(new_entry) && gtk_widget_get_parent(new_entry) != ped->vbox) bar_pane_exif_reparent_entry(new_entry, pane);
{
ExifEntry *ee = static_cast<ExifEntry *>(g_object_get_data(G_OBJECT(entry), "entry_data"));
- gtk_drag_source_set(entry, GDK_BUTTON1_MASK | GDK_BUTTON2_MASK,
+ gtk_drag_source_set(entry, static_cast<GdkModifierType>(GDK_BUTTON1_MASK | GDK_BUTTON2_MASK),
bar_pane_exif_drag_types, n_exif_entry_drag_types,
- GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK);
+ static_cast<GdkDragAction>(GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK));
g_signal_connect(G_OBJECT(entry), "drag_data_get",
G_CALLBACK(bar_pane_exif_entry_dnd_get), ee);
static void bar_pane_exif_dnd_init(GtkWidget *pane)
{
gtk_drag_dest_set(pane,
- GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_HIGHLIGHT | GTK_DEST_DEFAULT_DROP,
+ static_cast<GtkDestDefaults>(GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_HIGHLIGHT | GTK_DEST_DEFAULT_DROP),
bar_pane_exif_drop_types, n_exif_entry_drop_types,
- GDK_ACTION_COPY | GDK_ACTION_MOVE);
+ static_cast<GdkDragAction>(GDK_ACTION_COPY | GDK_ACTION_MOVE));
g_signal_connect(G_OBJECT(pane), "drag_data_received",
G_CALLBACK(bar_pane_exif_dnd_receive), NULL);
}
PaneGPSData *pgd = static_cast<PaneGPSData *>(data);
gtk_drag_dest_set(pgd->widget,
- GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_HIGHLIGHT | GTK_DEST_DEFAULT_DROP,
+ static_cast<GtkDestDefaults>(GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_HIGHLIGHT | GTK_DEST_DEFAULT_DROP),
bar_pane_gps_drop_types, n_gps_entry_drop_types,
- GDK_ACTION_COPY | GDK_ACTION_MOVE);
+ static_cast<GdkDragAction>(GDK_ACTION_COPY | GDK_ACTION_MOVE));
g_signal_connect(G_OBJECT(pgd->widget), "drag_data_received",
G_CALLBACK(bar_pane_gps_dnd_receive), NULL);
ClutterActor *actor, *direction;
ClutterActor *current_image;
GString *text;
- gint height, width, rotate;
+ gint height, width;
+ GdkPixbufRotation rotate;
gchar *altitude = NULL;
ThumbLoader *tl;
while (work1 && work2)
{
- if (strcmp(work1->data, work2->data) != 0) break;
+ if (strcmp(static_cast<const gchar *>(work1->data), static_cast<const gchar *>(work2->data)) != 0) break;
work1 = work1->next;
work2 = work2->next;
}
g_list_first(path_expanded);
while (path_expanded)
{
- bar_pane_keywords_entry_write_config(path_expanded->data, outstr, indent);
+ bar_pane_keywords_entry_write_config(static_cast<gchar *>(path_expanded->data), outstr, indent);
g_free(path_expanded->data);
path_expanded = path_expanded->next;
}
static GtkTargetEntry bar_pane_keywords_drag_types[] = {
- { TARGET_APP_KEYWORD_PATH_STRING, GTK_TARGET_SAME_WIDGET, TARGET_APP_KEYWORD_PATH },
+ { const_cast<gchar *>(TARGET_APP_KEYWORD_PATH_STRING), GTK_TARGET_SAME_WIDGET, TARGET_APP_KEYWORD_PATH },
{ const_cast<gchar *>("text/plain"), 0, TARGET_TEXT_PLAIN }
};
static gint n_keywords_drag_types = 2;
static GtkTargetEntry bar_pane_keywords_drop_types[] = {
- { TARGET_APP_KEYWORD_PATH_STRING, GTK_TARGET_SAME_WIDGET, TARGET_APP_KEYWORD_PATH },
+ { const_cast<gchar *>(TARGET_APP_KEYWORD_PATH_STRING), GTK_TARGET_SAME_WIDGET, TARGET_APP_KEYWORD_PATH },
{ const_cast<gchar *>("text/plain"), 0, TARGET_TEXT_PLAIN }
};
static gint n_keywords_drop_types = 2;
{
GList *path = keyword_tree_get_path(keyword_tree, &child_iter);
gtk_selection_data_set(selection_data, gtk_selection_data_get_target(selection_data),
- 8, (gpointer) &path, sizeof(path));
+ 8, reinterpret_cast<const guchar *>(&path), sizeof(path));
break;
}
{
case TARGET_APP_KEYWORD_PATH:
{
- GList *path = *(gpointer *)gtk_selection_data_get_data(selection_data);
+ GList *path = (GList *)(gtk_selection_data_get_data(selection_data));
src_valid = keyword_tree_get_iter(keyword_tree, &src_kw_iter, path);
string_list_free(path);
break;
if (cdd->edit_existing)
{
if (keywords && keywords->data && /* there should be one keyword */
- !keyword_exists(keyword_tree, NULL, &kw_iter, keywords->data, TRUE, NULL))
+ !keyword_exists(keyword_tree, NULL, &kw_iter, static_cast<const gchar *>(keywords->data), TRUE, NULL))
{
- keyword_set(GTK_TREE_STORE(keyword_tree), &kw_iter, keywords->data, cdd->is_keyword);
+ keyword_set(GTK_TREE_STORE(keyword_tree), &kw_iter, static_cast<const gchar *>(keywords->data), cdd->is_keyword);
}
}
else
while (work)
{
GtkTreeIter add;
- if (keyword_exists(keyword_tree, NULL, (have_dest || append_to) ? &kw_iter : NULL, work->data, FALSE, NULL))
+ if (keyword_exists(keyword_tree, NULL, (have_dest || append_to) ? &kw_iter : NULL, static_cast<const gchar *>(work->data), FALSE, NULL))
{
work = work->next;
continue;
append_to = TRUE;
kw_iter = add;
}
- keyword_set(GTK_TREE_STORE(keyword_tree), &add, work->data, cdd->is_keyword);
+ keyword_set(GTK_TREE_STORE(keyword_tree), &add, static_cast<const gchar *>(work->data), cdd->is_keyword);
work = work->next;
}
}
gtk_tree_view_set_expander_column(GTK_TREE_VIEW(pkd->keyword_treeview), column);
gtk_drag_source_set(pkd->keyword_treeview,
- GDK_BUTTON1_MASK | GDK_BUTTON2_MASK,
+ static_cast<GdkModifierType>(GDK_BUTTON1_MASK | GDK_BUTTON2_MASK),
bar_pane_keywords_drag_types, n_keywords_drag_types,
- GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK);
+ static_cast<GdkDragAction>(GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK));
g_signal_connect(G_OBJECT(pkd->keyword_treeview), "drag_data_get",
G_CALLBACK(bar_pane_keywords_dnd_get), pkd);
G_CALLBACK(bar_pane_keywords_dnd_end), pkd);
gtk_drag_dest_set(pkd->keyword_treeview,
- GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_HIGHLIGHT | GTK_DEST_DEFAULT_DROP,
+ static_cast<GtkDestDefaults>(GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_HIGHLIGHT | GTK_DEST_DEFAULT_DROP),
bar_pane_keywords_drop_types, n_keywords_drop_types,
- GDK_ACTION_COPY | GDK_ACTION_MOVE);
+ static_cast<GdkDragAction>(GDK_ACTION_COPY | GDK_ACTION_MOVE));
g_signal_connect(G_OBJECT(pkd->keyword_treeview), "drag_data_received",
G_CALLBACK(bar_pane_keywords_dnd_receive), pkd);
}
else
{
- gtk_widget_grab_focus(children->data);
+ gtk_widget_grab_focus(GTK_WIDGET(children->data));
ret = FALSE;
}
GList *work = sd->undo_src_list;
while(work)
{
- gchar *filename = g_strdup(filename_from_path(work->data));
+ gchar *filename = g_strdup(filename_from_path(static_cast<const gchar *>(work->data)));
gchar *dest_path = g_build_filename(g_strdup(dest), filename, NULL);
sd->undo_dest_list = g_list_prepend(sd->undo_dest_list, g_strdup(dest_path));
work = work->next;
return TRUE;
}
-static void bar_sort_help_cb(GtkWidget *button, gpointer UNUSED(data))
+static void bar_sort_help_cb(gpointer UNUSED(data))
{
bar_filter_help_dialog();
-
- return TRUE;
}
static void bar_sort_set_selection(SortData *sd, SortSelectionType selection)
_("Functions additional to Copy and Move"),
G_CALLBACK(bar_sort_help_cb), sd);
- sd->mode = -1;
+ sd->mode = static_cast<SortModeType>(-1);
bar_sort_mode_sync(sd, mode);
- gtk_combo_box_set_active(GTK_COMBO_BOX(combo), sd->mode);
+ gtk_combo_box_set_active(GTK_COMBO_BOX(combo), static_cast<gint>(sd->mode));
return sd->vbox;
}
void bar_sort_cold_start(LayoutWindow *lw, const gchar **attribute_names, const gchar **attribute_values)
{
gboolean enabled = TRUE;
- gint action = 0;
- gint mode = 0;
- gint selection = 0;
+ gint action = BAR_SORT_COPY;
+ gint mode = BAR_SORT_MODE_FOLDER;
+ gint selection = BAR_SORT_SELECTION_IMAGE;
gchar *filter_key = NULL;
while (attribute_names && *attribute_names)
log_printf("unknown attribute %s = %s\n", option, value);
}
- lw->options.action = action;
- lw->options.mode = mode;
- lw->options.selection = selection;
+ lw->options.action = static_cast<SortActionType>(action);
+ lw->options.mode = static_cast<SortModeType>(mode);
+ lw->options.selection = static_cast<SortSelectionType>(selection);
lw->options.filter_key = g_strdup(filter_key);
lw->bar_sort_enabled = enabled;
{
GtkWidget *item;
item = menu_item_add_stock(menu, _(pane->title), GTK_STOCK_ADD, G_CALLBACK(bar_expander_add_cb), bar);
- g_object_set_data(G_OBJECT(item), "pane_add_id", pane->id);
+ g_object_set_data(G_OBJECT(item), "pane_add_id", const_cast<gchar *>(pane->id));
pane++;
}
GtkWidget *widget = gtk_bin_get_child(GTK_BIN(expander));
PaneData *pd = static_cast<PaneData *>(g_object_get_data(G_OBJECT(widget), "pane_data"));
if (!pd) return;
- if (pd->pane_set_fd) pd->pane_set_fd(widget, data);
+ if (pd->pane_set_fd) pd->pane_set_fd(widget, static_cast<FileData *>(data));
}
void bar_set_fd(GtkWidget *bar, FileData *fd)
cache_sim_data_set_similarity(cl->cd, sim);
image_sim_free(sim);
- cl->todo_mask &= ~CACHE_LOADER_SIMILARITY;
- cl->done_mask |= CACHE_LOADER_SIMILARITY;
+ cl->todo_mask = static_cast<CacheDataType>(cl->todo_mask & ~CACHE_LOADER_SIMILARITY);
+ cl->done_mask = static_cast<CacheDataType>(cl->done_mask | CACHE_LOADER_SIMILARITY);
}
/* we have the dimensions via pixbuf */
gdk_pixbuf_get_height(pixbuf));
if (cl->todo_mask & CACHE_LOADER_DIMENSIONS)
{
- cl->todo_mask &= ~CACHE_LOADER_DIMENSIONS;
- cl->done_mask |= CACHE_LOADER_DIMENSIONS;
+ cl->todo_mask = static_cast<CacheDataType>(cl->todo_mask & ~CACHE_LOADER_DIMENSIONS);
+ cl->done_mask = static_cast<CacheDataType>(cl->done_mask | CACHE_LOADER_DIMENSIONS);
}
}
}
image_loader_free(cl->il);
cl->il = NULL;
- cl->todo_mask &= ~CACHE_LOADER_SIMILARITY;
+ cl->todo_mask = static_cast<CacheDataType>(cl->todo_mask & ~CACHE_LOADER_SIMILARITY);
}
else if (cl->todo_mask & CACHE_LOADER_DIMENSIONS &&
!cl->cd->dimensions)
image_load_dimensions(cl->fd, &cl->cd->width, &cl->cd->height))
{
cl->cd->dimensions = TRUE;
- cl->done_mask |= CACHE_LOADER_DIMENSIONS;
+ cl->done_mask = static_cast<CacheDataType>(cl->done_mask | CACHE_LOADER_DIMENSIONS);
}
else
{
cl->error = TRUE;
}
- cl->todo_mask &= ~CACHE_LOADER_DIMENSIONS;
+ cl->todo_mask = static_cast<CacheDataType>(cl->todo_mask & ~CACHE_LOADER_DIMENSIONS);
}
else if (cl->todo_mask & CACHE_LOADER_MD5SUM &&
!cl->cd->have_md5sum)
if (md5_get_digest_from_file_utf8(cl->fd->path, cl->cd->md5sum))
{
cl->cd->have_md5sum = TRUE;
- cl->done_mask |= CACHE_LOADER_MD5SUM;
+ cl->done_mask = static_cast<CacheDataType>(cl->done_mask | CACHE_LOADER_MD5SUM);
}
else
{
cl->error = TRUE;
}
- cl->todo_mask &= ~CACHE_LOADER_MD5SUM;
+ cl->todo_mask = static_cast<CacheDataType>(cl->todo_mask & ~CACHE_LOADER_MD5SUM);
}
else if (cl->todo_mask & CACHE_LOADER_DATE &&
!cl->cd->have_date)
cl->cd->date = date;
cl->cd->have_date = TRUE;
- cl->done_mask |= CACHE_LOADER_DATE;
- cl->todo_mask &= ~CACHE_LOADER_DATE;
+ cl->done_mask = static_cast<CacheDataType>(cl->done_mask | CACHE_LOADER_DATE);
+ cl->todo_mask = static_cast<CacheDataType>(cl->todo_mask & ~CACHE_LOADER_DATE);
}
else
{
fd = static_cast<FileData *>(cd->list->data);
cd->list = g_list_remove(cd->list, fd);
- load_mask = CACHE_LOADER_DIMENSIONS | CACHE_LOADER_DATE | CACHE_LOADER_MD5SUM | CACHE_LOADER_SIMILARITY;
+ load_mask = static_cast<CacheDataType>(CACHE_LOADER_DIMENSIONS | CACHE_LOADER_DATE | CACHE_LOADER_MD5SUM | CACHE_LOADER_SIMILARITY);
cd->cl = (CacheLoader *)cache_loader_new(fd, load_mask, (cache_manager_sim_file_done_cb), cd);
if (!cd->remote)
cell_icon_type = g_type_register_static(GTK_TYPE_CELL_RENDERER,
"GQvCellRendererIcon",
- &cell_icon_info, 0);
+ &cell_icon_info, G_TYPE_FLAG_NONE);
}
return cell_icon_type;
static void
gqv_cell_renderer_icon_init_wrapper(void *data, void *UNUSED(user_data))
{
- gqv_cell_renderer_icon_init(data);
+ gqv_cell_renderer_icon_init(static_cast<GQvCellRendererIcon *>(data));
}
static void
static void
gqv_cell_renderer_icon_class_init_wrapper(void *data, void *UNUSED(user_data))
{
- gqv_cell_renderer_icon_class_init(data);
+ gqv_cell_renderer_icon_class_init(static_cast<GQvCellRendererIconClass *>(data));
}
static void
}
break;
case PROP_BACKGROUND_GDK:
- set_bg_color(cellicon, g_value_get_boxed(value));
+ set_bg_color(cellicon, static_cast<GdkColor *>(g_value_get_boxed(value)));
break;
case PROP_FOREGROUND_GDK:
- set_fg_color(cellicon, g_value_get_boxed(value));
+ set_fg_color(cellicon, static_cast<GdkColor *>(g_value_get_boxed(value)));
break;
case PROP_FOCUSED:
cellicon->focused = g_value_get_boolean(value);
GtkCellRenderer *
gqv_cell_renderer_icon_new(void)
{
- return g_object_new(GQV_TYPE_CELL_RENDERER_ICON, NULL);
+ return static_cast<GtkCellRenderer *>(g_object_new(GQV_TYPE_CELL_RENDERER_ICON, NULL));
}
static void gqv_cell_renderer_icon_get_size(GtkCellRenderer *cell,
{
for (i = 0; i < cellicon->num_marks; i++)
{
- state &= ~(GTK_STATE_FLAG_CHECKED);
+ state = static_cast<GtkStateFlags>(state & ~GTK_STATE_FLAG_CHECKED);
if ((cellicon->marks & (1 << i)))
- state |= GTK_STATE_FLAG_CHECKED;
+ state = static_cast<GtkStateFlags>(state | GTK_STATE_FLAG_CHECKED);
cairo_save (cr);
cairo_rectangle(cr,
gboolean collection_load(CollectionData *cd, const gchar *path, CollectionLoadFlags flags)
{
- if (collection_load_private(cd, path, flags | COLLECTION_LOAD_FLUSH))
+ if (collection_load_private(cd, path, static_cast<CollectionLoadFlags>(flags | COLLECTION_LOAD_FLUSH)))
{
layout_recent_add_path(cd->path);
return TRUE;
{static_cast<GdkModifierType>(0), GDK_KEY_Return, N_("View")},
{static_cast<GdkModifierType>(0), 'V', N_("View in new window")},
{GDK_CONTROL_MASK, 'A', N_("Select all")},
- {GDK_CONTROL_MASK + GDK_SHIFT_MASK, 'A', N_("Select none")},
+ {static_cast<GdkModifierType>(GDK_CONTROL_MASK + GDK_SHIFT_MASK), 'A', N_("Select none")},
{GDK_MOD1_MASK, 'R', N_("Rectangular selection")},
{static_cast<GdkModifierType>(0), GDK_KEY_space, N_("Select single file")},
{GDK_CONTROL_MASK, GDK_KEY_space, N_("Toggle select image")},
if (iter) *iter = p;
- return g_list_nth_data(list, col);
+ return static_cast<CollectInfo *>(g_list_nth_data(list, col));
}
return NULL;
n = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(column), "column_number"));
if (iter) *iter = row;
- return g_list_nth_data(list, n);
+ return static_cast<CollectInfo *>(g_list_nth_data(list, n));
}
static guint collection_table_list_count(CollectTable *ct, gint64 *bytes)
static void collection_table_update_extras(CollectTable *ct, gboolean loading, gdouble value)
{
- gchar *text;
+ const gchar *text;
if (!ct->extra_label) return;
{
if (!info) return;
- collection_table_selection_set(ct, info, info->flag_mask | mask, iter);
+ collection_table_selection_set(ct, info, static_cast<SelectionType>(info->flag_mask | mask), iter);
}
static void collection_table_selection_remove(CollectTable *ct, CollectInfo *info, SelectionType mask, GtkTreeIter *iter)
{
if (!info) return;
- collection_table_selection_set(ct, info, info->flag_mask & ~mask, iter);
+ collection_table_selection_set(ct, info, static_cast<SelectionType>(info->flag_mask & ~mask), iter);
}
/*
*-------------------------------------------------------------------
while (work)
{
ct->selection = g_list_append(ct->selection, work->data);
- collection_table_selection_add(ct, work->data, SELECTION_SELECTED, NULL);
+ collection_table_selection_add(ct, static_cast<CollectInfo *>(work->data), SELECTION_SELECTED, NULL);
work = work->next;
}
work = ct->selection;
while (work)
{
- collection_table_selection_remove(ct, work->data, SELECTION_SELECTED, NULL);
+ collection_table_selection_remove(ct, static_cast<CollectInfo *>(work->data), SELECTION_SELECTED, NULL);
work = work->next;
}
G_CALLBACK(collection_table_popup_delete_cb), ct);
menu_item_add_divider(menu);
- submenu = submenu_add_sort(NULL, G_CALLBACK(collection_table_popup_sort_cb), ct, FALSE, TRUE, FALSE, 0);
+ submenu = submenu_add_sort(NULL, G_CALLBACK(collection_table_popup_sort_cb), ct, FALSE, TRUE, FALSE, SORT_NONE);
menu_item_add_divider(submenu);
menu_item_add(submenu, _("Randomize"),
G_CALLBACK(collection_table_popup_randomize_cb), ct);
*/
static GtkTargetEntry collection_drag_types[] = {
- { TARGET_APP_COLLECTION_MEMBER_STRING, 0, TARGET_APP_COLLECTION_MEMBER },
+ { const_cast<gchar *>(TARGET_APP_COLLECTION_MEMBER_STRING), 0, TARGET_APP_COLLECTION_MEMBER },
{ const_cast<gchar *>("text/uri-list"), 0, TARGET_URI_LIST },
{ const_cast<gchar *>("text/plain"), 0, TARGET_TEXT_PLAIN }
};
static gint n_collection_drag_types = 3;
static GtkTargetEntry collection_drop_types[] = {
- { TARGET_APP_COLLECTION_MEMBER_STRING, 0, TARGET_APP_COLLECTION_MEMBER },
+ { const_cast<gchar *>(TARGET_APP_COLLECTION_MEMBER_STRING), 0, TARGET_APP_COLLECTION_MEMBER },
{ const_cast<gchar *>("text/uri-list"), 0, TARGET_URI_LIST }
};
static gint n_collection_drop_types = 2;
static void collection_table_dnd_init(CollectTable *ct)
{
- gtk_drag_source_set(ct->listview, GDK_BUTTON1_MASK | GDK_BUTTON2_MASK,
+ gtk_drag_source_set(ct->listview, static_cast<GdkModifierType>(GDK_BUTTON1_MASK | GDK_BUTTON2_MASK),
collection_drag_types, n_collection_drag_types,
- GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK);
+ static_cast<GdkDragAction>(GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK));
g_signal_connect(G_OBJECT(ct->listview), "drag_data_get",
G_CALLBACK(collection_table_dnd_get), ct);
g_signal_connect(G_OBJECT(ct->listview), "drag_begin",
G_CALLBACK(collection_table_dnd_end), ct);
gtk_drag_dest_set(ct->listview,
- GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_HIGHLIGHT | GTK_DEST_DEFAULT_DROP,
+ static_cast<GtkDestDefaults>(GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_HIGHLIGHT | GTK_DEST_DEFAULT_DROP),
collection_drop_types, n_collection_drop_types,
- GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_ASK);
+ static_cast<GdkDragAction>(GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_ASK));
g_signal_connect(G_OBJECT(ct->listview), "drag_motion",
G_CALLBACK(collection_table_dnd_motion), ct);
g_signal_connect(G_OBJECT(ct->listview), "drag_leave",
collection_table_dnd_init(ct);
gtk_widget_set_events(ct->listview, GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK |
- GDK_BUTTON_PRESS_MASK | GDK_LEAVE_NOTIFY_MASK);
+ static_cast<GdkEventMask>(GDK_BUTTON_PRESS_MASK | GDK_LEAVE_NOTIFY_MASK));
g_signal_connect(G_OBJECT(ct->listview),"button_press_event",
G_CALLBACK(collection_table_press_cb), ct);
g_signal_connect(G_OBJECT(ct->listview),"button_release_event",
CollectionData *collection_from_number(gint n)
{
- return g_list_nth_data(collection_list, n);
+ return static_cast<CollectionData *>(g_list_nth_data(collection_list, n));
}
CollectionData *collection_from_dnd_data(const gchar *data, GList **list, GList **info_list)
*length += 1; /* ending nul char */
- uri_text = g_malloc(*length);
+ uri_text = static_cast<gchar *>(g_malloc(*length));
ptr = uri_text;
work = g_list_last(temp);
if (!work) return NULL;
work = work->next;
- if (work) return work->data;
+ if (work) return static_cast<CollectInfo *>(work->data);
return NULL;
}
if (!work) return NULL;
work = work->prev;
- if (work) return work->data;
+ if (work) return static_cast<CollectInfo *>(work->data);
return NULL;
}
CollectInfo *collection_get_first(CollectionData *cd)
{
- if (cd->list) return cd->list->data;
+ if (cd->list) return static_cast<CollectInfo *>(cd->list->data);
return NULL;
}
list = g_list_last(cd->list);
- if (list) return list->data;
+ if (list) return static_cast<CollectInfo *>(list->data);
return NULL;
}
if (g_hash_table_lookup(cd->existence, fd->path)) return NULL;
ci = collection_info_new(fd, st, NULL);
- if (ci) g_hash_table_insert(cd->existence, fd->path, "");
+ if (ci) g_hash_table_insert(cd->existence, fd->path, g_strdup(""));
return ci;
}
geometry.base_width = COLLECT_DEF_WIDTH;
geometry.base_height = COLLECT_DEF_HEIGHT;
gtk_window_set_geometry_hints(GTK_WINDOW(cw->window), NULL, &geometry,
- GDK_HINT_MIN_SIZE | GDK_HINT_BASE_SIZE);
+ static_cast<GdkWindowHints>(GDK_HINT_MIN_SIZE | GDK_HINT_BASE_SIZE));
if (options->collections_on_top)
{
*-------------------------------------------------------------------
*/
-static void color_man_done(ColorMan *cm, ColorManReturnType type)
-{
- if (cm->func_done)
- {
- cm->func_done(cm, type, cm->func_done_data);
- }
-}
+//static void color_man_done(ColorMan *cm, ColorManReturnType type)
+//{
+ //if (cm->func_done)
+ //{
+ //cm->func_done(cm, type, cm->func_done_data);
+ //}
+//}
void color_man_correct_region(ColorMan *cm, GdkPixbuf *pixbuf, gint x, gint y, gint w, gint h)
{
}
-static gboolean color_man_idle_cb(gpointer data)
-{
- ColorMan *cm = static_cast<ColorMan *>(data);
- gint width, height;
- gint rh;
-
- if (!cm->pixbuf) return FALSE;
-
- if (cm->imd &&
- cm->pixbuf != image_get_pixbuf(cm->imd))
- {
- cm->idle_id = 0;
- color_man_done(cm, COLOR_RETURN_IMAGE_CHANGED);
- return FALSE;
- }
-
- width = gdk_pixbuf_get_width(cm->pixbuf);
- height = gdk_pixbuf_get_height(cm->pixbuf);
-
- if (cm->row > height)
- {
- if (!cm->incremental_sync && cm->imd)
- {
- image_area_changed(cm->imd, 0, 0, width, height);
- }
-
- cm->idle_id = 0;
- color_man_done(cm, COLOR_RETURN_SUCCESS);
- return FALSE;
- }
-
- rh = COLOR_MAN_CHUNK_SIZE / width + 1;
- color_man_correct_region(cm, cm->pixbuf, 0, cm->row, width, rh);
- if (cm->incremental_sync && cm->imd) image_area_changed(cm->imd, 0, cm->row, width, rh);
- cm->row += rh;
-
- return TRUE;
-}
+//static gboolean color_man_idle_cb(gpointer data)
+//{
+ //ColorMan *cm = static_cast<ColorMan *>(data);
+ //gint width, height;
+ //gint rh;
+
+ //if (!cm->pixbuf) return FALSE;
+
+ //if (cm->imd &&
+ //cm->pixbuf != image_get_pixbuf(cm->imd))
+ //{
+ //cm->idle_id = 0;
+ //color_man_done(cm, COLOR_RETURN_IMAGE_CHANGED);
+ //return FALSE;
+ //}
+
+ //width = gdk_pixbuf_get_width(cm->pixbuf);
+ //height = gdk_pixbuf_get_height(cm->pixbuf);
+
+ //if (cm->row > height)
+ //{
+ //if (!cm->incremental_sync && cm->imd)
+ //{
+ //image_area_changed(cm->imd, 0, 0, width, height);
+ //}
+
+ //cm->idle_id = 0;
+ //color_man_done(cm, COLOR_RETURN_SUCCESS);
+ //return FALSE;
+ //}
+
+ //rh = COLOR_MAN_CHUNK_SIZE / width + 1;
+ //color_man_correct_region(cm, cm->pixbuf, 0, cm->row, width, rh);
+ //if (cm->incremental_sync && cm->imd) image_area_changed(cm->imd, 0, cm->row, width, rh);
+ //cm->row += rh;
+
+ //return TRUE;
+//}
static ColorMan *color_man_new_real(ImageWindow *imd, GdkPixbuf *pixbuf,
ColorManProfileType input_type, const gchar *input_file,
if (cm->idle_id) g_source_remove(cm->idle_id);
if (cm->pixbuf) g_object_unref(cm->pixbuf);
- color_man_cache_unref(cm->profile);
+ color_man_cache_unref(static_cast<ColorManCache *>(cm->profile));
g_free(cm);
}
gint dnd_file_drag_types_count = 2;
GtkTargetEntry dnd_file_drop_types[] = {
- { TARGET_APP_COLLECTION_MEMBER_STRING, 0, TARGET_APP_COLLECTION_MEMBER },
+ { const_cast<gchar *>(TARGET_APP_COLLECTION_MEMBER_STRING), 0, TARGET_APP_COLLECTION_MEMBER },
{ const_cast<gchar *>("text/uri-list"), 0, TARGET_URI_LIST },
{ const_cast<gchar *>("text/plain"), 0, TARGET_TEXT_PLAIN },
};
{static_cast<GdkModifierType>(0), GDK_KEY_Delete, N_("Remove")},
{GDK_CONTROL_MASK, GDK_KEY_Delete, N_("Clear")},
{GDK_CONTROL_MASK, 'A', N_("Select all")},
- {GDK_CONTROL_MASK + GDK_SHIFT_MASK, 'A', N_("Select none")},
+ {static_cast<GdkModifierType>(GDK_CONTROL_MASK + GDK_SHIFT_MASK), 'A', N_("Select none")},
{GDK_CONTROL_MASK, 'T', N_("Toggle thumbs")},
{GDK_CONTROL_MASK, 'W', N_("Close window")},
{static_cast<GdkModifierType>(0), GDK_KEY_Return, N_("View")},
}
else
{
- cursor = gdk_cursor_new(icon);
+ cursor = gdk_cursor_new(static_cast<GdkCursorType>(icon));
}
gdk_window_set_cursor(gtk_widget_get_window(widget), cursor);
text[DUPE_COLUMN_RANK] = g_strdup_printf("%d%s", rank, (di->second) ? " (2)" : "");
}
- text[DUPE_COLUMN_THUMB] = "";
+ text[DUPE_COLUMN_THUMB] = _("");
text[DUPE_COLUMN_NAME] = (gchar *)di->fd->name;
text[DUPE_COLUMN_SIZE] = text_from_size(di->fd->size);
text[DUPE_COLUMN_DATE] = (gchar *)text_from_time(di->fd->date);
for (i_set1 = 0; i_set1 <= (gint)(array_set1->len) - 1; i_set1++)
{
- DupeItem *di1 = g_array_index(array_set1, gpointer, i_set1);
+ DupeItem *di1 = static_cast<DupeItem *>(g_array_index(array_set1, gpointer, i_set1));
DupeItem *di2 = NULL;
/* If multiple identical entries in set 1, use the last one */
if (i_set1 < (gint)(array_set1->len) - 2)
{
- di2 = g_array_index(array_set1, gpointer, i_set1 + 1);
+ di2 = static_cast<DupeItem *>(g_array_index(array_set1, gpointer, i_set1 + 1));
check_result = dupe_match_check(di1, di2, dw);
if (check_result == DUPE_MATCH || check_result == DUPE_NAME_MATCH)
{
match_found = FALSE;
for(i=0; i < array_set2->len; i++)
{
- di2 = g_array_index(array_set2, gpointer, i);
+ di2 = static_cast<DupeItem *>(g_array_index(array_set2, gpointer, i));
check_result = dupe_match_check(di1, di2, dw);
if (check_result == DUPE_MATCH)
{
if (match_found)
{
- di2 = g_array_index(array_set2, gpointer, out_match_index);
+ di2 = static_cast<DupeItem *>(g_array_index(array_set2, gpointer, out_match_index));
check_result = dupe_match_check(di1, di2, dw);
if (check_result == DUPE_MATCH || check_result == DUPE_NAME_MATCH)
break;
}
/* Look for multiple matches in set 2 for item di1 */
- di2 = g_array_index(array_set2, gpointer, i_set2);
+ di2 = static_cast<DupeItem *>(g_array_index(array_set2, gpointer, i_set2));
check_result = dupe_match_check(di1, di2, dw);
while (check_result == DUPE_MATCH || check_result == DUPE_NAME_MATCH)
{
{
break;
}
- di2 = g_array_index(array_set2, gpointer, i_set2);
+ di2 = static_cast<DupeItem *>(g_array_index(array_set2, gpointer, i_set2));
check_result = dupe_match_check(di1, di2, dw);
}
}
{
for (i_set1 = 0; i_set1 <= (gint)(array_set1->len) - 2; i_set1++)
{
- DupeItem *di1 = g_array_index(array_set1, gpointer, i_set1);
- DupeItem *di2 = g_array_index(array_set1, gpointer, i_set1 + 1);
+ DupeItem *di1 = static_cast<DupeItem *>(g_array_index(array_set1, gpointer, i_set1));
+ DupeItem *di2 = static_cast<DupeItem *>(g_array_index(array_set1, gpointer, i_set1 + 1));
check_result = dupe_match_check(di1, di2, dw);
if (check_result == DUPE_MATCH || check_result == DUPE_NAME_MATCH)
break;
}
/* Look for multiple matches for item di1 */
- di2 = g_array_index(array_set1, gpointer, i_set1 + 1);
+ di2 = static_cast<DupeItem *>(g_array_index(array_set1, gpointer, i_set1 + 1));
check_result = dupe_match_check(di1, di2, dw);
while (check_result == DUPE_MATCH || check_result == DUPE_NAME_MATCH)
{
{
break;
}
- di2 = g_array_index(array_set1, gpointer, i_set1 + 1);
+ di2 = static_cast<DupeItem *>(g_array_index(array_set1, gpointer, i_set1 + 1));
check_result = dupe_match_check(di1, di2, dw);
}
}
dw->setup_point = dupe_setup_point_step(dw, dw->setup_point);
dw->setup_n++;
}
- dw->setup_mask |= DUPE_MATCH_SIM_MED;
+ dw->setup_mask = static_cast<DupeMatchType>(dw->setup_mask | DUPE_MATCH_SIM_MED);
dupe_setup_reset(dw);
}
dw->setup_count = g_list_length(dw->list);
if (dw->second_set) dw->setup_count += g_list_length(dw->second_list);
- dw->setup_mask = 0;
+ dw->setup_mask = DUPE_MATCH_NONE;
dupe_setup_reset(dw);
dw->working = g_list_last(dw->list);
geometry.base_width = DUPE_DEF_WIDTH;
geometry.base_height = DUPE_DEF_HEIGHT;
gtk_window_set_geometry_hints(GTK_WINDOW(dw->window), NULL, &geometry,
- GDK_HINT_MIN_SIZE | GDK_HINT_BASE_SIZE);
+ static_cast<GdkWindowHints>(GDK_HINT_MIN_SIZE | GDK_HINT_BASE_SIZE));
if (lw && options->save_window_positions)
{
static gint n_dupe_drag_types = 2;
static GtkTargetEntry dupe_drop_types[] = {
- { TARGET_APP_COLLECTION_MEMBER_STRING, 0, TARGET_APP_COLLECTION_MEMBER },
+ { const_cast<gchar *>(TARGET_APP_COLLECTION_MEMBER_STRING), 0, TARGET_APP_COLLECTION_MEMBER },
{ const_cast<gchar *>("text/uri-list"), 0, TARGET_URI_LIST }
};
static gint n_dupe_drop_types = 2;
if (enable)
{
gtk_drag_dest_set(widget,
- GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_HIGHLIGHT | GTK_DEST_DEFAULT_DROP,
+ static_cast<GtkDestDefaults>(GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_HIGHLIGHT | GTK_DEST_DEFAULT_DROP),
dupe_drop_types, n_dupe_drop_types,
- GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_ASK);
+ static_cast<GdkDragAction>(GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_ASK));
}
else
static void dupe_dnd_init(DupeWindow *dw)
{
- gtk_drag_source_set(dw->listview, GDK_BUTTON1_MASK | GDK_BUTTON2_MASK,
+ gtk_drag_source_set(dw->listview, static_cast<GdkModifierType>(GDK_BUTTON1_MASK | GDK_BUTTON2_MASK),
dupe_drag_types, n_dupe_drag_types,
- GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK);
+ static_cast<GdkDragAction>(GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK));
g_signal_connect(G_OBJECT(dw->listview), "drag_data_get",
G_CALLBACK(dupe_dnd_data_set), dw);
g_signal_connect(G_OBJECT(dw->listview), "drag_begin",
g_signal_connect(G_OBJECT(dw->listview), "drag_data_received",
G_CALLBACK(dupe_dnd_data_get), dw);
- gtk_drag_source_set(dw->second_listview, GDK_BUTTON1_MASK | GDK_BUTTON2_MASK,
+ gtk_drag_source_set(dw->second_listview, static_cast<GdkModifierType>(GDK_BUTTON1_MASK | GDK_BUTTON2_MASK),
dupe_drag_types, n_dupe_drag_types,
- GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK);
+ static_cast<GdkDragAction>(GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK));
g_signal_connect(G_OBJECT(dw->second_listview), "drag_data_get",
G_CALLBACK(dupe_dnd_data_set), dw);
g_signal_connect(G_OBJECT(dw->second_listview), "drag_begin",
if (g_hash_table_lookup(editors, key)) return FALSE; /* the file found earlier wins */
key_file = g_key_file_new();
- if (!g_key_file_load_from_file(key_file, path, 0, NULL))
+ if (!g_key_file_load_from_file(key_file, path, static_cast<GKeyFileFlags>(0), NULL))
{
g_key_file_free(key_file);
return FALSE;
}
}
- if (g_key_file_get_boolean(key_file, DESKTOP_GROUP, "X-Geeqie-Keep-Fullscreen", NULL)) editor->flags |= EDITOR_KEEP_FS;
- if (g_key_file_get_boolean(key_file, DESKTOP_GROUP, "X-Geeqie-Verbose", NULL)) editor->flags |= EDITOR_VERBOSE;
- if (g_key_file_get_boolean(key_file, DESKTOP_GROUP, "X-Geeqie-Verbose-Multi", NULL)) editor->flags |= EDITOR_VERBOSE_MULTI;
- if (g_key_file_get_boolean(key_file, DESKTOP_GROUP, "X-Geeqie-Filter", NULL)) editor->flags |= EDITOR_DEST;
- if (g_key_file_get_boolean(key_file, DESKTOP_GROUP, "Terminal", NULL)) editor->flags |= EDITOR_TERMINAL;
+ if (g_key_file_get_boolean(key_file, DESKTOP_GROUP, "X-Geeqie-Keep-Fullscreen", NULL)) editor->flags = static_cast<EditorFlags>(editor->flags | EDITOR_KEEP_FS);
+ if (g_key_file_get_boolean(key_file, DESKTOP_GROUP, "X-Geeqie-Verbose", NULL)) editor->flags = static_cast<EditorFlags>(editor->flags | EDITOR_VERBOSE);
+ if (g_key_file_get_boolean(key_file, DESKTOP_GROUP, "X-Geeqie-Verbose-Multi", NULL)) editor->flags = static_cast<EditorFlags>(editor->flags | EDITOR_VERBOSE_MULTI);
+ if (g_key_file_get_boolean(key_file, DESKTOP_GROUP, "X-Geeqie-Filter", NULL)) editor->flags = static_cast<EditorFlags>(editor->flags | EDITOR_DEST);
+ if (g_key_file_get_boolean(key_file, DESKTOP_GROUP, "Terminal", NULL)) editor->flags = static_cast<EditorFlags>(editor->flags | EDITOR_TERMINAL);
- editor->flags |= editor_command_parse(editor, NULL, FALSE, NULL);
+ editor->flags = static_cast<EditorFlags>(editor->flags | editor_command_parse(editor, NULL, FALSE, NULL));
if ((editor->flags & EDITOR_NO_PARAM) && !category_geeqie) editor->hidden = TRUE;
disabled = FALSE;
while (work)
{
- if (g_strcmp0(path, work->data) == 0)
+ if (g_strcmp0(path, static_cast<const gchar *>(work->data)) == 0)
{
disabled = TRUE;
break;
EditorFlags editor_command_parse(const EditorDescription *editor, GList *list, gboolean consider_sidecars, gchar **output)
{
- EditorFlags flags = 0;
+ EditorFlags flags = static_cast<EditorFlags>(0);
const gchar *p;
GString *result = NULL;
gboolean escape = FALSE;
if (editor->exec == NULL || editor->exec[0] == '\0')
{
- flags |= EDITOR_ERROR_EMPTY;
+ flags = static_cast<EditorFlags>(flags | EDITOR_ERROR_EMPTY);
goto err;
}
{
case 'f': /* single file */
case 'u': /* single url */
- flags |= EDITOR_FOR_EACH;
+ flags = static_cast<EditorFlags>(flags | EDITOR_FOR_EACH);
if (flags & EDITOR_SINGLE_COMMAND)
{
- flags |= EDITOR_ERROR_INCOMPATIBLE;
+ flags = static_cast<EditorFlags>(flags | EDITOR_ERROR_INCOMPATIBLE);
goto err;
}
if (list)
/* use the first file from the list */
if (!list->data)
{
- flags |= EDITOR_ERROR_NO_FILE;
+ flags = static_cast<EditorFlags>(flags | EDITOR_ERROR_NO_FILE);
goto err;
}
pathl = editor_command_path_parse((FileData *)list->data,
if (!pathl)
{
- flags |= EDITOR_ERROR_NO_FILE;
+ flags = static_cast<EditorFlags>(flags | EDITOR_ERROR_NO_FILE);
goto err;
}
if (output)
case 'F':
case 'U':
- flags |= EDITOR_SINGLE_COMMAND;
+ flags = static_cast<EditorFlags>(flags | EDITOR_SINGLE_COMMAND);
if (flags & (EDITOR_FOR_EACH | EDITOR_DEST))
{
- flags |= EDITOR_ERROR_INCOMPATIBLE;
+ flags = static_cast<EditorFlags>(flags | EDITOR_ERROR_INCOMPATIBLE);
goto err;
}
}
if (!ok)
{
- flags |= EDITOR_ERROR_NO_FILE;
+ flags = static_cast<EditorFlags>(flags | EDITOR_ERROR_NO_FILE);
goto err;
}
}
/* deprecated according to spec, ignore */
break;
default:
- flags |= EDITOR_ERROR_SYNTAX;
+ flags = static_cast<EditorFlags>(flags | EDITOR_ERROR_SYNTAX);
goto err;
}
}
p++;
}
- if (!(flags & (EDITOR_FOR_EACH | EDITOR_SINGLE_COMMAND))) flags |= EDITOR_NO_PARAM;
+ if (!(flags & (EDITOR_FOR_EACH | EDITOR_SINGLE_COMMAND))) flags = static_cast<EditorFlags>(flags | EDITOR_NO_PARAM);
if (output)
{
ed->pid = -1;
ed->flags = editor->flags;
- ed->flags |= editor_command_parse(editor, list, TRUE, &command);
+ ed->flags = static_cast<EditorFlags>(ed->flags | editor_command_parse(editor, list, TRUE, &command));
ok = !EDITOR_ERRORS(ed->flags);
if (!ok) log_printf("ERROR: cannot execute shell command '%s'\n", options->shell.path);
}
- if (!ok) ed->flags |= EDITOR_ERROR_CANT_EXEC;
+ if (!ok) ed->flags = static_cast<EditorFlags>(ed->flags | EDITOR_ERROR_CANT_EXEC);
}
if (ok)
g_free(working_directory);
- if (!ok) ed->flags |= EDITOR_ERROR_CANT_EXEC;
+ if (!ok) ed->flags = static_cast<EditorFlags>(ed->flags | EDITOR_ERROR_CANT_EXEC);
}
if (ok)
g_io_channel_set_flags(channel_output, G_IO_FLAG_NONBLOCK, NULL);
g_io_channel_set_encoding(channel_output, NULL, NULL);
- g_io_add_watch_full(channel_output, G_PRIORITY_HIGH, G_IO_IN | G_IO_ERR | G_IO_HUP,
+ g_io_add_watch_full(channel_output, G_PRIORITY_HIGH, static_cast<GIOCondition>(G_IO_IN | G_IO_ERR | G_IO_HUP),
+ editor_verbose_io_cb, ed, NULL);
+ g_io_add_watch_full(channel_output, G_PRIORITY_HIGH, static_cast<GIOCondition>(G_IO_IN | G_IO_ERR | G_IO_HUP),
editor_verbose_io_cb, ed, NULL);
g_io_channel_unref(channel_output);
g_io_channel_set_flags(channel_error, G_IO_FLAG_NONBLOCK, NULL);
g_io_channel_set_encoding(channel_error, NULL, NULL);
- g_io_add_watch_full(channel_error, G_PRIORITY_HIGH, G_IO_IN | G_IO_ERR | G_IO_HUP,
+ g_io_add_watch_full(channel_error, G_PRIORITY_HIGH, static_cast<GIOCondition>(G_IO_IN | G_IO_ERR | G_IO_HUP),
editor_verbose_io_cb, ed, NULL);
g_io_channel_unref(channel_error);
}
g_free(command);
- return EDITOR_ERRORS(ed->flags);
+ return static_cast<EditorFlags>(EDITOR_ERRORS(ed->flags));
}
static EditorFlags editor_command_next_start(EditorData *ed)
}
if (!error)
- return 0;
+ return static_cast<EditorFlags>(0);
/* command was not started, call the finish immediately */
return editor_command_next_finish(ed, 0);
gint cont = ed->stopping ? EDITOR_CB_SKIP : EDITOR_CB_CONTINUE;
if (status)
- ed->flags |= EDITOR_ERROR_STATUS;
+ ed->flags = static_cast<EditorFlags>(ed->flags | EDITOR_ERROR_STATUS);
if (ed->flags & EDITOR_FOR_EACH)
{
switch (cont)
{
case EDITOR_CB_SUSPEND:
- return EDITOR_ERRORS(ed->flags);
+ return static_cast<EditorFlags>(EDITOR_ERRORS(ed->flags));
case EDITOR_CB_SKIP:
return editor_command_done(ed);
}
/* free the not-handled items */
if (ed->list)
{
- ed->flags |= EDITOR_ERROR_SKIPPED;
+ ed->flags = static_cast<EditorFlags>(ed->flags | EDITOR_ERROR_SKIPPED);
if (ed->callback) ed->callback(NULL, ed->flags, ed->list, ed->data);
filelist_free(ed->list);
ed->list = NULL;
ed->count = 0;
- flags = EDITOR_ERRORS(ed->flags);
+ flags = static_cast<EditorFlags>(EDITOR_ERRORS(ed->flags));
if (!ed->vd) editor_data_free(ed);
void editor_resume(gpointer ed)
{
- editor_command_next_start(ed);
+ editor_command_next_start(reinterpret_cast<EditorData *>(ed));
}
void editor_skip(gpointer ed)
{
- editor_command_done(ed);
+ editor_command_done(static_cast<EditorData *>(ed));
}
static EditorFlags editor_command_start(const EditorDescription *editor, const gchar *text, GList *list, const gchar *working_directory, EditorCallback cb, gpointer data)
EditorData *ed;
EditorFlags flags = editor->flags;
- if (EDITOR_ERRORS(flags)) return EDITOR_ERRORS(flags);
+ if (EDITOR_ERRORS(flags)) return static_cast<EditorFlags>(EDITOR_ERRORS(flags));
ed = g_new0(EditorData, 1);
ed->list = filelist_copy(list);
ed->working_directory = g_strdup(working_directory);
if ((flags & EDITOR_VERBOSE_MULTI) && list && list->next)
- flags |= EDITOR_VERBOSE;
+ flags = static_cast<EditorFlags>(flags | EDITOR_VERBOSE);
if (flags & EDITOR_VERBOSE)
editor_verbose_window(ed, text);
editor_command_next_start(ed);
/* errors from editor_command_next_start will be handled via callback */
- return EDITOR_ERRORS(flags);
+ return static_cast<EditorFlags>(EDITOR_ERRORS(flags));
}
gboolean is_valid_editor_command(const gchar *key)
if (EDITOR_ERRORS(error)) return error;
- error |= editor_command_start(editor, editor->name, list, working_directory, cb, data);
+ error = static_cast<EditorFlags>(error | editor_command_start(editor, editor->name, list, working_directory, cb, data));
if (EDITOR_ERRORS(error))
{
g_free(text);
}
- return EDITOR_ERRORS(error);
+ return static_cast<EditorFlags>(EDITOR_ERRORS(error));
}
EditorFlags start_editor_from_filelist(const gchar *key, GList *list)
GList *list;
EditorFlags error;
- if (!fd) return FALSE;
+ if (!fd) return static_cast<EditorFlags>(FALSE);
list = g_list_append(NULL, fd);
error = start_editor_from_filelist_full(key, list, NULL, cb, data);
struct tm time_str;
uint year, month, day, hour, min, sec;
- sscanf(tmp, "%4d:%2d:%2d %2d:%2d:%2d", &year, &month, &day, &hour, &min, &sec);
+ sscanf(tmp, "%4u:%2u:%2u %2u:%2u:%2u", &year, &month, &day, &hour, &min, &sec);
time_str.tm_year = year - 1900;
time_str.tm_mon = month - 1;
time_str.tm_mday = day;
struct tm time_str;
uint year, month, day, hour, min, sec;
- sscanf(tmp, "%4d:%2d:%2d %2d:%2d:%2d", &year, &month, &day, &hour, &min, &sec);
+ sscanf(tmp, "%4u:%2u:%2u %2u:%2u:%2u", &year, &month, &day, &hour, &min, &sec);
time_str.tm_year = year - 1900;
time_str.tm_mon = month - 1;
time_str.tm_mday = day;
static gint filelist_sort_file_cb(gpointer a, gpointer b)
{
- return filelist_sort_compare_filedata(a, b);
+ return filelist_sort_compare_filedata(static_cast<FileData *>(a), static_cast<FileData *>(b));
}
GList *filelist_sort_full(GList *list, SortType method, gboolean ascend, GCompareFunc cb)
gboolean file_data_filter_file_filter(FileData *fd, GRegex *filter)
{
- return g_regex_match(filter, fd->name, 0, NULL);
+ return g_regex_match(filter, fd->name, G_REGEX_MATCH_DEFAULT, NULL);
}
GList *file_data_filter_file_filter_list(GList *list, GRegex *filter)
geometry.base_height = h;
geometry.win_gravity = GDK_GRAVITY_STATIC;
gtk_window_set_geometry_hints(GTK_WINDOW(fs->window), fs->window, &geometry,
- GDK_HINT_WIN_GRAVITY | GDK_HINT_USER_POS | GDK_HINT_USER_SIZE);
+ static_cast<GdkWindowHints>(GDK_HINT_WIN_GRAVITY | GDK_HINT_USER_POS | GDK_HINT_USER_SIZE));
gtk_widget_realize(fs->window);
chain_index = chain_index > 0 ? chain_index - 1 : 0;
- return g_list_nth_data(history_chain, chain_index);
+ return static_cast<const gchar *>(g_list_nth_data(history_chain, chain_index));
}
const gchar *history_chain_forward()
chain_index = chain_index < last ? chain_index + 1 : last;
- return g_list_nth_data(history_chain, chain_index);
+ return static_cast<const gchar *>(g_list_nth_data(history_chain, chain_index));
}
/**
else
{
work = g_list_last(history_chain);
- if (g_strcmp0(work->data , path) != static_cast<const char *>(0))
+ if (g_strcmp0(static_cast<const gchar *>(work->data), path) != 0)
{
history_chain = g_list_append (history_chain, g_strdup(path));
chain_index = g_list_length(history_chain) - 1;
image_chain_index = image_chain_index > 0 ? image_chain_index - 1 : 0;
- return g_list_nth_data(image_chain, image_chain_index);
+ return static_cast<const gchar *>(g_list_nth_data(image_chain, image_chain_index));
}
const gchar *image_chain_forward()
image_chain_index = image_chain_index < last ? image_chain_index + 1 : last;
- return g_list_nth_data(image_chain, image_chain_index);
+ return static_cast<const gchar *>(g_list_nth_data(image_chain, image_chain_index));
}
/**
else
{
work = g_list_last(image_chain);
- if (g_strcmp0(work->data , path) != static_cast<const char *>(0))
+ if (g_strcmp0(static_cast<const gchar *>(work->data) , path) != 0)
{
image_chain = g_list_append(image_chain, g_strdup(path));
image_chain_index = g_list_length(image_chain) - 1;
{
if ((!(strcmp(hd->key, "path_list") == 0 && list_count > options->open_recent_list_maxsize))
&&
- (!(strcmp(hd->key, "recent") == 0 && (!isfile(work->data))))
+ (!(strcmp(hd->key, "recent") == 0 && (!isfile(static_cast<const gchar *>(work->data)))))
&&
(!(strcmp(hd->key, "image_list") == 0 && list_count > options->recent_folder_image_list_maxsize)))
{
hd = history_list_find_by_key(key);
if (!hd || !hd->list) return NULL;
- return hd->list->data;
+ return static_cast<const gchar *>(hd->list->data);
}
void history_list_free_key(const gchar *key)
while (work)
{
- dirname = static_cast<const gchar *>(g_path_get_dirname(work->data));
+ dirname = g_path_get_dirname(static_cast<const gchar *>(work->data));
if (g_strcmp0(dirname, path) == 0)
{
- if (isfile(work->data))
+ if (isfile(static_cast<const gchar *>(work->data)))
{
- ret = static_cast<const gchar *>(g_strdup(work->data));
+ ret = g_strdup(static_cast<const gchar *>(work->data));
}
g_free(dirname);
break;
while (work)
{
- list_dir = static_cast<const gchar *>(g_path_get_dirname(work->data));
+ list_dir = g_path_get_dirname(static_cast<const gchar *>(work->data));
/* If folder already in list, update and move to start of list */
if (g_strcmp0(list_dir, image_dir) == 0)
static gchar** image_loader_collection_get_format_mime_types(gpointer UNUSED(loader))
{
static const gchar *mime[] = {"image/png", NULL};
- return g_strdupv(mime);
+ return g_strdupv(const_cast<gchar **>(mime));
}
static gboolean image_loader_collection_close(gpointer UNUSED(loader), GError **UNUSED(error))
static gchar** image_loader_cr3_get_format_mime_types(gpointer UNUSED(loader))
{
static const gchar *mime[] = {"image/x-canon-cr3", NULL};
- return g_strdupv(mime);
+ return g_strdupv(const_cast<gchar **>(mime));
}
static gboolean image_loader_cr3_close(gpointer UNUSED(loader), GError **UNUSED(error))
}
guchar *ddsDecodeDXT1(uint width, uint height, const unsigned char *buffer) {
- uint *pixels = g_try_malloc(4 * width*height);
+ uint *pixels = static_cast<uint *>(g_try_malloc(4 * width*height));
if (pixels == NULL) return NULL;
uint index = 128;
uint w = (width + 3) / 4;
}
guchar *ddsDecodeDXT3(uint width, uint height, const unsigned char *buffer) {
- uint *pixels = g_try_malloc(4 * width*height);
+ uint *pixels = static_cast<uint *>(g_try_malloc(4 * width*height));
if (pixels == NULL) return NULL;
uint index = 128;
uint w = (width + 3) / 4;
}
guchar *ddsDecodeDXT5(uint width, uint height, const unsigned char *buffer) {
- uint *pixels = g_try_malloc(4 * width*height);
+ uint *pixels = static_cast<uint *>(g_try_malloc(4 * width*height));
if (pixels == NULL) return NULL;
uint index = 128;
uint w = (width + 3) / 4;
}
guchar *ddsReadA1R5G5B5(uint width, uint height, const unsigned char *buffer) {
- uint *pixels = g_try_malloc(4 * width*height);
+ uint *pixels = static_cast<uint *>(g_try_malloc(4 * width*height));
if (pixels == NULL) return NULL;
uint index = 128;
for (uint i = 0; i<height*width; i++) {
}
guchar *ddsReadX1R5G5B5(uint width, uint height, const unsigned char *buffer) {
- uint *pixels = g_try_malloc(4 * width*height);
+ uint *pixels = static_cast<uint *>(g_try_malloc(4 * width*height));
if (pixels == NULL) return NULL;
uint index = 128;
for (uint i = 0; i<height*width; i++) {
}
guchar *ddsReadA4R4G4B4(uint width, uint height, const unsigned char *buffer) {
- uint *pixels = g_try_malloc(4 * width*height);
+ uint *pixels = static_cast<uint *>(g_try_malloc(4 * width*height));
if (pixels == NULL) return NULL;
uint index = 128;
for (uint i = 0; i<height*width; i++) {
}
guchar *ddsReadX4R4G4B4(uint width, uint height, const unsigned char *buffer) {
- uint *pixels = g_try_malloc(4 * width*height);
+ uint *pixels = static_cast<uint *>(g_try_malloc(4 * width*height));
if (pixels == NULL) return NULL;
uint index = 128;
for (uint i = 0; i<height*width; i++) {
}
guchar *ddsReadR5G6B5(uint width, uint height, const unsigned char *buffer) {
- uint *pixels = g_try_malloc(4 * width*height);
+ uint *pixels = static_cast<uint *>(g_try_malloc(4 * width*height));
if (pixels == NULL) return NULL;
uint index = 128;
for (uint i = 0; i<height*width; i++) {
}
guchar *ddsReadR8G8B8(uint width, uint height, const unsigned char *buffer) {
- uint *pixels = g_try_malloc(4 * width*height);
+ uint *pixels = static_cast<uint *>(g_try_malloc(4 * width*height));
if (pixels == NULL) return NULL;
uint index = 128;
for (uint i = 0; i<height*width; i++) {
}
guchar *ddsReadA8B8G8R8(uint width, uint height, const unsigned char *buffer) {
- uint *pixels = g_try_malloc(4 * width*height);
+ uint *pixels = static_cast<uint *>(g_try_malloc(4 * width*height));
if (pixels == NULL) return NULL;
uint index = 128;
for (uint i = 0; i<height*width; i++) {
}
guchar *ddsReadX8B8G8R8(uint width, uint height, const unsigned char *buffer) {
- uint *pixels = g_try_malloc(4 * width*height);
+ uint *pixels = static_cast<uint *>(g_try_malloc(4 * width*height));
if (pixels == NULL) return NULL;
uint index = 128;
for (uint i = 0; i<height*width; i++) {
}
guchar *ddsReadA8R8G8B8(uint width, uint height, const unsigned char *buffer) {
- uint *pixels = g_try_malloc(4 * width*height);
+ uint *pixels = static_cast<uint *>(g_try_malloc(4 * width*height));
if (pixels == NULL) return NULL;
uint index = 128;
for (uint i = 0; i<height*width; i++) {
}
guchar *ddsReadX8R8G8B8(uint width, uint height, const unsigned char *buffer) {
- uint *pixels = g_try_malloc(4 * width*height);
+ uint *pixels = static_cast<uint *>(g_try_malloc(4 * width*height));
if (pixels == NULL) return NULL;
uint index = 128;
for (uint i = 0; i<height*width; i++) {
static gchar** image_loader_dds_get_format_mime_types(gpointer UNUSED(loader))
{
static const gchar *mime[] = {"image/vnd-ms.dds", NULL};
- return g_strdupv(mime);
+ return g_strdupv(const_cast<gchar **>(mime));
}
static gboolean image_loader_dds_close(gpointer UNUSED(loader), GError **UNUSED(error))
static gchar** image_loader_djvu_get_format_mime_types(gpointer UNUSED(loader))
{
static const gchar *mime[] = {"image/vnd.djvu", NULL};
- return g_strdupv(mime);
+ return g_strdupv(const_cast<gchar **>(mime));
}
static void image_loader_djvu_set_page_num(gpointer loader, gint page_num)
static gchar** image_loader_external_get_format_mime_types(gpointer UNUSED(loader))
{
static const gchar *mime[] = {"application/octet-stream", NULL};
- return g_strdupv(mime);
+ return g_strdupv(const_cast<gchar **>(mime));
}
static gboolean image_loader_external_close(gpointer UNUSED(loader), GError **UNUSED(error))
static gchar** image_loader_ft_get_format_mime_types(gpointer UNUSED(loader))
{
static const gchar *mime[] = {"video/mp4", NULL};
- return g_strdupv(mime);}
+ return g_strdupv(const_cast<gchar **>(mime));
+}
static gpointer image_loader_ft_new(ImageLoaderBackendCbAreaUpdated area_updated_cb, ImageLoaderBackendCbSize size_cb, ImageLoaderBackendCbAreaPrepared area_prepared_cb, gpointer data)
{
static gchar** image_loader_heif_get_format_mime_types(gpointer UNUSED(loader))
{
static const gchar *mime[] = {"image/heic", NULL};
- return g_strdupv(mime);
+ return g_strdupv(const_cast<gchar **>(mime));
}
static void image_loader_heif_set_page_num(gpointer loader, gint page_num)
free (p_source_buffer->buf);
}
- p_source_buffer->buf = pbuf;
+ p_source_buffer->buf = static_cast<OPJ_BYTE *>(pbuf);
p_source_buffer->cur = (guchar *)pbuf + dist;
p_source_buffer->len = len;
}
static gchar** image_loader_j2k_get_format_mime_types(gpointer UNUSED(loader))
{
static const gchar *mime[] = {"image/jp2", NULL};
- return g_strdupv(mime);
+ return g_strdupv(const_cast<gchar **>(mime));
}
static gboolean image_loader_j2k_close(gpointer UNUSED(loader), GError **UNUSED(error))
static gchar** image_loader_jpeg_get_format_mime_types(gpointer UNUSED(loader))
{
static const gchar *mime[] = {"image/jpeg", NULL};
- return g_strdupv(mime);
+ return g_strdupv(const_cast<gchar **>(mime));
}
static gboolean image_loader_jpeg_close(gpointer UNUSED(loader), GError **UNUSED(error))
break;
}
size_t pixels_buffer_size = buffer_size * sizeof(uint8_t);
- pixels = malloc(pixels_buffer_size);
+ pixels = static_cast<uint8_t *>(malloc(pixels_buffer_size));
void *pixels_buffer = (void *)pixels;
if (JXL_DEC_SUCCESS != JxlDecoderSetImageOutBuffer(dec, &format,
pixels_buffer,
static gchar** image_loader_jpegxl_get_format_mime_types(gpointer loader)
{
static const gchar *mime[] = {"image/jxl", NULL};
- return g_strdupv(mime);
+ return g_strdupv(const_cast<gchar **>(mime));
}
static gboolean image_loader_jpegxl_close(gpointer loader, GError **error)
static gchar** image_loader_pdf_get_format_mime_types(gpointer UNUSED(loader))
{
static const gchar *mime[] = {"application/pdf", NULL};
- return g_strdupv(mime);
+ return g_strdupv(const_cast<gchar **>(mime));
}
static void image_loader_pdf_set_page_num(gpointer loader, gint page_num)
ctx->channels = hd.channels;
ctx->depth = hd.depth;
ctx->depth_bytes = (ctx->depth/8 > 0 ? ctx->depth/8 : 1);
- ctx->color_mode = hd.color_mode;
+ ctx->color_mode = static_cast<PsdColorMode>(hd.color_mode);
if (ctx->color_mode != PSD_MODE_RGB
&& ctx->color_mode != PSD_MODE_GRAYSCALE
/* we need buffer that can contain one channel data for one
row in RLE compressed format. 2*width should be enough */
g_free(ctx->buffer);
- ctx->buffer = g_malloc(ctx->width * 2 * ctx->depth_bytes);
+ ctx->buffer = static_cast<guchar *>(g_malloc(ctx->width * 2 * ctx->depth_bytes));
/* this will be needed for RLE decompression */
ctx->lines_lengths =
- g_malloc(2 * ctx->channels * ctx->height);
+ static_cast<guint16 *>(g_malloc(2 * ctx->channels * ctx->height));
ctx->pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB,
FALSE, 8, ctx->width, ctx->height);
}
/* create separate buffers for each channel */
- ctx->ch_bufs = g_malloc(sizeof(guchar*) * ctx->channels);
+ ctx->ch_bufs = static_cast<guchar **>(g_malloc(sizeof(guchar*) * ctx->channels));
for (i = 0; i < ctx->channels; i++) {
ctx->ch_bufs[i] =
- g_malloc(ctx->width*ctx->height*ctx->depth_bytes);
+ static_cast<guchar *>(g_malloc(ctx->width*ctx->height*ctx->depth_bytes));
if (ctx->ch_bufs[i] == NULL) {
log_printf("warning: Insufficient memory to load PSD image file\n");
case PSD_STATE_COMPRESSION:
if (feed_buffer(ctx->buffer, &ctx->bytes_read, &buf, &size, 2))
{
- ctx->compression = read_uint16(ctx->buffer);
+ ctx->compression = static_cast<PsdCompressionType>(read_uint16(ctx->buffer));
if (ctx->compression == PSD_COMPRESSION_RLE) {
ctx->state = PSD_STATE_LINES_LENGTHS;
static gchar** image_loader_psd_get_format_mime_types(gpointer UNUSED(loader))
{
static const gchar *mime[] = {"application/psd", NULL};
- return g_strdupv(mime);
+ return g_strdupv(const_cast<gchar **>(mime));
}
static gboolean image_loader_psd_close(gpointer UNUSED(loader), GError **UNUSED(error))
static gchar** image_loader_svgz_get_format_mime_types(gpointer UNUSED(loader))
{
static const gchar *mime[] = {"image/svg", NULL};
- return g_strdupv(mime);
+ return g_strdupv(const_cast<gchar **>(mime));
}
static gpointer image_loader_svgz_new(ImageLoaderBackendCbAreaUpdated area_updated_cb, ImageLoaderBackendCbSize size_cb, ImageLoaderBackendCbAreaPrepared area_prepared_cb, gpointer data)
static gchar** image_loader_tiff_get_format_mime_types(gpointer UNUSED(loader))
{
static const gchar *mime[] = {"image/tiff", NULL};
- return g_strdupv(mime);
+ return g_strdupv(const_cast<gchar **>(mime));
}
static gboolean image_loader_tiff_close(gpointer UNUSED(loader), GError **UNUSED(error))
width = 256;
height = 192;
- pixels = g_try_malloc(width * height * 3);
+ pixels = static_cast<guint8 *>(g_try_malloc(width * height * 3));
if (!pixels)
{
static gchar **image_loader_zxscr_get_format_mime_types(gpointer UNUSED(loader))
{
static const gchar *mime[] = {"application/octet-stream", NULL};
- return g_strdupv(mime);
+ return g_strdupv(const_cast<gchar **>(mime));
}
static gboolean image_loader_zxscr_close(gpointer UNUSED(loader), GError **UNUSED(error))
(GInstanceInitFunc)image_loader_init, /* instance_init */
NULL /* value_table */
};
- type = g_type_register_static(G_TYPE_OBJECT, "ImageLoaderType", &info, 0);
+ type = g_type_register_static(G_TYPE_OBJECT, "ImageLoaderType", &info, G_TYPE_FLAG_NONE);
}
return type;
}
static void image_loader_class_init_wrapper(void *data, void *UNUSED(user_data))
{
- image_loader_class_init(data);
+ image_loader_class_init(static_cast<ImageLoaderClass *>(data));
}
static void image_loader_class_init(ImageLoaderClass *loader_class)
{
if (*list)
{
- ImageLoaderAreaParam *prev_par = (*list)->data;
+ ImageLoaderAreaParam *prev_par = static_cast<ImageLoaderAreaParam *>((*list)->data);
if (prev_par->x == x && prev_par->w == w &&
prev_par->y + prev_par->h == y)
{
else
image_loader_backend_set_default(&il->backend);
- il->loader = static_cast<void *>(il->backend.loader_new(image_loader_area_updated_cb, image_loader_size_cb, image_loader_area_prepared_cb, il));
+ il->loader = static_cast<void **>(il->backend.loader_new(image_loader_area_updated_cb, image_loader_size_cb, image_loader_area_prepared_cb, il));
#ifdef HAVE_TIFF
format = il->backend.get_format_name(il->loader);
return FALSE;
}
- il->mapped_file = mmap(0, il->bytes_total, PROT_READ|PROT_WRITE, MAP_PRIVATE, load_fd, 0);
+ il->mapped_file = static_cast<guchar *>(mmap(0, il->bytes_total, PROT_READ|PROT_WRITE, MAP_PRIVATE, load_fd, 0));
close(load_fd);
if (il->mapped_file == MAP_FAILED)
{
show = image_osd_get(imd);
if (show == OSD_SHOW_NOTHING)
{
- image_osd_set(imd, OSD_SHOW_INFO | OSD_SHOW_STATUS);
+ image_osd_set(imd, static_cast<OsdShowFlags>(OSD_SHOW_INFO | OSD_SHOW_STATUS));
return;
}
else
}
else
{
- image_osd_set(imd, show | OSD_SHOW_HISTOGRAM);
+ image_osd_set(imd, static_cast<OsdShowFlags>(show | OSD_SHOW_HISTOGRAM));
}
}
}
{
if (osd->icon_time[i] > 0)
{
- image_osd_icon_show(osd, i);
+ image_osd_icon_show(osd, static_cast<ImageOSDFlag>(i));
}
else
{
- image_osd_icon_hide(osd, i);
+ image_osd_icon_hide(osd, static_cast<ImageOSDFlag>(i));
}
}
}
for (i = 0; i < IMAGE_OSD_COUNT; i++)
{
- image_osd_icon_hide(osd, i);
+ image_osd_icon_hide(osd, static_cast<ImageOSDFlag>(i));
}
}
}
osd->changed_states = IMAGE_STATE_NONE;
- osd->notify = 0;
+ osd->notify = static_cast<NotifyType>(0);
osd->idle_id = 0;
return FALSE;
}
static void image_osd_update_schedule(OverlayStateData *osd, gboolean force)
{
- if (force) osd->changed_states |= IMAGE_STATE_IMAGE;
+ if (force) osd->changed_states = static_cast<ImageState>(osd->changed_states | IMAGE_STATE_IMAGE);
if (!osd->idle_id)
{
{
OverlayStateData *osd = static_cast<OverlayStateData *>(data);
- osd->changed_states |= state;
+ osd->changed_states = static_cast<ImageState>(osd->changed_states | state);
image_osd_update_schedule(osd, FALSE);
}
if ((type & (NOTIFY_HISTMAP)) && osd->imd && fd == osd->imd->image_fd)
{
DEBUG_1("Notify osd: %s %04x", fd->path, type);
- osd->notify |= type;
+ osd->notify = static_cast<NotifyType>(osd->notify | type);
image_osd_update_schedule(osd, FALSE);
}
}
}
else
{
- imd->state |= state;
+ imd->state = static_cast<ImageState>(imd->state | state);
}
if (imd->func_state) imd->func_state(imd, state, imd->data_state);
}
static void image_state_unset(ImageWindow *imd, ImageState state)
{
- imd->state &= ~state;
+ imd->state = static_cast<ImageState>(imd->state & ~state);
if (imd->func_state) imd->func_state(imd, state, imd->data_state);
}
else if (imd->color_profile_input >= COLOR_PROFILE_SRGB &&
imd->color_profile_input < COLOR_PROFILE_FILE)
{
- input_type = imd->color_profile_input;
+ input_type = static_cast<ColorManProfileType>(imd->color_profile_input);
input_file = NULL;
}
else
if (imd->color_profile_use_image && imd->color_profile_from_image != COLOR_PROFILE_NONE)
{
- input_type = imd->color_profile_from_image;
+ input_type = static_cast<ColorManProfileType>(imd->color_profile_from_image);
input_file = NULL;
}
}
static void image_post_process_tile_color_cb(PixbufRenderer *UNUSED(pr), GdkPixbuf **pixbuf, gint x, gint y, gint w, gint h, gpointer data)
{
ImageWindow *imd = (ImageWindow *)data;
- if (imd->cm) color_man_correct_region(imd->cm, *pixbuf, x, y, w, h);
+ if (imd->cm) color_man_correct_region(static_cast<ColorMan *>(imd->cm), *pixbuf, x, y, w, h);
if (imd->desaturate) pixbuf_desaturate_rect(*pixbuf, x, y, w, h);
if (imd->overunderexposed) pixbuf_highlight_overunderexposed(*pixbuf, x, y, w, h);
}
if (pixbuf)
{
- stereo_data = imd->user_stereo;
+ stereo_data = static_cast<StereoPixbufData>(imd->user_stereo);
if (stereo_data == STEREO_PIXBUF_DEFAULT)
{
- stereo_data = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(pixbuf), "stereo_data"));
+ stereo_data = static_cast<StereoPixbufData>(GPOINTER_TO_INT(g_object_get_data(G_OBJECT(pixbuf), "stereo_data")));
}
}
pixbuf_renderer_set_post_process_func((PixbufRenderer *)imd->pr, NULL, NULL, FALSE);
if (imd->cm)
{
- color_man_free(imd->cm);
+ color_man_free(static_cast<ColorMan *>(imd->cm));
imd->cm = NULL;
}
gdouble r = 1.0;
gint pl = 0;
gint pr = 0;
- gchar *approx = " ";
+ const gchar *approx = " ";
zoom = image_zoom_get(imd);
scale = image_zoom_get_real(imd);
StereoPixbufData image_stereo_pixbuf_get(ImageWindow *imd)
{
- return imd->user_stereo;
+ return static_cast<StereoPixbufData>(imd->user_stereo);
}
void image_stereo_pixbuf_set(ImageWindow *imd, StereoPixbufData stereo_mode)
AlterType type;
vw = static_cast<ViewWindow *>(submenu_item_get_data(widget));
- type = GPOINTER_TO_INT(data);
+ type = static_cast<AlterType>(GPOINTER_TO_INT(data));
if (!vw) return;
image_alter_orientation(vw->imd, vw->imd->image_fd, type);
if (source && info_list)
{
- image_change_from_collection(imd, source, info_list->data, image_zoom_get_default(imd));
+ image_change_from_collection(imd, source, static_cast<CollectInfo *>(info_list->data), image_zoom_get_default(imd));
}
else
{
gtk_drag_source_set(imd->pr, GDK_BUTTON2_MASK,
dnd_file_drag_types, dnd_file_drag_types_count,
- GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK);
+ static_cast<GdkDragAction>(GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK));
g_signal_connect(G_OBJECT(imd->pr), "drag_data_get",
G_CALLBACK(view_window_set_dnd_data), vw);
gtk_drag_dest_set(imd->pr,
- GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_DROP,
+ static_cast<GtkDestDefaults>(GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_DROP),
dnd_file_drop_types, dnd_file_drop_types_count,
- GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK);
+ static_cast<GdkDragAction>(GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK));
g_signal_connect(G_OBJECT(imd->pr), "drag_data_received",
G_CALLBACK(view_window_get_dnd_data), vw);
}
static LayoutStyle layout_config_styles[] = {
/* 1, 2, 3 */
- { LAYOUT_LEFT | LAYOUT_TOP, LAYOUT_LEFT | LAYOUT_BOTTOM, LAYOUT_RIGHT },
- { LAYOUT_LEFT | LAYOUT_TOP, LAYOUT_RIGHT | LAYOUT_TOP, LAYOUT_BOTTOM },
- { LAYOUT_LEFT, LAYOUT_RIGHT | LAYOUT_TOP, LAYOUT_RIGHT | LAYOUT_BOTTOM },
- { LAYOUT_TOP, LAYOUT_LEFT | LAYOUT_BOTTOM, LAYOUT_RIGHT | LAYOUT_BOTTOM }
+ { static_cast<LayoutLocation>(LAYOUT_LEFT | LAYOUT_TOP), static_cast<LayoutLocation>(LAYOUT_LEFT | LAYOUT_BOTTOM), LAYOUT_RIGHT },
+ { static_cast<LayoutLocation>(LAYOUT_LEFT | LAYOUT_TOP), static_cast<LayoutLocation>(LAYOUT_RIGHT | LAYOUT_TOP), LAYOUT_BOTTOM },
+ { LAYOUT_LEFT, static_cast<LayoutLocation>(LAYOUT_RIGHT | LAYOUT_TOP), static_cast<LayoutLocation>(LAYOUT_RIGHT | LAYOUT_BOTTOM) },
+ { LAYOUT_TOP, static_cast<LayoutLocation>(LAYOUT_LEFT | LAYOUT_BOTTOM), static_cast<LayoutLocation>(LAYOUT_RIGHT | LAYOUT_BOTTOM) }
};
static gint layout_config_style_count = sizeof(layout_config_styles) / sizeof(LayoutStyle);
row = layout_list_get_index(lw, fd);
if (source && info_list)
{
- layout_image_set_collection(lw, source, info_list->data);
+ layout_image_set_collection(lw, source, static_cast<CollectInfo *>(info_list->data));
}
else if (row == -1)
{
gtk_drag_source_set(imd->pr, GDK_BUTTON2_MASK,
dnd_file_drag_types, dnd_file_drag_types_count,
- GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK);
+ static_cast<GdkDragAction>(GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK));
g_signal_connect(G_OBJECT(imd->pr), "drag_data_get",
G_CALLBACK(layout_image_dnd_get), lw);
g_signal_connect(G_OBJECT(imd->pr), "drag_end",
G_CALLBACK(layout_image_dnd_end), lw);
gtk_drag_dest_set(imd->pr,
- GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_DROP,
+ static_cast<GtkDestDefaults>(GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_DROP),
dnd_file_drop_types, dnd_file_drop_types_count,
- GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK);
+ static_cast<GdkDragAction>(GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK));
g_signal_connect(G_OBJECT(imd->pr), "drag_data_received",
G_CALLBACK(layout_image_dnd_receive), lw);
}
{
if (!layout_valid(&lw)) return;
- image_stereo_pixbuf_set(lw->image, stereo_mode);
+ image_stereo_pixbuf_set(lw->image, static_cast<StereoPixbufData>(stereo_mode));
}
const gchar *layout_image_get_path(LayoutWindow *lw)
ImageSplitMode mode;
layout_exit_fullscreen(lw);
- mode = gtk_radio_action_get_current_value(action);
+ mode = static_cast<ImageSplitMode>(gtk_radio_action_get_current_value(action));
layout_split_change(lw, mode);
}
OsdShowFlags flags = image_osd_get(lw->image);
if ((flags | OSD_SHOW_INFO | OSD_SHOW_STATUS) != flags)
- image_osd_set(lw->image, flags | OSD_SHOW_INFO | OSD_SHOW_STATUS);
+ image_osd_set(lw->image, static_cast<OsdShowFlags>(flags | OSD_SHOW_INFO | OSD_SHOW_STATUS));
}
else
{
if (gtk_toggle_action_get_active(action))
{
- image_osd_set(lw->image, OSD_SHOW_INFO | OSD_SHOW_STATUS | OSD_SHOW_HISTOGRAM);
+ image_osd_set(lw->image, static_cast<OsdShowFlags>(OSD_SHOW_INFO | OSD_SHOW_STATUS | OSD_SHOW_HISTOGRAM));
layout_util_sync_views(lw); /* show the overlay state, default channel and mode in the menu */
}
else
{
OsdShowFlags flags = image_osd_get(lw->image);
if (flags & OSD_SHOW_HISTOGRAM)
- image_osd_set(lw->image, flags & ~OSD_SHOW_HISTOGRAM);
+ image_osd_set(lw->image, static_cast<OsdShowFlags>(flags & ~OSD_SHOW_HISTOGRAM));
}
}
GError *error = NULL;
GIOChannel *channel;
char **pre_key, **post_key;
- char *key_name, *converted_line;
+ const char *key_name;
+ char *converted_line;
int keymap_index;
guint index;
key_name = " ";
for (index=0; index < array->len-2; index=index+2)
{
- if (!(g_ascii_strcasecmp(g_ptr_array_index(array,index+1), post_key[0])))
+ if (!(g_ascii_strcasecmp(static_cast<const gchar *>(g_ptr_array_index(array,index+1)), post_key[0])))
{
- key_name = g_ptr_array_index(array,index+0);
+ key_name = static_cast<const gchar *>(g_ptr_array_index(array,index+0));
break;
}
}
DEBUG_1("%s layout_actions_setup: add toolbar", get_exec_time());
for (i = 0; i < TOOLBAR_COUNT; i++)
{
- layout_toolbar_clear(lw, i);
- layout_toolbar_add_default(lw, i);
+ layout_toolbar_clear(lw, static_cast<ToolbarType>(i));
+ layout_toolbar_add_default(lw, static_cast<ToolbarType>(i));
}
DEBUG_1("%s layout_actions_setup: marks", get_exec_time());
return TRUE;
}
- editor_read_desktop_file(layout_editors_desktop_files->data);
+ editor_read_desktop_file(static_cast<const gchar *>(layout_editors_desktop_files->data));
g_free(layout_editors_desktop_files->data);
layout_editors_desktop_files = g_list_delete_link(layout_editors_desktop_files, layout_editors_desktop_files);
if (strcmp(id, LAYOUT_ID_CURRENT) == 0)
{
if (current_lw) return current_lw;
- if (layout_window_list) return layout_window_list->data;
+ if (layout_window_list) return static_cast<LayoutWindow *>(layout_window_list->data);
return NULL;
}
{
LayoutLocation l;
- l = l1 & l2; /* get common compass direction */
- l = l1 - l; /* remove it */
+ l = static_cast<LayoutLocation>(l1 & l2); /* get common compass direction */
+ l = static_cast<LayoutLocation>(l1 - l); /* remove it */
if (layout_location_first(l))
{
}
else
{
- hints = 0;
+ hints = static_cast<GdkWindowHints>(0);
}
geometry.min_width = DEFAULT_MINIMAL_WINDOW_SIZE;
geometry.base_width = TOOLWINDOW_DEF_WIDTH;
geometry.base_height = TOOLWINDOW_DEF_HEIGHT;
gtk_window_set_geometry_hints(GTK_WINDOW(lw->tools), NULL, &geometry,
- GDK_HINT_MIN_SIZE | GDK_HINT_BASE_SIZE | hints);
+ static_cast<GdkWindowHints>(GDK_HINT_MIN_SIZE | GDK_HINT_BASE_SIZE | hints));
gtk_window_set_resizable(GTK_WINDOW(lw->tools), TRUE);
h = lw->h_pane = gtk_hpaned_new();
DEBUG_NAME(h);
- if (!layout_location_vertical(priority_location))
+ if (!layout_location_vertical(static_cast<LayoutLocation>(priority_location)))
{
GtkWidget *tmp;
gtk_box_pack_start(GTK_BOX(lw->group_box), v, TRUE, TRUE, 0);
- if (!layout_location_first(priority_location))
+ if (!layout_location_first(static_cast<LayoutLocation>(priority_location)))
{
gtk_paned_pack1(GTK_PANED(v), h, FALSE, TRUE);
gtk_paned_pack2(GTK_PANED(v), w3, TRUE, TRUE);
/* fix to have image pane visible when it is left and priority widget */
if (lw->options.main_window.hdivider_pos == -1 &&
w1 == image_sb &&
- !layout_location_vertical(priority_location) &&
- layout_location_first(priority_location))
+ !layout_location_vertical(static_cast<LayoutLocation>(priority_location)) &&
+ layout_location_first(static_cast<LayoutLocation>(priority_location)))
{
gtk_widget_set_size_request(image_sb, 200, -1);
}
layout_config_parse(lw->options.style, lw->options.order,
&lw->dir_location, &lw->file_location, &lw->image_location);
- if (lw->options.dir_view_type > DIRVIEW_LAST) lw->options.dir_view_type = 0;
- if (lw->options.file_view_type > FILEVIEW_LAST) lw->options.file_view_type = 0;
-
+ if (lw->options.dir_view_type > DIRVIEW_LAST) lw->options.dir_view_type = DIRVIEW_LIST;
+ if (lw->options.file_view_type > FILEVIEW_LAST) lw->options.file_view_type = FILEVIEW_LIST;
/* divider positions */
default_path = g_build_filename(get_rc_dir(), DEFAULT_WINDOW_LAYOUT, NULL);
}
else
{
- hint_mask = 0;
+ hint_mask = static_cast<GdkWindowHints>(0);
}
hint.min_width = 32;
hint.base_width = 0;
hint.base_height = 0;
gtk_window_set_geometry_hints(GTK_WINDOW(lw->window), NULL, &hint,
- GDK_HINT_MIN_SIZE | GDK_HINT_BASE_SIZE | hint_mask);
+ static_cast<GdkWindowHints>(GDK_HINT_MIN_SIZE | GDK_HINT_BASE_SIZE | hint_mask));
if (options->save_window_positions || isfile(default_path))
{
gtk_widget_show(lw->window);
layout_tools_hide(lw, lw->options.tools_hidden);
- image_osd_set(lw->image, lw->options.image_overlay.state);
+ image_osd_set(lw->image, static_cast<OsdShowFlags>(lw->options.image_overlay.state));
histogram = image_osd_get_histogram(lw->image);
histogram->histogram_channel = lw->options.image_overlay.histogram_channel;
void sig_handler_cb(int signo, siginfo_t *info, void *UNUSED(context))
{
gchar hex_char[16];
- gchar *signal_name = NULL;
+ const gchar *signal_name = NULL;
gint i = 0;
guint64 addr;
guint64 char_index;
{
/* Assume the address is 64-bit */
write(STDERR_FILENO, "0x", 2);
- addr = info->si_addr;
+ addr = reinterpret_cast<guint64>(info->si_addr);
for (i = 0; i < 16; i++)
{
{
command_line->tools_show = TRUE;
- remote_list = g_list_append(remote_list, "+t");
+ remote_list = g_list_append(remote_list, g_strdup("+t"));
}
else if (strcmp(cmd_line, "-t") == 0 ||
strcmp(cmd_line, "--without-tools") == 0)
{
command_line->tools_hide = TRUE;
- remote_list = g_list_append(remote_list, "-t");
+ remote_list = g_list_append(remote_list, g_strdup("-t"));
}
else if (strcmp(cmd_line, "-f") == 0 ||
strcmp(cmd_line, "--fullscreen") == 0)
geometry = g_strdup_printf("--geometry=%s", command_line->geometry);
remote_list = g_list_prepend(remote_list, geometry);
}
- remote_list = g_list_prepend(remote_list, "--new-window");
+ remote_list = g_list_prepend(remote_list, g_strdup("--new-window"));
}
g_free(app_lock);
}
tmp_lw = static_cast<LayoutWindow *>(list->data);
if (!g_str_has_prefix(tmp_lw->options.id, "lw"))
{
- save_layout(list->data);
+ save_layout(static_cast<_LayoutWindow *>(list->data));
}
list = list->next;
}
{
gchar *dirname;
- dirname = static_cast<const gchar *>(g_path_get_dirname(work->data));
+ dirname = g_path_get_dirname(static_cast<const gchar *>(work->data));
if (!path)
{
path = g_strdup(dirname);
work = work->next;
}
- if (cd->list) layout_image_set_collection(NULL, cd, cd->list->data);
+ if (cd->list) layout_image_set_collection(NULL, cd, static_cast<CollectInfo *>(cd->list->data));
/* mem leak, we never unref this collection when !startup_command_line_collection
* (the image view of the main window does not hold a ref to the collection)
GtkWidget *item;
item = gtk_menu_item_new_with_label(label);
- gtk_widget_add_accelerator(item, "activate", accel_group, accel_key, accel_mods, GTK_ACCEL_VISIBLE);
+ gtk_widget_add_accelerator(item, "activate", accel_group, accel_key, static_cast<GdkModifierType>(accel_mods), GTK_ACCEL_VISIBLE);
g_signal_connect(G_OBJECT(item), "activate", func, data);
gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
gtk_widget_show(item);
have_keywords = g_hash_table_lookup_extended(fd->modified_xmp, KEYWORD_KEY, NULL, &keywords);
have_comment = g_hash_table_lookup_extended(fd->modified_xmp, COMMENT_KEY, NULL, &comment_l);
- comment = (have_comment && comment_l) ? ((GList *)comment_l)->data : NULL;
+ comment = static_cast<const gchar *>((have_comment && comment_l) ? ((GList *)comment_l)->data : NULL);
if (!have_keywords || !have_comment) metadata_file_read(metadata_pathl, &orig_keywords, &orig_comment);
while (TRUE)
{
gchar *name = keyword_get_name(keyword_tree, &iter);
- if (strcmp(name, path->data) == 0) break;
+ if (strcmp(name, static_cast<const gchar *>(path->data)) == 0) break;
g_free(name);
if (!gtk_tree_model_iter_next(keyword_tree, &iter)) return FALSE;
}
void tree_path_free_wrapper(void *data, void *UNUSED(useradata))
{
- gtk_tree_path_free(data);
+ gtk_tree_path_free(static_cast<GtkTreePath *>(data));
}
/* Copied from the libarchive .repo. examples */
#endif
else
{
- data = static_cast<const gchar *>(g_strdup(g_hash_table_lookup(vars, name)));
+ data = g_strdup(static_cast<const gchar *>(g_hash_table_lookup(vars, static_cast<gconstpointer>(name))));
if (!data)
data = metadata_read_string(fd, name, METADATA_FORMATTED);
}
{
if (!value)
{
- g_hash_table_insert(vars, keyword, g_strdup(""));
+ g_hash_table_insert(vars, (gpointer)(keyword), static_cast<gpointer>(g_strdup("")));
return;
}
if (flags & OSDT_NO_DUP)
{
- g_hash_table_insert(vars, keyword, value);
+ g_hash_table_insert(vars, (gpointer)(keyword), (gpointer)value);
return;
}
else
{
- g_hash_table_insert(vars, keyword, g_strdup(value));
+ g_hash_table_insert(vars, (gpointer)(keyword), g_strdup(value));
}
if (flags & OSDT_FREE) g_free((gpointer) value);
gchar *buf;
buf = pan_date_value_string(pi_day->fd->date, PAN_DATE_LENGTH_WEEK);
- plabel = pan_item_text_new(pw, x, y, buf, PAN_TEXT_ATTR_BOLD | PAN_TEXT_ATTR_HEADING,
- PAN_TEXT_BORDER_SIZE,
+ plabel = pan_item_text_new(pw, x, y, buf, static_cast<PanTextAttrType>(PAN_TEXT_ATTR_BOLD | PAN_TEXT_ATTR_HEADING),
+ PAN_BORDER_3,
PAN_CAL_POPUP_TEXT_COLOR, 255);
pan_item_set_key(plabel, "day_bubble");
g_free(buf);
PAN_CAL_MONTH_BORDER_COLOR, PAN_CAL_MONTH_ALPHA);
buf = pan_date_value_string(dt, PAN_DATE_LENGTH_MONTH);
pi_text = pan_item_text_new(pw, x, y, buf,
- PAN_TEXT_ATTR_BOLD | PAN_TEXT_ATTR_HEADING,
- PAN_TEXT_BORDER_SIZE,
+ static_cast<PanTextAttrType>(PAN_TEXT_ATTR_BOLD | PAN_TEXT_ATTR_HEADING),
+ PAN_BORDER_3,
PAN_CAL_MONTH_TEXT_COLOR, 255);
g_free(buf);
pi_text->x = pi_month->x + (pi_month->width - pi_text->width) / 2;
buf = g_strdup_printf("( %d )", n);
pi = pan_item_text_new(pw, x, y, buf, PAN_TEXT_ATTR_NONE,
- PAN_TEXT_BORDER_SIZE,
+ PAN_BORDER_3,
PAN_CAL_DAY_TEXT_COLOR, 255);
g_free(buf);
}
buf = g_strdup_printf("%d", day);
- pi_day_number = pan_item_text_new(pw, x + 4, y + 4, buf, PAN_TEXT_ATTR_BOLD | PAN_TEXT_ATTR_HEADING,
- PAN_TEXT_BORDER_SIZE,
+ pi_day_number = pan_item_text_new(pw, x + 4, y + 4, buf, static_cast<PanTextAttrType>(PAN_TEXT_ATTR_BOLD | PAN_TEXT_ATTR_HEADING),
+ PAN_BORDER_3,
PAN_CAL_DAY_TEXT_COLOR, 255);
g_free(buf);
buf = date_get_abbreviated_day_name(day_of_week);
pan_item_text_new(pw, x + 4 + pi_day_number->width + 4, y + 4, buf, PAN_TEXT_ATTR_NONE,
- PAN_TEXT_BORDER_SIZE,
+ PAN_BORDER_3,
PAN_CAL_DAY_OF_WEEK_COLOR, 255);
g_free(buf);
pan_filter_fd_list(&f, pw->filter_ui->filter_elements, pw->filter_ui->filter_classes);
pi_box = pan_item_text_new(pw, x, y, dir_fd->path, PAN_TEXT_ATTR_NONE,
- PAN_TEXT_BORDER_SIZE,
+ PAN_BORDER_3,
PAN_TEXT_COLOR, 255);
y += pi_box->height;
*x = PAN_BOX_BORDER + ((*level) * MAX(PAN_BOX_BORDER, PAN_THUMB_GAP));
pi_box = pan_item_text_new(pw, *x, *y, dir_fd->path, PAN_TEXT_ATTR_NONE,
- PAN_TEXT_BORDER_SIZE,
+ PAN_BORDER_3,
PAN_TEXT_COLOR, 255);
*y += pi_box->height;
if (label)
{
item = pan_item_text_new(ta->pw, ta->x, ta->y, label,
- PAN_TEXT_ATTR_BOLD, 0,
+ PAN_TEXT_ATTR_BOLD, PAN_BORDER_NONE,
PAN_POPUP_TEXT_COLOR, 255);
pan_item_set_key(item, ta->key);
}
if (text)
{
item = pan_item_text_new(ta->pw, ta->x, ta->y, text,
- PAN_TEXT_ATTR_NONE, 0,
+ PAN_TEXT_ATTR_NONE, PAN_BORDER_NONE,
PAN_POPUP_TEXT_COLOR, 255);
pan_item_set_key(item, ta->key);
}
buf = pan_date_value_string(fd->date, PAN_DATE_LENGTH_MONTH);
pi = pan_item_text_new(pw, x, y, buf,
- PAN_TEXT_ATTR_BOLD | PAN_TEXT_ATTR_HEADING,
- PAN_TEXT_BORDER_SIZE,
+ static_cast<PanTextAttrType>(PAN_TEXT_ATTR_BOLD | PAN_TEXT_ATTR_HEADING),
+ PAN_BORDER_3,
PAN_TEXT_COLOR, 255);
g_free(buf);
y += pi->height;
buf = pan_date_value_string(fd->date, PAN_DATE_LENGTH_WEEK);
pi = pan_item_text_new(pw, x, y, buf, PAN_TEXT_ATTR_NONE,
- PAN_TEXT_BORDER_SIZE,
+ PAN_BORDER_3,
PAN_TEXT_COLOR, 255);
g_free(buf);
if (g_strcmp0(text, g_regex_escape_string(text, -1)))
{
// It's an actual regex, so compile
- element->kw_regex = g_regex_new(text, G_REGEX_ANCHORED | G_REGEX_OPTIMIZE, G_REGEX_MATCH_ANCHORED, NULL);
+ element->kw_regex = g_regex_new(text, static_cast<GRegexCompileFlags>(G_REGEX_ANCHORED | G_REGEX_OPTIMIZE), G_REGEX_MATCH_ANCHORED, NULL);
}
ui->filter_elements = g_list_append(ui->filter_elements, element);
{
gchar *keyword = static_cast<gchar *>(work->data);
work = work->next;
- if (g_regex_match(filter->kw_regex, keyword, 0x0, NULL))
+ if (g_regex_match(filter->kw_regex, keyword, G_REGEX_MATCH_DEFAULT, NULL))
{
if (found_kw) *found_kw = keyword;
return TRUE;
cache_loader_free(pw->cache_cl);
load_mask = CACHE_LOADER_NONE;
- if (pw->size > PAN_IMAGE_SIZE_THUMB_LARGE) load_mask |= CACHE_LOADER_DIMENSIONS;
- if (pw->exif_date_enable) load_mask |= CACHE_LOADER_DATE;
+ if (pw->size > PAN_IMAGE_SIZE_THUMB_LARGE) load_mask = static_cast<CacheDataType>(load_mask | CACHE_LOADER_DIMENSIONS);
+ if (pw->exif_date_enable) load_mask = static_cast<CacheDataType>(load_mask | CACHE_LOADER_DATE);
pw->cache_cl = cache_loader_new(pc->fd, load_mask,
pan_cache_step_done_cb, pw);
return (pw->cache_cl == NULL);
{
PanWindow *pw = (PanWindow *)data;
- pw->layout = gtk_combo_box_get_active(GTK_COMBO_BOX(combo));
+ pw->layout = static_cast<PanLayoutType>(gtk_combo_box_get_active(GTK_COMBO_BOX(combo)));
pan_layout_update(pw);
}
{
PanWindow *pw = (PanWindow *)data;
- pw->size = gtk_combo_box_get_active(GTK_COMBO_BOX(combo));
+ pw->size = static_cast<PanImageSize>(gtk_combo_box_get_active(GTK_COMBO_BOX(combo)));
pan_layout_update(pw);
}
G_CALLBACK(pan_window_image_scroll_notify_cb), pw);
gtk_table_attach(GTK_TABLE(table), pw->imd->widget, 0, 1, 0, 1,
- GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND, 0, 0);
+ static_cast<GtkAttachOptions>(GTK_FILL | GTK_EXPAND), static_cast<GtkAttachOptions>(GTK_FILL | GTK_EXPAND), 0, 0);
gtk_widget_show(GTK_WIDGET(pw->imd->widget));
pan_window_dnd_init(pw);
g_signal_connect(G_OBJECT(pw->scrollbar_h), "value_changed",
G_CALLBACK(pan_window_scrollbar_h_value_cb), pw);
gtk_table_attach(GTK_TABLE(table), pw->scrollbar_h, 0, 1, 1, 2,
- GTK_FILL | GTK_EXPAND, 0, 0, 0);
+ static_cast<GtkAttachOptions>(GTK_FILL | GTK_EXPAND), static_cast<GtkAttachOptions>(0), 0, 0);
gtk_widget_show(pw->scrollbar_h);
pw->scrollbar_v = gtk_vscrollbar_new(NULL);
g_signal_connect(G_OBJECT(pw->scrollbar_v), "value_changed",
G_CALLBACK(pan_window_scrollbar_v_value_cb), pw);
gtk_table_attach(GTK_TABLE(table), pw->scrollbar_v, 1, 2, 0, 1,
- 0, GTK_FILL | GTK_EXPAND, 0, 0);
+ static_cast<GtkAttachOptions>(0), static_cast<GtkAttachOptions>(GTK_FILL | GTK_EXPAND), 0, 0);
gtk_widget_show(pw->scrollbar_v);
/* find bar */
gtk_drag_source_set(widget, GDK_BUTTON2_MASK,
dnd_file_drag_types, dnd_file_drag_types_count,
- GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK);
+ static_cast<GdkDragAction>(GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK));
g_signal_connect(G_OBJECT(widget), "drag_data_get",
G_CALLBACK(pan_window_set_dnd_data), pw);
gtk_drag_dest_set(widget,
- GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_DROP,
+ static_cast<GtkDestDefaults>(GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_DROP),
dnd_file_drop_types, dnd_file_drop_types_count,
- GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK);
+ static_cast<GdkDragAction>(GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK));
g_signal_connect(G_OBJECT(widget), "drag_data_received",
G_CALLBACK(pan_window_get_dnd_data), pw);
}
static void pixbuf_renderer_class_init_wrapper(void *g_class, void *UNUSED(class_data))
{
- pixbuf_renderer_class_init(g_class);
+ pixbuf_renderer_class_init(static_cast<PixbufRendererClass *>(g_class));
}
static void pixbuf_renderer_init_wrapper(PixbufRenderer *pr, void *UNUSED(class_data))
};
pixbuf_renderer_type = g_type_register_static(GTK_TYPE_EVENT_BOX, "PixbufRenderer",
- &pixbuf_renderer_info, 0);
+ &pixbuf_renderer_info, G_TYPE_FLAG_NONE);
}
return pixbuf_renderer_type;
-1000.0,
1000.0,
PR_ZOOM_MIN,
- G_PARAM_READABLE | G_PARAM_WRITABLE));
+ static_cast<GParamFlags>(G_PARAM_READABLE | G_PARAM_WRITABLE)));
g_object_class_install_property(gobject_class,
PROP_ZOOM_MAX,
-1000.0,
1000.0,
PR_ZOOM_MIN,
- G_PARAM_READABLE | G_PARAM_WRITABLE));
+ static_cast<GParamFlags>(G_PARAM_READABLE | G_PARAM_WRITABLE)));
g_object_class_install_property(gobject_class,
PROP_ZOOM_QUALITY,
GDK_INTERP_NEAREST,
GDK_INTERP_BILINEAR,
GDK_INTERP_BILINEAR,
- G_PARAM_READABLE | G_PARAM_WRITABLE));
+ static_cast<GParamFlags>(G_PARAM_READABLE | G_PARAM_WRITABLE)));
g_object_class_install_property(gobject_class,
PROP_ZOOM_2PASS,
"2 pass zoom",
NULL,
TRUE,
- G_PARAM_READABLE | G_PARAM_WRITABLE));
+ static_cast<GParamFlags>(G_PARAM_READABLE | G_PARAM_WRITABLE)));
g_object_class_install_property(gobject_class,
PROP_ZOOM_EXPAND,
"Expand image in autozoom.",
NULL,
FALSE,
- G_PARAM_READABLE | G_PARAM_WRITABLE));
+ static_cast<GParamFlags>(G_PARAM_READABLE | G_PARAM_WRITABLE)));
g_object_class_install_property(gobject_class,
PROP_SCROLL_RESET,
g_param_spec_uint("scroll_reset",
PR_SCROLL_RESET_TOPLEFT,
PR_SCROLL_RESET_NOCHANGE,
PR_SCROLL_RESET_TOPLEFT,
- G_PARAM_READABLE | G_PARAM_WRITABLE));
+ static_cast<GParamFlags>(G_PARAM_READABLE | G_PARAM_WRITABLE)));
g_object_class_install_property(gobject_class,
PROP_DELAY_FLIP,
"Delay image update",
NULL,
FALSE,
- G_PARAM_READABLE | G_PARAM_WRITABLE));
+ static_cast<GParamFlags>(G_PARAM_READABLE | G_PARAM_WRITABLE)));
g_object_class_install_property(gobject_class,
PROP_LOADING,
"Image actively loading",
NULL,
FALSE,
- G_PARAM_READABLE | G_PARAM_WRITABLE));
+ static_cast<GParamFlags>(G_PARAM_READABLE | G_PARAM_WRITABLE)));
g_object_class_install_property(gobject_class,
PROP_COMPLETE,
"Image rendering complete",
NULL,
FALSE,
- G_PARAM_READABLE | G_PARAM_WRITABLE));
+ static_cast<GParamFlags>(G_PARAM_READABLE | G_PARAM_WRITABLE)));
g_object_class_install_property(gobject_class,
PROP_CACHE_SIZE_DISPLAY,
0,
128,
PR_CACHE_SIZE_DEFAULT,
- G_PARAM_READABLE | G_PARAM_WRITABLE));
+ static_cast<GParamFlags>(G_PARAM_READABLE | G_PARAM_WRITABLE)));
g_object_class_install_property(gobject_class,
PROP_CACHE_SIZE_TILES,
0,
256,
PR_CACHE_SIZE_DEFAULT,
- G_PARAM_READABLE | G_PARAM_WRITABLE));
+ static_cast<GParamFlags>(G_PARAM_READABLE | G_PARAM_WRITABLE)));
g_object_class_install_property(gobject_class,
PROP_WINDOW_FIT,
"Fit window to image size",
NULL,
FALSE,
- G_PARAM_READABLE | G_PARAM_WRITABLE));
+ static_cast<GParamFlags>(G_PARAM_READABLE | G_PARAM_WRITABLE)));
g_object_class_install_property(gobject_class,
PROP_WINDOW_LIMIT,
"Limit size of parent window",
NULL,
FALSE,
- G_PARAM_READABLE | G_PARAM_WRITABLE));
+ static_cast<GParamFlags>(G_PARAM_READABLE | G_PARAM_WRITABLE)));
g_object_class_install_property(gobject_class,
PROP_WINDOW_LIMIT_VALUE,
10,
150,
100,
- G_PARAM_READABLE | G_PARAM_WRITABLE));
+ static_cast<GParamFlags>(G_PARAM_READABLE | G_PARAM_WRITABLE)));
g_object_class_install_property(gobject_class,
PROP_AUTOFIT_LIMIT,
"Limit size of image when autofitting",
NULL,
FALSE,
- G_PARAM_READABLE | G_PARAM_WRITABLE));
+ static_cast<GParamFlags>(G_PARAM_READABLE | G_PARAM_WRITABLE)));
g_object_class_install_property(gobject_class,
PROP_AUTOFIT_LIMIT_VALUE,
10,
150,
100,
- G_PARAM_READABLE | G_PARAM_WRITABLE));
+ static_cast<GParamFlags>(G_PARAM_READABLE | G_PARAM_WRITABLE)));
g_object_class_install_property(gobject_class,
PROP_ENLARGEMENT_LIMIT_VALUE,
100,
999,
500,
- G_PARAM_READABLE | G_PARAM_WRITABLE));
+ static_cast<GParamFlags>(G_PARAM_READABLE | G_PARAM_WRITABLE)));
signals[SIGNAL_ZOOM] =
PixbufRenderer *pixbuf_renderer_new(void)
{
- return g_object_new(TYPE_PIXBUF_RENDERER, NULL);
+ return static_cast<PixbufRenderer *>(g_object_new(TYPE_PIXBUF_RENDERER, NULL));
}
static void pixbuf_renderer_set_property(GObject *object, guint prop_id,
pr->zoom_max = g_value_get_double(value);
break;
case PROP_ZOOM_QUALITY:
- pr->zoom_quality = g_value_get_uint(value);
+ pr->zoom_quality = static_cast<GdkInterpType>(g_value_get_uint(value));
break;
case PROP_ZOOM_2PASS:
pr->zoom_2pass = g_value_get_boolean(value);
pr->zoom_expand = g_value_get_boolean(value);
break;
case PROP_SCROLL_RESET:
- pr->scroll_reset = g_value_get_uint(value);
+ pr->scroll_reset = static_cast<PixbufRendererScrollResetType>(g_value_get_uint(value));
break;
case PROP_DELAY_FLIP:
pr->delay_flip = g_value_get_boolean(value);
}
else
{
- cursor = gdk_cursor_new(icon);
+ cursor = gdk_cursor_new(static_cast<GdkCursorType>(icon));
}
gdk_window_set_cursor(gtk_widget_get_window(widget), cursor);
pr->func_tile_data = user_data;
pr_stereo_temp_disable(pr, TRUE);
- pr_zoom_sync(pr, zoom, PR_ZOOM_FORCE | PR_ZOOM_NEW, 0, 0);
+ pr_zoom_sync(pr, zoom, static_cast<PrZoomFlags>(PR_ZOOM_FORCE | PR_ZOOM_NEW), 0, 0);
}
void pixbuf_renderer_set_tiles_size(PixbufRenderer *pr, gint width, gint height)
old_cy = pr->y_scroll + pr->vis_height / 2;
}
- if (force) clamp_flags |= PR_ZOOM_INVALIDATE;
+ if (force) clamp_flags = static_cast<PrZoomFlags>(clamp_flags | PR_ZOOM_INVALIDATE);
if (!pr_zoom_clamp(pr, zoom, clamp_flags)) return;
(void) pr_size_clamp(pr);
pr->drag_last_y = bevent->y;
pr->drag_moved = 0;
gdk_pointer_grab(gtk_widget_get_window(widget), FALSE,
- GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_RELEASE_MASK,
+ static_cast<GdkEventMask>(GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_RELEASE_MASK),
NULL, NULL, bevent->time);
gtk_grab_add(widget);
break;
G_CALLBACK(pr_leave_notify_cb), pr);
gtk_widget_set_events(GTK_WIDGET(pr), GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK |
- GDK_BUTTON_RELEASE_MASK | GDK_BUTTON_PRESS_MASK | GDK_SCROLL_MASK |
- GDK_LEAVE_NOTIFY_MASK);
+ static_cast<GdkEventMask>(GDK_BUTTON_RELEASE_MASK | GDK_BUTTON_PRESS_MASK | GDK_SCROLL_MASK |
+ GDK_LEAVE_NOTIFY_MASK));
g_signal_connect(G_OBJECT(pr), "drag_begin",
G_CALLBACK(pr_mouse_drag_cb), pr);
pr_pixbuf_size_sync(pr);
pr->renderer->update_pixbuf(pr->renderer, flags & PR_ZOOM_LAZY);
if (pr->renderer2) pr->renderer2->update_pixbuf(pr->renderer2, flags & PR_ZOOM_LAZY);
- pr_zoom_sync(pr, zoom, flags | PR_ZOOM_FORCE | PR_ZOOM_NEW, 0, 0);
+ pr_zoom_sync(pr, zoom, static_cast<PrZoomFlags>(flags | PR_ZOOM_FORCE | PR_ZOOM_NEW), 0, 0);
}
void pixbuf_renderer_set_pixbuf(PixbufRenderer *pr, GdkPixbuf *pixbuf, gdouble zoom)
pr_source_tile_unset(pr);
- pr_set_pixbuf(pr, pixbuf, zoom, 0);
+ pr_set_pixbuf(pr, pixbuf, zoom, PR_ZOOM_NONE);
pr_update_signal(pr);
}
pr->source_tiles = source->source_tiles;
source->source_tiles = NULL;
- pr_zoom_sync(pr, source->zoom, PR_ZOOM_FORCE | PR_ZOOM_NEW, 0, 0);
+ pr_zoom_sync(pr, source->zoom, static_cast<PrZoomFlags>(PR_ZOOM_FORCE | PR_ZOOM_NEW), 0, 0);
}
else
{
pr->source_tiles = source->source_tiles;
source->source_tiles = NULL;
- pr_zoom_sync(pr, source->zoom, PR_ZOOM_FORCE | PR_ZOOM_NEW, 0, 0);
+ pr_zoom_sync(pr, source->zoom, static_cast<PrZoomFlags>(PR_ZOOM_FORCE | PR_ZOOM_NEW), 0, 0);
}
else
{
if (redraw)
{
pr_size_sync(pr, pr->window_width, pr->window_height); /* recalculate new viewport */
- pr_zoom_sync(pr, pr->zoom, PR_ZOOM_FORCE | PR_ZOOM_NEW, 0, 0);
+ pr_zoom_sync(pr, pr->zoom, static_cast<PrZoomFlags>(PR_ZOOM_FORCE | PR_ZOOM_NEW), 0, 0);
}
}
pixbuf = gtk_icon_theme_load_icon(icon_theme,
icon, /* icon name */
64, /* size */
- 0, /* flags */
+ static_cast<GtkIconLookupFlags>(0), /* flags */
&error);
if (!pixbuf)
{
pixbuf = gtk_icon_theme_load_icon(icon_theme,
icon2, /* icon name */
64, /* size */
- 0, /* flags */
+ static_cast<GtkIconLookupFlags>(0), /* flags */
&error);
if (error)
{
g_signal_connect(G_OBJECT(combo), "changed",
G_CALLBACK(quality_menu_cb), option_c);
- gtk_table_attach(GTK_TABLE(table), combo, column + 1, column + 2, row, row + 1, GTK_SHRINK, 0, 0, 0);
+ gtk_table_attach(GTK_TABLE(table), combo, column + 1, column + 2, row, row + 1, GTK_SHRINK, static_cast<GtkAttachOptions>(0), 0, 0);
gtk_widget_show(combo);
}
g_signal_connect(G_OBJECT(combo), "changed",
G_CALLBACK(dnd_default_action_selection_menu_cb), option_c);
- gtk_table_attach(GTK_TABLE(table), combo, column + 1, column + 2, row, row + 1, GTK_SHRINK, 0, 0, 0);
+ gtk_table_attach(GTK_TABLE(table), combo, column + 1, column + 2, row, row + 1, GTK_SHRINK, static_cast<GtkAttachOptions>(0), 0, 0);
gtk_widget_show(combo);
}
g_signal_connect(G_OBJECT(combo), "changed",
G_CALLBACK(clipboard_selection_menu_cb), option_c);
- gtk_table_attach(GTK_TABLE(table), combo, column + 1, column + 2, row, row + 1, GTK_SHRINK, 0, 0, 0);
+ gtk_table_attach(GTK_TABLE(table), combo, column + 1, column + 2, row, row + 1, GTK_SHRINK, static_cast<GtkAttachOptions>(0), 0, 0);
gtk_widget_show(combo);
}
g_signal_connect(G_OBJECT(combo), "changed", G_CALLBACK(zoom_style_selection_menu_cb), option_c);
- gtk_table_attach(GTK_TABLE(table), combo, column + 1, column + 2, row, row + 1, GTK_SHRINK, 0, 0, 0);
+ gtk_table_attach(GTK_TABLE(table), combo, column + 1, column + 2, row, row + 1, GTK_SHRINK, static_cast<GtkAttachOptions>(0), 0, 0);
gtk_widget_show(combo);
}
g_signal_connect(G_OBJECT(combo), "changed",
G_CALLBACK(mouse_buttons_selection_menu_cb), option_c);
- gtk_table_attach(GTK_TABLE(table), combo, column + 1, column + 2, row, row + 1, GTK_SHRINK, 0, 0, 0);
+ gtk_table_attach(GTK_TABLE(table), combo, column + 1, column + 2, row, row + 1, GTK_SHRINK, static_cast<GtkAttachOptions>(0), 0, 0);
gtk_widget_show(combo);
}
g_signal_connect(G_OBJECT(combo), "changed",
G_CALLBACK(thumb_size_menu_cb), NULL);
- gtk_table_attach(GTK_TABLE(table), combo, column + 1, column + 2, row, row + 1, GTK_SHRINK, 0, 0, 0);
+ gtk_table_attach(GTK_TABLE(table), combo, column + 1, column + 2, row, row + 1, GTK_SHRINK, static_cast<GtkAttachOptions>(0), 0, 0);
gtk_widget_show(combo);
}
g_signal_connect(G_OBJECT(combo), "changed",
G_CALLBACK(stereo_mode_menu_cb), option_c);
- gtk_table_attach(GTK_TABLE(table), combo, column + 1, column + 2, row, row + 1, GTK_SHRINK, 0, 0, 0);
+ gtk_table_attach(GTK_TABLE(table), combo, column + 1, column + 2, row, row + 1, GTK_SHRINK, static_cast<GtkAttachOptions>(0), 0, 0);
gtk_widget_show(combo);
}
g_signal_connect(G_OBJECT(combo), "changed",
G_CALLBACK(video_menu_cb), option_c);
- gtk_table_attach(GTK_TABLE(table), combo, column + 1, column + 2, row, row + 1, GTK_SHRINK, 0, 0, 0);
+ gtk_table_attach(GTK_TABLE(table), combo, column + 1, column + 2, row, row + 1, GTK_SHRINK, static_cast<GtkAttachOptions>(0), 0, 0);
gtk_widget_show(combo);
}
{
if (strcmp(new_text, _(format_class_list[i])) == 0)
{
- fe->file_class = i;
+ fe->file_class = static_cast<FileFormatClass>(i);
break;
}
}
hex_value = 0x003F; // Unicode 'Question Mark'
}
str = g_string_append_unichar(str, (gunichar)hex_value);
- gtk_label_set_text(g_list_nth_data(list, 1), str->str);
+ gtk_label_set_text(static_cast<GtkLabel *>(g_list_nth_data(list, 1)), str->str);
g_strfreev(hex_code);
g_string_free(str, TRUE);
while (keywords)
{
gtk_text_buffer_get_end_iter(buffer, &iter);
- tmp = g_strconcat(keywords->data, "\n", NULL);
+ tmp = g_strconcat(static_cast<const gchar *>(keywords->data), "\n", NULL);
gtk_text_buffer_insert(buffer, &iter, tmp, -1);
g_free(tmp);
keywords = keywords->next;
found = FALSE;
while (work)
{
- if (g_strcmp0(work->data, kw_split) == 0)
+ if (g_strcmp0(static_cast<const gchar *>(work->data), kw_split) == 0)
{
found = TRUE;
break;
while (kwl)
{
gtk_text_buffer_get_end_iter (buffer, &iter);
- tmp = g_strconcat(kwl->data, "\n", NULL);
+ tmp = g_strconcat(static_cast<const gchar *>(kwl->data), "\n", NULL);
gtk_text_buffer_insert(buffer, &iter, tmp, -1);
kwl = kwl->next;
g_free(tmp);
g_signal_connect(G_OBJECT(combo), "changed",
G_CALLBACK(intent_menu_cb), option_c);
- gtk_table_attach(GTK_TABLE(table), combo, column + 1, column + 2, row, row + 1, GTK_SHRINK, 0, 0, 0);
+ gtk_table_attach(GTK_TABLE(table), combo, column + 1, column + 2, row, row + 1, GTK_SHRINK, static_cast<GtkAttachOptions>(0), 0, 0);
gtk_widget_show(combo);
}
#endif
gtk_entry_set_text(GTK_ENTRY(entry), options->color_profile.input_name[i]);
}
gtk_table_attach(GTK_TABLE(table), entry, 1, 2, i + 1, i + 2,
- GTK_FILL | GTK_EXPAND, 0, 0, 0);
+ static_cast<GtkAttachOptions>(GTK_FILL | GTK_EXPAND), static_cast<GtkAttachOptions>(0), 0, 0);
gtk_widget_show(entry);
color_profile_input_name_entry[i] = entry;
tab_completion_add_select_button(entry, _("Select color profile"), FALSE);
gtk_widget_set_size_request(entry, 160, -1);
gtk_table_attach(GTK_TABLE(table), tabcomp, 2, 3, i + 1, i + 2,
- GTK_FILL | GTK_EXPAND, 0, 0, 0);
+ static_cast<GtkAttachOptions>(GTK_FILL | GTK_EXPAND), static_cast<GtkAttachOptions>(0), 0, 0);
gtk_widget_show(tabcomp);
color_profile_input_file_entry[i] = entry;
}
#endif
gtk_table_attach(GTK_TABLE(table), tabcomp, 1, 2,
0, 1,
- GTK_FILL | GTK_EXPAND, 0, 0, 0);
+ static_cast<GtkAttachOptions>(GTK_FILL | GTK_EXPAND), static_cast<GtkAttachOptions>(0), 0, 0);
gtk_widget_show(tabcomp);
}
{
gpointer option;
- if (g_strcmp0(data, "Image text font") == 0)
+ if (g_strcmp0(static_cast<const gchar *>(data), "Image text font") == 0)
{
option = options->printer.image_font;
}
PangoFontDescription *font_desc;
dialog = gtk_font_chooser_dialog_new(static_cast<const gchar *>(data), GTK_WINDOW(gtk_widget_get_toplevel(widget)));
- gtk_font_chooser_set_font(GTK_FONT_CHOOSER(dialog), option);
+ gtk_font_chooser_set_font(GTK_FONT_CHOOSER(dialog), static_cast<const gchar *>(option));
if (gtk_dialog_run(GTK_DIALOG(dialog)) != GTK_RESPONSE_CANCEL)
{
hbox = pref_box_new(subgroup, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_BUTTON_GAP);
button = pref_button_new(NULL, GTK_STOCK_SELECT_FONT, _("Font"), FALSE,
- G_CALLBACK(print_set_font_cb), "Image text font");
+ G_CALLBACK(print_set_font_cb), (gpointer)"Image text font");
gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
gtk_widget_show(button);
hbox = pref_box_new(subgroup, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_BUTTON_GAP);
button = pref_button_new(NULL, GTK_STOCK_SELECT_FONT, _("Font"), FALSE,
- G_CALLBACK(print_set_font_cb), "Page text font");
+ G_CALLBACK(print_set_font_cb), (gpointer)"Page text font");
gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
gtk_widget_show(button);
parser_data->startup = startup;
options_parse_func_push(parser_data, options_parse_toplevel, NULL, NULL);
- context = g_markup_parse_context_new(&parser, 0, parser_data, NULL);
+ context = g_markup_parse_context_new(&parser, G_MARKUP_DEFAULT_FLAGS, parser_data, NULL);
if (g_markup_parse_context_parse(context, buf, size, NULL) == FALSE)
{
client->fd = fd;
channel = g_io_channel_unix_new(fd);
- client->channel_id = g_io_add_watch_full(channel, G_PRIORITY_DEFAULT, G_IO_IN | G_IO_HUP,
+ client->channel_id = g_io_add_watch_full(channel, G_PRIORITY_DEFAULT, static_cast<GIOCondition>(G_IO_IN | G_IO_HUP),
remote_server_client_cb, client, NULL);
g_io_channel_unref(channel);
layout_set_path(lw_id, pwd);
}
-static gboolean gr_close_window_cb()
+static gboolean gr_close_window_cb(gpointer UNUSED(data))
{
if (!layout_valid(&lw_id)) return FALSE;
static void gr_close_window(const gchar *UNUSED(text), GIOChannel *UNUSED(channel), gpointer UNUSED(data))
{
- g_idle_add(gr_close_window_cb, NULL);
+ g_idle_add((gr_close_window_cb), NULL);
}
static void gr_image_prev(const gchar *UNUSED(text), GIOChannel *UNUSED(channel), gpointer UNUSED(data))
file_data_unref(dir_fd);
}
-static void gr_get_selection(const gchar *UNUSED(text), GIOChannel *channel, gboolean UNUSED(data))
+static void gr_get_selection(const gchar *UNUSED(text), GIOChannel *channel, gpointer UNUSED(data))
{
if (!layout_valid(&lw_id)) return;
rt_tile_invalidate_all((RendererTiles *)renderer);
if (!lazy)
{
- renderer_redraw(renderer, 0, 0, pr->width, pr->height, TRUE, TILE_RENDER_ALL, TRUE, FALSE);
+ renderer_redraw(static_cast<_RendererTiles *>(renderer), 0, 0, pr->width, pr->height, TRUE, TILE_RENDER_ALL, TRUE, FALSE);
}
rt_border_clear(rt);
}
reg_exp_str = g_string_new("\\b(\?=.*:)");
reg_exp_str = g_string_append(reg_exp_str, key);
- reg_exp = g_regex_new(reg_exp_str->str, G_REGEX_CASELESS, 0, &error);
+ reg_exp = g_regex_new(reg_exp_str->str, G_REGEX_CASELESS, G_REGEX_MATCH_DEFAULT, &error);
if (error)
{
log_printf("Error: could not compile regular expression %s\n%s\n", reg_exp_str->str, error->message);
g_error_free(error);
error = NULL;
- reg_exp = g_regex_new("", 0, 0, NULL);
+ reg_exp = g_regex_new("", G_REGEX_DEFAULT, G_REGEX_MATCH_DEFAULT, NULL);
}
- ret = g_regex_match(reg_exp, normalized, 0, NULL);
+ ret = g_regex_match(reg_exp, normalized, G_REGEX_MATCH_DEFAULT, NULL);
if (sar->match_found == FALSE && ret == TRUE)
{
geometry.max_width = 1500;
geometry.min_height = 10;
geometry.max_height = 10;
- gtk_window_set_geometry_hints(GTK_WINDOW(sar->window), NULL, &geometry, GDK_HINT_MIN_SIZE | GDK_HINT_MAX_SIZE);
+ gtk_window_set_geometry_hints(GTK_WINDOW(sar->window), NULL, &geometry, static_cast<GdkWindowHints>(GDK_HINT_MIN_SIZE | GDK_HINT_MAX_SIZE));
gtk_window_set_resizable(GTK_WINDOW(sar->window), TRUE);
#define SEARCH_BUFFER_MATCH_MISS 1
#define SEARCH_BUFFER_FLUSH_SIZE 99
-#define FORMAT_CLASS_BROKEN FILE_FORMAT_CLASSES + 1
+#define FORMAT_CLASS_BROKEN static_cast<FileFormatClass>(FILE_FORMAT_CLASSES + 1)
typedef enum {
SEARCH_MATCH_NONE,
{GDK_SHIFT_MASK, GDK_KEY_Delete, N_("Delete")},
{static_cast<GdkModifierType>(0), GDK_KEY_Delete, N_("Remove")},
{GDK_CONTROL_MASK, 'A', N_("Select all")},
- {GDK_CONTROL_MASK + GDK_SHIFT_MASK, 'A', N_("Select none")},
+ {static_cast<GdkModifierType>(GDK_CONTROL_MASK + GDK_SHIFT_MASK), 'A', N_("Select none")},
{GDK_CONTROL_MASK, GDK_KEY_Delete, N_("Clear")},
{GDK_CONTROL_MASK, 'T', N_("Toggle thumbs")},
{GDK_CONTROL_MASK, 'W', N_("Close window")},
static void search_dnd_init(SearchData *sd)
{
- gtk_drag_source_set(sd->result_view, GDK_BUTTON1_MASK | GDK_BUTTON2_MASK,
+ gtk_drag_source_set(sd->result_view, static_cast<GdkModifierType>(GDK_BUTTON1_MASK | GDK_BUTTON2_MASK),
result_drag_types, n_result_drag_types,
- GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK);
+ static_cast<GdkDragAction>(GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK));
g_signal_connect(G_OBJECT(sd->result_view), "drag_data_get",
G_CALLBACK(search_dnd_data_set), sd);
g_signal_connect(G_OBJECT(sd->result_view), "drag_begin",
}
if (sd->search_name_match_case)
{
- match = g_regex_match(sd->search_name_regex, fd_name_or_path, 0, NULL);
+ match = g_regex_match(sd->search_name_regex, fd_name_or_path, G_REGEX_MATCH_DEFAULT, NULL);
}
else
{
/* sd->search_name is converted in search_start() */
gchar *haystack = g_utf8_strdown(fd_name_or_path, -1);
- match = g_regex_match(sd->search_name_regex, haystack, 0, NULL);
+ match = g_regex_match(sd->search_name_regex, haystack, G_REGEX_MATCH_DEFAULT, NULL);
g_free(haystack);
}
}
if (sd->match_comment == SEARCH_MATCH_CONTAINS)
{
- match = g_regex_match(sd->search_comment_regex, comment, 0, NULL);
+ match = g_regex_match(sd->search_comment_regex, comment, G_REGEX_MATCH_DEFAULT, NULL);
}
else if (sd->match_comment == SEARCH_MATCH_NONE)
{
- match = !g_regex_match(sd->search_comment_regex, comment, 0, NULL);
+ match = !g_regex_match(sd->search_comment_regex, comment, G_REGEX_MATCH_DEFAULT, NULL);
}
g_free(comment);
}
g_regex_unref(sd->search_name_regex);
}
- sd->search_name_regex = g_regex_new(sd->search_name, 0, 0, &error);
+ sd->search_name_regex = g_regex_new(sd->search_name, G_REGEX_DEFAULT, G_REGEX_MATCH_DEFAULT, &error);
if (error)
{
log_printf("Error: could not compile regular expression %s\n%s\n", sd->search_name, error->message);
g_error_free(error);
error = NULL;
- sd->search_name_regex = g_regex_new("", 0, 0, NULL);
+ sd->search_name_regex = g_regex_new("", G_REGEX_DEFAULT, G_REGEX_MATCH_DEFAULT, NULL);
}
if (!sd->search_comment_match_case)
g_regex_unref(sd->search_comment_regex);
}
- sd->search_comment_regex = g_regex_new(sd->search_comment, 0, 0, &error);
+ sd->search_comment_regex = g_regex_new(sd->search_comment,G_REGEX_DEFAULT, G_REGEX_MATCH_DEFAULT, &error);
if (error)
{
log_printf("Error: could not compile regular expression %s\n%s\n", sd->search_comment, error->message);
g_error_free(error);
error = NULL;
- sd->search_comment_regex = g_regex_new("", 0, 0, NULL);
+ sd->search_comment_regex = g_regex_new("", G_REGEX_DEFAULT, G_REGEX_MATCH_DEFAULT, NULL);
}
sd->search_count = 0;
geometry.base_width = DEF_SEARCH_WIDTH;
geometry.base_height = DEF_SEARCH_HEIGHT;
gtk_window_set_geometry_hints(GTK_WINDOW(sd->window), NULL, &geometry,
- GDK_HINT_MIN_SIZE | GDK_HINT_BASE_SIZE);
+ static_cast<GdkWindowHints>(GDK_HINT_MIN_SIZE | GDK_HINT_BASE_SIZE));
if (lw && options->save_window_positions)
{
if (ss->filelist)
{
- image_prebuffer_set(ss->imd, g_list_nth_data(ss->filelist, r));
+ image_prebuffer_set(ss->imd, static_cast<FileData *>(g_list_nth_data(ss->filelist, r)));
}
else if (ss->cd)
{
static void toolbar_item_delete_cb(GtkWidget *UNUSED(widget), gpointer data)
{
- gtk_widget_destroy(data);
+ gtk_widget_destroy(GTK_WIDGET(data));
}
static void toolbar_menu_popup(GtkWidget *widget)
{
if (!tbbd) return;
- g_free(tbbd->name);
- g_free(tbbd->stock_id);
- g_free(tbbd);
+ g_free((gpointer)tbbd->name);
+ g_free((gpointer)tbbd->stock_id);
+ g_free((gpointer)tbbd);
}
static void toolbar_button_free(GtkWidget *widget)
static void bookmark_menu_up_cb(GtkWidget *UNUSED(widget), gpointer data)
{
- bookmark_menu_move(data, -1);
+ bookmark_menu_move(static_cast<BookMarkData *>(data), -1);
}
static void bookmark_menu_down_cb(GtkWidget *UNUSED(widget), gpointer data)
{
- bookmark_menu_move(data, 1);
+ bookmark_menu_move(static_cast<BookMarkData *>(data), 1);
}
static void bookmark_menu_remove_cb(GtkWidget *UNUSED(widget), gpointer data)
gtk_drag_source_set(b->button, GDK_BUTTON1_MASK,
bookmark_drag_types, bookmark_drag_types_n,
- GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK);
+ static_cast<GdkDragAction>(GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK));
g_signal_connect(G_OBJECT(b->button), "drag_data_get",
G_CALLBACK(bookmark_drag_set_data), bm);
g_signal_connect(G_OBJECT(b->button), "drag_begin",
bm->widget = scrolled;
gtk_drag_dest_set(scrolled,
- GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_DROP,
+ static_cast<GtkDestDefaults>(GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_DROP),
bookmark_drop_types, bookmark_drop_types_n,
- GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK);
+ static_cast<GdkDragAction>(GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK));
g_signal_connect(G_OBJECT(scrolled), "drag_data_received",
G_CALLBACK(bookmark_dnd_get_data), bm);
}
gtk_table_attach(GTK_TABLE(table), shell, column, column + 1, row, row + 1,
- GTK_EXPAND | GTK_FILL, 0, 0, 0);
+ static_cast<GtkAttachOptions>(GTK_EXPAND | GTK_FILL), static_cast<GtkAttachOptions>(0), 0, 0);
gtk_widget_show(shell);
align = gtk_alignment_new(alignment, 0.50, 0.0, 0.0);
gtk_table_attach(GTK_TABLE(table), align, column, column + 1, row, row + 1,
- GTK_FILL, 0, 0, 0);
+ GTK_FILL, static_cast<GtkAttachOptions>(0), 0, 0);
gtk_widget_show(align);
label = gtk_label_new(text);
gtk_container_add(GTK_CONTAINER(align), label);
button = pref_button_new(NULL, stock_id, text, hide_stock_text, func, data);
gtk_table_attach(GTK_TABLE(table), button, column, column + 1, row, row + 1,
- GTK_FILL, 0, 0, 0);
+ GTK_FILL, static_cast<GtkAttachOptions>(0), 0, 0);
gtk_widget_show(button);
return button;
}
gtk_table_attach(GTK_TABLE(table), box, column, column + 1, row, row + 1,
- GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
+ static_cast<GtkAttachOptions>(GTK_EXPAND | GTK_FILL), static_cast<GtkAttachOptions>(GTK_EXPAND | GTK_FILL), 0, 0);
gtk_widget_show(box);
return spin;
gtk_widget_grab_focus(ds->calendar);
gdk_pointer_grab(gtk_widget_get_window(ds->window), TRUE,
- GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_BUTTON_MOTION_MASK,
+ static_cast<GdkEventMask>(GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_BUTTON_MOTION_MASK),
NULL, NULL, GDK_CURRENT_TIME);
gdk_keyboard_grab(gtk_widget_get_window(ds->window), TRUE, GDK_CURRENT_TIME);
gtk_grab_add(ds->window);
GtkTreeIter iter;
gchar *filepath;
- if (strcmp(list->data, ".") == 0)
+ if (strcmp(static_cast<const gchar *>(list->data), ".") == 0)
{
filepath = g_strdup(path);
}
- else if (strcmp(list->data, "..") == 0)
+ else if (strcmp(static_cast<const gchar *>(list->data), "..") == 0)
{
gchar *p;
filepath = g_strdup(path);
{
gtk_tree_view_enable_model_drag_source(GTK_TREE_VIEW(dd->d_view), GDK_BUTTON1_MASK,
dest_drag_types, dest_drag_types_n,
- GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK | GDK_ACTION_ASK);
+ static_cast<GdkDragAction>(GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK | GDK_ACTION_ASK));
g_signal_connect(G_OBJECT(dd->d_view), "drag_data_get",
G_CALLBACK(dest_dnd_set_data), dd);
{
gtk_tree_view_enable_model_drag_source(GTK_TREE_VIEW(dd->f_view), GDK_BUTTON1_MASK,
dest_drag_types, dest_drag_types_n,
- GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK | GDK_ACTION_ASK);
+ static_cast<GdkDragAction>(GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK | GDK_ACTION_ASK));
g_signal_connect(G_OBJECT(dd->f_view), "drag_data_get",
G_CALLBACK(dest_dnd_set_data), dd);
}
paned = gtk_hpaned_new();
DEBUG_NAME(paned);
gtk_table_attach(GTK_TABLE(table), paned, 0, 3, 1, 2,
- GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
+ static_cast<GtkAttachOptions>(GTK_EXPAND | GTK_FILL), static_cast<GtkAttachOptions>(GTK_EXPAND | GTK_FILL), 0, 0);
gtk_widget_show(paned);
gtk_paned_add1(GTK_PANED(paned), hbox2);
}
{
paned = NULL;
gtk_table_attach(GTK_TABLE(table), hbox2, 0, 1, 1, 2,
- GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
+ static_cast<GtkAttachOptions>(GTK_EXPAND | GTK_FILL), static_cast<GtkAttachOptions>(GTK_EXPAND | GTK_FILL), 0, 0);
}
gtk_widget_show(hbox2);
else
{
gtk_table_attach(GTK_TABLE(table), scrolled, 2, 3, 1, 2,
- GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
+ static_cast<GtkAttachOptions>(GTK_EXPAND | GTK_FILL), static_cast<GtkAttachOptions>(GTK_EXPAND | GTK_FILL), 0, 0);
}
gtk_widget_show(scrolled);
gtk_widget_grab_focus(ted->entry);
gtk_grab_add(ted->window);
gdk_pointer_grab(gtk_widget_get_window(ted->window), TRUE,
- GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_BUTTON_MOTION_MASK,
+ static_cast<GdkEventMask>(GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_BUTTON_MOTION_MASK),
NULL, NULL, GDK_CURRENT_TIME);
gdk_keyboard_grab(gtk_widget_get_window(ted->window), TRUE, GDK_CURRENT_TIME);
gboolean last = !ud->flist->next;
EditorFlags status = EDITOR_ERROR_STATUS;
- if (ud->with_sidecars ? file_data_sc_perform_ci(single_entry->data)
- : file_data_perform_ci(single_entry->data))
- status = 0; /* OK */
+ if (ud->with_sidecars ? file_data_sc_perform_ci(static_cast<FileData *>(single_entry->data))
+ : file_data_perform_ci(static_cast<FileData *>(single_entry->data)))
+ status = static_cast<EditorFlags>(0); /* OK */
ret = file_util_perform_ci_cb(GINT_TO_POINTER(!last), status, single_entry, ud);
g_list_free(single_entry);
pref_table_label(table, 0, 1, _("New name:"), 1.0);
ud->rename_entry = gtk_entry_new();
- gtk_table_attach(GTK_TABLE(table), ud->rename_entry, 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, 0, 0, 0);
+ gtk_table_attach(GTK_TABLE(table), ud->rename_entry, 1, 2, 1, 2, static_cast<GtkAttachOptions>(GTK_EXPAND | GTK_FILL), static_cast<GtkAttachOptions>(0), 0, 0);
generic_dialog_attach_default(GENERIC_DIALOG(ud->gd), ud->rename_entry);
gtk_widget_grab_focus(ud->rename_entry);
static void file_util_details_dialog_close_cb(GtkWidget *UNUSED(widget), gpointer data)
{
- gtk_widget_destroy(data);
+ gtk_widget_destroy(GTK_WIDGET(data));
}
static void vdtree_busy_pop(ViewDir *vd)
{
- if (VDTREE(vd)->busy_ref == 1) set_cursor(vd->view, -1);
+ if (VDTREE(vd)->busy_ref == 1) set_cursor(vd->view, GDK_CURSOR_IS_PIXMAP);
if (VDTREE(vd)->busy_ref > 0) VDTREE(vd)->busy_ref--;
}
{
ViewDir *vd = static_cast<ViewDir *>(data);
- DirViewType new_type = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(widget), "menu_item_radio_data"));
+ DirViewType new_type = static_cast<DirViewType>(GPOINTER_TO_INT((g_object_get_data(G_OBJECT(widget), "menu_item_radio_data"))));
layout_views_set(vd->layout, new_type, vd->layout->options.file_view_type);
}
if (enable)
{
gtk_drag_dest_set(vd->view,
- GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_DROP,
+ static_cast<GtkDestDefaults>(GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_DROP),
vd_dnd_drop_types, vd_dnd_drop_types_count,
- GDK_ACTION_MOVE | GDK_ACTION_COPY);
+ static_cast<GdkDragAction>(GDK_ACTION_MOVE | GDK_ACTION_COPY));
}
else
{
if (gtk_drag_get_source_widget(context) == vd->view)
{
/* from same window */
- gdk_drag_status(context, 0, time);
+ gdk_drag_status(context, GDK_ACTION_DEFAULT, time);
return TRUE;
}
else
void vd_dnd_init(ViewDir *vd)
{
- gtk_drag_source_set(vd->view, GDK_BUTTON1_MASK | GDK_BUTTON2_MASK,
+ gtk_drag_source_set(vd->view, static_cast<GdkModifierType>(GDK_BUTTON1_MASK | GDK_BUTTON2_MASK),
dnd_file_drag_types, dnd_file_drag_types_count,
- GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_ASK);
+ static_cast<GdkDragAction>(GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_ASK));
g_signal_connect(G_OBJECT(vd->view), "drag_data_get",
G_CALLBACK(vd_dnd_get), vd);
g_signal_connect(G_OBJECT(vd->view), "drag_begin",
if (iter) *iter = p;
- return g_list_nth_data(list, col);
+ return static_cast<FileData *>(g_list_nth_data(list, col));
}
return NULL;
if (list)
{
if (iter) *iter = row;
- return g_list_nth_data(list, n);
+ return static_cast<FileData *>(g_list_nth_data(list, n));
}
}
void vficon_dnd_init(ViewFile *vf)
{
- gtk_drag_source_set(vf->listview, GDK_BUTTON1_MASK | GDK_BUTTON2_MASK,
+ gtk_drag_source_set(vf->listview, static_cast<GdkModifierType>(GDK_BUTTON1_MASK | GDK_BUTTON2_MASK),
dnd_file_drag_types, dnd_file_drag_types_count,
- GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK);
+ static_cast<GdkDragAction>(GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK));
gtk_drag_dest_set(vf->listview, GTK_DEST_DEFAULT_ALL,
dnd_file_drag_types, dnd_file_drag_types_count,
- GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK);
+ static_cast<GdkDragAction>(GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK));
g_signal_connect(G_OBJECT(vf->listview), "drag_data_get",
G_CALLBACK(vficon_dnd_get), vf);
{
if (!fd) return;
- vficon_selection_set(vf, fd, fd->selected | mask, iter);
+ vficon_selection_set(vf, fd, static_cast<SelectionType>(fd->selected | mask), iter);
}
static void vficon_selection_remove(ViewFile *vf, FileData *fd, SelectionType mask, GtkTreeIter *iter)
{
if (!fd) return;
- vficon_selection_set(vf, fd, fd->selected & ~mask, iter);
+ vficon_selection_set(vf, fd, static_cast<SelectionType>(fd->selected & ~mask), iter);
}
void vficon_marks_set(ViewFile *vf, gint UNUSED(enable))
GdkColor color_bg;
GtkStyle *style;
gchar *name_sidecars = NULL;
- gchar *link;
+ const gchar *link;
GtkStateType state = GTK_STATE_NORMAL;
g_assert(fd->magick == FD_MAGICK);
}
else
{
- gchar *disabled_grouping = fd->disable_grouping ? _(" [NO GROUPING]") : "";
+ const gchar *disabled_grouping = fd->disable_grouping ? _(" [NO GROUPING]") : "";
if (options->show_star_rating && VFICON(vf)->show_text)
{
name_sidecars = g_strdup_printf("%s%s%s\n%s", link, fd->name, disabled_grouping, star_rating);
G_CALLBACK(vficon_sized_cb), vf);
gtk_widget_set_events(vf->listview, GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK |
- GDK_BUTTON_PRESS_MASK | GDK_LEAVE_NOTIFY_MASK);
+ static_cast<GdkEventMask>(GDK_BUTTON_PRESS_MASK | GDK_LEAVE_NOTIFY_MASK));
g_signal_connect(G_OBJECT(vf->listview),"motion_notify_event",
G_CALLBACK(vficon_motion_cb), vf);
void vflist_dnd_init(ViewFile *vf)
{
- gtk_drag_source_set(vf->listview, GDK_BUTTON1_MASK | GDK_BUTTON2_MASK,
+ gtk_drag_source_set(vf->listview, static_cast<GdkModifierType>(GDK_BUTTON1_MASK | GDK_BUTTON2_MASK),
dnd_file_drag_types, dnd_file_drag_types_count,
- GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK);
+ static_cast<GdkDragAction>(GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK));
gtk_drag_dest_set(vf->listview, GTK_DEST_DEFAULT_ALL,
dnd_file_drag_types, dnd_file_drag_types_count,
- GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK);
+ static_cast<GdkDragAction>(GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK));
g_signal_connect(G_OBJECT(vf->listview), "drag_data_get",
G_CALLBACK(vflist_dnd_get), vf);
gchar *sidecars = NULL;
gchar *name;
const gchar *time = text_from_time(fd->date);
- gchar *link = islink(fd->path) ? GQ_LINK_STR : "";
+ const gchar *link = islink(fd->path) ? GQ_LINK_STR : "";
const gchar *disabled_grouping;
gchar *formatted;
gchar *formatted_with_stars;
{
gint i;
gint num_total = num_prepended + num_ordered;
- gint *new_order = g_malloc(num_total * sizeof(gint));
+ gint *new_order = static_cast<gint *>(g_malloc(num_total * sizeof(gint)));
for (i = 0; i < num_total; i++)
{
vf->list = filelist_sort(vf->list, vf->sort_method, vf->sort_ascend);
- new_order = g_malloc(i * sizeof(gint));
+ new_order = static_cast<gint *>(g_malloc(i * sizeof(gint)));
work = vf->list;
i = 0;
if (selected && vflist_selection_count(vf, NULL) == 0)
{
/* all selected files disappeared */
- vflist_select_closest(vf, selected->data);
+ vflist_select_closest(vf, static_cast<FileData *>(selected->data));
}
filelist_free(selected);
FileData *vf_index_get_data(ViewFile *vf, gint row)
{
- return g_list_nth_data(vf->list, row);
+ return static_cast<FileData *>(g_list_nth_data(vf->list, row));
}
gint vf_index_by_fd(ViewFile *vf, FileData *fd)
static void vf_pop_menu_toggle_view_type_cb(GtkWidget *widget, gpointer data)
{
ViewFile *vf = (ViewFile *)data;
- FileViewType new_type = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(widget), "menu_item_radio_data"));
+ FileViewType new_type = static_cast<FileViewType>(GPOINTER_TO_INT(g_object_get_data(G_OBJECT(widget), "menu_item_radio_data")));
if (!vf->layout) return;
layout_views_set(vf->layout, vf->layout->options.dir_view_type, new_type);
if (!gtk_widget_get_visible(vf->file_filter.combo))
{
- return g_regex_new("", 0, 0, NULL);
+ return g_regex_new("", G_REGEX_DEFAULT, G_REGEX_MATCH_DEFAULT, NULL);
}
file_filter_text = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(vf->file_filter.combo));
if (file_filter_text[0] != '\0')
{
- ret = g_regex_new(file_filter_text, vf->file_filter.case_sensitive ? 0 : G_REGEX_CASELESS, 0, &error);
+ ret = g_regex_new(file_filter_text, vf->file_filter.case_sensitive ? G_REGEX_DEFAULT : G_REGEX_CASELESS, G_REGEX_MATCH_DEFAULT, &error);
if (error)
{
log_printf("Error: could not compile regular expression %s\n%s\n", file_filter_text, error->message);
g_error_free(error);
error = NULL;
- ret = g_regex_new("", 0, 0, NULL);
+ ret = g_regex_new("", G_REGEX_DEFAULT, G_REGEX_MATCH_DEFAULT, NULL);
}
g_free(file_filter_text);
}
else
{
- ret = g_regex_new("", 0, 0, NULL);
+ ret = g_regex_new("", G_REGEX_DEFAULT, G_REGEX_MATCH_DEFAULT, NULL);
}
return ret;
ViewFile *vf = (ViewFile *)data;
gboolean refresh;
- NotifyType interested = NOTIFY_CHANGE | NOTIFY_REREAD | NOTIFY_GROUPING;
- if (vf->marks_enabled) interested |= NOTIFY_MARKS | NOTIFY_METADATA;
+ NotifyType interested = static_cast<NotifyType>(NOTIFY_CHANGE | NOTIFY_REREAD | NOTIFY_GROUPING);
+ if (vf->marks_enabled) interested = static_cast<NotifyType>(interested | NOTIFY_MARKS | NOTIFY_METADATA);
/** @FIXME NOTIFY_METADATA should be checked by the keyword-to-mark functions and converted to NOTIFY_MARKS only if there was a change */
if (!(type & interested) || vf->refresh_idle_id || !vf->dir_fd) return;
static void help_browser_run(const gchar *path)
{
- gchar *name = options->helpers.html_browser.command_name;
- gchar *cmd = options->helpers.html_browser.command_line;
+ const gchar *name = options->helpers.html_browser.command_name;
+ const gchar *cmd = options->helpers.html_browser.command_line;
gchar *result = NULL;
gint i;
}
}
- char *const str = malloc((size_t)(strLength + 1));
+ char *const str = static_cast<char *>(malloc((size_t)(strLength + 1)));
if(str) {
#if defined(_MSC_VER)
uint32_t index = UINT32_C(7);
- library->fieldNames = malloc(library->numFields * sizeof *library->fieldNames);
+ library->fieldNames = static_cast<char **>(malloc(library->numFields * sizeof *library->fieldNames));
if (!library->fieldNames) {
return -1;
}
size_t listLength = 2 * 100;
size_t listIndex = 0;
- int32_t* list = malloc(sizeof(int32_t) * listLength);
+ int32_t* list = static_cast<int32_t *>(malloc(sizeof(int32_t) * listLength));
if(!list) {
goto fail;
}
goto fail;
}
- list = realloc(list, sizeof(int32_t) * listLength);
+ list = static_cast<int32_t *>(realloc(list, sizeof(int32_t) * listLength));
if(!list) {
goto fail;
}
goto fail;
}
- flData = malloc(sizeof(float) * length);
+ flData = static_cast<float *>(malloc(sizeof(float) * length));
if(!flData) {
goto fail;
}
ZoneDetect *ZDOpenDatabaseFromMemory(void* buffer, size_t length)
{
- ZoneDetect *const library = malloc(sizeof *library);
+ ZoneDetect *const library = static_cast<ZoneDetect *>(malloc(sizeof *library));
if(library) {
memset(library, 0, sizeof(*library));
goto fail;
}
- library->mapping = buffer;
+ library->mapping = static_cast<uint8_t *>(buffer);
/* Parse the header */
if(ZDParseHeader(library)) {
ZoneDetect *ZDOpenDatabase(const char *path)
{
- ZoneDetect *const library = malloc(sizeof *library);
+ ZoneDetect *const library = static_cast<ZoneDetect *>(malloc(sizeof *library));
if(library) {
memset(library, 0, sizeof(*library));
}
lseek(library->fd, 0, SEEK_SET);
- library->mapping = mmap(NULL, (size_t)library->length, PROT_READ, MAP_PRIVATE | MAP_FILE, library->fd, 0);
+ library->mapping = static_cast<uint8_t *>(mmap(NULL, (size_t)library->length, PROT_READ, MAP_PRIVATE | MAP_FILE, library->fd, 0));
if(library->mapping == MAP_FAILED) {
zdError(ZD_E_DB_MMAP, errno);
goto fail;
uint32_t metadataIndex = 0;
uint32_t polygonIndex = 0;
- ZoneDetectResult *results = malloc(sizeof *results);
+ ZoneDetectResult *results = static_cast<ZoneDetectResult *>(malloc(sizeof *results));
if(!results) {
return NULL;
}
if(lookupResult == ZD_LOOKUP_PARSE_ERROR) {
break;
} else if(lookupResult != ZD_LOOKUP_NOT_IN_ZONE) {
- ZoneDetectResult *const newResults = realloc(results, sizeof *newResults * (numResults + 2));
+ ZoneDetectResult *const newResults = static_cast<ZoneDetectResult *>(realloc(results, sizeof *newResults * (numResults + 2)));
if(newResults) {
results = newResults;
/* Lookup metadata */
for(i = 0; i < numResults; i++) {
uint32_t tmpIndex = library->metadataOffset + results[i].metaId;
- results[i].data = malloc(library->numFields * sizeof *results[i].data);
+ results[i].data = static_cast<char **>(malloc(library->numFields * sizeof *results[i].data));
if(results[i].data) {
size_t j;
for(j = 0; j < library->numFields; j++) {