fixed auto_ptr for m_toolbar, rearranged includes, fixed forward declaration, removed

fluxbox from constructor and fixed some minor accessors
This commit is contained in:
fluxgen 2002-10-25 20:56:12 +00:00
parent 527e21377f
commit cc60dc63d6

View file

@ -22,21 +22,19 @@
// 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.47 2002/10/15 10:54:40 fluxgen Exp $ // $Id: Screen.hh,v 1.48 2002/10/25 20:56:12 fluxgen Exp $
#ifndef SCREEN_HH #ifndef SCREEN_HH
#define SCREEN_HH #define SCREEN_HH
#include "Theme.hh" #include "Theme.hh"
#include "BaseDisplay.hh" #include "BaseDisplay.hh"
#include "Configmenu.hh"
#include "Icon.hh"
#include "Netizen.hh" #include "Netizen.hh"
#include "Rootmenu.hh"
#include "Timer.hh" #include "Timer.hh"
#include "Workspace.hh" #include "Workspace.hh"
#include "Workspacemenu.hh" #include "Tab.hh"
#include "fluxbox.hh" #include "Resource.hh"
#include "Toolbar.hh"
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
@ -65,13 +63,19 @@
#include <list> #include <list>
#include <vector> #include <vector>
#include <fstream> #include <fstream>
#include <memory>
class Configmenu;
class Workspacemenu;
class Iconmenu;
class Rootmenu;
class BScreen : public ScreenInfo { class BScreen : public ScreenInfo {
public: public:
typedef std::vector<Workspace *> Workspaces; typedef std::vector<Workspace *> Workspaces;
typedef std::vector<std::string> WorkspaceNames; typedef std::vector<std::string> WorkspaceNames;
BScreen(ResourceManager &rm, Fluxbox *b, BScreen(ResourceManager &rm,
const std::string &screenname, const std::string &altscreenname, const std::string &screenname, const std::string &altscreenname,
int scrn); int scrn);
~BScreen(); ~BScreen();
@ -99,8 +103,10 @@ public:
inline const FbTk::Color *getBorderColor() const { return &theme->getBorderColor(); } inline const FbTk::Color *getBorderColor() const { return &theme->getBorderColor(); }
inline BImageControl *getImageControl() { return image_control; } inline BImageControl *getImageControl() { return image_control; }
inline Rootmenu *getRootmenu() { return rootmenu; } const Rootmenu * const getRootmenu() const { return rootmenu; }
inline const std::string &getRootCommand(void ) const { return *resource.rootcommand; } Rootmenu * const getRootmenu() { return rootmenu; }
inline const std::string &getRootCommand() const { return *resource.rootcommand; }
#ifdef SLIT #ifdef SLIT
inline bool isSlitOnTop() const { return resource.slit_on_top; } inline bool isSlitOnTop() const { return resource.slit_on_top; }
inline bool doSlitAutoHide() const { return resource.slit_auto_hide; } inline bool doSlitAutoHide() const { return resource.slit_auto_hide; }
@ -119,12 +125,14 @@ public:
#endif // SLIT #endif // SLIT
inline Toolbar *getToolbar() { return toolbar; } inline const Toolbar * const getToolbar() const { return m_toolbar.get(); }
inline Toolbar * const getToolbar() { return m_toolbar.get(); }
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() { return current_workspace; } inline Workspace *getCurrentWorkspace() { return current_workspace; }
inline Workspacemenu *getWorkspacemenu() { return workspacemenu; } const Workspacemenu * const getWorkspacemenu() const { return workspacemenu; }
Workspacemenu * const getWorkspacemenu() { return workspacemenu; }
inline unsigned int getHandleWidth() const { return theme->getHandleWidth(); } inline unsigned int getHandleWidth() const { return theme->getHandleWidth(); }
inline unsigned int getBevelWidth() const { return theme->getBevelWidth(); } inline unsigned int getBevelWidth() const { return theme->getBevelWidth(); }
@ -201,8 +209,8 @@ 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() { iconmenu->update(); } void iconUpdate();
inline Iconmenu *getIconmenu() { return iconmenu; } inline const Iconmenu *getIconmenu() const { return m_iconmenu; }
inline void setAutoGroupWindow(Window w = 0) { auto_group_window = w; } inline void setAutoGroupWindow(Window w = 0) { auto_group_window = w; }
void setAntialias(bool value); void setAntialias(bool value);
@ -289,6 +297,12 @@ public:
}; };
private: private:
void createStyleMenu(Rootmenu *menu, bool newmenu, const char *label, const char *directory);
bool parseMenuFile(std::ifstream &, Rootmenu *, int&);
void initMenu();
bool doSkipWindow(const FluxboxWindow *w, int options); bool doSkipWindow(const FluxboxWindow *w, int options);
ScreenSubject ScreenSubject
@ -297,7 +311,6 @@ private:
m_workspacenames_sig, ///< workspace names signal m_workspacenames_sig, ///< workspace names signal
m_currentworkspace_sig; ///< current workspace signal m_currentworkspace_sig; ///< current workspace signal
Theme *theme; Theme *theme;
@ -306,10 +319,9 @@ private:
Pixmap geom_pixmap; Pixmap geom_pixmap;
Window geom_window; Window geom_window;
Fluxbox *fluxbox;
BImageControl *image_control; BImageControl *image_control;
Configmenu *configmenu; Configmenu *configmenu;
Iconmenu *iconmenu; Iconmenu *m_iconmenu;
Rootmenu *rootmenu; Rootmenu *rootmenu;
@ -320,11 +332,11 @@ private:
Netizens netizenList; Netizens netizenList;
Icons iconList; Icons iconList;
#ifdef SLIT #ifdef SLIT
Slit *slit; Slit *slit;
#endif // SLIT #endif // SLIT
Toolbar *toolbar; std::auto_ptr<Toolbar> m_toolbar;
Workspace *current_workspace; Workspace *current_workspace;
Workspacemenu *workspacemenu; Workspacemenu *workspacemenu;
@ -382,22 +394,7 @@ private:
#endif // HAVE_STRFTIME #endif // HAVE_STRFTIME
} resource; } resource;
void createStyleMenu(Rootmenu *menu, bool newmenu, const char *label, const char *directory);
protected:
bool parseMenuFile(std::ifstream &, Rootmenu *, int&);
bool readDatabaseTexture(char *, char *, FbTk::Texture *, unsigned long);
bool readDatabaseColor(char *, char *, FbTk::Color *, unsigned long);
void readDatabaseFontSet(char *, char *, XFontSet *);
XFontSet createFontSet(char *);
void readDatabaseFont(char *, char *, XFontStruct **);
void initMenu();
}; };
#endif // _SCREEN_HH_ #endif // SCREEN_HH