fluxbox/src/Screen.hh

596 lines
22 KiB
C++
Raw Normal View History

// Screen.hh for Fluxbox Window Manager
2006-02-16 06:53:05 +00:00
// Copyright (c) 2001 - 2006 Henrik Kinnunen (fluxgen at fluxbox dot org)
2005-01-24 17:14:24 +00:00
//
2001-12-11 20:47:02 +00:00
// Screen.hh for Blackbox - an X11 Window manager
// Copyright (c) 1997 - 2000 Brad Hughes (bhughes at tcac.net)
2001-12-11 20:47:02 +00:00
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// 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:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2002-05-08 14:25:40 +00:00
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
2001-12-11 20:47:02 +00:00
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// 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
// DEALINGS IN THE SOFTWARE.
2004-11-19 11:37:27 +00:00
// $Id$
2001-12-11 20:47:02 +00:00
#ifndef SCREEN_HH
#define SCREEN_HH
2002-01-04 21:21:43 +00:00
2006-03-22 12:23:17 +00:00
#include "FbWinFrame.hh"
2003-05-10 22:45:08 +00:00
#include "FbRootWindow.hh"
#include "MenuTheme.hh"
2001-12-11 20:47:02 +00:00
#include "FbTk/EventHandler.hh"
#include "FbTk/Resource.hh"
#include "FbTk/Subject.hh"
#include "FbTk/MultLayers.hh"
#include "FbTk/NotCopyable.hh"
#include "FbTk/Observer.hh"
2002-01-10 12:49:15 +00:00
#include <X11/Xlib.h>
#include <X11/Xresource.h>
2004-08-31 15:26:40 +00:00
#ifdef HAVE_CSTDIO
#include <cstdio>
#else
#include <stdio.h>
#endif
2002-01-10 12:49:15 +00:00
#include <string>
2002-02-08 13:35:20 +00:00
#include <list>
#include <vector>
2002-01-27 12:45:32 +00:00
#include <fstream>
#include <memory>
#include <map>
2007-03-31 19:10:16 +00:00
class ClientPattern;
class Focusable;
class FluxboxWindow;
class FbWinFrameTheme;
class RootTheme;
class WinButtonTheme;
2003-04-14 12:13:36 +00:00
class WinClient;
class Workspace;
2003-06-18 13:42:21 +00:00
class Strut;
2003-06-20 01:30:08 +00:00
class Slit;
class HeadArea;
class FocusControl;
class ScreenPlacement;
2002-01-27 12:45:32 +00:00
2003-01-07 02:03:57 +00:00
namespace FbTk {
class Menu;
2003-01-10 00:35:19 +00:00
class ImageControl;
2003-04-26 14:47:40 +00:00
class XLayerItem;
2003-05-19 15:32:47 +00:00
class FbWindow;
2003-08-25 13:15:53 +00:00
class Subject;
}
2003-01-07 02:03:57 +00:00
/// Handles screen connection, screen clients and workspaces
/**
2003-06-25 05:47:23 +00:00
Create workspaces, handles switching between workspaces and windows
*/
class BScreen: public FbTk::EventHandler, public FbTk::Observer,
private FbTk::NotCopyable {
2001-12-11 20:47:02 +00:00
public:
/// a window becomes active / focussed on a different workspace
enum FollowModel {
IGNORE_OTHER_WORKSPACES = 0, ///< who cares?
2007-10-13 21:51:37 +00:00
FOLLOW_ACTIVE_WINDOW, ///< go to that workspace
SEMIFOLLOW_ACTIVE_WINDOW, ///< fetch iconified windows, else follow
2007-10-13 21:51:37 +00:00
FETCH_ACTIVE_WINDOW ///< put that window to the current workspace
};
2007-03-31 19:10:16 +00:00
typedef std::list<FluxboxWindow *> Icons;
2002-12-01 13:42:15 +00:00
typedef std::vector<Workspace *> Workspaces;
typedef std::vector<std::string> WorkspaceNames;
typedef std::list<std::pair<FbTk::FbString, FbTk::Menu *> > ExtraMenus;
2003-06-18 13:42:21 +00:00
2003-05-18 22:04:06 +00:00
BScreen(FbTk::ResourceManager &rm,
2002-12-01 13:42:15 +00:00
const std::string &screenname, const std::string &altscreenname,
2003-02-03 13:50:35 +00:00
int scrn, int number_of_layers);
2002-12-01 13:42:15 +00:00
~BScreen();
void initWindows();
void initMenus();
bool isRootColormapInstalled() const { return root_colormap_installed; }
bool isScreenManaged() const { return managed; }
bool isWorkspaceWarping() const { return *resource.workspace_warping; }
bool doAutoRaise() const { return *resource.auto_raise; }
bool clickRaises() const { return *resource.click_raises; }
bool doOpaqueMove() const { return *resource.opaque_move; }
bool doFullMax() const { return *resource.full_max; }
2007-10-13 21:51:37 +00:00
bool getMaxIgnoreIncrement() const { return *resource.max_ignore_inc; }
bool getMaxDisableMove() const { return *resource.max_disable_move; }
bool getMaxDisableResize() const { return *resource.max_disable_resize; }
bool doShowWindowPos() const { return *resource.show_window_pos; }
bool decorateTransient() const { return *resource.decorate_transient; }
const std::string &defaultDeco() const { return *resource.default_deco; }
const std::string &windowMenuFilename() const { return *resource.windowmenufile; }
FbTk::ImageControl &imageControl() { return *m_image_control.get(); }
// menus
const FbTk::Menu &rootMenu() const { return *m_rootmenu.get(); }
FbTk::Menu &rootMenu() { return *m_rootmenu.get(); }
const FbTk::Menu &configMenu() const { return *m_configmenu.get(); }
FbTk::Menu &configMenu() { return *m_configmenu.get(); }
const FbTk::Menu &windowMenu() const { return *m_windowmenu.get(); }
FbTk::Menu &windowMenu() { return *m_windowmenu.get(); }
ExtraMenus &extraWindowMenus() { return m_extramenus; }
const ExtraMenus &extraWindowMenus() const { return m_extramenus; }
2006-03-22 12:23:17 +00:00
FbWinFrame::TabPlacement getTabPlacement() const { return *resource.tab_placement; }
2007-10-13 21:51:37 +00:00
inline unsigned int noFocusWhileTypingDelay() const { return *resource.typing_delay; }
inline FollowModel getFollowModel() const { return *resource.follow_model; }
inline FollowModel getUserFollowModel() const { return *resource.user_follow_model; }
2002-12-01 13:42:15 +00:00
inline const std::string &getScrollAction() const { return *resource.scroll_action; }
inline const bool getScrollReverse() const { return *resource.scroll_reverse; }
inline const bool allowRemoteActions() const { return *resource.allow_remote_actions; }
2007-10-13 21:51:37 +00:00
inline const bool clientMenuUsePixmap() const { return *resource.clientmenu_use_pixmap; }
2006-03-22 12:23:17 +00:00
inline const bool getDefaultInternalTabs() const { return *resource.default_internal_tabs; }
2007-10-13 21:51:37 +00:00
inline const bool getTabsUsePixmap() const { return *resource.tabs_use_pixmap; }
inline const bool getMaxOverTabs() const { return *resource.max_over_tabs; }
inline unsigned int getTabWidth() const { return *resource.tab_width; }
2007-03-31 19:10:16 +00:00
/// @return the slit, @see Slit
2003-05-15 12:00:46 +00:00
inline Slit *slit() { return m_slit.get(); }
2007-03-31 19:10:16 +00:00
/// @return the slit, @see Slit
2003-05-15 12:00:46 +00:00
inline const Slit *slit() const { return m_slit.get(); }
2007-03-31 19:10:16 +00:00
/**
* @param w the workspace number
* @return workspace for the given workspace number
*/
2003-05-19 22:45:51 +00:00
inline Workspace *getWorkspace(unsigned int w) { return ( w < m_workspaces_list.size() ? m_workspaces_list[w] : 0); }
2007-03-31 19:10:16 +00:00
/**
* @param w the workspace number
* @return workspace for the given workspace number
*/
inline const Workspace *getWorkspace(unsigned int w) const {
return (w < m_workspaces_list.size() ? m_workspaces_list[w] : 0);
}
/// @return the current workspace
2003-05-19 22:45:51 +00:00
inline Workspace *currentWorkspace() { return m_current_workspace; }
inline const Workspace *currentWorkspace() const { return m_current_workspace; }
2007-03-31 19:10:16 +00:00
/// @return the workspace menu
const FbTk::Menu &workspaceMenu() const { return *m_workspacemenu.get(); }
2007-03-31 19:10:16 +00:00
/// @return the workspace menu
FbTk::Menu &workspaceMenu() { return *m_workspacemenu.get(); }
2007-03-31 19:10:16 +00:00
/// @return focus control handler
const FocusControl &focusControl() const { return *m_focus_control; }
2007-03-31 19:10:16 +00:00
/// @return focus control handler
FocusControl &focusControl() { return *m_focus_control; }
2007-03-31 19:10:16 +00:00
/// @return the current workspace id
2003-05-15 12:00:46 +00:00
unsigned int currentWorkspaceID() const;
2007-03-31 19:10:16 +00:00
/**
*
*/
2007-03-31 19:10:16 +00:00
/// @return maximum screen bound to the left for a specific xinerama head
unsigned int maxLeft(int head) const;
2007-03-31 19:10:16 +00:00
/// @return maximum screen bound to the right for a specific xinerama head
unsigned int maxRight(int head) const;
2007-03-31 19:10:16 +00:00
/// @return maximum screen bound at the top for the specified xinerama head
unsigned int maxTop(int head) const;
2007-03-31 19:10:16 +00:00
/// @return maximum screen bound at bottom for the specified xinerama head
unsigned int maxBottom(int head) const;
/// @return true if window is kde dock app
bool isKdeDockapp(Window win) const;
/// @return true if dock app was added, else false
bool addKdeDockapp(Window win);
2007-03-31 19:10:16 +00:00
/// @return screen width, @see rootWindow()
unsigned int width() const { return rootWindow().width(); }
2007-03-31 19:10:16 +00:00
/// @return screen height, @see rootWindow()
unsigned int height() const { return rootWindow().height(); }
2007-03-31 19:10:16 +00:00
/// @return number of the screen, @see rootWindow()
int screenNumber() const { return rootWindow().screenNumber(); }
2002-12-01 13:42:15 +00:00
/// @return number of workspaces
size_t numberOfWorkspaces() const { return m_workspaces_list.size(); }
const Icons &iconList() const { return m_icon_list; }
Icons &iconList() { return m_icon_list; }
2003-05-19 22:45:51 +00:00
const Workspaces &getWorkspacesList() const { return m_workspaces_list; }
2003-08-12 00:27:13 +00:00
Workspaces &getWorkspacesList() { return m_workspaces_list; }
2003-05-19 22:45:51 +00:00
const WorkspaceNames &getWorkspaceNames() const { return m_workspace_names; }
/**
@name Screen signals
*/
//@{
2002-12-01 13:42:15 +00:00
/// client list signal
FbTk::Subject &clientListSig() { return m_clientlist_sig; }
/// icon list sig
FbTk::Subject &iconListSig() { return m_iconlist_sig; }
2002-12-01 13:42:15 +00:00
/// workspace count signal
FbTk::Subject &workspaceCountSig() { return m_workspacecount_sig; }
/// workspace names signal
FbTk::Subject &workspaceNamesSig() { return m_workspacenames_sig; }
2004-01-19 18:29:43 +00:00
/// workspace area signal
FbTk::Subject &workspaceAreaSig() { return m_workspace_area_sig; }
2002-12-01 13:42:15 +00:00
/// current workspace signal
FbTk::Subject &currentWorkspaceSig() { return m_currentworkspace_sig; }
/// focused window signal
FbTk::Subject &focusedWindowSig() { return m_focusedwindow_sig; }
2003-07-01 12:39:09 +00:00
/// reconfigure signal
FbTk::Subject &reconfigureSig() { return m_reconfigure_sig; }
FbTk::Subject &resizeSig() { return m_resize_sig; }
FbTk::Subject &bgChangeSig() { return m_bg_change_sig; }
//@}
2003-08-25 13:15:53 +00:00
2007-03-31 19:10:16 +00:00
/// called when the screen receives a signal from a subject
2003-08-25 13:15:53 +00:00
void update(FbTk::Subject *subj);
void propertyNotify(Atom atom);
void keyPressEvent(XKeyEvent &ke);
void keyReleaseEvent(XKeyEvent &ke);
void buttonPressEvent(XButtonEvent &be);
void notifyUngrabKeyboard();
2007-03-31 19:10:16 +00:00
/**
* Cycles focus of windows
* @param opts focus options
2007-10-13 21:51:37 +00:00
* @param pat specific pattern to match windows with
2007-03-31 19:10:16 +00:00
* @param reverse the order of cycling
*/
2007-10-13 21:51:37 +00:00
void cycleFocus(int opts = 0, const ClientPattern *pat = 0, bool reverse = false);
2007-03-31 19:10:16 +00:00
/**
* Creates an empty menu with specified label
* @param label for the menu
* @return create menu
*/
2003-12-10 23:08:06 +00:00
FbTk::Menu *createMenu(const std::string &label);
2007-03-31 19:10:16 +00:00
/**
* Creates an empty toggle menu with a specific label
* @param label
* @return created menu
*/
2006-03-22 12:23:17 +00:00
FbTk::Menu *createToggleMenu(const std::string &label);
2007-03-31 19:10:16 +00:00
/**
* For extras to add menus.
* These menus will be marked internal,
* and deleted when the window dies (as opposed to Screen
*/
void addExtraWindowMenu(const FbTk::FbString &label, FbTk::Menu *menu);
2003-12-10 23:08:06 +00:00
2002-12-01 13:42:15 +00:00
inline int getEdgeSnapThreshold() const { return *resource.edge_snap_threshold; }
void setRootColormapInstalled(bool r) { root_colormap_installed = r; }
2006-03-22 12:23:17 +00:00
void saveTabPlacement(FbWinFrame::TabPlacement place) { *resource.tab_placement = place; }
void saveWorkspaces(int w) { *resource.workspaces = w; }
void saveMenu(FbTk::Menu &menu) { m_rootmenu_list.push_back(&menu); }
2002-12-01 13:42:15 +00:00
FbWinFrameTheme &winFrameTheme() { return *m_windowtheme.get(); }
const FbWinFrameTheme &winFrameTheme() const { return *m_windowtheme.get(); }
MenuTheme &menuTheme() { return *m_menutheme.get(); }
const MenuTheme &menuTheme() const { return *m_menutheme.get(); }
const RootTheme &rootTheme() const { return *m_root_theme.get(); }
WinButtonTheme &winButtonTheme() { return *m_winbutton_theme.get(); }
const WinButtonTheme &winButtonTheme() const { return *m_winbutton_theme.get(); }
FbRootWindow &rootWindow() { return m_root_window; }
const FbRootWindow &rootWindow() const { return m_root_window; }
2003-01-07 02:03:57 +00:00
2007-10-13 21:51:37 +00:00
FbTk::FbWindow &dummyWindow() { return m_dummy_window; }
const FbTk::FbWindow &dummyWindow() const { return m_dummy_window; }
FbTk::MultLayers &layerManager() { return m_layermanager; }
const FbTk::MultLayers &layerManager() const { return m_layermanager; }
FbTk::ResourceManager &resourceManager() { return m_resource_manager; }
const FbTk::ResourceManager &resourceManager() const { return m_resource_manager; }
const std::string &name() const { return m_name; }
const std::string &altName() const { return m_altname; }
bool isShuttingdown() const { return m_shutdown; }
bool isRestart();
2003-12-19 01:46:58 +00:00
ScreenPlacement &placementStrategy() { return *m_placement_strategy; }
const ScreenPlacement &placementStrategy() const { return *m_placement_strategy; }
2002-12-01 13:42:15 +00:00
int addWorkspace();
int removeLastWorkspace();
2003-07-01 12:39:09 +00:00
// scroll workspaces
2007-03-31 19:10:16 +00:00
/// go to next workspace ( right )
void nextWorkspace() { nextWorkspace(1); }
2007-03-31 19:10:16 +00:00
/// go to previous workspace
void prevWorkspace() { prevWorkspace(1); }
2007-03-31 19:10:16 +00:00
/**
* Jump forward to a workspace
* @param delta number of steps to jump
*/
void nextWorkspace(int delta);
2007-03-31 19:10:16 +00:00
/**
* Jump backwards to a workspace
* @param delta number of steps to jump
*/
void prevWorkspace(int delta);
2007-03-31 19:10:16 +00:00
/**
* Jump right to a workspace.
* @param delta number of steps to jump
*/
void rightWorkspace(int delta);
2007-03-31 19:10:16 +00:00
/**
* Jump left to a workspace
* @param delta number of steps to jump
*/
void leftWorkspace(int delta);
2002-12-01 13:42:15 +00:00
/// update workspace name for given workspace
void updateWorkspaceName(unsigned int w);
2007-03-31 19:10:16 +00:00
/// remove all workspace names
2002-12-01 13:42:15 +00:00
void removeWorkspaceNames();
2007-03-31 19:10:16 +00:00
/// update the workspace name atom
2002-12-01 13:42:15 +00:00
void updateWorkspaceNamesAtom();
2007-03-31 19:10:16 +00:00
/// add a workspace name to the end of the workspace name list
2002-12-01 13:42:15 +00:00
void addWorkspaceName(const char *name);
2007-03-31 19:10:16 +00:00
/// add a window to the icon list
2002-12-01 13:42:15 +00:00
void addIcon(FluxboxWindow *win);
2007-03-31 19:10:16 +00:00
/// remove a window from the icon list
2002-12-01 13:42:15 +00:00
void removeIcon(FluxboxWindow *win);
2007-03-31 19:10:16 +00:00
/// remove a window
2002-12-01 13:42:15 +00:00
void removeWindow(FluxboxWindow *win);
2007-03-31 19:10:16 +00:00
/// remove a client
void removeClient(WinClient &client);
2007-03-31 19:10:16 +00:00
/**
* Gets name of a specific workspace
* @param workspace the workspace number to get the name of
* @return name of the workspace
*/
2002-12-01 13:42:15 +00:00
std::string getNameOfWorkspace(unsigned int workspace) const;
2007-03-31 19:10:16 +00:00
/// changes workspace to specified id
void changeWorkspaceID(unsigned int, bool revert = true);
2007-03-31 19:10:16 +00:00
/**
* Sends a window to a workspace
* @param workspace the workspace id
* @param win the window to send
* @param changeworkspace whether current workspace should change
*/
void sendToWorkspace(unsigned int workspace, FluxboxWindow *win=0,
bool changeworkspace=true);
2007-03-31 19:10:16 +00:00
/**
* Reassociate a window to another workspace
* @param window the window to reassociate
* @param workspace_id id of the workspace
* @param ignore_sticky ignores any sticky windows
*/
void reassociateWindow(FluxboxWindow *window, unsigned int workspace_id,
bool ignore_sticky);
2002-12-01 13:42:15 +00:00
void reconfigure();
2006-03-22 12:23:17 +00:00
void reconfigureTabs();
2002-12-01 13:42:15 +00:00
void rereadMenu();
void shutdown();
2003-06-12 15:22:59 +00:00
/// show position window centered on the screen with "X x Y" text
2002-12-01 13:42:15 +00:00
void showPosition(int x, int y);
void hidePosition();
2003-06-12 15:22:59 +00:00
/// show geomentry with "width x height"-text, not size of window
2006-07-20 11:16:09 +00:00
void showGeometry(int width, int height);
2002-12-01 13:42:15 +00:00
void hideGeometry();
2007-03-31 19:10:16 +00:00
void setLayer(FbTk::XLayerItem &item, int layernum);
2003-02-09 14:11:14 +00:00
// remove? no, items are never removed from their layer until they die
/// updates root window size and resizes/reconfigures screen clients
2003-06-25 05:47:23 +00:00
/// that depends on screen size (slit)
/// (and maximized windows?)
void updateSize();
// Xinerama-related functions
2007-03-31 19:10:16 +00:00
/// @return true if xinerama is available
bool hasXinerama() const { return m_xinerama_avail; }
2007-03-31 19:10:16 +00:00
/// @return umber of xinerama heads
int numHeads() const { return m_xinerama_num_heads; }
2003-05-19 15:32:47 +00:00
void initXinerama();
2007-03-31 19:10:16 +00:00
/**
* Determines head number for a position
* @param x position in pixels on the screen
* @param y position in pixels on the screen
* @return head number at this position
*/
int getHead(int x, int y) const;
2007-03-31 19:10:16 +00:00
/// @return head number of window
int getHead(const FbTk::FbWindow &win) const;
/// @return the current head number
int getCurrHead() const;
2007-03-31 19:10:16 +00:00
/// @return head x position
int getHeadX(int head) const;
2007-03-31 19:10:16 +00:00
/// @return head y position
int getHeadY(int head) const;
2007-03-31 19:10:16 +00:00
/// @return width of the head
int getHeadWidth(int head) const;
2007-03-31 19:10:16 +00:00
/// @return height of the head
int getHeadHeight(int head) const;
2007-03-31 19:10:16 +00:00
/// @return the new (x,y) for a rectangle fitted on a head
std::pair<int,int> clampToHead(int head, int x, int y, int w, int h) const;
2003-05-19 15:32:47 +00:00
// magic to allow us to have "on head" placement (menu) without
// the object really knowing about it.
template <typename OnHeadObject>
2007-03-31 19:10:16 +00:00
int getOnHead(OnHeadObject &obj) const;
// grouping - we want ordering, so we can either search for a
// group to the left, or to the right (they'll be different if
// they exist).
WinClient *findGroupLeft(WinClient &winclient);
WinClient *findGroupRight(WinClient &winclient);
/// create window frame for client window and attach it
FluxboxWindow *createWindow(Window clientwin);
2007-03-31 19:10:16 +00:00
/// creates a window frame for a winclient. The client is attached to the window
2003-04-14 12:13:36 +00:00
FluxboxWindow *createWindow(WinClient &client);
2003-06-18 13:42:21 +00:00
/// request workspace space, i.e "don't maximize over this area"
Strut *requestStrut(int head, int left, int right, int top, int bottom);
2003-06-18 13:42:21 +00:00
/// remove requested space and destroy strut
void clearStrut(Strut *strut);
/// updates max avaible area for the workspace
void updateAvailableWorkspaceArea();
2002-12-01 13:42:15 +00:00
// for extras to add menus. These menus must be marked
// internal for their safety, and __the extension__ must
// delete and remove the menu itself (opposite to Window)
void addConfigMenu(const FbTk::FbString &label, FbTk::Menu &menu);
void removeConfigMenu(FbTk::Menu &menu);
2003-12-19 01:46:58 +00:00
/// Adds a resource to managed resource list
/// This resource is now owned by Screen and will be destroyed
/// when screen dies
void addManagedResource(FbTk::Resource_base *resource);
2007-03-31 19:10:16 +00:00
/**
* Used to emit different signals for the screen
*/
2002-12-01 13:42:15 +00:00
class ScreenSubject:public FbTk::Subject {
public:
ScreenSubject(BScreen &scr):m_scr(scr) { }
const BScreen &screen() const { return m_scr; }
BScreen &screen() { return m_scr; }
private:
BScreen &m_scr;
};
2001-12-11 20:47:02 +00:00
private:
void setupConfigmenu(FbTk::Menu &menu);
2002-12-01 13:42:15 +00:00
void initMenu();
2003-06-12 15:22:59 +00:00
void renderGeomWindow();
void renderPosWindow();
2003-06-12 15:22:59 +00:00
const Strut* availableWorkspaceArea(int head) const;
2002-12-01 13:42:15 +00:00
ScreenSubject
m_clientlist_sig, ///< client signal
m_iconlist_sig, ///< notify if a window gets iconified/deiconified
2002-12-01 13:42:15 +00:00
m_workspacecount_sig, ///< workspace count signal
m_workspacenames_sig, ///< workspace names signal
2004-01-19 18:29:43 +00:00
m_workspace_area_sig, ///< workspace area changed signal
2003-07-01 12:39:09 +00:00
m_currentworkspace_sig, ///< current workspace signal
m_focusedwindow_sig, ///< focused window signal
m_reconfigure_sig, ///< reconfigure signal
m_resize_sig, ///< resize signal
m_bg_change_sig; ///< background change signal
2002-09-07 20:22:08 +00:00
2003-02-03 13:50:35 +00:00
FbTk::MultLayers m_layermanager;
2001-12-11 20:47:02 +00:00
bool root_colormap_installed, managed, geom_visible, pos_visible;
2002-12-01 13:42:15 +00:00
GC opGC;
Pixmap geom_pixmap, pos_pixmap;
2003-05-19 22:45:51 +00:00
2001-12-11 20:47:02 +00:00
2003-05-15 23:30:07 +00:00
std::auto_ptr<FbTk::ImageControl> m_image_control;
std::auto_ptr<FbTk::Menu> m_configmenu, m_rootmenu, m_workspacemenu, m_windowmenu;
ExtraMenus m_extramenus;
2001-12-11 20:47:02 +00:00
typedef std::list<FbTk::Menu *> Rootmenus;
typedef std::list<std::pair<FbTk::FbString, FbTk::Menu *> > Configmenus;
2002-02-08 13:35:20 +00:00
2003-05-19 22:45:51 +00:00
Rootmenus m_rootmenu_list;
Configmenus m_configmenu_list;
2003-05-19 22:45:51 +00:00
Icons m_icon_list;
2002-12-01 13:42:15 +00:00
std::auto_ptr<Slit> m_slit;
2003-03-03 21:51:13 +00:00
2003-05-19 22:45:51 +00:00
Workspace *m_current_workspace;
2001-12-11 20:47:02 +00:00
2003-05-19 22:45:51 +00:00
WorkspaceNames m_workspace_names;
Workspaces m_workspaces_list;
std::auto_ptr<FbWinFrameTheme> m_windowtheme;
std::auto_ptr<WinButtonTheme> m_winbutton_theme;
std::auto_ptr<MenuTheme> m_menutheme;
std::auto_ptr<RootTheme> m_root_theme;
2003-01-07 02:03:57 +00:00
2003-05-10 22:45:08 +00:00
FbRootWindow m_root_window;
2007-10-13 21:51:37 +00:00
FbTk::FbWindow m_geom_window, m_pos_window, m_dummy_window;
2003-05-10 22:45:08 +00:00
2002-12-01 13:42:15 +00:00
struct ScreenResource {
2003-05-18 22:04:06 +00:00
ScreenResource(FbTk::ResourceManager &rm, const std::string &scrname,
2002-12-01 13:42:15 +00:00
const std::string &altscrname);
2001-12-11 20:47:02 +00:00
2003-06-23 12:57:36 +00:00
FbTk::Resource<bool> image_dither, opaque_move, full_max,
2007-10-13 21:51:37 +00:00
max_ignore_inc, max_disable_move, max_disable_resize,
workspace_warping, show_window_pos, auto_raise, click_raises,
decorate_transient;
FbTk::Resource<std::string> default_deco;
FbTk::Resource<std::string> rootcommand;
2006-03-22 12:23:17 +00:00
FbTk::Resource<FbWinFrame::TabPlacement> tab_placement;
FbTk::Resource<std::string> windowmenufile;
2007-10-13 21:51:37 +00:00
FbTk::Resource<unsigned int> typing_delay;
FbTk::Resource<FollowModel> follow_model, user_follow_model;
bool ordered_dither;
FbTk::Resource<int> workspaces, edge_snap_threshold, focused_alpha,
unfocused_alpha, menu_alpha, menu_delay, menu_delay_close, tab_width;
2003-12-12 18:18:49 +00:00
FbTk::Resource<FbTk::MenuTheme::MenuMode> menu_mode;
FbTk::Resource<int> gc_line_width;
FbTk::Resource<FbTk::GContext::LineStyle> gc_line_style;
FbTk::Resource<FbTk::GContext::JoinStyle> gc_join_style;
FbTk::Resource<FbTk::GContext::CapStyle> gc_cap_style;
FbTk::Resource<std::string> scroll_action;
FbTk::Resource<bool> scroll_reverse;
FbTk::Resource<bool> allow_remote_actions;
2007-10-13 21:51:37 +00:00
FbTk::Resource<bool> clientmenu_use_pixmap;
FbTk::Resource<bool> tabs_use_pixmap;
FbTk::Resource<bool> max_over_tabs;
2006-03-22 12:23:17 +00:00
FbTk::Resource<bool> default_internal_tabs;
2001-12-11 20:47:02 +00:00
2007-03-31 19:10:16 +00:00
2002-12-01 13:42:15 +00:00
} resource;
2003-02-03 13:50:35 +00:00
/// Holds manage resources that screen destroys
FbTk::ResourceManager::ResourceList m_managed_resources;
FbTk::ResourceManager &m_resource_manager;
const std::string m_name, m_altname;
FocusControl *m_focus_control;
ScreenPlacement *m_placement_strategy;
// This is a map of windows to clients for clients that had a left
// window set, but that window wasn't present at the time
typedef std::map<Window, WinClient *> Groupables;
Groupables m_expecting_groups;
bool m_cycling;
2007-03-31 19:10:16 +00:00
const ClientPattern *m_cycle_opts;
// Xinerama related private data
bool m_xinerama_avail;
int m_xinerama_num_heads;
int m_xinerama_center_x, m_xinerama_center_y;
HeadArea *m_head_areas;
2003-06-18 13:42:21 +00:00
struct XineramaHeadInfo {
int x, y, width, height;
} *m_xinerama_headinfo;
2003-05-19 22:45:51 +00:00
bool m_restart, m_shutdown;
2001-12-11 20:47:02 +00:00
};
2003-02-03 13:50:35 +00:00
#endif // SCREEN_HH