mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-23 12:56:51 +03:00
e7911e2b15
1998-10-21 Federico Mena Quintero <federico@nuclecu.unam.mx> * gdesktop.c (create_desktop_icon): Renamed from my_create_transparent_text_window. Now uses the DesktopIcon widget for its work. (get_desktop_icon_for_dentry): Renamed from get_transparent_window_for_dentry. Uses the DesktopIcon widget. (get_desktop_icon_for_di): Renamed from get_transparent_window_for_di. (desktop_icon_properties): Do not size_request the icon, since now we can get its dimensions directly from the DesktopIcon structure. * desktop-icon.[ch]: New file that takes care of desktop icons. It provides the spiffy widget that is used for them. * Makefile.in: Added desktop-icon.[ch] to the list of sources. MC should use Automake, I think.
75 lines
2.0 KiB
C
75 lines
2.0 KiB
C
#ifndef _GDESKTOP_H
|
|
#define _GDESKTOP_H
|
|
|
|
#define MC_LIB_DESKTOP "mc.desktop"
|
|
|
|
/* Drag and drop types recognized by us */
|
|
enum {
|
|
TARGET_URI_LIST,
|
|
TARGET_URL_LIST,
|
|
TARGET_TEXT_PLAIN,
|
|
};
|
|
|
|
|
|
/* Types of desktop icons:
|
|
*
|
|
* o Application: Double click: start up application;
|
|
* Dropping: start up program with arguments.
|
|
*
|
|
* o Directory: Double click: opens the directory in a panel.
|
|
* Double click: copies/moves files.
|
|
*
|
|
* o File: Opens the application according to regex_command
|
|
*/
|
|
|
|
typedef enum {
|
|
application,
|
|
directory,
|
|
file
|
|
} icon_t;
|
|
|
|
/* 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;
|
|
|
|
/* size of the snap to grid size */
|
|
#define SNAP_X 80
|
|
#define SNAP_Y 80
|
|
|
|
/* gtrans.c */
|
|
|
|
extern int want_transparent_icons;
|
|
extern int want_transparent_text;
|
|
|
|
GtkWidget *make_transparent_window (char *file);
|
|
|
|
/* gdesktop.c */
|
|
void drop_on_directory (GtkSelectionData *sel_data, GdkDragContext *context,
|
|
GdkDragAction action, char *dest, int force_manually);
|
|
#if 0
|
|
void drop_on_directory (GdkEventDropDataAvailable *event, char *dest, int force_manually);
|
|
void artificial_drag_start (GdkWindow *source_window, int x, int y);
|
|
#endif
|
|
|
|
void gnome_arrange_icons (void);
|
|
void start_desktop (void);
|
|
void stop_desktop (void);
|
|
|
|
/* These get invoked by the context sensitive popup menu in gscreen.c */
|
|
void desktop_icon_properties (GtkWidget *widget, desktop_icon_t *di);
|
|
void desktop_icon_execute (GtkWidget *widget, desktop_icon_t *di);
|
|
void desktop_icon_delete (GtkWidget *widget, desktop_icon_t *di);
|
|
|
|
/* Pops up the context sensitive menu for a WPanel or a desktop_icon_t */
|
|
void file_popup (GdkEventButton *event, void *WPanel_pointer, void *desktop_icon_t_pointer, int row, char *filename);
|
|
|
|
extern int icons_snap_to_grid;
|
|
|
|
#endif
|