mirror of
https://github.com/edeproject/ede.git
synced 2023-08-10 21:13:03 +03:00
Added ede-bell-conf, a tool to configure system bell (that annoying beep thing)
Rest are changes so can nicely be compiled on freebsd Also, some changes are in coding style
This commit is contained in:
@@ -30,79 +30,79 @@ class MovableIcon;
|
||||
class Fl_Menu_Button;
|
||||
|
||||
class DesktopIcon : public Fl_Widget {
|
||||
private:
|
||||
IconSettings* settings;
|
||||
const GlobalIconSettings* globals;
|
||||
private:
|
||||
IconSettings* settings;
|
||||
const GlobalIconSettings* globals;
|
||||
|
||||
int lwidth;
|
||||
int lheight;
|
||||
bool focus;
|
||||
int lwidth;
|
||||
int lheight;
|
||||
bool focus;
|
||||
|
||||
MovableIcon* micon;
|
||||
MovableIcon* micon;
|
||||
|
||||
Fl_Image* darker_img;
|
||||
Fl_Menu_Button* imenu;
|
||||
Fl_Image* darker_img;
|
||||
Fl_Menu_Button* imenu;
|
||||
|
||||
void load_icon(int face);
|
||||
void update_label_size(void);
|
||||
void fix_position(int X, int Y);
|
||||
void load_icon(int face);
|
||||
void update_label_size(void);
|
||||
void fix_position(int X, int Y);
|
||||
|
||||
public:
|
||||
DesktopIcon(GlobalIconSettings* gisett, IconSettings* isett, int bg);
|
||||
~DesktopIcon();
|
||||
public:
|
||||
DesktopIcon(GlobalIconSettings* gisett, IconSettings* isett, int bg);
|
||||
~DesktopIcon();
|
||||
|
||||
virtual void draw(void);
|
||||
virtual int handle(int event);
|
||||
virtual void draw(void);
|
||||
virtual int handle(int event);
|
||||
|
||||
void drag(int x, int y, bool apply);
|
||||
int drag_icon_x(void);
|
||||
int drag_icon_y(void);
|
||||
void drag(int x, int y, bool apply);
|
||||
int drag_icon_x(void);
|
||||
int drag_icon_y(void);
|
||||
|
||||
/*
|
||||
* This is 'enhanced' (in some sense) redraw(). Redrawing
|
||||
* icon will not fully redraw label nor focus box, which laid outside
|
||||
* icon box. It will use damage() on given region, but called from
|
||||
* parent, so parent can redraw that region on itself (since label does
|
||||
* not laid on any box)
|
||||
*
|
||||
* Alternative way would be to redraw whole parent, but it is pretty unneeded
|
||||
* and slow.
|
||||
*/
|
||||
void fast_redraw(void);
|
||||
/*
|
||||
* This is 'enhanced' (in some sense) redraw(). Redrawing
|
||||
* icon will not fully redraw label nor focus box, which laid outside
|
||||
* icon box. It will use damage() on given region, but called from
|
||||
* parent, so parent can redraw that region on itself (since label does
|
||||
* not laid on any box)
|
||||
*
|
||||
* Alternative way would be to redraw whole parent, but it is pretty unneeded
|
||||
* and slow.
|
||||
*/
|
||||
void fast_redraw(void);
|
||||
|
||||
/*
|
||||
* Here is implemented localy focus schema avoiding
|
||||
* messy fltk one. Focus/unfocus is handled from Desktop.
|
||||
*/
|
||||
void do_focus(void) { focus = true; }
|
||||
void do_unfocus(void) { focus = false; }
|
||||
bool is_focused(void) { return focus; }
|
||||
/*
|
||||
* Here is implemented localy focus schema avoiding
|
||||
* messy fltk one. Focus/unfocus is handled from Desktop.
|
||||
*/
|
||||
void do_focus(void) { focus = true; }
|
||||
void do_unfocus(void) { focus = false; }
|
||||
bool is_focused(void) { return focus; }
|
||||
|
||||
Fl_Image* icon_image(void) { return image(); }
|
||||
Fl_Image* icon_image(void) { return image(); }
|
||||
|
||||
void rename(const char* str);
|
||||
void rename(const char* str);
|
||||
|
||||
/*
|
||||
* make sure this returns String since operator== is
|
||||
* further used, especially in Desktop
|
||||
*/
|
||||
const edelib::String& path(void);
|
||||
/*
|
||||
* make sure this returns String since operator== is
|
||||
* further used, especially in Desktop
|
||||
*/
|
||||
const edelib::String& path(void);
|
||||
|
||||
int icon_type(void);
|
||||
void use_icon1(void);
|
||||
void use_icon2(void);
|
||||
int icon_type(void);
|
||||
void use_icon1(void);
|
||||
void use_icon2(void);
|
||||
};
|
||||
|
||||
class MovableIcon : public Fl_Window {
|
||||
private:
|
||||
DesktopIcon* icon;
|
||||
Fl_Box* icon_box;
|
||||
Pixmap mask;
|
||||
private:
|
||||
DesktopIcon* icon;
|
||||
Fl_Box* icon_box;
|
||||
Pixmap mask;
|
||||
|
||||
public:
|
||||
MovableIcon(DesktopIcon* i);
|
||||
~MovableIcon();
|
||||
virtual void show(void);
|
||||
public:
|
||||
MovableIcon(DesktopIcon* i);
|
||||
~MovableIcon();
|
||||
virtual void show(void);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -54,8 +54,6 @@ static void ok_cb(Fl_Widget*, void* w) {
|
||||
}
|
||||
|
||||
static void icon_change_cb(Fl_Button* b, void* d) {
|
||||
DesktopIconData* data = (DesktopIconData*)d;
|
||||
|
||||
edelib::String ret = edelib::icon_chooser(edelib::ICON_SIZE_HUGE);
|
||||
if(ret.empty())
|
||||
return;
|
||||
|
@@ -18,22 +18,22 @@
|
||||
|
||||
/*
|
||||
* Class responsible for displaying images at background
|
||||
* their scaling (TODO), caching(TODO) and making coffee at the spear time.
|
||||
* their scaling (TODO), caching(TODO) and making coffee at the spare time.
|
||||
*/
|
||||
class Wallpaper : public Fl_Box {
|
||||
private:
|
||||
Pixmap rootpmap_pixmap;
|
||||
bool tiled;
|
||||
void set_rootpmap(void);
|
||||
private:
|
||||
Pixmap rootpmap_pixmap;
|
||||
bool tiled;
|
||||
void set_rootpmap(void);
|
||||
|
||||
public:
|
||||
Wallpaper(int X, int Y, int W, int H);
|
||||
~Wallpaper();
|
||||
public:
|
||||
Wallpaper(int X, int Y, int W, int H);
|
||||
~Wallpaper();
|
||||
|
||||
bool set(const char* path);
|
||||
bool set_tiled(const char* path);
|
||||
virtual void draw(void);
|
||||
virtual int handle(int event);
|
||||
bool set(const char* path);
|
||||
bool set_tiled(const char* path);
|
||||
virtual void draw(void);
|
||||
virtual int handle(int event);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -97,79 +97,79 @@ typedef edelib::list<edelib::String>::iterator StringListIter;
|
||||
#endif
|
||||
|
||||
class Desktop : public DESKTOP_WINDOW {
|
||||
private:
|
||||
static Desktop* pinstance;
|
||||
private:
|
||||
static Desktop* pinstance;
|
||||
|
||||
int selection_x, selection_y;
|
||||
bool moving;
|
||||
bool do_dirwatch;
|
||||
int selection_x, selection_y;
|
||||
bool moving;
|
||||
bool do_dirwatch;
|
||||
|
||||
SelectionOverlay* selbox;
|
||||
SelectionOverlay* selbox;
|
||||
|
||||
GlobalIconSettings* gisett;
|
||||
DesktopSettings* dsett;
|
||||
GlobalIconSettings* gisett;
|
||||
DesktopSettings* dsett;
|
||||
|
||||
Fl_Menu_Button* dmenu;
|
||||
Wallpaper* wallpaper;
|
||||
edelib::EdbusConnection* dbus;
|
||||
Fl_Menu_Button* dmenu;
|
||||
Wallpaper* wallpaper;
|
||||
edelib::EdbusConnection* dbus;
|
||||
|
||||
DesktopIconList icons;
|
||||
DesktopIconList selectionbuff;
|
||||
DesktopIconList icons;
|
||||
DesktopIconList selectionbuff;
|
||||
|
||||
edelib::String trash_path;
|
||||
edelib::String trash_path;
|
||||
|
||||
void init_internals(void);
|
||||
void init_internals(void);
|
||||
|
||||
void load_icons(const char* path);
|
||||
void save_icons_positions(void);
|
||||
bool read_desktop_file(const char* path, IconSettings& is);
|
||||
void load_icons(const char* path);
|
||||
void save_icons_positions(void);
|
||||
bool read_desktop_file(const char* path, IconSettings& is);
|
||||
|
||||
void add_icon(DesktopIcon* ic);
|
||||
bool add_icon_by_path(const char* path, edelib::Resource* conf);
|
||||
DesktopIcon* find_icon_by_path(const char* path);
|
||||
bool remove_icon_by_path(const char* path);
|
||||
bool update_icon_by_path(const char* path);
|
||||
void add_icon(DesktopIcon* ic);
|
||||
bool add_icon_by_path(const char* path, edelib::Resource* conf);
|
||||
DesktopIcon* find_icon_by_path(const char* path);
|
||||
bool remove_icon_by_path(const char* path);
|
||||
bool update_icon_by_path(const char* path);
|
||||
|
||||
void unfocus_all(void);
|
||||
void unfocus_all(void);
|
||||
|
||||
void select(DesktopIcon* ic, bool do_redraw = true);
|
||||
void select_only(DesktopIcon* ic);
|
||||
bool in_selection(const DesktopIcon* ic);
|
||||
void move_selection(int x, int y, bool apply);
|
||||
void select(DesktopIcon* ic, bool do_redraw = true);
|
||||
void select_only(DesktopIcon* ic);
|
||||
bool in_selection(const DesktopIcon* ic);
|
||||
void move_selection(int x, int y, bool apply);
|
||||
|
||||
void select_in_area(void);
|
||||
void select_in_area(void);
|
||||
|
||||
void dnd_drop_source(const char* src, int src_len, int x, int y);
|
||||
void dnd_drop_source(const char* src, int src_len, int x, int y);
|
||||
|
||||
DesktopIcon* below_mouse(int px, int py);
|
||||
DesktopIcon* below_mouse(int px, int py);
|
||||
|
||||
public:
|
||||
Desktop();
|
||||
~Desktop();
|
||||
public:
|
||||
Desktop();
|
||||
~Desktop();
|
||||
|
||||
virtual void show(void);
|
||||
virtual void hide(void);
|
||||
virtual void draw(void);
|
||||
virtual int handle(int event);
|
||||
virtual void show(void);
|
||||
virtual void hide(void);
|
||||
virtual void draw(void);
|
||||
virtual int handle(int event);
|
||||
|
||||
static void init(void);
|
||||
static void shutdown(void);
|
||||
static Desktop* instance(void);
|
||||
static void init(void);
|
||||
static void shutdown(void);
|
||||
static Desktop* instance(void);
|
||||
|
||||
void read_config(void);
|
||||
void read_config(void);
|
||||
|
||||
void update_workarea(void);
|
||||
void area(int& X, int& Y, int& W, int& H) { X = x(); Y = y(); W = w(); H = h(); }
|
||||
void update_workarea(void);
|
||||
void area(int& X, int& Y, int& W, int& H) { X = x(); Y = y(); W = w(); H = h(); }
|
||||
|
||||
void set_bg_color(int c, bool do_redraw = true);
|
||||
void set_bg_color(int c, bool do_redraw = true);
|
||||
|
||||
void notify_desktop_changed(void);
|
||||
void notify_desktop_changed(void);
|
||||
|
||||
void dir_watch(const char* dir, const char* changed, int flags);
|
||||
void dir_watch_on(void) { do_dirwatch = true; }
|
||||
void dir_watch_off(void) { do_dirwatch = false; }
|
||||
void dir_watch(const char* dir, const char* changed, int flags);
|
||||
void dir_watch_on(void) { do_dirwatch = true; }
|
||||
void dir_watch_off(void) { do_dirwatch = false; }
|
||||
|
||||
void execute(const char* cmd);
|
||||
void execute(const char* cmd);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user