mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-23 12:56:51 +03:00
b169beea0e
* setup.c: Declare extern int tree_panel_visible for the GNOME version. 1999-02-18 Federico Mena Quintero <federico@nuclecu.unam.mx> * gmount.c (gmount_setup_devices): New function to set up the mountable devices on the desktop directory. Moved over from gdesktop.c. Added an argument that specifies whether it should clean up the device list first. (cleanup_devices): Delete the metadata for the devices. (setup_devices): Free the list of device names. Use the proper icon for each device. (create_device_link): Better error checking. * gdesktop.c (create_desktop_dir): Use gmount_setup_devices(). (desktop_icon_info_destroy): Made static. (desktop_popup_items): The command for rescanning mountable devices should go here. (handle_rescan_devices): Call gmount and refresh the desktop. * gdesktop.h: Removed the declaration of tree_panel_visible, since it has nothing to do with the desktop. * glayout.c (gnome_panel_commands_menu): Removed the recreate devices command. * gdesktop.c (desktop_popup_items): Added a new command to create a file window.
59 lines
1.9 KiB
C
59 lines
1.9 KiB
C
/* Desktop management for the Midnight Commander
|
|
*
|
|
* Copyright (C) 1998 The Free Software Foundation
|
|
*
|
|
* Authors: Federico Mena <federico@nuclecu.unam.mx>
|
|
* Miguel de Icaza <miguel@nuclecu.unam.mx>
|
|
*/
|
|
|
|
#ifndef GDESKTOP_H
|
|
#define GDESKTOP_H
|
|
|
|
#include "dir.h"
|
|
|
|
|
|
/* Snap granularity for desktop icons -- maybe these should be calculated in
|
|
* terms of the font size?
|
|
*/
|
|
#define DESKTOP_SNAP_X 80
|
|
#define DESKTOP_SNAP_Y 80
|
|
|
|
|
|
/* Configuration options for the desktop */
|
|
|
|
extern int desktop_use_shaped_icons; /* Whether to use shaped icons or not (for slow X servers) */
|
|
extern int desktop_auto_placement; /* Whether to auto-place icons or not (user placement) */
|
|
extern int desktop_snap_icons; /* Whether to snap icons to the grid or not */
|
|
extern char *desktop_directory;
|
|
|
|
/* Initializes the desktop -- init DnD, load the default desktop icons, etc. */
|
|
void desktop_init (void);
|
|
|
|
/* Shuts the desktop down by destroying the desktop icons. */
|
|
void desktop_destroy (void);
|
|
|
|
|
|
/* This structure defines the information carried by a desktop icon */
|
|
typedef struct {
|
|
GtkWidget *dicon; /* The desktop icon widget */
|
|
int x, y; /* Position in the desktop */
|
|
int slot; /* Index of the slot the icon is in, or -1 for none */
|
|
char *filename; /* The file this icon refers to
|
|
* (relative to the desktop_directory)
|
|
*/
|
|
char *url; /* URL this icon points to */
|
|
int selected : 1; /* Is the icon selected? */
|
|
int tmp_selected : 1; /* Temp storage for original selection while rubberbanding */
|
|
} DesktopIconInfo;
|
|
|
|
void desktop_icon_info_open (DesktopIconInfo *dii);
|
|
void desktop_icon_info_delete (DesktopIconInfo *dii);
|
|
|
|
file_entry *file_entry_from_file (char *filename);
|
|
void file_entry_free (file_entry *fe);
|
|
|
|
gboolean is_mountable (char *filename, file_entry *fe, int *is_mounted);
|
|
gboolean do_mount_umount (char *filename, gboolean is_mount);
|
|
|
|
#endif
|