Codepage messages related translated & other stuff...
[midnight-commander.git] / gnome / gdesktop.h
blob606ed77e43cd7d277a75394229e1cc23c1feb588
1 /* Desktop management for the Midnight Commander
3 * Copyright (C) 1998-1999 The Free Software Foundation
5 * Authors: Federico Mena <federico@nuclecu.unam.mx>
6 * Miguel de Icaza <miguel@nuclecu.unam.mx>
7 */
9 #ifndef GDESKTOP_H
10 #define GDESKTOP_H
12 #include "dir.h"
13 #include "gcmd.h"
16 /* Snap granularity for desktop icons -- maybe these should be calculated in
17 * terms of the font size?
19 #define DESKTOP_SNAP_X 80
20 #define DESKTOP_SNAP_Y 80
22 /* Name of the user's desktop directory (i.e. ~/desktop) */
23 #define DESKTOP_DIR_NAME ".gnome-desktop"
26 /* Configuration options for the desktop */
28 extern int desktop_use_shaped_icons; /* Whether to use shaped icons or not (for slow X servers) */
29 extern int desktop_use_shaped_text; /* Shaped text for the icons on the desktop */
30 extern int desktop_auto_placement; /* Whether to auto-place icons or not (user placement) */
31 extern int desktop_snap_icons; /* Whether to snap icons to the grid or not */
32 extern int desktop_arr_r2l; /* Arrange from right to left */
33 extern int desktop_arr_b2t; /* Arrange from bottom to top */
34 extern int desktop_arr_rows; /* Arrange in rows instead of columns */
35 extern char *desktop_directory;
37 /* Menu items for arranging the desktop icons */
38 extern GnomeUIInfo desktop_arrange_icons_items[];
40 /* Initializes the desktop -- init DnD, load the default desktop icons, etc. */
41 void desktop_init (void);
43 /* Shuts the desktop down by destroying the desktop icons. */
44 void desktop_destroy (void);
47 /* This structure defines the information carried by a desktop icon */
48 typedef struct {
49 GtkWidget *dicon; /* The desktop icon widget */
50 int x, y; /* Position in the desktop */
51 int slot; /* Index of the slot the icon is in, or -1 for none */
52 char *filename; /* The file this icon refers to
53 * (relative to the desktop_directory)
55 char *url; /* URL this icon points to */
56 int selected : 1; /* Is the icon selected? */
57 int tmp_selected : 1; /* Temp storage for original selection while rubberbanding */
58 } DesktopIconInfo;
60 void desktop_icon_info_open (DesktopIconInfo *dii);
61 void desktop_icon_info_delete (DesktopIconInfo *dii);
62 void desktop_icon_set_busy (DesktopIconInfo *dii, int busy);
64 DesktopIconInfo *desktop_icon_info_get_by_filename (char *filename);
66 file_entry *file_entry_from_file (char *filename);
67 void file_entry_free (file_entry *fe);
69 gboolean is_mountable (char *filename, file_entry *fe, int *is_mounted, char **mount_point);
70 gboolean is_ejectable (char *filename);
71 gboolean do_mount_umount (char *filename, gboolean is_mount);
72 gboolean do_eject (char *filename);
74 void desktop_rescan_devices (void);
75 void desktop_recreate_default_icons (void);
76 void desktop_reload_icons (int user_pos, int xpos, int ypos);
77 void desktop_arrange_icons (SortType type);
78 void desktop_create_url (const char *filename, const char *title, const char *url, const char *icon);
79 void desktop_tidy_icons (void);
82 extern int desktop_wm_is_gnome_compliant;
84 #endif