#include <stdlib.h>
#include <string.h>
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>

#include "../include/disk.h"

#include "guiutils.h"
#include "toolbar.h"

#include "cfg.h"
#include "edv_types.h"
#include "edv_list_cb.h"
#include "edv_obj.h"
#include "edv_mime_type.h"
#include "edv_device.h"
#include "edv_status_bar.h"
#include "obj_op_dlg.h"
#include "imbr.h"
#include "imbr_cb.h"
#include "imbr_op_cb.h"
#include "imbr_tlist.h"
#include "imbr_dnd.h"
#include "endeavour2.h"
#include "edv_cb.h"
#include "edv_open_to_menu.h"
#include "edv_utils.h"
#include "edv_utils_gtk.h"
#include "edv_cfg_list.h"
#include "config.h"

#include "images/icon_hsep_20x20.xpm"
#include "images/icon_copy_20x20.xpm"
#include "images/icon_paste_20x20.xpm"
#include "images/icon_new_20x20.xpm"
#include "images/icon_save_20x20.xpm"
#include "images/icon_trace_20x20.xpm"
#include "images/icon_run_20x20.xpm"
#include "images/icon_terminal_20x20.xpm"
#include "images/icon_close_20x20.xpm"
#include "images/icon_exit_20x20.xpm"
#include "images/icon_mount_20x20.xpm"
#include "images/icon_unmount_20x20.xpm"
#include "images/icon_eject_20x20.xpm"
#include "images/icon_move_file_20x20.xpm"
#include "images/icon_copy_file_20x20.xpm"
#include "images/icon_rename_20x20.xpm"
#include "images/icon_cancel_20x20.xpm"
#include "images/icon_chmod_20x20.xpm"
#include "images/icon_owned_20x20.xpm"
#include "images/icon_time_stamp_20x20.xpm"
#include "images/icon_properties2_20x20.xpm"
#include "images/icon_stop_20x20.xpm"
#include "images/icon_monitor_20x20.xpm"
#include "images/icon_select_all_20x20.xpm"
#include "images/icon_unselect_all_20x20.xpm"
#include "images/icon_invert_selection_20x20.xpm"
#include "images/icon_reload_20x20.xpm"
#include "images/icon_download_file_20x20.xpm"
#include "images/icon_search_20x20.xpm"
#include "images/icon_devices_list_20x20.xpm"
#include "images/icon_mimetypes_20x20.xpm"
#include "images/icon_tool_bar_20x20.xpm"
#include "images/icon_status_bar_20x20.xpm"
#include "images/icon_wildcards_20x20.xpm"
#include "images/icon_options2_20x20.xpm"
#include "images/icon_customize_20x20.xpm"
#include "images/icon_insecure_20x20.xpm"
#include "images/icon_secure_20x20.xpm"
#include "images/icon_fsck_20x20.xpm"
#include "images/icon_tools_20x20.xpm"
#include "images/icon_floppy_20x20.xpm"

#include "images/icon_open_20x20.xpm"
#include "images/icon_file_20x20.xpm"
#include "images/icon_folder_closed_20x20.xpm"
#include "images/icon_folder_home_20x20.xpm"
#include "images/icon_folder_parent_20x20.xpm"
#include "images/icon_link2_20x20.xpm"
#include "images/icon_pipe_20x20.xpm"
#include "images/icon_device_block_20x20.xpm"
#include "images/icon_device_character_20x20.xpm"
#include "images/icon_socket_20x20.xpm"

#include "images/icon_folder_parent_32x32.xpm"
#include "images/icon_folder_noaccess_32x32.xpm"
#include "images/icon_file_badimage_32x32.xpm"

#include "images/icon_trash_empty_20x20.xpm"
#include "images/icon_trash_20x20.xpm"
#include "images/icon_purge_20x20.xpm"
#include "images/icon_help_20x20.xpm"
#include "images/icon_about_20x20.xpm"

#include "images/endeavour_20x20.xpm"
#include "images/image_browser_20x20.xpm"
#include "images/archiver_20x20.xpm"
#include "images/image_browser_48x48.xpm"


/* Utilities */
edv_imbr_opid_struct *EDVImbrMatchOPID(
	edv_imbr_struct *imbr, edv_imbr_op op
);

/* Title */
void EDVImbrSetTitle(edv_imbr_struct *imbr, const gchar *path);

/* Location */
gchar *EDVImbrCurrentLocation(edv_imbr_struct *imbr);
void EDVImbrSetLocation(
	edv_imbr_struct *imbr,
	const gchar *path, gboolean record_history
);
void EDVImbrUpdateLocationIcon(
	edv_imbr_struct *imbr, const gchar *path
);

/* Regenerate Styles, Menus, and Tool Bars */
void EDVImbrAccelkeysRegenerate(edv_imbr_struct *imbr);
void EDVImbrNewObjectMenuRegenerate(edv_imbr_struct *imbr);
void EDVImbrOpenToMenuRegenerate(
	edv_imbr_struct *imbr, edv_mime_type_struct *m
);
void EDVImbrToolbarRegenerate(edv_imbr_struct *imbr);
void EDVImbrTListMenuRegenerate(edv_imbr_struct *imbr);

/* Sync Configuration */
void EDVImbrSyncConfiguration(edv_imbr_struct *imbr);

/* Load Control */
void EDVImbrQueueLoadingProcess(edv_imbr_struct *imbr);

/* Select Path */
void EDVImbrSelectPath(
	edv_imbr_struct *imbr, const gchar *path
);

/* Operation IDs */
GList *EDVImbrOPIDListNew(edv_imbr_struct *imbr);
void EDVImbrOPIDListDelete(GList *glist);

/* Accel Keys */
cfg_accelkey_list_struct *EDVImbrAccelkeysListNewDefault(void);

/* Image Browser */
static void EDVImbrCreateMenuBar(
	edv_imbr_struct *imbr, GtkWidget *parent
);
edv_imbr_struct *EDVImbrNew(edv_core_struct *core);
void EDVImbrSyncData(edv_imbr_struct *imbr);
void EDVImbrUpdateMenus(edv_imbr_struct *imbr);
void EDVImbrSetBusy(edv_imbr_struct *imbr, gboolean busy);
void EDVImbrSetPassiveBusy(edv_imbr_struct *imbr, gboolean busy);
gboolean EDVImbrIsMapped(edv_imbr_struct *imbr);
void EDVImbrMap(edv_imbr_struct *imbr);
void EDVImbrUnmap(edv_imbr_struct *imbr);
void EDVImbrDelete(edv_imbr_struct *imbr);


#define ATOI(s)		(((s) != NULL) ? atoi(s) : 0)
#define ATOL(s)		(((s) != NULL) ? atol(s) : 0)
#define ATOF(s)		(((s) != NULL) ? atof(s) : 0.0f)
#define STRDUP(s)	(((s) != NULL) ? g_strdup(s) : NULL)

#define MAX(a,b)	(((a) > (b)) ? (a) : (b))
#define MIN(a,b)	(((a) < (b)) ? (a) : (b))
#define CLIP(a,l,h)	(MIN(MAX((a),(l)),(h)))
#define STRLEN(s)	(((s) != NULL) ? strlen(s) : 0)
#define STRISEMPTY(s)	(((s) != NULL) ? (*(s) == '\0') : TRUE)


/*
 *	Returns the Image Browser Operation ID that matches the given
 *	operation.
 */
edv_imbr_opid_struct *EDVImbrMatchOPID(
	edv_imbr_struct *imbr, edv_imbr_op op
)
{
	GList *glist;
	edv_imbr_opid_struct *opid;

	if(imbr == NULL)
	    return(NULL);

	for(glist = imbr->opid_list; glist != NULL; glist = g_list_next(glist))
	{
	    opid = EDV_IMBR_OPID(glist->data);
	    if(opid == NULL)
		continue;

	    if(opid->op == op)
		return(opid);
	}

	return(NULL);
}


/*
 *	Sets the Image Browser's title.
 *
 *	The given path is optional, it can be either the current
 *	selected location or the last selected object.
 */
void EDVImbrSetTitle(edv_imbr_struct *imbr, const gchar *path)
{
	gboolean include_user_name, include_location;
	const gchar *prog_name = "Image Browser";
	gchar *title;
	GtkWidget *w;
	const cfg_item_struct *cfg_list;
	edv_core_struct *core;

	if(imbr == NULL)
	    return;

	w = imbr->toplevel;
	core = imbr->core;
	if((w == NULL) || (core == NULL))
	    return;

	if(!STRISEMPTY(core->title))
	    prog_name = core->title;

	cfg_list = core->cfg_list;

	include_user_name = EDV_GET_B(EDV_CFG_PARM_IMBR_TITLE_WITH_USER);
	include_location = EDV_GET_B(EDV_CFG_PARM_IMBR_TITLE_WITH_LOCATION);

	/* Generate new title string */
	if(include_user_name && include_location &&
	   (path != NULL)
	)
	    title = g_strdup_printf(
		"%s: %s %s",
		prog_name, core->effective_user_id_host_str,
		path
	    );
	else if(include_location && (path != NULL))
	    title = g_strdup_printf(
		"%s: %s",
		prog_name, path
	    );
	else if(include_user_name)
	    title = g_strdup_printf(
		"%s: %s",
		prog_name, core->effective_user_id_host_str
	    );
	else
	    title = STRDUP(prog_name);

	/* Set new title */
	gtk_window_set_title(GTK_WINDOW(w), title);

	g_free(title);
}

/*
 *	Returns the Image Browser's current location.
 */
gchar *EDVImbrCurrentLocation(edv_imbr_struct *imbr)
{
	GtkCombo *combo = (GtkCombo *)((imbr != NULL) ?
	    imbr->location_combo : NULL
	);
	return((combo != NULL) ?
	    gtk_entry_get_text(GTK_ENTRY(combo->entry)) : NULL
	);
}

/*
 *	Sets the Image Browser's location.
 *
 *	If record_history is TRUE then the new location will be
 *	recorded on the location history.
 */
void EDVImbrSetLocation(
	edv_imbr_struct *imbr,
	const gchar *path, gboolean record_history
)
{
	const gchar *s;
	gchar *new_path;
	GtkEntry *entry;
	GtkCombo *combo = (GtkCombo *)((imbr != NULL) ?
	    imbr->location_combo : NULL
	);
	if((combo == NULL) || STRISEMPTY(path))
	    return;

	entry = GTK_ENTRY(combo->entry);

	/* Get new path */
	new_path = STRDUP(path);

	/* Simplify new path */
	SimplifyPath(new_path);

	/* No change? */
	s = gtk_entry_get_text(entry);
	if((s != NULL) ? !strcmp(s, new_path) : FALSE)
	{
	    g_free(new_path);
	    return;
	}

	/* Record new location on the location history? */
	if(record_history)
	    GUIComboAddItem(GTK_WIDGET(combo), new_path);

	/* Set new location */
	gtk_entry_set_text(entry, new_path);
	gtk_entry_set_position(entry, -1);

	g_free(new_path);
}

/*
 *	Updates the Image Browser Location Bar's icon.
 *
 *	If the given path is NULL then the icon will be set as unknown.
 */
void EDVImbrUpdateLocationIcon(
	edv_imbr_struct *imbr, const gchar *path
)
{
	edv_object_struct *obj = NULL;
	GdkPixmap *pixmap, *pixmap_hid;
	GdkBitmap *mask, *mask_hid;
	GtkWidget *parent, *w;
	edv_core_struct *core;

	if(imbr == NULL)
	    return;

	parent = imbr->location_icon_fixed;
	core = imbr->core;
	if((parent == NULL) || (core == NULL))
	    return;

	if(!STRISEMPTY(path))
	{
	    struct stat lstat_buf;
	    if(!lstat(path, &lstat_buf))
	    {
		obj = EDVObjectNew();
		EDVObjectSetPath(obj, path);
		EDVObjectSetStat(obj, &lstat_buf);
		EDVObjectUpdateLinkFlags(obj);
	    }
	}
	if(obj == NULL)
	{
	    obj = EDVObjectNew();
	    if(obj != NULL)
	    {
		obj->type = EDV_OBJECT_TYPE_DIRECTORY;
		obj->permissions = 0x00000000;
		if(!STRISEMPTY(path))
		{
		    struct stat lstat_buf;
		    EDVObjectSetPath(obj, path);
		    if(!lstat(path, &lstat_buf))
		    {
			EDVObjectSetStat(obj, &lstat_buf);
			EDVObjectUpdateLinkFlags(obj);
		    }
		}
	    }
	}

	/* Get pixmap and mask for icon */
	EDVMatchObjectIcon(
	    core->device, core->total_devices,
	    core->mimetype, core->total_mimetypes,
	    obj->type,
	    obj->full_path,
	    EDV_OBJECT_IS_LINK_VALID(obj),
	    obj->permissions,
	    0,			/* Small icons */
	    &pixmap, &mask,
	    NULL, NULL,
	    NULL, NULL,
	    &pixmap_hid, &mask_hid
	);
	/* Hidden */
	if(EDVIsObjectHidden(obj))
	{
	    if(pixmap_hid != NULL)
	    {
		pixmap = pixmap_hid;
		mask = mask_hid;
	    }
	}
	if(pixmap == NULL)
	    return;

	GDK_PIXMAP_REF(pixmap);
	GDK_BITMAP_REF(mask);

	/* Create new icon pixmap widget as needed */
	w = imbr->location_icon_pm;
	if(w == NULL)
	{
	    imbr->location_icon_pm = w = gtk_pixmap_new(pixmap, mask);
	    gtk_fixed_put(GTK_FIXED(parent), w, 0, 0);
	    gtk_widget_show(w);
	}
	else
	{
	    gtk_pixmap_set(GTK_PIXMAP(w), pixmap, mask);
	}

	EDVObjectDelete(obj);

	GDK_PIXMAP_UNREF(pixmap);
	GDK_BITMAP_UNREF(mask);
}


/*
 *	Recreates the Image Browser's Tool Bar.
 */
void EDVImbrToolbarRegenerate(edv_imbr_struct *imbr)
{
	gint i, total_items;
	GList *glist;
	toolbar_display tb_display;
	toolbar_relief tb_relief;
	GtkWidget *w, *parent;
	const cfg_intlist_struct *intlist;
	const cfg_item_struct *cfg_list;
	edv_imbr_opid_struct *opid;
	toolbar_item_struct **item, *item_ptr;
	toolbar_struct *toolbar;
	edv_core_struct *core;

	if(imbr == NULL)
	    return;

	parent = imbr->tool_bar_handle;
	core = imbr->core;
	if((parent == NULL) || (core == NULL))
	    return;

	cfg_list = core->cfg_list;

	/* Get Tool Bar configuration */
	tb_display = (toolbar_display)EDV_GET_I(
	    EDV_CFG_PARM_IMBR_TOOL_BAR_DISPLAY
	);
	tb_relief = (toolbar_relief)EDV_GET_I(
	    EDV_CFG_PARM_IMBR_TOOL_BAR_RELIEF
	);
	intlist = EDV_GET_INTLIST(EDV_CFG_PARM_IMBR_TOOL_BAR);
	if(intlist == NULL)
	    return;

	/* Delete existing Tool Bar if any */
	ToolBarDelete(imbr->tool_bar);
	imbr->tool_bar = NULL;

	/* Create Tool Bar items list */
	glist = intlist->list;
	total_items = g_list_length(glist);
	if(total_items > 0)
	{
	    item = (toolbar_item_struct **)g_malloc0(
		total_items * sizeof(toolbar_item_struct *)
	    );
	    if(item == NULL)
		total_items = 0;
	}
	else
	{
	    item = NULL;
	}
	for(i = 0; i < total_items; i++)
	{
	    /* Get Operation ID */
	    opid = EDVImbrMatchOPID(
		imbr,
		(edv_imbr_op)((glist != NULL) ?
		    glist->data : NULL
		)
	    );
	    glist = g_list_next(glist);
	    if(opid == NULL)
		continue;

	    switch(opid->op)
	    {
	      case EDV_IMBR_OP_NONE:
		item[i] = item_ptr = NULL;
		break;

	      default:
		item[i] = item_ptr = ToolBarItemNew(
		    opid->tb_item_type,
		    opid->button_name,
		    opid->button_icon_data,
		    opid->tooltip,
		    opid->op,
		    EDVImbrOPCB, opid,
		    EDVImbrOPEnterCB, opid,
		    EDVImbrOPLeaveCB, opid
		);
		break;
	    }

	}

	/* Create new Tool Bar */
	imbr->tool_bar = toolbar = ToolBarNew(
	    item, total_items, parent,
	    tb_display, tb_relief, FALSE
	);
	ToolBarMap(toolbar);

	/* Delete Tool Bar items list */
	ToolBarItemListDeleteAll(&item, &total_items);

	/* Need to queue resize of toplevel since Tool Bar size
	 * mave have changed
	 */
	w = imbr->toplevel;
	if(w != NULL)
	    gtk_widget_queue_resize(w);
}


/*
 *	Resets the Image Browser's accelkeys displayed on the widgets.
 */
