ede/eiconman/eiconman.h

110 lines
2.2 KiB
C
Raw Normal View History

/*
* $Id$
*
2007-05-22 18:53:17 +04:00
* Eiconman, desktop and icon manager
* Part of Equinox Desktop Environment (EDE).
2007-05-22 18:53:17 +04:00
* Copyright (c) 2000-2007 EDE Authors.
*
2007-05-22 18:53:17 +04:00
* This program is licensed under terms of the
* GNU General Public License version 2 or newer.
* See COPYING for details.
*/
2007-05-22 18:53:17 +04:00
#ifndef __EICONMAN_H__
#define __EICONMAN_H__
2007-05-22 18:53:17 +04:00
#include <fltk/Window.h>
#include <fltk/PopupMenu.h>
#include <edelib/String.h>
#include <edelib/Config.h>
#include <edelib/Vector.h>
2007-05-22 18:53:17 +04:00
// settings realted to specific desktop view
struct DesktopSettings {
bool wp_use;
int color;
edelib::String wallpaper;
};
2007-05-22 18:53:17 +04:00
struct GlobalIconSettings {
int label_background;
int label_foreground;
int label_fontsize;
int label_maxwidth;
int gridspacing;
bool label_transparent;
bool label_draw;
bool one_click_exec;
bool auto_arr;
bool same_size;
};
2007-05-22 18:53:17 +04:00
// settings related to .desktop files
struct IconSettings {
int x, y;
bool cmd_is_url; // interpret cmd as url, like system:/,trash:/,$HOME
edelib::String name;
edelib::String cmd;
edelib::String icon;
edelib::String icon2; // for stateable icons, like trash (empty/full)
edelib::String desktop_name; // name used as key when storing positions
};
2007-05-22 20:27:33 +04:00
// selection overlay
struct SelectionOverlay {
int x, y, w, h;
bool show;
};
2007-05-22 18:53:17 +04:00
class DesktopIcon;
class Desktop : public fltk::Window {
private:
int desktops_num;
int bg_color;
bool wp_use;
bool moving;
int selection_x;
int selection_y;
2007-05-22 20:27:33 +04:00
SelectionOverlay* selbox;
2007-05-22 18:53:17 +04:00
//DesktopSettings* dsett;
2007-05-22 18:53:17 +04:00
GlobalIconSettings gisett;
IconSettings isett;
edelib::vector<DesktopIcon*> icons;
edelib::vector<DesktopIcon*> selectionbuff;
fltk::PopupMenu* pmenu;
void default_gisett(void);
void load_icons(const char* path, edelib::Config& conf);
bool read_desktop_file(const char* path, IconSettings& is, int& icon_type);
void add_icon(DesktopIcon* ic);
void unfocus_all(void);
void select(DesktopIcon* ic);
void select_only(DesktopIcon* ic);
bool in_selection(const DesktopIcon* ic);
void move_selection(int x, int y, bool apply);
public:
Desktop();
~Desktop();
void update_workarea(void);
void read_config(void);
void save_config(void);
void create(void);
virtual void draw(void);
virtual int handle(int event);
};
#endif