1998-10-30 03:47:54 +03:00
|
|
|
/* Desktop management for the Midnight Commander
|
|
|
|
*
|
1999-03-30 10:09:56 +04:00
|
|
|
* Copyright (C) 1998-1999 The Free Software Foundation
|
1998-10-30 03:47:54 +03:00
|
|
|
*
|
|
|
|
* Authors: Federico Mena <federico@nuclecu.unam.mx>
|
|
|
|
* Miguel de Icaza <miguel@nuclecu.unam.mx>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef GDESKTOP_H
|
|
|
|
#define GDESKTOP_H
|
1999-01-22 03:59:11 +03:00
|
|
|
|
1999-01-21 22:29:39 +03:00
|
|
|
#include "dir.h"
|
2000-01-25 13:30:53 +03:00
|
|
|
#include "gcmd.h"
|
1998-10-30 03:47:54 +03:00
|
|
|
|
1999-01-22 03:59:11 +03:00
|
|
|
|
1999-01-02 21:41:59 +03:00
|
|
|
/* Snap granularity for desktop icons -- maybe these should be calculated in
|
|
|
|
* terms of the font size?
|
|
|
|
*/
|
1998-10-30 03:47:54 +03:00
|
|
|
#define DESKTOP_SNAP_X 80
|
|
|
|
#define DESKTOP_SNAP_Y 80
|
|
|
|
|
1999-03-19 20:13:33 +03:00
|
|
|
/* Name of the user's desktop directory (i.e. ~/desktop) */
|
|
|
|
#define DESKTOP_DIR_NAME ".gnome-desktop"
|
|
|
|
|
1998-10-30 03:47:54 +03:00
|
|
|
|
|
|
|
/* Configuration options for the desktop */
|
|
|
|
|
1999-01-02 21:41:59 +03:00
|
|
|
extern int desktop_use_shaped_icons; /* Whether to use shaped icons or not (for slow X servers) */
|
1999-08-24 03:13:31 +04:00
|
|
|
extern int desktop_use_shaped_text; /* Shaped text for the icons on the desktop */
|
1999-01-02 21:41:59 +03:00
|
|
|
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 */
|
1999-08-09 07:41:39 +04:00
|
|
|
extern int desktop_arr_r2l; /* Arrange from right to left */
|
|
|
|
extern int desktop_arr_b2t; /* Arrange from bottom to top */
|
|
|
|
extern int desktop_arr_rows; /* Arrange in rows instead of columns */
|
1999-02-17 05:18:12 +03:00
|
|
|
extern char *desktop_directory;
|
1998-10-30 03:47:54 +03:00
|
|
|
|
1999-08-10 02:54:02 +04:00
|
|
|
/* Menu items for arranging the desktop icons */
|
|
|
|
extern GnomeUIInfo desktop_arrange_icons_items[];
|
1999-08-09 07:41:39 +04:00
|
|
|
|
1998-10-30 03:47:54 +03:00
|
|
|
/* 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);
|
|
|
|
|
1998-12-30 05:51:01 +03:00
|
|
|
|
1998-12-22 02:29:46 +03:00
|
|
|
/* This structure defines the information carried by a desktop icon */
|
1998-12-31 04:43:11 +03:00
|
|
|
typedef struct {
|
1998-12-22 02:29:46 +03:00
|
|
|
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 */
|
1999-01-02 21:41:59 +03:00
|
|
|
char *filename; /* The file this icon refers to
|
|
|
|
* (relative to the desktop_directory)
|
|
|
|
*/
|
1999-01-31 00:52:40 +03:00
|
|
|
char *url; /* URL this icon points to */
|
1998-12-22 02:29:46 +03:00
|
|
|
int selected : 1; /* Is the icon selected? */
|
|
|
|
int tmp_selected : 1; /* Temp storage for original selection while rubberbanding */
|
1998-12-31 04:43:11 +03:00
|
|
|
} DesktopIconInfo;
|
1998-10-30 03:47:54 +03:00
|
|
|
|
1999-01-02 21:41:59 +03:00
|
|
|
void desktop_icon_info_open (DesktopIconInfo *dii);
|
|
|
|
void desktop_icon_info_delete (DesktopIconInfo *dii);
|
1999-03-11 22:37:24 +03:00
|
|
|
void desktop_icon_set_busy (DesktopIconInfo *dii, int busy);
|
1999-03-11 05:40:53 +03:00
|
|
|
|
|
|
|
DesktopIconInfo *desktop_icon_info_get_by_filename (char *filename);
|
1998-10-31 02:22:35 +03:00
|
|
|
|
1999-01-19 01:37:39 +03:00
|
|
|
file_entry *file_entry_from_file (char *filename);
|
|
|
|
void file_entry_free (file_entry *fe);
|
1998-10-30 03:47:54 +03:00
|
|
|
|
1999-02-23 04:56:09 +03:00
|
|
|
gboolean is_mountable (char *filename, file_entry *fe, int *is_mounted, char **mount_point);
|
1999-03-11 05:40:53 +03:00
|
|
|
gboolean is_ejectable (char *filename);
|
1999-02-17 05:18:12 +03:00
|
|
|
gboolean do_mount_umount (char *filename, gboolean is_mount);
|
1999-03-11 05:40:53 +03:00
|
|
|
gboolean do_eject (char *filename);
|
1999-02-17 05:18:12 +03:00
|
|
|
|
1999-02-23 04:56:09 +03:00
|
|
|
void desktop_rescan_devices (void);
|
1999-09-21 04:40:21 +04:00
|
|
|
void desktop_recreate_default_icons (void);
|
1999-02-23 04:56:09 +03:00
|
|
|
void desktop_reload_icons (int user_pos, int xpos, int ypos);
|
2000-01-25 13:30:53 +03:00
|
|
|
void desktop_arrange_icons (SortType type);
|
2001-07-27 23:38:31 +04:00
|
|
|
void desktop_create_url (const char *filename, const char *title,
|
|
|
|
const char *url, const char *icon,
|
|
|
|
gboolean is_template);
|
2000-05-15 21:29:02 +04:00
|
|
|
void desktop_tidy_icons (void);
|
|
|
|
|
1999-02-23 04:56:09 +03:00
|
|
|
|
|
|
|
extern int desktop_wm_is_gnome_compliant;
|
1999-03-30 10:09:56 +04:00
|
|
|
|
1998-10-30 03:47:54 +03:00
|
|
|
#endif
|