void EDVImbrAccelkeysRegenerate(edv_imbr_struct *imbr)
{
	GtkAccelGroup *accelgrp = NULL;
	cfg_accelkey_list_struct *ak_list;
	const cfg_item_struct *cfg_list;
	edv_core_struct *core;

	if(imbr == NULL)
	    return;
		   
	core = imbr->core;
	if(core == NULL)
	    return;

	cfg_list = core->cfg_list;

	ak_list = EDV_GET_ACCELKEY_LIST(EDV_CFG_PARM_IMBR_ACCELERATOR_KEYS);
	if(ak_list == NULL)
	    return;

#define UPDATE_ACCELKEY(_w_,_opid_)	{	\
 if(((_w_) != NULL) && ((_opid_) > 0)) {	\
  GList *glist;					\
  cfg_accelkey_struct *ak;			\
						\
  for(glist = ak_list->list;			\
      glist != NULL;				\
      glist = g_list_next(glist)		\
  ) {						\
   ak = CFG_ACCELKEY(glist->data);		\
   if(ak == NULL)				\
    continue;					\
						\
   if(ak->opid == (gint)(_opid_)) {		\
    GUIMenuItemSetAccelKey(			\
     (_w_), accelgrp, ak->key, ak->modifiers	\
    );						\
    break;					\
   }						\
  }						\
 }						\
}
		   
	UPDATE_ACCELKEY(
	    imbr->open_mi,
	    EDV_IMBR_OP_OPEN
	);
	UPDATE_ACCELKEY(
	    imbr->open_to_mi,
	    EDV_IMBR_OP_OPEN_TO
	);
	UPDATE_ACCELKEY(
	    imbr->open_with_mi,
	    EDV_IMBR_OP_OPEN_WITH
	);
	UPDATE_ACCELKEY(
	    imbr->new_file_mi,
	    EDV_IMBR_OP_NEW_FILE
	);
	UPDATE_ACCELKEY(
	    imbr->new_directory_mi,
	    EDV_IMBR_OP_NEW_DIRECTORY
	);
	UPDATE_ACCELKEY(
	    imbr->new_link_mi,
	    EDV_IMBR_OP_NEW_LINK
	);
	UPDATE_ACCELKEY(
	    imbr->new_fifo_mi,
	    EDV_IMBR_OP_NEW_FIFO
	);
	UPDATE_ACCELKEY(
	    imbr->new_device_block_mi,
	    EDV_IMBR_OP_NEW_DEVICE_BLOCK
	);
	UPDATE_ACCELKEY(
	    imbr->new_device_character_mi,
	    EDV_IMBR_OP_NEW_DEVICE_CHARACTER
	);
	UPDATE_ACCELKEY(
	    imbr->new_socket_mi,
	    EDV_IMBR_OP_NEW_SOCKET
	);
	UPDATE_ACCELKEY(
	    imbr->sync_disks_mi,
	    EDV_IMBR_OP_SYNC_DISKS
	);
	UPDATE_ACCELKEY(
	    imbr->history_mi,
	    EDV_IMBR_OP_HISTORY
	);
	UPDATE_ACCELKEY(
	    imbr->run_mi,
	    EDV_IMBR_OP_RUN
	);
	UPDATE_ACCELKEY(
	    imbr->close_mi,
	    EDV_IMBR_OP_CLOSE
	);

	UPDATE_ACCELKEY(
	    imbr->move_mi,
	    EDV_IMBR_OP_MOVE
	);
	UPDATE_ACCELKEY(
	    imbr->copy_mi,
	    EDV_IMBR_OP_COPY
	);
	UPDATE_ACCELKEY(
	    imbr->link_mi,
	    EDV_IMBR_OP_LINK
	);
	UPDATE_ACCELKEY(
	    imbr->rename_mi,
	    EDV_IMBR_OP_RENAME
	);
	UPDATE_ACCELKEY(
	    imbr->chmod_mi,
	    EDV_IMBR_OP_CHMOD
	);
	UPDATE_ACCELKEY(
	    imbr->chown_mi,
	    EDV_IMBR_OP_CHOWN
	);
	UPDATE_ACCELKEY(
	    imbr->chtime_mi,
	    EDV_IMBR_OP_CHTIME
	);
	UPDATE_ACCELKEY(
	    imbr->delete_mi,
	    EDV_IMBR_OP_DELETE
	);
	UPDATE_ACCELKEY(
	    imbr->copy_path_mi,
	    EDV_IMBR_OP_COPY_PATH
	);
	UPDATE_ACCELKEY(
	    imbr->copy_url_mi,
	    EDV_IMBR_OP_COPY_URL
	);
	UPDATE_ACCELKEY(
	    imbr->paste_mi,
	    EDV_IMBR_OP_PASTE
	);
	UPDATE_ACCELKEY(
	    imbr->select_all_mi,
	    EDV_IMBR_OP_SELECT_ALL
	);
	UPDATE_ACCELKEY(
	    imbr->unselect_all_mi,
	    EDV_IMBR_OP_UNSELECT_ALL
	);
	UPDATE_ACCELKEY(
	    imbr->invert_selection_mi,
	    EDV_IMBR_OP_INVERT_SELECTION
	);
	UPDATE_ACCELKEY(
	    imbr->find_mi,
	    EDV_IMBR_OP_FIND
	);
	UPDATE_ACCELKEY(
	    imbr->properties_mi,
	    EDV_IMBR_OP_PROPERTIES
	);

	UPDATE_ACCELKEY(
	    imbr->mount_mi,
	    EDV_IMBR_OP_MOUNT
	);
	UPDATE_ACCELKEY(
	    imbr->eject_mi,
	    EDV_IMBR_OP_EJECT
	);
	UPDATE_ACCELKEY(
	    imbr->device_check_mi,
	    EDV_IMBR_OP_DEVICE_CHECK
	);
	UPDATE_ACCELKEY(
	    imbr->device_tools_mi,
	    EDV_IMBR_OP_DEVICE_TOOLS
	);
	UPDATE_ACCELKEY(
	    imbr->device_format_mi,
	    EDV_IMBR_OP_DEVICE_FORMAT
	);
	UPDATE_ACCELKEY(
	    imbr->devices_mi,
	    EDV_IMBR_OP_DEVICES
	);

	UPDATE_ACCELKEY(
	    imbr->stop_mi,
	    EDV_IMBR_OP_STOP
	);
	UPDATE_ACCELKEY(
	    imbr->continue_mi,
	    EDV_IMBR_OP_CONTINUE
	);
	UPDATE_ACCELKEY(
	    imbr->presentation_mode_mi,
	    EDV_IMBR_OP_PRESENTATION_MODE
	);
	UPDATE_ACCELKEY(
	    imbr->refresh_mi,
	    EDV_IMBR_OP_REFRESH
	);
	UPDATE_ACCELKEY(
	    imbr->refresh_all_mi,
	    EDV_IMBR_OP_REFRESH_ALL
	);
	UPDATE_ACCELKEY(
	    imbr->show_tool_bar_micheck,
	    EDV_IMBR_OP_SHOW_TOOL_BAR
	);
	UPDATE_ACCELKEY(
	    imbr->show_location_bar_micheck,
	    EDV_IMBR_OP_SHOW_LOCATION_BAR
	);
	UPDATE_ACCELKEY(
	    imbr->show_mount_bar_micheck,
	    EDV_IMBR_OP_SHOW_MOUNT_BAR
	);
	UPDATE_ACCELKEY(
	    imbr->show_find_bar_micheck,
	    EDV_IMBR_OP_SHOW_FIND_BAR
	);
	UPDATE_ACCELKEY(
	    imbr->show_status_bar_micheck,
	    EDV_IMBR_OP_SHOW_STATUS_BAR
	);
	UPDATE_ACCELKEY(
	    imbr->thumbs_list_filter_mi,
	    EDV_IMBR_OP_THUMBS_LIST_FILTER
	);
	UPDATE_ACCELKEY(
	    imbr->show_hidden_objects_micheck,
	    EDV_IMBR_OP_SHOW_HIDDEN_OBJECTS
	);
	UPDATE_ACCELKEY(
	    imbr->show_noaccess_objects_micheck,
	    EDV_IMBR_OP_SHOW_NOACCESS_OBJECTS
	);
	UPDATE_ACCELKEY(
	    imbr->show_nonimage_objects_micheck,
	    EDV_IMBR_OP_SHOW_NONIMAGE_OBJECTS
	);
	UPDATE_ACCELKEY(
	    imbr->mime_types_mi,
	    EDV_IMBR_OP_MIME_TYPES
	);


	UPDATE_ACCELKEY(
	    imbr->write_protect_mi,
	    EDV_IMBR_OP_WRITE_PROTECT
	);
	UPDATE_ACCELKEY(
	    imbr->delete_method_recycle_micheck,
	    EDV_IMBR_OP_DELETE_METHOD_RECYCLE
	);
	UPDATE_ACCELKEY(
	    imbr->delete_method_purge_micheck,
	    EDV_IMBR_OP_DELETE_METHOD_PURGE
	);
	UPDATE_ACCELKEY(
	    imbr->options_mi,
	    EDV_IMBR_OP_OPTIONS
	);
	UPDATE_ACCELKEY(
	    imbr->customize_mi,
	    EDV_IMBR_OP_CUSTOMIZE
	);

	UPDATE_ACCELKEY(
	    imbr->window_new_browser_mi,
	    EDV_IMBR_OP_NEW_BROWSER
	);
	UPDATE_ACCELKEY(
	    imbr->window_new_imbr_mi,
	    EDV_IMBR_OP_NEW_IMBR
	);
	UPDATE_ACCELKEY(
	    imbr->window_new_archiver_mi,
	    EDV_IMBR_OP_NEW_ARCHIVER
	);
	UPDATE_ACCELKEY(
	    imbr->window_recycle_bin_mi,
	    EDV_IMBR_OP_RECYCLE_BIN
	);

	UPDATE_ACCELKEY(
	    imbr->help_contents_mi,
	    EDV_IMBR_OP_HELP_CONTENTS
	);
	UPDATE_ACCELKEY(
	    imbr->help_image_browser_mi,
	    EDV_IMBR_OP_HELP_IMAGE_BROWSER
	);
	UPDATE_ACCELKEY(
	    imbr->help_keys_list_mi,
	    EDV_IMBR_OP_HELP_KEYS_LIST
	);
	UPDATE_ACCELKEY(
	    imbr->help_mime_types_mi,
	    EDV_IMBR_OP_HELP_MIME_TYPES
	);
	UPDATE_ACCELKEY(
	    imbr->help_devices_mi,
	    EDV_IMBR_OP_HELP_DEVICES
	);
	UPDATE_ACCELKEY(
	    imbr->help_common_operations_mi,
	    EDV_IMBR_OP_HELP_COMMON_OPERATIONS
	);
	UPDATE_ACCELKEY(
	    imbr->help_about_mi,
	    EDV_IMBR_OP_HELP_ABOUT
	);

	UPDATE_ACCELKEY(
	    imbr->tlist_open_mi,
	    EDV_IMBR_OP_OPEN
	);
	UPDATE_ACCELKEY(
	    imbr->tlist_open_to_mi,
	    EDV_IMBR_OP_OPEN_TO
	);
	UPDATE_ACCELKEY(
	    imbr->tlist_open_with_mi,
	    EDV_IMBR_OP_OPEN_WITH
	);
	UPDATE_ACCELKEY(
	    imbr->tlist_mount_mi,
	    EDV_IMBR_OP_MOUNT
	);
	UPDATE_ACCELKEY(
	    imbr->tlist_eject_mi,
	    EDV_IMBR_OP_EJECT
	);
	UPDATE_ACCELKEY(
	    imbr->tlist_move_mi,
	    EDV_IMBR_OP_MOVE
	);
	UPDATE_ACCELKEY(
	    imbr->tlist_copy_mi,
	    EDV_IMBR_OP_COPY
	);
	UPDATE_ACCELKEY(
	    imbr->tlist_link_mi,
	    EDV_IMBR_OP_LINK
	);
	UPDATE_ACCELKEY(
	    imbr->tlist_rename_mi,
	    EDV_IMBR_OP_RENAME
	);
	UPDATE_ACCELKEY(
	    imbr->tlist_chmod_mi,
	    EDV_IMBR_OP_CHMOD
	);
	UPDATE_ACCELKEY(
	    imbr->tlist_chown_mi,
	    EDV_IMBR_OP_CHOWN
	);
	UPDATE_ACCELKEY(
	    imbr->tlist_chtime_mi,
	    EDV_IMBR_OP_CHTIME
	);
	UPDATE_ACCELKEY(
	    imbr->tlist_delete_mi,
	    EDV_IMBR_OP_DELETE
	);
	UPDATE_ACCELKEY(
	    imbr->tlist_copy_path_mi,
	    EDV_IMBR_OP_COPY_PATH
	);
	UPDATE_ACCELKEY(
	    imbr->tlist_copy_url_mi,
	    EDV_IMBR_OP_COPY_URL
	);
	UPDATE_ACCELKEY(
	    imbr->tlist_paste_mi,
	    EDV_IMBR_OP_PASTE
	);
	UPDATE_ACCELKEY(
	    imbr->tlist_properties_mi,
	    EDV_IMBR_OP_PROPERTIES
	);


#undef UPDATE_ACCELKEY
}

/*
 *	Recreates the Image Browser's New Object Submenu.
 */
void EDVImbrNewObjectMenuRegenerate(edv_imbr_struct *imbr)
{
	guint8 **icon_data = NULL;
	edv_imbr_op op;
	GtkAccelGroup *accelgrp = NULL;
	GtkWidget *w, *menu;

	if(imbr == NULL)
	    return;

	/* Recreate menu */
	imbr->new_object_menu = menu = GUIMenuCreate();

#define DO_ADD_MENU_ITEM_LABEL	{		\
 edv_imbr_opid_struct *opid =			\
  EDVImbrMatchOPID(imbr, op);			\
 if(opid != NULL) {				\
  w = GUIMenuItemCreate(			\
   menu, GUI_MENU_ITEM_TYPE_LABEL, accelgrp,	\
   (icon_data != NULL) ?			\
    icon_data : opid->menu_icon_data,		\
   opid->menu_name,				\
   opid->accel_key, opid->accel_mods,		\
   NULL,					\
   opid, EDVImbrMenuItemCB			\
  );						\
  GUISetMenuItemCrossingCB(			\
   w,						\
   (gpointer)EDVImbrMenuItemEnterCB, opid,	\
   (gpointer)EDVImbrMenuItemLeaveCB, opid	\
  );						\
 } else {					\
  w = NULL;					\
 }						\
}

#define DO_ADD_MENU_SEP	{			\
 w = GUIMenuItemCreate(				\
  menu, GUI_MENU_ITEM_TYPE_SEPARATOR, NULL,	\
  NULL, NULL, 0, 0, NULL,			\
  NULL, NULL					\
 );						\
}
	op = EDV_IMBR_OP_NEW_FILE;
	DO_ADD_MENU_ITEM_LABEL
	imbr->new_file_mi = w;

	op = EDV_IMBR_OP_NEW_DIRECTORY;
	DO_ADD_MENU_ITEM_LABEL
	imbr->new_directory_mi = w;

	op = EDV_IMBR_OP_NEW_LINK;
	DO_ADD_MENU_ITEM_LABEL
	imbr->new_link_mi = w;

	op = EDV_IMBR_OP_NEW_FIFO;
	DO_ADD_MENU_ITEM_LABEL
	imbr->new_fifo_mi = w;

	op = EDV_IMBR_OP_NEW_DEVICE_BLOCK;
	DO_ADD_MENU_ITEM_LABEL
	imbr->new_device_block_mi = w;

	op = EDV_IMBR_OP_NEW_DEVICE_CHARACTER;
	DO_ADD_MENU_ITEM_LABEL
	imbr->new_device_character_mi = w;

	op = EDV_IMBR_OP_NEW_SOCKET;
	DO_ADD_MENU_ITEM_LABEL
	imbr->new_socket_mi = w;

#undef DO_ADD_MENU_ITEM_LABEL
#undef DO_ADD_MENU_SEP

	/* Attach submenu to new object menu item */
	GUIMenuItemSetSubMenu(imbr->new_object_mi, menu);
}

/*
 *	Regenerates the Open To menu.
 */
void EDVImbrOpenToMenuRegenerate(
	edv_imbr_struct *imbr, edv_mime_type_struct *m
)
{
	GtkWidget *menu, *toplevel;
	edv_core_struct *core;

	if(imbr == NULL)
	    return;

	toplevel = imbr->toplevel;
	core = imbr->core;

	menu = EDVOpenToMenuNewFromMIMEType(
	    core, m,
	    EDVImbrGetSelectedPathsListCB, imbr,
	    EDVImbrGotoDirectoryCB, imbr,
	    toplevel,
	    TRUE			/* Verbose */
	);
	GUIMenuItemSetSubMenu(imbr->open_to_mi, menu);
	imbr->open_to_menu = menu;

	menu = EDVOpenToMenuNewFromMIMEType(
	    core, m,
	    EDVImbrGetSelectedPathsListCB, imbr,
	    EDVImbrGotoDirectoryCB, imbr,
	    toplevel,
	    TRUE			/* Verbose */
	);
	GUIMenuItemSetSubMenu(imbr->tlist_open_to_mi, menu);
	imbr->tlist_open_to_menu = menu;
}

/*
 *	Recreates the Image Browser Thumbs List right-click menu.
 */
void EDVImbrTListMenuRegenerate(edv_imbr_struct *imbr)
{
	guint8 **icon_data = NULL;
	edv_imbr_op op;
	GtkAccelGroup *accelgrp = NULL;
	GtkWidget *menu, *w;

	if(imbr == NULL)
	    return;

	/* Recreate menu */
	GTK_WIDGET_DESTROY(imbr->tlist_menu);
	imbr->tlist_menu = menu = GUIMenuCreate();

#define DO_ADD_MENU_ITEM_LABEL	{		\
 edv_imbr_opid_struct *opid =			\
  EDVImbrMatchOPID(imbr, op);			\
 if(opid != NULL) {				\
  w = GUIMenuItemCreate(			\
   menu, GUI_MENU_ITEM_TYPE_LABEL, accelgrp,	\
   (icon_data != NULL) ?			\
    icon_data : opid->menu_icon_data,		\
   opid->menu_name,				\
   opid->accel_key, opid->accel_mods,		\
   NULL,					\
   opid, EDVImbrMenuItemCB			\
  );						\
  GUISetMenuItemCrossingCB(			\
   w,						\
   (gpointer)EDVImbrMenuItemEnterCB, opid,	\
   (gpointer)EDVImbrMenuItemLeaveCB, opid	\
  );						\
 } else {					\
  w = NULL;					\
 }						\
}

#define DO_ADD_MENU_SUBMENU_LABEL	{	\
 edv_imbr_opid_struct *opid =			\
  EDVImbrMatchOPID(imbr, op);			\
 if(opid != NULL) {				\
  w = GUIMenuItemCreate(			\
   menu, GUI_MENU_ITEM_TYPE_LABEL, NULL,	\
   (icon_data != NULL) ?			\
    icon_data : opid->menu_icon_data,		\
   opid->menu_name,				\
   0, 0, NULL, NULL, NULL			\
  );						\
  GUISetMenuItemCrossingCB(			\
   w,						\
   (gpointer)EDVImbrMenuItemEnterCB, opid,	\
   (gpointer)EDVImbrMenuItemLeaveCB, opid	\
  );						\
 } else {					\
  w = NULL;					\
 }						\
}

#define DO_ADD_MENU_SEP		{		\
 w = GUIMenuItemCreate(				\
  menu, GUI_MENU_ITEM_TYPE_SEPARATOR, NULL,	\
  NULL, NULL, 0, 0, NULL,			\
  NULL, NULL					\
 );						\
}
	op = EDV_IMBR_OP_OPEN;
	DO_ADD_MENU_ITEM_LABEL
	GUISetMenuItemDefault(w);
	imbr->tlist_open_mi = w;

	op = EDV_IMBR_OP_OPEN_TO;
	DO_ADD_MENU_SUBMENU_LABEL
	imbr->tlist_open_to_mi = w;

	op = EDV_IMBR_OP_OPEN_WITH;
	DO_ADD_MENU_ITEM_LABEL
	imbr->tlist_open_with_mi = w;

	DO_ADD_MENU_SEP

	op = EDV_IMBR_OP_MOUNT;
	DO_ADD_MENU_ITEM_LABEL
	imbr->tlist_mount_mi = w;

	op = EDV_IMBR_OP_EJECT;
	DO_ADD_MENU_ITEM_LABEL
	imbr->tlist_eject_mi = w;

	DO_ADD_MENU_SEP
	imbr->tlist_mount_misep = w;

	op = EDV_IMBR_OP_MOVE;
	DO_ADD_MENU_ITEM_LABEL
	imbr->tlist_move_mi = w;

	op = EDV_IMBR_OP_COPY;
	DO_ADD_MENU_ITEM_LABEL
	imbr->tlist_copy_mi = w;

	op = EDV_IMBR_OP_LINK;
	DO_ADD_MENU_ITEM_LABEL
	imbr->tlist_link_mi = w;

	op = EDV_IMBR_OP_RENAME;
	DO_ADD_MENU_ITEM_LABEL
	imbr->tlist_rename_mi = w;

	op = EDV_IMBR_OP_CHMOD;
	DO_ADD_MENU_ITEM_LABEL
	imbr->tlist_chmod_mi = w;

	op = EDV_IMBR_OP_CHOWN;
	DO_ADD_MENU_ITEM_LABEL
	imbr->tlist_chown_mi = w;

	op = EDV_IMBR_OP_CHTIME;
	DO_ADD_MENU_ITEM_LABEL
	imbr->tlist_chtime_mi = w;

	op = EDV_IMBR_OP_DELETE;
	DO_ADD_MENU_ITEM_LABEL
	imbr->tlist_delete_mi = w;

	DO_ADD_MENU_SEP

	op = EDV_IMBR_OP_COPY_PATH;
	DO_ADD_MENU_ITEM_LABEL
	imbr->tlist_copy_path_mi = w;

	op = EDV_IMBR_OP_COPY_URL;
	DO_ADD_MENU_ITEM_LABEL
	imbr->tlist_copy_url_mi = w;

	op = EDV_IMBR_OP_PASTE;
	DO_ADD_MENU_ITEM_LABEL
	imbr->tlist_paste_mi = w;

	DO_ADD_MENU_SEP

	op = EDV_IMBR_OP_PROPERTIES;
	DO_ADD_MENU_ITEM_LABEL
	imbr->tlist_properties_mi = w;

#undef DO_ADD_MENU_ITEM_LABEL
#undef DO_ADD_MENU_SUBMENU_LABEL
#undef DO_ADD_MENU_SEP
}


/*
 *	Sets the Image Browser's values to the configuration.
 */
void EDVImbrSyncConfiguration(edv_imbr_struct *imbr)
{
	GtkWidget *w;
	edv_core_struct *core;
	cfg_item_struct *cfg_list;

	if(imbr == NULL)
	    return;

	core = imbr->core;
	if(core == NULL)
	    return;

	cfg_list = core->cfg_list;

	/* Location history */
	w = imbr->location_combo;
	if(core != NULL)
	{
	    GList *glist = GUIComboGetList(w);
	    const gchar *path = EDV_GET_S(
		EDV_CFG_PARM_FILE_IMBR_LOCATION_HISTORY
	    );
	    EDVSaveFileGList(path, glist);
	}

	/* Toplevel geometry */
	w = imbr->toplevel;
	if(w != NULL)
	{
	    GdkWindow *window = w->window;
	    gint x = 0, y = 0;

	    if(window != NULL)
		gdk_window_get_root_origin(window, &x, &y);

	    EDV_SET_I(EDV_CFG_PARM_IMBR_X, x);
	    EDV_SET_I(EDV_CFG_PARM_IMBR_Y, y);
	    EDV_SET_I(EDV_CFG_PARM_IMBR_WIDTH, w->allocation.width);
	    EDV_SET_I(EDV_CFG_PARM_IMBR_HEIGHT, w->allocation.height);
	}

	/* Get position of main paned */
	w = imbr->main_paned;
	if(w != NULL)
	{
	    EDV_SET_I(
		EDV_CFG_PARM_IMBR_PANED_POSITION,
		GTK_PANED(w)->child1_size
	    );
	}

	/* Set new startup directory as the last directory of this
	 * window's location
	 */
	if(EDV_GET_B(EDV_CFG_PARM_RECORD_START_UP_DIR))
	{
	    EDV_SET_S(
		EDV_CFG_PARM_DIR_START_UP,
		EDVImbrCurrentLocation(imbr)
	    );
	}

	/* Thumbs list filter */
	if(STRISEMPTY(imbr->thumbs_list_filter))
	{
	    EDV_SET_S(
		EDV_CFG_PARM_IMBR_THUMBS_LIST_FILTER,
		"*"
	    );
	}
	else
	{
	    EDV_SET_S(
		EDV_CFG_PARM_IMBR_THUMBS_LIST_FILTER,
		imbr->thumbs_list_filter
	    );
	}
}

/*
 *	Resets the Image Browser's loading process timeout callback
 *	and initializes loading values.
 */
void EDVImbrQueueLoadingProcess(edv_imbr_struct *imbr)
{
	if(imbr == NULL)
	    return;

	/* Remove previous loading timeout callback as needed */
	if(imbr->loading_tocb > 0)
	{
	    gtk_timeout_remove(imbr->loading_tocb);
	    imbr->loading_tocb = 0;
	}
	while(imbr->passive_busy_count > 0)
	    EDVImbrSetPassiveBusy(imbr, FALSE);

	/* Reset stop count */
	imbr->stop_count = 0;

	/* Set new loading timeout */
	imbr->loading_tocb = gtk_timeout_add(
	    100l,
	    EDVImbrLoadingTOCB, imbr
	);

	EDVImbrSetPassiveBusy(imbr, TRUE);
}


