2002-01-09 14:11:20 +00:00
|
|
|
// Window.hh for Fluxbox Window Manager
|
2003-01-05 22:20:46 +00:00
|
|
|
// Copyright (c) 2001-2003 Henrik Kinnunen (fluxgen at users.sourceforge.net)
|
2001-12-19 13:53:35 +00:00
|
|
|
//
|
2001-12-11 20:47:02 +00:00
|
|
|
// Window.hh for Blackbox - an X11 Window manager
|
2002-12-13 20:35:36 +00:00
|
|
|
// 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,
|
2003-01-05 22:20:46 +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.
|
|
|
|
|
2003-04-26 14:05:47 +00:00
|
|
|
// $Id: Window.hh,v 1.63 2003/04/26 14:05:47 rathnor Exp $
|
2002-01-09 14:11:20 +00:00
|
|
|
|
2002-02-17 18:47:45 +00:00
|
|
|
#ifndef WINDOW_HH
|
|
|
|
#define WINDOW_HH
|
2001-12-11 20:47:02 +00:00
|
|
|
|
2002-08-11 22:33:41 +00:00
|
|
|
#include "BaseDisplay.hh"
|
|
|
|
#include "Timer.hh"
|
2003-01-07 01:34:49 +00:00
|
|
|
#include "Menu.hh"
|
2002-09-07 20:16:43 +00:00
|
|
|
#include "Subject.hh"
|
2003-01-05 22:20:46 +00:00
|
|
|
#include "FbWinFrame.hh"
|
|
|
|
#include "EventHandler.hh"
|
2003-02-02 16:32:41 +00:00
|
|
|
#include "XLayerItem.hh"
|
2003-02-18 15:11:12 +00:00
|
|
|
#include "LayerMenu.hh"
|
2002-08-11 22:33:41 +00:00
|
|
|
|
2001-12-11 20:47:02 +00:00
|
|
|
#include <X11/Xlib.h>
|
|
|
|
#include <X11/Xutil.h>
|
|
|
|
|
2002-05-30 00:38:22 +00:00
|
|
|
#ifdef SHAPE
|
|
|
|
#include <X11/extensions/shape.h>
|
2001-12-11 20:47:02 +00:00
|
|
|
#endif // SHAPE
|
|
|
|
|
2002-02-17 18:47:45 +00:00
|
|
|
#include <vector>
|
|
|
|
#include <string>
|
2002-10-19 10:56:30 +00:00
|
|
|
#include <memory>
|
2003-04-14 15:01:55 +00:00
|
|
|
#include <map>
|
2002-02-17 18:47:45 +00:00
|
|
|
|
2002-05-30 15:49:10 +00:00
|
|
|
#define PropMwmHintsElements 3
|
2002-02-17 18:47:45 +00:00
|
|
|
|
2003-04-14 15:01:55 +00:00
|
|
|
class WinClient;
|
2003-01-05 22:20:46 +00:00
|
|
|
class FbWinFrameTheme;
|
2003-01-07 01:34:49 +00:00
|
|
|
class BScreen;
|
2003-04-14 15:01:55 +00:00
|
|
|
class TextButton;
|
2001-12-11 20:47:02 +00:00
|
|
|
|
2003-01-07 01:34:49 +00:00
|
|
|
namespace FbTk {
|
|
|
|
class MenuTheme;
|
2003-01-09 22:16:40 +00:00
|
|
|
class ImageControl;
|
2003-02-03 13:53:48 +00:00
|
|
|
class XLayer;
|
2003-01-07 01:34:49 +00:00
|
|
|
};
|
2002-11-15 12:17:03 +00:00
|
|
|
|
2003-02-18 15:11:12 +00:00
|
|
|
|
2002-12-13 20:35:36 +00:00
|
|
|
/// Creates the window frame and handles any window event for it
|
2003-01-09 22:16:40 +00:00
|
|
|
class FluxboxWindow : public FbTk::TimeoutHandler, public FbTk::EventHandler {
|
2001-12-11 20:47:02 +00:00
|
|
|
public:
|
2003-04-26 14:05:47 +00:00
|
|
|
/// Represents certain "preset" sets of decorations.
|
2002-12-13 20:35:36 +00:00
|
|
|
enum Decoration {
|
|
|
|
DECOR_NONE=0, ///< no decor at all
|
|
|
|
DECOR_NORMAL, ///< normal normal
|
|
|
|
DECOR_TINY, ///< tiny decoration
|
|
|
|
DECOR_TOOL ///< decor tool
|
2002-12-01 13:42:15 +00:00
|
|
|
};
|
|
|
|
|
2002-12-13 20:35:36 +00:00
|
|
|
/// Motif wm Hints
|
2002-12-01 13:42:15 +00:00
|
|
|
enum {
|
2002-12-13 20:35:36 +00:00
|
|
|
MwmHintsFunctions = (1l << 0), ///< use motif wm functions
|
|
|
|
MwmHintsDecorations = (1l << 1) ///< use motif wm decorations
|
2002-12-01 13:42:15 +00:00
|
|
|
};
|
2002-04-04 14:23:30 +00:00
|
|
|
|
2002-12-13 20:35:36 +00:00
|
|
|
/// Motif wm functions
|
2002-12-01 13:42:15 +00:00
|
|
|
enum MwmFunc{
|
2002-12-13 20:35:36 +00:00
|
|
|
MwmFuncAll = (1l << 0), ///< all motif wm functions
|
|
|
|
MwmFuncResize = (1l << 1), ///< resize
|
|
|
|
MwmFuncMove = (1l << 2), ///< move
|
|
|
|
MwmFuncIconify = (1l << 3), ///< iconify
|
|
|
|
MwmFuncMaximize = (1l << 4), ///< maximize
|
|
|
|
MwmFuncClose = (1l << 5) ///< close
|
2002-12-01 13:42:15 +00:00
|
|
|
};
|
2003-01-05 22:20:46 +00:00
|
|
|
|
2002-12-13 20:35:36 +00:00
|
|
|
/// Motif wm decorations
|
2002-12-01 13:42:15 +00:00
|
|
|
enum MwmDecor {
|
2002-12-13 20:35:36 +00:00
|
|
|
MwmDecorAll = (1l << 0), /// all decorations
|
|
|
|
MwmDecorBorder = (1l << 1), /// border
|
|
|
|
MwmDecorHandle = (1l << 2), /// handle
|
|
|
|
MwmDecorTitle = (1l << 3), /// title
|
|
|
|
MwmDecorMenu = (1l << 4), /// menu
|
|
|
|
MwmDecorIconify = (1l << 5), /// iconify
|
|
|
|
MwmDecorMaximize = (1l << 6) /// maximize
|
2002-12-01 13:42:15 +00:00
|
|
|
};
|
2003-01-05 22:20:46 +00:00
|
|
|
|
2003-04-14 15:01:55 +00:00
|
|
|
typedef std::list<WinClient *> ClientList;
|
|
|
|
|
|
|
|
/// create a window from a client
|
|
|
|
FluxboxWindow(WinClient &client, BScreen &scr,
|
|
|
|
FbWinFrameTheme &tm,
|
|
|
|
FbTk::MenuTheme &menutheme,
|
|
|
|
FbTk::XLayer &layer);
|
|
|
|
|
2002-12-13 20:35:36 +00:00
|
|
|
/// create fluxbox window with parent win and screen connection
|
2003-04-14 15:01:55 +00:00
|
|
|
FluxboxWindow(Window win, BScreen &scr,
|
|
|
|
FbWinFrameTheme &tm,
|
2003-02-03 13:53:48 +00:00
|
|
|
FbTk::MenuTheme &menutheme,
|
|
|
|
FbTk::XLayer &layer);
|
2002-12-01 13:42:15 +00:00
|
|
|
virtual ~FluxboxWindow();
|
2003-01-05 22:20:46 +00:00
|
|
|
|
2003-04-14 15:01:55 +00:00
|
|
|
/// attach client to our client list and remove it from old window
|
|
|
|
void attachClient(WinClient &client);
|
|
|
|
/// detach client (remove it from list) and create a new window for it
|
|
|
|
bool detachClient(WinClient &client);
|
2003-04-16 12:28:39 +00:00
|
|
|
/// detach current working client if we have more than one
|
|
|
|
void detachCurrentClient();
|
2003-04-14 15:01:55 +00:00
|
|
|
/// remove client from client list
|
|
|
|
bool removeClient(WinClient &client);
|
|
|
|
/// set new current client and raise it
|
|
|
|
void setCurrentClient(WinClient &client);
|
|
|
|
WinClient *findClient(Window win);
|
|
|
|
void nextClient();
|
|
|
|
void prevClient();
|
2003-01-05 22:20:46 +00:00
|
|
|
|
|
|
|
void setWindowNumber(int n) { window_number = n; }
|
|
|
|
|
|
|
|
bool validateClient();
|
|
|
|
bool setInputFocus();
|
2003-02-16 16:43:00 +00:00
|
|
|
void raiseAndFocus() { raise(); setInputFocus(); }
|
2003-01-05 22:20:46 +00:00
|
|
|
void setFocusFlag(bool flag);
|
2003-02-16 17:57:54 +00:00
|
|
|
// map this window
|
|
|
|
void show();
|
|
|
|
// unmap this window
|
|
|
|
void hide();
|
2003-01-05 22:20:46 +00:00
|
|
|
void iconify();
|
|
|
|
void deiconify(bool = true, bool = true);
|
|
|
|
/// destroy this window
|
|
|
|
void close();
|
|
|
|
/// set the window in withdrawn state
|
|
|
|
void withdraw();
|
|
|
|
/// toggel maximize
|
|
|
|
void maximize();
|
|
|
|
/// maximizes the window horizontal
|
|
|
|
void maximizeHorizontal();
|
|
|
|
/// maximizes the window vertical
|
|
|
|
void maximizeVertical();
|
|
|
|
/// toggles shade
|
|
|
|
void shade();
|
|
|
|
/// toggles sticky
|
|
|
|
void stick();
|
|
|
|
void raise();
|
2003-02-09 14:11:14 +00:00
|
|
|
void lower();
|
2003-04-15 23:09:26 +00:00
|
|
|
void tempRaise();
|
2003-02-09 14:11:14 +00:00
|
|
|
void raiseLayer();
|
|
|
|
void lowerLayer();
|
|
|
|
void moveToLayer(int layernum);
|
2003-01-05 22:20:46 +00:00
|
|
|
|
|
|
|
void reconfigure();
|
|
|
|
void installColormap(bool);
|
2003-04-14 15:01:55 +00:00
|
|
|
void restore(WinClient *client, bool remap);
|
2003-01-05 22:20:46 +00:00
|
|
|
void restore(bool remap);
|
|
|
|
/// move frame to x, y
|
|
|
|
void move(int x, int y);
|
|
|
|
/// resize frame to width, height
|
|
|
|
void resize(unsigned int width, unsigned int height);
|
|
|
|
/// move and resize frame to pox x,y and size width, height
|
|
|
|
void moveResize(int x, int y, unsigned int width, unsigned int height);
|
|
|
|
|
|
|
|
void setWorkspace(int n);
|
|
|
|
void changeBlackboxHints(const BaseDisplay::BlackboxHints &bh);
|
2003-02-16 17:57:54 +00:00
|
|
|
void restoreAttributes();
|
2003-01-07 01:34:49 +00:00
|
|
|
void showMenu(int mx, int my);
|
|
|
|
// popup menu on last button press position
|
|
|
|
void popupMenu();
|
|
|
|
|
2003-01-05 22:20:46 +00:00
|
|
|
void pauseMoving();
|
|
|
|
void resumeMoving();
|
|
|
|
/**
|
|
|
|
@name event handlers
|
|
|
|
*/
|
|
|
|
//@{
|
|
|
|
void handleEvent(XEvent &event);
|
|
|
|
void buttonPressEvent(XButtonEvent &be);
|
|
|
|
void buttonReleaseEvent(XButtonEvent &be);
|
|
|
|
void motionNotifyEvent(XMotionEvent &me);
|
|
|
|
void destroyNotifyEvent(XDestroyWindowEvent &dwe);
|
|
|
|
void mapRequestEvent(XMapRequestEvent &mre);
|
|
|
|
void mapNotifyEvent(XMapEvent &mapev);
|
|
|
|
void unmapNotifyEvent(XUnmapEvent &unmapev);
|
|
|
|
void exposeEvent(XExposeEvent &ee);
|
|
|
|
void configureRequestEvent(XConfigureRequestEvent &ce);
|
|
|
|
void propertyNotifyEvent(Atom a);
|
2003-02-22 15:10:43 +00:00
|
|
|
void enterNotifyEvent(XCrossingEvent &ev);
|
|
|
|
void leaveNotifyEvent(XCrossingEvent &ev);
|
2003-01-05 22:20:46 +00:00
|
|
|
//@}
|
|
|
|
|
|
|
|
void setDecoration(Decoration decoration);
|
|
|
|
void toggleDecoration();
|
|
|
|
|
2003-04-26 14:05:47 +00:00
|
|
|
/**
|
|
|
|
This enumeration represents individual decoration
|
|
|
|
attributes, they can be OR-d together to get a mask.
|
|
|
|
Useful for saving.
|
|
|
|
*/
|
2003-04-26 05:42:36 +00:00
|
|
|
enum DecorationMask {
|
|
|
|
DECORM_TITLEBAR = (1<<0),
|
|
|
|
DECORM_HANDLE = (1<<1),
|
|
|
|
DECORM_BORDER = (1<<2),
|
|
|
|
DECORM_ICONIFY = (1<<3),
|
|
|
|
DECORM_MAXIMIZE = (1<<4),
|
|
|
|
DECORM_CLOSE = (1<<5),
|
|
|
|
DECORM_MENU = (1<<6),
|
|
|
|
DECORM_STICKY = (1<<7),
|
|
|
|
DECORM_SHADE = (1<<8),
|
|
|
|
DECORM_TAB = (1<<9),
|
|
|
|
DECORM_ENABLED = (1<<10),
|
|
|
|
DECORM_LAST = (1<<11) // useful for getting "All"
|
|
|
|
};
|
|
|
|
|
|
|
|
unsigned int getDecorationMask() const;
|
|
|
|
void setDecorationMask(unsigned int mask);
|
|
|
|
|
2003-01-05 22:20:46 +00:00
|
|
|
#ifdef SHAPE
|
|
|
|
void shapeEvent(XShapeEvent *event);
|
|
|
|
#endif // SHAPE
|
|
|
|
|
|
|
|
virtual void timeout();
|
|
|
|
|
2002-12-01 13:42:15 +00:00
|
|
|
/**
|
|
|
|
@name accessors
|
|
|
|
*/
|
|
|
|
//@{
|
2003-04-20 15:11:48 +00:00
|
|
|
bool isTransient() const;
|
|
|
|
bool hasTransient() const;
|
2003-04-14 15:01:55 +00:00
|
|
|
inline bool isManaged() const { return m_managed; }
|
|
|
|
inline bool isFocused() const { return focused; }
|
|
|
|
inline bool isVisible() const { return visible; }
|
|
|
|
inline bool isIconic() const { return iconic; }
|
|
|
|
inline bool isShaded() const { return shaded; }
|
|
|
|
inline bool isMaximized() const { return maximized; }
|
|
|
|
inline bool isIconifiable() const { return functions.iconify; }
|
|
|
|
inline bool isMaximizable() const { return functions.maximize; }
|
|
|
|
inline bool isResizable() const { return functions.resize; }
|
|
|
|
inline bool isClosable() const { return functions.close; }
|
|
|
|
inline bool isStuck() const { return stuck; }
|
|
|
|
inline bool hasTitlebar() const { return decorations.titlebar; }
|
|
|
|
inline bool isMoving() const { return moving; }
|
|
|
|
inline bool isResizing() const { return resizing; }
|
2002-12-01 13:42:15 +00:00
|
|
|
bool isGroupable() const;
|
2003-04-14 15:01:55 +00:00
|
|
|
inline int numClients() const { return m_clientlist.size(); }
|
|
|
|
inline ClientList &clientList() { return m_clientlist; }
|
|
|
|
inline const ClientList &clientList() const { return m_clientlist; }
|
|
|
|
inline WinClient &winClient() { return *m_client; }
|
|
|
|
inline const WinClient &winClient() const { return *m_client; }
|
|
|
|
|
|
|
|
inline const BScreen &getScreen() const { return screen; }
|
|
|
|
inline BScreen &getScreen() { return screen; }
|
|
|
|
|
|
|
|
inline const FbTk::XLayerItem &getLayerItem() const { return m_layeritem; }
|
|
|
|
inline FbTk::XLayerItem &getLayerItem() { return m_layeritem; }
|
|
|
|
|
|
|
|
const std::list<FluxboxWindow *> &getTransients() const;
|
|
|
|
std::list<FluxboxWindow *> &getTransients();
|
|
|
|
const FluxboxWindow *getTransientFor() const;
|
|
|
|
FluxboxWindow *getTransientFor();
|
2002-08-04 15:55:13 +00:00
|
|
|
|
2003-04-14 15:01:55 +00:00
|
|
|
Window getClientWindow() const;
|
2002-09-08 19:49:39 +00:00
|
|
|
|
2003-02-18 15:11:12 +00:00
|
|
|
FbTk::FbWindow &getFbWindow() { return m_frame.window(); }
|
|
|
|
const FbTk::FbWindow &getFbWindow() const { return m_frame.window(); }
|
|
|
|
|
2003-01-07 01:34:49 +00:00
|
|
|
FbTk::Menu &getWindowmenu() { return m_windowmenu; }
|
|
|
|
const FbTk::Menu &getWindowmenu() const { return m_windowmenu; }
|
2003-02-16 15:12:08 +00:00
|
|
|
|
2003-04-14 15:01:55 +00:00
|
|
|
FbTk::Menu &getLayermenu() { return m_layermenu; }
|
|
|
|
const FbTk::Menu &getLayermenu() const { return m_layermenu; }
|
2002-10-19 10:56:30 +00:00
|
|
|
|
2003-04-14 15:01:55 +00:00
|
|
|
const std::string &getTitle() const;
|
|
|
|
const std::string &getIconTitle() const;
|
2003-01-05 22:20:46 +00:00
|
|
|
int getXFrame() const { return m_frame.x(); }
|
|
|
|
int getYFrame() const { return m_frame.y(); }
|
2003-04-14 15:01:55 +00:00
|
|
|
int getXClient() const;
|
|
|
|
int getYClient() const;
|
2002-12-01 13:42:15 +00:00
|
|
|
unsigned int getWorkspaceNumber() const { return workspace_number; }
|
|
|
|
int getWindowNumber() const { return window_number; }
|
2003-02-02 16:32:41 +00:00
|
|
|
int getLayerNum() const { return m_layernum; }
|
|
|
|
void setLayerNum(int layernum);
|
2003-01-05 22:20:46 +00:00
|
|
|
unsigned int getWidth() const { return m_frame.width(); }
|
|
|
|
unsigned int getHeight() const { return m_frame.height(); }
|
2003-04-14 15:01:55 +00:00
|
|
|
unsigned int getClientHeight() const;
|
|
|
|
unsigned int getClientWidth() const;
|
2003-01-05 22:20:46 +00:00
|
|
|
unsigned int getTitleHeight() const { return m_frame.titleHeight(); }
|
2002-12-01 13:42:15 +00:00
|
|
|
const std::string &className() const { return m_class_name; }
|
|
|
|
const std::string &instanceName() const { return m_instance_name; }
|
|
|
|
bool isLowerTab() const;
|
2003-04-14 15:01:55 +00:00
|
|
|
int initialState() const;
|
2003-01-05 22:20:46 +00:00
|
|
|
|
|
|
|
FbWinFrame &frame() { return m_frame; }
|
|
|
|
const FbWinFrame &frame() const { return m_frame; }
|
|
|
|
|
2002-12-01 13:42:15 +00:00
|
|
|
/**
|
|
|
|
@name signals
|
2003-01-05 22:20:46 +00:00
|
|
|
@{
|
2002-12-01 13:42:15 +00:00
|
|
|
*/
|
|
|
|
FbTk::Subject &stateSig() { return m_statesig; }
|
|
|
|
const FbTk::Subject &stateSig() const { return m_statesig; }
|
2003-02-02 16:32:41 +00:00
|
|
|
FbTk::Subject &layerSig() { return m_layersig; }
|
|
|
|
const FbTk::Subject &layerSig() const { return m_layersig; }
|
2002-12-01 13:42:15 +00:00
|
|
|
FbTk::Subject &hintSig() { return m_hintsig; }
|
|
|
|
const FbTk::Subject &hintSig() const { return m_hintsig; }
|
|
|
|
FbTk::Subject &workspaceSig() { return m_workspacesig; }
|
|
|
|
const FbTk::Subject &workspaceSig() const { return m_workspacesig; }
|
2003-01-05 22:20:46 +00:00
|
|
|
FbTk::Subject &dieSig() { return m_diesig; }
|
|
|
|
const FbTk::Subject &dieSig() const { return m_diesig; }
|
2002-12-13 20:35:36 +00:00
|
|
|
/** @} */ // end group signals
|
2002-12-01 13:42:15 +00:00
|
|
|
|
|
|
|
const timeval &getLastFocusTime() const {return lastFocusTime;}
|
|
|
|
|
|
|
|
//@}
|
2001-12-11 20:47:02 +00:00
|
|
|
|
2002-12-01 13:42:15 +00:00
|
|
|
class WinSubject: public FbTk::Subject {
|
|
|
|
public:
|
|
|
|
WinSubject(FluxboxWindow &w):m_win(w) { }
|
|
|
|
FluxboxWindow &win() { return m_win; }
|
|
|
|
const FluxboxWindow &win() const { return m_win; }
|
|
|
|
private:
|
|
|
|
FluxboxWindow &m_win;
|
|
|
|
};
|
2002-09-07 20:16:43 +00:00
|
|
|
|
2001-12-11 20:47:02 +00:00
|
|
|
private:
|
2003-04-14 15:01:55 +00:00
|
|
|
void init();
|
2003-01-05 22:20:46 +00:00
|
|
|
|
|
|
|
void grabButtons();
|
|
|
|
|
|
|
|
void startMoving(Window win);
|
|
|
|
void stopMoving();
|
|
|
|
void startResizing(Window win, int x, int y, bool left);
|
|
|
|
void stopResizing(Window win=0);
|
|
|
|
void updateIcon();
|
2003-04-15 14:40:24 +00:00
|
|
|
/// try to attach current attaching client to a window at pos x, y
|
|
|
|
void attachTo(int x, int y);
|
|
|
|
|
2003-01-05 22:20:46 +00:00
|
|
|
void updateTransientInfo();
|
|
|
|
|
|
|
|
bool getState();
|
|
|
|
/// gets title string from client window and updates frame's title
|
|
|
|
void updateTitleFromClient();
|
|
|
|
/// gets icon name from client window
|
|
|
|
void updateIconNameFromClient();
|
|
|
|
void getWMNormalHints();
|
|
|
|
void getWMProtocols();
|
|
|
|
void getWMHints();
|
|
|
|
void getMWMHints();
|
|
|
|
void getBlackboxHints();
|
2003-02-02 16:32:41 +00:00
|
|
|
void saveBlackboxHints();
|
2003-01-05 22:20:46 +00:00
|
|
|
void setNetWMAttributes();
|
|
|
|
void associateClientWindow();
|
|
|
|
void createWinButtons();
|
|
|
|
void decorateLabel();
|
|
|
|
void positionWindows();
|
|
|
|
|
|
|
|
void restoreGravity();
|
|
|
|
void setGravityOffsets();
|
|
|
|
void setState(unsigned long stateval);
|
|
|
|
void upsize();
|
|
|
|
void downsize();
|
2003-04-20 02:47:15 +00:00
|
|
|
|
|
|
|
// modifies left and top if snap is necessary
|
|
|
|
void doSnapping(int &left, int &top);
|
2003-01-05 22:20:46 +00:00
|
|
|
void right_fixsize(int *x = 0, int *y = 0);
|
|
|
|
void left_fixsize(int *x = 0, int *y = 0);
|
2003-04-15 18:56:42 +00:00
|
|
|
void resizeClient(WinClient &client, unsigned int width, unsigned int height);
|
|
|
|
/// sends configurenotify to all clients
|
|
|
|
void sendConfigureNotify();
|
2002-12-01 13:42:15 +00:00
|
|
|
// state and hint signals
|
2003-02-02 16:32:41 +00:00
|
|
|
WinSubject m_hintsig, m_statesig, m_layersig, m_workspacesig, m_diesig;
|
2002-09-07 20:16:43 +00:00
|
|
|
|
2002-12-01 13:42:15 +00:00
|
|
|
std::string m_instance_name; /// instance name from WM_CLASS
|
|
|
|
std::string m_class_name; /// class name from WM_CLASS
|
2002-08-11 22:33:41 +00:00
|
|
|
|
2002-12-01 13:42:15 +00:00
|
|
|
//Window state
|
|
|
|
bool moving, resizing, shaded, maximized, visible, iconic, transient,
|
2003-01-05 22:20:46 +00:00
|
|
|
focused, stuck, modal, send_focus_message, m_managed;
|
2003-04-15 14:40:24 +00:00
|
|
|
WinClient *m_attaching_tab;
|
2002-12-01 13:42:15 +00:00
|
|
|
|
2003-04-14 15:01:55 +00:00
|
|
|
BScreen &screen; /// screen on which this window exist
|
2003-01-09 22:16:40 +00:00
|
|
|
FbTk::Timer timer;
|
2003-04-14 15:01:55 +00:00
|
|
|
Display *display; /// display connection
|
2002-12-01 13:42:15 +00:00
|
|
|
BaseDisplay::BlackboxAttributes blackbox_attrib;
|
|
|
|
|
|
|
|
Time lastButtonPressTime;
|
2003-02-18 15:11:12 +00:00
|
|
|
FbTk::Menu m_windowmenu;
|
2003-04-14 15:01:55 +00:00
|
|
|
LayerMenu<FluxboxWindow> m_layermenu;
|
2003-02-03 13:53:48 +00:00
|
|
|
|
2002-12-01 13:42:15 +00:00
|
|
|
timeval lastFocusTime;
|
2003-01-05 22:20:46 +00:00
|
|
|
|
|
|
|
int button_grab_x, button_grab_y; // handles last button press event for move
|
|
|
|
int last_resize_x, last_resize_y; // handles last button press event for resize
|
2003-02-17 22:41:24 +00:00
|
|
|
int last_move_x, last_move_y; // handles last pos for non opaque moving
|
2003-01-05 22:20:46 +00:00
|
|
|
unsigned int last_resize_h, last_resize_w; // handles height/width for resize "window"
|
2003-03-22 05:13:08 +00:00
|
|
|
unsigned int move_ws; // handles home workspace for opaque workspace warping
|
2002-12-01 13:42:15 +00:00
|
|
|
|
|
|
|
int focus_mode, window_number;
|
|
|
|
unsigned int workspace_number;
|
|
|
|
unsigned long current_state;
|
2003-02-02 16:32:41 +00:00
|
|
|
|
2002-12-01 13:42:15 +00:00
|
|
|
Decoration old_decoration;
|
|
|
|
|
2003-04-14 15:01:55 +00:00
|
|
|
ClientList m_clientlist;
|
|
|
|
WinClient *m_client;
|
|
|
|
typedef std::map<WinClient *, TextButton *> Client2ButtonMap;
|
|
|
|
Client2ButtonMap m_labelbuttons;
|
2002-12-01 13:42:15 +00:00
|
|
|
|
2003-04-14 15:01:55 +00:00
|
|
|
// just temporary solution
|
|
|
|
friend class WinClient;
|
2001-12-11 20:47:02 +00:00
|
|
|
|
2002-12-01 13:42:15 +00:00
|
|
|
struct _decorations {
|
|
|
|
bool titlebar, handle, border, iconify,
|
|
|
|
maximize, close, menu, sticky, shade, tab, enabled;
|
|
|
|
} decorations;
|
2001-12-11 20:47:02 +00:00
|
|
|
|
2002-12-01 13:42:15 +00:00
|
|
|
struct _functions {
|
|
|
|
bool resize, move, iconify, maximize, close;
|
|
|
|
} functions;
|
2002-01-18 01:33:58 +00:00
|
|
|
|
2003-01-05 22:20:46 +00:00
|
|
|
int frame_resize_x, frame_resize_w;
|
|
|
|
int frame_resize_y, frame_resize_h;
|
|
|
|
int m_old_pos_x, m_old_pos_y; ///< old position so we can restore from maximized
|
|
|
|
unsigned int m_old_width, m_old_height; ///< old size so we can restore from maximized state
|
2003-01-07 01:34:49 +00:00
|
|
|
int m_last_button_x, ///< last known x position of the mouse button
|
|
|
|
m_last_button_y; ///< last known y position of the mouse button
|
2003-01-05 22:20:46 +00:00
|
|
|
FbWinFrame m_frame;
|
2002-12-01 13:42:15 +00:00
|
|
|
|
2003-02-09 14:11:14 +00:00
|
|
|
FbTk::XLayerItem m_layeritem;
|
|
|
|
int m_layernum;
|
|
|
|
|
2002-12-01 13:42:15 +00:00
|
|
|
enum { F_NOINPUT = 0, F_PASSIVE, F_LOCALLYACTIVE, F_GLOBALLYACTIVE };
|
2003-02-17 22:41:24 +00:00
|
|
|
|
2001-12-11 20:47:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2002-07-10 14:46:42 +00:00
|
|
|
#endif // WINDOW_HH
|