From bcfcc6403a62a4ba2a0f7d1c4b1b3be9ee07251b Mon Sep 17 00:00:00 2001 From: fluxgen Date: Mon, 18 Mar 2002 15:28:25 +0000 Subject: moved Atoms into FbAtoms --- src/BaseDisplay.cc | 97 +-------------------- src/BaseDisplay.hh | 245 +++++------------------------------------------------ 2 files changed, 23 insertions(+), 319 deletions(-) diff --git a/src/BaseDisplay.cc b/src/BaseDisplay.cc index fae87f6..9a24081 100644 --- a/src/BaseDisplay.cc +++ b/src/BaseDisplay.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: BaseDisplay.cc,v 1.6 2002/02/11 10:57:23 fluxgen Exp $ +// $Id: BaseDisplay.cc,v 1.7 2002/03/18 15:28:25 fluxgen Exp $ // use some GNU extensions #ifndef _GNU_SOURCE @@ -219,7 +219,7 @@ void bexec(const char *command, char* displaystring) { #endif // !__EMX__ -BaseDisplay::BaseDisplay(char *app_name, char *dpy_name): +BaseDisplay::BaseDisplay(char *app_name, char *dpy_name):FbAtoms(0), m_startup(true), m_shutdown(false), m_display_name(XDisplayName(dpy_name)), m_app_name(app_name), m_server_grabs(0) @@ -280,6 +280,8 @@ m_server_grabs(0) "as close-on-exec\n")); throw static_cast(2); //throw error 2 } + //initiate atoms + initAtoms(m_display); number_of_screens = ScreenCount(m_display); @@ -289,97 +291,6 @@ m_server_grabs(0) #else // !SHAPE shape.extensions = False; #endif // SHAPE -//---------- setup atoms - - xa_wm_colormap_windows = - XInternAtom(m_display, "WM_COLORMAP_WINDOWS", False); - xa_wm_protocols = XInternAtom(m_display, "WM_PROTOCOLS", False); - xa_wm_state = XInternAtom(m_display, "WM_STATE", False); - xa_wm_change_state = XInternAtom(m_display, "WM_CHANGE_STATE", False); - xa_wm_delete_window = XInternAtom(m_display, "WM_DELETE_WINDOW", False); - xa_wm_take_focus = XInternAtom(m_display, "WM_TAKE_FOCUS", False); - motif_wm_hints = XInternAtom(m_display, "_MOTIF_WM_HINTS", False); - - blackbox_hints = XInternAtom(m_display, "_BLACKBOX_HINTS", False); - blackbox_attributes = XInternAtom(m_display, "_BLACKBOX_ATTRIBUTES", False); - blackbox_change_attributes = - XInternAtom(m_display, "_BLACKBOX_CHANGE_ATTRIBUTES", False); - - blackbox_structure_messages = - XInternAtom(m_display, "_BLACKBOX_STRUCTURE_MESSAGES", False); - blackbox_notify_startup = - XInternAtom(m_display, "_BLACKBOX_NOTIFY_STARTUP", False); - blackbox_notify_window_add = - XInternAtom(m_display, "_BLACKBOX_NOTIFY_WINDOW_ADD", False); - blackbox_notify_window_del = - XInternAtom(m_display, "_BLACKBOX_NOTIFY_WINDOW_DEL", False); - blackbox_notify_current_workspace = - XInternAtom(m_display, "_BLACKBOX_NOTIFY_CURRENT_WORKSPACE", False); - blackbox_notify_workspace_count = - XInternAtom(m_display, "_BLACKBOX_NOTIFY_WORKSPACE_COUNT", False); - blackbox_notify_window_focus = - XInternAtom(m_display, "_BLACKBOX_NOTIFY_WINDOW_FOCUS", False); - blackbox_notify_window_raise = - XInternAtom(m_display, "_BLACKBOX_NOTIFY_WINDOW_RAISE", False); - blackbox_notify_window_lower = - XInternAtom(m_display, "_BLACKBOX_NOTIFY_WINDOW_LOWER", False); - - blackbox_change_workspace = - XInternAtom(m_display, "_BLACKBOX_CHANGE_WORKSPACE", False); - blackbox_change_window_focus = - XInternAtom(m_display, "_BLACKBOX_CHANGE_WINDOW_FOCUS", False); - blackbox_cycle_window_focus = - XInternAtom(m_display, "_BLACKBOX_CYCLE_WINDOW_FOCUS", False); - -#ifdef NEWWMSPEC - - net_supported = XInternAtom(m_display, "_NET_SUPPORTED", False); - net_client_list = XInternAtom(m_display, "_NET_CLIENT_LIST", False); - net_client_list_stacking = XInternAtom(m_display, "_NET_CLIENT_LIST_STACKING", False); - net_number_of_desktops = XInternAtom(m_display, "_NET_NUMBER_OF_DESKTOPS", False); - net_desktop_geometry = XInternAtom(m_display, "_NET_DESKTOP_GEOMETRY", False); - net_desktop_viewport = XInternAtom(m_display, "_NET_DESKTOP_VIEWPORT", False); - net_current_desktop = XInternAtom(m_display, "_NET_CURRENT_DESKTOP", False); - net_desktop_names = XInternAtom(m_display, "_NET_DESKTOP_NAMES", False); - net_active_window = XInternAtom(m_display, "_NET_ACTIVE_WINDOW", False); - net_workarea = XInternAtom(m_display, "_NET_WORKAREA", False); - net_supporting_wm_check = XInternAtom(m_display, "_NET_SUPPORTING_WM_CHECK", False); - net_virtual_roots = XInternAtom(m_display, "_NET_VIRTUAL_ROOTS", False); - - net_close_window = XInternAtom(m_display, "_NET_CLOSE_WINDOW", False); - net_wm_moveresize = XInternAtom(m_display, "_NET_WM_MOVERESIZE", False); - - net_properties = XInternAtom(m_display, "_NET_PROPERTIES", False); - net_wm_name = XInternAtom(m_display, "_NET_WM_NAME", False); - net_wm_desktop = XInternAtom(m_display, "_NET_WM_DESKTOP", False); - net_wm_window_type = XInternAtom(m_display, "_NET_WM_WINDOW_TYPE", False); - net_wm_state = XInternAtom(m_display, "_NET_WM_STATE", False); - net_wm_strut = XInternAtom(m_display, "_NET_WM_STRUT", False); - net_wm_icon_geometry = XInternAtom(m_display, "_NET_WM_ICON_GEOMETRY", False); - net_wm_icon = XInternAtom(m_display, "_NET_WM_ICON", False); - net_wm_pid = XInternAtom(m_display, "_NET_WM_PID", False); - net_wm_handled_icons = XInternAtom(m_display, "_NET_WM_HANDLED_ICONS", False); - - net_wm_ping = XInternAtom(m_display, "_NET_WM_PING", False); - -#endif // NEWWMSPEC - -#ifdef GNOME - - gnome_wm_win_layer = XInternAtom(m_display, "_WIN_LAYER", False); - gnome_wm_win_state = XInternAtom(m_display, "_WIN_STATE", False); - gnome_wm_win_hints = XInternAtom(m_display, "_WIN_HINTS", False); - gnome_wm_win_app_state = XInternAtom(m_display, "_WIN_APP_STATE", False); - gnome_wm_win_expanded_size = XInternAtom(m_display, "_WIN_EXPANDED_SIZE", False); - gnome_wm_win_icons = XInternAtom(m_display, "_WIN_ICONS", False); - gnome_wm_win_workspace = XInternAtom(m_display, "_WIN_WORKSPACE", False); - gnome_wm_win_workspace_count = XInternAtom(m_display, "_WIN_WORKSPACE_COUNT", False); - gnome_wm_win_workspace_names = XInternAtom(m_display, "_WIN_WORKSPACE_NAMES", False); - gnome_wm_win_client_list = XInternAtom(m_display, "_WIN_CLIENT_LIST", False); - gnome_wm_prot = XInternAtom(m_display, "_WIN_PROTOCOLS", False); - gnome_wm_supporting_wm_check = XInternAtom(m_display, "_WIN_SUPPORTING_WM_CHECK", False); - -#endif // GNOME cursor.session = XCreateFontCursor(m_display, XC_left_ptr); cursor.move = XCreateFontCursor(m_display, XC_fleur); diff --git a/src/BaseDisplay.hh b/src/BaseDisplay.hh index 89196a8..4aa7228 100644 --- a/src/BaseDisplay.hh +++ b/src/BaseDisplay.hh @@ -22,16 +22,15 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: BaseDisplay.hh,v 1.13 2002/02/20 22:39:14 fluxgen Exp $ +// $Id: BaseDisplay.hh,v 1.14 2002/03/18 15:28:25 fluxgen Exp $ #ifndef BASEDISPLAY_HH #define BASEDISPLAY_HH #include "Timer.hh" #include "NotCopyable.hh" - +#include "FbAtoms.hh" #include -#include #include #include @@ -42,15 +41,9 @@ class ScreenInfo; #define PropBlackboxHintsElements (5) #define PropBlackboxAttributesElements (8) -#ifndef __EMX__ -void bexec(const char *, char *); -#endif // !__EMX__ - +void bexec(const char *command, char* displaystring); -template inline Z min(Z a, Z b) { return ((a < b) ? a : b); } -template inline Z max(Z a, Z b) { return ((a > b) ? a : b); } - -class BaseDisplay:private NotCopyable +class BaseDisplay:private NotCopyable, public FbAtoms { public: @@ -81,172 +74,25 @@ public: unsigned int premax_w, premax_h; } BlackboxAttributes; -#ifdef GNOME - inline Atom &getGnomeProtAtom() { return gnome_wm_prot; } - inline Atom &getGnomeClientListAtom() { return gnome_wm_win_client_list; } - inline Atom &getGnomeSupportingWMCheckAtom() { return gnome_wm_supporting_wm_check; } - inline Atom &getGnomeWorkspaceAtom() { return gnome_wm_win_workspace; } - inline Atom &getGnomeWorkspaceCountAtom() { return gnome_wm_win_workspace_count; } - inline Atom &getGnomeWorkspaceNamesAtom() { return gnome_wm_win_workspace_names; } - inline Atom &getGnomeStateAtom() { return gnome_wm_win_state; } - inline Atom &getGnomeHintsAtom() { return gnome_wm_win_hints; } - inline Atom &getGnomeLayerAtom() { return gnome_wm_win_layer; } -#endif //GNOME - - inline const Atom &getWMChangeStateAtom(void) const - { return xa_wm_change_state; } - inline const Atom &getWMStateAtom(void) const - { return xa_wm_state; } - inline const Atom &getWMDeleteAtom(void) const - { return xa_wm_delete_window; } - inline const Atom &getWMProtocolsAtom(void) const - { return xa_wm_protocols; } - inline const Atom &getWMTakeFocusAtom(void) const - { return xa_wm_take_focus; } - inline const Atom &getWMColormapAtom(void) const - { return xa_wm_colormap_windows; } - inline const Atom &getMotifWMHintsAtom(void) const - { return motif_wm_hints; } - - // this atom is for normal app->WM hints about decorations, stacking, - // starting workspace etc... - inline const Atom &getFluxboxHintsAtom(void) const - { return blackbox_hints;} - - // these atoms are for normal app->WM interaction beyond the scope of the - // ICCCM... - inline const Atom &getFluxboxAttributesAtom(void) const - { return blackbox_attributes; } - inline const Atom &getFluxboxChangeAttributesAtom(void) const - { return blackbox_change_attributes; } - - // these atoms are for window->WM interaction, with more control and - // information on window "structure"... common examples are - // notifying apps when windows are raised/lowered... when the user changes - // workspaces... i.e. "pager talk" - inline const Atom &getFluxboxStructureMessagesAtom(void) const - { return blackbox_structure_messages; } - - // *Notify* portions of the NETStructureMessages protocol - inline const Atom &getFluxboxNotifyStartupAtom(void) const - { return blackbox_notify_startup; } - inline const Atom &getFluxboxNotifyWindowAddAtom(void) const - { return blackbox_notify_window_add; } - inline const Atom &getFluxboxNotifyWindowDelAtom(void) const - { return blackbox_notify_window_del; } - inline const Atom &getFluxboxNotifyWindowFocusAtom(void) const - { return blackbox_notify_window_focus; } - inline const Atom &getFluxboxNotifyCurrentWorkspaceAtom(void) const - { return blackbox_notify_current_workspace; } - inline const Atom &getFluxboxNotifyWorkspaceCountAtom(void) const - { return blackbox_notify_workspace_count; } - inline const Atom &getFluxboxNotifyWindowRaiseAtom(void) const - { return blackbox_notify_window_raise; } - inline const Atom &getFluxboxNotifyWindowLowerAtom(void) const - { return blackbox_notify_window_lower; } - - // atoms to change that request changes to the desktop environment during - // runtime... these messages can be sent by any client... as the sending - // client window id is not included in the ClientMessage event... - inline const Atom &getFluxboxChangeWorkspaceAtom(void) const - { return blackbox_change_workspace; } - inline const Atom &getFluxboxChangeWindowFocusAtom(void) const - { return blackbox_change_window_focus; } - inline const Atom &getFluxboxCycleWindowFocusAtom(void) const - { return blackbox_cycle_window_focus; } - -#ifdef NEWWMSPEC - - // root window properties - inline const Atom &getNETSupportedAtom(void) const - { return net_supported; } - inline const Atom &getNETClientListAtom(void) const - { return net_client_list; } - inline const Atom &getNETClientListStackingAtom(void) const - { return net_client_list_stacking; } - inline const Atom &getNETNumberOfDesktopsAtom(void) const - { return net_number_of_desktops; } - inline const Atom &getNETDesktopGeometryAtom(void) const - { return net_desktop_geometry; } - inline const Atom &getNETDesktopViewportAtom(void) const - { return net_desktop_viewport; } - inline const Atom &getNETCurrentDesktopAtom(void) const - { return net_current_desktop; } - inline const Atom &getNETDesktopNamesAtom(void) const - { return net_desktop_names; } - inline const Atom &getNETActiveWindowAtom(void) const - { return net_active_window; } - inline const Atom &getNETWorkareaAtom(void) const - { return net_workarea; } - inline const Atom &getNETSupportingWMCheckAtom(void) const - { return net_supporting_wm_check; } - inline const Atom &getNETVirtualRootsAtom(void) const - { return net_virtual_roots; } - - // root window messages - inline const Atom &getNETCloseWindowAtom(void) const - { return net_close_window; } - inline const Atom &getNETWMMoveResizeAtom(void) const - { return net_wm_moveresize; } - - // application window properties - inline const Atom &getNETPropertiesAtom(void) const - { return net_properties; } - inline const Atom &getNETWMNameAtom(void) const - { return net_wm_name; } - inline const Atom &getNETWMDesktopAtom(void) const - { return net_wm_desktop; } - inline const Atom &getNETWMWindowTypeAtom(void) const - { return net_wm_window_type; } - inline const Atom &getNETWMStateAtom(void) const - { return net_wm_state; } - inline const Atom &getNETWMStrutAtom(void) const - { return net_wm_strut; } - inline const Atom &getNETWMIconGeometryAtom(void) const - { return net_wm_icon_geometry; } - inline const Atom &getNETWMIconAtom(void) const - { return net_wm_icon; } - inline const Atom &getNETWMPidAtom(void) const - { return net_wm_pid; } - inline const Atom &getNETWMHandledIconsAtom(void) const - { return net_wm_handled_icons; } - - // application protocols - inline const Atom &getNETWMPingAtom(void) const - { return net_wm_ping; } - -#endif // NEWWMSPEC - - inline ScreenInfo *getScreenInfo(int s) - { return (ScreenInfo *) screenInfoList[s]; } - - inline const Bool &hasShapeExtensions(void) const - { return shape.extensions; } - inline const bool &doShutdown(void) const - { return m_shutdown; } - inline const bool &isStartup(void) const - { return m_startup; } - - inline const Cursor &getSessionCursor(void) const - { return cursor.session; } - inline const Cursor &getMoveCursor(void) const - { return cursor.move; } - inline const Cursor &getLowerLeftAngleCursor(void) const - { return cursor.ll_angle; } - inline const Cursor &getLowerRightAngleCursor(void) const - { return cursor.lr_angle; } + + inline ScreenInfo *getScreenInfo(int s) { return screenInfoList[s]; } + + inline const Bool &hasShapeExtensions(void) const { return shape.extensions; } + inline const bool &doShutdown(void) const { return m_shutdown; } + inline const bool &isStartup(void) const { return m_startup; } + + inline const Cursor &getSessionCursor(void) const { return cursor.session; } + inline const Cursor &getMoveCursor(void) const { return cursor.move; } + inline const Cursor &getLowerLeftAngleCursor(void) const { return cursor.ll_angle; } + inline const Cursor &getLowerRightAngleCursor(void) const { return cursor.lr_angle; } inline Display *getXDisplay(void) { return m_display; } - inline const char *getXDisplayName(void) const - { return const_cast(m_display_name); } - inline const char *getApplicationName(void) const - { return const_cast(m_app_name); } + inline const char *getXDisplayName(void) const { return const_cast(m_display_name); } + inline const char *getApplicationName(void) const { return const_cast(m_app_name); } - inline const int &getNumberOfScreens(void) const - { return number_of_screens; } - inline const int &getShapeEventBase(void) const - { return shape.event_basep; } + inline const int &getNumberOfScreens(void) const { return number_of_screens; } + inline const int &getShapeEventBase(void) const { return shape.event_basep; } inline void shutdown(void) { m_shutdown = true; } inline void run(void) { m_startup = m_shutdown = false; } @@ -284,59 +130,7 @@ private: int event_basep, error_basep; } shape; - Atom xa_wm_colormap_windows, xa_wm_protocols, xa_wm_state, - xa_wm_delete_window, xa_wm_take_focus, xa_wm_change_state, - motif_wm_hints; - - // NETAttributes - Atom blackbox_attributes, blackbox_change_attributes, blackbox_hints; - - // NETStructureMessages - Atom blackbox_structure_messages, blackbox_notify_startup, - blackbox_notify_window_add, blackbox_notify_window_del, - blackbox_notify_window_focus, blackbox_notify_current_workspace, - blackbox_notify_workspace_count, blackbox_notify_window_raise, - blackbox_notify_window_lower; - - // message_types for client -> wm messages - Atom blackbox_change_workspace, blackbox_change_window_focus, - blackbox_cycle_window_focus; - -#ifdef NEWWMSPEC - - // root window properties - Atom net_supported, net_client_list, net_client_list_stacking, - net_number_of_desktops, net_desktop_geometry, net_desktop_viewport, - net_current_desktop, net_desktop_names, net_active_window, net_workarea, - net_supporting_wm_check, net_virtual_roots; - - // root window messages - Atom net_close_window, net_wm_moveresize; - - // application window properties - Atom net_properties, net_wm_name, net_wm_desktop, net_wm_window_type, - net_wm_state, net_wm_strut, net_wm_icon_geometry, net_wm_icon, net_wm_pid, - net_wm_handled_icons; - - // application protocols - Atom net_wm_ping; - -#endif // NEWWMSPEC - -#ifdef GNOME -// union { - Atom gnome_wm_win_layer, gnome_wm_win_state, gnome_wm_win_hints, - gnome_wm_win_app_state, gnome_wm_win_expanded_size, - gnome_wm_win_icons, gnome_wm_win_workspace, - gnome_wm_win_workspace_count, gnome_wm_win_workspace_names, - gnome_wm_win_client_list; -// Atom gnome_atom_list[10]; -// }; - Atom gnome_wm_prot; - Atom gnome_wm_supporting_wm_check; -#endif // GNOME - bool m_startup, m_shutdown; Display *m_display; @@ -354,7 +148,6 @@ protected: virtual void process_event(XEvent *) = 0; - }; -- cgit v0.11.2