/*
 *	Clears the Image Browser's Thumbs List and resets all loading
 *	procedure values, then loads the listing for the new directory
 *	specified by path.
 */
void EDVImbrSelectPath(edv_imbr_struct *imbr, const gchar *path)
{
	gchar *dpath;
	const cfg_item_struct *cfg_list;
	edv_core_struct *core;

	if((imbr == NULL) || STRISEMPTY(path))
	    return;

	core = imbr->core;
	if(core == NULL)
	    return;

	cfg_list = core->cfg_list;

	dpath = STRDUP(path);
	if(dpath == NULL)
	    return;

	/* Remove previous loading timeout callback as needed */
	if(imbr->loading_tocb > 0)
	{
	    gtk_timeout_remove(imbr->loading_tocb);
	    imbr->loading_tocb = 0;
	}
	while(imbr->passive_busy_count > 0)
	    EDVImbrSetPassiveBusy(imbr, FALSE);

	/* Update Title & Location Bar */
	EDVImbrSetTitle(imbr, dpath);
	EDVImbrSetLocation(imbr, dpath, FALSE);
	EDVImbrUpdateLocationIcon(imbr, dpath);

	/* Get new listing  */
	EDVImbrTListGetListing(
	    imbr, dpath,
	    EDV_GET_B(EDV_CFG_PARM_LISTS_ANIMATE_UPDATES)
	);

	/* Set loading progress timeout callback and reset loading
	 * progress values
	 */
	EDVImbrQueueLoadingProcess(imbr);

	g_free(dpath);
}


/*
 *	Creates a new Image Browser Operation IDs list.
 */
GList *EDVImbrOPIDListNew(edv_imbr_struct *imbr)
{
	const gchar *button_name, *menu_name, *tooltip;
	guint accel_key, accel_mods;
	guint8 **button_icon_data, **menu_icon_data;
	GList *opid_list = NULL;
	toolbar_item_type tb_item_type;
	edv_opid_flags flags;
	edv_imbr_op op;
	edv_imbr_opid_struct *opid;
	void (*func_cb)(toolbar_item_struct *, gint, gpointer);
	void (*enter_func_cb)(toolbar_item_struct *, gint, gpointer);

#define DO_APPEND_OPID	{			\
 opid = EDV_IMBR_OPID(				\
  g_malloc0(sizeof(edv_imbr_opid_struct))	\
 );						\
 if(opid != NULL) {				\
  opid->op = op;				\
  opid->tb_item_type = tb_item_type;		\
  opid->flags = flags;				\
  opid->func_cb = func_cb;			\
  opid->enter_func_cb = enter_func_cb;		\
  opid->button_name = STRDUP(button_name);	\
  opid->menu_name = STRDUP(menu_name);		\
  opid->tooltip = STRDUP(tooltip);		\
  opid->accel_key = accel_key;			\
  opid->accel_mods = accel_mods;		\
  opid->button_icon_data = button_icon_data;	\
  opid->menu_icon_data = menu_icon_data;	\
  opid->imbr = imbr;				\
  opid_list = g_list_append(opid_list, opid);	\
 }						\
}

	func_cb = EDVImbrOPCB;
	enter_func_cb = EDVImbrOPEnterCB;


	op = EDV_IMBR_OP_SEPARATOR;
	flags = EDV_OPID_ALLOW_MULTIPLE | EDV_OPID_NO_OP;
	tb_item_type = TOOLBAR_ITEM_SEPARATOR;
	button_icon_data = (guint8 **)icon_hsep_20x20_xpm;
	menu_icon_data = button_icon_data;
#if defined(PROG_LANGUAGE_SPANISH)
	button_name = "Separador";
	menu_name = "Separador";
	tooltip = "Separador";
#elif defined(PROG_LANGUAGE_FRENCH)
	button_name = "Séparateur";
	menu_name = "Séparateur";
	tooltip = "Séparateur";
#elif defined(PROG_LANGUAGE_GERMAN)
	button_name = "Separator";
	menu_name = "Separator";
	tooltip = "Separator";
#elif defined(PROG_LANGUAGE_ITALIAN)
	button_name = "Separatore";
	menu_name = "Separatore";
	tooltip = "Separatore";
#elif defined(PROG_LANGUAGE_DUTCH)
	button_name = "Separator";
	menu_name = "Separator";
	tooltip = "Separator";
#elif defined(PROG_LANGUAGE_PORTUGUESE)
	button_name = "Separador";
	menu_name = "Separador";
	tooltip = "Separador";
#elif defined(PROG_LANGUAGE_NORWEGIAN)
	button_name = "Separator";
	menu_name = "Separator";
	tooltip = "Separator";
#else
	button_name = "Separator";
	menu_name = "Separator";
	tooltip = "Separator";
#endif
	accel_key = 0;
	accel_mods = 0;
	DO_APPEND_OPID


	op = EDV_IMBR_OP_CLOSE;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_close_20x20_xpm;
	menu_icon_data = button_icon_data;
#ifdef PROG_LANGUAGE_ENGLISH
	button_name = "Close";
	menu_name = "Close";
	tooltip = "Close this window";
#endif
#ifdef PROG_LANGUAGE_SPANISH
	button_name = "Cierre";
	menu_name = "Cierre";
	tooltip = "Cierre esta ventana";
#endif
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "Fermer";
	menu_name = "Fermer";
	tooltip = "Fermer cette fenêtre";
#endif
	accel_key = GDK_w;
	accel_mods = GDK_CONTROL_MASK;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_EXIT;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_exit_20x20_xpm;
	menu_icon_data = button_icon_data;
#ifdef PROG_LANGUAGE_ENGLISH
	button_name = "Exit";
	menu_name = "Exit";
	tooltip = "Close all windows in the application and exit";
#endif
#ifdef PROG_LANGUAGE_SPANISH
	button_name = "La Salida";
	menu_name = "La Salida";
	tooltip = "Cierra todas ventanas en la aplicación y la";
#endif
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "Quitter";
	menu_name = "Quitter";
	tooltip = "Ferme toutes fenêtres de l'application et sortir";
#endif
	accel_key = GDK_q;
	accel_mods = GDK_CONTROL_MASK;
	DO_APPEND_OPID


	op = EDV_IMBR_OP_SYNC_DISKS;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_save_20x20_xpm;
	menu_icon_data = button_icon_data;
#ifdef PROG_LANGUAGE_ENGLISH
	button_name = "Sync Disks";
	menu_name = "Sync Disks";
	tooltip = "Flush any pending data transfers to disk";
#endif
#ifdef PROG_LANGUAGE_SPANISH
	button_name = "Sincronizar Discos";
	menu_name = "Sincronizar Discos";
	tooltip = "Limpían cualquiera transferencias pendientes de datos al disco";
#endif
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "Synchronise";
	menu_name = "Synchronise Les Disques";
	tooltip = "Effectuer des transferts de données en attente pour le disque";
#endif
	accel_key = 0;
	accel_mods = 0;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_HISTORY;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_trace_20x20_xpm;
	menu_icon_data = button_icon_data;
#ifdef PROG_LANGUAGE_ENGLISH
	button_name = "History";
	menu_name = "History...";
	tooltip = "History of commands processed by this application";
#endif
#ifdef PROG_LANGUAGE_SPANISH
	button_name = "Historia";
	menu_name = "La Historia...";
	tooltip = "La Historia de órdenes procesadas por esta aplicación";
#endif
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "Historique";
	menu_name = "Historique...";
	tooltip = "Historique des commandes effectuées dans cette application";
#endif
	accel_key = 0;
	accel_mods = 0;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_RUN;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_run_20x20_xpm;
	menu_icon_data = button_icon_data;
#ifdef PROG_LANGUAGE_ENGLISH
	button_name = "Run";
	menu_name = "Run...";
	tooltip = "Run a program";
#endif
#ifdef PROG_LANGUAGE_SPANISH
	button_name = "Corra";
	menu_name = "Corra...";
	tooltip = "Corra un programa";
#endif
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "Exécuter";
	menu_name = "Exécuter...";
	tooltip = "Exécute un programme";
#endif
	accel_key = GDK_r;
	accel_mods = GDK_CONTROL_MASK;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_RUN_TERMINAL;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_terminal_20x20_xpm;
	menu_icon_data = button_icon_data;
#ifdef PROG_LANGUAGE_ENGLISH
	button_name = "Terminal";
	menu_name = "Terminal";
	tooltip = "Run a terminal";
#endif
#ifdef PROG_LANGUAGE_SPANISH
	button_name = "La Terminal";
	menu_name = "La Terminal";
	tooltip = "Corre una terminal";
#endif
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "Terminal";
	menu_name = "Terminal";
	tooltip = "Ouvrir un terminal";
#endif
	accel_key = 0;
	accel_mods = 0;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_WRITE_PROTECT;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_secure_20x20_xpm;
	menu_icon_data = button_icon_data;
#ifdef PROG_LANGUAGE_ENGLISH
	button_name = "Protect";
	menu_name = "Write Protect";
	tooltip = "Enable/disable write protect";
#endif
#ifdef PROG_LANGUAGE_SPANISH
	button_name = "Proteja";
	menu_name = "Proteja contra escritura";
	tooltip = "Habilite/inhabilita la proteccion contra escritura";
#endif
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "Protége";
	menu_name = "Protége En écriture";
	tooltip = "En-service/Hors-service la protection écriture";
#endif
	accel_key = GDK_y;
	accel_mods = GDK_CONTROL_MASK;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_DELETE_METHOD_RECYCLE;
	tb_item_type = TOOLBAR_ITEM_TOGGLE_BUTTON;
	flags = 0;
	button_icon_data = (guint8 **)icon_trash_20x20_xpm;
	menu_icon_data = button_icon_data;
	button_name = "Recycle";
	menu_name = "Delete Method: Recycle";
	tooltip = "Set the delete method to recycle";
	accel_key = 0;
	accel_mods = 0;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_DELETE_METHOD_PURGE;
	tb_item_type = TOOLBAR_ITEM_TOGGLE_BUTTON;
	flags = 0;
	button_icon_data = (guint8 **)icon_purge_20x20_xpm;
	menu_icon_data = button_icon_data;
	button_name = "Purge";
	menu_name = "Delete Method: Purge";
	tooltip = "Set the delete method to purge";
	accel_key = 0;
	accel_mods = 0;
	DO_APPEND_OPID


	op = EDV_IMBR_OP_NEW;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_new_20x20_xpm;
	menu_icon_data = button_icon_data;
#ifdef PROG_LANGUAGE_ENGLISH
	button_name = "New";
	menu_name = "New";
	tooltip = "Create a new object";
#endif
#ifdef PROG_LANGUAGE_SPANISH
	button_name = "Nuevo";
	menu_name = "Nuevo";
	tooltip = "Crea un objeto nuevo";
#endif
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "Nouveau";
	menu_name = "Nouveau";
	tooltip = "Créer un nouvel objet";
#endif
	accel_key = GDK_n;
	accel_mods = GDK_CONTROL_MASK;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_NEW_FILE;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_file_20x20_xpm;
	menu_icon_data = button_icon_data;
#ifdef PROG_LANGUAGE_ENGLISH
	button_name = "New File";
	menu_name = "File";
	tooltip = "Create a new file object";
#endif
#ifdef PROG_LANGUAGE_SPANISH
	button_name = "Archivo";
	menu_name = "El Archivo";
	tooltip = "Crea un objeto nuevo del archivo";
#endif
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "Fichier";
	menu_name = "Fichier";
	tooltip = "Créer un nouvel objet de fichier";
#endif
	accel_key = 0;
	accel_mods = 0;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_NEW_DIRECTORY;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_folder_closed_20x20_xpm;
	menu_icon_data = button_icon_data;
#ifdef PROG_LANGUAGE_ENGLISH
	button_name = "New Dir";
	menu_name = "Directory";
	tooltip = "Create a new directory object";
#endif
#ifdef PROG_LANGUAGE_SPANISH
	button_name = "Carpeta";
	menu_name = "Carpeta";
	tooltip = "Crea una nueva carpeta";
#endif
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "Répertoire";
	menu_name = "Répertoire";
	tooltip = "Créer un nouvel objet Répertoire";
#endif
	accel_key = 0;
	accel_mods = 0;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_NEW_LINK;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_link2_20x20_xpm;
	menu_icon_data = button_icon_data;
#ifdef PROG_LANGUAGE_ENGLISH
	button_name = "New Lnk";
	menu_name = "Link";
	tooltip = "Create a new symbolic link object";
#endif
#ifdef PROG_LANGUAGE_SPANISH
	button_name = "Enlace";
	menu_name = "Enlace";
	tooltip = "Crea un enlace simbólico nuevo";
#endif
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "Lien";
	menu_name = "Lien";
	tooltip = "Crée un nouveau lien symbolique";
#endif
	accel_key = 0;
	accel_mods = 0;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_NEW_FIFO;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_pipe_20x20_xpm;
	menu_icon_data = button_icon_data;
#ifdef PROG_LANGUAGE_ENGLISH
	button_name = "New FIFO";
	menu_name = "FIFO Pipe";
	tooltip = "Create a new FIFO pipe object";
#endif
#ifdef PROG_LANGUAGE_SPANISH
	button_name = "FIFO";
	menu_name = "FIFO Tubo";
	tooltip = "Crea un objeto nuevo de tubo de FIFO";
#endif
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "Tube FIFO";
	menu_name = "Tube nommé";
	tooltip = "Créer un nouvel objet Tube nommé FIFO";
#endif
	accel_key = 0;
	accel_mods = 0;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_NEW_DEVICE_BLOCK;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_device_block_20x20_xpm;
	menu_icon_data = button_icon_data;
#ifdef PROG_LANGUAGE_ENGLISH
	button_name = "New BDev";
	menu_name = "Block Device";
	tooltip = "Create a new block (buffered) device node object";
#endif
#ifdef PROG_LANGUAGE_SPANISH
	button_name = "BDispositivo";
	menu_name = "El Dispositivo Del Bloque";
	tooltip = "Crea un objeto nuevo de nodo de Dispositivo de bloque (buffered)";
#endif
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "Périf Bloc";
	menu_name = "Périphérique mode blocs";
	tooltip = "Créer un nouveau périphérique en mode d'accès blocs";
#endif
	accel_key = 0;
	accel_mods = 0;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_NEW_DEVICE_CHARACTER;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_device_character_20x20_xpm;
	menu_icon_data = button_icon_data;
#ifdef PROG_LANGUAGE_ENGLISH
	button_name = "New CDev";
	menu_name = "Character Device";
	tooltip = "Create a new character (unbuffered) device node object";
#endif
#ifdef PROG_LANGUAGE_SPANISH
	button_name = "CDispositivo";
	menu_name = "El Dispositivo Del Carácter";
	tooltip = "Crea un objeto nuevo de nodo de Dispositivo de carácter (unbuffered)";
#endif
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "Périf carac";
	menu_name = "Périphérique mode Caractères";
	tooltip = "Créer un nouveau périphérique en mode d'accès caractères";
#endif
	accel_key = 0;
	accel_mods = 0;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_NEW_SOCKET;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_socket_20x20_xpm;
	menu_icon_data = button_icon_data;
#ifdef PROG_LANGUAGE_ENGLISH
	button_name = "New Sock";
	menu_name = "Socket";
	tooltip = "Create a new socket object";
#endif
#ifdef PROG_LANGUAGE_SPANISH
	button_name = "Enchufe";
	menu_name = "El Enchufe";
	tooltip = "Crea un objeto nuevo del enchufe";
#endif
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "Prise Rés";
	menu_name = "Prise réseau";
	tooltip = "Créer un nouvel objet Prise de connexion réseau";
#endif
	accel_key = 0;
	accel_mods = 0;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_OPEN;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_open_20x20_xpm;
	menu_icon_data = button_icon_data;
#ifdef PROG_LANGUAGE_ENGLISH
	button_name = "Open";
	menu_name = "Open";
	tooltip = "Open the selected object(s)";
#endif
#ifdef PROG_LANGUAGE_SPANISH
	button_name = "Abrir";
	menu_name = "Abrir";
	tooltip = "Abre archivo(s) escogido(s)";
#endif
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "Ouvrir";
	menu_name = "Ouvrir";
	tooltip = "Ouvrir l'objet choisi";
#endif
	accel_key = GDK_Return;
	accel_mods = 0;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_OPEN_TO;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_open_20x20_xpm;
	menu_icon_data = NULL;
	button_name = "Open To";
	menu_name = "Open To";
	tooltip = "Open the selected object(s) using a specific method";
	accel_key = GDK_Return;
	accel_mods = GDK_CONTROL_MASK | GDK_SHIFT_MASK;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_OPEN_WITH;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_open_20x20_xpm;
	menu_icon_data = NULL;
#ifdef PROG_LANGUAGE_ENGLISH
	button_name = "Open With";
	menu_name = "Open With...";
	tooltip = "Open the selected object(s) using a specific application";
#endif
#ifdef PROG_LANGUAGE_SPANISH
	button_name = "Abrir con";
	menu_name = "Abrir con...";
	tooltip = "Abrir archivo escogido usando un método específico";
#endif
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "Ouvrir Avec";
	menu_name = "Ouvrir Avec...";
	tooltip = "Ouvrir l'objet choisi en utilisant une méthode spécifique";
#endif
	accel_key = GDK_Return;
	accel_mods = GDK_SHIFT_MASK;
	DO_APPEND_OPID


	op = EDV_IMBR_OP_COPY_PATH;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_copy_20x20_xpm;
	menu_icon_data = button_icon_data;
#ifdef PROG_LANGUAGE_ENGLISH
	button_name = "CopyPath";
	menu_name = "Copy Path";
	tooltip = "Copy the location of the selected object(s) as path(s)";
#endif
#ifdef PROG_LANGUAGE_SPANISH
	button_name = "CopiSende";
	menu_name = "Copie Sendero";
	tooltip = "Copia la ubicación del objeto(s) escogido como sendero(s)";
#endif
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "CopiRep";
	menu_name = "Copier Le répertoire";
	tooltip = "Copier l'emplacement de l'objet choisi(s) comme un répertoire)";
#endif
	accel_key = GDK_c;
	accel_mods = GDK_CONTROL_MASK;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_COPY_URL;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_copy_20x20_xpm;
	menu_icon_data = button_icon_data;
#ifdef PROG_LANGUAGE_ENGLISH
	button_name = "CopyURL";
	menu_name = "Copy URL";
	tooltip = "Copy the location of the selected object(s) as url(s)";
#endif
#ifdef PROG_LANGUAGE_SPANISH
	button_name = "CopiURL";
	menu_name = "Copie URL";
	tooltip = "Copie la ubicación del objeto(s) escogido como url(s)";
#endif
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "CopiURL";
	menu_name = "Copier URL";
	tooltip = "Copier l'emplacement de l'objet choisi(s) comme url(s)";
#endif
	accel_key = GDK_c;
	accel_mods = GDK_CONTROL_MASK | GDK_SHIFT_MASK;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_PASTE;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_paste_20x20_xpm;
	menu_icon_data = button_icon_data;
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "Coller";
	menu_name = "Coller";
	tooltip = "Coller object(s) depuis la soure(s)";
#else
	button_name = "Paste";
	menu_name = "Paste";
	tooltip = "Paste object(s) from coppied location source(s)";
#endif
	accel_key = GDK_v;
	accel_mods = GDK_CONTROL_MASK;
	DO_APPEND_OPID


	op = EDV_IMBR_OP_MOVE;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_move_file_20x20_xpm;
	menu_icon_data = button_icon_data;
#ifdef PROG_LANGUAGE_ENGLISH
	button_name = "Move";
	menu_name = "Move...";
	tooltip = "Move the selected object(s)";
#endif
#ifdef PROG_LANGUAGE_SPANISH
	button_name = "Mueva";
	menu_name = "Mueva...";
	tooltip = "Mueva objetos escogido(s)";
#endif
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "Déplacer";
	menu_name = "Déplacer...";
	tooltip = "Déplacer l'objet choisi(s)";
#endif
	accel_key = GDK_F7;
	accel_mods = 0;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_COPY;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_copy_file_20x20_xpm;
	menu_icon_data = button_icon_data;
#ifdef PROG_LANGUAGE_ENGLISH
	button_name = "Copy";
	menu_name = "Copy...";
	tooltip = "Copy the selected object(s)";
#endif
#ifdef PROG_LANGUAGE_SPANISH
	button_name = "Copia";
	menu_name = "Copia...";
	tooltip = "Copia objetos escogido(s)";
#endif
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "Copier";
	menu_name = "Copier...";
	tooltip = "Copier l'objet choisi(s)";
#endif
	accel_key = GDK_F8;
	accel_mods = 0;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_LINK;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_link2_20x20_xpm;
	menu_icon_data = button_icon_data;
#ifdef PROG_LANGUAGE_ENGLISH
	button_name = "Link";
	menu_name = "Link...";
	tooltip = "Link the selected object(s)";
#endif
#ifdef PROG_LANGUAGE_SPANISH
	button_name = "Enlace";
	menu_name = "Enlace...";
	tooltip = "Enlace objetos escogido(s)";
#endif
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "Lier";
	menu_name = "Lier...";
	tooltip = "Lier l'objet(s) choisi";
#endif
	accel_key = GDK_F6;
	accel_mods = 0;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_RENAME;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_rename_20x20_xpm;
	menu_icon_data = button_icon_data;
#ifdef PROG_LANGUAGE_ENGLISH
	button_name = "Rename";
	menu_name = "Rename";
	tooltip = "Rename the selected object";
