doxygen comments

This commit is contained in:
fluxgen 2002-08-04 15:55:13 +00:00
parent 380d50ba27
commit 56a41b23f9
15 changed files with 628 additions and 423 deletions

View file

@ -22,7 +22,7 @@
// 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: Basemenu.hh,v 1.15 2002/08/02 12:52:44 fluxgen Exp $ // $Id: Basemenu.hh,v 1.16 2002/08/04 15:55:13 fluxgen Exp $
#ifndef BASEMENU_HH #ifndef BASEMENU_HH
#define BASEMENU_HH #define BASEMENU_HH
@ -36,17 +36,26 @@ class BasemenuItem;
class Fluxbox; class Fluxbox;
class BImageControl; class BImageControl;
class BScreen; class BScreen;
/**
Base class for menus
*/
class Basemenu { class Basemenu {
public: public:
enum Alignment{ ALIGNDONTCARE = 1, ALIGNTOP, ALIGNBOTTOM }; enum Alignment{ ALIGNDONTCARE = 1, ALIGNTOP, ALIGNBOTTOM };
enum { RIGHT = 1, LEFT }; enum { RIGHT = 1, LEFT };
/**
Bullet type
*/
enum { EMPTY = 0, SQUARE, TRIANGLE, DIAMOND }; enum { EMPTY = 0, SQUARE, TRIANGLE, DIAMOND };
explicit Basemenu(BScreen *screen); explicit Basemenu(BScreen *screen);
virtual ~Basemenu(); virtual ~Basemenu();
//manipulators /**
@name manipulators
*/
//@{
int insert(const char *label, int function= 0, const char *exec = 0, int pos = -1); int insert(const char *label, int function= 0, const char *exec = 0, int pos = -1);
int insert(const char *label, Basemenu *submenu, int pos= -1); int insert(const char *label, Basemenu *submenu, int pos= -1);
int remove(unsigned int item); int remove(unsigned int item);
@ -54,14 +63,22 @@ public:
inline void setAlignment(Alignment a) { m_alignment = a; } inline void setAlignment(Alignment a) { m_alignment = a; }
inline void setTorn() { torn = true; } inline void setTorn() { torn = true; }
inline void removeParent() { if (internal_menu) m_parent = 0; } inline void removeParent() { if (internal_menu) m_parent = 0; }
void buttonPressEvent(XButtonEvent *); /**
void buttonReleaseEvent(XButtonEvent *); @name event handlers
void motionNotifyEvent(XMotionEvent *); */
void enterNotifyEvent(XCrossingEvent *); //@{
void leaveNotifyEvent(XCrossingEvent *); void buttonPressEvent(XButtonEvent *bp);
void exposeEvent(XExposeEvent *); void buttonReleaseEvent(XButtonEvent *br);
void motionNotifyEvent(XMotionEvent *mn);
void enterNotifyEvent(XCrossingEvent *en);
void leaveNotifyEvent(XCrossingEvent *ce);
void exposeEvent(XExposeEvent *ee);
//@}
void reconfigure(); void reconfigure();
/// set label string
void setLabel(const char *labelstr); void setLabel(const char *labelstr);
/// move menu to x,y
void move(int x, int y); void move(int x, int y);
void update(); void update();
void setItemSelected(unsigned int index, bool val); void setItemSelected(unsigned int index, bool val);
@ -69,8 +86,12 @@ public:
virtual void drawSubmenu(unsigned int index); virtual void drawSubmenu(unsigned int index);
virtual void show(); virtual void show();
virtual void hide(); virtual void hide();
/*@}*/
//accessors /**
@name accessors
*/
//@{
inline bool isTorn() const { return torn; } inline bool isTorn() const { return torn; }
inline bool isVisible() const { return visible; } inline bool isVisible() const { return visible; }
inline BScreen *screen() const { return m_screen; } inline BScreen *screen() const { return m_screen; }
@ -86,10 +107,28 @@ public:
bool hasSubmenu(unsigned int index) const; bool hasSubmenu(unsigned int index) const;
bool isItemSelected(unsigned int index) const; bool isItemSelected(unsigned int index) const;
bool isItemEnabled(unsigned int index) const; bool isItemEnabled(unsigned int index) const;
//@}
protected:
inline BasemenuItem *find(unsigned int index) const { return menuitems[index]; }
inline void setTitleVisibility(bool b) { title_vis = b; }
inline void setMovable(bool b) { movable = b; }
inline void setHideTree(bool h) { hide_tree = h; }
inline void setMinimumSublevels(int m) { menu.minsub = m; }
virtual void itemSelected(int button, unsigned int index) = 0;
virtual void drawItem(unsigned int index, bool highlight= false, bool clear= false,
int x= -1, int y= -1, unsigned int width= 0, unsigned int height= 0);
virtual void redrawTitle();
virtual void internal_hide();
inline Basemenu *parent() { return m_parent; }
inline const Basemenu *GetParent() const { return m_parent; }
private: private:
typedef std::vector<BasemenuItem *> Menuitems; typedef std::vector<BasemenuItem *> Menuitems;
Fluxbox *m_fluxbox; Fluxbox *m_fluxbox; //< fluxbox object, obsolete
BScreen *m_screen; BScreen *m_screen;
Display *m_display; Display *m_display;
Basemenu *m_parent; Basemenu *m_parent;
@ -113,23 +152,11 @@ private:
bevel_h; bevel_h;
} menu; } menu;
protected:
inline BasemenuItem *find(unsigned int index) const { return menuitems[index]; }
inline void setTitleVisibility(bool b) { title_vis = b; }
inline void setMovable(bool b) { movable = b; }
inline void setHideTree(bool h) { hide_tree = h; }
inline void setMinimumSublevels(int m) { menu.minsub = m; }
virtual void itemSelected(int button, unsigned int index) = 0;
virtual void drawItem(unsigned int index, bool highlight= false, bool clear= false,
int x= -1, int y= -1, unsigned int width= 0, unsigned int height= 0);
virtual void redrawTitle();
virtual void internal_hide();
inline Basemenu *GetParent() { return m_parent; }
inline const Basemenu *GetParent() const { return m_parent; }
}; };
/**
A menu item
*/
class BasemenuItem { class BasemenuItem {
public: public:
BasemenuItem( BasemenuItem(
@ -153,19 +180,25 @@ public:
, m_selected(false) , m_selected(false)
{ } { }
inline const std::string &exec() const { return m_exec; } void setSelected(bool selected) { m_selected = selected; }
inline const std::string &label() const { return m_label; } void setEnabled(bool enabled) { m_enabled = enabled; }
inline int function() const { return m_function; } Basemenu *submenu() { return m_submenu; }
inline Basemenu *submenu() const { return m_submenu; } /**
@name accessors
inline bool isEnabled() const { return m_enabled; } */
inline void setEnabled(bool enabled) { m_enabled = enabled; } //@{
inline bool isSelected() const { return m_selected; } const std::string &exec() const { return m_exec; }
inline void setSelected(bool selected) { m_selected = selected; } const std::string &label() const { return m_label; }
int function() const { return m_function; }
const Basemenu *submenu() const { return m_submenu; }
bool isEnabled() const { return m_enabled; }
bool isSelected() const { return m_selected; }
//@}
private: private:
std::string m_label, m_exec; std::string m_label; ///< label of this item
Basemenu *m_submenu; std::string m_exec; ///< command string to execute
Basemenu *m_submenu; ///< a submenu, 0 if we don't have one
int m_function; int m_function;
bool m_enabled, m_selected; bool m_enabled, m_selected;
@ -173,4 +206,4 @@ private:
}; };
#endif // _BASEMENU_HH_ #endif // BASEMENU_HH

View file

@ -19,12 +19,15 @@
// 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: FbAtoms.hh,v 1.3 2002/05/07 15:07:02 fluxgen Exp $ // $Id: FbAtoms.hh,v 1.4 2002/08/04 15:55:13 fluxgen Exp $
#ifndef FBATOMS_HH #ifndef FBATOMS_HH
#define FBATOMS_HH #define FBATOMS_HH
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <X11/Xatom.h> #include <X11/Xatom.h>
/**
atom handler, should probably be a singleton
*/
class FbAtoms class FbAtoms
{ {
public: public:
@ -43,80 +46,80 @@ public:
inline const Atom &getGnomeLayerAtom() const { return gnome_wm_win_layer; } inline const Atom &getGnomeLayerAtom() const { return gnome_wm_win_layer; }
#endif //GNOME #endif //GNOME
inline const Atom &getWMChangeStateAtom(void) const { return xa_wm_change_state; } inline const Atom &getWMChangeStateAtom() const { return xa_wm_change_state; }
inline const Atom &getWMStateAtom(void) const { return xa_wm_state; } inline const Atom &getWMStateAtom() const { return xa_wm_state; }
inline const Atom &getWMDeleteAtom(void) const { return xa_wm_delete_window; } inline const Atom &getWMDeleteAtom() const { return xa_wm_delete_window; }
inline const Atom &getWMProtocolsAtom(void) const { return xa_wm_protocols; } inline const Atom &getWMProtocolsAtom() const { return xa_wm_protocols; }
inline const Atom &getWMTakeFocusAtom(void) const { return xa_wm_take_focus; } inline const Atom &getWMTakeFocusAtom() const { return xa_wm_take_focus; }
inline const Atom &getWMColormapAtom(void) const { return xa_wm_colormap_windows; } inline const Atom &getWMColormapAtom() const { return xa_wm_colormap_windows; }
inline const Atom &getMotifWMHintsAtom(void) const { return motif_wm_hints; } inline const Atom &getMotifWMHintsAtom() const { return motif_wm_hints; }
// this atom is for normal app->WM hints about decorations, stacking, // this atom is for normal app->WM hints about decorations, stacking,
// starting workspace etc... // starting workspace etc...
inline const Atom &getFluxboxHintsAtom(void) const { return blackbox_hints;} inline const Atom &getFluxboxHintsAtom() const { return blackbox_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 const Atom &getFluxboxAttributesAtom(void) const { return blackbox_attributes; } inline const Atom &getFluxboxAttributesAtom() const { return blackbox_attributes; }
inline const Atom &getFluxboxChangeAttributesAtom(void) const { return blackbox_change_attributes; } inline const Atom &getFluxboxChangeAttributesAtom() const { return blackbox_change_attributes; }
// these atoms are for window->WM interaction, with more control and // these atoms are for window->WM interaction, with more control and
// information on window "structure"... common examples are // information on window "structure"... common examples are
// notifying apps when windows are raised/lowered... when the user changes // notifying apps when windows are raised/lowered... when the user changes
// workspaces... i.e. "pager talk" // workspaces... i.e. "pager talk"
inline const Atom &getFluxboxStructureMessagesAtom(void) const{ return blackbox_structure_messages; } inline const Atom &getFluxboxStructureMessagesAtom() const{ return blackbox_structure_messages; }
// *Notify* portions of the NETStructureMessages protocol // *Notify* portions of the NETStructureMessages protocol
inline const Atom &getFluxboxNotifyStartupAtom(void) const { return blackbox_notify_startup; } inline const Atom &getFluxboxNotifyStartupAtom() const { return blackbox_notify_startup; }
inline const Atom &getFluxboxNotifyWindowAddAtom(void) const { return blackbox_notify_window_add; } inline const Atom &getFluxboxNotifyWindowAddAtom() const { return blackbox_notify_window_add; }
inline const Atom &getFluxboxNotifyWindowDelAtom(void) const { return blackbox_notify_window_del; } inline const Atom &getFluxboxNotifyWindowDelAtom() const { return blackbox_notify_window_del; }
inline const Atom &getFluxboxNotifyWindowFocusAtom(void) const { return blackbox_notify_window_focus; } inline const Atom &getFluxboxNotifyWindowFocusAtom() const { return blackbox_notify_window_focus; }
inline const Atom &getFluxboxNotifyCurrentWorkspaceAtom(void) const { return blackbox_notify_current_workspace; } inline const Atom &getFluxboxNotifyCurrentWorkspaceAtom() const { return blackbox_notify_current_workspace; }
inline const Atom &getFluxboxNotifyWorkspaceCountAtom(void) const { return blackbox_notify_workspace_count; } inline const Atom &getFluxboxNotifyWorkspaceCountAtom() const { return blackbox_notify_workspace_count; }
inline const Atom &getFluxboxNotifyWindowRaiseAtom(void) const { return blackbox_notify_window_raise; } inline const Atom &getFluxboxNotifyWindowRaiseAtom() const { return blackbox_notify_window_raise; }
inline const Atom &getFluxboxNotifyWindowLowerAtom(void) const { return blackbox_notify_window_lower; } inline const Atom &getFluxboxNotifyWindowLowerAtom() const { return blackbox_notify_window_lower; }
// atoms to change that request changes to the desktop environment during // atoms to change that request changes to the desktop environment during
// runtime... these messages can be sent by any client... as the sending // runtime... these messages can be sent by any client... as the sending
// client window id is not included in the ClientMessage event... // client window id is not included in the ClientMessage event...
inline const Atom &getFluxboxChangeWorkspaceAtom(void) const { return blackbox_change_workspace; } inline const Atom &getFluxboxChangeWorkspaceAtom() const { return blackbox_change_workspace; }
inline const Atom &getFluxboxChangeWindowFocusAtom(void) const { return blackbox_change_window_focus; } inline const Atom &getFluxboxChangeWindowFocusAtom() const { return blackbox_change_window_focus; }
inline const Atom &getFluxboxCycleWindowFocusAtom(void) const { return blackbox_cycle_window_focus; } inline const Atom &getFluxboxCycleWindowFocusAtom() const { return blackbox_cycle_window_focus; }
#ifdef NEWWMSPEC #ifdef NEWWMSPEC
// root window properties // root window properties
inline const Atom &getNETSupportedAtom(void) const { return net_supported; } inline const Atom &getNETSupportedAtom() const { return net_supported; }
inline const Atom &getNETClientListAtom(void) const { return net_client_list; } inline const Atom &getNETClientListAtom() const { return net_client_list; }
inline const Atom &getNETClientListStackingAtom(void) const { return net_client_list_stacking; } inline const Atom &getNETClientListStackingAtom() const { return net_client_list_stacking; }
inline const Atom &getNETNumberOfDesktopsAtom(void) const { return net_number_of_desktops; } inline const Atom &getNETNumberOfDesktopsAtom() const { return net_number_of_desktops; }
inline const Atom &getNETDesktopGeometryAtom(void) const { return net_desktop_geometry; } inline const Atom &getNETDesktopGeometryAtom() const { return net_desktop_geometry; }
inline const Atom &getNETDesktopViewportAtom(void) const { return net_desktop_viewport; } inline const Atom &getNETDesktopViewportAtom() const { return net_desktop_viewport; }
inline const Atom &getNETCurrentDesktopAtom(void) const { return net_current_desktop; } inline const Atom &getNETCurrentDesktopAtom() const { return net_current_desktop; }
inline const Atom &getNETDesktopNamesAtom(void) const { return net_desktop_names; } inline const Atom &getNETDesktopNamesAtom() const { return net_desktop_names; }
inline const Atom &getNETActiveWindowAtom(void) const { return net_active_window; } inline const Atom &getNETActiveWindowAtom() const { return net_active_window; }
inline const Atom &getNETWorkareaAtom(void) const { return net_workarea; } inline const Atom &getNETWorkareaAtom() const { return net_workarea; }
inline const Atom &getNETSupportingWMCheckAtom(void) const { return net_supporting_wm_check; } inline const Atom &getNETSupportingWMCheckAtom() const { return net_supporting_wm_check; }
inline const Atom &getNETVirtualRootsAtom(void) const { return net_virtual_roots; } inline const Atom &getNETVirtualRootsAtom() const { return net_virtual_roots; }
// root window messages // root window messages
inline const Atom &getNETCloseWindowAtom(void) const { return net_close_window; } inline const Atom &getNETCloseWindowAtom() const { return net_close_window; }
inline const Atom &getNETWMMoveResizeAtom(void) const { return net_wm_moveresize; } inline const Atom &getNETWMMoveResizeAtom() const { return net_wm_moveresize; }
// application window properties // application window properties
inline const Atom &getNETPropertiesAtom(void) const { return net_properties; } inline const Atom &getNETPropertiesAtom() const { return net_properties; }
inline const Atom &getNETWMNameAtom(void) const { return net_wm_name; } inline const Atom &getNETWMNameAtom() const { return net_wm_name; }
inline const Atom &getNETWMDesktopAtom(void) const { return net_wm_desktop; } inline const Atom &getNETWMDesktopAtom() const { return net_wm_desktop; }
inline const Atom &getNETWMWindowTypeAtom(void) const { return net_wm_window_type; } inline const Atom &getNETWMWindowTypeAtom() const { return net_wm_window_type; }
inline const Atom &getNETWMStateAtom(void) const { return net_wm_state; } inline const Atom &getNETWMStateAtom() const { return net_wm_state; }
inline const Atom &getNETWMStrutAtom(void) const { return net_wm_strut; } inline const Atom &getNETWMStrutAtom() const { return net_wm_strut; }
inline const Atom &getNETWMIconGeometryAtom(void) const { return net_wm_icon_geometry; } inline const Atom &getNETWMIconGeometryAtom() const { return net_wm_icon_geometry; }
inline const Atom &getNETWMIconAtom(void) const { return net_wm_icon; } inline const Atom &getNETWMIconAtom() const { return net_wm_icon; }
inline const Atom &getNETWMPidAtom(void) const { return net_wm_pid; } inline const Atom &getNETWMPidAtom() const { return net_wm_pid; }
inline const Atom &getNETWMHandledIconsAtom(void) const { return net_wm_handled_icons; } inline const Atom &getNETWMHandledIconsAtom() const { return net_wm_handled_icons; }
// application protocols // application protocols
inline const Atom &getNETWMPingAtom(void) const { return net_wm_ping; } inline const Atom &getNETWMPingAtom() const { return net_wm_ping; }
#endif // NEWWMSPEC #endif // NEWWMSPEC

View file

@ -19,7 +19,7 @@
// 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: Font.hh,v 1.3 2002/05/15 09:36:57 fluxgen Exp $ //$Id: Font.hh,v 1.4 2002/08/04 15:55:13 fluxgen Exp $
#ifndef FBTK_FONT_HH #ifndef FBTK_FONT_HH
#define FBTK_FONT_HH #define FBTK_FONT_HH
@ -30,23 +30,46 @@
namespace FbTk namespace FbTk
{ {
/**
Handles loading of font.
*/
class Font class Font
{ {
public: public:
Font(Display *display, const char *name=0); Font(Display *display, const char *name=0);
virtual ~Font(); virtual ~Font();
//manipulators /**
Load a font
@return true on success, else false and it'll fall back on the last
loaded font
*/
bool load(const char *name); bool load(const char *name);
/**
Loads a font from database
@return true on success, else false and it'll fall back on the last
loaded font
@see load(const char *name)
*/
bool loadFromDatabase(XrmDatabase &database, const char *rname, const char *rclass); bool loadFromDatabase(XrmDatabase &database, const char *rname, const char *rclass);
//accessors /// @return true if a font is loaded, else false
inline bool isLoaded() const { return m_loaded; } inline bool isLoaded() const { return m_loaded; }
inline const XFontStruct *getFontStruct() const { return m_font.fontstruct; } /// @return XFontStruct of font, note: can be 0
inline const XFontSet &getFontSet() const { return m_font.set; } inline const XFontStruct *fontStruct() const { return m_font.fontstruct; }
inline const XFontSetExtents *getFontSetExtents() const { return m_font.set_extents; } /// @return XFontSet of font, note: check isLoaded
inline const XFontSet &fontSet() const { return m_font.set; }
/// @return XFontSetExtents of font, note: can be 0
inline const XFontSetExtents *fontSetExtents() const { return m_font.set_extents; }
/// @return true if multibyte is enabled, else false
static inline bool multibyte() { return m_multibyte; } static inline bool multibyte() { return m_multibyte; }
unsigned int getTextWidth(const char *text, unsigned int size) const; /**
unsigned int getHeight() const; @param text text to check size
Display *getDisplay() const { return m_display; } @param size length of text in bytes
@return size of text in pixels
*/
unsigned int textWidth(const char *text, unsigned int size) const;
unsigned int height() const;
/// @return display connection
Display *display() const { return m_display; }
private: private:
void freeFont(); void freeFont();
static XFontSet createFontSet(Display *display, const char *fontname); static XFontSet createFontSet(Display *display, const char *fontname);

View file

@ -19,29 +19,36 @@
// 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: IconBar.hh,v 1.6 2002/02/17 18:57:47 fluxgen Exp $ // $Id: IconBar.hh,v 1.7 2002/08/04 15:55:13 fluxgen Exp $
#ifndef ICONBAR_HH #ifndef ICONBAR_HH
#define ICONBAR_HH #define ICONBAR_HH
#include <vector>
#include "Window.hh" #include "Window.hh"
#include <list> #include <list>
/**
Icon object in IconBar
*/
class IconBarObj class IconBarObj
{ {
public: public:
IconBarObj(FluxboxWindow *fluxboxwin, Window iconwin); IconBarObj(FluxboxWindow *fluxboxwin, Window iconwin);
~IconBarObj(); ~IconBarObj();
inline Window getIconWin(void) { return m_iconwin; } Window getIconWin() const { return m_iconwin; }
inline FluxboxWindow *getFluxboxWin(void) { return m_fluxboxwin; } FluxboxWindow *getFluxboxWin() { return m_fluxboxwin; }
unsigned int getWidth(void); const FluxboxWindow *getFluxboxWin() const { return m_fluxboxwin; }
unsigned int width() const;
private: private:
FluxboxWindow *m_fluxboxwin; FluxboxWindow *m_fluxboxwin;
Window m_iconwin; Window m_iconwin;
}; };
/**
Icon container
*/
class IconBar class IconBar
{ {
public: public:
@ -64,7 +71,7 @@ private:
void loadTheme(unsigned int width, unsigned int height); void loadTheme(unsigned int width, unsigned int height);
void decorate(Window win); void decorate(Window win);
// IconBarObj *findIcon(FluxboxWindow *fluxboxwin); // IconBarObj *findIcon(FluxboxWindow *fluxboxwin);
void repositionIcons(void); void repositionIcons();
Window createIconWindow(FluxboxWindow *fluxboxwin, Window parent); Window createIconWindow(FluxboxWindow *fluxboxwin, Window parent);
BScreen *m_screen; BScreen *m_screen;
Display *m_display; Display *m_display;
@ -74,4 +81,4 @@ private:
unsigned long m_focus_pixel; unsigned long m_focus_pixel;
}; };
#endif // _ICONBAR_HH_ #endif // ICONBAR_HH

View file

@ -22,24 +22,25 @@
// 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: Image.hh,v 1.10 2002/07/23 17:11:59 fluxgen Exp $ // $Id: Image.hh,v 1.11 2002/08/04 15:55:13 fluxgen Exp $
#ifndef IMAGE_HH #ifndef IMAGE_HH
#define IMAGE_HH #define IMAGE_HH
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include "Timer.hh" #include "Timer.hh"
#include "BaseDisplay.hh" #include "BaseDisplay.hh"
#include "Color.hh" #include "Color.hh"
#include "Texture.hh" #include "Texture.hh"
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <list> #include <list>
class BImageControl; class BImageControl;
/**
Renders to pixmap
*/
class BImage { class BImage {
public: public:
BImage(BImageControl *ic, unsigned int, unsigned int); BImage(BImageControl *ic, unsigned int, unsigned int);
@ -62,7 +63,10 @@ protected:
@returns allocated and rendered XImage, user is responsible to deallocate @returns allocated and rendered XImage, user is responsible to deallocate
*/ */
XImage *renderXImage(); XImage *renderXImage();
/**
@name render functions
*/
//@{
void invert(); void invert();
void bevel1(); void bevel1();
void bevel2(); void bevel2();
@ -74,6 +78,7 @@ protected:
void vgradient(); void vgradient();
void cdgradient(); void cdgradient();
void pcgradient(); void pcgradient();
//@}
private: private:
BImageControl *control; BImageControl *control;
@ -91,7 +96,9 @@ private:
unsigned int width, height, *xtable, *ytable; unsigned int width, height, *xtable, *ytable;
}; };
/**
Holds screen info and color tables
*/
class BImageControl : public TimeoutHandler { class BImageControl : public TimeoutHandler {
public: public:
BImageControl(BaseDisplay *disp, ScreenInfo *screen, bool = False, int = 4, BImageControl(BaseDisplay *disp, ScreenInfo *screen, bool = False, int = 4,
@ -102,13 +109,14 @@ public:
inline bool doDither() { return dither; } inline bool doDither() { return dither; }
inline const Colormap &colormap() const { return m_colormap; } inline const Colormap &colormap() const { return m_colormap; }
inline ScreenInfo *getScreenInfo() { return screeninfo; } inline const ScreenInfo *getScreenInfo() const { return screeninfo; }
inline Window drawable() const { return window; } inline Window drawable() const { return window; }
/// @return visual of screen
inline Visual *visual() { return screeninfo->getVisual(); } inline Visual *visual() { return screeninfo->getVisual(); }
/// @return Bits per pixel of screen
inline int bitsPerPixel() const { return bits_per_pixel; } inline int bitsPerPixel() const { return bits_per_pixel; }
/// @return depth of screen
inline int depth() const { return screen_depth; } inline int depth() const { return screen_depth; }
inline int colorsPerChannel() const { return colors_per_channel; } inline int colorsPerChannel() const { return colors_per_channel; }
@ -116,7 +124,13 @@ public:
unsigned long color(const char *, unsigned char *, unsigned char *, unsigned long color(const char *, unsigned char *, unsigned char *,
unsigned char *); unsigned char *);
unsigned long getSqrt(unsigned int val); unsigned long getSqrt(unsigned int val);
/**
Render to pixmap
@param width width of pixmap
@param height height of pixmap
@param src_texture texture type to render
@return pixmap of the rendered image, on failure None
*/
Pixmap renderImage(unsigned int width, unsigned int height, Pixmap renderImage(unsigned int width, unsigned int height,
const FbTk::Texture *src_texture); const FbTk::Texture *src_texture);
@ -153,7 +167,8 @@ private:
Colormap m_colormap; Colormap m_colormap;
Window window; Window window;
XColor *colors; // color table XColor *colors; ///< color table
int colors_per_channel, ncolors, screen_number, screen_depth, int colors_per_channel, ncolors, screen_number, screen_depth,
bits_per_pixel, red_offset, green_offset, blue_offset, bits_per_pixel, red_offset, green_offset, blue_offset,
red_bits, green_bits, blue_bits; red_bits, green_bits, blue_bits;
@ -179,5 +194,5 @@ private:
}; };
#endif // __Image_hh #endif // IMAGE_HH

View file

@ -19,7 +19,7 @@
// 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: Keys.hh,v 1.14 2002/07/27 18:03:39 fluxgen Exp $ // $Id: Keys.hh,v 1.15 2002/08/04 15:55:13 fluxgen Exp $
#ifndef KEYS_HH #ifndef KEYS_HH
#define KEYS_HH #define KEYS_HH
@ -31,7 +31,9 @@
class Keys class Keys
{ {
public: public:
/**
Key actions
*/
enum KeyAction{ enum KeyAction{
ICONIFY=0, ICONIFY=0,
RAISE, LOWER, RAISE, LOWER,
@ -59,7 +61,11 @@ public:
ROOTMENU, // pop up rootmenu ROOTMENU, // pop up rootmenu
LASTKEYGRAB //mark end of keygrabbs LASTKEYGRAB //mark end of keygrabbs
}; };
/**
Constructor
@param display display connection
@param filename file to load, default none
*/
Keys(Display *display, const char *filename=0); Keys(Display *display, const char *filename=0);
/// destructor /// destructor
~Keys(); ~Keys();
@ -97,8 +103,21 @@ private:
void deleteTree(); void deleteTree();
void ungrabKeys(); void ungrabKeys();
void bindKey(unsigned int key, unsigned int mod); void bindKey(unsigned int key, unsigned int mod);
/**
@param modstr modifier string (i.e Mod4, Mod5)
@return modifier number that match modstr
*/
unsigned int getModifier(const char *modstr); unsigned int getModifier(const char *modstr);
/**
@param keystr a key string (i.e F1, Enter)
@return key number that match keystr
*/
unsigned int getKey(const char *keystr); unsigned int getKey(const char *keystr);
/**
grab a key
@param key the key
@param mod the modifier
*/
void grabKey(unsigned int key, unsigned int mod); void grabKey(unsigned int key, unsigned int mod);
std::string filename; std::string filename;
@ -139,6 +158,7 @@ private:
@return true on success, else false @return true on success, else false
*/ */
bool mergeTree(t_key *newtree, t_key *basetree=0); bool mergeTree(t_key *newtree, t_key *basetree=0);
#ifdef DEBUG #ifdef DEBUG
/// debug function /// debug function
void showTree(); void showTree();
@ -154,10 +174,10 @@ private:
static t_actionstr m_actionlist[]; static t_actionstr m_actionlist[];
std::vector<t_key *> m_keylist; std::vector<t_key *> m_keylist;
t_key *m_abortkey; //abortkey for keygrabbing chain t_key *m_abortkey; ///< abortkey for keygrabbing chain
std::string m_execcmdstring; //copy of the execcommandstring std::string m_execcmdstring; ///< copy of the execcommandstring
int m_param; // copy of the param argument int m_param; ///< copy of the param argument
Display *m_display; Display *m_display; ///< display connection
}; };
#endif // _KEYS_HH_ #endif // _KEYS_HH_

View file

@ -19,7 +19,7 @@
// 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: Resource.hh,v 1.6 2002/07/20 09:51:03 fluxgen Exp $ // $Id: Resource.hh,v 1.7 2002/08/04 15:55:13 fluxgen Exp $
#ifndef RESOURCE_HH #ifndef RESOURCE_HH
#define RESOURCE_HH #define RESOURCE_HH
@ -27,7 +27,9 @@
#include "NotCopyable.hh" #include "NotCopyable.hh"
#include <string> #include <string>
#include <list> #include <list>
/**
Base class for resources
*/
class Resource_base:private NotCopyable class Resource_base:private NotCopyable
{ {
public: public:
@ -47,17 +49,18 @@ public:
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
}; };
class ResourceManager; class ResourceManager;
/**
Real resource class
*/
template <typename T> template <typename T>
class Resource:public Resource_base class Resource:public Resource_base
{ {
@ -79,10 +82,10 @@ public:
inline Resource<T>& operator = (const T& newvalue) { m_value = newvalue; return *this;} inline Resource<T>& operator = (const T& newvalue) { m_value = newvalue; return *this;}
std::string getString(); std::string getString();
inline T& operator*(void) { return m_value; } inline T& operator*() { return m_value; }
inline const T& operator*(void) const { return m_value; } inline const T& operator*() const { return m_value; }
inline T *operator->(void) { return &m_value; } inline T *operator->() { return &m_value; }
inline const T *operator->(void) const { return &m_value; } inline 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;
@ -103,11 +106,17 @@ public:
save all resouces registered to this class save all resouces registered to this class
*/ */
virtual bool save(const char *filename, const char *mergefilename=0); virtual bool save(const char *filename, const char *mergefilename=0);
/**
add resource to list
*/
template <class T> template <class T>
void addResource(Resource<T> &r) { void addResource(Resource<T> &r) {
m_resourcelist.push_back(&r); m_resourcelist.push_back(&r);
m_resourcelist.unique(); m_resourcelist.unique();
} }
/**
Remove a specific resource
*/
template <class T> template <class T>
void removeResource(Resource<T> &r) { void removeResource(Resource<T> &r) {
m_resourcelist.remove(&r); m_resourcelist.remove(&r);
@ -115,9 +124,9 @@ public:
protected: protected:
static inline void ensureXrmIsInitialize(); static inline void ensureXrmIsInitialize();
private: private:
static bool m_init; static bool m_init;
ResourceList m_resourcelist; ResourceList m_resourcelist;
}; };
#endif //_RESOURCE_HH_ #endif //_RESOURCE_HH_

View file

@ -22,7 +22,7 @@
// 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: Screen.hh,v 1.40 2002/08/02 12:52:44 fluxgen Exp $ // $Id: Screen.hh,v 1.41 2002/08/04 15:55:13 fluxgen Exp $
#ifndef SCREEN_HH #ifndef SCREEN_HH
#define SCREEN_HH #define SCREEN_HH
@ -70,82 +70,82 @@ public:
int scrn); int scrn);
~BScreen(); ~BScreen();
inline bool isToolbarOnTop(void) const { return *resource.toolbar_on_top; } inline bool isToolbarOnTop() const { return *resource.toolbar_on_top; }
inline bool doToolbarAutoHide(void) const { return *resource.toolbar_auto_hide; } inline bool doToolbarAutoHide() const { return *resource.toolbar_auto_hide; }
inline bool isSloppyFocus(void) const { return resource.sloppy_focus; } inline bool isSloppyFocus() const { return resource.sloppy_focus; }
inline bool isSemiSloppyFocus(void) const { return resource.semi_sloppy_focus; } inline bool isSemiSloppyFocus() const { return resource.semi_sloppy_focus; }
inline bool isRootColormapInstalled(void) const { return root_colormap_installed; } inline bool isRootColormapInstalled() const { return root_colormap_installed; }
inline bool isScreenManaged(void) const { return managed; } inline bool isScreenManaged() const { return managed; }
inline bool isTabRotateVertical(void) const { return *resource.tab_rotate_vertical; } inline bool isTabRotateVertical() const { return *resource.tab_rotate_vertical; }
inline bool isSloppyWindowGrouping(void) const { return *resource.sloppy_window_grouping; } inline bool isSloppyWindowGrouping() const { return *resource.sloppy_window_grouping; }
inline bool isWorkspaceWarping(void) const { return *resource.workspace_warping; } inline bool isWorkspaceWarping() const { return *resource.workspace_warping; }
inline bool isDesktopWheeling(void) const { return *resource.desktop_wheeling; } inline bool isDesktopWheeling() const { return *resource.desktop_wheeling; }
inline bool doAutoRaise(void) const { return resource.auto_raise; } inline bool doAutoRaise() const { return resource.auto_raise; }
inline bool doImageDither(void) const { return *resource.image_dither; } inline bool doImageDither() const { return *resource.image_dither; }
inline bool doMaxOverSlit(void) const { return *resource.max_over_slit; } inline bool doMaxOverSlit() const { return *resource.max_over_slit; }
inline bool doOpaqueMove(void) const { return *resource.opaque_move; } inline bool doOpaqueMove() const { return *resource.opaque_move; }
inline bool doFullMax(void) const { return *resource.full_max; } inline bool doFullMax() const { return *resource.full_max; }
inline bool doFocusNew(void) const { return *resource.focus_new; } inline bool doFocusNew() const { return *resource.focus_new; }
inline bool doFocusLast(void) const { return *resource.focus_last; } inline bool doFocusLast() const { return *resource.focus_last; }
inline bool doShowWindowPos(void) const { return *resource.show_window_pos; } inline bool doShowWindowPos() const { return *resource.show_window_pos; }
inline GC getOpGC() const { return theme->getOpGC(); } inline GC getOpGC() const { return theme->getOpGC(); }
inline const FbTk::Color *getBorderColor(void) const { return &theme->getBorderColor(); } inline const FbTk::Color *getBorderColor() const { return &theme->getBorderColor(); }
inline BImageControl *getImageControl(void) { return image_control; } inline BImageControl *getImageControl() { return image_control; }
inline Rootmenu *getRootmenu(void) { return rootmenu; } inline Rootmenu *getRootmenu() { return rootmenu; }
inline const std::string &getRootCommand(void ) const { return *resource.rootcommand; } inline const std::string &getRootCommand(void ) const { return *resource.rootcommand; }
#ifdef SLIT #ifdef SLIT
inline bool isSlitOnTop(void) const { return resource.slit_on_top; } inline bool isSlitOnTop() const { return resource.slit_on_top; }
inline bool doSlitAutoHide(void) const { return resource.slit_auto_hide; } inline bool doSlitAutoHide() const { return resource.slit_auto_hide; }
inline Slit *getSlit(void) { return slit; } inline Slit *getSlit() { return slit; }
inline int getSlitPlacement(void) const { return resource.slit_placement; } inline int getSlitPlacement() const { return resource.slit_placement; }
inline int getSlitDirection(void) const { return resource.slit_direction; } inline int getSlitDirection() const { return resource.slit_direction; }
inline void saveSlitPlacement(int p) { resource.slit_placement = p; } inline void saveSlitPlacement(int p) { resource.slit_placement = p; }
inline void saveSlitDirection(int d) { resource.slit_direction = d; } inline void saveSlitDirection(int d) { resource.slit_direction = d; }
inline void saveSlitOnTop(bool t) { resource.slit_on_top = t; } inline void saveSlitOnTop(bool t) { resource.slit_on_top = t; }
inline void saveSlitAutoHide(bool t) { resource.slit_auto_hide = t; } inline void saveSlitAutoHide(bool t) { resource.slit_auto_hide = t; }
#ifdef XINERAMA #ifdef XINERAMA
inline unsigned int getSlitOnHead(void) const { return resource.slit_on_head; } inline unsigned int getSlitOnHead() const { return resource.slit_on_head; }
inline void saveSlitOnHead(unsigned int h) { resource.slit_on_head = h; } inline void saveSlitOnHead(unsigned int h) { resource.slit_on_head = h; }
#endif // XINERAMA #endif // XINERAMA
#endif // SLIT #endif // SLIT
inline Toolbar *getToolbar(void) { return toolbar; } inline Toolbar *getToolbar() { return toolbar; }
inline Workspace *getWorkspace(unsigned int w) { return ( w < workspacesList.size() ? workspacesList[w] : 0); } inline Workspace *getWorkspace(unsigned int w) { return ( w < workspacesList.size() ? workspacesList[w] : 0); }
inline Workspace *getCurrentWorkspace(void) { return current_workspace; } inline Workspace *getCurrentWorkspace() { return current_workspace; }
inline Workspacemenu *getWorkspacemenu(void) { return workspacemenu; } inline Workspacemenu *getWorkspacemenu() { return workspacemenu; }
inline unsigned int getHandleWidth(void) const { return theme->getHandleWidth(); } inline unsigned int getHandleWidth() const { return theme->getHandleWidth(); }
inline unsigned int getBevelWidth(void) const { return theme->getBevelWidth(); } inline unsigned int getBevelWidth() const { return theme->getBevelWidth(); }
inline unsigned int getFrameWidth(void) const { return theme->getFrameWidth(); } inline unsigned int getFrameWidth() const { return theme->getFrameWidth(); }
inline unsigned int getBorderWidth(void) const { return theme->getBorderWidth(); } inline unsigned int getBorderWidth() const { return theme->getBorderWidth(); }
inline unsigned int getBorderWidth2x(void) const { return theme->getBorderWidth()*2; } inline unsigned int getBorderWidth2x() const { return theme->getBorderWidth()*2; }
inline unsigned int getCurrentWorkspaceID() const { return current_workspace->workspaceID(); } inline unsigned int getCurrentWorkspaceID() const { return current_workspace->workspaceID(); }
typedef std::vector<FluxboxWindow *> Icons; typedef std::vector<FluxboxWindow *> Icons;
inline unsigned int getCount(void) const { return workspacesList.size(); } inline unsigned int getCount() const { return workspacesList.size(); }
inline unsigned int getIconCount(void) const { return iconList.size(); } inline unsigned int getIconCount() const { return iconList.size(); }
inline const Icons &getIconList(void) const { return iconList; } inline const Icons &getIconList() const { return iconList; }
inline Icons &getIconList(void) { return iconList; } inline Icons &getIconList() { return iconList; }
inline int getNumberOfWorkspaces(void) const { return *resource.workspaces; } inline int getNumberOfWorkspaces() const { return *resource.workspaces; }
inline Toolbar::Placement getToolbarPlacement(void) const { return *resource.toolbar_placement; } inline Toolbar::Placement getToolbarPlacement() const { return *resource.toolbar_placement; }
#ifdef XINERAMA #ifdef XINERAMA
inline int getToolbarOnHead(void) { return *resource.toolbar_on_head; } inline int getToolbarOnHead() { return *resource.toolbar_on_head; }
#endif // XINERAMA #endif // XINERAMA
inline int getToolbarWidthPercent(void) const { return *resource.toolbar_width_percent; } inline int getToolbarWidthPercent() const { return *resource.toolbar_width_percent; }
inline int getPlacementPolicy(void) const { return resource.placement_policy; } inline int getPlacementPolicy() const { return resource.placement_policy; }
inline int getEdgeSnapThreshold(void) const { return *resource.edge_snap_threshold; } inline int getEdgeSnapThreshold() const { return *resource.edge_snap_threshold; }
inline int getRowPlacementDirection(void) const { return resource.row_direction; } inline int getRowPlacementDirection() const { return resource.row_direction; }
inline int getColPlacementDirection(void) const { return resource.col_direction; } inline int getColPlacementDirection() const { return resource.col_direction; }
inline unsigned int getTabWidth(void) const { return *resource.tab_width; } inline unsigned int getTabWidth() const { return *resource.tab_width; }
inline unsigned int getTabHeight(void) const { return *resource.tab_height; } inline unsigned int getTabHeight() const { return *resource.tab_height; }
inline Tab::Placement getTabPlacement(void) const { return *resource.tab_placement; } inline Tab::Placement getTabPlacement() const { return *resource.tab_placement; }
inline Tab::Alignment getTabAlignment(void) const { return *resource.tab_alignment; } inline Tab::Alignment getTabAlignment() const { return *resource.tab_alignment; }
inline void setRootColormapInstalled(Bool r) { root_colormap_installed = r; } inline void setRootColormapInstalled(Bool r) { root_colormap_installed = r; }
inline void saveRootCommand(std::string rootcmd) { *resource.rootcommand = rootcmd; } inline void saveRootCommand(std::string rootcmd) { *resource.rootcommand = rootcmd; }
@ -179,37 +179,37 @@ public:
inline void saveSloppyWindowGrouping(bool s) { resource.sloppy_window_grouping = s; } inline void saveSloppyWindowGrouping(bool s) { resource.sloppy_window_grouping = s; }
inline void saveWorkspaceWarping(bool s) { resource.workspace_warping = s; } inline void saveWorkspaceWarping(bool s) { resource.workspace_warping = s; }
inline void saveDesktopWheeling(bool s) { resource.desktop_wheeling = s; } inline void saveDesktopWheeling(bool s) { resource.desktop_wheeling = s; }
inline void iconUpdate(void) { iconmenu->update(); } inline void iconUpdate() { iconmenu->update(); }
inline Iconmenu *getIconmenu(void) { return iconmenu; } inline Iconmenu *getIconmenu() { return iconmenu; }
inline void setAutoGroupWindow(Window w = 0) { auto_group_window = w; } inline void setAutoGroupWindow(Window w = 0) { auto_group_window = w; }
#ifdef HAVE_STRFTIME #ifdef HAVE_STRFTIME
inline const char *getStrftimeFormat(void) { return resource.strftime_format.c_str(); } inline const char *getStrftimeFormat() { return resource.strftime_format.c_str(); }
void saveStrftimeFormat(const char *format); void saveStrftimeFormat(const char *format);
#else // !HAVE_STRFTIME #else // !HAVE_STRFTIME
inline int getDateFormat(void) { return resource.date_format; } inline int getDateFormat() { return resource.date_format; }
inline void saveDateFormat(int f) { resource.date_format = f; } inline void saveDateFormat(int f) { resource.date_format = f; }
inline bool isClock24Hour(void) { return resource.clock24hour; } inline bool isClock24Hour() { return resource.clock24hour; }
inline void saveClock24Hour(Bool c) { resource.clock24hour = c; } inline void saveClock24Hour(Bool c) { resource.clock24hour = c; }
#endif // HAVE_STRFTIME #endif // HAVE_STRFTIME
inline Theme::WindowStyle *getWindowStyle(void) { return &theme->getWindowStyle(); } inline Theme::WindowStyle *getWindowStyle() { return &theme->getWindowStyle(); }
inline Theme::MenuStyle *getMenuStyle(void) { return &theme->getMenuStyle(); } inline Theme::MenuStyle *getMenuStyle() { return &theme->getMenuStyle(); }
inline Theme::ToolbarStyle *getToolbarStyle(void) { return &theme->getToolbarStyle(); } inline Theme::ToolbarStyle *getToolbarStyle() { return &theme->getToolbarStyle(); }
const Theme *getTheme() const { return theme; } const Theme *getTheme() const { return theme; }
FluxboxWindow *getIcon(unsigned int index); FluxboxWindow *getIcon(unsigned int index);
int addWorkspace(void); int addWorkspace();
int removeLastWorkspace(void); int removeLastWorkspace();
//scroll workspaces //scroll workspaces
void nextWorkspace(const int delta); void nextWorkspace(const int delta);
void prevWorkspace(const int delta); void prevWorkspace(const int delta);
void rightWorkspace(const int delta); void rightWorkspace(const int delta);
void leftWorkspace(const int delta); void leftWorkspace(const int delta);
void removeWorkspaceNames(void); void removeWorkspaceNames();
void updateWorkspaceNamesAtom(void); void updateWorkspaceNamesAtom();
void addWorkspaceName(const char *name); void addWorkspaceName(const char *name);
void addNetizen(Netizen *net); void addNetizen(Netizen *net);
@ -223,19 +223,19 @@ public:
void reassociateWindow(FluxboxWindow *window, unsigned int workspace_id, bool ignore_sticky); void reassociateWindow(FluxboxWindow *window, unsigned int workspace_id, bool ignore_sticky);
void prevFocus(int = 0); void prevFocus(int = 0);
void nextFocus(int = 0); void nextFocus(int = 0);
void raiseFocus(void); void raiseFocus();
void reconfigure(void); void reconfigure();
void rereadMenu(void); void rereadMenu();
void shutdown(void); void shutdown();
void showPosition(int, int); void showPosition(int, int);
void showGeometry(unsigned int, unsigned int); void showGeometry(unsigned int, unsigned int);
void hideGeometry(void); void hideGeometry();
FluxboxWindow* useAutoGroupWindow(void); FluxboxWindow* useAutoGroupWindow();
void updateNetizenCurrentWorkspace(void); void updateNetizenCurrentWorkspace();
void updateNetizenWorkspaceCount(void); void updateNetizenWorkspaceCount();
void updateNetizenWindowFocus(void); void updateNetizenWindowFocus();
void updateNetizenWindowAdd(Window, unsigned long); void updateNetizenWindowAdd(Window, unsigned long);
void updateNetizenWindowDel(Window); void updateNetizenWindowDel(Window);
void updateNetizenConfigNotify(XEvent *); void updateNetizenConfigNotify(XEvent *);
@ -356,7 +356,7 @@ protected:
XFontSet createFontSet(char *); XFontSet createFontSet(char *);
void readDatabaseFont(char *, char *, XFontStruct **); void readDatabaseFont(char *, char *, XFontStruct **);
void initMenu(void); void initMenu();
}; };

View file

@ -40,15 +40,15 @@ class Slitmenu;
class Slitmenu : public Basemenu { class Slitmenu : public Basemenu {
public: public:
explicit Slitmenu(Slit &theslist); explicit Slitmenu(Slit &theslist);
virtual ~Slitmenu(void); virtual ~Slitmenu();
inline Basemenu *getDirectionmenu(void) { return directionmenu; } inline Basemenu *getDirectionmenu() { return directionmenu; }
inline Basemenu *getPlacementmenu(void) { return placementmenu; } inline Basemenu *getPlacementmenu() { return placementmenu; }
#ifdef XINERAMA #ifdef XINERAMA
inline Basemenu *getHeadmenu(void) { return headmenu; } inline Basemenu *getHeadmenu() { return headmenu; }
#endif // XINERAMA #endif // XINERAMA
void reconfigure(void); void reconfigure();
private: private:
class Directionmenu : public Basemenu { class Directionmenu : public Basemenu {
@ -103,52 +103,63 @@ private:
protected: protected:
virtual void itemSelected(int button, unsigned int index); virtual void itemSelected(int button, unsigned int index);
virtual void internal_hide(void); virtual void internal_hide();
}; };
class Slit : public TimeoutHandler { class Slit : public TimeoutHandler {
public: public:
explicit Slit(BScreen *); explicit Slit(BScreen *screen);
virtual ~Slit(); virtual ~Slit();
inline bool isOnTop(void) const { return on_top; } inline bool isOnTop() const { return on_top; }
inline bool isHidden(void) const { return hidden; } inline bool isHidden() const { return hidden; }
inline bool doAutoHide(void) const { return do_auto_hide; } inline bool doAutoHide() const { return do_auto_hide; }
Slitmenu &getMenu() { return slitmenu; } Slitmenu &menu() { return slitmenu; }
inline const Window &getWindowID() const { return frame.window; } inline const Window &getWindowID() const { return frame.window; }
inline int getX() const { return ((hidden) ? frame.x_hidden : frame.x); } inline int x() const { return ((hidden) ? frame.x_hidden : frame.x); }
inline int getY() const { return ((hidden) ? frame.y_hidden : frame.y); } inline int y() const { return ((hidden) ? frame.y_hidden : frame.y); }
inline unsigned int getWidth(void) const { return frame.width; } inline unsigned int width() const { return frame.width; }
inline unsigned int getHeight(void) const { return frame.height; } inline unsigned int height() const { return frame.height; }
void addClient(Window); void addClient(Window clientwin);
void removeClient(Window, bool = true); void removeClient(Window clientwin, bool = true);
void reconfigure(void); void reconfigure();
void reposition(void); void reposition();
void shutdown(void); void shutdown();
void saveClientList(void); void saveClientList();
void buttonPressEvent(XButtonEvent *); /**
void enterNotifyEvent(XCrossingEvent *); @name eventhandlers
void leaveNotifyEvent(XCrossingEvent *); */
void configureRequestEvent(XConfigureRequestEvent *); //@{
void buttonPressEvent(XButtonEvent *bp);
void enterNotifyEvent(XCrossingEvent *en);
void leaveNotifyEvent(XCrossingEvent *ln);
void configureRequestEvent(XConfigureRequestEvent *cr);
//@}
virtual void timeout(void); virtual void timeout();
/**
Client alignment
*/
enum { VERTICAL = 1, HORIZONTAL }; enum { VERTICAL = 1, HORIZONTAL };
/**
Screen placement
*/
enum { TOPLEFT = 1, CENTERLEFT, BOTTOMLEFT, TOPCENTER, BOTTOMCENTER, enum { TOPLEFT = 1, CENTERLEFT, BOTTOMLEFT, TOPCENTER, BOTTOMCENTER,
TOPRIGHT, CENTERRIGHT, BOTTOMRIGHT }; TOPRIGHT, CENTERRIGHT, BOTTOMRIGHT };
private: private:
class SlitClient { class SlitClient {
public: public:
SlitClient(BScreen *, Window); // For adding an actual window SlitClient(BScreen *screen, Window client_window); // For adding an actual window
SlitClient(const char *); // For adding a placeholder SlitClient(const char *name); // For adding a placeholder
// Now we pre-initialize a list of slit clients with names for // Now we pre-initialize a list of slit clients with names for
// comparison with incoming client windows. This allows the slit // comparison with incoming client windows. This allows the slit
@ -163,16 +174,17 @@ private:
int x, y; int x, y;
unsigned int width, height; unsigned int width, height;
void initialize(BScreen * = NULL, Window = None); void initialize(BScreen *screen = 0, Window client_window= None);
}; };
void removeClient(SlitClient *, bool, bool); void removeClient(SlitClient *client, bool remap, bool destroy);
void loadClientList(void); void loadClientList();
Bool on_top, hidden, do_auto_hide; bool on_top, hidden, do_auto_hide;
Display *display;
Fluxbox *fluxbox; Display *display; ///< display connection
Fluxbox *fluxbox; ///< obsolete
BScreen *screen; BScreen *screen;
BTimer timer; BTimer timer;
@ -199,4 +211,4 @@ private:
}; };
#endif // __Slit_hh #endif // SLIT_HH

View file

@ -20,8 +20,6 @@
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
// A lot of the base code is taken from Screen.hh in Blackbox 0.61.1 // A lot of the base code is taken from Screen.hh in Blackbox 0.61.1
// and Brad Hughes (bhuges@tcac.net) should get alot of credit for it
// And for license-hunters here's the license and copyright for Screen.cc
// Screen.cc - Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net) // Screen.cc - Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net)
// //
// Permission is hereby granted, free of charge, to any person obtaining a // Permission is hereby granted, free of charge, to any person obtaining a
@ -42,7 +40,7 @@
// 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: Theme.hh,v 1.12 2002/07/23 18:38:31 fluxgen Exp $ // $Id: Theme.hh,v 1.13 2002/08/04 15:55:13 fluxgen Exp $
#ifndef THEME_HH #ifndef THEME_HH
#define THEME_HH #define THEME_HH
@ -55,7 +53,10 @@
#include <X11/Xresource.h> #include <X11/Xresource.h>
#include <string> #include <string>
/**
Main theme class, holds themes for
Window, toolbar, slit, menu and the rootCommand, for a specific screen.
*/
class Theme class Theme
{ {
public: public:

View file

@ -30,60 +30,76 @@
#endif //HAVE_CONFIG_H #endif //HAVE_CONFIG_H
#ifdef TIME_WITH_SYS_TIME #ifdef TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
#else // !TIME_WITH_SYS_TIME
# ifdef HAVE_SYS_TIME_H
#include <sys/time.h> #include <sys/time.h>
# else // !HAVE_SYS_TIME_H #include <time.h>
# include <time.h> #else //!TIME_WITH_SYS_TIME
# endif // HAVE_SYS_TIME_H #ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#else // !HAVE_SYS_TIME_H
#include <time.h>
#endif // HAVE_SYS_TIME_H
#endif // TIME_WITH_SYS_TIME #endif // TIME_WITH_SYS_TIME
#include <list> #include <list>
/**
Inherit this to have a timed object, that calls
timeout function when the time is out
*/
class TimeoutHandler { class TimeoutHandler {
public: public:
virtual void timeout(void) = 0; /// called when the time is out
virtual void timeout() = 0;
}; };
/**
Handles TimeoutHandles
*/
class BTimer { class BTimer {
public: public:
explicit BTimer(TimeoutHandler *); explicit BTimer(TimeoutHandler *handler);
virtual ~BTimer(void); virtual ~BTimer();
inline int isTiming(void) const { return m_timing; } inline int isTiming() const { return m_timing; }
inline int doOnce(void) const { return m_once; } inline int doOnce() const { return m_once; }
inline const timeval &getTimeout(void) const { return m_timeout; } inline const timeval &getTimeout() const { return m_timeout; }
inline const timeval &getStartTime(void) const { return m_start; } inline const timeval &getStartTime() const { return m_start; }
inline void fireOnce(bool once) { m_once = once; } inline void fireOnce(bool once) { m_once = once; }
/// set timeout
void setTimeout(long val);
/// set timeout
void setTimeout(timeval val);
/// start timing
void start();
/// stop timing
void stop();
/// update all timers
static void updateTimers(int file_descriptor);
void setTimeout(long);
void setTimeout(timeval);
void start(void);
void stop(void);
static void updateTimers(int fd);
protected: protected:
void fireTimeout(void); /// force a timeout
void fireTimeout();
private: private:
/// add a timer to the static list
static void addTimer(BTimer *timer); static void addTimer(BTimer *timer);
/// remove a timer from the static list
static void removeTimer(BTimer *timer); static void removeTimer(BTimer *timer);
typedef std::list<BTimer *> TimerList; typedef std::list<BTimer *> TimerList;
static TimerList m_timerlist; static TimerList m_timerlist; ///< list of all timers
TimeoutHandler *m_handler; TimeoutHandler *m_handler; ///< handler
bool m_timing, m_once; bool m_timing; ///< clock running?
bool m_once; ///< do timeout only once?
timeval m_start, m_timeout; timeval m_start; ///< start time
timeval m_timeout; ///< time length
}; };
#endif // TIMER_HH
#endif // _TIMER_HH_

View file

@ -22,20 +22,39 @@
// 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: Toolbar.hh,v 1.10 2002/04/03 12:08:54 fluxgen Exp $ // $Id: Toolbar.hh,v 1.11 2002/08/04 15:55:13 fluxgen Exp $
#ifndef TOOLBAR_HH #ifndef TOOLBAR_HH
#define TOOLBAR_HH #define TOOLBAR_HH
#include <X11/Xlib.h>
#include "Basemenu.hh" #include "Basemenu.hh"
#include "Timer.hh" #include "Timer.hh"
#include "IconBar.hh" #include "IconBar.hh"
// forward declaration
class Toolbar; class Toolbar;
class Toolbarmenu : public Basemenu { /**
Menu for toolbar.
@see Toolbar
*/
class Toolbarmenu:public Basemenu {
public:
explicit Toolbarmenu(Toolbar *tb);
~Toolbarmenu();
#ifdef XINERAMA
inline Basemenu *getHeadmenu() { return headmenu; }
#endif // XINERAMA
inline Basemenu *getPlacementmenu() { return placementmenu; }
inline const Basemenu *getPlacementmenu() const { return placementmenu; }
void reconfigure();
protected:
virtual void itemSelected(int button, unsigned int index);
virtual void internal_hide();
private: private:
class Placementmenu : public Basemenu { class Placementmenu : public Basemenu {
private: private:
@ -71,28 +90,88 @@ private:
friend class Placementmenu; friend class Placementmenu;
friend class Toolbar; friend class Toolbar;
protected:
virtual void itemSelected(int button, unsigned int index);
virtual void internal_hide(void);
public:
Toolbarmenu(Toolbar *);
~Toolbarmenu(void);
#ifdef XINERAMA
inline Basemenu *getHeadmenu(void) { return headmenu; }
#endif // XINERAMA
inline Basemenu *getPlacementmenu(void) { return placementmenu; }
void reconfigure(void);
}; };
/**
the toolbar.
*/
class Toolbar : public TimeoutHandler { class Toolbar : public TimeoutHandler {
public:
/**
Toolbar placement on the screen
*/
enum Placement{ TOPLEFT = 1, BOTTOMLEFT, TOPCENTER,
BOTTOMCENTER, TOPRIGHT, BOTTOMRIGHT };
explicit Toolbar(BScreen *screen);
virtual ~Toolbar();
/// add icon to iconbar
void addIcon(FluxboxWindow *w);
/// remove icon from iconbar
void delIcon(FluxboxWindow *w);
inline Toolbarmenu *getMenu() { return toolbarmenu; }
inline const Toolbarmenu *getMenu() const { return toolbarmenu; }
//inline Window getWindowLabel(void) { return frame.window_label; }
/// are we in workspacename editing?
inline bool isEditing() const { return editing; }
/// always on top?
inline bool isOnTop() const { return on_top; }
/// are we hidden?
inline bool isHidden() const { return hidden; }
/// do we auto hide the toolbar?
inline bool doAutoHide() const { return do_auto_hide; }
/**
@return X window of the toolbar
*/
inline Window getWindowID() const { return frame.window; }
inline unsigned int getWidth() const { return frame.width; }
inline unsigned int getHeight() const { return frame.height; }
inline unsigned int getExposedHeight() const { return ((do_auto_hide) ? frame.bevel_w : frame.height); }
inline int getX() const { return ((hidden) ? frame.x_hidden : frame.x); }
inline int getY() const { return ((hidden) ? frame.y_hidden : frame.y); }
inline IconBar *getIconBar() { return iconbar; }
/**
@name eventhandlers
*/
//@{
void buttonPressEvent(XButtonEvent *be);
void buttonReleaseEvent(XButtonEvent *be);
void enterNotifyEvent(XCrossingEvent *ce);
void leaveNotifyEvent(XCrossingEvent *ce);
void exposeEvent(XExposeEvent *ee);
void keyPressEvent(XKeyEvent *ke);
//@}
void redrawWindowLabel(bool redraw= false);
void redrawWorkspaceLabel(bool redraw= false);
void redrawPrevWorkspaceButton(bool pressed = false, bool redraw = false);
void redrawNextWorkspaceButton(bool pressed = false, bool redraw = false);
void redrawPrevWindowButton(bool pressed = false, bool redraw = false);
void redrawNextWindowButton(bool pressed = false, bool redraw = false);
/// enter edit mode on workspace label
void edit();
void reconfigure();
#ifdef HAVE_STRFTIME
void checkClock(bool redraw = false);
#else // HAVE_STRFTIME
void checkClock(bool redraw = false, bool date = false);
#endif // HAVE_STRFTIME
virtual void timeout();
private: private:
Bool on_top, editing, hidden, do_auto_hide; bool on_top; ///< always on top
Display *display; bool editing; ///< edit workspace label mode
bool hidden; ///< hidden state
bool do_auto_hide; ///< do we auto hide
Display *display; ///< display connection
struct frame { struct frame {
unsigned long button_pixel, pbutton_pixel; unsigned long button_pixel, pbutton_pixel;
@ -112,14 +191,14 @@ private:
virtual void timeout(void); virtual void timeout(void);
} hide_handler; } hide_handler;
Fluxbox *fluxbox; Fluxbox *fluxbox; ///< obsolete
BScreen *screen; BScreen *screen; ///< screen on wich this toolbar exist
BImageControl *image_ctrl; BImageControl *image_ctrl;
BTimer clock_timer, *hide_timer; BTimer clock_timer, *hide_timer;
Toolbarmenu *toolbarmenu; Toolbarmenu *toolbarmenu;
class IconBar *iconbar; IconBar *iconbar;
std::string new_workspace_name; std::string new_workspace_name; ///< temp variable in edit mode
friend class HideHandler; friend class HideHandler;
friend class Toolbarmenu; friend class Toolbarmenu;
@ -127,60 +206,7 @@ private:
#ifdef XINERAMA #ifdef XINERAMA
friend class Toolbarmenu::Headmenu; friend class Toolbarmenu::Headmenu;
#endif // XINERAMA #endif // XINERAMA
public:
Toolbar(BScreen *);
virtual ~Toolbar(void);
void addIcon(FluxboxWindow *w);
void delIcon(FluxboxWindow *w);
inline Toolbarmenu *getMenu(void) { return toolbarmenu; }
//inline Window getWindowLabel(void) { return frame.window_label; }
inline const Bool &isEditing(void) const { return editing; }
inline const Bool &isOnTop(void) const { return on_top; }
inline const Bool &isHidden(void) const { return hidden; }
inline const Bool &doAutoHide(void) const { return do_auto_hide; }
inline const Window &getWindowID(void) const { return frame.window; }
inline const unsigned int &getWidth(void) const { return frame.width; }
inline const unsigned int &getHeight(void) const { return frame.height; }
inline const unsigned int &getExposedHeight(void) const
{ return ((do_auto_hide) ? frame.bevel_w : frame.height); }
inline const int &getX(void) const
{ return ((hidden) ? frame.x_hidden : frame.x); }
inline const int &getY(void) const
{ return ((hidden) ? frame.y_hidden : frame.y); }
inline IconBar *getIconBar(void) { return iconbar; }
void buttonPressEvent(XButtonEvent *);
void buttonReleaseEvent(XButtonEvent *);
void enterNotifyEvent(XCrossingEvent *);
void leaveNotifyEvent(XCrossingEvent *);
void exposeEvent(XExposeEvent *);
void keyPressEvent(XKeyEvent *);
void redrawWindowLabel(Bool = False);
void redrawWorkspaceLabel(Bool = False);
void redrawPrevWorkspaceButton(Bool = False, Bool = False);
void redrawNextWorkspaceButton(Bool = False, Bool = False);
void redrawPrevWindowButton(Bool = False, Bool = False);
void redrawNextWindowButton(Bool = False, Bool = False);
void edit(void);
void reconfigure(void);
#ifdef HAVE_STRFTIME
void checkClock(Bool = False);
#else // HAVE_STRFTIME
void checkClock(Bool = False, Bool = False);
#endif // HAVE_STRFTIME
virtual void timeout(void);
enum Placement{ TOPLEFT = 1, BOTTOMLEFT, TOPCENTER,
BOTTOMCENTER, TOPRIGHT, BOTTOMRIGHT };
}; };
#endif // __Toolbar_hh #endif // TOOLBAR_HH

View file

@ -22,7 +22,7 @@
// 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: Window.hh,v 1.24 2002/07/10 14:46:42 fluxgen Exp $ // $Id: Window.hh,v 1.25 2002/08/04 15:55:13 fluxgen Exp $
#ifndef WINDOW_HH #ifndef WINDOW_HH
#define WINDOW_HH #define WINDOW_HH
@ -45,10 +45,16 @@
class Tab; class Tab;
/**
Creates the window frame and handles any window event for it
TODO: this is to huge!
*/
class FluxboxWindow : public TimeoutHandler { class FluxboxWindow : public TimeoutHandler {
public: public:
/// obsolete
enum Error{NOERROR=0, XGETWINDOWATTRIB, CANTFINDSCREEN}; enum Error{NOERROR=0, XGETWINDOWATTRIB, CANTFINDSCREEN};
#ifdef GNOME
#ifdef GNOME
enum GnomeLayer { enum GnomeLayer {
WIN_LAYER_DESKTOP = 0, WIN_LAYER_DESKTOP = 0,
WIN_LAYER_BELOW = 2, WIN_LAYER_BELOW = 2,
@ -79,7 +85,7 @@ public:
WIN_HINTS_GROUP_TRANSIENT = (1<<3), // Reserved - definition is unclear WIN_HINTS_GROUP_TRANSIENT = (1<<3), // Reserved - definition is unclear
WIN_HINTS_FOCUS_ON_CLICK = (1<<4) // app only accepts focus if clicked WIN_HINTS_FOCUS_ON_CLICK = (1<<4) // app only accepts focus if clicked
}; };
#endif #endif // GNOME
enum WinLayer { enum WinLayer {
LAYER_BOTTOM = 0x01, LAYER_BOTTOM = 0x01,
@ -116,9 +122,12 @@ public:
MwmDecorMaximize = (1l << 6) MwmDecorMaximize = (1l << 6)
}; };
explicit FluxboxWindow(Window, BScreen *scr = 0); explicit FluxboxWindow(Window win, BScreen *scr = 0);
virtual ~FluxboxWindow(); virtual ~FluxboxWindow();
/**
@name accessors
*/
//@{
inline bool isTransient() const { return ((transient) ? true : false); } inline bool isTransient() const { return ((transient) ? true : false); }
inline bool hasTransient() const { return ((client.transient) ? true : false); } inline bool hasTransient() const { return ((client.transient) ? true : false); }
inline bool isManaged() const { return managed; } inline bool isManaged() const { return managed; }
@ -136,10 +145,14 @@ public:
inline bool hasTab() const { return (tab!=0 ? true : false); } inline bool hasTab() const { return (tab!=0 ? true : false); }
inline bool isMoving() const { return moving; } inline bool isMoving() const { return moving; }
inline bool isResizing() const { return resizing; } inline bool isResizing() const { return resizing; }
inline BScreen *getScreen() const { return screen; } inline const BScreen *getScreen() const { return screen; }
inline Tab *getTab() const { return tab; } inline BScreen *getScreen() { return screen; }
inline FluxboxWindow *getTransient() const { return client.transient; } inline const Tab *getTab() const { return tab; }
inline FluxboxWindow *getTransientFor() const { return client.transient_for; } inline Tab *getTab() { return tab; }
inline const FluxboxWindow *getTransient() const { return client.transient; }
inline FluxboxWindow *getTransient() { return client.transient; }
inline const FluxboxWindow *getTransientFor() const { return client.transient_for; }
inline FluxboxWindow *getTransientFor() { return client.transient_for; }
inline const Window &getFrameWindow() const { return frame.window; } inline const Window &getFrameWindow() const { return frame.window; }
inline const Window &getClientWindow() const { return client.window; } inline const Window &getClientWindow() const { return client.window; }
@ -160,6 +173,8 @@ public:
inline unsigned int getClientHeight() const { return client.height; } inline unsigned int getClientHeight() const { return client.height; }
inline unsigned int getClientWidth() const { return client.width; } inline unsigned int getClientWidth() const { return client.width; }
inline unsigned int getTitleHeight() const { return frame.title_h; } inline unsigned int getTitleHeight() const { return frame.title_h; }
bool isLowerTab() const;
//@}
inline void setWindowNumber(int n) { window_number = n; } inline void setWindowNumber(int n) { window_number = n; }
@ -184,7 +199,7 @@ public:
void setWorkspace(int n); void setWorkspace(int n);
void changeBlackboxHints(BaseDisplay::BlackboxHints *bh); void changeBlackboxHints(BaseDisplay::BlackboxHints *bh);
void restoreAttributes(); void restoreAttributes();
bool isLowerTab() const;
void buttonPressEvent(XButtonEvent *be); void buttonPressEvent(XButtonEvent *be);
void buttonReleaseEvent(XButtonEvent *be); void buttonReleaseEvent(XButtonEvent *be);
@ -202,9 +217,9 @@ public:
static void showError(FluxboxWindow::Error error); static void showError(FluxboxWindow::Error error);
#ifdef SHAPE #ifdef SHAPE
void shapeEvent(XShapeEvent *); void shapeEvent(XShapeEvent *);
#endif // SHAPE #endif // SHAPE
virtual void timeout(); virtual void timeout();
@ -215,10 +230,11 @@ public:
unsigned long functions; // Motif wm functions unsigned long functions; // Motif wm functions
unsigned long decorations; // Motif wm decorations unsigned long decorations; // Motif wm decorations
} MwmHints; } MwmHints;
#ifdef GNOME
#ifdef GNOME
void setGnomeState(int state); void setGnomeState(int state);
inline int getGnomeHints() const { return gnome_hints; } inline int getGnomeHints() const { return gnome_hints; }
#endif //GNOME #endif //GNOME
private: private:
@ -326,7 +342,7 @@ private:
void destroyHandle(); void destroyHandle();
void checkTransient(); void checkTransient();
#ifdef GNOME #ifdef GNOME
void updateGnomeAtoms() const; void updateGnomeAtoms() const;
void updateGnomeStateAtom() const; void updateGnomeStateAtom() const;
@ -345,15 +361,15 @@ private:
void loadGnomeLayerAtom(); void loadGnomeLayerAtom();
int gnome_hints; int gnome_hints;
#endif //GNOME #endif //GNOME
#ifdef NEWWMSPEC #ifdef NEWWMSPEC
void updateNETWMAtoms(); void updateNETWMAtoms();
void handleNETWMProperyNotify(Atom atom); void handleNETWMProperyNotify(Atom atom);
int getNETWMWindowState(); int getNETWMWindowState();
#endif //NEWWMSPEC #endif //NEWWMSPEC
Window findTitleButton(int type); Window findTitleButton(int type);
private: private:

View file

@ -36,34 +36,54 @@
class BScreen; class BScreen;
/**
Handles a single workspace
*/
class Workspace:private NotCopyable { class Workspace:private NotCopyable {
public: public:
typedef std::vector<FluxboxWindow *> Windows; typedef std::vector<FluxboxWindow *> Windows;
Workspace(BScreen *screen, unsigned int workspaceid= 0); Workspace(BScreen *screen, unsigned int workspaceid = 0);
~Workspace(); ~Workspace();
inline void setLastFocusedWindow(FluxboxWindow *w) { lastfocus = w; } inline void setLastFocusedWindow(FluxboxWindow *w) { lastfocus = w; }
/**
Set workspace name
*/
void setName(const char *name); void setName(const char *name);
void showAll(); void showAll();
void hideAll(); void hideAll();
void removeAll(); void removeAll();
void raiseWindow(FluxboxWindow *); void raiseWindow(FluxboxWindow *win);
void lowerWindow(FluxboxWindow *); void lowerWindow(FluxboxWindow *win);
void reconfigure(); void reconfigure();
void update(); void update();
void setCurrent(); void setCurrent();
void shutdown(); void shutdown();
int addWindow(FluxboxWindow *window, bool place = false); int addWindow(FluxboxWindow *win, bool place = false);
int removeWindow(FluxboxWindow *); int removeWindow(FluxboxWindow *win);
BScreen *getScreen() { return screen; }
FluxboxWindow *getLastFocusedWindow() { return lastfocus; }
inline BScreen *getScreen() const { return screen; } const BScreen *getScreen() const { return screen; }
inline FluxboxWindow *getLastFocusedWindow(void) const { return lastfocus; } const FluxboxWindow *getLastFocusedWindow() const { return lastfocus; }
inline Clientmenu *menu() { return &m_clientmenu; } Clientmenu *menu() { return &m_clientmenu; }
/**
@return client menu
*/
inline const Clientmenu *menu() const { return &m_clientmenu; } inline const Clientmenu *menu() const { return &m_clientmenu; }
/**
@return name of this workspace
*/
inline const std::string &name() const { return m_name; } inline const std::string &name() const { return m_name; }
/**
@return the number of this workspace, note: obsolete, should be in BScreen
*/
inline unsigned int workspaceID() const { return m_id; } inline unsigned int workspaceID() const { return m_id; }
/**
@param id the window id number
@return window that match the id, else 0
*/
FluxboxWindow *getWindow(unsigned int id); FluxboxWindow *getWindow(unsigned int id);
const FluxboxWindow *getWindow(unsigned int id) const; const FluxboxWindow *getWindow(unsigned int id) const;
inline const Windows &getWindowList() const { return windowList; } inline const Windows &getWindowList() const { return windowList; }
@ -72,7 +92,7 @@ public:
int getCount() const; int getCount() const;
protected: protected:
void placeWindow(FluxboxWindow *); void placeWindow(FluxboxWindow *win);
private: private:
BScreen *screen; BScreen *screen;
@ -85,11 +105,11 @@ private:
WindowStack stackingList; WindowStack stackingList;
Windows windowList; Windows windowList;
std::string m_name; std::string m_name; ///< name of this workspace
unsigned int m_id; unsigned int m_id; ///< id, obsolete, this should be in BScreen
int cascade_x, cascade_y; int cascade_x, cascade_y;
}; };
#endif // _WORKSPACE_HH_ #endif // WORKSPACE_HH

View file

@ -22,7 +22,7 @@
// 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: fluxbox.hh,v 1.21 2002/07/19 21:26:11 fluxgen Exp $ // $Id: fluxbox.hh,v 1.22 2002/08/04 15:55:13 fluxgen Exp $
#ifndef FLUXBOX_HH #ifndef FLUXBOX_HH
#define FLUXBOX_HH #define FLUXBOX_HH
@ -62,6 +62,10 @@
#include <map> #include <map>
#include <list> #include <list>
/**
main class for the window manager.
singleton type
*/
class Fluxbox : public BaseDisplay, public TimeoutHandler { class Fluxbox : public BaseDisplay, public TimeoutHandler {
public: public:
@ -73,11 +77,11 @@ public:
inline void saveTabs(bool value) { *m_rc_tabs = value; } inline void saveTabs(bool value) { *m_rc_tabs = value; }
inline void saveIconBar(bool value) { m_rc_iconbar = value; } inline void saveIconBar(bool value) { m_rc_iconbar = value; }
#ifdef HAVE_GETPID #ifdef HAVE_GETPID
inline const Atom &getFluxboxPidAtom(void) const { return fluxbox_pid; } inline const Atom &getFluxboxPidAtom() const { return fluxbox_pid; }
#ifdef KDE #ifdef KDE
//For KDE dock applets //For KDE dock applets
inline const Atom &getKWM1DockwindowAtom(void) const { return kwm1_dockwindow; } //KDE v1.x inline const Atom &getKWM1DockwindowAtom() const { return kwm1_dockwindow; } //KDE v1.x
inline const Atom &getKWM2DockwindowAtom(void) const { return kwm2_dockwindow; } //KDE v2.x inline const Atom &getKWM2DockwindowAtom() const { return kwm2_dockwindow; } //KDE v2.x
#endif #endif
#endif // HAVE_GETPID #endif // HAVE_GETPID
@ -85,39 +89,39 @@ public:
FluxboxWindow *searchGroup(Window, FluxboxWindow *); FluxboxWindow *searchGroup(Window, FluxboxWindow *);
FluxboxWindow *searchWindow(Window); FluxboxWindow *searchWindow(Window);
inline FluxboxWindow *getFocusedWindow(void) { return focused_window; } inline FluxboxWindow *getFocusedWindow() { return focused_window; }
BScreen *searchScreen(Window); BScreen *searchScreen(Window w);
inline const Time &getDoubleClickInterval(void) const inline const Time &getDoubleClickInterval() const { return resource.double_click_interval; }
{ return resource.double_click_interval; } inline const Time &getLastTime() const { return last_time; }
inline const Time &getLastTime(void) const { return last_time; }
Toolbar *searchToolbar(Window); Toolbar *searchToolbar(Window w);
Tab *searchTab(Window); Tab *searchTab(Window);
/// obsolete
enum Titlebar{SHADE=0, MINIMIZE, MAXIMIZE, CLOSE, STICK, MENU, EMPTY}; enum Titlebar{SHADE=0, MINIMIZE, MAXIMIZE, CLOSE, STICK, MENU, EMPTY};
inline const std::vector<Fluxbox::Titlebar>& getTitlebarRight() { return *m_rc_titlebar_right; } inline const std::vector<Fluxbox::Titlebar>& getTitlebarRight() { return *m_rc_titlebar_right; }
inline const std::vector<Fluxbox::Titlebar>& getTitlebarLeft() { return *m_rc_titlebar_left; } inline const std::vector<Fluxbox::Titlebar>& getTitlebarLeft() { return *m_rc_titlebar_left; }
inline const char *getStyleFilename(void) const { return m_rc_stylefile->c_str(); } inline const char *getStyleFilename() const { return m_rc_stylefile->c_str(); }
inline const char *getMenuFilename(void) const { return m_rc_menufile->c_str(); } inline const char *getMenuFilename() const { return m_rc_menufile->c_str(); }
inline const std::string &getSlitlistFilename(void) const { return *m_rc_slitlistfile; } inline const std::string &getSlitlistFilename() const { return *m_rc_slitlistfile; }
inline int colorsPerChannel(void) const { return *m_rc_colors_per_channel; } inline int colorsPerChannel() const { return *m_rc_colors_per_channel; }
inline const timeval &getAutoRaiseDelay(void) const { return resource.auto_raise_delay; } inline const timeval &getAutoRaiseDelay() const { return resource.auto_raise_delay; }
inline unsigned int getCacheLife(void) const { return *m_rc_cache_life * 60000; } inline unsigned int getCacheLife() const { return *m_rc_cache_life * 60000; }
inline unsigned int getCacheMax(void) const { return *m_rc_cache_max; } inline unsigned int getCacheMax() const { return *m_rc_cache_max; }
inline void maskWindowEvents(Window w, FluxboxWindow *bw) inline void maskWindowEvents(Window w, FluxboxWindow *bw)
{ masked = w; masked_window = bw; } { masked = w; masked_window = bw; }
inline void setNoFocus(Bool f) { no_focus = f; } inline void setNoFocus(Bool f) { no_focus = f; }
void setFocusedWindow(FluxboxWindow *w); void setFocusedWindow(FluxboxWindow *w);
void shutdown(void); void shutdown();
void load_rc(BScreen *); void load_rc(BScreen *);
void loadRootCommand(BScreen *); void loadRootCommand(BScreen *);
void loadTitlebar(); void loadTitlebar();
@ -130,21 +134,21 @@ public:
void saveToolbarSearch(Window, Toolbar *); void saveToolbarSearch(Window, Toolbar *);
void saveTabSearch(Window, Tab *); void saveTabSearch(Window, Tab *);
void saveGroupSearch(Window, FluxboxWindow *); void saveGroupSearch(Window, FluxboxWindow *);
void save_rc(void); void save_rc();
void removeMenuSearch(Window); void removeMenuSearch(Window);
void removeWindowSearch(Window); void removeWindowSearch(Window);
void removeToolbarSearch(Window); void removeToolbarSearch(Window);
void removeTabSearch(Window); void removeTabSearch(Window);
void removeGroupSearch(Window); void removeGroupSearch(Window);
void restart(const char * = 0); void restart(const char * = 0);
void reconfigure(void); void reconfigure();
void reconfigureTabs(void); void reconfigureTabs();
void rereadMenu(void); void rereadMenu();
void checkMenu(void); void checkMenu();
virtual Bool handleSignal(int); virtual Bool handleSignal(int);
virtual void timeout(void); virtual void timeout();
#ifdef SLIT #ifdef SLIT
Slit *searchSlit(Window); Slit *searchSlit(Window);
@ -238,18 +242,18 @@ protected:
Fluxbox(int, char **, char * = 0, char * = 0); Fluxbox(int, char **, char * = 0, char * = 0);
char *getRcFilename(); char *getRcFilename();
void getDefaultDataFilename(char *, std::string &); void getDefaultDataFilename(char *, std::string &);
void load_rc(void); void load_rc();
void reload_rc(void); void reload_rc();
void real_rereadMenu(void); void real_rereadMenu();
void real_reconfigure(void); void real_reconfigure();
virtual void process_event(XEvent *); virtual void process_event(XEvent *);
//only main should be able to creat new blackbox object //only main should be able to creat new blackbox object
//TODO this must be removed! //TODO this must be removed!
friend int main(int,char **); friend int main(int,char **);
static Fluxbox *singleton; //singleton object ( can only be destroyed by main ) static Fluxbox *singleton; //singleton object ( can only be destroyed by main )
virtual ~Fluxbox(void); virtual ~Fluxbox();
}; };