1998-10-30 03:47:54 +03:00
|
|
|
/* 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
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
|
/* 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) */
|
|
|
|
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 */
|
1998-10-30 03:47:54 +03:00
|
|
|
|
1999-01-17 07:17:20 +03:00
|
|
|
extern int tree_panel_visible;
|
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)
|
|
|
|
*/
|
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_destroy (DesktopIconInfo *dii);
|
|
|
|
void desktop_icon_info_open (DesktopIconInfo *dii);
|
|
|
|
void desktop_icon_info_delete (DesktopIconInfo *dii);
|
1998-10-31 02:22:35 +03:00
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
application,
|
|
|
|
directory,
|
|
|
|
file
|
|
|
|
} icon_t;
|
1998-12-30 05:51:01 +03:00
|
|
|
|
1998-10-31 02:22:35 +03:00
|
|
|
/* A structure that describes each icon on the desktop */
|
|
|
|
typedef struct {
|
|
|
|
GnomeDesktopEntry *dentry;
|
|
|
|
GtkWidget *widget;
|
|
|
|
icon_t type;
|
|
|
|
int x, y;
|
|
|
|
int grid_x, grid_y;
|
|
|
|
char *pathname;
|
|
|
|
} desktop_icon_t;
|
|
|
|
|
1998-10-30 03:47:54 +03:00
|
|
|
|
|
|
|
#endif
|