#endif
#ifdef PROG_LANGUAGE_SPANISH
	button_name = "Renombrar";
	menu_name = "Renombrar";
	tooltip = "Renombrar archivo escogido";
#endif
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "Renommer";
	menu_name = "Renommer";
	tooltip = "Renomme l'objet choisi";
#endif
	accel_key = GDK_F2;
	accel_mods = 0;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_CHMOD;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_chmod_20x20_xpm;
	menu_icon_data = button_icon_data;
#ifdef PROG_LANGUAGE_ENGLISH
	button_name = "ChMod";
	menu_name = "Change Permissions...";
	tooltip = "Change the permissions of the selected object(s)";
#endif
#ifdef PROG_LANGUAGE_SPANISH
	button_name = "ChMod";
	menu_name = "Cambie permisos...";
	tooltip = "Cambiar los permisos de los objetos escogidos";
#endif
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "ChMod";
	menu_name = "Changer Mode...";
	tooltip = "Changer les permissions de l'objet(s) choisi";
#endif
	accel_key = GDK_F9;
	accel_mods = 0;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_CHOWN;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_owned_20x20_xpm;
	menu_icon_data = button_icon_data;
#ifdef PROG_LANGUAGE_ENGLISH
	button_name = "ChOwn";
	menu_name = "Change Ownership...";
	tooltip = "Change the ownership of the selected object(s)";
#endif
#ifdef PROG_LANGUAGE_SPANISH
	button_name = "ChOwn";
	menu_name = "Change Ownership...";
	tooltip = "Chown escogido(s)";
#endif
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "ChOwn";
	menu_name = "Changer propriétaire...";
	tooltip = "Changer le propriétaire de l'objet(s)";
#endif
	accel_key = GDK_F10;
	accel_mods = 0;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_CHTIME;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_time_stamp_20x20_xpm;
	menu_icon_data = button_icon_data;
	button_name = "ChTime";
	menu_name = "Change Time Stamps...";
	tooltip = "Change the time stamps of the selected object(s)";
	accel_key = GDK_F11;
	accel_mods = 0;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_DELETE;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_cancel_20x20_xpm;
	menu_icon_data = button_icon_data;
#ifdef PROG_LANGUAGE_ENGLISH
	button_name = "Delete";
	menu_name = "Delete";
	tooltip = "Delete the selected object(s)";
#endif
#ifdef PROG_LANGUAGE_SPANISH
	button_name = "Borre";
	menu_name = "Borre";
	tooltip = "Borre objetos escogido(s)";
#endif
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "Supprimer";
	menu_name = "Supprimer";
	tooltip = "Supprime l'objet(s) choisi";
#endif
	accel_key = GDK_Delete;
	accel_mods = 0;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_PROPERTIES;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_properties2_20x20_xpm;
	menu_icon_data = button_icon_data;
#ifdef PROG_LANGUAGE_ENGLISH
	button_name = "Properties";
	menu_name = "Properties...";
	tooltip = "Modify the selected object's properties";
#endif
#ifdef PROG_LANGUAGE_SPANISH
	button_name = "Props";
	menu_name = "Las Propiedades";
	tooltip = "Modifican escogió las propiedades de objeto";
#endif
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "Props";
	menu_name = "Modifier Propriétés";
	tooltip = "Modifier les propriétés de l'objet";
#endif
	accel_key = GDK_Return;
	accel_mods = GDK_CONTROL_MASK;
	DO_APPEND_OPID


	op = EDV_IMBR_OP_SELECT_ALL;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_select_all_20x20_xpm;
	menu_icon_data = NULL;
#ifdef PROG_LANGUAGE_ENGLISH
	button_name = "SelAll";
	menu_name = "Select All";
	tooltip = "Select all objects";
#endif
#ifdef PROG_LANGUAGE_SPANISH
	button_name = "SelAll";
	menu_name = "Escoja Todo";
	tooltip = "Escoge todo";
#endif
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "SelAll";
	menu_name = "Choisir Tous";
	tooltip = "Choisir tous objets";
#endif
	accel_key = GDK_a;
	accel_mods = GDK_CONTROL_MASK;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_UNSELECT_ALL;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_unselect_all_20x20_xpm;
	menu_icon_data = NULL;
#ifdef PROG_LANGUAGE_ENGLISH
	button_name = "UnSelAll";
	menu_name = "Unselect All";
	tooltip = "Unselect all objects";
#endif
#ifdef PROG_LANGUAGE_SPANISH
	button_name = "UnSelAll";
	menu_name = "Unescoja Todo";
	tooltip = "Unescoge todo";
#endif
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "UnSelAll";
	menu_name = "Choisir aucun";
	tooltip = "Aucun objet choisi";
#endif
	accel_key = GDK_u;
	accel_mods = GDK_CONTROL_MASK;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_INVERT_SELECTION;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_invert_selection_20x20_xpm;
	menu_icon_data = NULL;
#ifdef PROG_LANGUAGE_ENGLISH
	button_name = "InvSel";
	menu_name = "Invert Selection";
	tooltip =
 "Select all unselected objects and unselect all selected objects";
#endif
#ifdef PROG_LANGUAGE_SPANISH
	button_name = "InvSel";
	menu_name = "Invierta Selección";
	tooltip =
 "Selectos todos objetos y unselect no seleccionados todos objetos escogidos";
#endif
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "InvSel";
	menu_name = "Inverser Sélection";
	tooltip = "Inverser les objets sélectionnés";

#endif
	accel_key = GDK_i;
	accel_mods = GDK_CONTROL_MASK;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_FIND;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_search_20x20_xpm;
	menu_icon_data = button_icon_data;
#ifdef PROG_LANGUAGE_ENGLISH
	button_name = "Find";
	menu_name = "Find...";
	tooltip = "Find object(s) by specific attributes";
#endif
#ifdef PROG_LANGUAGE_SPANISH
	button_name = "Buscar";
	menu_name = "Buscar";
	tooltip = "Buscar objeto(s) por atributos especificados";
#endif
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "Find";
	menu_name = "Recherche";
	tooltip = "Rechercher un objet suivant les attributs spécifiés ";
#endif
	accel_key = GDK_f;
	accel_mods = GDK_CONTROL_MASK;
	DO_APPEND_OPID


	op = EDV_IMBR_OP_DOWNLOAD;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_download_file_20x20_xpm;
	menu_icon_data = button_icon_data;
#ifdef PROG_LANGUAGE_ENGLISH
	button_name = "Download";
	menu_name = "Download";
	tooltip = "Download an object";
#endif
#ifdef PROG_LANGUAGE_SPANISH
	button_name = "Download";
	menu_name = "Download";
	tooltip = "Download del objeto";
#endif
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "Descendre";
	menu_name = "Descendre";
	tooltip = "Descendre l'objet (download)";
#endif
	accel_key = 0;
	accel_mods = 0;
	DO_APPEND_OPID


	op = EDV_IMBR_OP_REFRESH;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_reload_20x20_xpm;
	menu_icon_data = button_icon_data;
#ifdef PROG_LANGUAGE_ENGLISH
	button_name = "Refresh";
	menu_name = "Refresh";
	tooltip = "Refresh the thumbs list";
#endif
#ifdef PROG_LANGUAGE_SPANISH
	button_name = "Refresque";
	menu_name = "Refresque";
	tooltip = "Refresque la carpeta escogida para listar";
#endif
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "Rafraîchir";
	menu_name = "Rafraîchir";
	tooltip = "Rafraîchit le répertoire sélectionné";
#endif
	accel_key = GDK_F5;
	accel_mods = 0;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_REFRESH_ALL;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_reload_20x20_xpm;
	menu_icon_data = button_icon_data;
#ifdef PROG_LANGUAGE_ENGLISH
	button_name = "Refresh All";
	menu_name = "Refresh All";
	tooltip = "Refresh all listings";
#endif
#ifdef PROG_LANGUAGE_SPANISH
	button_name = "Refresque Todo";
	menu_name = "Refresque Todo";
	tooltip = "Refresca todas listas";
#endif
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "Rafraîchir Tout";
	menu_name = "Rafraîchir Tout";
	tooltip = "Rafraîchir toutes listes";
#endif
	accel_key = 0;
	accel_mods = 0;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_GOTO_PARENT;	
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_folder_parent_20x20_xpm;
	menu_icon_data = button_icon_data;
#ifdef PROG_LANGUAGE_ENGLISH
	button_name = "Parent";
	menu_name = "Go To Parent";
	tooltip = "Go to the parent directory";
#endif
#ifdef PROG_LANGUAGE_SPANISH
	button_name = "Carpeta padre";
	menu_name = "Ir a carpeta padre";
	tooltip = "Para ir a carpeta padre";
#endif
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "Parent";
	menu_name = "Aller Au Parent";
	tooltip = "Aller au répertoire parent";
#endif
	accel_key = GDK_BackSpace;
	accel_mods = 0;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_GOTO_HOME;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_folder_home_20x20_xpm;
	menu_icon_data = button_icon_data;
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "Accueil";
	menu_name = "Aller à l'accueil";
	tooltip = "Aller au répertoire d'accueil (HOME)";
#else
	button_name = "Home";
	menu_name = "Go To Home";
	tooltip = "Go to the home directory";
#endif
	accel_key = GDK_grave;
	accel_mods = 0;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_STOP;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_stop_20x20_xpm;
	menu_icon_data = button_icon_data;
#ifdef PROG_LANGUAGE_ENGLISH
	button_name = "Stop";
	menu_name = "Stop Loading";
	tooltip = "Stop the loading process";
#endif
#ifdef PROG_LANGUAGE_SPANISH
	button_name = "Parada";
	menu_name = "La Parada Cargando";
	tooltip = "Para el proceso que carga";
#endif
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "Arrêt";
	menu_name = "Arrêt du chargement";
	tooltip = "Arrête le procédé de chargement (download)";
#endif
	accel_key = 0;
	accel_mods = 0;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_CONTINUE;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_run_20x20_xpm;
	menu_icon_data = button_icon_data;
#ifdef PROG_LANGUAGE_ENGLISH
	button_name = "Continue";
	menu_name = "Continue Loading";
	tooltip = "Continue the loading process";
#endif
#ifdef PROG_LANGUAGE_SPANISH
	button_name = "Continúe";
	menu_name = "Siga Carga";
	tooltip = "Continúe el proceso que carga";
#endif
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "Poursuivre";
	menu_name = "Poursuivre le Chargement";
	tooltip = "Poursuivre le procédé de chargement";
#endif
	accel_key = 0;
	accel_mods = 0;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_PRESENTATION_MODE;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_monitor_20x20_xpm;
	menu_icon_data = button_icon_data;
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "Diaporama";
	menu_name = "Présentation en mode Diaporama";
	tooltip = "Commuter en mode présentation Diaporama (plein écran)";
#else
	button_name = "Present";
	menu_name = "Presentation Mode";
	tooltip = "Switch to presentation mode (fullscreen slideshow)";
#endif
	accel_key = GDK_F11;
	accel_mods = GDK_CONTROL_MASK;
	DO_APPEND_OPID 




	op = EDV_IMBR_OP_SHOW_TOOL_BAR;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_TOGGLE_BUTTON;
	button_icon_data = (guint8 **)icon_tool_bar_20x20_xpm;
	menu_icon_data = button_icon_data;
#ifdef PROG_LANGUAGE_ENGLISH
	button_name = "ToolBar";
	menu_name = "Tool Bar";
	tooltip = "Show/hide tool bar";
#endif
#ifdef PROG_LANGUAGE_SPANISH
	button_name = "ToolBar";
	menu_name = "Tool Bar";
	tooltip = "La Exposición/la barra de herramienta de cuero";
#endif
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "Outils";
	menu_name = "Barre d'outils";
	tooltip = "Monter/cacher la barre d'outil";
#endif
	accel_key = 0;
	accel_mods = 0;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_SHOW_LOCATION_BAR;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_TOGGLE_BUTTON;
	button_icon_data = (guint8 **)icon_tool_bar_20x20_xpm;
	menu_icon_data = button_icon_data;
#ifdef PROG_LANGUAGE_ENGLISH
	button_name = "LocBar";
	menu_name = "Location Bar";
	tooltip = "Show/hide location bar";
#endif
#ifdef PROG_LANGUAGE_SPANISH
	button_name = "LocBar";
	menu_name = "Location Bar";
	tooltip = "La exposición/la barra de la ubicación del cuero";
#endif
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "Adresse";
	menu_name = "Barre d'adresse";
	tooltip = "Monter/cacher la barre d'emplacement";
#endif
	accel_key = 0;
	accel_mods = 0;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_SHOW_MOUNT_BAR;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_TOGGLE_BUTTON;
	button_icon_data = (guint8 **)icon_tool_bar_20x20_xpm;
	menu_icon_data = button_icon_data;
#ifdef PROG_LANGUAGE_ENGLISH
	button_name = "MountBar";
	menu_name = "Mount Bar";
	tooltip = "Show/hide mount bar";
#endif
#ifdef PROG_LANGUAGE_SPANISH
	button_name = "MountBar";
	menu_name = "Mount Bar";
	tooltip = "La Exposición/la barra del monte del cuero";
#endif
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "Montage";
	menu_name = "Barre de montage";
	tooltip = "Monter/cacher la barre de montage";
#endif
	accel_key = 0;
	accel_mods = 0;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_SHOW_FIND_BAR;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_TOGGLE_BUTTON;
	button_icon_data = (guint8 **)icon_tool_bar_20x20_xpm;
	menu_icon_data = button_icon_data;
#ifdef PROG_LANGUAGE_ENGLISH
	button_name = "FindBar";
	menu_name = "Find Bar";
	tooltip = "Show/hide find bar";
#endif
#ifdef PROG_LANGUAGE_SPANISH
	button_name = "FindBar";
	menu_name = "Find Bar";
	tooltip = "La exposición/la barra del hallazgo del cuero";
#endif
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "Recherche";
	menu_name = "Barre de recherche";
	tooltip = "Monter/cacher la barre de recherche";
#endif
	accel_key = 0;
	accel_mods = 0;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_SHOW_STATUS_BAR;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_TOGGLE_BUTTON;
	button_icon_data = (guint8 **)icon_status_bar_20x20_xpm;
	menu_icon_data = button_icon_data;
#ifdef PROG_LANGUAGE_ENGLISH
	button_name = "StatusBar";
	menu_name = "Status Bar";
	tooltip = "Show/hide status bar";
#endif
#ifdef PROG_LANGUAGE_SPANISH
	button_name = "StatusBar";
	menu_name = "Status Bar";
	tooltip = "La exposición/la barra de la posición del cuero";
#endif
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "Etat";
	menu_name = "Barre d'état";
	tooltip = "Monter/cacher la barre d'état";
#endif
	accel_key = 0;
	accel_mods = 0;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_THUMBS_LIST_FILTER;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_wildcards_20x20_xpm;
	menu_icon_data = button_icon_data;
	button_name = "Filter";
	menu_name = "Set Filter...";
	tooltip = "Set the name filter for listing objects";
	accel_key = 0;
	accel_mods = 0;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_SHOW_HIDDEN_OBJECTS;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_TOGGLE_BUTTON;
	button_icon_data = (guint8 **)icon_file_20x20_xpm;
	menu_icon_data = NULL;
#if defined(PROG_LANGUAGE_FRENCH)
	button_name = "HidObj";
	menu_name = "Objets Cachés";
	tooltip = "Monter/cacher objets cachés(.)";
#else
	button_name = "HidObj";
	menu_name = "Hidden Objects";
	tooltip = "Show/hide hidden objects";
#endif
	accel_key = 0;
	accel_mods = 0;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_SHOW_NOACCESS_OBJECTS;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_TOGGLE_BUTTON;
	button_icon_data = (guint8 **)icon_file_20x20_xpm;
	menu_icon_data = NULL;
#if defined(PROG_LANGUAGE_FRENCH)
	button_name = "NoAccObj";
	menu_name = "Objet à accès réservé";
	tooltip = "Monter/cacher les objets à accès réservé";
#else
	button_name = "NoAccObj";
	menu_name = "No Access Objects";
	tooltip = "Show/hide no access objects";
#endif
	accel_key = 0;
	accel_mods = 0;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_SHOW_NONIMAGE_OBJECTS;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_TOGGLE_BUTTON;
	button_icon_data = (guint8 **)icon_file_20x20_xpm;
	menu_icon_data = NULL;
#if defined(PROG_LANGUAGE_FRENCH)
	button_name = "NonImgObj";
	menu_name = "Autres qu'Image";
	tooltip = "Monter/cacher les objets non-image";
#else
	button_name = "NonImgObj";
	menu_name = "Non-Image Objects";
	tooltip = "Show/hide non-image objects";
#endif
	accel_key = 0;
	accel_mods = 0;
	DO_APPEND_OPID


	op = EDV_IMBR_OP_MOUNT;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_mount_20x20_xpm;
	menu_icon_data = button_icon_data;
#ifdef PROG_LANGUAGE_ENGLISH
	button_name = "Mount";
	menu_name = "Mount";
	tooltip = "Mount/unmount selected mount point directory";
#endif
#ifdef PROG_LANGUAGE_SPANISH
	button_name = "Montar";
	menu_name = "Montar";
	tooltip = "Montar/desmontar carpeta de punto de montaje seleccionada";
#endif
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "Monter";
	menu_name = "Monter...";
	tooltip = "Monter/démonter le composant sur le répertoire de montage";
#endif
	accel_key = 0;
	accel_mods = 0;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_EJECT;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_eject_20x20_xpm;
	menu_icon_data = button_icon_data;
#ifdef PROG_LANGUAGE_ENGLISH
	button_name = "Eject";
	menu_name = "Eject";
	tooltip = "Eject media from device";
#endif
#ifdef PROG_LANGUAGE_SPANISH
	button_name = "Expulse";
	menu_name = "Expulse";
	tooltip = "Expulse medios del Dispositivo";
#endif
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "Ejecter";
	menu_name = "Ejecter";
	tooltip = "Ejecter le support du composant";
#endif
	accel_key = 0;
	accel_mods = 0;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_DEVICE_CHECK;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_fsck_20x20_xpm;
	menu_icon_data = button_icon_data;
#ifdef PROG_LANGUAGE_ENGLISH
	button_name = "FSCK";
	menu_name = "File System Check...";
	tooltip = "Check the device's file system";
#endif
#ifdef PROG_LANGUAGE_SPANISH
	button_name = "FSCK";
	menu_name = "Archive Cheque De Sistema...";
	tooltip = "Verifique el sistema del archivo de Dispositivo";
#endif
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "FSCK";
	menu_name = "Vérifier le système de fichier...";
	tooltip = "Vérifier le système de fichier du composant";
#endif
	accel_key = 0;
	accel_mods = 0;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_DEVICE_TOOLS;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_tools_20x20_xpm;
	menu_icon_data = button_icon_data;
#ifdef PROG_LANGUAGE_ENGLISH
	button_name = "DevTool";
	menu_name = "Device Tools...";
	tooltip = "Run the device's tools program";
#endif
#ifdef PROG_LANGUAGE_SPANISH
	button_name = "DevTool";
	menu_name = "Herramienta Equipar Dispositivo  ...";
	tooltip = "Corra el programa de herramientas de Dispositivo";
#endif
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "Panneau";
	menu_name = "Panneau du composant...";
	tooltip = "Ouvrir le panneau de commande du composant";
#endif
	accel_key = 0;
	accel_mods = 0;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_DEVICE_FORMAT;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_floppy_20x20_xpm;
	menu_icon_data = button_icon_data;
#ifdef PROG_LANGUAGE_ENGLISH
	button_name = "Format";
	menu_name = "Format Media...";
	tooltip = "Format the media in the device";
#endif
#ifdef PROG_LANGUAGE_SPANISH
	button_name = "Format";
	menu_name = "Formatear Medios...";
	tooltip = "Formatear los medios en el Dispositivo";
#endif
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "Formatter";
	menu_name = "Formatter le composant...";
	tooltip = "Formatter le support dans le composant";
#endif
	accel_key = 0;
	accel_mods = 0;
	DO_APPEND_OPID


	op = EDV_IMBR_OP_MIME_TYPES;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_mimetypes_20x20_xpm;
	menu_icon_data = button_icon_data;
#ifdef PROG_LANGUAGE_ENGLISH
	button_name = "MIMETypes";
	menu_name = "MIME Types...";
	tooltip = "View/modify MIME Types";
#endif
#ifdef PROG_LANGUAGE_SPANISH
	button_name = "MIMETypes";
	menu_name = "MIME Types...";
	tooltip = "El panorama/modifica MIME Types";
#endif
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "MIMETypes";
	menu_name = "MIME Types...";
	tooltip = "Voir/modifier MIME Types";
#endif
	accel_key = GDK_m;
	accel_mods = GDK_CONTROL_MASK;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_DEVICES;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_devices_list_20x20_xpm;
	menu_icon_data = button_icon_data;
#ifdef PROG_LANGUAGE_ENGLISH
	button_name = "Devices";
	menu_name = "Devices...";
	tooltip = "View/modify file system device references";
#endif
#ifdef PROG_LANGUAGE_SPANISH
	button_name = "Dispositivos";
	menu_name = "Los Dispositivos...";
	tooltip = "El Panorama/modifica las referencias de Dispositivo de sistema de archivo";
#endif
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "Composant";
	menu_name = "Composant...";
	tooltip = "Voir/modifier la configuration du système de fichier";
