'inline' in class declaration is implicitly inline
This commit is contained in:
parent
e90c3678d9
commit
e1f362ae76
44 changed files with 583 additions and 584 deletions
|
@ -41,10 +41,10 @@ public:
|
||||||
bool fallback(FbTk::ThemeItem_base &item);
|
bool fallback(FbTk::ThemeItem_base &item);
|
||||||
void reconfigTheme();
|
void reconfigTheme();
|
||||||
|
|
||||||
inline const FbTk::Texture &pressed() const { return *m_pressed_texture; }
|
const FbTk::Texture &pressed() const { return *m_pressed_texture; }
|
||||||
inline GC gc() const { return m_gc.gc(); }
|
GC gc() const { return m_gc.gc(); }
|
||||||
inline int scale() const { return *m_scale; } // scale factor for inside objects
|
int scale() const { return *m_scale; } // scale factor for inside objects
|
||||||
inline const std::string &name() { return m_name; }
|
const std::string &name() { return m_name; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
FbTk::ThemeItem<FbTk::Color> m_pic_color;
|
FbTk::ThemeItem<FbTk::Color> m_pic_color;
|
||||||
|
|
|
@ -42,7 +42,7 @@ class ClientPattern:private FbTk::NotCopyable {
|
||||||
public:
|
public:
|
||||||
ClientPattern();
|
ClientPattern();
|
||||||
/**
|
/**
|
||||||
* Create the pattern from the given string as it would appear in the
|
* Create the pattern from the given string as it would appear in the
|
||||||
* apps file. the bool value returns the character at which
|
* apps file. the bool value returns the character at which
|
||||||
* there was a parse problem, or -1.
|
* there was a parse problem, or -1.
|
||||||
*/
|
*/
|
||||||
|
@ -76,7 +76,7 @@ public:
|
||||||
*/
|
*/
|
||||||
bool addTerm(const std::string &str, WinProperty prop, bool negate = false);
|
bool addTerm(const std::string &str, WinProperty prop, bool negate = false);
|
||||||
|
|
||||||
inline void addMatch() { ++m_nummatches; }
|
void addMatch() { ++m_nummatches; }
|
||||||
|
|
||||||
// whether this pattern has identical matching criteria
|
// whether this pattern has identical matching criteria
|
||||||
bool operator ==(const ClientPattern &pat) const;
|
bool operator ==(const ClientPattern &pat) const;
|
||||||
|
@ -85,7 +85,7 @@ public:
|
||||||
* If there are no terms, then there is assumed to be an error
|
* If there are no terms, then there is assumed to be an error
|
||||||
* the column of the error is stored in m_matchlimit
|
* the column of the error is stored in m_matchlimit
|
||||||
*/
|
*/
|
||||||
inline int error() const { return m_terms.empty() ? 1 : 0; }
|
int error() const { return m_terms.empty() ? 1 : 0; }
|
||||||
|
|
||||||
static std::string getProperty(WinProperty prop, const Focusable &client);
|
static std::string getProperty(WinProperty prop, const Focusable &client);
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ private:
|
||||||
* We have a "term" in the whole expression which is the full pattern
|
* We have a "term" in the whole expression which is the full pattern
|
||||||
* we also need to keep track of the uncompiled regular expression
|
* we also need to keep track of the uncompiled regular expression
|
||||||
* for final output
|
* for final output
|
||||||
*/
|
*/
|
||||||
struct Term {
|
struct Term {
|
||||||
Term(const std::string ®str, bool full_match) :regexp(regstr, full_match){};
|
Term(const std::string ®str, bool full_match) :regexp(regstr, full_match){};
|
||||||
std::string orig;
|
std::string orig;
|
||||||
|
|
|
@ -62,7 +62,7 @@ public:
|
||||||
unsigned int width() const;
|
unsigned int width() const;
|
||||||
unsigned int height() const;
|
unsigned int height() const;
|
||||||
unsigned int borderWidth() const;
|
unsigned int borderWidth() const;
|
||||||
inline const std::string &timeFormat() const { return *m_timeformat; }
|
const std::string &timeFormat() const { return *m_timeformat; }
|
||||||
|
|
||||||
void setOrientation(FbTk::Orientation orient);
|
void setOrientation(FbTk::Orientation orient);
|
||||||
|
|
||||||
|
|
|
@ -34,17 +34,17 @@ public:
|
||||||
|
|
||||||
static FbAtoms *instance();
|
static FbAtoms *instance();
|
||||||
|
|
||||||
inline Atom getWMChangeStateAtom() const { return xa_wm_change_state; }
|
Atom getWMChangeStateAtom() const { return xa_wm_change_state; }
|
||||||
inline Atom getWMStateAtom() const { return xa_wm_state; }
|
Atom getWMStateAtom() const { return xa_wm_state; }
|
||||||
inline Atom getWMDeleteAtom() const { return xa_wm_delete_window; }
|
Atom getWMDeleteAtom() const { return xa_wm_delete_window; }
|
||||||
inline Atom getWMProtocolsAtom() const { return xa_wm_protocols; }
|
Atom getWMProtocolsAtom() const { return xa_wm_protocols; }
|
||||||
inline Atom getWMTakeFocusAtom() const { return xa_wm_take_focus; }
|
Atom getWMTakeFocusAtom() const { return xa_wm_take_focus; }
|
||||||
|
|
||||||
inline Atom getMWMHintsAtom() const { return motif_wm_hints; }
|
Atom getMWMHintsAtom() const { return motif_wm_hints; }
|
||||||
|
|
||||||
// these atoms are for normal app->WM interaction beyond the scope of the
|
// these atoms are for normal app->WM interaction beyond the scope of the
|
||||||
// ICCCM...
|
// ICCCM...
|
||||||
inline Atom getFluxboxAttributesAtom() const { return blackbox_attributes; }
|
Atom getFluxboxAttributesAtom() const { return blackbox_attributes; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void initAtoms();
|
void initAtoms();
|
||||||
|
@ -54,7 +54,7 @@ private:
|
||||||
|
|
||||||
Atom xa_wm_protocols, xa_wm_state,
|
Atom xa_wm_protocols, xa_wm_state,
|
||||||
xa_wm_delete_window, xa_wm_take_focus, xa_wm_change_state;
|
xa_wm_delete_window, xa_wm_take_focus, xa_wm_change_state;
|
||||||
|
|
||||||
bool m_init;
|
bool m_init;
|
||||||
static FbAtoms *s_singleton;
|
static FbAtoms *s_singleton;
|
||||||
};
|
};
|
||||||
|
|
|
@ -38,8 +38,8 @@ public:
|
||||||
// we should not assign a new window to this
|
// we should not assign a new window to this
|
||||||
FbTk::FbWindow &operator = (Window win) { return *this; }
|
FbTk::FbWindow &operator = (Window win) { return *this; }
|
||||||
void updateGeometry();
|
void updateGeometry();
|
||||||
inline Visual *visual() const { return m_visual; }
|
Visual *visual() const { return m_visual; }
|
||||||
inline Colormap colormap() const { return m_colormap; }
|
Colormap colormap() const { return m_colormap; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Visual *m_visual;
|
Visual *m_visual;
|
||||||
|
|
|
@ -37,8 +37,8 @@ template <typename T>
|
||||||
class SimpleAccessor: public Accessor<T> {
|
class SimpleAccessor: public Accessor<T> {
|
||||||
public:
|
public:
|
||||||
SimpleAccessor(T &val): m_val(val) { }
|
SimpleAccessor(T &val): m_val(val) { }
|
||||||
inline Accessor<T> &operator =(const T &val) { m_val = val; return *this; }
|
Accessor<T> &operator =(const T &val) { m_val = val; return *this; }
|
||||||
inline operator T() const { return m_val; }
|
operator T() const { return m_val; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
T &m_val;
|
T &m_val;
|
||||||
|
@ -53,8 +53,8 @@ public:
|
||||||
ObjectAccessor(Receiver &r, Getter g, Setter s):
|
ObjectAccessor(Receiver &r, Getter g, Setter s):
|
||||||
m_receiver(r), m_getter(g), m_setter(s) { }
|
m_receiver(r), m_getter(g), m_setter(s) { }
|
||||||
|
|
||||||
inline operator T() const { return (m_receiver.*m_getter)(); }
|
operator T() const { return (m_receiver.*m_getter)(); }
|
||||||
inline Accessor<T> &operator =(const T &val) {
|
Accessor<T> &operator =(const T &val) {
|
||||||
(m_receiver.*m_setter)(val); return *this;
|
(m_receiver.*m_setter)(val); return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,8 +72,8 @@ public:
|
||||||
ConstObjectAccessor(const Receiver &r, Getter g):
|
ConstObjectAccessor(const Receiver &r, Getter g):
|
||||||
m_receiver(r), m_getter(g) { }
|
m_receiver(r), m_getter(g) { }
|
||||||
|
|
||||||
inline operator T() const { return (m_receiver.*m_getter)(); }
|
operator T() const { return (m_receiver.*m_getter)(); }
|
||||||
inline Accessor<T> &operator =(const T &val) { return *this; }
|
Accessor<T> &operator =(const T &val) { return *this; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const Receiver &m_receiver;
|
const Receiver &m_receiver;
|
||||||
|
|
|
@ -46,7 +46,7 @@ public:
|
||||||
explicit App(const char *displayname=0);
|
explicit App(const char *displayname=0);
|
||||||
virtual ~App();
|
virtual ~App();
|
||||||
/// display connection
|
/// display connection
|
||||||
inline Display *display() const { return m_display; }
|
Display *display() const { return m_display; }
|
||||||
void sync(bool discard);
|
void sync(bool discard);
|
||||||
/// starts event loop
|
/// starts event loop
|
||||||
virtual void eventLoop();
|
virtual void eventLoop();
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// Color.hh for Fluxbox Window Manager
|
// Color.hh for Fluxbox Window Manager
|
||||||
// Copyright (c) 2002 - 2006 Henrik Kinnunen (fluxgen at fluxbox dot org)
|
// Copyright (c) 2002 - 2006 Henrik Kinnunen (fluxgen at fluxbox dot org)
|
||||||
//
|
//
|
||||||
// from Image.hh for Blackbox - an X11 Window manager
|
// from Image.hh for Blackbox - an X11 Window manager
|
||||||
|
@ -48,12 +48,12 @@ public:
|
||||||
void setPixel(unsigned long pixel) { m_pixel = pixel; }
|
void setPixel(unsigned long pixel) { m_pixel = pixel; }
|
||||||
|
|
||||||
Color &operator = (const Color &col_copy);
|
Color &operator = (const Color &col_copy);
|
||||||
|
|
||||||
inline bool isAllocated() const { return m_allocated; }
|
bool isAllocated() const { return m_allocated; }
|
||||||
inline unsigned short red() const { return m_red; }
|
unsigned short red() const { return m_red; }
|
||||||
inline unsigned short green() const { return m_green; }
|
unsigned short green() const { return m_green; }
|
||||||
inline unsigned short blue() const { return m_blue; }
|
unsigned short blue() const { return m_blue; }
|
||||||
inline unsigned long pixel() const { return m_pixel; }
|
unsigned long pixel() const { return m_pixel; }
|
||||||
|
|
||||||
/// @return true if the color name in color_string is resolved, else false
|
/// @return true if the color name in color_string is resolved, else false
|
||||||
static bool validColorString(const char *color_string, int screen);
|
static bool validColorString(const char *color_string, int screen);
|
||||||
|
@ -61,9 +61,9 @@ public:
|
||||||
private:
|
private:
|
||||||
void free();
|
void free();
|
||||||
void copy(const Color &col);
|
void copy(const Color &col);
|
||||||
void allocate(unsigned short red, unsigned short green,
|
void allocate(unsigned short red, unsigned short green,
|
||||||
unsigned short blue, int screen);
|
unsigned short blue, int screen);
|
||||||
inline void setAllocated(bool a) { m_allocated = a; }
|
void setAllocated(bool a) { m_allocated = a; }
|
||||||
void setRGB(unsigned short red, unsigned short green, unsigned short blue);
|
void setRGB(unsigned short red, unsigned short green, unsigned short blue);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -71,9 +71,9 @@ public:
|
||||||
Item back() { return m_item_list.back(); }
|
Item back() { return m_item_list.back(); }
|
||||||
|
|
||||||
/// force update
|
/// force update
|
||||||
inline void update() { repositionItems(); }
|
void update() { repositionItems(); }
|
||||||
/// so we can add items without having an graphic update for each item
|
/// so we can add items without having an graphic update for each item
|
||||||
inline void setUpdateLock(bool value) { m_update_lock = value; }
|
void setUpdateLock(bool value) { m_update_lock = value; }
|
||||||
|
|
||||||
/// event handler
|
/// event handler
|
||||||
void exposeEvent(XExposeEvent &event);
|
void exposeEvent(XExposeEvent &event);
|
||||||
|
@ -86,12 +86,12 @@ public:
|
||||||
void invalidateBackground();
|
void invalidateBackground();
|
||||||
|
|
||||||
/// accessors
|
/// accessors
|
||||||
inline Alignment alignment() const { return m_align; }
|
Alignment alignment() const { return m_align; }
|
||||||
inline Orientation orientation() const { return m_orientation; }
|
Orientation orientation() const { return m_orientation; }
|
||||||
inline int size() const { return m_item_list.size(); }
|
int size() const { return m_item_list.size(); }
|
||||||
inline bool empty() const { return m_item_list.empty(); }
|
bool empty() const { return m_item_list.empty(); }
|
||||||
unsigned int maxWidthPerClient() const;
|
unsigned int maxWidthPerClient() const;
|
||||||
inline bool updateLock() const { return m_update_lock; }
|
bool updateLock() const { return m_update_lock; }
|
||||||
|
|
||||||
void for_each(std::mem_fun_t<void, FbWindow> function);
|
void for_each(std::mem_fun_t<void, FbWindow> function);
|
||||||
void setAlpha(unsigned char alpha); // set alpha on all windows
|
void setAlpha(unsigned char alpha); // set alpha on all windows
|
||||||
|
|
|
@ -36,14 +36,14 @@ public:
|
||||||
DefaultValue(const Def def):
|
DefaultValue(const Def def):
|
||||||
m_default(def), m_actual(def), m_use_default(true) { }
|
m_default(def), m_actual(def), m_use_default(true) { }
|
||||||
|
|
||||||
inline void restoreDefault() { m_use_default = true; }
|
void restoreDefault() { m_use_default = true; }
|
||||||
inline bool isDefault() const { return m_use_default; }
|
bool isDefault() const { return m_use_default; }
|
||||||
|
|
||||||
inline DefaultValue<Ret, Def> &operator =(const Ret &val) {
|
DefaultValue<Ret, Def> &operator =(const Ret &val) {
|
||||||
m_use_default = false; m_actual = val; return *this;
|
m_use_default = false; m_actual = val; return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline operator Ret() const { return m_use_default ? m_default : m_actual; }
|
operator Ret() const { return m_use_default ? m_default : m_actual; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const Def m_default;
|
const Def m_default;
|
||||||
|
|
|
@ -64,10 +64,10 @@ public:
|
||||||
/// sets new pixmap
|
/// sets new pixmap
|
||||||
FbPixmap &operator = (Pixmap pm);
|
FbPixmap &operator = (Pixmap pm);
|
||||||
|
|
||||||
inline Drawable drawable() const { return m_pm; }
|
Drawable drawable() const { return m_pm; }
|
||||||
inline unsigned int width() const { return m_width; }
|
unsigned int width() const { return m_width; }
|
||||||
inline unsigned int height() const { return m_height; }
|
unsigned int height() const { return m_height; }
|
||||||
inline unsigned int depth() const { return m_depth; }
|
unsigned int depth() const { return m_depth; }
|
||||||
|
|
||||||
static Pixmap getRootPixmap(int screen_num, bool force_update=false);
|
static Pixmap getRootPixmap(int screen_num, bool force_update=false);
|
||||||
static bool setRootPixmap(int screen_num, Pixmap pm);
|
static bool setRootPixmap(int screen_num, Pixmap pm);
|
||||||
|
|
|
@ -55,19 +55,19 @@ public:
|
||||||
FbWindow(const FbWindow &win_copy);
|
FbWindow(const FbWindow &win_copy);
|
||||||
|
|
||||||
FbWindow(int screen_num,
|
FbWindow(int screen_num,
|
||||||
int x, int y, unsigned int width, unsigned int height, long eventmask,
|
int x, int y, unsigned int width, unsigned int height, long eventmask,
|
||||||
bool overrride_redirect = false,
|
bool overrride_redirect = false,
|
||||||
bool save_unders = false,
|
bool save_unders = false,
|
||||||
unsigned int depth = CopyFromParent,
|
unsigned int depth = CopyFromParent,
|
||||||
int class_type = InputOutput);
|
int class_type = InputOutput);
|
||||||
|
|
||||||
FbWindow(const FbWindow &parent,
|
FbWindow(const FbWindow &parent,
|
||||||
int x, int y,
|
int x, int y,
|
||||||
unsigned int width, unsigned int height,
|
unsigned int width, unsigned int height,
|
||||||
long eventmask,
|
long eventmask,
|
||||||
bool overrride_redirect = false,
|
bool overrride_redirect = false,
|
||||||
bool save_unders = false,
|
bool save_unders = false,
|
||||||
unsigned int depth = CopyFromParent,
|
unsigned int depth = CopyFromParent,
|
||||||
int class_type = InputOutput);
|
int class_type = InputOutput);
|
||||||
|
|
||||||
virtual ~FbWindow();
|
virtual ~FbWindow();
|
||||||
|
@ -83,10 +83,10 @@ public:
|
||||||
/// clear window with background pixmap or color
|
/// clear window with background pixmap or color
|
||||||
virtual void clear();
|
virtual void clear();
|
||||||
/// @param exposures wheter Expose event should be generated
|
/// @param exposures wheter Expose event should be generated
|
||||||
virtual void clearArea(int x, int y,
|
virtual void clearArea(int x, int y,
|
||||||
unsigned int width, unsigned int height,
|
unsigned int width, unsigned int height,
|
||||||
bool exposures = false);
|
bool exposures = false);
|
||||||
void updateTransparent(int x = -1, int y = -1, unsigned int width = 0,
|
void updateTransparent(int x = -1, int y = -1, unsigned int width = 0,
|
||||||
unsigned int height = 0, Pixmap dest_override = None,
|
unsigned int height = 0, Pixmap dest_override = None,
|
||||||
bool override_is_offset = false);
|
bool override_is_offset = false);
|
||||||
|
|
||||||
|
@ -94,18 +94,18 @@ public:
|
||||||
|
|
||||||
virtual FbWindow &operator = (const FbWindow &win);
|
virtual FbWindow &operator = (const FbWindow &win);
|
||||||
/// assign a new X window to this
|
/// assign a new X window to this
|
||||||
virtual FbWindow &operator = (Window win);
|
virtual FbWindow &operator = (Window win);
|
||||||
virtual void hide();
|
virtual void hide();
|
||||||
virtual void show();
|
virtual void show();
|
||||||
virtual void showSubwindows();
|
virtual void showSubwindows();
|
||||||
|
|
||||||
/// Notify that the parent window was moved,
|
/// Notify that the parent window was moved,
|
||||||
/// thus the absolute position of this one moved
|
/// thus the absolute position of this one moved
|
||||||
virtual inline void parentMoved() {
|
virtual void parentMoved() {
|
||||||
updateBackground(true);
|
updateBackground(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual inline void move(int x, int y) {
|
virtual void move(int x, int y) {
|
||||||
if (x == m_x && y == m_y)
|
if (x == m_x && y == m_y)
|
||||||
return;
|
return;
|
||||||
XMoveWindow(s_display, m_window, x, y);
|
XMoveWindow(s_display, m_window, x, y);
|
||||||
|
@ -114,7 +114,7 @@ public:
|
||||||
updateBackground(true);
|
updateBackground(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual inline void resize(unsigned int width, unsigned int height) {
|
virtual void resize(unsigned int width, unsigned int height) {
|
||||||
if (width == m_width && height == m_height)
|
if (width == m_width && height == m_height)
|
||||||
return;
|
return;
|
||||||
XResizeWindow(s_display, m_window, width, height);
|
XResizeWindow(s_display, m_window, width, height);
|
||||||
|
@ -123,7 +123,7 @@ public:
|
||||||
updateBackground(false);
|
updateBackground(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual inline void moveResize(int x, int y, unsigned int width, unsigned int height) {
|
virtual void moveResize(int x, int y, unsigned int width, unsigned int height) {
|
||||||
if (x == m_x && y == m_y && width == m_width && height == m_height)
|
if (x == m_x && y == m_y && width == m_width && height == m_height)
|
||||||
return;
|
return;
|
||||||
XMoveResizeWindow(s_display, m_window, x, y, width, height);
|
XMoveResizeWindow(s_display, m_window, x, y, width, height);
|
||||||
|
@ -171,26 +171,26 @@ public:
|
||||||
/// @return parent FbWindow
|
/// @return parent FbWindow
|
||||||
const FbWindow *parent() const { return m_parent; }
|
const FbWindow *parent() const { return m_parent; }
|
||||||
/// @return real X window
|
/// @return real X window
|
||||||
inline Window window() const { return m_window; }
|
Window window() const { return m_window; }
|
||||||
/// @return drawable (the X window)
|
/// @return drawable (the X window)
|
||||||
inline Drawable drawable() const { return window(); }
|
Drawable drawable() const { return window(); }
|
||||||
inline int x() const { return m_x; }
|
int x() const { return m_x; }
|
||||||
inline int y() const { return m_y; }
|
int y() const { return m_y; }
|
||||||
inline unsigned int width() const { return m_width; }
|
unsigned int width() const { return m_width; }
|
||||||
inline unsigned int height() const { return m_height; }
|
unsigned int height() const { return m_height; }
|
||||||
inline unsigned int borderWidth() const { return m_border_width; }
|
unsigned int borderWidth() const { return m_border_width; }
|
||||||
inline unsigned int depth() const { return m_depth; }
|
unsigned int depth() const { return m_depth; }
|
||||||
unsigned char alpha() const;
|
unsigned char alpha() const;
|
||||||
int screenNumber() const;
|
int screenNumber() const;
|
||||||
long eventMask() const;
|
long eventMask() const;
|
||||||
Display *display() const { return s_display; }
|
Display *display() const { return s_display; }
|
||||||
|
|
||||||
/// compare X window
|
/// compare X window
|
||||||
inline bool operator == (Window win) const { return m_window == win; }
|
bool operator == (Window win) const { return m_window == win; }
|
||||||
inline bool operator != (Window win) const { return m_window != win; }
|
bool operator != (Window win) const { return m_window != win; }
|
||||||
/// compare two windows
|
/// compare two windows
|
||||||
inline bool operator == (const FbWindow &win) const { return m_window == win.m_window; }
|
bool operator == (const FbWindow &win) const { return m_window == win.m_window; }
|
||||||
inline bool operator != (const FbWindow &win) const { return m_window != win.m_window; }
|
bool operator != (const FbWindow &win) const { return m_window != win.m_window; }
|
||||||
|
|
||||||
// used for composite
|
// used for composite
|
||||||
void setOpaque(unsigned char alpha);
|
void setOpaque(unsigned char alpha);
|
||||||
|
@ -215,10 +215,10 @@ private:
|
||||||
void setNew(Window win);
|
void setNew(Window win);
|
||||||
/// creates a new X window
|
/// creates a new X window
|
||||||
void create(Window parent, int x, int y, unsigned int width, unsigned int height,
|
void create(Window parent, int x, int y, unsigned int width, unsigned int height,
|
||||||
long eventmask,
|
long eventmask,
|
||||||
bool override_redirect,
|
bool override_redirect,
|
||||||
bool save_unders,
|
bool save_unders,
|
||||||
unsigned int depth,
|
unsigned int depth,
|
||||||
int class_type);
|
int class_type);
|
||||||
|
|
||||||
const FbWindow *m_parent; ///< parent FbWindow
|
const FbWindow *m_parent; ///< parent FbWindow
|
||||||
|
@ -250,11 +250,11 @@ class ChangeProperty {
|
||||||
public:
|
public:
|
||||||
ChangeProperty(Display *disp, Atom prop, int mode,
|
ChangeProperty(Display *disp, Atom prop, int mode,
|
||||||
unsigned char *state, int num):m_disp(disp),
|
unsigned char *state, int num):m_disp(disp),
|
||||||
m_prop(prop),
|
m_prop(prop),
|
||||||
m_state(state),
|
m_state(state),
|
||||||
m_num(num),
|
m_num(num),
|
||||||
m_mode(mode){
|
m_mode(mode){
|
||||||
|
|
||||||
}
|
}
|
||||||
void operator () (FbTk::FbWindow *win) {
|
void operator () (FbTk::FbWindow *win) {
|
||||||
XChangeProperty(m_disp, win->window(), m_prop, m_prop, 32, m_mode,
|
XChangeProperty(m_disp, win->window(), m_prop, m_prop, 32, m_mode,
|
||||||
|
|
|
@ -53,7 +53,7 @@ public:
|
||||||
CAPROUND= CapRound,
|
CAPROUND= CapRound,
|
||||||
CAPPROJECTING= CapProjecting
|
CAPPROJECTING= CapProjecting
|
||||||
} CapStyle;
|
} CapStyle;
|
||||||
|
|
||||||
/// for FbTk drawable
|
/// for FbTk drawable
|
||||||
explicit GContext(const FbTk::FbDrawable &drawable);
|
explicit GContext(const FbTk::FbDrawable &drawable);
|
||||||
/// for X drawable
|
/// for X drawable
|
||||||
|
@ -61,81 +61,81 @@ public:
|
||||||
GContext(Drawable d, const FbTk::GContext &gc);
|
GContext(Drawable d, const FbTk::GContext &gc);
|
||||||
virtual ~GContext();
|
virtual ~GContext();
|
||||||
|
|
||||||
inline void setForeground(const FbTk::Color &color) {
|
void setForeground(const FbTk::Color &color) {
|
||||||
setForeground(color.pixel());
|
setForeground(color.pixel());
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void setForeground(long pixel_value) {
|
void setForeground(long pixel_value) {
|
||||||
XSetForeground(m_display, m_gc,
|
XSetForeground(m_display, m_gc,
|
||||||
pixel_value);
|
pixel_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void setBackground(const FbTk::Color &color) {
|
void setBackground(const FbTk::Color &color) {
|
||||||
setBackground(color.pixel());
|
setBackground(color.pixel());
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void setBackground(long pixel_value) {
|
void setBackground(long pixel_value) {
|
||||||
XSetBackground(m_display, m_gc, pixel_value);
|
XSetBackground(m_display, m_gc, pixel_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void setTile(Drawable draw) {
|
void setTile(Drawable draw) {
|
||||||
XSetTile(m_display, m_gc, draw);
|
XSetTile(m_display, m_gc, draw);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void setTile(const FbTk::FbPixmap &draw) {
|
void setTile(const FbTk::FbPixmap &draw) {
|
||||||
setTile(draw.drawable());
|
setTile(draw.drawable());
|
||||||
}
|
}
|
||||||
|
|
||||||
/// not implemented
|
/// not implemented
|
||||||
inline void setFont(const FbTk::Font &) {}
|
void setFont(const FbTk::Font &) {}
|
||||||
|
|
||||||
/// set font id
|
/// set font id
|
||||||
inline void setFont(int fid) {
|
void setFont(int fid) {
|
||||||
XSetFont(m_display, m_gc, fid);
|
XSetFont(m_display, m_gc, fid);
|
||||||
}
|
}
|
||||||
#ifdef NOT_USED
|
#ifdef NOT_USED
|
||||||
inline void setClipMask(const FbTk::FbPixmap &mask) {
|
void setClipMask(const FbTk::FbPixmap &mask) {
|
||||||
XSetClipMask(m_display, m_gc, mask.drawable());
|
XSetClipMask(m_display, m_gc, mask.drawable());
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void setClipOrigin(int x, int y) {
|
void setClipOrigin(int x, int y) {
|
||||||
XSetClipOrigin(m_display, m_gc, x, y);
|
XSetClipOrigin(m_display, m_gc, x, y);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
inline void setGraphicsExposure(bool value) {
|
void setGraphicsExposure(bool value) {
|
||||||
XSetGraphicsExposures(m_display, m_gc, value);
|
XSetGraphicsExposures(m_display, m_gc, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void setFunction(int func) {
|
void setFunction(int func) {
|
||||||
XSetFunction(m_display, m_gc, func);
|
XSetFunction(m_display, m_gc, func);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void setSubwindowMode(int mode) {
|
void setSubwindowMode(int mode) {
|
||||||
XSetSubwindowMode(m_display, m_gc, mode);
|
XSetSubwindowMode(m_display, m_gc, mode);
|
||||||
}
|
}
|
||||||
inline void setFillStyle(int style) {
|
void setFillStyle(int style) {
|
||||||
XSetFillStyle(m_display, m_gc, style);
|
XSetFillStyle(m_display, m_gc, style);
|
||||||
}
|
}
|
||||||
#ifdef NOT_USED
|
#ifdef NOT_USED
|
||||||
inline void setFillRule(int rule) {
|
void setFillRule(int rule) {
|
||||||
XSetFillRule(m_display, m_gc, rule);
|
XSetFillRule(m_display, m_gc, rule);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
inline void setLineAttributes(unsigned int width,
|
void setLineAttributes(unsigned int width,
|
||||||
int line_style,
|
int line_style,
|
||||||
int cap_style,
|
int cap_style,
|
||||||
int join_style) {
|
int join_style) {
|
||||||
|
|
||||||
XSetLineAttributes(m_display, m_gc, width, line_style, cap_style, join_style);
|
XSetLineAttributes(m_display, m_gc, width, line_style, cap_style, join_style);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void copy(GC gc);
|
void copy(GC gc);
|
||||||
void copy(const GContext &gc);
|
void copy(const GContext &gc);
|
||||||
|
|
||||||
inline GContext &operator = (const GContext ©_gc) { copy(copy_gc); return *this; }
|
GContext &operator = (const GContext ©_gc) { copy(copy_gc); return *this; }
|
||||||
inline GContext &operator = (GC copy_gc) { copy(copy_gc); return *this; }
|
GContext &operator = (GC copy_gc) { copy(copy_gc); return *this; }
|
||||||
inline GC gc() const { return m_gc; }
|
GC gc() const { return m_gc; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
GContext(const GContext &cont);
|
GContext(const GContext &cont);
|
||||||
|
|
|
@ -24,8 +24,8 @@
|
||||||
|
|
||||||
// $Id$
|
// $Id$
|
||||||
|
|
||||||
#ifndef I18N_HH
|
#ifndef I18N_HH
|
||||||
#define I18N_HH
|
#define I18N_HH
|
||||||
|
|
||||||
// TODO: FIXME
|
// TODO: FIXME
|
||||||
#include "../../nls/fluxbox-nls.hh"
|
#include "../../nls/fluxbox-nls.hh"
|
||||||
|
@ -105,9 +105,9 @@ namespace FbTk {
|
||||||
class I18n {
|
class I18n {
|
||||||
public:
|
public:
|
||||||
static I18n *instance();
|
static I18n *instance();
|
||||||
inline const char *getLocale() const { return m_locale.c_str(); }
|
const char *getLocale() const { return m_locale.c_str(); }
|
||||||
inline bool multibyte() const { return m_multibyte; }
|
bool multibyte() const { return m_multibyte; }
|
||||||
inline const nl_catd &getCatalogFd() const { return m_catalog_fd; }
|
const nl_catd &getCatalogFd() const { return m_catalog_fd; }
|
||||||
|
|
||||||
FbString getMessage(int set_number, int message_number,
|
FbString getMessage(int set_number, int message_number,
|
||||||
const char *default_messsage = 0, bool translate_fb = false) const;
|
const char *default_messsage = 0, bool translate_fb = false) const;
|
||||||
|
|
|
@ -24,8 +24,8 @@
|
||||||
|
|
||||||
// $Id$
|
// $Id$
|
||||||
|
|
||||||
#ifndef FBTK_IMAGECONTROL_HH
|
#ifndef FBTK_IMAGECONTROL_HH
|
||||||
#define FBTK_IMAGECONTROL_HH
|
#define FBTK_IMAGECONTROL_HH
|
||||||
|
|
||||||
// actually, Text is rather tool like, that's where orientation comes from
|
// actually, Text is rather tool like, that's where orientation comes from
|
||||||
#include "Text.hh"
|
#include "Text.hh"
|
||||||
|
@ -47,14 +47,14 @@ public:
|
||||||
unsigned long cache_timeout = 300000l, unsigned long cache_max = 200l);
|
unsigned long cache_timeout = 300000l, unsigned long cache_max = 200l);
|
||||||
virtual ~ImageControl();
|
virtual ~ImageControl();
|
||||||
|
|
||||||
inline bool doDither() const { return m_dither; }
|
bool doDither() const { return m_dither; }
|
||||||
#ifdef NOT_USED
|
#ifdef NOT_USED
|
||||||
inline int bitsPerPixel() const { return bits_per_pixel; }
|
int bitsPerPixel() const { return bits_per_pixel; }
|
||||||
#endif
|
#endif
|
||||||
inline int depth() const { return m_screen_depth; }
|
int depth() const { return m_screen_depth; }
|
||||||
inline int colorsPerChannel() const { return m_colors_per_channel; }
|
int colorsPerChannel() const { return m_colors_per_channel; }
|
||||||
inline int screenNumber() const { return m_screen_num; }
|
int screenNumber() const { return m_screen_num; }
|
||||||
inline Visual *visual() const { return m_visual; }
|
Visual *visual() const { return m_visual; }
|
||||||
unsigned long getSqrt(unsigned int val) const;
|
unsigned long getSqrt(unsigned int val) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -35,7 +35,7 @@ public:
|
||||||
IntMenuItem(const FbTk::FbString &label, Accessor<int> &res,
|
IntMenuItem(const FbTk::FbString &label, Accessor<int> &res,
|
||||||
int min_val, int max_val, FbTk::Menu &host_menu) :
|
int min_val, int max_val, FbTk::Menu &host_menu) :
|
||||||
FbTk::MenuItem(label, host_menu), m_org_label(FbTk::MenuItem::label()),
|
FbTk::MenuItem(label, host_menu), m_org_label(FbTk::MenuItem::label()),
|
||||||
m_max(max_val), m_min(min_val), m_res(res) {
|
m_max(max_val), m_min(min_val), m_res(res) {
|
||||||
updateLabel();
|
updateLabel();
|
||||||
setCloseOnClick(false);
|
setCloseOnClick(false);
|
||||||
}
|
}
|
||||||
|
@ -77,7 +77,7 @@ public:
|
||||||
updateLabel();
|
updateLabel();
|
||||||
// call other commands
|
// call other commands
|
||||||
FbTk::MenuItem::click(button, time, mods);
|
FbTk::MenuItem::click(button, time, mods);
|
||||||
|
|
||||||
// show new value, which for us means forcing a full menu update
|
// show new value, which for us means forcing a full menu update
|
||||||
// since the text is drawn onto the background!
|
// since the text is drawn onto the background!
|
||||||
if (menu()) {
|
if (menu()) {
|
||||||
|
|
|
@ -54,12 +54,12 @@ class Menu: public FbTk::EventHandler, FbTk::FbWindowRenderer,
|
||||||
public:
|
public:
|
||||||
enum Alignment{ ALIGNDONTCARE = 1, ALIGNTOP, ALIGNBOTTOM };
|
enum Alignment{ ALIGNDONTCARE = 1, ALIGNTOP, ALIGNBOTTOM };
|
||||||
enum { RIGHT = 1, LEFT };
|
enum { RIGHT = 1, LEFT };
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Bullet type
|
Bullet type
|
||||||
*/
|
*/
|
||||||
enum { EMPTY = 0, SQUARE, TRIANGLE, DIAMOND };
|
enum { EMPTY = 0, SQUARE, TRIANGLE, DIAMOND };
|
||||||
|
|
||||||
Menu(MenuTheme &tm, ImageControl &imgctrl);
|
Menu(MenuTheme &tm, ImageControl &imgctrl);
|
||||||
virtual ~Menu();
|
virtual ~Menu();
|
||||||
|
|
||||||
|
@ -79,11 +79,11 @@ public:
|
||||||
int remove(unsigned int item);
|
int remove(unsigned int item);
|
||||||
/// remove all items
|
/// remove all items
|
||||||
void removeAll();
|
void removeAll();
|
||||||
inline void setInternalMenu(bool val = true) { m_internal_menu = val; }
|
void setInternalMenu(bool val = true) { m_internal_menu = val; }
|
||||||
inline void setAlignment(Alignment a) { m_alignment = a; }
|
void setAlignment(Alignment a) { m_alignment = a; }
|
||||||
#ifdef NOT_USED
|
#ifdef NOT_USED
|
||||||
inline void setTorn() { m_torn = true; }
|
void setTorn() { m_torn = true; }
|
||||||
inline void removeParent() { if (m_internal_menu) m_parent = 0; }
|
void removeParent() { if (m_internal_menu) m_parent = 0; }
|
||||||
#endif
|
#endif
|
||||||
/// raise this window
|
/// raise this window
|
||||||
virtual void raise();
|
virtual void raise();
|
||||||
|
@ -119,7 +119,7 @@ public:
|
||||||
virtual void updateMenu(int active_index = -1);
|
virtual void updateMenu(int active_index = -1);
|
||||||
void setItemSelected(unsigned int index, bool val);
|
void setItemSelected(unsigned int index, bool val);
|
||||||
void setItemEnabled(unsigned int index, bool val);
|
void setItemEnabled(unsigned int index, bool val);
|
||||||
inline void setMinimumSublevels(int m) { menu.minsub = m; }
|
void setMinimumSublevels(int m) { menu.minsub = m; }
|
||||||
virtual void drawSubmenu(unsigned int index);
|
virtual void drawSubmenu(unsigned int index);
|
||||||
/// show menu
|
/// show menu
|
||||||
virtual void show();
|
virtual void show();
|
||||||
|
@ -129,54 +129,54 @@ public:
|
||||||
#ifdef NOT_USED
|
#ifdef NOT_USED
|
||||||
void setActiveIndex(int index) { m_active_index = index; }
|
void setActiveIndex(int index) { m_active_index = index; }
|
||||||
/*@}*/
|
/*@}*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@name accessors
|
@name accessors
|
||||||
*/
|
*/
|
||||||
//@{
|
//@{
|
||||||
inline int activeIndex() const { return m_active_index; }
|
int activeIndex() const { return m_active_index; }
|
||||||
#endif
|
#endif
|
||||||
inline bool isTorn() const { return m_torn; }
|
bool isTorn() const { return m_torn; }
|
||||||
inline bool isVisible() const { return m_visible; }
|
bool isVisible() const { return m_visible; }
|
||||||
inline bool isMoving() const { return m_moving; }
|
bool isMoving() const { return m_moving; }
|
||||||
inline int screenNumber() const { return menu.window.screenNumber(); }
|
int screenNumber() const { return menu.window.screenNumber(); }
|
||||||
inline Window window() const { return menu.window.window(); }
|
Window window() const { return menu.window.window(); }
|
||||||
inline FbWindow &fbwindow() { return menu.window; }
|
FbWindow &fbwindow() { return menu.window; }
|
||||||
inline const FbWindow &fbwindow() const { return menu.window; }
|
const FbWindow &fbwindow() const { return menu.window; }
|
||||||
inline FbWindow &titleWindow() { return menu.title; }
|
FbWindow &titleWindow() { return menu.title; }
|
||||||
inline FbWindow &frameWindow() { return menu.frame; }
|
FbWindow &frameWindow() { return menu.frame; }
|
||||||
inline const std::string &label() const { return menu.label; }
|
const std::string &label() const { return menu.label; }
|
||||||
inline int x() const { return menu.window.x(); }
|
int x() const { return menu.window.x(); }
|
||||||
inline int y() const { return menu.window.y(); }
|
int y() const { return menu.window.y(); }
|
||||||
inline unsigned int width() const { return menu.window.width(); }
|
unsigned int width() const { return menu.window.width(); }
|
||||||
inline unsigned int height() const { return menu.window.height(); }
|
unsigned int height() const { return menu.window.height(); }
|
||||||
inline size_t numberOfItems() const { return menuitems.size(); }
|
size_t numberOfItems() const { return menuitems.size(); }
|
||||||
inline int currentSubmenu() const { return m_which_sub; }
|
int currentSubmenu() const { return m_which_sub; }
|
||||||
|
|
||||||
bool isItemSelected(unsigned int index) const;
|
bool isItemSelected(unsigned int index) const;
|
||||||
bool isItemEnabled(unsigned int index) const;
|
bool isItemEnabled(unsigned int index) const;
|
||||||
bool isItemSelectable(unsigned int index) const;
|
bool isItemSelectable(unsigned int index) const;
|
||||||
inline const MenuTheme &theme() const { return m_theme; }
|
const MenuTheme &theme() const { return m_theme; }
|
||||||
inline unsigned char alpha() const { return theme().alpha(); }
|
unsigned char alpha() const { return theme().alpha(); }
|
||||||
inline static Menu *shownMenu() { return shown; }
|
static Menu *shownMenu() { return shown; }
|
||||||
inline static Menu *focused() { return s_focused; }
|
static Menu *focused() { return s_focused; }
|
||||||
static void hideShownMenu();
|
static void hideShownMenu();
|
||||||
/// @return menuitem at index
|
/// @return menuitem at index
|
||||||
inline const MenuItem *find(unsigned int index) const { return menuitems[index]; }
|
const MenuItem *find(unsigned int index) const { return menuitems[index]; }
|
||||||
inline MenuItem *find(unsigned int index) { return menuitems[index]; }
|
MenuItem *find(unsigned int index) { return menuitems[index]; }
|
||||||
//@}
|
//@}
|
||||||
/// @return true if index is valid
|
/// @return true if index is valid
|
||||||
inline bool validIndex(int index) const { return (index < static_cast<int>(numberOfItems()) && index >= 0); }
|
bool validIndex(int index) const { return (index < static_cast<int>(numberOfItems()) && index >= 0); }
|
||||||
|
|
||||||
inline Menu *parent() { return m_parent; }
|
Menu *parent() { return m_parent; }
|
||||||
inline const Menu *parent() const { return m_parent; }
|
const Menu *parent() const { return m_parent; }
|
||||||
|
|
||||||
void renderForeground(FbWindow &win, FbDrawable &drawable);
|
void renderForeground(FbWindow &win, FbDrawable &drawable);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
inline void setTitleVisibility(bool b) {
|
void setTitleVisibility(bool b) {
|
||||||
m_title_vis = b; m_need_update = true;
|
m_title_vis = b; m_need_update = true;
|
||||||
if (!b)
|
if (!b)
|
||||||
titleWindow().lower();
|
titleWindow().lower();
|
||||||
else
|
else
|
||||||
|
@ -196,7 +196,7 @@ protected:
|
||||||
|
|
||||||
virtual void update(FbTk::Subject *);
|
virtual void update(FbTk::Subject *);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void openSubmenu();
|
void openSubmenu();
|
||||||
void closeMenu();
|
void closeMenu();
|
||||||
|
@ -225,7 +225,7 @@ private:
|
||||||
bool m_torn; ///< torn from parent
|
bool m_torn; ///< torn from parent
|
||||||
bool m_internal_menu; ///< whether we should destroy this menu or if it's managed somewhere else
|
bool m_internal_menu; ///< whether we should destroy this menu or if it's managed somewhere else
|
||||||
bool m_title_vis; ///< title visibility
|
bool m_title_vis; ///< title visibility
|
||||||
|
|
||||||
int m_which_sub;
|
int m_which_sub;
|
||||||
Alignment m_alignment;
|
Alignment m_alignment;
|
||||||
|
|
||||||
|
|
|
@ -92,7 +92,7 @@ public:
|
||||||
{ }
|
{ }
|
||||||
virtual ~MenuItem() { }
|
virtual ~MenuItem() { }
|
||||||
|
|
||||||
inline void setCommand(RefCount<Command> &cmd) { m_command = cmd; }
|
void setCommand(RefCount<Command> &cmd) { m_command = cmd; }
|
||||||
virtual void setSelected(bool selected) { m_selected = selected; }
|
virtual void setSelected(bool selected) { m_selected = selected; }
|
||||||
virtual void setEnabled(bool enabled) { m_enabled = enabled; }
|
virtual void setEnabled(bool enabled) { m_enabled = enabled; }
|
||||||
virtual void setLabel(const FbString &label) { m_label = label; }
|
virtual void setLabel(const FbString &label) { m_label = label; }
|
||||||
|
@ -100,7 +100,7 @@ public:
|
||||||
void setCloseOnClick(bool val) { m_close_on_click = val; }
|
void setCloseOnClick(bool val) { m_close_on_click = val; }
|
||||||
void setIcon(const std::string &filename, int screen_num);
|
void setIcon(const std::string &filename, int screen_num);
|
||||||
virtual Menu *submenu() { return m_submenu; }
|
virtual Menu *submenu() { return m_submenu; }
|
||||||
/**
|
/**
|
||||||
@name accessors
|
@name accessors
|
||||||
*/
|
*/
|
||||||
//@{
|
//@{
|
||||||
|
@ -108,15 +108,15 @@ public:
|
||||||
virtual const PixmapWithMask *icon() const {
|
virtual const PixmapWithMask *icon() const {
|
||||||
return m_icon.get() ? m_icon->pixmap.get() : 0;
|
return m_icon.get() ? m_icon->pixmap.get() : 0;
|
||||||
}
|
}
|
||||||
virtual const Menu *submenu() const { return m_submenu; }
|
virtual const Menu *submenu() const { return m_submenu; }
|
||||||
virtual bool isEnabled() const { return m_enabled; }
|
virtual bool isEnabled() const { return m_enabled; }
|
||||||
virtual bool isSelected() const { return m_selected; }
|
virtual bool isSelected() const { return m_selected; }
|
||||||
virtual bool isToggleItem() const { return m_toggle_item; }
|
virtual bool isToggleItem() const { return m_toggle_item; }
|
||||||
|
|
||||||
// iType functions
|
// iType functions
|
||||||
virtual inline void setIndex(int index) { m_index = index; }
|
virtual void setIndex(int index) { m_index = index; }
|
||||||
virtual inline int getIndex() { return m_index; }
|
virtual int getIndex() { return m_index; }
|
||||||
inline const std::string &iTypeString() const { return m_label; }
|
const std::string &iTypeString() const { return m_label; }
|
||||||
virtual void drawLine(FbDrawable &draw,
|
virtual void drawLine(FbDrawable &draw,
|
||||||
const MenuTheme &theme,
|
const MenuTheme &theme,
|
||||||
size_t size,
|
size_t size,
|
||||||
|
@ -125,7 +125,7 @@ public:
|
||||||
|
|
||||||
virtual unsigned int width(const MenuTheme &theme) const;
|
virtual unsigned int width(const MenuTheme &theme) const;
|
||||||
virtual unsigned int height(const MenuTheme &theme) const;
|
virtual unsigned int height(const MenuTheme &theme) const;
|
||||||
virtual void draw(FbDrawable &drawable,
|
virtual void draw(FbDrawable &drawable,
|
||||||
const MenuTheme &theme,
|
const MenuTheme &theme,
|
||||||
bool highlight,
|
bool highlight,
|
||||||
// "foreground" is the transient bits - more likely to change
|
// "foreground" is the transient bits - more likely to change
|
||||||
|
@ -136,7 +136,7 @@ public:
|
||||||
/**
|
/**
|
||||||
Called when the item was clicked with a specific button
|
Called when the item was clicked with a specific button
|
||||||
@param button the button number
|
@param button the button number
|
||||||
@param time the time stamp
|
@param time the time stamp
|
||||||
*/
|
*/
|
||||||
virtual void click(int button, int time, unsigned int mods);
|
virtual void click(int button, int time, unsigned int mods);
|
||||||
/// must use this to show submenu to ensure consistency for object like window menu in ClientMenu (see Workspace.cc)
|
/// must use this to show submenu to ensure consistency for object like window menu in ClientMenu (see Workspace.cc)
|
||||||
|
@ -147,7 +147,7 @@ public:
|
||||||
|
|
||||||
void setMenu(Menu &menu) { m_menu = &menu; }
|
void setMenu(Menu &menu) { m_menu = &menu; }
|
||||||
Menu *menu() { return m_menu; }
|
Menu *menu() { return m_menu; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
FbString m_label; ///< label of this item
|
FbString m_label; ///< label of this item
|
||||||
Menu *m_menu; ///< the menu we live in
|
Menu *m_menu; ///< the menu we live in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// MenuTheme.hh for FbTk
|
// MenuTheme.hh for FbTk
|
||||||
// Copyright (c) 2002 - 2006 Henrik Kinnunen (fluxgen at fluxbox dot org)
|
// Copyright (c) 2002 - 2006 Henrik Kinnunen (fluxgen at fluxbox dot org)
|
||||||
//
|
//
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
// copy of this software and associated documentation files (the "Software"),
|
// copy of this software and associated documentation files (the "Software"),
|
||||||
// to deal in the Software without restriction, including without limitation
|
// to deal in the Software without restriction, including without limitation
|
||||||
|
@ -55,90 +55,90 @@ public:
|
||||||
@name text colors
|
@name text colors
|
||||||
*/
|
*/
|
||||||
///@{
|
///@{
|
||||||
inline const Color &titleTextColor() const { return *t_text; }
|
const Color &titleTextColor() const { return *t_text; }
|
||||||
inline const Color &frameTextColor() const { return *f_text; }
|
const Color &frameTextColor() const { return *f_text; }
|
||||||
inline const Color &frameUnderlineColor() const { return *u_text; }
|
const Color &frameUnderlineColor() const { return *u_text; }
|
||||||
inline const Color &highlightTextColor() const { return *h_text; }
|
const Color &highlightTextColor() const { return *h_text; }
|
||||||
inline const Color &disableTextColor() const { return *d_text; }
|
const Color &disableTextColor() const { return *d_text; }
|
||||||
///@}
|
///@}
|
||||||
/**
|
/**
|
||||||
@name textures
|
@name textures
|
||||||
*/
|
*/
|
||||||
///@{
|
///@{
|
||||||
inline const Texture &titleTexture() const { return *title; }
|
const Texture &titleTexture() const { return *title; }
|
||||||
inline const Texture &frameTexture() const { return *frame; }
|
const Texture &frameTexture() const { return *frame; }
|
||||||
inline const Texture &hiliteTexture() const { return *hilite; }
|
const Texture &hiliteTexture() const { return *hilite; }
|
||||||
///@}
|
///@}
|
||||||
|
|
||||||
inline const PixmapWithMask &bulletPixmap() const { return *m_bullet_pixmap; }
|
const PixmapWithMask &bulletPixmap() const { return *m_bullet_pixmap; }
|
||||||
inline const PixmapWithMask &selectedPixmap() const { return *m_selected_pixmap; }
|
const PixmapWithMask &selectedPixmap() const { return *m_selected_pixmap; }
|
||||||
inline const PixmapWithMask &unselectedPixmap() const { return *m_unselected_pixmap; }
|
const PixmapWithMask &unselectedPixmap() const { return *m_unselected_pixmap; }
|
||||||
|
|
||||||
inline const PixmapWithMask &highlightBulletPixmap() const { return *m_hl_bullet_pixmap; }
|
const PixmapWithMask &highlightBulletPixmap() const { return *m_hl_bullet_pixmap; }
|
||||||
inline const PixmapWithMask &highlightSelectedPixmap() const { return *m_hl_selected_pixmap; }
|
const PixmapWithMask &highlightSelectedPixmap() const { return *m_hl_selected_pixmap; }
|
||||||
inline const PixmapWithMask &highlightUnselectedPixmap() const { return *m_hl_unselected_pixmap; }
|
const PixmapWithMask &highlightUnselectedPixmap() const { return *m_hl_unselected_pixmap; }
|
||||||
/**
|
/**
|
||||||
@name fonts
|
@name fonts
|
||||||
*/
|
*/
|
||||||
///@{
|
///@{
|
||||||
inline const Font &titleFont() const { return *titlefont; }
|
const Font &titleFont() const { return *titlefont; }
|
||||||
inline Font &titleFont() { return *titlefont; }
|
Font &titleFont() { return *titlefont; }
|
||||||
inline const Font &frameFont() const { return *framefont; }
|
const Font &frameFont() const { return *framefont; }
|
||||||
inline Font &frameFont() { return *framefont; }
|
Font &frameFont() { return *framefont; }
|
||||||
///@}
|
///@}
|
||||||
|
|
||||||
inline Justify frameFontJustify() const { return *framefont_justify; }
|
Justify frameFontJustify() const { return *framefont_justify; }
|
||||||
inline Justify titleFontJustify() const { return *titlefont_justify; }
|
Justify titleFontJustify() const { return *titlefont_justify; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@name graphic contexts
|
@name graphic contexts
|
||||||
*/
|
*/
|
||||||
///@{
|
///@{
|
||||||
inline const GContext &titleTextGC() const { return t_text_gc; }
|
const GContext &titleTextGC() const { return t_text_gc; }
|
||||||
inline const GContext &frameTextGC() const { return f_text_gc; }
|
const GContext &frameTextGC() const { return f_text_gc; }
|
||||||
inline const GContext &frameUnderlineGC() const { return u_text_gc; }
|
const GContext &frameUnderlineGC() const { return u_text_gc; }
|
||||||
inline const GContext &hiliteTextGC() const { return h_text_gc; }
|
const GContext &hiliteTextGC() const { return h_text_gc; }
|
||||||
inline const GContext &disableTextGC() const { return d_text_gc; }
|
const GContext &disableTextGC() const { return d_text_gc; }
|
||||||
inline const GContext &hiliteGC() const { return hilite_gc; }
|
const GContext &hiliteGC() const { return hilite_gc; }
|
||||||
inline GContext &titleTextGC() { return t_text_gc; }
|
GContext &titleTextGC() { return t_text_gc; }
|
||||||
inline GContext &frameTextGC() { return f_text_gc; }
|
GContext &frameTextGC() { return f_text_gc; }
|
||||||
inline GContext &frameUnderlineGC() { return u_text_gc; }
|
GContext &frameUnderlineGC() { return u_text_gc; }
|
||||||
inline GContext &hiliteTextGC() { return h_text_gc; }
|
GContext &hiliteTextGC() { return h_text_gc; }
|
||||||
inline GContext &disableTextGC() { return d_text_gc; }
|
GContext &disableTextGC() { return d_text_gc; }
|
||||||
inline GContext &hiliteGC() { return hilite_gc; }
|
GContext &hiliteGC() { return hilite_gc; }
|
||||||
///@}
|
///@}
|
||||||
inline BulletType bullet() const { return *m_bullet; }
|
BulletType bullet() const { return *m_bullet; }
|
||||||
inline Justify bulletPos() const { return *bullet_pos; }
|
Justify bulletPos() const { return *bullet_pos; }
|
||||||
|
|
||||||
inline unsigned int titleHeight() const { return m_real_title_height; }
|
unsigned int titleHeight() const { return m_real_title_height; }
|
||||||
inline unsigned int itemHeight() const { return m_real_item_height; }
|
unsigned int itemHeight() const { return m_real_item_height; }
|
||||||
inline unsigned int borderWidth() const { return *m_border_width; }
|
unsigned int borderWidth() const { return *m_border_width; }
|
||||||
inline unsigned int bevelWidth() const { return *m_bevel_width; }
|
unsigned int bevelWidth() const { return *m_bevel_width; }
|
||||||
|
|
||||||
inline unsigned char alpha() const { return m_alpha; }
|
unsigned char alpha() const { return m_alpha; }
|
||||||
inline void setAlpha(unsigned char alpha) { m_alpha = alpha; }
|
void setAlpha(unsigned char alpha) { m_alpha = alpha; }
|
||||||
// this isn't actually a theme item
|
// this isn't actually a theme item
|
||||||
// but we'll let it be here for now, until there's a better way to
|
// but we'll let it be here for now, until there's a better way to
|
||||||
// get resources into menu
|
// get resources into menu
|
||||||
inline void setMenuMode(MenuMode mode) { m_menumode = mode; }
|
void setMenuMode(MenuMode mode) { m_menumode = mode; }
|
||||||
inline MenuMode menuMode() const { return m_menumode; }
|
MenuMode menuMode() const { return m_menumode; }
|
||||||
inline void setDelayOpen(int msec) { m_delayopen = msec; }
|
void setDelayOpen(int msec) { m_delayopen = msec; }
|
||||||
inline void setDelayClose(int msec) { m_delayclose = msec; }
|
void setDelayClose(int msec) { m_delayclose = msec; }
|
||||||
inline int delayOpen() const { return m_delayopen; }
|
int delayOpen() const { return m_delayopen; }
|
||||||
inline int delayClose() const { return m_delayclose; }
|
int delayClose() const { return m_delayclose; }
|
||||||
|
|
||||||
inline const Color &borderColor() const { return *m_border_color; }
|
const Color &borderColor() const { return *m_border_color; }
|
||||||
inline Shape::ShapePlace shapePlaces() const { return *m_shapeplace; }
|
Shape::ShapePlace shapePlaces() const { return *m_shapeplace; }
|
||||||
|
|
||||||
// special override
|
// special override
|
||||||
inline void setSelectedPixmap(Pixmap pm, bool is_imagecached) {
|
void setSelectedPixmap(Pixmap pm, bool is_imagecached) {
|
||||||
m_selected_pixmap->pixmap() = pm;
|
m_selected_pixmap->pixmap() = pm;
|
||||||
if (is_imagecached)
|
if (is_imagecached)
|
||||||
m_selected_pixmap->pixmap().dontFree();
|
m_selected_pixmap->pixmap().dontFree();
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void setHighlightSelectedPixmap(Pixmap pm, bool is_imagecached) {
|
void setHighlightSelectedPixmap(Pixmap pm, bool is_imagecached) {
|
||||||
m_hl_selected_pixmap->pixmap() = pm;
|
m_hl_selected_pixmap->pixmap() = pm;
|
||||||
if (is_imagecached)
|
if (is_imagecached)
|
||||||
m_hl_selected_pixmap->pixmap().dontFree();
|
m_hl_selected_pixmap->pixmap().dontFree();
|
||||||
}
|
}
|
||||||
|
@ -148,7 +148,7 @@ private:
|
||||||
ThemeItem<Texture> title, frame, hilite;
|
ThemeItem<Texture> title, frame, hilite;
|
||||||
ThemeItem<Font> titlefont, framefont;
|
ThemeItem<Font> titlefont, framefont;
|
||||||
ThemeItem<Justify> framefont_justify, titlefont_justify;
|
ThemeItem<Justify> framefont_justify, titlefont_justify;
|
||||||
ThemeItem<Justify> bullet_pos;
|
ThemeItem<Justify> bullet_pos;
|
||||||
ThemeItem<BulletType> m_bullet;
|
ThemeItem<BulletType> m_bullet;
|
||||||
ThemeItem<Shape::ShapePlace> m_shapeplace;
|
ThemeItem<Shape::ShapePlace> m_shapeplace;
|
||||||
ThemeItem<unsigned int> m_title_height, m_item_height;
|
ThemeItem<unsigned int> m_title_height, m_item_height;
|
||||||
|
|
|
@ -59,9 +59,9 @@ public:
|
||||||
XLayer *getLayer(size_t num);
|
XLayer *getLayer(size_t num);
|
||||||
const XLayer *getLayer(size_t num) const;
|
const XLayer *getLayer(size_t num) const;
|
||||||
|
|
||||||
inline bool isUpdatable() const { return m_lock == 0; }
|
bool isUpdatable() const { return m_lock == 0; }
|
||||||
inline void lock() { ++m_lock; }
|
void lock() { ++m_lock; }
|
||||||
inline void unlock() { if (--m_lock == 0) restack(); }
|
void unlock() { if (--m_lock == 0) restack(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector<XLayer *> m_layers;
|
std::vector<XLayer *> m_layers;
|
||||||
|
|
|
@ -40,7 +40,7 @@ public:
|
||||||
/// executes command for the button click
|
/// executes command for the button click
|
||||||
virtual void click(int button, int time, unsigned int mods);
|
virtual void click(int button, int time, unsigned int mods);
|
||||||
/// @return number of buttons this instance handles
|
/// @return number of buttons this instance handles
|
||||||
inline unsigned int buttons() const { return m_buttons; }
|
unsigned int buttons() const { return m_buttons; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void init(int buttons);
|
void init(int buttons);
|
||||||
|
|
|
@ -55,8 +55,8 @@ private:
|
||||||
class Resource_base:private FbTk::NotCopyable
|
class Resource_base:private FbTk::NotCopyable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~Resource_base() { };
|
virtual ~Resource_base() { };
|
||||||
|
|
||||||
/// set from string value
|
/// set from string value
|
||||||
virtual void setFromString(char const *strval) = 0;
|
virtual void setFromString(char const *strval) = 0;
|
||||||
/// set default value
|
/// set default value
|
||||||
|
@ -64,18 +64,18 @@ public:
|
||||||
/// get string value
|
/// get string value
|
||||||
virtual std::string getString() const = 0;
|
virtual std::string getString() const = 0;
|
||||||
/// get alternative name of this resource
|
/// get alternative name of this resource
|
||||||
inline const std::string& altName() const { return m_altname; }
|
const std::string& altName() const { return m_altname; }
|
||||||
/// get name of this resource
|
/// get name of this resource
|
||||||
inline const std::string& name() const { return m_name; }
|
const std::string& name() const { return m_name; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Resource_base(const std::string &name, const std::string &altname):
|
Resource_base(const std::string &name, const std::string &altname):
|
||||||
m_name(name), m_altname(altname)
|
m_name(name), m_altname(altname)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string m_name; ///< name of this resource
|
std::string m_name; ///< name of this resource
|
||||||
std::string m_altname; ///< alternative name
|
std::string m_altname; ///< alternative name
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
@ -99,7 +99,7 @@ public:
|
||||||
/// @return true on success
|
/// @return true on success
|
||||||
virtual bool save(const char *filename, const char *mergefilename=0);
|
virtual bool save(const char *filename, const char *mergefilename=0);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// Add resource to list, only used in Resource<T>
|
/// Add resource to list, only used in Resource<T>
|
||||||
template <class T>
|
template <class T>
|
||||||
|
@ -122,21 +122,21 @@ public:
|
||||||
void setResourceValue(const std::string &resourcename, const std::string &value);
|
void setResourceValue(const std::string &resourcename, const std::string &value);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Will search and cast the resource to Resource<Type>,
|
* Will search and cast the resource to Resource<Type>,
|
||||||
* it will throw exception if it fails
|
* it will throw exception if it fails
|
||||||
* @return reference to resource type
|
* @return reference to resource type
|
||||||
*/
|
*/
|
||||||
template <typename ResourceType>
|
template <typename ResourceType>
|
||||||
Resource<ResourceType> &getResource(const std::string &resource);
|
Resource<ResourceType> &getResource(const std::string &resource);
|
||||||
|
|
||||||
// this marks the database as "in use" and will avoid reloading
|
// this marks the database as "in use" and will avoid reloading
|
||||||
// resources unless it is zero.
|
// resources unless it is zero.
|
||||||
// It returns this resource manager. Useful for passing to
|
// It returns this resource manager. Useful for passing to
|
||||||
// constructors like Object(m_rm.lock())
|
// constructors like Object(m_rm.lock())
|
||||||
ResourceManager &lock();
|
ResourceManager &lock();
|
||||||
void unlock();
|
void unlock();
|
||||||
// for debugging
|
// for debugging
|
||||||
inline int lockDepth() const { return m_db_lock; }
|
int lockDepth() const { return m_db_lock; }
|
||||||
void dump() {
|
void dump() {
|
||||||
ResourceList::iterator it = m_resourcelist.begin();
|
ResourceList::iterator it = m_resourcelist.begin();
|
||||||
ResourceList::iterator it_end = m_resourcelist.end();
|
ResourceList::iterator it_end = m_resourcelist.end();
|
||||||
|
@ -171,33 +171,33 @@ private:
|
||||||
*/
|
*/
|
||||||
template <typename T>
|
template <typename T>
|
||||||
class Resource:public Resource_base, public Accessor<T> {
|
class Resource:public Resource_base, public Accessor<T> {
|
||||||
public:
|
public:
|
||||||
typedef T Type;
|
typedef T Type;
|
||||||
Resource(ResourceManager &rm, T val,
|
Resource(ResourceManager &rm, T val,
|
||||||
const std::string &name, const std::string &altname):
|
const std::string &name, const std::string &altname):
|
||||||
Resource_base(name, altname),
|
Resource_base(name, altname),
|
||||||
m_value(val), m_defaultval(val),
|
m_value(val), m_defaultval(val),
|
||||||
m_rm(rm) {
|
m_rm(rm) {
|
||||||
m_rm.addResource(*this); // add this to resource handler
|
m_rm.addResource(*this); // add this to resource handler
|
||||||
}
|
}
|
||||||
virtual ~Resource() {
|
virtual ~Resource() {
|
||||||
m_rm.removeResource(*this); // remove this from resource handler
|
m_rm.removeResource(*this); // remove this from resource handler
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void setDefaultValue() { m_value = m_defaultval; }
|
void setDefaultValue() { m_value = m_defaultval; }
|
||||||
/// sets resource from string, specialized, must be implemented
|
/// sets resource from string, specialized, must be implemented
|
||||||
void setFromString(const char *strval);
|
void setFromString(const char *strval);
|
||||||
inline Resource<T>& operator = (const T& newvalue) { m_value = newvalue; return *this;}
|
Resource<T>& operator = (const T& newvalue) { m_value = newvalue; return *this;}
|
||||||
/// specialized, must be implemented
|
/// specialized, must be implemented
|
||||||
/// @return string value of resource
|
/// @return string value of resource
|
||||||
std::string getString() const;
|
std::string getString() const;
|
||||||
|
|
||||||
inline operator T() const { return m_value; }
|
operator T() const { return m_value; }
|
||||||
inline T& get() { return m_value; }
|
T& get() { return m_value; }
|
||||||
inline T& operator*() { return m_value; }
|
T& operator*() { return m_value; }
|
||||||
inline const T& operator*() const { return m_value; }
|
const T& operator*() const { return m_value; }
|
||||||
inline T *operator->() { return &m_value; }
|
T *operator->() { return &m_value; }
|
||||||
inline const T *operator->() const { return &m_value; }
|
const T *operator->() const { return &m_value; }
|
||||||
private:
|
private:
|
||||||
T m_value, m_defaultval;
|
T m_value, m_defaultval;
|
||||||
ResourceManager &m_rm;
|
ResourceManager &m_rm;
|
||||||
|
@ -233,17 +233,17 @@ void ResourceManager::addResource(Resource<T> &r) {
|
||||||
|
|
||||||
unlock();
|
unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template <typename ResourceType>
|
template <typename ResourceType>
|
||||||
Resource<ResourceType> &ResourceManager::getResource(const std::string &resname) {
|
Resource<ResourceType> &ResourceManager::getResource(const std::string &resname) {
|
||||||
Resource_base *res = findResource(resname);
|
Resource_base *res = findResource(resname);
|
||||||
if (res == 0) {
|
if (res == 0) {
|
||||||
throw ResourceException("Could not find resource \"" +
|
throw ResourceException("Could not find resource \"" +
|
||||||
resname + "\"");
|
resname + "\"");
|
||||||
}
|
}
|
||||||
|
|
||||||
Resource<ResourceType> *res_type =
|
Resource<ResourceType> *res_type =
|
||||||
dynamic_cast<Resource<ResourceType> *>(res);
|
dynamic_cast<Resource<ResourceType> *>(res);
|
||||||
if (res_type == 0) {
|
if (res_type == 0) {
|
||||||
throw ResourceException("Could not convert resource \"" +
|
throw ResourceException("Could not convert resource \"" +
|
||||||
|
|
|
@ -68,7 +68,7 @@ public:
|
||||||
const Font &font() const { return *m_font; }
|
const Font &font() const { return *m_font; }
|
||||||
GC gc() const { return m_gc; }
|
GC gc() const { return m_gc; }
|
||||||
int cursorPosition() const { return m_cursor_pos; }
|
int cursorPosition() const { return m_cursor_pos; }
|
||||||
inline int textStartPos(){ return m_start_pos; }
|
int textStartPos(){ return m_start_pos; }
|
||||||
|
|
||||||
unsigned int findEmptySpaceLeft();
|
unsigned int findEmptySpaceLeft();
|
||||||
unsigned int findEmptySpaceRight();
|
unsigned int findEmptySpaceRight();
|
||||||
|
|
|
@ -66,10 +66,10 @@ public:
|
||||||
|
|
||||||
void renderForeground(FbDrawable &drawable);
|
void renderForeground(FbDrawable &drawable);
|
||||||
|
|
||||||
inline FbTk::Justify justify() const { return m_justify; }
|
FbTk::Justify justify() const { return m_justify; }
|
||||||
inline const std::string &text() const { return m_text; }
|
const std::string &text() const { return m_text; }
|
||||||
inline FbTk::Font &font() const { return *m_font; }
|
FbTk::Font &font() const { return *m_font; }
|
||||||
inline FbTk::Orientation orientation() const { return m_orientation; }
|
FbTk::Orientation orientation() const { return m_orientation; }
|
||||||
unsigned int textWidth() const;
|
unsigned int textWidth() const;
|
||||||
#ifdef NOT_USED
|
#ifdef NOT_USED
|
||||||
unsigned int textHeight() const;
|
unsigned int textHeight() const;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// Texture.hh for Fluxbox Window Manager
|
// Texture.hh for Fluxbox Window Manager
|
||||||
// Copyright (c) 2002-2003 Henrik Kinnunen (fluxbox<at>users.sourceforge.net)
|
// Copyright (c) 2002-2003 Henrik Kinnunen (fluxbox<at>users.sourceforge.net)
|
||||||
//
|
//
|
||||||
// from Image.hh for Blackbox - an X11 Window manager
|
// from Image.hh for Blackbox - an X11 Window manager
|
||||||
|
@ -63,9 +63,9 @@ public:
|
||||||
PIPECROSS = 0x01000,
|
PIPECROSS = 0x01000,
|
||||||
ELLIPTIC = 0x02000
|
ELLIPTIC = 0x02000
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
BEVEL1 = 0x04000,
|
BEVEL1 = 0x04000,
|
||||||
BEVEL2 = 0x08000, // bevel types
|
BEVEL2 = 0x08000, // bevel types
|
||||||
INVERT = 0x10000, ///< inverted image
|
INVERT = 0x10000, ///< inverted image
|
||||||
PARENTRELATIVE = 0x20000,
|
PARENTRELATIVE = 0x20000,
|
||||||
|
@ -78,7 +78,7 @@ public:
|
||||||
void setType(unsigned long t) { m_type = t; }
|
void setType(unsigned long t) { m_type = t; }
|
||||||
void addType(unsigned long t) { m_type |= t; }
|
void addType(unsigned long t) { m_type |= t; }
|
||||||
void setFromString(const char * const str);
|
void setFromString(const char * const str);
|
||||||
|
|
||||||
Color &color() { return m_color; }
|
Color &color() { return m_color; }
|
||||||
Color &colorTo() { return m_color_to; }
|
Color &colorTo() { return m_color_to; }
|
||||||
Color &hiColor() { return m_hicolor; }
|
Color &hiColor() { return m_hicolor; }
|
||||||
|
@ -93,8 +93,8 @@ public:
|
||||||
const Color &hiColor() const { return m_hicolor; }
|
const Color &hiColor() const { return m_hicolor; }
|
||||||
const Color &loColor() const { return m_locolor; }
|
const Color &loColor() const { return m_locolor; }
|
||||||
const FbTk::FbPixmap &pixmap() const { return m_pixmap; }
|
const FbTk::FbPixmap &pixmap() const { return m_pixmap; }
|
||||||
inline unsigned long type() const { return m_type; }
|
unsigned long type() const { return m_type; }
|
||||||
inline bool usePixmap() const { return !( type() == (FLAT | SOLID) && pixmap().drawable() == 0); }
|
bool usePixmap() const { return !( type() == (FLAT | SOLID) && pixmap().drawable() == 0); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
FbTk::Color m_color, m_color_to, m_hicolor, m_locolor;
|
FbTk::Color m_color, m_color_to, m_hicolor, m_locolor;
|
||||||
|
|
|
@ -66,7 +66,7 @@ public:
|
||||||
ThemeItem(FbTk::Theme &tm, const std::string &name, const std::string &altname);
|
ThemeItem(FbTk::Theme &tm, const std::string &name, const std::string &altname);
|
||||||
virtual ~ThemeItem();
|
virtual ~ThemeItem();
|
||||||
/// specialized
|
/// specialized
|
||||||
void setDefaultValue();
|
void setDefaultValue();
|
||||||
/// specialized
|
/// specialized
|
||||||
virtual void setFromString(const char *strval);
|
virtual void setFromString(const char *strval);
|
||||||
/// specialized
|
/// specialized
|
||||||
|
@ -77,10 +77,10 @@ public:
|
||||||
@name access operators
|
@name access operators
|
||||||
*/
|
*/
|
||||||
/**@{*/
|
/**@{*/
|
||||||
inline T& operator*() { return m_value; }
|
T& operator*() { return m_value; }
|
||||||
inline const T& operator*() const { return m_value; }
|
const T& operator*() const { return m_value; }
|
||||||
inline T *operator->() { return &m_value; }
|
T *operator->() { return &m_value; }
|
||||||
inline const T *operator->() const { return &m_value; }
|
const T *operator->() const { return &m_value; }
|
||||||
/**@}*/
|
/**@}*/
|
||||||
|
|
||||||
FbTk::Theme &theme() { return m_tm; }
|
FbTk::Theme &theme() { return m_tm; }
|
||||||
|
@ -112,7 +112,7 @@ public:
|
||||||
FbTk::Subject &reconfigSig() { return m_reconfig_sig; }
|
FbTk::Subject &reconfigSig() { return m_reconfig_sig; }
|
||||||
const FbTk::Subject &reconfigSig() const { return m_reconfig_sig; }
|
const FbTk::Subject &reconfigSig() const { return m_reconfig_sig; }
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const int m_screen_num;
|
const int m_screen_num;
|
||||||
|
|
||||||
|
@ -131,7 +131,7 @@ public:
|
||||||
typedef std::vector<ThemeList> ScreenThemeVector;
|
typedef std::vector<ThemeList> ScreenThemeVector;
|
||||||
|
|
||||||
static ThemeManager &instance();
|
static ThemeManager &instance();
|
||||||
/// load style file "filename" to screen
|
/// load style file "filename" to screen
|
||||||
bool load(const std::string &filename, const std::string &overlay_filename, int screen_num = -1);
|
bool load(const std::string &filename, const std::string &overlay_filename, int screen_num = -1);
|
||||||
std::string resourceValue(const std::string &name, const std::string &altname);
|
std::string resourceValue(const std::string &name, const std::string &altname);
|
||||||
void loadTheme(Theme &tm);
|
void loadTheme(Theme &tm);
|
||||||
|
@ -149,9 +149,9 @@ private:
|
||||||
~ThemeManager() { }
|
~ThemeManager() { }
|
||||||
|
|
||||||
friend class FbTk::Theme; // so only theme can register itself in constructor
|
friend class FbTk::Theme; // so only theme can register itself in constructor
|
||||||
/// @return false if screen_num if out of
|
/// @return false if screen_num if out of
|
||||||
/// range or theme already registered, else true
|
/// range or theme already registered, else true
|
||||||
bool registerTheme(FbTk::Theme &tm);
|
bool registerTheme(FbTk::Theme &tm);
|
||||||
/// @return false if theme isn't registred in the manager
|
/// @return false if theme isn't registred in the manager
|
||||||
bool unregisterTheme(FbTk::Theme &tm);
|
bool unregisterTheme(FbTk::Theme &tm);
|
||||||
/// map each theme manager to a screen
|
/// map each theme manager to a screen
|
||||||
|
@ -167,7 +167,7 @@ private:
|
||||||
|
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
ThemeItem<T>::ThemeItem(FbTk::Theme &tm,
|
ThemeItem<T>::ThemeItem(FbTk::Theme &tm,
|
||||||
const std::string &name, const std::string &altname):
|
const std::string &name, const std::string &altname):
|
||||||
ThemeItem_base(name, altname),
|
ThemeItem_base(name, altname),
|
||||||
m_tm(tm) {
|
m_tm(tm) {
|
||||||
|
|
|
@ -21,9 +21,9 @@
|
||||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
#ifndef FBTK_TIMER_HH
|
#ifndef FBTK_TIMER_HH
|
||||||
#define FBTK_TIMER_HH
|
#define FBTK_TIMER_HH
|
||||||
|
|
||||||
#include "RefCount.hh"
|
#include "RefCount.hh"
|
||||||
#include "Command.hh"
|
#include "Command.hh"
|
||||||
|
@ -52,7 +52,7 @@
|
||||||
namespace FbTk {
|
namespace FbTk {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Handles Timeout
|
Handles Timeout
|
||||||
*/
|
*/
|
||||||
class Timer {
|
class Timer {
|
||||||
public:
|
public:
|
||||||
|
@ -60,7 +60,7 @@ public:
|
||||||
explicit Timer(RefCount<Command> &handler);
|
explicit Timer(RefCount<Command> &handler);
|
||||||
virtual ~Timer();
|
virtual ~Timer();
|
||||||
|
|
||||||
inline void fireOnce(bool once) { m_once = once; }
|
void fireOnce(bool once) { m_once = once; }
|
||||||
/// set timeout
|
/// set timeout
|
||||||
void setTimeout(time_t val);
|
void setTimeout(time_t val);
|
||||||
/// set timeout
|
/// set timeout
|
||||||
|
|
|
@ -30,7 +30,7 @@ namespace FbTk {
|
||||||
|
|
||||||
template <typename Items, typename Item_Type>
|
template <typename Items, typename Item_Type>
|
||||||
class TypeAhead {
|
class TypeAhead {
|
||||||
/*
|
#if 0
|
||||||
|
|
||||||
a class template can't be split into separate interface + implementation files, an interface summary is given here:
|
a class template can't be split into separate interface + implementation files, an interface summary is given here:
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ public:
|
||||||
void init(Items const &items);
|
void init(Items const &items);
|
||||||
|
|
||||||
// accessors:
|
// accessors:
|
||||||
inline int stringSize() const { return m_searchstr.size(); }
|
int stringSize() const { return m_searchstr.size(); }
|
||||||
Items matched() const;
|
Items matched() const;
|
||||||
|
|
||||||
// modifiers:
|
// modifiers:
|
||||||
|
@ -65,7 +65,7 @@ private:
|
||||||
void doSearch(char to_test,
|
void doSearch(char to_test,
|
||||||
BaseItems const &search,
|
BaseItems const &search,
|
||||||
SearchResult &mySearchResult) const;
|
SearchResult &mySearchResult) const;
|
||||||
*/
|
#endif
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef std::vector < ITypeAheadable* > BaseItems;
|
typedef std::vector < ITypeAheadable* > BaseItems;
|
||||||
|
@ -75,7 +75,7 @@ public:
|
||||||
|
|
||||||
void init(Items const &items) { m_ref = &items; }
|
void init(Items const &items) { m_ref = &items; }
|
||||||
|
|
||||||
inline size_t stringSize() const { return m_searchstr.size(); }
|
size_t stringSize() const { return m_searchstr.size(); }
|
||||||
|
|
||||||
void seek() {
|
void seek() {
|
||||||
if (!m_search_results.empty())
|
if (!m_search_results.empty())
|
||||||
|
|
|
@ -63,13 +63,13 @@ public:
|
||||||
enum TabMode { NOTSET = 0, INTERNAL = 1, EXTERNAL };
|
enum TabMode { NOTSET = 0, INTERNAL = 1, EXTERNAL };
|
||||||
|
|
||||||
/// Toolbar placement on the screen
|
/// Toolbar placement on the screen
|
||||||
enum TabPlacement{
|
enum TabPlacement{
|
||||||
// top and bottom placement
|
// top and bottom placement
|
||||||
TOPLEFT = 1, BOTTOMLEFT,
|
TOPLEFT = 1, BOTTOMLEFT,
|
||||||
TOPRIGHT, BOTTOMRIGHT,
|
TOPRIGHT, BOTTOMRIGHT,
|
||||||
// left and right placement
|
// left and right placement
|
||||||
LEFTBOTTOM, LEFTTOP,
|
LEFTBOTTOM, LEFTTOP,
|
||||||
RIGHTBOTTOM, RIGHTTOP
|
RIGHTBOTTOM, RIGHTTOP
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -108,9 +108,9 @@ public:
|
||||||
unsigned int width, unsigned int height);
|
unsigned int width, unsigned int height);
|
||||||
|
|
||||||
/* /// create a frame window inside another FbWindow, NOT IMPLEMENTED!
|
/* /// create a frame window inside another FbWindow, NOT IMPLEMENTED!
|
||||||
FbWinFrame(BScreen &screen, FbWinFrameTheme &theme, FbTk::ImageControl &imgctrl,
|
FbWinFrame(BScreen &screen, FbWinFrameTheme &theme, FbTk::ImageControl &imgctrl,
|
||||||
const FbTk::FbWindow &parent,
|
const FbTk::FbWindow &parent,
|
||||||
int x, int y,
|
int x, int y,
|
||||||
unsigned int width, unsigned int height);
|
unsigned int width, unsigned int height);
|
||||||
*/
|
*/
|
||||||
/// destroy frame
|
/// destroy frame
|
||||||
|
@ -118,7 +118,7 @@ public:
|
||||||
|
|
||||||
void hide();
|
void hide();
|
||||||
void show();
|
void show();
|
||||||
inline bool isVisible() const { return m_visible; }
|
bool isVisible() const { return m_visible; }
|
||||||
/// shade frame (ie resize to titlebar size)
|
/// shade frame (ie resize to titlebar size)
|
||||||
void shade();
|
void shade();
|
||||||
void move(int x, int y);
|
void move(int x, int y);
|
||||||
|
@ -127,17 +127,17 @@ public:
|
||||||
void resizeForClient(unsigned int width, unsigned int height, int win_gravity=ForgetGravity, unsigned int client_bw = 0);
|
void resizeForClient(unsigned int width, unsigned int height, int win_gravity=ForgetGravity, unsigned int client_bw = 0);
|
||||||
|
|
||||||
// for when there needs to be an atomic move+resize operation
|
// for when there needs to be an atomic move+resize operation
|
||||||
void moveResizeForClient(int x, int y,
|
void moveResizeForClient(int x, int y,
|
||||||
unsigned int width, unsigned int height,
|
unsigned int width, unsigned int height,
|
||||||
int win_gravity=ForgetGravity, unsigned int client_bw = 0, bool move = true, bool resize = true);
|
int win_gravity=ForgetGravity, unsigned int client_bw = 0, bool move = true, bool resize = true);
|
||||||
|
|
||||||
// can elect to ignore move or resize (mainly for use of move/resize individual functions
|
// can elect to ignore move or resize (mainly for use of move/resize individual functions
|
||||||
void moveResize(int x, int y,
|
void moveResize(int x, int y,
|
||||||
unsigned int width, unsigned int height,
|
unsigned int width, unsigned int height,
|
||||||
bool move = true, bool resize = true);
|
bool move = true, bool resize = true);
|
||||||
|
|
||||||
// move without transparency or special effects (generally when dragging)
|
// move without transparency or special effects (generally when dragging)
|
||||||
void quietMoveResize(int x, int y,
|
void quietMoveResize(int x, int y,
|
||||||
unsigned int width, unsigned int height);
|
unsigned int width, unsigned int height);
|
||||||
|
|
||||||
/// some outside move/resize happened, and we need to notify all of our windows
|
/// some outside move/resize happened, and we need to notify all of our windows
|
||||||
|
@ -147,9 +147,9 @@ public:
|
||||||
|
|
||||||
/// set focus/unfocus style
|
/// set focus/unfocus style
|
||||||
void setFocus(bool newvalue);
|
void setFocus(bool newvalue);
|
||||||
inline void setFocusTitle(const std::string &str) { m_label.setText(str); }
|
void setFocusTitle(const std::string &str) { m_label.setText(str); }
|
||||||
bool setTabMode(TabMode tabmode);
|
bool setTabMode(TabMode tabmode);
|
||||||
inline void updateTabProperties() { alignTabs(); }
|
void updateTabProperties() { alignTabs(); }
|
||||||
|
|
||||||
/// Alpha settings
|
/// Alpha settings
|
||||||
void setAlpha(bool focused, unsigned char value);
|
void setAlpha(bool focused, unsigned char value);
|
||||||
|
@ -215,7 +215,7 @@ public:
|
||||||
void configureNotifyEvent(XConfigureEvent &event);
|
void configureNotifyEvent(XConfigureEvent &event);
|
||||||
void handleEvent(XEvent &event);
|
void handleEvent(XEvent &event);
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
void reconfigure();
|
void reconfigure();
|
||||||
void setUseShape(bool value);
|
void setUseShape(bool value);
|
||||||
void setShapingClient(FbTk::FbWindow *win, bool always_update);
|
void setShapingClient(FbTk::FbWindow *win, bool always_update);
|
||||||
|
@ -225,10 +225,10 @@ public:
|
||||||
@name accessors
|
@name accessors
|
||||||
*/
|
*/
|
||||||
//@{
|
//@{
|
||||||
inline int x() const { return m_window.x(); }
|
int x() const { return m_window.x(); }
|
||||||
inline int y() const { return m_window.y(); }
|
int y() const { return m_window.y(); }
|
||||||
inline unsigned int width() const { return m_window.width(); }
|
unsigned int width() const { return m_window.width(); }
|
||||||
inline unsigned int height() const { return m_window.height(); }
|
unsigned int height() const { return m_window.height(); }
|
||||||
unsigned int normalHeight() const;
|
unsigned int normalHeight() const;
|
||||||
|
|
||||||
// extra bits for tabs
|
// extra bits for tabs
|
||||||
|
@ -237,31 +237,31 @@ public:
|
||||||
int widthOffset() const;
|
int widthOffset() const;
|
||||||
int heightOffset() const;
|
int heightOffset() const;
|
||||||
|
|
||||||
inline const FbTk::FbWindow &window() const { return m_window; }
|
const FbTk::FbWindow &window() const { return m_window; }
|
||||||
inline FbTk::FbWindow &window() { return m_window; }
|
FbTk::FbWindow &window() { return m_window; }
|
||||||
/// @return titlebar window
|
/// @return titlebar window
|
||||||
inline const FbTk::FbWindow &titlebar() const { return m_titlebar; }
|
const FbTk::FbWindow &titlebar() const { return m_titlebar; }
|
||||||
inline FbTk::FbWindow &titlebar() { return m_titlebar; }
|
FbTk::FbWindow &titlebar() { return m_titlebar; }
|
||||||
inline const FbTk::FbWindow &label() const { return m_label; }
|
const FbTk::FbWindow &label() const { return m_label; }
|
||||||
inline FbTk::FbWindow &label() { return m_label; }
|
FbTk::FbWindow &label() { return m_label; }
|
||||||
|
|
||||||
|
const FbTk::Container &tabcontainer() const { return m_tab_container; }
|
||||||
|
FbTk::Container &tabcontainer() { return m_tab_container; }
|
||||||
|
|
||||||
inline const FbTk::Container &tabcontainer() const { return m_tab_container; }
|
|
||||||
inline FbTk::Container &tabcontainer() { return m_tab_container; }
|
|
||||||
|
|
||||||
/// @return clientarea window
|
/// @return clientarea window
|
||||||
inline const FbTk::FbWindow &clientArea() const { return m_clientarea; }
|
const FbTk::FbWindow &clientArea() const { return m_clientarea; }
|
||||||
inline FbTk::FbWindow &clientArea() { return m_clientarea; }
|
FbTk::FbWindow &clientArea() { return m_clientarea; }
|
||||||
/// @return handle window
|
/// @return handle window
|
||||||
inline const FbTk::FbWindow &handle() const { return m_handle; }
|
const FbTk::FbWindow &handle() const { return m_handle; }
|
||||||
inline FbTk::FbWindow &handle() { return m_handle; }
|
FbTk::FbWindow &handle() { return m_handle; }
|
||||||
inline const FbTk::FbWindow &gripLeft() const { return m_grip_left; }
|
const FbTk::FbWindow &gripLeft() const { return m_grip_left; }
|
||||||
inline FbTk::FbWindow &gripLeft() { return m_grip_left; }
|
FbTk::FbWindow &gripLeft() { return m_grip_left; }
|
||||||
inline const FbTk::FbWindow &gripRight() const { return m_grip_right; }
|
const FbTk::FbWindow &gripRight() const { return m_grip_right; }
|
||||||
inline FbTk::FbWindow &gripRight() { return m_grip_right; }
|
FbTk::FbWindow &gripRight() { return m_grip_right; }
|
||||||
inline const IconButton *currentLabel() const { return m_current_label; }
|
const IconButton *currentLabel() const { return m_current_label; }
|
||||||
inline bool focused() const { return m_focused; }
|
bool focused() const { return m_focused; }
|
||||||
inline bool isShaded() const { return m_shaded; }
|
bool isShaded() const { return m_shaded; }
|
||||||
inline FbWinFrameTheme &theme() const { return m_theme; }
|
FbWinFrameTheme &theme() const { return m_theme; }
|
||||||
/// @return titlebar height
|
/// @return titlebar height
|
||||||
unsigned int titlebarHeight() const { return (m_use_titlebar?m_titlebar.height()+m_window.borderWidth():0); }
|
unsigned int titlebarHeight() const { return (m_use_titlebar?m_titlebar.height()+m_window.borderWidth():0); }
|
||||||
unsigned int handleHeight() const { return (m_use_handle?m_handle.height()+m_window.borderWidth():0); }
|
unsigned int handleHeight() const { return (m_use_handle?m_handle.height()+m_window.borderWidth():0); }
|
||||||
|
@ -269,8 +269,8 @@ public:
|
||||||
unsigned int buttonHeight() const;
|
unsigned int buttonHeight() const;
|
||||||
bool externalTabMode() const { return m_tabmode == EXTERNAL && m_use_tabs; }
|
bool externalTabMode() const { return m_tabmode == EXTERNAL && m_use_tabs; }
|
||||||
|
|
||||||
inline const FbTk::XLayerItem &layerItem() const { return m_layeritem; }
|
const FbTk::XLayerItem &layerItem() const { return m_layeritem; }
|
||||||
inline FbTk::XLayerItem &layerItem() { return m_layeritem; }
|
FbTk::XLayerItem &layerItem() { return m_layeritem; }
|
||||||
|
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
|
@ -320,7 +320,7 @@ private:
|
||||||
|
|
||||||
BScreen &m_screen;
|
BScreen &m_screen;
|
||||||
|
|
||||||
FbWinFrameTheme &m_theme; ///< theme to be used
|
FbWinFrameTheme &m_theme; ///< theme to be used
|
||||||
FbTk::ImageControl &m_imagectrl; ///< Image control for rendering
|
FbTk::ImageControl &m_imagectrl; ///< Image control for rendering
|
||||||
/**
|
/**
|
||||||
@name windows
|
@name windows
|
||||||
|
@ -373,9 +373,9 @@ private:
|
||||||
|
|
||||||
FbTk::Color m_handle_focused_color, m_handle_unfocused_color;
|
FbTk::Color m_handle_focused_color, m_handle_unfocused_color;
|
||||||
Pixmap m_handle_focused_pm, m_handle_unfocused_pm;
|
Pixmap m_handle_focused_pm, m_handle_unfocused_pm;
|
||||||
|
|
||||||
|
|
||||||
Pixmap m_button_pm; ///< normal button
|
|
||||||
|
Pixmap m_button_pm; ///< normal button
|
||||||
FbTk::Color m_button_color; ///< normal color button
|
FbTk::Color m_button_color; ///< normal color button
|
||||||
Pixmap m_button_unfocused_pm; ///< unfocused button
|
Pixmap m_button_unfocused_pm; ///< unfocused button
|
||||||
FbTk::Color m_button_unfocused_color; ///< unfocused color button
|
FbTk::Color m_button_unfocused_color; ///< unfocused color button
|
||||||
|
|
|
@ -52,7 +52,7 @@ public:
|
||||||
|
|
||||||
const FbTk::Texture &buttonFocusTexture() const { return *m_button_focus; }
|
const FbTk::Texture &buttonFocusTexture() const { return *m_button_focus; }
|
||||||
const FbTk::Texture &buttonUnfocusTexture() const { return *m_button_unfocus; }
|
const FbTk::Texture &buttonUnfocusTexture() const { return *m_button_unfocus; }
|
||||||
const FbTk::Texture &buttonPressedTexture() const { return *m_button_pressed; }
|
const FbTk::Texture &buttonPressedTexture() const { return *m_button_pressed; }
|
||||||
|
|
||||||
const FbTk::Texture &gripFocusTexture() const { return *m_grip_focus; }
|
const FbTk::Texture &gripFocusTexture() const { return *m_grip_focus; }
|
||||||
const FbTk::Texture &gripUnfocusTexture() const { return *m_grip_unfocus; }
|
const FbTk::Texture &gripUnfocusTexture() const { return *m_grip_unfocus; }
|
||||||
|
@ -73,18 +73,18 @@ public:
|
||||||
bool fallback(FbTk::ThemeItem_base &item);
|
bool fallback(FbTk::ThemeItem_base &item);
|
||||||
void reconfigTheme();
|
void reconfigTheme();
|
||||||
|
|
||||||
inline Cursor moveCursor() const { return m_cursor_move; }
|
Cursor moveCursor() const { return m_cursor_move; }
|
||||||
inline Cursor lowerLeftAngleCursor() const { return m_cursor_lower_left_angle; }
|
Cursor lowerLeftAngleCursor() const { return m_cursor_lower_left_angle; }
|
||||||
inline Cursor lowerRightAngleCursor() const { return m_cursor_lower_right_angle; }
|
Cursor lowerRightAngleCursor() const { return m_cursor_lower_right_angle; }
|
||||||
inline Cursor upperLeftAngleCursor() const { return m_cursor_upper_left_angle; }
|
Cursor upperLeftAngleCursor() const { return m_cursor_upper_left_angle; }
|
||||||
inline Cursor upperRightAngleCursor() const { return m_cursor_upper_right_angle; }
|
Cursor upperRightAngleCursor() const { return m_cursor_upper_right_angle; }
|
||||||
inline Cursor leftSideCursor() const { return m_cursor_left_side; }
|
Cursor leftSideCursor() const { return m_cursor_left_side; }
|
||||||
inline Cursor rightSideCursor() const { return m_cursor_right_side; }
|
Cursor rightSideCursor() const { return m_cursor_right_side; }
|
||||||
inline Cursor topSideCursor() const { return m_cursor_top_side; }
|
Cursor topSideCursor() const { return m_cursor_top_side; }
|
||||||
inline Cursor bottomSideCursor() const { return m_cursor_bottom_side; }
|
Cursor bottomSideCursor() const { return m_cursor_bottom_side; }
|
||||||
|
|
||||||
inline FbTk::Shape::ShapePlace shapePlace() const { return *m_shape_place; }
|
FbTk::Shape::ShapePlace shapePlace() const { return *m_shape_place; }
|
||||||
inline const FbTk::BorderTheme &border(bool focus) const { return (focus ? m_border_focus : m_border_unfocus); }
|
const FbTk::BorderTheme &border(bool focus) const { return (focus ? m_border_focus : m_border_unfocus); }
|
||||||
|
|
||||||
unsigned int titleHeight() const { return *m_title_height; }
|
unsigned int titleHeight() const { return *m_title_height; }
|
||||||
unsigned int bevelWidth() const { return *m_bevel_width; }
|
unsigned int bevelWidth() const { return *m_bevel_width; }
|
||||||
|
@ -104,7 +104,7 @@ private:
|
||||||
FbTk::ThemeItem<FbTk::Texture> m_grip_focus, m_grip_unfocus;
|
FbTk::ThemeItem<FbTk::Texture> m_grip_focus, m_grip_unfocus;
|
||||||
|
|
||||||
FbTk::ThemeItem<FbTk::Color> m_button_focus_color, m_button_unfocus_color;
|
FbTk::ThemeItem<FbTk::Color> m_button_focus_color, m_button_unfocus_color;
|
||||||
|
|
||||||
FbTk::ThemeItem<FbTk::Font> m_font;
|
FbTk::ThemeItem<FbTk::Font> m_font;
|
||||||
FbTk::ThemeItem<FbTk::Shape::ShapePlace> m_shape_place;
|
FbTk::ThemeItem<FbTk::Shape::ShapePlace> m_shape_place;
|
||||||
|
|
||||||
|
|
|
@ -69,27 +69,27 @@ public:
|
||||||
virtual bool acceptsFocus() const { return true; }
|
virtual bool acceptsFocus() const { return true; }
|
||||||
|
|
||||||
/// @return true if icon button should appear focused
|
/// @return true if icon button should appear focused
|
||||||
inline bool getAttentionState() const { return m_attention_state; }
|
bool getAttentionState() const { return m_attention_state; }
|
||||||
/// @set the attention state
|
/// @set the attention state
|
||||||
virtual void setAttentionState(bool value) {
|
virtual void setAttentionState(bool value) {
|
||||||
m_attention_state = value; attentionSig().notify();
|
m_attention_state = value; attentionSig().notify();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @return the screen in which this object resides
|
/// @return the screen in which this object resides
|
||||||
inline BScreen &screen() { return m_screen; }
|
BScreen &screen() { return m_screen; }
|
||||||
/// @return the screen in which this object resides
|
/// @return the screen in which this object resides
|
||||||
inline const BScreen &screen() const { return m_screen; }
|
const BScreen &screen() const { return m_screen; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* For accessing window properties, like shaded, minimized, etc.
|
* For accessing window properties, like shaded, minimized, etc.
|
||||||
* @return window context
|
* @return window context
|
||||||
*/
|
*/
|
||||||
inline const FluxboxWindow *fbwindow() const { return m_fbwin; }
|
const FluxboxWindow *fbwindow() const { return m_fbwin; }
|
||||||
/**
|
/**
|
||||||
* For accessing window properties, like shaded, minimized, etc.
|
* For accessing window properties, like shaded, minimized, etc.
|
||||||
* @return window context
|
* @return window context
|
||||||
*/
|
*/
|
||||||
inline FluxboxWindow *fbwindow() { return m_fbwin; }
|
FluxboxWindow *fbwindow() { return m_fbwin; }
|
||||||
|
|
||||||
/// @return WM_CLASS class string (for pattern matching)
|
/// @return WM_CLASS class string (for pattern matching)
|
||||||
virtual const std::string &getWMClassClass() const { return m_class_name; }
|
virtual const std::string &getWMClassClass() const { return m_class_name; }
|
||||||
|
|
|
@ -48,57 +48,57 @@ class Application {
|
||||||
public:
|
public:
|
||||||
Application(bool grouped, ClientPattern *pat = 0);
|
Application(bool grouped, ClientPattern *pat = 0);
|
||||||
void reset();
|
void reset();
|
||||||
inline void forgetWorkspace() { workspace_remember = false; }
|
void forgetWorkspace() { workspace_remember = false; }
|
||||||
inline void forgetHead() { head_remember = false; }
|
void forgetHead() { head_remember = false; }
|
||||||
inline void forgetDimensions() { dimensions_remember = false; }
|
void forgetDimensions() { dimensions_remember = false; }
|
||||||
inline void forgetPosition() { position_remember = false; }
|
void forgetPosition() { position_remember = false; }
|
||||||
inline void forgetShadedstate() { shadedstate_remember = false; }
|
void forgetShadedstate() { shadedstate_remember = false; }
|
||||||
inline void forgetTabstate() { tabstate_remember = false; }
|
void forgetTabstate() { tabstate_remember = false; }
|
||||||
inline void forgetDecostate() { decostate_remember = false; }
|
void forgetDecostate() { decostate_remember = false; }
|
||||||
inline void forgetFocusHiddenstate() { focushiddenstate_remember= false; }
|
void forgetFocusHiddenstate() { focushiddenstate_remember= false; }
|
||||||
inline void forgetIconHiddenstate() { iconhiddenstate_remember= false; }
|
void forgetIconHiddenstate() { iconhiddenstate_remember= false; }
|
||||||
inline void forgetStuckstate() { stuckstate_remember = false; }
|
void forgetStuckstate() { stuckstate_remember = false; }
|
||||||
inline void forgetJumpworkspace() { jumpworkspace_remember = false; }
|
void forgetJumpworkspace() { jumpworkspace_remember = false; }
|
||||||
inline void forgetLayer() { layer_remember = false; }
|
void forgetLayer() { layer_remember = false; }
|
||||||
inline void forgetSaveOnClose() { save_on_close_remember = false; }
|
void forgetSaveOnClose() { save_on_close_remember = false; }
|
||||||
inline void forgetAlpha() { alpha_remember = false; }
|
void forgetAlpha() { alpha_remember = false; }
|
||||||
inline void forgetMinimizedstate() { minimizedstate_remember = false; }
|
void forgetMinimizedstate() { minimizedstate_remember = false; }
|
||||||
inline void forgetMaximizedstate() { maximizedstate_remember = false; }
|
void forgetMaximizedstate() { maximizedstate_remember = false; }
|
||||||
inline void forgetFullscreenstate() { fullscreenstate_remember = false; }
|
void forgetFullscreenstate() { fullscreenstate_remember = false; }
|
||||||
|
|
||||||
inline void rememberWorkspace(int ws)
|
void rememberWorkspace(int ws)
|
||||||
{ workspace = ws; workspace_remember = true; }
|
{ workspace = ws; workspace_remember = true; }
|
||||||
inline void rememberHead(int h)
|
void rememberHead(int h)
|
||||||
{ head = h; head_remember = true; }
|
{ head = h; head_remember = true; }
|
||||||
inline void rememberDimensions(int width, int height)
|
void rememberDimensions(int width, int height)
|
||||||
{ w = width; h = height; dimensions_remember = true; }
|
{ w = width; h = height; dimensions_remember = true; }
|
||||||
inline void rememberFocusHiddenstate(bool state)
|
void rememberFocusHiddenstate(bool state)
|
||||||
{ focushiddenstate= state; focushiddenstate_remember= true; }
|
{ focushiddenstate= state; focushiddenstate_remember= true; }
|
||||||
inline void rememberIconHiddenstate(bool state)
|
void rememberIconHiddenstate(bool state)
|
||||||
{ iconhiddenstate= state; iconhiddenstate_remember= true; }
|
{ iconhiddenstate= state; iconhiddenstate_remember= true; }
|
||||||
inline void rememberPosition(int posx, int posy, unsigned char rfc= 0 )
|
void rememberPosition(int posx, int posy, unsigned char rfc= 0 )
|
||||||
{ x = posx; y = posy; refc = rfc; position_remember = true; }
|
{ x = posx; y = posy; refc = rfc; position_remember = true; }
|
||||||
inline void rememberShadedstate(bool state)
|
void rememberShadedstate(bool state)
|
||||||
{ shadedstate = state; shadedstate_remember = true; }
|
{ shadedstate = state; shadedstate_remember = true; }
|
||||||
inline void rememberTabstate(bool state)
|
void rememberTabstate(bool state)
|
||||||
{ tabstate = state; tabstate_remember = true; }
|
{ tabstate = state; tabstate_remember = true; }
|
||||||
inline void rememberDecostate(unsigned int state)
|
void rememberDecostate(unsigned int state)
|
||||||
{ decostate = state; decostate_remember = true; }
|
{ decostate = state; decostate_remember = true; }
|
||||||
inline void rememberStuckstate(bool state)
|
void rememberStuckstate(bool state)
|
||||||
{ stuckstate = state; stuckstate_remember = true; }
|
{ stuckstate = state; stuckstate_remember = true; }
|
||||||
inline void rememberJumpworkspace(bool state)
|
void rememberJumpworkspace(bool state)
|
||||||
{ jumpworkspace = state; jumpworkspace_remember = true; }
|
{ jumpworkspace = state; jumpworkspace_remember = true; }
|
||||||
inline void rememberLayer(int layernum)
|
void rememberLayer(int layernum)
|
||||||
{ layer = layernum; layer_remember = true; }
|
{ layer = layernum; layer_remember = true; }
|
||||||
inline void rememberSaveOnClose(bool state)
|
void rememberSaveOnClose(bool state)
|
||||||
{ save_on_close = state; save_on_close_remember = true; }
|
{ save_on_close = state; save_on_close_remember = true; }
|
||||||
inline void rememberAlpha(int focused_a, int unfocused_a)
|
void rememberAlpha(int focused_a, int unfocused_a)
|
||||||
{ focused_alpha = focused_a; unfocused_alpha = unfocused_a; alpha_remember = true; }
|
{ focused_alpha = focused_a; unfocused_alpha = unfocused_a; alpha_remember = true; }
|
||||||
inline void rememberMinimizedstate(bool state)
|
void rememberMinimizedstate(bool state)
|
||||||
{ minimizedstate = state; minimizedstate_remember = true; }
|
{ minimizedstate = state; minimizedstate_remember = true; }
|
||||||
inline void rememberMaximizedstate(int state)
|
void rememberMaximizedstate(int state)
|
||||||
{ maximizedstate = state; maximizedstate_remember = true; }
|
{ maximizedstate = state; maximizedstate_remember = true; }
|
||||||
inline void rememberFullscreenstate(bool state)
|
void rememberFullscreenstate(bool state)
|
||||||
{ fullscreenstate = state; fullscreenstate_remember = true; }
|
{ fullscreenstate = state; fullscreenstate_remember = true; }
|
||||||
|
|
||||||
bool workspace_remember;
|
bool workspace_remember;
|
||||||
|
|
|
@ -24,8 +24,8 @@
|
||||||
|
|
||||||
// $Id$
|
// $Id$
|
||||||
|
|
||||||
#ifndef SCREEN_HH
|
#ifndef SCREEN_HH
|
||||||
#define SCREEN_HH
|
#define SCREEN_HH
|
||||||
|
|
||||||
#include "FbWinFrame.hh"
|
#include "FbWinFrame.hh"
|
||||||
#include "FbRootWindow.hh"
|
#include "FbRootWindow.hh"
|
||||||
|
@ -83,11 +83,11 @@ class BScreen: public FbTk::EventHandler, public FbTk::Observer,
|
||||||
private FbTk::NotCopyable {
|
private FbTk::NotCopyable {
|
||||||
public:
|
public:
|
||||||
/// a window becomes active / focussed on a different workspace
|
/// a window becomes active / focussed on a different workspace
|
||||||
enum FollowModel {
|
enum FollowModel {
|
||||||
IGNORE_OTHER_WORKSPACES = 0, ///< who cares?
|
IGNORE_OTHER_WORKSPACES = 0, ///< who cares?
|
||||||
FOLLOW_ACTIVE_WINDOW, ///< go to that workspace
|
FOLLOW_ACTIVE_WINDOW, ///< go to that workspace
|
||||||
SEMIFOLLOW_ACTIVE_WINDOW, ///< fetch iconified windows, else follow
|
SEMIFOLLOW_ACTIVE_WINDOW, ///< fetch iconified windows, else follow
|
||||||
FETCH_ACTIVE_WINDOW ///< put that window to the current workspace
|
FETCH_ACTIVE_WINDOW ///< put that window to the current workspace
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -129,41 +129,41 @@ public:
|
||||||
FbTk::Menu &windowMenu() { return *m_windowmenu.get(); }
|
FbTk::Menu &windowMenu() { return *m_windowmenu.get(); }
|
||||||
ExtraMenus &extraWindowMenus() { return m_extramenus; }
|
ExtraMenus &extraWindowMenus() { return m_extramenus; }
|
||||||
const ExtraMenus &extraWindowMenus() const { return m_extramenus; }
|
const ExtraMenus &extraWindowMenus() const { return m_extramenus; }
|
||||||
|
|
||||||
FbWinFrame::TabPlacement getTabPlacement() const { return *resource.tab_placement; }
|
FbWinFrame::TabPlacement getTabPlacement() const { return *resource.tab_placement; }
|
||||||
|
|
||||||
inline unsigned int noFocusWhileTypingDelay() const { return *resource.typing_delay; }
|
unsigned int noFocusWhileTypingDelay() const { return *resource.typing_delay; }
|
||||||
inline FollowModel getFollowModel() const { return *resource.follow_model; }
|
FollowModel getFollowModel() const { return *resource.follow_model; }
|
||||||
inline FollowModel getUserFollowModel() const { return *resource.user_follow_model; }
|
FollowModel getUserFollowModel() const { return *resource.user_follow_model; }
|
||||||
|
|
||||||
inline const std::string &getScrollAction() const { return *resource.scroll_action; }
|
const std::string &getScrollAction() const { return *resource.scroll_action; }
|
||||||
inline const bool getScrollReverse() const { return *resource.scroll_reverse; }
|
const bool getScrollReverse() const { return *resource.scroll_reverse; }
|
||||||
inline const bool allowRemoteActions() const { return *resource.allow_remote_actions; }
|
const bool allowRemoteActions() const { return *resource.allow_remote_actions; }
|
||||||
inline const bool clientMenuUsePixmap() const { return *resource.clientmenu_use_pixmap; }
|
const bool clientMenuUsePixmap() const { return *resource.clientmenu_use_pixmap; }
|
||||||
inline const bool getDefaultInternalTabs() const { return *resource.default_internal_tabs; }
|
const bool getDefaultInternalTabs() const { return *resource.default_internal_tabs; }
|
||||||
inline const bool getTabsUsePixmap() const { return *resource.tabs_use_pixmap; }
|
const bool getTabsUsePixmap() const { return *resource.tabs_use_pixmap; }
|
||||||
inline const bool getMaxOverTabs() const { return *resource.max_over_tabs; }
|
const bool getMaxOverTabs() const { return *resource.max_over_tabs; }
|
||||||
|
|
||||||
inline unsigned int getTabWidth() const { return *resource.tab_width; }
|
unsigned int getTabWidth() const { return *resource.tab_width; }
|
||||||
/// @return the slit, @see Slit
|
/// @return the slit, @see Slit
|
||||||
inline Slit *slit() { return m_slit.get(); }
|
Slit *slit() { return m_slit.get(); }
|
||||||
/// @return the slit, @see Slit
|
/// @return the slit, @see Slit
|
||||||
inline const Slit *slit() const { return m_slit.get(); }
|
const Slit *slit() const { return m_slit.get(); }
|
||||||
/**
|
/**
|
||||||
* @param w the workspace number
|
* @param w the workspace number
|
||||||
* @return workspace for the given workspace number
|
* @return workspace for the given workspace number
|
||||||
*/
|
*/
|
||||||
inline Workspace *getWorkspace(unsigned int w) { return ( w < m_workspaces_list.size() ? m_workspaces_list[w] : 0); }
|
Workspace *getWorkspace(unsigned int w) { return ( w < m_workspaces_list.size() ? m_workspaces_list[w] : 0); }
|
||||||
/**
|
/**
|
||||||
* @param w the workspace number
|
* @param w the workspace number
|
||||||
* @return workspace for the given workspace number
|
* @return workspace for the given workspace number
|
||||||
*/
|
*/
|
||||||
inline const Workspace *getWorkspace(unsigned int w) const {
|
const Workspace *getWorkspace(unsigned int w) const {
|
||||||
return (w < m_workspaces_list.size() ? m_workspaces_list[w] : 0);
|
return (w < m_workspaces_list.size() ? m_workspaces_list[w] : 0);
|
||||||
}
|
}
|
||||||
/// @return the current workspace
|
/// @return the current workspace
|
||||||
inline Workspace *currentWorkspace() { return m_current_workspace; }
|
Workspace *currentWorkspace() { return m_current_workspace; }
|
||||||
inline const Workspace *currentWorkspace() const { return m_current_workspace; }
|
const Workspace *currentWorkspace() const { return m_current_workspace; }
|
||||||
/// @return the workspace menu
|
/// @return the workspace menu
|
||||||
const FbTk::Menu &workspaceMenu() const { return *m_workspacemenu.get(); }
|
const FbTk::Menu &workspaceMenu() const { return *m_workspacemenu.get(); }
|
||||||
/// @return the workspace menu
|
/// @return the workspace menu
|
||||||
|
@ -211,12 +211,12 @@ public:
|
||||||
*/
|
*/
|
||||||
//@{
|
//@{
|
||||||
/// client list signal
|
/// client list signal
|
||||||
FbTk::Subject &clientListSig() { return m_clientlist_sig; }
|
FbTk::Subject &clientListSig() { return m_clientlist_sig; }
|
||||||
/// icon list sig
|
/// icon list sig
|
||||||
FbTk::Subject &iconListSig() { return m_iconlist_sig; }
|
FbTk::Subject &iconListSig() { return m_iconlist_sig; }
|
||||||
/// workspace count signal
|
/// workspace count signal
|
||||||
FbTk::Subject &workspaceCountSig() { return m_workspacecount_sig; }
|
FbTk::Subject &workspaceCountSig() { return m_workspacecount_sig; }
|
||||||
/// workspace names signal
|
/// workspace names signal
|
||||||
FbTk::Subject &workspaceNamesSig() { return m_workspacenames_sig; }
|
FbTk::Subject &workspaceNamesSig() { return m_workspacenames_sig; }
|
||||||
/// workspace area signal
|
/// workspace area signal
|
||||||
FbTk::Subject &workspaceAreaSig() { return m_workspace_area_sig; }
|
FbTk::Subject &workspaceAreaSig() { return m_workspace_area_sig; }
|
||||||
|
@ -260,14 +260,14 @@ public:
|
||||||
*/
|
*/
|
||||||
FbTk::Menu *createToggleMenu(const std::string &label);
|
FbTk::Menu *createToggleMenu(const std::string &label);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* For extras to add menus.
|
* For extras to add menus.
|
||||||
* These menus will be marked internal,
|
* These menus will be marked internal,
|
||||||
* and deleted when the window dies (as opposed to Screen
|
* and deleted when the window dies (as opposed to Screen
|
||||||
*/
|
*/
|
||||||
void addExtraWindowMenu(const FbTk::FbString &label, FbTk::Menu *menu);
|
void addExtraWindowMenu(const FbTk::FbString &label, FbTk::Menu *menu);
|
||||||
|
|
||||||
inline int getEdgeSnapThreshold() const { return *resource.edge_snap_threshold; }
|
int getEdgeSnapThreshold() const { return *resource.edge_snap_threshold; }
|
||||||
|
|
||||||
void setRootColormapInstalled(bool r) { root_colormap_installed = r; }
|
void setRootColormapInstalled(bool r) { root_colormap_installed = r; }
|
||||||
|
|
||||||
|
@ -302,7 +302,7 @@ public:
|
||||||
|
|
||||||
ScreenPlacement &placementStrategy() { return *m_placement_strategy; }
|
ScreenPlacement &placementStrategy() { return *m_placement_strategy; }
|
||||||
const ScreenPlacement &placementStrategy() const { return *m_placement_strategy; }
|
const ScreenPlacement &placementStrategy() const { return *m_placement_strategy; }
|
||||||
|
|
||||||
int addWorkspace();
|
int addWorkspace();
|
||||||
int removeLastWorkspace();
|
int removeLastWorkspace();
|
||||||
// scroll workspaces
|
// scroll workspaces
|
||||||
|
@ -333,7 +333,7 @@ public:
|
||||||
|
|
||||||
/// update workspace name for given workspace
|
/// update workspace name for given workspace
|
||||||
void updateWorkspaceName(unsigned int w);
|
void updateWorkspaceName(unsigned int w);
|
||||||
/// remove all workspace names
|
/// remove all workspace names
|
||||||
void removeWorkspaceNames();
|
void removeWorkspaceNames();
|
||||||
/// update the workspace name atom
|
/// update the workspace name atom
|
||||||
void updateWorkspaceNamesAtom();
|
void updateWorkspaceNamesAtom();
|
||||||
|
@ -361,7 +361,7 @@ public:
|
||||||
* @param win the window to send
|
* @param win the window to send
|
||||||
* @param changeworkspace whether current workspace should change
|
* @param changeworkspace whether current workspace should change
|
||||||
*/
|
*/
|
||||||
void sendToWorkspace(unsigned int workspace, FluxboxWindow *win=0,
|
void sendToWorkspace(unsigned int workspace, FluxboxWindow *win=0,
|
||||||
bool changeworkspace=true);
|
bool changeworkspace=true);
|
||||||
/**
|
/**
|
||||||
* Reassociate a window to another workspace
|
* Reassociate a window to another workspace
|
||||||
|
@ -369,12 +369,12 @@ public:
|
||||||
* @param workspace_id id of the workspace
|
* @param workspace_id id of the workspace
|
||||||
* @param ignore_sticky ignores any sticky windows
|
* @param ignore_sticky ignores any sticky windows
|
||||||
*/
|
*/
|
||||||
void reassociateWindow(FluxboxWindow *window, unsigned int workspace_id,
|
void reassociateWindow(FluxboxWindow *window, unsigned int workspace_id,
|
||||||
bool ignore_sticky);
|
bool ignore_sticky);
|
||||||
|
|
||||||
|
|
||||||
void reconfigure();
|
void reconfigure();
|
||||||
void reconfigureTabs();
|
void reconfigureTabs();
|
||||||
void rereadMenu();
|
void rereadMenu();
|
||||||
void shutdown();
|
void shutdown();
|
||||||
/// show position window centered on the screen with "X x Y" text
|
/// show position window centered on the screen with "X x Y" text
|
||||||
|
@ -383,11 +383,11 @@ public:
|
||||||
/// show geomentry with "width x height"-text, not size of window
|
/// show geomentry with "width x height"-text, not size of window
|
||||||
void showGeometry(int width, int height);
|
void showGeometry(int width, int height);
|
||||||
void hideGeometry();
|
void hideGeometry();
|
||||||
|
|
||||||
void setLayer(FbTk::XLayerItem &item, int layernum);
|
void setLayer(FbTk::XLayerItem &item, int layernum);
|
||||||
// remove? no, items are never removed from their layer until they die
|
// remove? no, items are never removed from their layer until they die
|
||||||
|
|
||||||
/// updates root window size and resizes/reconfigures screen clients
|
/// updates root window size and resizes/reconfigures screen clients
|
||||||
/// that depends on screen size (slit)
|
/// that depends on screen size (slit)
|
||||||
/// (and maximized windows?)
|
/// (and maximized windows?)
|
||||||
void updateSize();
|
void updateSize();
|
||||||
|
@ -428,7 +428,7 @@ public:
|
||||||
template <typename OnHeadObject>
|
template <typename OnHeadObject>
|
||||||
int getOnHead(OnHeadObject &obj) const;
|
int getOnHead(OnHeadObject &obj) const;
|
||||||
|
|
||||||
// grouping - we want ordering, so we can either search for a
|
// grouping - we want ordering, so we can either search for a
|
||||||
// group to the left, or to the right (they'll be different if
|
// group to the left, or to the right (they'll be different if
|
||||||
// they exist).
|
// they exist).
|
||||||
WinClient *findGroupLeft(WinClient &winclient);
|
WinClient *findGroupLeft(WinClient &winclient);
|
||||||
|
@ -441,7 +441,7 @@ public:
|
||||||
/// request workspace space, i.e "don't maximize over this area"
|
/// request workspace space, i.e "don't maximize over this area"
|
||||||
Strut *requestStrut(int head, int left, int right, int top, int bottom);
|
Strut *requestStrut(int head, int left, int right, int top, int bottom);
|
||||||
/// remove requested space and destroy strut
|
/// remove requested space and destroy strut
|
||||||
void clearStrut(Strut *strut);
|
void clearStrut(Strut *strut);
|
||||||
/// updates max avaible area for the workspace
|
/// updates max avaible area for the workspace
|
||||||
void updateAvailableWorkspaceArea();
|
void updateAvailableWorkspaceArea();
|
||||||
|
|
||||||
|
@ -477,20 +477,20 @@ private:
|
||||||
|
|
||||||
const Strut* availableWorkspaceArea(int head) const;
|
const Strut* availableWorkspaceArea(int head) const;
|
||||||
|
|
||||||
ScreenSubject
|
ScreenSubject
|
||||||
m_clientlist_sig, ///< client signal
|
m_clientlist_sig, ///< client signal
|
||||||
m_iconlist_sig, ///< notify if a window gets iconified/deiconified
|
m_iconlist_sig, ///< notify if a window gets iconified/deiconified
|
||||||
m_workspacecount_sig, ///< workspace count signal
|
m_workspacecount_sig, ///< workspace count signal
|
||||||
m_workspacenames_sig, ///< workspace names signal
|
m_workspacenames_sig, ///< workspace names signal
|
||||||
m_workspace_area_sig, ///< workspace area changed signal
|
m_workspace_area_sig, ///< workspace area changed signal
|
||||||
m_currentworkspace_sig, ///< current workspace signal
|
m_currentworkspace_sig, ///< current workspace signal
|
||||||
m_focusedwindow_sig, ///< focused window signal
|
m_focusedwindow_sig, ///< focused window signal
|
||||||
m_reconfigure_sig, ///< reconfigure signal
|
m_reconfigure_sig, ///< reconfigure signal
|
||||||
m_resize_sig, ///< resize signal
|
m_resize_sig, ///< resize signal
|
||||||
m_bg_change_sig; ///< background change signal
|
m_bg_change_sig; ///< background change signal
|
||||||
|
|
||||||
FbTk::MultLayers m_layermanager;
|
FbTk::MultLayers m_layermanager;
|
||||||
|
|
||||||
bool root_colormap_installed, managed, geom_visible, pos_visible;
|
bool root_colormap_installed, managed, geom_visible, pos_visible;
|
||||||
|
|
||||||
GC opGC;
|
GC opGC;
|
||||||
|
@ -585,7 +585,7 @@ private:
|
||||||
HeadArea *m_head_areas;
|
HeadArea *m_head_areas;
|
||||||
|
|
||||||
struct XineramaHeadInfo {
|
struct XineramaHeadInfo {
|
||||||
int x, y, width, height;
|
int x, y, width, height;
|
||||||
} *m_xinerama_headinfo;
|
} *m_xinerama_headinfo;
|
||||||
|
|
||||||
bool m_restart, m_shutdown;
|
bool m_restart, m_shutdown;
|
||||||
|
|
58
src/Slit.hh
58
src/Slit.hh
|
@ -8,24 +8,24 @@
|
||||||
// copy of this software and associated documentation files (the "Software"),
|
// copy of this software and associated documentation files (the "Software"),
|
||||||
// to deal in the Software without restriction, including without limitation
|
// to deal in the Software without restriction, including without limitation
|
||||||
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
// and/or sell copies of the Software, and to permit persons to whom the
|
// and/or sell copies of the Software, and to permit persons to whom the
|
||||||
// Software is furnished to do so, subject to the following conditions:
|
// Software is furnished to do so, subject to the following conditions:
|
||||||
//
|
//
|
||||||
// The above copyright notice and this permission notice shall be included in
|
// The above copyright notice and this permission notice shall be included in
|
||||||
// all copies or substantial portions of the Software.
|
// all copies or substantial portions of the Software.
|
||||||
//
|
//
|
||||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
/// $Id$
|
/// $Id$
|
||||||
|
|
||||||
#ifndef SLIT_HH
|
#ifndef SLIT_HH
|
||||||
#define SLIT_HH
|
#define SLIT_HH
|
||||||
|
|
||||||
|
|
||||||
#include "LayerMenu.hh"
|
#include "LayerMenu.hh"
|
||||||
|
@ -54,7 +54,7 @@ class Layer;
|
||||||
/// Handles dock apps
|
/// Handles dock apps
|
||||||
class Slit: public FbTk::EventHandler, public FbTk::Observer, public LayerObject {
|
class Slit: public FbTk::EventHandler, public FbTk::Observer, public LayerObject {
|
||||||
public:
|
public:
|
||||||
typedef std::list<SlitClient *> SlitClients;
|
typedef std::list<SlitClient *> SlitClients;
|
||||||
/**
|
/**
|
||||||
Client alignment
|
Client alignment
|
||||||
*/
|
*/
|
||||||
|
@ -100,7 +100,7 @@ public:
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
void update(FbTk::Subject *subj);
|
void update(FbTk::Subject *subj);
|
||||||
|
|
||||||
void moveToLayer(int layernum);
|
void moveToLayer(int layernum);
|
||||||
void toggleHidden();
|
void toggleHidden();
|
||||||
|
|
||||||
|
@ -111,29 +111,29 @@ public:
|
||||||
|
|
||||||
int layerNumber() const { return m_layeritem->getLayerNum(); }
|
int layerNumber() const { return m_layeritem->getLayerNum(); }
|
||||||
|
|
||||||
inline bool isHidden() const { return m_hidden; }
|
bool isHidden() const { return m_hidden; }
|
||||||
inline bool acceptKdeDockapp() const { return *m_rc_kde_dockapp; }
|
bool acceptKdeDockapp() const { return *m_rc_kde_dockapp; }
|
||||||
inline bool doAutoHide() const { return *m_rc_auto_hide; }
|
bool doAutoHide() const { return *m_rc_auto_hide; }
|
||||||
inline Direction direction() const { return *m_rc_direction; }
|
Direction direction() const { return *m_rc_direction; }
|
||||||
inline Placement placement() const { return *m_rc_placement; }
|
Placement placement() const { return *m_rc_placement; }
|
||||||
inline int getOnHead() const { return *m_rc_on_head; }
|
int getOnHead() const { return *m_rc_on_head; }
|
||||||
void saveOnHead(int head);
|
void saveOnHead(int head);
|
||||||
FbTk::Menu &menu() { return m_slitmenu; }
|
FbTk::Menu &menu() { return m_slitmenu; }
|
||||||
|
|
||||||
inline const FbTk::FbWindow &window() const { return frame.window; }
|
const FbTk::FbWindow &window() const { return frame.window; }
|
||||||
|
|
||||||
inline int x() const { return (m_hidden ? frame.x_hidden : frame.x); }
|
int x() const { return (m_hidden ? frame.x_hidden : frame.x); }
|
||||||
inline int y() const { return (m_hidden ? frame.y_hidden : frame.y); }
|
int y() const { return (m_hidden ? frame.y_hidden : frame.y); }
|
||||||
|
|
||||||
inline unsigned int width() const { return frame.width; }
|
unsigned int width() const { return frame.width; }
|
||||||
inline unsigned int height() const { return frame.height; }
|
unsigned int height() const { return frame.height; }
|
||||||
const SlitClients &clients() const { return m_client_list; }
|
const SlitClients &clients() const { return m_client_list; }
|
||||||
SlitClients &clients() { return m_client_list; }
|
SlitClients &clients() { return m_client_list; }
|
||||||
private:
|
private:
|
||||||
void updateAlpha();
|
void updateAlpha();
|
||||||
void clearWindow();
|
void clearWindow();
|
||||||
void setupMenu();
|
void setupMenu();
|
||||||
|
|
||||||
void removeClient(SlitClient *client, bool remap, bool destroy);
|
void removeClient(SlitClient *client, bool remap, bool destroy);
|
||||||
void loadClientList(const char *filename);
|
void loadClientList(const char *filename);
|
||||||
void updateClientmenu();
|
void updateClientmenu();
|
||||||
|
@ -153,9 +153,9 @@ private:
|
||||||
|
|
||||||
struct frame {
|
struct frame {
|
||||||
frame(const FbTk::FbWindow &parent):
|
frame(const FbTk::FbWindow &parent):
|
||||||
window(parent, 0, 0, 10, 10,
|
window(parent, 0, 0, 10, 10,
|
||||||
SubstructureRedirectMask | ButtonPressMask |
|
SubstructureRedirectMask | ButtonPressMask |
|
||||||
EnterWindowMask | LeaveWindowMask | ExposureMask,
|
EnterWindowMask | LeaveWindowMask | ExposureMask,
|
||||||
true), // override redirect
|
true), // override redirect
|
||||||
x(0), y(0), x_hidden(0), y_hidden(0),
|
x(0), y(0), x_hidden(0), y_hidden(0),
|
||||||
width(10), height(10) {}
|
width(10), height(10) {}
|
||||||
|
|
|
@ -40,14 +40,14 @@ public:
|
||||||
/// For adding a placeholder
|
/// For adding a placeholder
|
||||||
explicit SlitClient(const char *name);
|
explicit SlitClient(const char *name);
|
||||||
|
|
||||||
inline const std::string &matchName() const { return m_match_name; }
|
const std::string &matchName() const { return m_match_name; }
|
||||||
inline Window window() const { return m_window; }
|
Window window() const { return m_window; }
|
||||||
inline Window clientWindow() const { return m_client_window; }
|
Window clientWindow() const { return m_client_window; }
|
||||||
inline Window iconWindow() const { return m_icon_window; }
|
Window iconWindow() const { return m_icon_window; }
|
||||||
inline int x() const { return m_x; }
|
int x() const { return m_x; }
|
||||||
inline int y() const { return m_y; }
|
int y() const { return m_y; }
|
||||||
inline unsigned int width() const { return m_width; }
|
unsigned int width() const { return m_width; }
|
||||||
inline unsigned int height() const { return m_height; }
|
unsigned int height() const { return m_height; }
|
||||||
bool visible() const { return m_visible; }
|
bool visible() const { return m_visible; }
|
||||||
|
|
||||||
|
|
||||||
|
|
16
src/Strut.hh
16
src/Strut.hh
|
@ -27,16 +27,16 @@
|
||||||
|
|
||||||
class Strut {
|
class Strut {
|
||||||
public:
|
public:
|
||||||
Strut(int head, int left, int right,
|
Strut(int head, int left, int right,
|
||||||
int top, int bottom, Strut* next = 0)
|
int top, int bottom, Strut* next = 0)
|
||||||
:m_head(head), m_left(left), m_right(right),
|
:m_head(head), m_left(left), m_right(right),
|
||||||
m_top(top), m_bottom(bottom), m_next(next) { }
|
m_top(top), m_bottom(bottom), m_next(next) { }
|
||||||
inline int head() const { return m_head; }
|
int head() const { return m_head; }
|
||||||
inline int left() const { return m_left; }
|
int left() const { return m_left; }
|
||||||
inline int right() const { return m_right; }
|
int right() const { return m_right; }
|
||||||
inline int bottom() const { return m_bottom; }
|
int bottom() const { return m_bottom; }
|
||||||
inline int top() const { return m_top; }
|
int top() const { return m_top; }
|
||||||
inline Strut* next() const { return m_next; }
|
Strut* next() const { return m_next; }
|
||||||
bool operator == (const Strut &test) const {
|
bool operator == (const Strut &test) const {
|
||||||
return (head() == test.head() &&
|
return (head() == test.head() &&
|
||||||
left() == test.left() &&
|
left() == test.left() &&
|
||||||
|
|
|
@ -69,8 +69,8 @@ public:
|
||||||
int numClients() const { return m_clients.size(); }
|
int numClients() const { return m_clients.size(); }
|
||||||
const FbTk::FbWindow &window() const { return m_window; }
|
const FbTk::FbWindow &window() const { return m_window; }
|
||||||
|
|
||||||
inline void renderTheme(unsigned char alpha) { m_window.setAlpha(alpha); update(0); }
|
void renderTheme(unsigned char alpha) { m_window.setAlpha(alpha); update(0); }
|
||||||
inline void updateSizing() {}
|
void updateSizing() {}
|
||||||
|
|
||||||
void parentMoved() { m_window.parentMoved(); }
|
void parentMoved() { m_window.parentMoved(); }
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@ public:
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void update(FbTk::Subject *subj);
|
void update(FbTk::Subject *subj);
|
||||||
|
|
||||||
typedef std::list<TrayWindow *> ClientList;
|
typedef std::list<TrayWindow *> ClientList;
|
||||||
ClientList::iterator findClient(Window win);
|
ClientList::iterator findClient(Window win);
|
||||||
|
|
||||||
|
|
|
@ -48,8 +48,8 @@ public:
|
||||||
ToolbarItem *create(const std::string &name, const FbTk::FbWindow &parent, Toolbar &tbar);
|
ToolbarItem *create(const std::string &name, const FbTk::FbWindow &parent, Toolbar &tbar);
|
||||||
void updateThemes();
|
void updateThemes();
|
||||||
int maxFontHeight();
|
int maxFontHeight();
|
||||||
inline const BScreen &screen() const { return m_screen; }
|
const BScreen &screen() const { return m_screen; }
|
||||||
inline BScreen &screen() { return m_screen; }
|
BScreen &screen() { return m_screen; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BScreen &m_screen;
|
BScreen &m_screen;
|
||||||
|
|
|
@ -45,8 +45,8 @@ public:
|
||||||
// textures
|
// textures
|
||||||
const FbTk::Texture &texture() const { return *m_texture; }
|
const FbTk::Texture &texture() const { return *m_texture; }
|
||||||
const FbTk::BorderTheme &border() const { return m_border; }
|
const FbTk::BorderTheme &border() const { return m_border; }
|
||||||
inline unsigned char alpha() const { return m_alpha; }
|
unsigned char alpha() const { return m_alpha; }
|
||||||
inline void setAlpha(unsigned char alpha) { m_alpha = alpha; }
|
void setAlpha(unsigned char alpha) { m_alpha = alpha; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
FbTk::ThemeItem<FbTk::Texture> &textureTheme() { return m_texture; }
|
FbTk::ThemeItem<FbTk::Texture> &textureTheme() { return m_texture; }
|
||||||
|
|
|
@ -24,8 +24,8 @@
|
||||||
|
|
||||||
// $Id$
|
// $Id$
|
||||||
|
|
||||||
#ifndef TOOLBAR_HH
|
#ifndef TOOLBAR_HH
|
||||||
#define TOOLBAR_HH
|
#define TOOLBAR_HH
|
||||||
|
|
||||||
#include "ToolbarTheme.hh"
|
#include "ToolbarTheme.hh"
|
||||||
#include "LayerMenu.hh"
|
#include "LayerMenu.hh"
|
||||||
|
@ -53,19 +53,19 @@ class ImageControl;
|
||||||
class Shape;
|
class Shape;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The toolbar.
|
/// The toolbar.
|
||||||
/// Handles iconbar, workspace name view and clock view
|
/// Handles iconbar, workspace name view and clock view
|
||||||
class Toolbar: public FbTk::EventHandler, public FbTk::Observer, public LayerObject {
|
class Toolbar: public FbTk::EventHandler, public FbTk::Observer, public LayerObject {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// Toolbar placement on the screen
|
/// Toolbar placement on the screen
|
||||||
enum Placement{
|
enum Placement{
|
||||||
// top and bottom placement
|
// top and bottom placement
|
||||||
TOPLEFT = 1, BOTTOMLEFT, TOPCENTER,
|
TOPLEFT = 1, BOTTOMLEFT, TOPCENTER,
|
||||||
BOTTOMCENTER, TOPRIGHT, BOTTOMRIGHT,
|
BOTTOMCENTER, TOPRIGHT, BOTTOMRIGHT,
|
||||||
// left and right placement
|
// left and right placement
|
||||||
LEFTCENTER, LEFTBOTTOM, LEFTTOP,
|
LEFTCENTER, LEFTBOTTOM, LEFTTOP,
|
||||||
RIGHTCENTER, RIGHTBOTTOM, RIGHTTOP
|
RIGHTCENTER, RIGHTBOTTOM, RIGHTTOP
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Create a toolbar on the screen with specific width
|
/// Create a toolbar on the screen with specific width
|
||||||
|
@ -93,7 +93,7 @@ public:
|
||||||
void exposeEvent(XExposeEvent &ee);
|
void exposeEvent(XExposeEvent &ee);
|
||||||
void handleEvent(XEvent &event);
|
void handleEvent(XEvent &event);
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
void reconfigure();
|
void reconfigure();
|
||||||
void setPlacement(Placement where);
|
void setPlacement(Placement where);
|
||||||
|
|
||||||
|
@ -101,35 +101,35 @@ public:
|
||||||
|
|
||||||
int layerNumber() const { return const_cast<FbTk::XLayerItem &>(m_layeritem).getLayerNum(); }
|
int layerNumber() const { return const_cast<FbTk::XLayerItem &>(m_layeritem).getLayerNum(); }
|
||||||
|
|
||||||
inline const FbTk::Menu &menu() const { return m_toolbarmenu; }
|
const FbTk::Menu &menu() const { return m_toolbarmenu; }
|
||||||
inline FbTk::Menu &menu() { return m_toolbarmenu; }
|
FbTk::Menu &menu() { return m_toolbarmenu; }
|
||||||
inline FbTk::Menu &placementMenu() { return m_placementmenu; }
|
FbTk::Menu &placementMenu() { return m_placementmenu; }
|
||||||
inline const FbTk::Menu &placementMenu() const { return m_placementmenu; }
|
const FbTk::Menu &placementMenu() const { return m_placementmenu; }
|
||||||
|
|
||||||
inline FbTk::Menu &layerMenu() { return m_layermenu; }
|
FbTk::Menu &layerMenu() { return m_layermenu; }
|
||||||
inline const FbTk::Menu &layerMenu() const { return m_layermenu; }
|
const FbTk::Menu &layerMenu() const { return m_layermenu; }
|
||||||
|
|
||||||
/// are we hidden?
|
/// are we hidden?
|
||||||
inline bool isHidden() const { return m_hidden; }
|
bool isHidden() const { return m_hidden; }
|
||||||
/// do we auto hide the toolbar?
|
/// do we auto hide the toolbar?
|
||||||
inline bool doAutoHide() const { return *m_rc_auto_hide; }
|
bool doAutoHide() const { return *m_rc_auto_hide; }
|
||||||
/// @return X window of the toolbar
|
/// @return X window of the toolbar
|
||||||
inline const FbTk::FbWindow &window() const { return frame.window; }
|
const FbTk::FbWindow &window() const { return frame.window; }
|
||||||
inline BScreen &screen() { return m_screen; }
|
BScreen &screen() { return m_screen; }
|
||||||
inline const BScreen &screen() const { return m_screen; }
|
const BScreen &screen() const { return m_screen; }
|
||||||
inline unsigned int width() const { return frame.window.width(); }
|
unsigned int width() const { return frame.window.width(); }
|
||||||
inline unsigned int height() const { return frame.window.height(); }
|
unsigned int height() const { return frame.window.height(); }
|
||||||
inline int x() const { return isHidden() ? frame.x_hidden : frame.x; }
|
int x() const { return isHidden() ? frame.x_hidden : frame.x; }
|
||||||
inline int y() const { return isHidden() ? frame.y_hidden : frame.y; }
|
int y() const { return isHidden() ? frame.y_hidden : frame.y; }
|
||||||
inline Placement placement() const { return *m_rc_placement; }
|
Placement placement() const { return *m_rc_placement; }
|
||||||
/// @return pointer to iconbar if it got one, else 0
|
/// @return pointer to iconbar if it got one, else 0
|
||||||
inline const ToolbarTheme &theme() const { return m_theme; }
|
const ToolbarTheme &theme() const { return m_theme; }
|
||||||
inline ToolbarTheme &theme() { return m_theme; }
|
ToolbarTheme &theme() { return m_theme; }
|
||||||
bool isVertical() const;
|
bool isVertical() const;
|
||||||
|
|
||||||
inline int getOnHead() const { return *m_rc_on_head; }
|
int getOnHead() const { return *m_rc_on_head; }
|
||||||
|
|
||||||
inline unsigned char alpha() const { return *m_rc_alpha; }
|
unsigned char alpha() const { return *m_rc_alpha; }
|
||||||
private:
|
private:
|
||||||
void rearrangeItems();
|
void rearrangeItems();
|
||||||
void deleteItems();
|
void deleteItems();
|
||||||
|
@ -165,7 +165,7 @@ private:
|
||||||
|
|
||||||
// themes
|
// themes
|
||||||
ToolbarTheme m_theme;
|
ToolbarTheme m_theme;
|
||||||
|
|
||||||
|
|
||||||
typedef std::list<ToolbarItem *> ItemList;
|
typedef std::list<ToolbarItem *> ItemList;
|
||||||
ItemList m_item_list;
|
ItemList m_item_list;
|
||||||
|
|
|
@ -36,17 +36,16 @@ public:
|
||||||
virtual ~ToolbarTheme();
|
virtual ~ToolbarTheme();
|
||||||
|
|
||||||
void reconfigTheme();
|
void reconfigTheme();
|
||||||
|
|
||||||
|
|
||||||
inline const FbTk::BorderTheme &border() const { return m_border; }
|
const FbTk::BorderTheme &border() const { return m_border; }
|
||||||
inline const FbTk::Texture &toolbar() const { return *m_toolbar; }
|
const FbTk::Texture &toolbar() const { return *m_toolbar; }
|
||||||
|
|
||||||
bool fallback(FbTk::ThemeItem_base &item);
|
bool fallback(FbTk::ThemeItem_base &item);
|
||||||
|
|
||||||
inline int bevelWidth() const { return *m_bevel_width; }
|
int bevelWidth() const { return *m_bevel_width; }
|
||||||
inline bool shape() const { return *m_shape; }
|
bool shape() const { return *m_shape; }
|
||||||
inline int height() const { return *m_height; }
|
int height() const { return *m_height; }
|
||||||
inline int buttonSize() const { return *m_button_size; }
|
int buttonSize() const { return *m_button_size; }
|
||||||
private:
|
private:
|
||||||
FbTk::ThemeItem<FbTk::Texture> m_toolbar;
|
FbTk::ThemeItem<FbTk::Texture> m_toolbar;
|
||||||
FbTk::BorderTheme m_border;
|
FbTk::BorderTheme m_border;
|
||||||
|
|
|
@ -56,7 +56,7 @@ public:
|
||||||
bool acceptsFocus() const; // will this window accept focus (according to hints)
|
bool acceptsFocus() const; // will this window accept focus (according to hints)
|
||||||
void sendClose(bool forceful = false);
|
void sendClose(bool forceful = false);
|
||||||
// not aware of anything that makes this false at present
|
// not aware of anything that makes this false at present
|
||||||
inline bool isClosable() const { return true; }
|
bool isClosable() const { return true; }
|
||||||
|
|
||||||
/// updates from wm class hints
|
/// updates from wm class hints
|
||||||
void updateWMClassHint();
|
void updateWMClassHint();
|
||||||
|
@ -111,26 +111,26 @@ public:
|
||||||
Focusable::WindowType getWindowType() const { return m_window_type; }
|
Focusable::WindowType getWindowType() const { return m_window_type; }
|
||||||
void setWindowType(Focusable::WindowType type) { m_window_type = type; }
|
void setWindowType(Focusable::WindowType type) { m_window_type = type; }
|
||||||
|
|
||||||
inline WinClient *transientFor() { return transient_for; }
|
WinClient *transientFor() { return transient_for; }
|
||||||
inline const WinClient *transientFor() const { return transient_for; }
|
const WinClient *transientFor() const { return transient_for; }
|
||||||
inline TransientList &transientList() { return transients; }
|
TransientList &transientList() { return transients; }
|
||||||
inline const TransientList &transientList() const { return transients; }
|
const TransientList &transientList() const { return transients; }
|
||||||
inline bool isTransient() const { return transient_for != 0; }
|
bool isTransient() const { return transient_for != 0; }
|
||||||
|
|
||||||
inline bool isModal() const { return m_modal_count > 0; }
|
bool isModal() const { return m_modal_count > 0; }
|
||||||
inline bool isStateModal() const { return m_modal; }
|
bool isStateModal() const { return m_modal; }
|
||||||
void setStateModal(bool state);
|
void setStateModal(bool state);
|
||||||
|
|
||||||
inline int gravity() const { return m_win_gravity; }
|
int gravity() const { return m_win_gravity; }
|
||||||
|
|
||||||
bool hasGroupLeftWindow() const;
|
bool hasGroupLeftWindow() const;
|
||||||
// grouping is tracked by remembering the window to the left in the group
|
// grouping is tracked by remembering the window to the left in the group
|
||||||
Window getGroupLeftWindow() const;
|
Window getGroupLeftWindow() const;
|
||||||
|
|
||||||
inline const MwmHints *getMwmHint() const { return m_mwm_hint; }
|
const MwmHints *getMwmHint() const { return m_mwm_hint; }
|
||||||
|
|
||||||
inline unsigned int maxWidth() const { return max_width; }
|
unsigned int maxWidth() const { return max_width; }
|
||||||
inline unsigned int maxHeight() const { return max_height; }
|
unsigned int maxHeight() const { return max_height; }
|
||||||
|
|
||||||
static const int PropMwmHintsElements = 3;
|
static const int PropMwmHintsElements = 3;
|
||||||
|
|
||||||
|
|
116
src/Window.hh
116
src/Window.hh
|
@ -24,8 +24,8 @@
|
||||||
|
|
||||||
// $Id$
|
// $Id$
|
||||||
|
|
||||||
#ifndef WINDOW_HH
|
#ifndef WINDOW_HH
|
||||||
#define WINDOW_HH
|
#define WINDOW_HH
|
||||||
|
|
||||||
#include "FbTk/DefaultValue.hh"
|
#include "FbTk/DefaultValue.hh"
|
||||||
#include "FbTk/Timer.hh"
|
#include "FbTk/Timer.hh"
|
||||||
|
@ -67,7 +67,7 @@ public:
|
||||||
/// Motif wm Hints
|
/// Motif wm Hints
|
||||||
enum {
|
enum {
|
||||||
MwmHintsFunctions = (1l << 0), ///< use motif wm functions
|
MwmHintsFunctions = (1l << 0), ///< use motif wm functions
|
||||||
MwmHintsDecorations = (1l << 1) ///< use motif wm decorations
|
MwmHintsDecorations = (1l << 1) ///< use motif wm decorations
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Motif wm functions
|
/// Motif wm functions
|
||||||
|
@ -99,7 +99,7 @@ public:
|
||||||
ATTRIB_OMNIPRESENT = 0x08, ///< omnipresent (sticky)
|
ATTRIB_OMNIPRESENT = 0x08, ///< omnipresent (sticky)
|
||||||
ATTRIB_WORKSPACE = 0x10, ///< workspace
|
ATTRIB_WORKSPACE = 0x10, ///< workspace
|
||||||
ATTRIB_STACK = 0x20, ///< stack
|
ATTRIB_STACK = 0x20, ///< stack
|
||||||
ATTRIB_DECORATION = 0x40, ///< decorations
|
ATTRIB_DECORATION = 0x40, ///< decorations
|
||||||
ATTRIB_HIDDEN = 0x80, ///< hidden
|
ATTRIB_HIDDEN = 0x80, ///< hidden
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -114,7 +114,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Different resize modes when resizing a window
|
/// Different resize modes when resizing a window
|
||||||
enum ResizeModel {
|
enum ResizeModel {
|
||||||
QUADRANTRESIZE, ///< resizes from one quadrant
|
QUADRANTRESIZE, ///< resizes from one quadrant
|
||||||
CENTERRESIZE, ///< resizes from center
|
CENTERRESIZE, ///< resizes from center
|
||||||
NEARESTEDGERESIZE, ///< resizes the nearest edge
|
NEARESTEDGERESIZE, ///< resizes the nearest edge
|
||||||
|
@ -133,13 +133,13 @@ public:
|
||||||
* Resize direction while resizing
|
* Resize direction while resizing
|
||||||
*/
|
*/
|
||||||
enum ResizeDirection {
|
enum ResizeDirection {
|
||||||
NOCORNER = -1,
|
NOCORNER = -1,
|
||||||
LEFTTOP = 0,
|
LEFTTOP = 0,
|
||||||
TOP = 1,
|
TOP = 1,
|
||||||
RIGHTTOP = 2,
|
RIGHTTOP = 2,
|
||||||
RIGHT = 3,
|
RIGHT = 3,
|
||||||
RIGHTBOTTOM = 4,
|
RIGHTBOTTOM = 4,
|
||||||
BOTTOM = 5,
|
BOTTOM = 5,
|
||||||
LEFTBOTTOM = 6,
|
LEFTBOTTOM = 6,
|
||||||
LEFT = 7,
|
LEFT = 7,
|
||||||
ALLCORNERS = 8
|
ALLCORNERS = 8
|
||||||
|
@ -172,7 +172,7 @@ public:
|
||||||
/// set new current client and raise it
|
/// set new current client and raise it
|
||||||
bool setCurrentClient(WinClient &client, bool setinput = true);
|
bool setCurrentClient(WinClient &client, bool setinput = true);
|
||||||
/**
|
/**
|
||||||
* Searches for a client
|
* Searches for a client
|
||||||
* @param win the client X window
|
* @param win the client X window
|
||||||
* @return pointer to client matching the window or NULL
|
* @return pointer to client matching the window or NULL
|
||||||
*/
|
*/
|
||||||
|
@ -316,7 +316,7 @@ public:
|
||||||
void moveResizeForClient(int x, int y, unsigned int width, unsigned int height, int gravity = ForgetGravity, unsigned int client_bw = 0);
|
void moveResizeForClient(int x, int y, unsigned int width, unsigned int height, int gravity = ForgetGravity, unsigned int client_bw = 0);
|
||||||
/**
|
/**
|
||||||
* Determines maximum size using all clients that this window can have.
|
* Determines maximum size using all clients that this window can have.
|
||||||
* @param width will be filled in with maximum width
|
* @param width will be filled in with maximum width
|
||||||
* @param height will be filled in with maximum height
|
* @param height will be filled in with maximum height
|
||||||
*/
|
*/
|
||||||
void maxSize(unsigned int &width, unsigned int &height);
|
void maxSize(unsigned int &width, unsigned int &height);
|
||||||
|
@ -391,55 +391,55 @@ public:
|
||||||
@name accessors
|
@name accessors
|
||||||
*/
|
*/
|
||||||
//@{
|
//@{
|
||||||
|
|
||||||
// whether this window can be tabbed with other windows,
|
// whether this window can be tabbed with other windows,
|
||||||
// and others tabbed with it
|
// and others tabbed with it
|
||||||
inline void setTabable(bool tabable) { functions.tabable = tabable; }
|
void setTabable(bool tabable) { functions.tabable = tabable; }
|
||||||
inline bool isTabable() { return functions.tabable; }
|
bool isTabable() { return functions.tabable; }
|
||||||
inline void setMovable(bool movable) { functions.move = movable; }
|
void setMovable(bool movable) { functions.move = movable; }
|
||||||
inline void setResizable(bool resizable) { functions.resize = resizable; }
|
void setResizable(bool resizable) { functions.resize = resizable; }
|
||||||
|
|
||||||
inline bool isFocusHidden() const { return m_focus_hidden; }
|
bool isFocusHidden() const { return m_focus_hidden; }
|
||||||
inline bool isIconHidden() const { return m_icon_hidden; }
|
bool isIconHidden() const { return m_icon_hidden; }
|
||||||
inline bool isManaged() const { return m_initialized; }
|
bool isManaged() const { return m_initialized; }
|
||||||
bool isVisible() const;
|
bool isVisible() const;
|
||||||
inline bool isIconic() { return iconic; }
|
bool isIconic() { return iconic; }
|
||||||
inline bool isIconic() const { return iconic; }
|
bool isIconic() const { return iconic; }
|
||||||
inline bool isShaded() { return shaded; }
|
bool isShaded() { return shaded; }
|
||||||
inline bool isShaded() const { return shaded; }
|
bool isShaded() const { return shaded; }
|
||||||
inline bool isFullscreen() const { return fullscreen; }
|
bool isFullscreen() const { return fullscreen; }
|
||||||
inline bool isMaximized() const { return maximized == MAX_FULL; }
|
bool isMaximized() const { return maximized == MAX_FULL; }
|
||||||
inline bool isMaximizedVert() const { return (bool)(maximized & MAX_VERT); }
|
bool isMaximizedVert() const { return (bool)(maximized & MAX_VERT); }
|
||||||
inline bool isMaximizedHorz() const { return (bool)(maximized & MAX_HORZ); }
|
bool isMaximizedHorz() const { return (bool)(maximized & MAX_HORZ); }
|
||||||
inline int maximizedState() const { return maximized; }
|
int maximizedState() const { return maximized; }
|
||||||
inline bool isIconifiable() const { return functions.iconify; }
|
bool isIconifiable() const { return functions.iconify; }
|
||||||
inline bool isMaximizable() const { return functions.maximize; }
|
bool isMaximizable() const { return functions.maximize; }
|
||||||
inline bool isResizable() const { return functions.resize; }
|
bool isResizable() const { return functions.resize; }
|
||||||
inline bool isClosable() const { return functions.close; }
|
bool isClosable() const { return functions.close; }
|
||||||
inline bool isMoveable() const { return functions.move; }
|
bool isMoveable() const { return functions.move; }
|
||||||
inline bool isStuck() const { return stuck; }
|
bool isStuck() const { return stuck; }
|
||||||
inline bool hasTitlebar() const { return decorations.titlebar; }
|
bool hasTitlebar() const { return decorations.titlebar; }
|
||||||
inline bool isMoving() const { return moving; }
|
bool isMoving() const { return moving; }
|
||||||
inline bool isResizing() const { return resizing; }
|
bool isResizing() const { return resizing; }
|
||||||
bool isGroupable() const;
|
bool isGroupable() const;
|
||||||
inline int numClients() const { return m_clientlist.size(); }
|
int numClients() const { return m_clientlist.size(); }
|
||||||
inline bool empty() const { return m_clientlist.empty(); }
|
bool empty() const { return m_clientlist.empty(); }
|
||||||
inline ClientList &clientList() { return m_clientlist; }
|
ClientList &clientList() { return m_clientlist; }
|
||||||
inline const ClientList &clientList() const { return m_clientlist; }
|
const ClientList &clientList() const { return m_clientlist; }
|
||||||
inline WinClient &winClient() { return *m_client; }
|
WinClient &winClient() { return *m_client; }
|
||||||
inline const WinClient &winClient() const { return *m_client; }
|
const WinClient &winClient() const { return *m_client; }
|
||||||
|
|
||||||
bool isTyping();
|
bool isTyping();
|
||||||
|
|
||||||
inline const FbTk::XLayerItem &layerItem() const { return m_frame.layerItem(); }
|
const FbTk::XLayerItem &layerItem() const { return m_frame.layerItem(); }
|
||||||
inline FbTk::XLayerItem &layerItem() { return m_frame.layerItem(); }
|
FbTk::XLayerItem &layerItem() { return m_frame.layerItem(); }
|
||||||
|
|
||||||
Window clientWindow() const;
|
Window clientWindow() const;
|
||||||
|
|
||||||
FbTk::FbWindow &fbWindow();
|
FbTk::FbWindow &fbWindow();
|
||||||
const FbTk::FbWindow &fbWindow() const;
|
const FbTk::FbWindow &fbWindow() const;
|
||||||
|
|
||||||
FbTk::Menu &menu();
|
FbTk::Menu &menu();
|
||||||
const FbTk::Menu &menu() const;
|
const FbTk::Menu &menu() const;
|
||||||
|
|
||||||
const FbTk::FbWindow &parent() const { return m_parent; }
|
const FbTk::FbWindow &parent() const { return m_parent; }
|
||||||
|
@ -448,27 +448,27 @@ public:
|
||||||
bool acceptsFocus() const;
|
bool acceptsFocus() const;
|
||||||
const FbTk::PixmapWithMask &icon() const;
|
const FbTk::PixmapWithMask &icon() const;
|
||||||
const std::string &title() const;
|
const std::string &title() const;
|
||||||
const std::string &getWMClassName() const;
|
const std::string &getWMClassName() const;
|
||||||
const std::string &getWMClassClass() const;
|
const std::string &getWMClassClass() const;
|
||||||
std::string getWMRole() const;
|
std::string getWMRole() const;
|
||||||
Focusable::WindowType getWindowType() const;
|
Focusable::WindowType getWindowType() const;
|
||||||
void setWindowType(Focusable::WindowType type);
|
void setWindowType(Focusable::WindowType type);
|
||||||
bool isTransient() const;
|
bool isTransient() const;
|
||||||
|
|
||||||
inline int x() const { return frame().x(); }
|
int x() const { return frame().x(); }
|
||||||
inline int y() const { return frame().y(); }
|
int y() const { return frame().y(); }
|
||||||
inline unsigned int width() const { return frame().width(); }
|
unsigned int width() const { return frame().width(); }
|
||||||
inline unsigned int height() const { return frame().height(); }
|
unsigned int height() const { return frame().height(); }
|
||||||
|
|
||||||
int normalX() const;
|
int normalX() const;
|
||||||
int normalY() const;
|
int normalY() const;
|
||||||
unsigned int normalWidth() const;
|
unsigned int normalWidth() const;
|
||||||
unsigned int normalHeight() const;
|
unsigned int normalHeight() const;
|
||||||
|
|
||||||
inline int xOffset() const { return frame().xOffset(); }
|
int xOffset() const { return frame().xOffset(); }
|
||||||
inline int yOffset() const { return frame().yOffset(); }
|
int yOffset() const { return frame().yOffset(); }
|
||||||
inline int widthOffset() const { return frame().widthOffset(); }
|
int widthOffset() const { return frame().widthOffset(); }
|
||||||
inline int heightOffset() const { return frame().heightOffset(); }
|
int heightOffset() const { return frame().heightOffset(); }
|
||||||
|
|
||||||
unsigned int workspaceNumber() const { return m_workspace_number; }
|
unsigned int workspaceNumber() const { return m_workspace_number; }
|
||||||
|
|
||||||
|
@ -481,8 +481,8 @@ public:
|
||||||
|
|
||||||
int initialState() const;
|
int initialState() const;
|
||||||
|
|
||||||
inline FbWinFrame &frame() { return m_frame; }
|
FbWinFrame &frame() { return m_frame; }
|
||||||
inline const FbWinFrame &frame() const { return m_frame; }
|
const FbWinFrame &frame() const { return m_frame; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@name signals
|
@name signals
|
||||||
|
@ -556,9 +556,9 @@ private:
|
||||||
void associateClient(WinClient &client);
|
void associateClient(WinClient &client);
|
||||||
|
|
||||||
// state and hint signals
|
// state and hint signals
|
||||||
WinSubject m_hintsig,
|
WinSubject m_hintsig,
|
||||||
m_statesig,
|
m_statesig,
|
||||||
m_layersig,
|
m_layersig,
|
||||||
m_workspacesig;
|
m_workspacesig;
|
||||||
|
|
||||||
class ThemeListener: public FbTk::Observer {
|
class ThemeListener: public FbTk::Observer {
|
||||||
|
|
|
@ -74,11 +74,11 @@ public:
|
||||||
WindowAccessor(Getter g, Setter s, Def def):
|
WindowAccessor(Getter g, Setter s, Def def):
|
||||||
m_getter(g), m_setter(s), m_def(def) { }
|
m_getter(g), m_setter(s), m_def(def) { }
|
||||||
|
|
||||||
inline operator Ret() const {
|
operator Ret() const {
|
||||||
FluxboxWindow *fbwin = WindowCmd<void>::window();
|
FluxboxWindow *fbwin = WindowCmd<void>::window();
|
||||||
return fbwin ? (fbwin->*m_getter)() : m_def;
|
return fbwin ? (fbwin->*m_getter)() : m_def;
|
||||||
}
|
}
|
||||||
inline FbTk::Accessor<Ret> &operator =(const Ret &val) {
|
FbTk::Accessor<Ret> &operator =(const Ret &val) {
|
||||||
FluxboxWindow *fbwin = WindowCmd<void>::window();
|
FluxboxWindow *fbwin = WindowCmd<void>::window();
|
||||||
if (fbwin)
|
if (fbwin)
|
||||||
(fbwin->*m_setter)(val);
|
(fbwin->*m_setter)(val);
|
||||||
|
@ -99,11 +99,11 @@ public:
|
||||||
ConstWindowAccessor(Getter g, Def def):
|
ConstWindowAccessor(Getter g, Def def):
|
||||||
m_getter(g), m_def(def) { }
|
m_getter(g), m_def(def) { }
|
||||||
|
|
||||||
inline operator Ret() const {
|
operator Ret() const {
|
||||||
FluxboxWindow *fbwin = WindowCmd<void>::window();
|
FluxboxWindow *fbwin = WindowCmd<void>::window();
|
||||||
return fbwin ? (fbwin->*m_getter)() : m_def;
|
return fbwin ? (fbwin->*m_getter)() : m_def;
|
||||||
}
|
}
|
||||||
inline FbTk::Accessor<Ret> &operator =(const Ret &val) { return *this; }
|
FbTk::Accessor<Ret> &operator =(const Ret &val) { return *this; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Getter m_getter;
|
Getter m_getter;
|
||||||
|
|
Loading…
Reference in a new issue