#endif
	accel_key = GDK_d;
	accel_mods = GDK_CONTROL_MASK;
	DO_APPEND_OPID


	op = EDV_IMBR_OP_NEW_BROWSER;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)endeavour_20x20_xpm;
	menu_icon_data = button_icon_data;
#ifdef PROG_LANGUAGE_ENGLISH
	button_name = "FBrowser";
	menu_name = "New File Browser";
	tooltip = "Create a new file browser";
#endif
#ifdef PROG_LANGUAGE_SPANISH
	button_name = "FBrowser";
	menu_name = "Nuevo Examinador De Archivos";
	tooltip = "Muestra un nuevo examinador de archivos";
#endif
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "Dossier";
	menu_name = "Nouveau navigateur de Fichier";
	tooltip = "Créer une nouvelle fenêtre de navigation Dossier";
#endif
	accel_key = GDK_1;
	accel_mods = GDK_CONTROL_MASK;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_NEW_IMBR;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)image_browser_20x20_xpm;
	menu_icon_data = button_icon_data;
#ifdef PROG_LANGUAGE_ENGLISH
	button_name = "IBrowser";
	menu_name = "New Image Browser";
	tooltip = "Create a new image browser";
#endif
#ifdef PROG_LANGUAGE_SPANISH
	button_name = "IBrowser";
	menu_name = "Nuevo Examinador De Imagenes";
	tooltip = "Muestra un nuevo examinador de imagenes";
#endif
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "Galerie";
	menu_name = "Nouveau navigateur de Galerie d'image";
	tooltip = "Créer un nouvelle fenêtre de navigation de galerie d'image";
#endif
	accel_key = GDK_2;
	accel_mods = GDK_CONTROL_MASK;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_NEW_ARCHIVER;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)archiver_20x20_xpm;
	menu_icon_data = button_icon_data;
#ifdef PROG_LANGUAGE_ENGLISH
	button_name = "Archiver";
	menu_name = "New Archiver";
	tooltip = "Create a new archiver";
#endif
#ifdef PROG_LANGUAGE_SPANISH
	button_name = "Archiver";
	menu_name = "Nuevo Compresor De Archivos";
	tooltip = "Muestra un archivo comprimido nuevo";
#endif
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "Archive";
	menu_name = "Nouvelle Archive";
	tooltip = "Créer une nouvelle fenêtre d'archivage";
#endif
	accel_key = GDK_3;
	accel_mods = GDK_CONTROL_MASK;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_RECYCLE_BIN;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_trash_20x20_xpm;
	menu_icon_data = button_icon_data;
#ifdef PROG_LANGUAGE_ENGLISH
	button_name = "RecBin";
	menu_name = "Recycle Bin";
	tooltip = "Open Recycle Bin";
#endif
#ifdef PROG_LANGUAGE_SPANISH
	button_name = "RecBin";
	menu_name = "El Cajón De Reciclaje";
	tooltip = "Abre Cajón de Reciclaje (basura)";
#endif
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "Corbeille";
	menu_name = "Corbeille";
	tooltip = "Corbeille(la poubelle)";
#endif
	accel_key = GDK_4;
	accel_mods = GDK_CONTROL_MASK;
	DO_APPEND_OPID


	op = EDV_IMBR_OP_OPTIONS;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_options2_20x20_xpm;
	menu_icon_data = button_icon_data;
#ifdef PROG_LANGUAGE_ENGLISH
	button_name = "Options";
	menu_name = "Options...";
	tooltip = "Modify this application's options";
#endif
#ifdef PROG_LANGUAGE_SPANISH
	button_name = "Las Opciones";
	menu_name = "Las Opciones...";
	tooltip = "Modifican estas opciones de la aplicación";
#endif
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "Options";
	menu_name = "Options";
	tooltip = "Modifier les options de l'application";
#endif
	accel_key = GDK_o;
	accel_mods = GDK_CONTROL_MASK;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_CUSTOMIZE;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_customize_20x20_xpm;
	menu_icon_data = button_icon_data;
#ifdef PROG_LANGUAGE_ENGLISH
	button_name = "Custom";
	menu_name = "Customize...";
	tooltip = "Customize the look and feel of this application";
#endif
#ifdef PROG_LANGUAGE_SPANISH
	button_name = "Personal";
	menu_name = "Personaliza...";
	tooltip = "Personaliza la mirada y se siente de esta aplicación";
#endif
#ifdef PROG_LANGUAGE_FRENCH
	button_name = "Préférences";
	menu_name = "Préférences...";
	tooltip = "Règler les préférences pour cette application";
#endif
	accel_key = GDK_t;
	accel_mods = GDK_CONTROL_MASK;
	DO_APPEND_OPID


	op = EDV_IMBR_OP_HELP_CONTENTS;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_help_20x20_xpm;
	menu_icon_data = NULL;
#if defined(PROG_LANGUAGE_SPANISH)
	button_name = "La Ayuda";
	menu_name = "El Contenido";
	tooltip = "El Indice de toda ayuda pagina";
#elif defined(PROG_LANGUAGE_FRENCH)
	button_name = "Aide";
	menu_name = "Contenu de l'aide";
	tooltip = "Index des pages d'aide";
#elif defined(PROG_LANGUAGE_POLISH)
	button_name = "Pomoc";
	menu_name = "Tematy pomocy";
	tooltip = "Spis tre¶ci wszystkich stron pomocy";
#else
	button_name = "Help";
	menu_name = "Contents";
	tooltip = "Index of all help pages";
#endif
	accel_key = GDK_F1;
	accel_mods = 0;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_HELP_FILE_BROWSER;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_help_20x20_xpm;
	menu_icon_data = NULL;
	button_name = "Help";
	menu_name = "File Browser";
	tooltip = "Help on using the file browser";
	accel_key = 0;
	accel_mods = 0;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_HELP_IMAGE_BROWSER;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_help_20x20_xpm;
	menu_icon_data = NULL;
	button_name = "Help";
	menu_name = "Image Browser";
	tooltip = "Help on using the image browser";
	accel_key = 0;
	accel_mods = 0;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_HELP_ARCHIVER;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_help_20x20_xpm;
	menu_icon_data = NULL;
	button_name = "Help";
	menu_name = "Archiver";
	tooltip = "Help on using the archiver";
	accel_key = 0;
	accel_mods = 0;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_HELP_RECYCLE_BIN;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_help_20x20_xpm;
	menu_icon_data = NULL;
#if defined(PROG_LANGUAGE_FRENCH)
	button_name = "Aide";
	menu_name = "Corbeille";
	tooltip = "Aide sur l'utilisation de la Corbeille";
#else
	button_name = "Help";
	menu_name = "Recycle Bin";
	tooltip = "Help on using the recycle bin";
#endif
	accel_key = 0;
	accel_mods = 0;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_HELP_KEYS_LIST;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_help_20x20_xpm;
	menu_icon_data = NULL;
#if defined(PROG_LANGUAGE_SPANISH)
	button_name = "HelpKeys";
	menu_name = "La Lista De Llaves";
	tooltip = "La Lista de todo teclado las operaciones claves";
#elif defined(PROG_LANGUAGE_FRENCH)
	button_name = "Clavier";
	menu_name = "Liste des touches raccourci clavier";
	tooltip = "Liste des opérations principales disponibles avec les touches clavier";
#elif defined(PROG_LANGUAGE_POLISH)
	button_name = "PomocKlaw";
	menu_name = "Lista klawiszy";
	tooltip = "Lista skrótów klawiaturowych";
#else
	button_name = "HelpKeys";
	menu_name = "Keys List";
	tooltip = "List of all keyboard key operations";

#endif
	accel_key = 0;
	accel_mods = 0;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_HELP_MIME_TYPES;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_help_20x20_xpm;
	menu_icon_data = NULL;
#if defined(PROG_LANGUAGE_SPANISH)
	button_name = "HelpMIME";
	menu_name = "Mime Types";
	tooltip = "Ayude a establecer MIME Types";
#elif defined(PROG_LANGUAGE_FRENCH)
	button_name = "HelpMIME";
	menu_name = "Mime Types";
	tooltip = "Aide sur les types MIME";
#elif defined(PROG_LANGUAGE_POLISH)
	button_name = "Pomoc MIME";
	menu_name = "Typy MIME";
	tooltip = "Pomoc w ustawianiu typów MIME";
#else
	button_name = "HelpMIME";
	menu_name = "Mime Types";
	tooltip = "Help on setting up MIME Types";
#endif
	accel_key = 0;
	accel_mods = 0;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_HELP_DEVICES;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_help_20x20_xpm;
	menu_icon_data = NULL;
#if defined(PROG_LANGUAGE_SPANISH)
	button_name = "HelpDev";
	menu_name = "Los Dispositivos";
	tooltip = "La Ayuda a establecer Dispositivos";
#elif defined(PROG_LANGUAGE_FRENCH)
	button_name = "Composant";
	menu_name = "Composant";
	tooltip = "Aide sur les composants";
#elif defined(PROG_LANGUAGE_POLISH)
	button_name = "PomUrz±dzenia";
	menu_name = "Urz±dzenia";
	tooltip = "Pomoc w ustawianiu urz±dzeñ";
#else
	button_name = "HelpDev";
	menu_name = "Devices";
	tooltip = "Help on setting up devices";
#endif
	accel_key = 0;
	accel_mods = 0;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_HELP_COMMON_OPERATIONS;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_help_20x20_xpm;
	menu_icon_data = NULL;
#if defined(PROG_LANGUAGE_SPANISH)
	button_name = "HelpOp";
	menu_name = "Las Operaciones Comunes";
	tooltip = "La Ayuda en las operaciones más comunes";
#elif defined(PROG_LANGUAGE_FRENCH)
	button_name = "Opérations";
	menu_name = "Opérations classiques";
	tooltip = "Aide sur les opération";
#elif defined(PROG_LANGUAGE_POLISH)
	button_name = "PomOperacje";
	menu_name = "Najczêstsze operacje";
	tooltip = "Pomoc dotycz±ca najczêstszych operacji";
#else
	button_name = "HelpOp";
	menu_name = "Common Operations";
	tooltip = "Help on the most common operations";

#endif
	accel_key = 0;
	accel_mods = 0;
	DO_APPEND_OPID

	op = EDV_IMBR_OP_HELP_ABOUT;
	flags = 0;
	tb_item_type = TOOLBAR_ITEM_BUTTON;
	button_icon_data = (guint8 **)icon_about_20x20_xpm;
	menu_icon_data = (guint8 **)icon_about_20x20_xpm;
#if defined(PROG_LANGUAGE_SPANISH)
	button_name = "Acerca";
	menu_name = "Acerca De";
	tooltip = "Acerca de esta aplicación";
#elif defined(PROG_LANGUAGE_FRENCH)
	button_name = "A propos";
	menu_name = "A propos";
	tooltip = "A propos de cette application";
#elif defined(PROG_LANGUAGE_POLISH)
	button_name = "O programie";
	menu_name = "O programie";
	tooltip = "Informacje o programie";
#else
	button_name = "About";
	menu_name = "About";
	tooltip = "About this application";
#endif
	accel_key = 0;
	accel_mods = 0;
	DO_APPEND_OPID


	return(opid_list);
#undef DO_APPEND_OPID
}

/*
 *	Deletes the Image Browser Operation IDs list.
 */
void EDVImbrOPIDListDelete(GList *glist)
{
	GList *opid_list = glist;
	edv_imbr_opid_struct *opid;

	for(; glist != NULL; glist = g_list_next(glist))
	{
	    opid = EDV_IMBR_OPID(glist->data);
	    if(opid == NULL)
		continue;

	    g_free(opid->button_name);
	    g_free(opid->menu_name);
	    g_free(opid->tooltip);

	    g_free(opid);
	}
	g_list_free(opid_list);
}


/*
 *	Creates a new Accel Key List with default values.
 */
cfg_accelkey_list_struct *EDVImbrAccelkeysListNewDefault(void)
{
	GList *glist, *opid_list, *ak_glist = NULL;
	cfg_accelkey_list_struct *ak_list;
	edv_imbr_opid_struct *opid;

	opid_list = EDVImbrOPIDListNew(NULL);
	for(glist = opid_list; glist != NULL; glist = g_list_next(glist))
	{
	    opid = EDV_IMBR_OPID(glist->data);
	    if(opid == NULL)
		continue;

	    if(opid->flags & EDV_OPID_NO_OP)
		continue;

	    ak_glist = g_list_append(
		ak_glist,
		CFGAccelkeyNew(
		    (gint)opid->op,
		    opid->accel_key,
		    opid->accel_mods
		)
	    );
	}
	EDVImbrOPIDListDelete(opid_list);

	ak_list = CFGAccelkeyListNew(ak_glist);

	g_list_foreach(ak_glist, (GFunc)CFGAccelkeyDelete, NULL);
	g_list_free(ak_glist);

	return(ak_list);
}


/*
 *	Creates the Image Browser's menu bar.
 *
 *	This function should be called by EDVImbrNew().
 */
static void EDVImbrCreateMenuBar(
	edv_imbr_struct *imbr, GtkWidget *parent
)
{
	edv_imbr_op op;
	guint8 **icon_data = NULL;
	GtkAccelGroup *accelgrp = NULL;
	GtkWidget *w, *menu, *menu_bar;

	/* Create Menu Bar */
	imbr->menu_bar = menu_bar = GUIMenuBarCreate(NULL);
	gtk_container_add(GTK_CONTAINER(parent), menu_bar);
	gtk_widget_show(menu_bar);

#define DO_ADD_MENU_ITEM_LABEL	{		\
 edv_imbr_opid_struct *opid =			\
  EDVImbrMatchOPID(imbr, op);			\
 if(opid != NULL) {				\
  w = GUIMenuItemCreate(			\
   menu, GUI_MENU_ITEM_TYPE_LABEL, accelgrp,	\
   (icon_data != NULL) ?			\
    icon_data : opid->menu_icon_data,		\
   opid->menu_name,				\
   opid->accel_key, opid->accel_mods,		\
   NULL,					\
   opid, EDVImbrMenuItemCB			\
  );						\
  GUISetMenuItemCrossingCB(			\
   w,						\
   (gpointer)EDVImbrMenuItemEnterCB, opid,	\
   (gpointer)EDVImbrMenuItemLeaveCB, opid	\
  );						\
 } else {					\
  w = NULL;					\
 }						\
}

#define DO_ADD_MENU_ITEM_CHECK	{		\
 edv_imbr_opid_struct *opid =			\
  EDVImbrMatchOPID(imbr, op);			\
 if(opid != NULL) {				\
  w = GUIMenuItemCreate(			\
   menu, GUI_MENU_ITEM_TYPE_CHECK, accelgrp,	\
   (icon_data != NULL) ?			\
    icon_data : opid->menu_icon_data,		\
   opid->menu_name,				\
   opid->accel_key, opid->accel_mods,		\
   NULL,					\
   opid, EDVImbrMenuItemCB			\
  );						\
  GUISetMenuItemCrossingCB(			\
   w,						\
   (gpointer)EDVImbrMenuItemEnterCB, opid,	\
   (gpointer)EDVImbrMenuItemLeaveCB, opid	\
  );						\
 } else {					\
  w = NULL;					\
 }						\
}

#define DO_ADD_MENU_SUBMENU_LABEL	{	\
 edv_imbr_opid_struct *opid =			\
  EDVImbrMatchOPID(imbr, op);			\
 if(opid != NULL) {				\
  w = GUIMenuItemCreate(			\
   menu, GUI_MENU_ITEM_TYPE_LABEL, NULL,	\
   (icon_data != NULL) ?			\
    icon_data : opid->menu_icon_data,		\
   opid->menu_name,				\
   0, 0, NULL, NULL, NULL			\
  );						\
  GUISetMenuItemCrossingCB(			\
   w,						\
   (gpointer)EDVImbrMenuItemEnterCB, opid,	\
   (gpointer)EDVImbrMenuItemLeaveCB, opid	\
  );						\
 } else {					\
  w = NULL;					\
 }						\
}

#define DO_ADD_MENU_SEP	{			\
 w = GUIMenuItemCreate(				\
  menu, GUI_MENU_ITEM_TYPE_SEPARATOR, NULL,	\
  NULL, NULL, 0, 0, NULL,			\
  NULL, NULL					\
 );						\
}
	/* Create menus */

	/* File Menu */
	menu = GUIMenuCreateTearOff();
	if(menu != NULL)
	{
	    op = EDV_IMBR_OP_OPEN;
	    DO_ADD_MENU_ITEM_LABEL
	    imbr->open_mi = w;

	    op = EDV_IMBR_OP_OPEN_TO;
	    DO_ADD_MENU_SUBMENU_LABEL
	    imbr->open_to_mi = w;

	    op = EDV_IMBR_OP_OPEN_WITH;
	    DO_ADD_MENU_ITEM_LABEL
	    imbr->open_with_mi = w;

	    DO_ADD_MENU_SEP

	    op = EDV_IMBR_OP_NEW;
	    DO_ADD_MENU_SUBMENU_LABEL
	    imbr->new_object_mi = w;

	    DO_ADD_MENU_SEP

	    op = EDV_IMBR_OP_SYNC_DISKS;
	    DO_ADD_MENU_ITEM_LABEL
	    imbr->sync_disks_mi = w;

	    DO_ADD_MENU_SEP

	    op = EDV_IMBR_OP_HISTORY;
	    DO_ADD_MENU_ITEM_LABEL
	    imbr->history_mi = w;

	    DO_ADD_MENU_SEP

	    op = EDV_IMBR_OP_RUN;
	    DO_ADD_MENU_ITEM_LABEL
	    imbr->run_mi = w;

	    DO_ADD_MENU_SEP

	    op = EDV_IMBR_OP_CLOSE;
	    DO_ADD_MENU_ITEM_LABEL
	    imbr->close_mi = w;
	}
	GUIMenuAddToMenuBar(
	    menu_bar, menu,
#if defined(PROG_LANGUAGE_SPANISH)
"Archivo"
#elif defined(PROG_LANGUAGE_FRENCH)
"Fichier"
#elif defined(PROG_LANGUAGE_GERMAN)
"Akte"
#elif defined(PROG_LANGUAGE_ITALIAN)
"File"
#elif defined(PROG_LANGUAGE_DUTCH)
"Dossier"
#elif defined(PROG_LANGUAGE_PORTUGUESE)
"Arquivo"
#elif defined(PROG_LANGUAGE_NORWEGIAN)
"Arkiv"
#else
"File"
#endif
	    , GUI_MENU_BAR_ALIGN_LEFT
	);


	/* Edit Menu */
	menu = GUIMenuCreateTearOff();
	if(menu != NULL)
	{
	    op = EDV_IMBR_OP_MOVE;
	    DO_ADD_MENU_ITEM_LABEL
	    imbr->move_mi = w;

	    op = EDV_IMBR_OP_COPY;
	    DO_ADD_MENU_ITEM_LABEL
	    imbr->copy_mi = w;

	    op = EDV_IMBR_OP_LINK;
	    DO_ADD_MENU_ITEM_LABEL
	    imbr->link_mi = w;

	    op = EDV_IMBR_OP_RENAME;
	    DO_ADD_MENU_ITEM_LABEL
	    imbr->rename_mi = w;

	    op = EDV_IMBR_OP_CHMOD;
	    DO_ADD_MENU_ITEM_LABEL
	    imbr->chmod_mi = w;

	    op = EDV_IMBR_OP_CHOWN;
	    DO_ADD_MENU_ITEM_LABEL
	    imbr->chown_mi = w;

	    op = EDV_IMBR_OP_CHTIME;
	    DO_ADD_MENU_ITEM_LABEL
	    imbr->chtime_mi = w;

	    op = EDV_IMBR_OP_DELETE;
	    DO_ADD_MENU_ITEM_LABEL
	    imbr->delete_mi = w;

	    DO_ADD_MENU_SEP

	    op = EDV_IMBR_OP_COPY_PATH;
	    DO_ADD_MENU_ITEM_LABEL
	    imbr->copy_path_mi = w;

	    op = EDV_IMBR_OP_COPY_URL;
	    DO_ADD_MENU_ITEM_LABEL
	    imbr->copy_url_mi = w;

	    op = EDV_IMBR_OP_PASTE;
	    DO_ADD_MENU_ITEM_LABEL    
	    imbr->paste_mi = w;

	    DO_ADD_MENU_SEP

	    op = EDV_IMBR_OP_SELECT_ALL;
	    DO_ADD_MENU_ITEM_LABEL
	    imbr->select_all_mi = w;

	    op = EDV_IMBR_OP_UNSELECT_ALL;
	    DO_ADD_MENU_ITEM_LABEL
	    imbr->unselect_all_mi = w;

	    op = EDV_IMBR_OP_INVERT_SELECTION;
	    DO_ADD_MENU_ITEM_LABEL
	    imbr->invert_selection_mi = w;

	    DO_ADD_MENU_SEP

	    op = EDV_IMBR_OP_FIND;
	    DO_ADD_MENU_ITEM_LABEL
	    imbr->find_mi = w;

	    DO_ADD_MENU_SEP

	    op = EDV_IMBR_OP_PROPERTIES;
	    DO_ADD_MENU_ITEM_LABEL
	    imbr->properties_mi = w;
	}
	GUIMenuAddToMenuBar(
	    menu_bar, menu,
#if defined(PROG_LANGUAGE_SPANISH)
"Editar"
#elif defined(PROG_LANGUAGE_FRENCH)
"Editer"
#elif defined(PROG_LANGUAGE_GERMAN)
"Redigieren"
#elif defined(PROG_LANGUAGE_ITALIAN)
"Redigere"
#elif defined(PROG_LANGUAGE_DUTCH)
"Bewerking"
#elif defined(PROG_LANGUAGE_PORTUGUESE)
"Edite"
#elif defined(PROG_LANGUAGE_NORWEGIAN)
"Rediger"
#else
"Edit"
#endif
	    , GUI_MENU_BAR_ALIGN_LEFT
	);


	/* View Menu */
	menu = GUIMenuCreateTearOff();
	if(menu != NULL)
	{
	    op = EDV_IMBR_OP_STOP;
	    DO_ADD_MENU_ITEM_LABEL
	    imbr->stop_mi = w;

	    op = EDV_IMBR_OP_CONTINUE;
	    DO_ADD_MENU_ITEM_LABEL
	    imbr->continue_mi = w;

	    op = EDV_IMBR_OP_PRESENTATION_MODE;
	    DO_ADD_MENU_ITEM_LABEL
	    imbr->presentation_mode_mi = w;

	    DO_ADD_MENU_SEP

	    op = EDV_IMBR_OP_REFRESH;
	    DO_ADD_MENU_ITEM_LABEL
	    imbr->refresh_mi = w;

	    op = EDV_IMBR_OP_REFRESH_ALL;
	    DO_ADD_MENU_ITEM_LABEL
	    imbr->refresh_all_mi = w;

	    DO_ADD_MENU_SEP

	    op = EDV_IMBR_OP_SHOW_TOOL_BAR;
	    DO_ADD_MENU_ITEM_CHECK
	    imbr->show_tool_bar_micheck = w;

	    op = EDV_IMBR_OP_SHOW_LOCATION_BAR;
	    DO_ADD_MENU_ITEM_CHECK
	    imbr->show_location_bar_micheck = w;

	    op = EDV_IMBR_OP_SHOW_MOUNT_BAR;
	    DO_ADD_MENU_ITEM_CHECK
	    imbr->show_mount_bar_micheck = w;

	    op = EDV_IMBR_OP_SHOW_FIND_BAR;
	    DO_ADD_MENU_ITEM_CHECK
	    imbr->show_find_bar_micheck = w;

	    op = EDV_IMBR_OP_SHOW_STATUS_BAR;
	    DO_ADD_MENU_ITEM_CHECK
	    imbr->show_status_bar_micheck = w;

	    DO_ADD_MENU_SEP

	    op = EDV_IMBR_OP_SHOW_HIDDEN_OBJECTS;
	    DO_ADD_MENU_ITEM_CHECK
	    imbr->show_hidden_objects_micheck = w;

	    op = EDV_IMBR_OP_SHOW_NOACCESS_OBJECTS;
	    DO_ADD_MENU_ITEM_CHECK
	    imbr->show_noaccess_objects_micheck = w;

	    op = EDV_IMBR_OP_SHOW_NONIMAGE_OBJECTS;
	    DO_ADD_MENU_ITEM_CHECK
	    imbr->show_nonimage_objects_micheck = w;

	    op = EDV_IMBR_OP_THUMBS_LIST_FILTER;
	    DO_ADD_MENU_ITEM_LABEL
	    imbr->thumbs_list_filter_mi = w;

	    DO_ADD_MENU_SEP

	    op = EDV_IMBR_OP_MIME_TYPES;
	    DO_ADD_MENU_ITEM_LABEL
	    imbr->mime_types_mi = w;
	}
	GUIMenuAddToMenuBar(
	    menu_bar, menu,
#if defined(PROG_LANGUAGE_SPANISH)
"Vista"
#elif defined(PROG_LANGUAGE_FRENCH)
"Voir"
#elif defined(PROG_LANGUAGE_GERMAN)
"Blick"
#elif defined(PROG_LANGUAGE_ITALIAN)
"Veduta"
#elif defined(PROG_LANGUAGE_DUTCH)
"Overzicht"
#elif defined(PROG_LANGUAGE_PORTUGUESE)
"Vista"
#elif defined(PROG_LANGUAGE_NORWEGIAN)
"Sikt"
#else
"View"
#endif
	    , GUI_MENU_BAR_ALIGN_LEFT
	);


	/* Device Menu */
	menu = GUIMenuCreateTearOff();
	if(menu != NULL)
	{
	    op = EDV_IMBR_OP_MOUNT;
	    DO_ADD_MENU_ITEM_LABEL
	    imbr->mount_mi = w;

	    op = EDV_IMBR_OP_EJECT;
	    DO_ADD_MENU_ITEM_LABEL
	    imbr->eject_mi = w;

	    DO_ADD_MENU_SEP

	    op = EDV_IMBR_OP_DEVICE_CHECK;
	    DO_ADD_MENU_ITEM_LABEL
	    imbr->device_check_mi = w;

	    op = EDV_IMBR_OP_DEVICE_TOOLS;
	    DO_ADD_MENU_ITEM_LABEL
	    imbr->device_tools_mi = w;

	    op = EDV_IMBR_OP_DEVICE_FORMAT;
	    DO_ADD_MENU_ITEM_LABEL
	    imbr->device_format_mi = w;

	    DO_ADD_MENU_SEP

	    op = EDV_IMBR_OP_DEVICES;
	    DO_ADD_MENU_ITEM_LABEL
	    imbr->devices_mi = w;
	}
	GUIMenuAddToMenuBar(
	    menu_bar, menu,
#if defined(PROG_LANGUAGE_SPANISH)
"Dispositivo"
#elif defined(PROG_LANGUAGE_FRENCH)
"Composant"
#elif defined(PROG_LANGUAGE_GERMAN)
"Vorrichtung"
#elif defined(PROG_LANGUAGE_ITALIAN)
"Congegno"
#elif defined(PROG_LANGUAGE_DUTCH)
"Apparaat"
#elif defined(PROG_LANGUAGE_PORTUGUESE)
"Artifício"
#elif defined(PROG_LANGUAGE_NORWEGIAN)
"Innretning"
#else
"Device"
#endif
	    , GUI_MENU_BAR_ALIGN_LEFT
	);


	/* Settings Menu */
	menu = GUIMenuCreateTearOff();
	if(menu != NULL)
	{
	    op = EDV_IMBR_OP_WRITE_PROTECT;
	    DO_ADD_MENU_ITEM_LABEL
	    imbr->write_protect_mi = w;

	    op = EDV_IMBR_OP_DELETE_METHOD_RECYCLE;
	    DO_ADD_MENU_ITEM_CHECK
	    imbr->delete_method_recycle_micheck = w;

	    op = EDV_IMBR_OP_DELETE_METHOD_PURGE;
	    DO_ADD_MENU_ITEM_CHECK
	    imbr->delete_method_purge_micheck = w;

	    DO_ADD_MENU_SEP

	    op = EDV_IMBR_OP_OPTIONS;
	    DO_ADD_MENU_ITEM_LABEL
	    imbr->options_mi = w;

	    op = EDV_IMBR_OP_CUSTOMIZE;
	    DO_ADD_MENU_ITEM_LABEL
	    imbr->customize_mi = w;
	}
	GUIMenuAddToMenuBar(
	    menu_bar, menu,
#if defined(PROG_LANGUAGE_SPANISH)
"Configuracion"
#elif defined(PROG_LANGUAGE_FRENCH)
"Réglages"
#elif defined(PROG_LANGUAGE_GERMAN)
"Setzen"
#elif defined(PROG_LANGUAGE_ITALIAN)
"Montaggi"
#elif defined(PROG_LANGUAGE_DUTCH)
"Zetten"
#elif defined(PROG_LANGUAGE_PORTUGUESE)
"Por"
#elif defined(PROG_LANGUAGE_NORWEGIAN)
"Innstillinger"
#else
"Settings"
#endif
	    , GUI_MENU_BAR_ALIGN_LEFT
	);


	/* Windows Menu */
	menu = GUIMenuCreateTearOff();
	if(menu != NULL)
	{
	    op = EDV_IMBR_OP_NEW_BROWSER;
	    DO_ADD_MENU_ITEM_LABEL
	    imbr->window_new_browser_mi = w;

	    op = EDV_IMBR_OP_NEW_IMBR;
	    DO_ADD_MENU_ITEM_LABEL
	    imbr->window_new_imbr_mi = w;

	    op = EDV_IMBR_OP_NEW_ARCHIVER;
	    DO_ADD_MENU_ITEM_LABEL
	    imbr->window_new_archiver_mi = w;

	    DO_ADD_MENU_SEP

	    op = EDV_IMBR_OP_RECYCLE_BIN;
	    DO_ADD_MENU_ITEM_LABEL
	    imbr->window_recycle_bin_mi = w;
	}
	GUIMenuAddToMenuBar(
	    menu_bar, menu,
#if defined(PROG_LANGUAGE_SPANISH)
"Ventanas"
#elif defined(PROG_LANGUAGE_FRENCH)
"Fenêtres"
#elif defined(PROG_LANGUAGE_GERMAN)
"Fenster"
#elif defined(PROG_LANGUAGE_ITALIAN)
"Finestre"
#elif defined(PROG_LANGUAGE_DUTCH)
"Ramen"
#elif defined(PROG_LANGUAGE_PORTUGUESE)
"Janelas"
#elif defined(PROG_LANGUAGE_NORWEGIAN)
"Vinduer"
#else
"Windows"
#endif
	    , GUI_MENU_BAR_ALIGN_LEFT
	);


	/* Help Menu */
	menu = GUIMenuCreateTearOff();
	if(menu != NULL)
	{
	    op = EDV_IMBR_OP_HELP_CONTENTS;
	    DO_ADD_MENU_ITEM_LABEL
	    imbr->help_contents_mi = w;

	    DO_ADD_MENU_SEP

	    op = EDV_IMBR_OP_HELP_IMAGE_BROWSER;
	    DO_ADD_MENU_ITEM_LABEL
	    imbr->help_image_browser_mi = w;

	    op = EDV_IMBR_OP_HELP_KEYS_LIST;
	    DO_ADD_MENU_ITEM_LABEL
	    imbr->help_keys_list_mi = w;

	    op = EDV_IMBR_OP_HELP_MIME_TYPES;
	    DO_ADD_MENU_ITEM_LABEL
	    imbr->help_mime_types_mi = w;

	    op = EDV_IMBR_OP_HELP_DEVICES;
	    DO_ADD_MENU_ITEM_LABEL
	    imbr->help_devices_mi = w;

	    op = EDV_IMBR_OP_HELP_COMMON_OPERATIONS;
	    DO_ADD_MENU_ITEM_LABEL
	    imbr->help_common_operations_mi = w;

	    DO_ADD_MENU_SEP

	    op = EDV_IMBR_OP_HELP_ABOUT;
	    DO_ADD_MENU_ITEM_LABEL
	    imbr->help_about_mi = w;
	}
	GUIMenuAddToMenuBar(
	    menu_bar, menu,
#if defined(PROG_LANGUAGE_SPANISH)
"Ayuda"
#elif defined(PROG_LANGUAGE_FRENCH)
"Aide"
#elif defined(PROG_LANGUAGE_GERMAN)
"Hilfe"
#elif defined(PROG_LANGUAGE_ITALIAN)
"L'Aiuto"
#elif defined(PROG_LANGUAGE_DUTCH)
"Hulp"
#elif defined(PROG_LANGUAGE_PORTUGUESE)
"Ajuda"
#elif defined(PROG_LANGUAGE_NORWEGIAN)
"Hjelp"
#else
"Help"
#endif
	    , GUI_MENU_BAR_ALIGN_RIGHT
	);

#undef DO_ADD_MENU_ITEM_LABEL
#undef DO_ADD_MENU_ITEM_CHECK
#undef DO_ADD_MENU_SUBMENU_LABEL
#undef DO_ADD_MENU_SEP
}

/*
 *	Creates a new Image Browser.
 */
edv_imbr_struct *EDVImbrNew(edv_core_struct *core)
{
	const gchar *location_history_file = NULL;
	gint	toplevel_x, toplevel_y,
		toplevel_width, toplevel_height,
		paned_position;
	gboolean	tool_bar_map_state,
			location_bar_map_state,
			mount_bar_map_state,
			find_bar_map_state,
			status_bar_map_state;
	const gchar *wm_name = NULL, *wm_class;
	GList *glist;
	GdkCursor *cursor;
	GdkWindow *window;
	GtkRcStyle *standard_rcstyle, *lists_rcstyle;
	GtkStyle *style;
	GtkWidget *w, *parent, *parent2, *parent3, *parent4;
	gpointer combo_rtn;
	GtkCombo *combo;
	const GtkTargetEntry dnd_tar_types[] = {
{"text/plain",				0,	EDV_DND_TYPE_INFO_TEXT_PLAIN},
{"text/uri-list",			0,	EDV_DND_TYPE_INFO_TEXT_URI_LIST},
{"STRING",				0,	EDV_DND_TYPE_INFO_STRING},
{EDV_DND_TYPE_STRING_RECYCLED_OBJECT,	0,	EDV_DND_TYPE_INFO_RECYCLED_OBJECT},
{EDV_DND_TYPE_STRING_ARCHIVE_OBJECT,	0,	EDV_DND_TYPE_INFO_ARCHIVE_OBJECT}
	};
	const GtkTargetEntry dnd_src_types[] = {
{"text/plain",				0,	EDV_DND_TYPE_INFO_TEXT_PLAIN},
{"text/uri-list",			0,	EDV_DND_TYPE_INFO_TEXT_URI_LIST},
{"STRING",				0,	EDV_DND_TYPE_INFO_STRING}
	};
	const cfg_item_struct *cfg_list;
	tlist_struct *tlist;
	imgview_struct *iv;
	edv_status_bar_struct *status_bar;
	edv_imbr_struct *imbr = EDV_IMBR(g_malloc0(
	    sizeof(edv_imbr_struct)
	));
	if((imbr == NULL) || (core == NULL))
	{
	    g_free(imbr);
	    return(NULL);
	}

	cfg_list = core->cfg_list;

	standard_rcstyle = core->standard_rcstyle;
	lists_rcstyle = core->lists_rcstyle;

	wm_name = core->wm_name;
	wm_class = core->wm_class;

	location_history_file = EDV_GET_S(EDV_CFG_PARM_FILE_IMBR_LOCATION_HISTORY);

	if(core->geometry_set)
	{
	    const GdkRectangle *rect = &core->geometry;
	    toplevel_x = rect->x;
	    toplevel_y = rect->y;
	    toplevel_width = rect->width;
	    toplevel_height = rect->height;
	}
	else
	{
	    toplevel_x = EDV_GET_I(EDV_CFG_PARM_IMBR_X);
	    toplevel_y = EDV_GET_I(EDV_CFG_PARM_IMBR_Y);
	    toplevel_width = EDV_GET_I(EDV_CFG_PARM_IMBR_WIDTH);
	    toplevel_height = EDV_GET_I(EDV_CFG_PARM_IMBR_HEIGHT);
	}
	paned_position = EDV_GET_I(EDV_CFG_PARM_IMBR_PANED_POSITION);

	tool_bar_map_state = EDV_GET_B(EDV_CFG_PARM_IMBR_SHOW_TOOL_BAR);
	location_bar_map_state = EDV_GET_B(EDV_CFG_PARM_IMBR_SHOW_LOCATION_BAR);
	mount_bar_map_state = EDV_GET_B(EDV_CFG_PARM_IMBR_SHOW_MOUNT_BAR);
	find_bar_map_state = EDV_GET_B(EDV_CFG_PARM_IMBR_SHOW_FIND_BAR);
	status_bar_map_state = EDV_GET_B(EDV_CFG_PARM_IMBR_SHOW_STATUS_BAR);

	imbr->processing = FALSE;
	imbr->busy_count = 0;
	imbr->passive_busy_count = 0;
	imbr->freeze_count = 0;
	imbr->core = core;

	imbr->opid_list = EDVImbrOPIDListNew(imbr);

	imbr->stop_count = 0;
	imbr->loading_tocb = 0;
	imbr->tool_bar_map_state = tool_bar_map_state;
	imbr->location_bar_map_state = location_bar_map_state;
	imbr->mount_bar_map_state = mount_bar_map_state;
	imbr->find_bar_map_state = find_bar_map_state;
	imbr->status_bar_map_state = status_bar_map_state;
	imbr->thumbs_list_filter = STRDUP(EDV_GET_S(
	    EDV_CFG_PARM_IMBR_THUMBS_LIST_FILTER
	));
	imbr->tlist_selected_thumb = -1;
	imbr->selected_dev_num = -1;
	imbr->last_recbin_items = -1;
	imbr->last_write_protect_state = -1;
	imbr->status_bar = NULL;
	imbr->obj_op_dlg = NULL;


	/* Begin creating widgets */

	/* Toplevel */
	gtk_widget_push_visual(gdk_rgb_get_visual());
	gtk_widget_push_colormap(gdk_rgb_get_cmap());
	imbr->toplevel = w = gtk_window_new(GTK_WINDOW_TOPLEVEL);
	gtk_widget_pop_visual();
	gtk_widget_pop_colormap();
	gtk_widget_set_uposition(
	    w, toplevel_x, toplevel_y
	);
	gtk_widget_set_usize(
	    w, toplevel_width, toplevel_height
	);
	if(!STRISEMPTY(wm_name) && !STRISEMPTY(wm_class))
	    gtk_window_set_wmclass(GTK_WINDOW(w), wm_name, wm_class);
	else
	    gtk_window_set_wmclass(
		GTK_WINDOW(w), "imagebrowser", PROG_NAME
	    );
	gtk_window_set_policy(
	    GTK_WINDOW(w),
	    TRUE, TRUE, TRUE
	);
	gtk_widget_realize(w);
	window = w->window;
	if(window != NULL)
	{
	    GdkGeometry geo;

	    geo.min_width = 100;
	    geo.min_height = 70;
	    geo.base_width = 0;
	    geo.base_height = 0;
	    geo.width_inc = 1;
	    geo.height_inc = 1;
	    gdk_window_set_geometry_hints(
		window, &geo,
		GDK_HINT_MIN_SIZE |
		GDK_HINT_BASE_SIZE |
		GDK_HINT_RESIZE_INC
	    );

	    GUISetWMIcon(window, (guint8 **)image_browser_48x48_xpm);
	}
	gtk_widget_add_events(
	    w,
	    GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK
	);
	gtk_signal_connect(
	    GTK_OBJECT(w), "delete_event",
	    GTK_SIGNAL_FUNC(EDVImbrDeleteEventCB), imbr
	);
	gtk_signal_connect(
	    GTK_OBJECT(w), "key_press_event",
	    GTK_SIGNAL_FUNC(EDVImbrKeyEventCB), imbr
	);
	gtk_signal_connect(
	    GTK_OBJECT(w), "key_release_event",
	    GTK_SIGNAL_FUNC(EDVImbrKeyEventCB), imbr
	);
	style = gtk_widget_get_style(w);
	parent = w;


	/* Main vbox */
	imbr->main_vbox = w = gtk_vbox_new(FALSE, 0);
	gtk_container_add(GTK_CONTAINER(parent), w);
	gtk_widget_show(w);
	parent = w;


	/* Vbox for tool bars */
	imbr->bars_vbox = w = gtk_vbox_new(FALSE, 0);
	gtk_box_pack_start(GTK_BOX(parent), w, FALSE, FALSE, 0);
	gtk_widget_show(w);
	parent2 = w;


	/* Handle for menu bar */
	imbr->menu_bar_handle = w = gtk_handle_box_new();
	gtk_box_pack_start(GTK_BOX(parent2), w, FALSE, FALSE, 0);
	gtk_signal_connect_after(
	    GTK_OBJECT(w), "child_attached",
	    GTK_SIGNAL_FUNC(EDVImbrHandleChildAttachedCB), imbr
	);
	gtk_signal_connect_after(
	    GTK_OBJECT(w), "child_detached",
	    GTK_SIGNAL_FUNC(EDVImbrHandleChildDetachedCB), imbr
	);
	gtk_widget_show(w);
	/* Create menu bar */
	EDVImbrCreateMenuBar(imbr, w);


	/* Handle for tool bar */
	imbr->tool_bar_handle = w = gtk_handle_box_new();
	gtk_box_pack_start(GTK_BOX(parent2), w, FALSE, FALSE, 0);
	gtk_signal_connect_after(
	    GTK_OBJECT(w), "child_attached",
	    GTK_SIGNAL_FUNC(EDVImbrHandleChildAttachedCB), imbr
	);
	gtk_signal_connect_after(
	    GTK_OBJECT(w), "child_detached",
	    GTK_SIGNAL_FUNC(EDVImbrHandleChildDetachedCB), imbr
	);
	if(imbr->tool_bar_map_state)
	    gtk_widget_show(w);
	/* Build tool bar later */
	imbr->tool_bar = NULL;


	/* Location bar handle box */
	imbr->location_bar_handle = w = gtk_handle_box_new();
	gtk_signal_connect_after(
	    GTK_OBJECT(w), "child_attached",
	    GTK_SIGNAL_FUNC(EDVImbrHandleChildAttachedCB), imbr
	);
	gtk_signal_connect_after(
	    GTK_OBJECT(w), "child_detached",
	    GTK_SIGNAL_FUNC(EDVImbrHandleChildDetachedCB), imbr
	);
	gtk_box_pack_start(GTK_BOX(parent), w, FALSE, FALSE, 0);
	if(imbr->location_bar_map_state)
	    gtk_widget_show(w);
	parent2 = w;

	/* Location bar hbox for location bar */
	imbr->location_bar_hbox = w = gtk_hbox_new(FALSE, 0);
	gtk_container_add(GTK_CONTAINER(parent2), w);
	gtk_widget_show(w);
	parent2 = w;


	/* Hbox for location icon and combo */
	w = gtk_hbox_new(FALSE, 0);	/* Don't need spacing between icon
					 * and combo because combo has it
					 * already.
					 */
	gtk_box_pack_start(GTK_BOX(parent2), w, TRUE, TRUE, 0);
	gtk_widget_show(w);
	parent3 = w;

	/* Vbox to orient location icon fixed parent */
	w = gtk_vbox_new(TRUE, 0);
	gtk_widget_set_usize(w, 20, 20);
	gtk_box_pack_start(GTK_BOX(parent3), w, FALSE, FALSE, 0);
	gtk_widget_show(w);
	parent4 = w;
	/* Location icon fixed parent */
	imbr->location_icon_fixed = w = gtk_fixed_new();
	gtk_widget_add_events(
	    w,
	    GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
	    GDK_POINTER_MOTION_MASK |
	    GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK
	);
	gtk_box_pack_start(GTK_BOX(parent4), w, TRUE, FALSE, 0);
	gtk_signal_connect(
	    GTK_OBJECT(w), "enter_notify_event",
	    GTK_SIGNAL_FUNC(EDVImbrLocBarIconCrossingCB), imbr
	);
	gtk_signal_connect(
	    GTK_OBJECT(w), "leave_notify_event",
	    GTK_SIGNAL_FUNC(EDVImbrLocBarIconCrossingCB), imbr
	);
	gtk_widget_realize(w);
	cursor = EDVGetCursor(
	    (edv_core_struct *)core, EDV_CURSOR_CODE_HAND
	);
	gdk_window_set_cursor(w->window, cursor);
	GUISetWidgetTip(
	    w,
#ifdef PROG_LANGUAGE_ENGLISH
"Drag this to create a link to this location"
#endif
#ifdef PROG_LANGUAGE_SPANISH
"Arrastre esto para crear un enlace en esta ubicación"
#endif
#ifdef PROG_LANGUAGE_FRENCH
"Traîner ceci pour créer un lien à cet emplacement"
#endif
	);
	gtk_widget_show(w);

	/* Reset location icon pixmap */
	imbr->location_icon_pm = NULL;

	/* Location combo */
	glist = EDVOpenFileGList(location_history_file, 0);
	w = GUIComboCreate(
#ifdef PROG_LANGUAGE_ENGLISH
	    "Location:",
#endif
#ifdef PROG_LANGUAGE_SPANISH
	    "La Ubicación:",
#endif
#ifdef PROG_LANGUAGE_FRENCH
	    "Emplacement:",
#endif
	    "/",
	    glist,
	    20,		/* Maximum items */
	    &combo_rtn,
	    imbr,
	    EDVImbrComboActivateCB,
	    NULL
	);
	if(glist != NULL)
	{
	    g_list_foreach(glist, (GFunc)g_free, NULL);
	    g_list_free(glist);
	    glist = NULL;
	}
	gtk_box_pack_start(GTK_BOX(parent3), w, TRUE, TRUE, 0);
	gtk_widget_show(w);

	imbr->location_combo = w = (GtkWidget *)combo_rtn;
	combo = GTK_COMBO(w);
	gtk_combo_set_case_sensitive(combo, TRUE);
	GUIDNDSetSrc(
	    imbr->location_icon_fixed,
	    dnd_src_types,
	    sizeof(dnd_src_types) / sizeof(GtkTargetEntry),
	    GDK_ACTION_COPY | GDK_ACTION_MOVE |
	    GDK_ACTION_LINK,			/* Actions */
	    GDK_BUTTON1_MASK,			/* Buttons */
	    NULL,
	    EDVLocBarIconDragDataGet,
	    NULL,
	    NULL,
	    combo
	);
	EDVEntrySetDND((edv_core_struct *)core, combo->entry);
	EDVEntrySetCompletePath((edv_core_struct *)core, combo->entry);


	/* GtkHandleBox for the Mount Bar */
	imbr->mount_bar_handle = w = gtk_handle_box_new();
	gtk_signal_connect_after(
	    GTK_OBJECT(w), "child_attached",
	    GTK_SIGNAL_FUNC(EDVImbrHandleChildAttachedCB), imbr
	);
	gtk_signal_connect_after(
	    GTK_OBJECT(w), "child_detached",
	    GTK_SIGNAL_FUNC(EDVImbrHandleChildDetachedCB), imbr
	);
	gtk_box_pack_start(GTK_BOX(parent), w, FALSE, FALSE, 0);
	if(imbr->mount_bar_map_state)
	    gtk_widget_show(w);
	parent2 = w;

	/* Create the Mount Bar */
	imbr->mount_bar = EDVMountBarNew(
	    core, parent2,
	    EDVImbrMountBarMountCB,
	    EDVImbrMountBarEjectCB,
	    EDVImbrMountBarGoToCB,
	    EDVImbrStatusMessageCB,
	    imbr
	);
	EDVMountBarMap(imbr->mount_bar);


	/* GtkHandleBox for the Find Bar */
	imbr->find_bar_handle = w = gtk_handle_box_new();
	gtk_signal_connect_after(
	    GTK_OBJECT(w), "child_attached",
	    GTK_SIGNAL_FUNC(EDVImbrHandleChildAttachedCB), imbr
	);
	gtk_signal_connect_after(
	    GTK_OBJECT(w), "child_detached",
	    GTK_SIGNAL_FUNC(EDVImbrHandleChildDetachedCB), imbr
	);
	gtk_box_pack_start(GTK_BOX(parent), w, FALSE, FALSE, 0);
	if(imbr->find_bar_map_state)
	    gtk_widget_show(w);
	parent2 = w;

	/* Create the Find Bar */
	imbr->find_bar = EDVFindBarNew(
	    core, parent2,
	    EDV_FINDBAR_ROLE_DISK_OBJECT,
	    EDVImbrFindBarLocationCB,
	    EDVImbrFindBarStartCB,
	    EDVImbrFindBarEndCB,
	    EDVImbrFindBarMatchCB,
	    EDVImbrStatusMessageCB,
	    EDVImbrStatusProgressCB,
	    imbr
	);
	EDVFindBarMap(imbr->find_bar);



	/* Main paned */
	imbr->main_paned = w = gtk_hpaned_new();
	gtk_paned_set_position(GTK_PANED(w), paned_position);
	gtk_paned_set_handle_size(
	    GTK_PANED(w), EDV_DEF_PANED_HANDLE_SIZE
	);
	gtk_paned_set_gutter_size(
	    GTK_PANED(w), EDV_DEF_PANED_GUTTER_SIZE
	);
	gtk_box_pack_start(GTK_BOX(parent), w, TRUE, TRUE, 0);
	gtk_widget_show(w);
	parent2 = w;


	/* Create thumbs list */
	imbr->tlist = tlist = TListNew(
	    EDV_GET_B(EDV_CFG_PARM_IMBR_THUMB_LIST_HORIZONTAL),
	    EDV_GET_I(EDV_CFG_PARM_IMBR_THUMB_WIDTH),
	    EDV_GET_I(EDV_CFG_PARM_IMBR_THUMB_HEIGHT),
	    EDV_GET_I(EDV_CFG_PARM_IMBR_THUMB_BORDER),
	    imbr,
	    EDVImbrTListSelectCB,
	    EDVImbrTListUnselectCB
	);
	w = tlist->toplevel;
	gtk_paned_add1(GTK_PANED(parent2), w);
	TListDoubleBuffer(tlist, EDV_GET_B(EDV_CFG_PARM_LISTS_DOUBLE_BUFFER));
	TListSelectionMode(tlist, GTK_SELECTION_EXTENDED);
	TListShowThumbFrames(tlist, EDV_GET_B(EDV_CFG_PARM_IMBR_THUMB_SHOW_FRAMES));
	TListShowThumbLabels(tlist, EDV_GET_B(EDV_CFG_PARM_IMBR_THUMB_SHOW_LABELS));
	TListShowTextTips(tlist, EDV_GET_B(EDV_CFG_PARM_SHOW_TEXTTIPS));

	w = tlist->list_da;
	gtk_signal_connect(
	    GTK_OBJECT(w), "button_press_event",
	    GTK_SIGNAL_FUNC(EDVTListButtonEventCB), imbr
	);
	gtk_signal_connect(
	    GTK_OBJECT(w), "button_release_event",
	    GTK_SIGNAL_FUNC(EDVTListButtonEventCB), imbr
	);
	gtk_signal_connect(
	    GTK_OBJECT(w), "motion_notify_event",
	    GTK_SIGNAL_FUNC(EDVTListMotionEventCB), imbr
	);
	gtk_signal_connect_after(
	    GTK_OBJECT(w), "key_press_event",
	    GTK_SIGNAL_FUNC(EDVImbrKeyEventCB), imbr
	);
	gtk_signal_connect_after(
	    GTK_OBJECT(w), "key_release_event",
	    GTK_SIGNAL_FUNC(EDVImbrKeyEventCB), imbr
	);
	gtk_signal_connect_after(
	    GTK_OBJECT(w), "button_press_event",
	    GTK_SIGNAL_FUNC(EDVImbrButtonPressEventCB), imbr
	);

	/* Set up DND for the thumbs list */
	GUIDNDSetSrc(
	    w,
	    dnd_src_types,
	    sizeof(dnd_src_types) / sizeof(GtkTargetEntry),
	    GDK_ACTION_COPY | GDK_ACTION_MOVE |
		GDK_ACTION_LINK,		/* Actions */
	    GDK_BUTTON1_MASK,			/* Buttons */
	    NULL,
	    EDVImbrTListDragDataGetCB,
	    EDVImbrTListDragDataDeleteCB,
	    NULL,
	    imbr
	);
	GUIDNDSetTar(
	    w,
	    dnd_tar_types,
	    sizeof(dnd_tar_types) / sizeof(GtkTargetEntry),
	    GDK_ACTION_COPY | GDK_ACTION_MOVE |
		GDK_ACTION_LINK,		/* Actions */
	    GDK_ACTION_MOVE,			/* Default action if same */
	    GDK_ACTION_MOVE,			/* Default action */
	    EDVImbrTListDragDataReceivedCB,
	    imbr
	);
	TListMap(tlist);


	/* Create image viewer as a child widget */
	imbr->imgview = iv = ImgViewNew(
	    TRUE,			/* Show tool bar */
	    TRUE,			/* Show values */
	    FALSE,			/* Show status bar */
	    FALSE,			/* Show image on wm icon */
	    EDV_GET_I(EDV_CFG_PARM_IMAGE_QUALITY),	/* Quality (0 to 2) */
	    FALSE,			/* Toplevel to be a GtkWindow? */
	    &w				/* Toplevel return */
	);
	gtk_paned_add2(GTK_PANED(parent2), w);
	if(iv != NULL)
	{
	    /* Background color */
	    const cfg_color_struct *color = EDV_GET_COLOR(
		EDV_CFG_PARM_IMBR_COLOR_BG
	    );
	    if(color != NULL)
	    {
		GdkColor gdk_color[5];
		gint i, m = sizeof(gdk_color) / sizeof(GdkColor);
		const cfg_color_struct *sc = color;

		for(i = 0; i < m; i++)
		{
		    GDK_COLOR_SET_COEFF(
			&gdk_color[i],
			sc->r, sc->g, sc->b
		    )
		}
		ImgViewSetViewBG(iv, gdk_color);
	    }

	    ImgViewMap(iv);
	}

	/* Set up view widget */
	w = (GtkWidget *)ImgViewGetViewWidget(iv);
	if(w != NULL)
	{
	    gtk_signal_connect_after(
		GTK_OBJECT(w), "button_press_event",
		GTK_SIGNAL_FUNC(EDVImbrButtonPressEventCB), imbr
	    );

	    GUIDNDSetTar(
		w,
		dnd_tar_types,
		sizeof(dnd_tar_types) / sizeof(GtkTargetEntry),
		GDK_ACTION_COPY | GDK_ACTION_MOVE |
		    GDK_ACTION_LINK,		/* Actions */
		GDK_ACTION_MOVE,		/* Default action if same */
		GDK_ACTION_MOVE,		/* Default action */
		EDVImbrImgViewDragDataReceivedCB,
		imbr
	    );
	}


	/* Create tool bar */
	EDVImbrToolbarRegenerate(imbr);

	/* Create tlist right-click menu */
	EDVImbrTListMenuRegenerate(imbr);


	/* Create status bar */
	imbr->status_bar = status_bar = EDVStatusBarNew(
	    core, imbr->main_vbox
	);
	if(status_bar != NULL)
	{
	    if(imbr->status_bar_map_state)
		EDVStatusBarMap(status_bar);
	    else
		EDVStatusBarUnmap(status_bar);
	}



	/* Create the New Objects submenu */
	EDVImbrNewObjectMenuRegenerate(imbr);

	/* Create the Open To submenu */
	EDVImbrOpenToMenuRegenerate(imbr, NULL);


	/* Set initial RC styles */
	if(standard_rcstyle != NULL)
	    gtk_widget_modify_style_recursive(
		imbr->toplevel, standard_rcstyle
	    );
	if(lists_rcstyle != NULL)
	    gtk_widget_modify_style_recursive(
		imbr->tlist->list_da, lists_rcstyle
	    );
	w = ImgViewGetToplevelWidget(imbr->imgview);
	if(lists_rcstyle != NULL)
	    gtk_widget_modify_style_recursive(
		w, lists_rcstyle
	    );
	w = (GtkWidget *)ImgViewGetMenuWidget(imbr->imgview);
	if(standard_rcstyle != NULL)
	    gtk_widget_modify_style_recursive(
		w, standard_rcstyle
	    );
	if(standard_rcstyle != NULL)
	    gtk_widget_modify_style_recursive(
		imbr->tlist_menu, standard_rcstyle
	    );

	/* Load special icons */
	if(TRUE)
	{
	    gchar *icons_dir = STRDUP(PrefixPaths(
		EDV_GET_S(EDV_CFG_PARM_DIR_GLOBAL),
		"icons"
	    ));

#define LOAD_ICON(_f_,_p_,_m_)	{			\
 gchar *s = STRDUP(PrefixPaths(icons_dir, (_f_)));	\
 *(_p_) = GDK_PIXMAP_NEW_FROM_XPM_FILE((_m_), s);	\
 g_free(s);						\
}
	    LOAD_ICON(
		"icon_folder_parent_32x32.xpm",
		&imbr->folder_parent_pixmap,
		&imbr->folder_parent_mask
	    );
	    if(imbr->folder_parent_pixmap == NULL)
		EDVLoadPixmap(
		    core,
		    (guint8 **)icon_folder_parent_32x32_xpm,
		    "icon_folder_parent_32x32_xpm",
		    &imbr->folder_parent_pixmap,
		    &imbr->folder_parent_mask 
		);

	    LOAD_ICON(
		"icon_folder_noaccess_32x32.xpm",
		&imbr->folder_noaccess_pixmap,
		&imbr->folder_noaccess_mask
	    );
	    if(imbr->folder_noaccess_pixmap == NULL)
		EDVLoadPixmap(
		    core,
		    (guint8 **)icon_folder_noaccess_32x32_xpm,
		    "icon_folder_noaccess_32x32_xpm",
		    &imbr->folder_noaccess_pixmap,
		    &imbr->folder_noaccess_mask
		);

	    LOAD_ICON(
		"icon_file_badimage_32x32.xpm",
		&imbr->file_badimage_pixmap,
		&imbr->file_badimage_mask
	    );
	    if(imbr->file_badimage_pixmap == NULL)
		EDVLoadPixmap(
		    core,
		    (guint8 **)icon_file_badimage_32x32_xpm,
		    "icon_file_badimage_32x32_xpm",
		    &imbr->file_badimage_pixmap,
		    &imbr->file_badimage_mask
		);
#undef LOAD_ICON

	    g_free(icons_dir);
	}


	/* Reset values */
	EDVImbrSetTitle(imbr, NULL);
	EDVImbrAccelkeysRegenerate(imbr);
	EDVImbrUpdateMenus(imbr);

	return(imbr);
}

/*
 *	Syncronizes the Image Browser's widget values with other values.
 */
void EDVImbrSyncData(edv_imbr_struct *imbr)
{
	if(imbr == NULL)
	    return;

/* This function may be removed in the future, since there really is
 * no floating data from widgets to be synced to disk on the image
 * browser
 */

}


/*
 *	Updates the Image Browser's widgets to reflect current 
 *	values.
 */
void EDVImbrUpdateMenus(edv_imbr_struct *imbr)
{
	gboolean	write_protect,
			write_protect_changed = FALSE,
			loading_in_progress;
	edv_delete_method delete_method;
	gboolean sensitive, state;
	gint selected_dev_num;
	edv_device_struct *selected_dev_ptr;
	guint8 **icon_data, **recbin_icon_data;
	GtkWidget *w;
	gint tlist_selected_thumb;
	const cfg_item_struct *cfg_list;
	toolbar_struct *tb;
	edv_core_struct *core;

	if(imbr == NULL)
	    return;

	core = imbr->core;
	if(core == NULL)
	    return;

	cfg_list = core->cfg_list;

	tb = imbr->tool_bar;

#define DO_SHOW			\
{ if(w != NULL) gtk_widget_show(w); }
#define DO_HIDE			\
{ if(w != NULL) gtk_widget_hide(w); }
#define DO_SET_CHECK_STATE	\
{ GUIMenuItemSetCheck(w, state, FALSE); }

	/* Get loading in progress state */
	loading_in_progress = (imbr->loading_tocb > 0) ? TRUE : FALSE;

	/* Get global write protect state */
	write_protect = EDV_GET_B(EDV_CFG_PARM_WRITE_PROTECT);
	if(imbr->last_write_protect_state < 0)
	{
	    write_protect_changed = TRUE;
	}
	else
	{
	    if((write_protect && !imbr->last_write_protect_state) ||
	       (!write_protect && imbr->last_write_protect_state)
	    )
		write_protect_changed = TRUE;
	}
	imbr->last_write_protect_state = write_protect ? 1 : 0;

	/* Delete method */
	delete_method = (edv_delete_method)EDV_GET_I(
	    EDV_CFG_PARM_DELETE_METHOD
	);

	/* Get last selected thumb */
	tlist_selected_thumb = imbr->tlist_selected_thumb;

	/* Get last selected device (if any) */
	selected_dev_num = imbr->selected_dev_num;
	if((selected_dev_num >= 0) && (selected_dev_num < core->total_devices))
	    selected_dev_ptr = core->device[selected_dev_num];
	else
	    selected_dev_ptr = NULL;

	/* Update recycle bin icon data, setting it to not NULL if it
	 * needs to be changed and update the image browser's
	 * last_recbin_items to match the value on the core structure.
	 */
	icon_data = NULL;
	if(imbr->last_recbin_items < 0)
	{
	    if(core->last_recbin_items > 0)
		icon_data = (guint8 **)icon_trash_20x20_xpm;
	    else
		icon_data = (guint8 **)icon_trash_empty_20x20_xpm;
	}
	else
	{
	    if(!imbr->last_recbin_items &&
	       core->last_recbin_items
	    )
		icon_data = (guint8 **)icon_trash_20x20_xpm;
	    else if(imbr->last_recbin_items &&
		    !core->last_recbin_items
	    )
		icon_data = (guint8 **)icon_trash_empty_20x20_xpm;
	}
	imbr->last_recbin_items = core->last_recbin_items;
	recbin_icon_data = icon_data;



	/* Update mount bar */
	EDVMountBarUpdateMenus(imbr->mount_bar);

	/* Update find bar */
	EDVFindBarUpdateMenus(imbr->find_bar);



	/* Begin updating menu items and tool bar items */

	/* File Menu */
	/* Open & Open With */
	sensitive = (tlist_selected_thumb > -1) ? TRUE : FALSE;
	/* Open */
	GTK_WIDGET_SET_SENSITIVE(imbr->open_mi, sensitive)
	ToolBarItemSetSensitiveID(
	    tb, EDV_IMBR_OP_OPEN, sensitive
	);
	/* Open To */
	GTK_WIDGET_SET_SENSITIVE(imbr->open_to_mi, sensitive)
	ToolBarItemSetSensitiveID(
	    tb, EDV_IMBR_OP_OPEN_TO, sensitive
	);
	/* Open With */
	GTK_WIDGET_SET_SENSITIVE(imbr->open_with_mi, sensitive)
	ToolBarItemSetSensitiveID(
	    tb, EDV_IMBR_OP_OPEN_WITH, sensitive
	);

	/* New Object Submenu Item */
	sensitive = TRUE;
	GTK_WIDGET_SET_SENSITIVE(imbr->new_object_mi, sensitive)
	/* New file */
	GTK_WIDGET_SET_SENSITIVE(imbr->new_file_mi, sensitive)
	ToolBarItemSetSensitiveID(
	    tb, EDV_IMBR_OP_NEW_FILE, sensitive
	);
	/* New Directory */
	GTK_WIDGET_SET_SENSITIVE(imbr->new_directory_mi, sensitive)
	ToolBarItemSetSensitiveID(
	    tb, EDV_IMBR_OP_NEW_DIRECTORY, sensitive
	);
	/* New Link */
	GTK_WIDGET_SET_SENSITIVE(imbr->new_link_mi, sensitive)
	ToolBarItemSetSensitiveID(
	    tb, EDV_IMBR_OP_NEW_LINK, sensitive
	);
	/* New FIFO */
	GTK_WIDGET_SET_SENSITIVE(imbr->new_fifo_mi, sensitive)
	ToolBarItemSetSensitiveID(
	    tb, EDV_IMBR_OP_NEW_FIFO, sensitive
	);
	/* New Block Device */
	GTK_WIDGET_SET_SENSITIVE(imbr->new_device_block_mi, sensitive)
	ToolBarItemSetSensitiveID(
	    tb, EDV_IMBR_OP_NEW_DEVICE_BLOCK, sensitive
	);
	/* New Character Device */
	GTK_WIDGET_SET_SENSITIVE(imbr->new_device_character_mi, sensitive)
	ToolBarItemSetSensitiveID(
	    tb, EDV_IMBR_OP_NEW_DEVICE_CHARACTER, sensitive
	);
	/* New Socket */
	GTK_WIDGET_SET_SENSITIVE(imbr->new_socket_mi, sensitive)
	ToolBarItemSetSensitiveID(
	    tb, EDV_IMBR_OP_NEW_SOCKET, sensitive
	);

	/* Go To Parent */
	sensitive = TRUE;
	ToolBarItemSetSensitiveID(
	    tb, EDV_IMBR_OP_GOTO_PARENT, sensitive
	);


	/* Edit Menu */
	sensitive = (tlist_selected_thumb > -1) ? TRUE : FALSE;
	/* Move */
	GTK_WIDGET_SET_SENSITIVE(imbr->move_mi, sensitive)
	ToolBarItemSetSensitiveID(
	    tb, EDV_IMBR_OP_MOVE, sensitive
	);
	/* Copy */
	GTK_WIDGET_SET_SENSITIVE(imbr->copy_mi, sensitive)
	ToolBarItemSetSensitiveID(
	    tb, EDV_IMBR_OP_COPY, sensitive
	);
	/* Link */
	GTK_WIDGET_SET_SENSITIVE(imbr->link_mi, sensitive);
	ToolBarItemSetSensitiveID(
	    tb, EDV_IMBR_OP_LINK, sensitive
	);
	/* Rename */
	GTK_WIDGET_SET_SENSITIVE(imbr->rename_mi, sensitive);
	ToolBarItemSetSensitiveID(
	    tb, EDV_IMBR_OP_RENAME, sensitive
	);
	/* Change Permissions */
	GTK_WIDGET_SET_SENSITIVE(imbr->chmod_mi, sensitive);
	ToolBarItemSetSensitiveID(
	    tb, EDV_IMBR_OP_CHMOD, sensitive
	);
	/* Change Ownership */
	GTK_WIDGET_SET_SENSITIVE(imbr->chown_mi, sensitive);
	ToolBarItemSetSensitiveID(
	    tb, EDV_IMBR_OP_CHOWN, sensitive
	);
	/* Set Time Stamps */
	GTK_WIDGET_SET_SENSITIVE(imbr->chtime_mi, sensitive);
	ToolBarItemSetSensitiveID(
	    tb, EDV_IMBR_OP_CHTIME, sensitive
	);
	/* Delete */
	GTK_WIDGET_SET_SENSITIVE(imbr->delete_mi, sensitive);
	ToolBarItemSetSensitiveID(
	    tb, EDV_IMBR_OP_DELETE, sensitive
	);
	/* Copy path */
	GTK_WIDGET_SET_SENSITIVE(imbr->copy_path_mi, sensitive)
	ToolBarItemSetSensitiveID(
	    tb, EDV_IMBR_OP_COPY_PATH, sensitive
	);
	/* Copy URL */
	GTK_WIDGET_SET_SENSITIVE(imbr->copy_url_mi, sensitive)
	ToolBarItemSetSensitiveID(
	    tb, EDV_IMBR_OP_COPY_URL, sensitive
	);
	/* Properties */
	GTK_WIDGET_SET_SENSITIVE(imbr->properties_mi, sensitive)
	ToolBarItemSetSensitiveID(
	    tb, EDV_IMBR_OP_PROPERTIES, sensitive
	);

	/* View Menu */
	/* Stop loading */
	sensitive = loading_in_progress;
	GTK_WIDGET_SET_SENSITIVE(imbr->stop_mi, sensitive)
	ToolBarItemSetSensitiveID(
	    tb, EDV_IMBR_OP_STOP, sensitive
	);
	/* Continue loading */
	sensitive = !loading_in_progress;
	GTK_WIDGET_SET_SENSITIVE(imbr->continue_mi, sensitive)
	ToolBarItemSetSensitiveID(
	    tb, EDV_IMBR_OP_CONTINUE, sensitive
	);
	sensitive = TRUE;
	GTK_WIDGET_SET_SENSITIVE(imbr->presentation_mode_mi, sensitive)
	ToolBarItemSetSensitiveID(
	    tb, EDV_IMBR_OP_PRESENTATION_MODE, sensitive
	);

	/* Show Tool Bar */
	w = imbr->show_tool_bar_micheck;
	state = EDV_GET_B(EDV_CFG_PARM_IMBR_SHOW_TOOL_BAR);
	DO_SET_CHECK_STATE
	ToolBarItemSetToggleID(
	    tb, EDV_IMBR_OP_SHOW_TOOL_BAR, state
	);
	/* Show Location Bar */
	w = imbr->show_location_bar_micheck;
	state = EDV_GET_B(EDV_CFG_PARM_IMBR_SHOW_LOCATION_BAR);
	DO_SET_CHECK_STATE
	ToolBarItemSetToggleID(
	    tb, EDV_IMBR_OP_SHOW_LOCATION_BAR, state
	);
	/* Show Mount Bar */
	w = imbr->show_mount_bar_micheck;
	state = EDV_GET_B(EDV_CFG_PARM_IMBR_SHOW_MOUNT_BAR);
	DO_SET_CHECK_STATE
	ToolBarItemSetToggleID(
	    tb, EDV_IMBR_OP_SHOW_MOUNT_BAR, state
	);
	/* Show Find Bar */
	w = imbr->show_find_bar_micheck;
	state = EDV_GET_B(EDV_CFG_PARM_IMBR_SHOW_FIND_BAR);
	DO_SET_CHECK_STATE
	ToolBarItemSetToggleID(
	    tb, EDV_IMBR_OP_SHOW_FIND_BAR, state
	);
	/* Show Status Bar */
	w = imbr->show_status_bar_micheck;
	state = EDV_GET_B(EDV_CFG_PARM_IMBR_SHOW_STATUS_BAR);
	DO_SET_CHECK_STATE
	ToolBarItemSetToggleID(
	    tb, EDV_IMBR_OP_SHOW_STATUS_BAR, state
	);
	/* Show Hidden Objects */
	w = imbr->show_hidden_objects_micheck;
	state = EDV_GET_B(EDV_CFG_PARM_IMBR_SHOW_OBJECT_HIDDEN);
	DO_SET_CHECK_STATE 
	ToolBarItemSetToggleID(
	    tb, EDV_IMBR_OP_SHOW_HIDDEN_OBJECTS, state
	);
	/* Show No Access Objects */
	w = imbr->show_noaccess_objects_micheck;
	state = EDV_GET_B(EDV_CFG_PARM_IMBR_SHOW_OBJECT_NOACCESS);
	DO_SET_CHECK_STATE
	ToolBarItemSetToggleID(
	    tb, EDV_IMBR_OP_SHOW_NOACCESS_OBJECTS, state
	);
	/* Show Non-Image Objects */
	w = imbr->show_nonimage_objects_micheck;
	state = EDV_GET_B(EDV_CFG_PARM_IMBR_SHOW_OBJECT_NONIMAGE);
	DO_SET_CHECK_STATE
	ToolBarItemSetToggleID(
	    tb, EDV_IMBR_OP_SHOW_NONIMAGE_OBJECTS, state
	);

	/* Device Menu */
	w = imbr->mount_mi;
	sensitive = (selected_dev_ptr != NULL) ?
	    !EDV_DEVICE_IS_NO_UNMOUNT(selected_dev_ptr) : FALSE;
	GTK_WIDGET_SET_SENSITIVE(w, sensitive)
	if(TRUE)
	{
	    const gchar *text;
	    guint8 **icon_data;
	    if(selected_dev_ptr != NULL)
	    {
		if(EDV_DEVICE_IS_MOUNTED(selected_dev_ptr))
		{
		    text = "Unmount";
		    icon_data = (guint8 **)icon_unmount_20x20_xpm;
		}
		else  
		{
		    text = "Mount";
		    icon_data = (guint8 **)icon_mount_20x20_xpm;
		}
	    }
	    else
	    {
		text = "Mount/Unmount";
		icon_data = (guint8 **)icon_unmount_20x20_xpm;
	    }
	    GUIMenuItemSetPixmap(w, icon_data);
	    GUIMenuItemSetLabel(w, text);
	    ToolBarItemUpdateByID(
		tb, EDV_IMBR_OP_MOUNT, text, NULL, NULL
	    );
	}
	ToolBarItemSetSensitiveID(
	    tb, EDV_IMBR_OP_MOUNT, sensitive
	);

	/* Eject */
	if(selected_dev_ptr != NULL)
	    sensitive = !STRISEMPTY(selected_dev_ptr->command_eject);
	else
	    sensitive = FALSE;
	GTK_WIDGET_SET_SENSITIVE(imbr->eject_mi, sensitive)
	ToolBarItemSetSensitiveID(
	    tb, EDV_IMBR_OP_EJECT, sensitive
	);


	/* Device check, tools, and format commands */
	if(selected_dev_ptr != NULL)
	    sensitive = !STRISEMPTY(selected_dev_ptr->command_check);
	else
	    sensitive = FALSE;
	GTK_WIDGET_SET_SENSITIVE(imbr->device_check_mi, sensitive)
	ToolBarItemSetSensitiveID(
	    tb, EDV_IMBR_OP_DEVICE_CHECK, sensitive
	);

	if(selected_dev_ptr != NULL)
	    sensitive = !STRISEMPTY(selected_dev_ptr->command_tools);
	else
	    sensitive = FALSE;
	GTK_WIDGET_SET_SENSITIVE(imbr->device_tools_mi, sensitive)
	ToolBarItemSetSensitiveID(
	    tb, EDV_IMBR_OP_DEVICE_TOOLS, sensitive
	);

	if(selected_dev_ptr != NULL)
	    sensitive = !STRISEMPTY(selected_dev_ptr->command_format);
	else
	    sensitive = FALSE;
	GTK_WIDGET_SET_SENSITIVE(imbr->device_format_mi, sensitive)
	ToolBarItemSetSensitiveID(
	    tb, EDV_IMBR_OP_DEVICE_FORMAT, sensitive
	);


	/* Settings Menu */
	if(write_protect_changed)
	{
	    w = imbr->write_protect_mi;
	    if(w != NULL)
		GUIMenuItemSetPixmap(
		    w,
		    (guint8 **)(write_protect ?
			icon_secure_20x20_xpm : icon_insecure_20x20_xpm)
		);
	    ToolBarItemUpdateByID(
		tb, EDV_IMBR_OP_WRITE_PROTECT,
		NULL,
		(guint8 **)(write_protect ?
		    icon_secure_20x20_xpm : icon_insecure_20x20_xpm),
		NULL
	    );
	}

	/* Delete Method: Recycle */  
	w = imbr->delete_method_recycle_micheck;
	GUIMenuItemSetPixmap(w, recbin_icon_data);
	state = (delete_method == EDV_DELETE_METHOD_RECYCLE) ?
	    TRUE : FALSE;
	DO_SET_CHECK_STATE
	ToolBarItemUpdateByID(
	    tb, EDV_IMBR_OP_DELETE_METHOD_RECYCLE, 
	    NULL, recbin_icon_data, NULL
	);
	ToolBarItemSetToggleID(
	    tb, EDV_IMBR_OP_DELETE_METHOD_RECYCLE, state
	);

	/* Delete Method: Purge */
	w = imbr->delete_method_purge_micheck;
	state = (delete_method == EDV_DELETE_METHOD_PURGE) ?
	    TRUE : FALSE;
	DO_SET_CHECK_STATE
	ToolBarItemSetToggleID(
	    tb, EDV_IMBR_OP_DELETE_METHOD_PURGE, state
	);


	/* Windows Menu */
	if(recbin_icon_data != NULL)
	{
	    GUIMenuItemSetPixmap(
		imbr->window_recycle_bin_mi, recbin_icon_data
	    );
	    ToolBarItemUpdateByID(
		tb, EDV_IMBR_OP_RECYCLE_BIN,
		NULL, recbin_icon_data, NULL
	    );
	}


	/* TList Right-Click Menu */
	sensitive = (tlist_selected_thumb > -1) ? TRUE : FALSE;
	GTK_WIDGET_SET_SENSITIVE(imbr->tlist_open_mi, sensitive)
	GTK_WIDGET_SET_SENSITIVE(imbr->tlist_open_to_mi, sensitive)
	GTK_WIDGET_SET_SENSITIVE(imbr->tlist_open_with_mi, sensitive)
	GTK_WIDGET_SET_SENSITIVE(imbr->tlist_move_mi, sensitive)
	GTK_WIDGET_SET_SENSITIVE(imbr->tlist_copy_mi, sensitive)
	GTK_WIDGET_SET_SENSITIVE(imbr->tlist_link_mi, sensitive)
	GTK_WIDGET_SET_SENSITIVE(imbr->tlist_rename_mi, sensitive)
	GTK_WIDGET_SET_SENSITIVE(imbr->tlist_chmod_mi, sensitive)
	GTK_WIDGET_SET_SENSITIVE(imbr->tlist_chown_mi, sensitive)
	GTK_WIDGET_SET_SENSITIVE(imbr->tlist_delete_mi, sensitive)
	GTK_WIDGET_SET_SENSITIVE(imbr->tlist_copy_path_mi, sensitive)
	GTK_WIDGET_SET_SENSITIVE(imbr->tlist_copy_url_mi, sensitive)
	GTK_WIDGET_SET_SENSITIVE(imbr->tlist_properties_mi, sensitive)

	w = imbr->tlist_mount_mi;
	if(selected_dev_ptr == NULL)
	    DO_HIDE
	else
	    DO_SHOW
	sensitive = (selected_dev_ptr != NULL) ?
	    !EDV_DEVICE_IS_NO_UNMOUNT(selected_dev_ptr) : FALSE;
	GTK_WIDGET_SET_SENSITIVE(w, sensitive)
	if(selected_dev_ptr != NULL)
	{
	    const gchar *text;
	    guint8 **icon_data;
	    if(EDV_DEVICE_IS_MOUNTED(selected_dev_ptr))
	    {
		text = "Unmount";
		icon_data = (guint8 **)icon_unmount_20x20_xpm;
	    }
	    else
	    {
		text = "Mount";
		icon_data = (guint8 **)icon_mount_20x20_xpm;
	    }
	    GUIMenuItemSetPixmap(w, icon_data);
	    GUIMenuItemSetLabel(w, text);
	}

	w = imbr->tlist_mount_misep;
	if(selected_dev_ptr == NULL)
	    DO_HIDE
	else
	    DO_SHOW

	/* Eject */
	w = imbr->tlist_eject_mi;
	if(selected_dev_ptr == NULL)
	    DO_HIDE
	else
	    DO_SHOW
	if(selected_dev_ptr != NULL)
	    sensitive = !STRISEMPTY(selected_dev_ptr->command_eject);
	else
	    sensitive = FALSE;
	GTK_WIDGET_SET_SENSITIVE(w, sensitive)




	/* Update status bar */
	EDVStatusBarUpdate(imbr->status_bar);

#undef DO_SHOW
#undef DO_HIDE
#undef DO_SET_CHECK_STATE
}

/*
 *	Marks the Image Browser as busy or ready.
 */
void EDVImbrSetBusy(edv_imbr_struct *imbr, gboolean busy)
{
	GdkCursor *cur;
	GtkWidget *w;
	edv_core_struct *core;

	if(imbr == NULL)
	    return;

	w = imbr->toplevel;
	core = imbr->core;
	if((w == NULL) || (core == NULL))
	    return;

	if(busy)
	{
	    imbr->busy_count++;
	    if(imbr->busy_count > 1)
		return;

	    cur = EDVGetCursor(core, EDV_CURSOR_CODE_BUSY);
	}
	else
	{
	    imbr->busy_count--;
	    if(imbr->busy_count < 0)
		imbr->busy_count = 0;
	    if(imbr->busy_count > 0)
		return;
	    cur = (imbr->passive_busy_count > 0) ?
		EDVGetCursor(core, EDV_CURSOR_CODE_PASSIVE_BUSY) :
		NULL;
	}

	if(w->window != NULL)
	{
	    gdk_window_set_cursor(w->window, cur);
	    gdk_flush();
	}
}

/*
 *	Marks the Image Browser as passive busy or ready.
 */
void EDVImbrSetPassiveBusy(edv_imbr_struct *imbr, gboolean busy)
{
	GdkCursor *cur;
	GtkWidget *w;
	edv_core_struct *core;

	if(imbr == NULL)
	    return; 

	w = imbr->toplevel;
	core = imbr->core;
	if((w == NULL) || (core == NULL))
	    return;

	if(busy)
	{
	    imbr->passive_busy_count++;
	    if((imbr->passive_busy_count > 1) || (imbr->busy_count > 0))
		return;
	    cur = EDVGetCursor(core, EDV_CURSOR_CODE_PASSIVE_BUSY);
	}
	else
	{
	    imbr->passive_busy_count--;
	    if(imbr->passive_busy_count < 0)
		imbr->passive_busy_count = 0;
	    if((imbr->passive_busy_count > 0) || (imbr->busy_count > 0))
		return;
	    cur = NULL;
	}

	if(w->window != NULL)
	{
	    gdk_window_set_cursor(w->window, cur);
	    gdk_flush();
	}
}

/*
 *	Checks if the Image Browser is mapped.
 */
gboolean EDVImbrIsMapped(edv_imbr_struct *imbr)
{
	GtkWidget *w = (imbr != NULL) ? imbr->toplevel : NULL;
	return((w != NULL) ? GTK_WIDGET_MAPPED(w) : FALSE);
}

/*
 *	Maps the Image Browser.
 */
void EDVImbrMap(edv_imbr_struct *imbr)
{
	GtkWidget *w = (imbr != NULL) ? imbr->toplevel : NULL;
	if(w == NULL)
	    return;

	gtk_widget_show_raise(w);
}

/*
 *	Unmaps the Image Browser.
 */
void EDVImbrUnmap(edv_imbr_struct *imbr)
{
	GtkWidget *w = (imbr != NULL) ? imbr->toplevel : NULL;
	if(w == NULL)
	    return;

	gtk_widget_hide(w);
}

/*
 *	Deletes the Image Browser.
 */
void EDVImbrDelete(edv_imbr_struct *imbr)
{
	if(imbr == NULL)
	    return;

	/* Delete all Thumbs in the Thumbs List */
	EDVImbrTlistClear(imbr);

	/* Remove idle & timeout callbacks */
	GTK_TIMEOUT_REMOVE(imbr->loading_tocb);
	imbr->loading_tocb = 0;

	/* Reset last selected item references */
	imbr->tlist_selected_thumb = -1;


	/* Delete the Object Operations Dialog */
	EDVObjOpDlgDelete(imbr->obj_op_dlg);


	TListDelete(imbr->tlist);
	ImgViewDelete(imbr->imgview);

	GTK_WIDGET_DESTROY(imbr->tlist_open_to_menu);
	GTK_WIDGET_DESTROY(imbr->tlist_menu);

	EDVStatusBarDelete(imbr->status_bar);

	ToolBarDelete(imbr->tool_bar);

	EDVMountBarDelete(imbr->mount_bar);

	EDVFindBarDelete(imbr->find_bar);

	GTK_WIDGET_DESTROY(imbr->location_icon_pm);
	GTK_WIDGET_DESTROY(imbr->location_icon_fixed);
	GTK_WIDGET_DESTROY(imbr->location_combo);
	GTK_WIDGET_DESTROY(imbr->location_bar_hbox);

	GTK_WIDGET_DESTROY(imbr->new_object_menu);
	GTK_WIDGET_DESTROY(imbr->open_to_menu);

	GTK_WIDGET_DESTROY(imbr->menu_bar);

	GTK_WIDGET_DESTROY(imbr->menu_bar_handle);
	GTK_WIDGET_DESTROY(imbr->tool_bar_handle);
	GTK_WIDGET_DESTROY(imbr->location_bar_handle);
	GTK_WIDGET_DESTROY(imbr->bars_vbox);
	GTK_WIDGET_DESTROY(imbr->main_paned);
	GTK_WIDGET_DESTROY(imbr->main_vbox);
	GTK_WIDGET_DESTROY(imbr->toplevel);


	/* Unref special icons */
	GDK_PIXMAP_UNREF(imbr->folder_parent_pixmap);
	GDK_BITMAP_UNREF(imbr->folder_parent_mask);
	GDK_PIXMAP_UNREF(imbr->folder_noaccess_pixmap);
	GDK_BITMAP_UNREF(imbr->folder_noaccess_mask);
	GDK_PIXMAP_UNREF(imbr->file_badimage_pixmap);
	GDK_BITMAP_UNREF(imbr->file_badimage_mask);

	/* Delete other resources */

	/* Operation IDs */
	EDVImbrOPIDListDelete(imbr->opid_list);

	g_free(imbr->thumbs_list_filter);

	g_free(imbr);
}
