diff --git a/edewm/Atoms.cpp b/edewm/Atoms.cpp deleted file mode 100644 index 0cddd8e..0000000 --- a/edewm/Atoms.cpp +++ /dev/null @@ -1,243 +0,0 @@ -/* - * $Id: Atoms.cpp 1700 2006-07-22 18:51:10Z karijes $ - * - * Edewm, window manager - * Part of Equinox Desktop Environment (EDE). - * Copyright (c) 2000-2006 EDE Authors. - * - * This program is licenced under terms of the - * GNU General Public Licence version 2 or newer. - * See COPYING for details. - */ - -#include "Atoms.h" -#include - -// Icccm atoms -Atom _XA_WM_PROTOCOLS; -Atom _XA_WM_DELETE_WINDOW; -Atom _XA_WM_STATE; -Atom _XA_WM_CHANGE_STATE; -Atom _XA_WM_COLORMAP_WINDOWS; -Atom _XA_WM_TAKE_FOCUS; - -Atom _XA_UTF8_STRING; - -// Motif atoms -Atom _XA_MOTIF_HINTS; - -// Netwm atoms -Atom _XA_NET_SUPPORTED; -Atom _XA_NET_SUPPORTING_WM_CHECK; - -Atom _XA_NET_NUMBER_OF_DESKTOPS; -Atom _XA_NET_DESKTOP_GEOMETRY; -Atom _XA_NET_DESKTOP_VIEWPORT; -Atom _XA_NET_CURRENT_DESKTOP; -Atom _XA_NET_DESKTOP_NAMES; -Atom _XA_NET_ACTIVE_WINDOW; -Atom _XA_NET_WORKAREA; -Atom _XA_NET_SHOWING_DESKTOP; -// other root messages -Atom _XA_NET_CLOSE_WINDOW; -Atom _XA_NET_MOVERESIZE_WINDOW; -Atom _XA_NET_RESTACK_WINDOW; -Atom _XA_NET_REQUEST_FRAME_EXTENTS; - -// application messages -Atom _XA_NET_WM_NAME; -Atom _XA_NET_WM_WINDOW_TYPE; -Atom _XA_NET_WM_WINDOW_TYPE_NORMAL; -Atom _XA_NET_WM_WINDOW_TYPE_DOCK; -Atom _XA_NET_WM_WINDOW_TYPE_TOOLBAR; -Atom _XA_NET_WM_WINDOW_TYPE_MENU; -Atom _XA_NET_WM_WINDOW_TYPE_UTIL; -Atom _XA_NET_WM_WINDOW_TYPE_DIALOG; -Atom _XA_NET_WM_WINDOW_TYPE_SPLASH; -Atom _XA_NET_WM_WINDOW_TYPE_DESKTOP; - -// our messages -Atom _XA_EDE_WM_STARTUP_NOTIFY; -Atom _XA_EDE_WM_APP_STARTING; - -// only for debugging -Atom _XA_NET_VIRTUAL_ROOTS; -Atom _XA_NET_DESKTOP_LAYOUT; -Atom _XA_NET_WM_MOVERESIZE; -Atom _XA_NET_WM_VISIBLE_NAME; -Atom _XA_NET_WM_ICON_NAME; -Atom _XA_NET_WM_ICON_VISIBLE_NAME; -Atom _XA_NET_WM_DESKTOP; -Atom _XA_NET_WM_STATE; -Atom _XA_NET_WM_STATE_MODAL; //Needs transient for (root for whole group) -Atom _XA_NET_WM_STATE_STICKY; //Pos fixed, even if virt. desk. scrolls -Atom _XA_NET_WM_STATE_MAXIMIZED_VERT; -Atom _XA_NET_WM_STATE_MAXIMIZED_HORZ; -Atom _XA_NET_WM_STATE_SHADED; -Atom _XA_NET_WM_STATE_SKIP_TASKBAR; -Atom _XA_NET_WM_STATE_SKIP_PAGER; -Atom _XA_NET_WM_STATE_HIDDEN; -Atom _XA_NET_WM_STATE_FULLSCREEN; -Atom _XA_NET_WM_STATE_ABOVE; -Atom _XA_NET_WM_STATE_BELOW; -Atom _XA_NET_WM_STATE_DEMANDS_ATTENTION; -Atom _XA_NET_WM_ALLOWED_ACTIONS; -Atom _XA_NET_WM_ACTION_MOVE; -Atom _XA_NET_WM_ACTION_RESIZE; -Atom _XA_NET_WM_ACTION_MINIMIZE; -Atom _XA_NET_WM_ACTION_SHADE; -Atom _XA_NET_WM_ACTION_STICK; -Atom _XA_NET_WM_ACTION_MAXIMIZE_HORZ; -Atom _XA_NET_WM_ACTION_MAXIMIZE_VERT; -Atom _XA_NET_WM_ACTION_FULLSCREEN; -Atom _XA_NET_WM_ACTION_CHANGE_DESKTOP; -Atom _XA_NET_WM_ACTION_CLOSE; -Atom _XA_NET_WM_STRUT; -Atom _XA_NET_WM_STRUT_PARTIAL; -Atom _XA_NET_WM_ICON_GEOMETRY; -Atom _XA_NET_WM_ICON; -Atom _XA_NET_WM_PID; -Atom _XA_NET_WM_HANDLED_ICONS; -Atom _XA_NET_WM_USER_TIME; -Atom _XA_NET_FRAME_EXTENTS; -Atom _XA_NET_WM_PING; -Atom _XA_NET_WM_SYNC_REQUEST; -Atom _XA_NET_WM_STATE_STAYS_ON_TOP; -Atom _XA_KWM_WIN_ICON; - - -#ifdef _DEBUG - #define REGISTER_ATOM(id, name) \ - id = XInternAtom(fl_display, name, False);\ - atoms_map[id] = name -#else - #define REGISTER_ATOM(id, name) \ - id = XInternAtom(fl_display, name, False) -#endif - -#define COUNT(x) (sizeof(x)/sizeof(x[0])) - -#ifdef _DEBUG -void InitAtoms(Display* display, std::map& atoms_map) -#else -void InitAtoms(Display* display) -#endif -{ - // Icccm - REGISTER_ATOM(_XA_WM_PROTOCOLS, "WM_PROTOCOLS"); - REGISTER_ATOM(_XA_WM_DELETE_WINDOW, "WM_DELETE_WINDOW"); - REGISTER_ATOM(_XA_WM_STATE, "WM_STATE"); - REGISTER_ATOM(_XA_WM_CHANGE_STATE, "WM_CHANGE_STATE"); - REGISTER_ATOM(_XA_WM_COLORMAP_WINDOWS, "WM_COLORMAP_WINDOWS"); - REGISTER_ATOM(_XA_WM_TAKE_FOCUS, "WM_TAKE_FOCUS"); - - REGISTER_ATOM(_XA_UTF8_STRING, "UTF8_STRING"); - - // Motif - REGISTER_ATOM(_XA_MOTIF_HINTS, "_MOTIF_WM_HINTS"); - - // Netwm - REGISTER_ATOM(_XA_NET_SUPPORTED, "_NET_SUPPORTED"); - REGISTER_ATOM(_XA_NET_SUPPORTING_WM_CHECK, "_NET_SUPPORTING_WM_CHECK"); - REGISTER_ATOM(_XA_NET_NUMBER_OF_DESKTOPS, "_NET_NUMBER_OF_DESKTOPS"); - REGISTER_ATOM(_XA_NET_DESKTOP_GEOMETRY, "_NET_DESKTOP_GEOMETRY"); - REGISTER_ATOM(_XA_NET_DESKTOP_VIEWPORT, "_NET_DESKTOP_VIEWPORT"); - REGISTER_ATOM(_XA_NET_CURRENT_DESKTOP, "_NET_CURRENT_DESKTOP"); - REGISTER_ATOM(_XA_NET_DESKTOP_NAMES, "_NET_DESKTOP_NAMES"); - REGISTER_ATOM(_XA_NET_ACTIVE_WINDOW, "_NET_ACTIVE_WINDOW"); - REGISTER_ATOM(_XA_NET_WORKAREA, "_NET_WORKAREA"); - REGISTER_ATOM(_XA_NET_SHOWING_DESKTOP, "_NET_SHOWING_DESKTOP"); - - // other root messages - REGISTER_ATOM(_XA_NET_CLOSE_WINDOW, "_NET_CLOSE_WINDOW"); - REGISTER_ATOM(_XA_NET_MOVERESIZE_WINDOW, "_NET_MOVERESIZE_WINDOW"); - REGISTER_ATOM(_XA_NET_RESTACK_WINDOW, "_NET_RESTACK_WINDOW"); - REGISTER_ATOM(_XA_NET_REQUEST_FRAME_EXTENTS, "_NET_REQUEST_FRAME_EXTENTS"); - - REGISTER_ATOM(_XA_NET_WM_NAME, "_NET_WM_NAME"); - REGISTER_ATOM(_XA_NET_WM_WINDOW_TYPE, "_NET_WM_WINDOW_TYPE"); - REGISTER_ATOM(_XA_NET_WM_WINDOW_TYPE_NORMAL, "_NET_WM_WINDOW_TYPE_NORMAL"); - REGISTER_ATOM(_XA_NET_WM_WINDOW_TYPE_DOCK, "_NET_WM_WINDOW_TYPE_DOCK"); - REGISTER_ATOM(_XA_NET_WM_WINDOW_TYPE_TOOLBAR, "_NET_WM_WINDOW_TYPE_TOOLBAR"); - REGISTER_ATOM(_XA_NET_WM_WINDOW_TYPE_MENU, "_NET_WM_WINDOW_TYPE_MENU"); - REGISTER_ATOM(_XA_NET_WM_WINDOW_TYPE_UTIL, "_NET_WM_WINDOW_TYPE_UTIL"); - REGISTER_ATOM(_XA_NET_WM_WINDOW_TYPE_DIALOG, "_NET_WM_WINDOW_TYPE_DIALOG"); - REGISTER_ATOM(_XA_NET_WM_WINDOW_TYPE_DIALOG, "_NET_WM_WINDOW_TYPE_SPLASH"); - REGISTER_ATOM(_XA_NET_WM_WINDOW_TYPE_DESKTOP, "_NET_WM_WINDOW_TYPE_DESKTOP"); - - // window messages - REGISTER_ATOM(_XA_NET_WM_STATE, "_NET_WM_STATE"); - REGISTER_ATOM(_XA_NET_WM_STATE_MAXIMIZED_VERT,"_NET_WM_STATE_MAXIMIZED_VERT"); - REGISTER_ATOM(_XA_NET_WM_STATE_MAXIMIZED_HORZ,"_NET_WM_STATE_MAXIMIZED_HORZ"); - REGISTER_ATOM(_XA_NET_WM_STATE_SHADED, "_NET_WM_STATE_SHADED"); - REGISTER_ATOM(_XA_NET_WM_STATE_ABOVE, "_NET_WM_STATE_ABOVE"); - REGISTER_ATOM(_XA_NET_WM_STATE_BELOW, "_NET_WM_STATE_BELOW"); - - // our messages - REGISTER_ATOM(_XA_EDE_WM_STARTUP_NOTIFY, "_EDE_WM_STARTUP_NOTIFY"); - REGISTER_ATOM(_XA_EDE_WM_APP_STARTING, "_EDE_WM_APP_STARTING"); - - // debugging stuff (aka. not implemented) - REGISTER_ATOM(_XA_NET_VIRTUAL_ROOTS, "_NET_VIRTUAL_ROOTS"); - REGISTER_ATOM(_XA_NET_DESKTOP_LAYOUT, "_NET_DESKTOP_LAYOUT"); - REGISTER_ATOM(_XA_NET_WM_MOVERESIZE, "_NET_WM_MOVERESIZE"); - REGISTER_ATOM(_XA_NET_WM_VISIBLE_NAME, "_NET_WM_VISIBLE_NAME"); - REGISTER_ATOM(_XA_NET_WM_ICON_NAME, "_NET_WM_ICON_NAME"); - REGISTER_ATOM(_XA_NET_WM_ICON_VISIBLE_NAME, "_NET_WM_ICON_VISIBLE_NAME"); - REGISTER_ATOM(_XA_NET_WM_DESKTOP, "_NET_WM_DESKTOP"); - REGISTER_ATOM(_XA_NET_WM_STATE_MODAL, "_NET_WM_STATE_MODAL"); - REGISTER_ATOM(_XA_NET_WM_STATE_STICKY, "_NET_WM_STATE_STICKY"); - REGISTER_ATOM(_XA_NET_WM_STATE_SKIP_TASKBAR, "_NET_WM_STATE_SKIP_TASKBAR"); - REGISTER_ATOM(_XA_NET_WM_STATE_SKIP_PAGER, "_NET_WM_STATE_SKIP_PAGER"); - REGISTER_ATOM(_XA_NET_WM_STATE_HIDDEN, "_NET_WM_STATE_HIDDEN"); - REGISTER_ATOM(_XA_NET_WM_STATE_FULLSCREEN, "_NET_WM_STATE_FULLSCREEN"); - REGISTER_ATOM(_XA_NET_WM_STATE_DEMANDS_ATTENTION, "_NET_WM_STATE_DEMANDS_ATTENTION"); - REGISTER_ATOM(_XA_NET_WM_ALLOWED_ACTIONS, "_NET_WM_ALLOWED_ACTIONS"); - REGISTER_ATOM(_XA_NET_WM_ACTION_MOVE, "_NET_WM_ACTION_MOVE"); - REGISTER_ATOM(_XA_NET_WM_ACTION_RESIZE, "_NET_WM_ACTION_RESIZE"); - REGISTER_ATOM(_XA_NET_WM_ACTION_MINIMIZE, "_NET_WM_ACTION_MINIMIZE"); - REGISTER_ATOM(_XA_NET_WM_ACTION_SHADE, "_NET_WM_ACTION_SHADE"); - REGISTER_ATOM(_XA_NET_WM_ACTION_STICK, "_NET_WM_ACTION_STICK"); - REGISTER_ATOM(_XA_NET_WM_ACTION_MAXIMIZE_HORZ,"_NET_WM_ACTION_MAXIMIZE_HORZ"); - REGISTER_ATOM(_XA_NET_WM_ACTION_MAXIMIZE_VERT,"_NET_WM_ACTION_MAXIMIZE_VERT"); - REGISTER_ATOM(_XA_NET_WM_ACTION_FULLSCREEN, "_NET_WM_ACTION_FULLSCREEN"); - REGISTER_ATOM(_XA_NET_WM_ACTION_CHANGE_DESKTOP,"_NET_WM_ACTION_CHANGE_DESKTOP"); - REGISTER_ATOM(_XA_NET_WM_ACTION_CLOSE, "_NET_WM_ACTION_CLOSE"); - REGISTER_ATOM(_XA_NET_WM_STRUT, "_NET_WM_STRUT"); - REGISTER_ATOM(_XA_NET_WM_STRUT_PARTIAL, "_NET_WM_STRUT_PARTIAL"); - REGISTER_ATOM(_XA_NET_WM_ICON_GEOMETRY, "_NET_WM_ICON_GEOMETRY"); - REGISTER_ATOM(_XA_NET_WM_ICON, "_NET_WM_ICON"); - REGISTER_ATOM(_XA_NET_WM_PID, "_NET_WM_PID"); - REGISTER_ATOM(_XA_NET_WM_HANDLED_ICONS, "_NET_WM_HANDLED_ICONS"); - REGISTER_ATOM(_XA_NET_WM_USER_TIME, "_NET_WM_USER_TIME"); - REGISTER_ATOM(_XA_NET_FRAME_EXTENTS, "_NET_FRAME_EXTENTS"); - REGISTER_ATOM(_XA_NET_WM_PING, "_NET_WM_PING"); - REGISTER_ATOM(_XA_NET_WM_SYNC_REQUEST, "_NET_WM_SYNC_REQUEST"); - REGISTER_ATOM(_XA_NET_WM_STATE_STAYS_ON_TOP, "_NET_WM_STATE_STAYS_ON_TOP"); - REGISTER_ATOM(_XA_KWM_WIN_ICON, "_KWM_WIN_ICON"); -} - -// these are list of current implemented atoms -void SetSupported(Window root) -{ - Atom atoms[] = - { - _XA_NET_SUPPORTED, - _XA_NET_SUPPORTING_WM_CHECK, - - _XA_NET_WM_NAME, - _XA_NET_WM_WINDOW_TYPE, - _XA_NET_WM_WINDOW_TYPE_NORMAL, - _XA_NET_WM_WINDOW_TYPE_DOCK, - _XA_NET_WM_WINDOW_TYPE_TOOLBAR, - _XA_NET_WM_WINDOW_TYPE_MENU, - _XA_NET_WM_WINDOW_TYPE_UTIL, - _XA_NET_WM_WINDOW_TYPE_DIALOG, - _XA_NET_WM_WINDOW_TYPE_SPLASH, - _XA_NET_WM_WINDOW_TYPE_DESKTOP - }; - - XChangeProperty(fl_display, root, _XA_NET_SUPPORTED, XA_ATOM, 32, PropModeReplace, - (unsigned char*)atoms, COUNT(atoms)); -} - diff --git a/edewm/Atoms.h b/edewm/Atoms.h deleted file mode 100644 index b37ce79..0000000 --- a/edewm/Atoms.h +++ /dev/null @@ -1,131 +0,0 @@ -/* - * $Id: Atoms.h 1700 2006-07-22 18:51:10Z karijes $ - * - * Edewm, window manager - * Part of Equinox Desktop Environment (EDE). - * Copyright (c) 2000-2006 EDE Authors. - * - * This program is licenced under terms of the - * GNU General Public Licence version 2 or newer. - * See COPYING for details. - */ - -#ifndef __ATOMS_H__ -#define __ATOMS_H__ - -#ifdef _DEBUG -#include -#endif - -#include - -// Icccm atoms -extern Atom _XA_WM_PROTOCOLS; -extern Atom _XA_WM_DELETE_WINDOW; -extern Atom _XA_WM_STATE; -extern Atom _XA_WM_CHANGE_STATE; -extern Atom _XA_WM_COLORMAP_WINDOWS; -extern Atom _XA_WM_TAKE_FOCUS; - -extern Atom _XA_UTF8_STRING; - -// Motif atoms -extern Atom _XA_MOTIF_HINTS; - -// Netwm atoms -// root messages -extern Atom _XA_NET_SUPPORTED; -extern Atom _XA_NET_SUPPORTING_WM_CHECK; -extern Atom _XA_NET_NUMBER_OF_DESKTOPS; -extern Atom _XA_NET_DESKTOP_GEOMETRY; -extern Atom _XA_NET_DESKTOP_VIEWPORT; -extern Atom _XA_NET_CURRENT_DESKTOP; -extern Atom _XA_NET_DESKTOP_NAMES; -extern Atom _XA_NET_ACTIVE_WINDOW; -extern Atom _XA_NET_WORKAREA; -extern Atom _XA_NET_SHOWING_DESKTOP; -// other root messages -extern Atom _XA_NET_CLOSE_WINDOW; -extern Atom _XA_NET_MOVERESIZE_WINDOW; -extern Atom _XA_NET_RESTACK_WINDOW; -extern Atom _XA_NET_REQUEST_FRAME_EXTENTS; - -// application messages -extern Atom _XA_NET_WM_NAME; -extern Atom _XA_NET_WM_WINDOW_TYPE; - extern Atom _XA_NET_WM_WINDOW_TYPE_NORMAL; - extern Atom _XA_NET_WM_WINDOW_TYPE_DOCK; - extern Atom _XA_NET_WM_WINDOW_TYPE_TOOLBAR; - extern Atom _XA_NET_WM_WINDOW_TYPE_MENU; - extern Atom _XA_NET_WM_WINDOW_TYPE_UTIL; - extern Atom _XA_NET_WM_WINDOW_TYPE_DIALOG; - extern Atom _XA_NET_WM_WINDOW_TYPE_SPLASH; - extern Atom _XA_NET_WM_WINDOW_TYPE_DESKTOP; - -extern Atom _XA_NET_WM_STATE_SHADED; -extern Atom _XA_NET_WM_STATE_MAXIMIZED_VERT; -extern Atom _XA_NET_WM_STATE_MAXIMIZED_HORZ; -extern Atom _XA_NET_WM_STATE_ABOVE; -extern Atom _XA_NET_WM_STATE_BELOW; - -// how to apply above states -#define _NET_WM_STATE_REMOVE 0 // remove/unset property -#define _NET_WM_STATE_ADD 1 // add/set property -#define _NET_WM_STATE_TOGGLE 2 // toggle property - -// our messages -extern Atom _XA_EDE_WM_STARTUP_NOTIFY; - extern Atom _XA_EDE_WM_APP_STARTING; - -// atoms for debugging (not implemented) -extern Atom _XA_NET_VIRTUAL_ROOTS; -extern Atom _XA_NET_DESKTOP_LAYOUT; -extern Atom _XA_NET_WM_MOVERESIZE; -extern Atom _XA_NET_RESTACK_WINDOW; -extern Atom _XA_NET_REQUEST_FRAME_EXTENTS; -extern Atom _XA_NET_WM_NAME; -extern Atom _XA_NET_WM_VISIBLE_NAME; -extern Atom _XA_NET_WM_ICON_NAME; -extern Atom _XA_NET_WM_ICON_VISIBLE_NAME; -extern Atom _XA_NET_WM_DESKTOP; -extern Atom _XA_NET_WM_STATE; -extern Atom _XA_NET_WM_STATE_MODAL; //Needs transient for (root for whole group) -extern Atom _XA_NET_WM_STATE_STICKY; //Pos fixed, even if virt. desk. scrolls -extern Atom _XA_NET_WM_STATE_SKIP_TASKBAR; -extern Atom _XA_NET_WM_STATE_SKIP_PAGER; -extern Atom _XA_NET_WM_STATE_HIDDEN; -extern Atom _XA_NET_WM_STATE_FULLSCREEN; -extern Atom _XA_NET_WM_STATE_DEMANDS_ATTENTION; - -extern Atom _XA_NET_WM_ALLOWED_ACTIONS; -extern Atom _XA_NET_WM_ACTION_MOVE; -extern Atom _XA_NET_WM_ACTION_RESIZE; -extern Atom _XA_NET_WM_ACTION_MINIMIZE; -extern Atom _XA_NET_WM_ACTION_SHADE; -extern Atom _XA_NET_WM_ACTION_STICK; -extern Atom _XA_NET_WM_ACTION_MAXIMIZE_HORZ; -extern Atom _XA_NET_WM_ACTION_MAXIMIZE_VERT; -extern Atom _XA_NET_WM_ACTION_FULLSCREEN; -extern Atom _XA_NET_WM_ACTION_CHANGE_DESKTOP; -extern Atom _XA_NET_WM_ACTION_CLOSE; -extern Atom _XA_NET_WM_STRUT; -extern Atom _XA_NET_WM_STRUT_PARTIAL; -extern Atom _XA_NET_WM_ICON_GEOMETRY; -extern Atom _XA_NET_WM_ICON; -extern Atom _XA_NET_WM_PID; -extern Atom _XA_NET_WM_HANDLED_ICONS; -extern Atom _XA_NET_WM_USER_TIME; -extern Atom _XA_NET_FRAME_EXTENTS; -extern Atom _XA_NET_WM_PING; -extern Atom _XA_NET_WM_SYNC_REQUEST; -extern Atom _XA_NET_WM_STATE_STAYS_ON_TOP; -extern Atom _XA_KWM_WIN_ICON; - -#ifdef _DEBUG - void InitAtoms(Display* display, std::map& atoms_map); -#else - void InitAtoms(Display* display); -#endif -void SetSupported(Window root); - -#endif // __ATOMS_H__ diff --git a/edewm/COMPLIANCE b/edewm/COMPLIANCE deleted file mode 100644 index 2d4e4c4..0000000 --- a/edewm/COMPLIANCE +++ /dev/null @@ -1,128 +0,0 @@ -$Id: COMPLIANCE 1688 2006-07-19 12:01:58Z karijes $ - -Edewm standards compliance -========================== - -Map: ----- - (?): pending for implementation - (+): implemented - (/): partially implemented - (x): listed in _NET_SUPPORTED, but not implemented - (-): probably will not be implemented - -Netwm compliance (http://freedesktop.org/Standards/wm-spec/) -============================================================ - -Root window ------------ - -(+) _NET_SUPPORTED, -(x) _NET_SUPPORTING_WM_CHECK -(?) _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 -(?) _NET_DESKTOP_LAYOUT -(?) _NET_SHOWING_DESKTOP -(?) _NET_CLOSE_WINDOW -(?) _NET_MOVERESIZE_WINDOW -(?) _NET_WM_MOVERESIZE - -Application window ------------------- - -(x) _NET_WM_NAME -(/) _NET_WM_WINDOW_TYPE - (+) _NET_WM_WINDOW_TYPE_NORMAL - (?) _NET_WM_WINDOW_TYPE_DOCK - (+) _NET_WM_WINDOW_TYPE_TOOLBAR - (+) _NET_WM_WINDOW_TYPE_MENU - (?) _NET_WM_WINDOW_TYPE_UTIL - (?) _NET_WM_WINDOW_TYPE_DIALOG - (+) _NET_WM_WINDOW_TYPE_SPLASH - (?) _NET_WM_WINDOW_TYPE_DESKTOP - -(/) _NET_WM_STATE - (?) _NET_WM_STATE_MODAL - (?) _NET_WM_STATE_STICKY - (/) _NET_WM_STATE_MAXIMIZED_VERT - (/) _NET_WM_STATE_MAXIMIZED_HORZ - (+) _NET_WM_STATE_SHADED - (?) _NET_WM_STATE_SKIP_TASKBAR - (?) _NET_WM_STATE_SKIP_PAGER - (?) _NET_WM_STATE_HIDDEN - (?) _NET_WM_STATE_FULLSCREEN - (?) _NET_WM_STATE_ABOVE - (?) _NET_WM_STATE_BELOW - -(-) _NET_WM_ALLOWED_ACTIONS - Although in edewm there is facility for easier implementing - this message, I am not quite sure where will be used. - -(?) _NET_WM_STRUT -(?) _NET_WM_STRUT_PARTIAL -(?) _NET_WM_ICON_GEOMETRY -(?) _NET_WM_ICON - -(-) _NET_WM_PID - Probably later will be implemented. For now it is not needed - at all. - -(-) _NET_WM_HANDLED_ICONS -(?) _NET_WM_USER_TIME - - -Icccm compliance -================ - -Version 2.0 is used as guide. - -Note: in WM_NORMAL_HINTS, win_gravitiy is ignored since edewm always -assume and use NorthWestGravity. This will be changed. - - -Other -===== - -Motif ------ - -(/) _MOTIF_HINTS - This hint is, as I can see, very standardized now, but implementations - differ. Edewm use only decor data from it, since based on decor, allowed - actions are deduced. - -KDE ---- -(?) _KWM_WIN_ICON - Previous edewm version loaded this message, but not used. Probably - will be implemented for history reasons (hm...) - -GNOME ------ -(-) None of them, since no one requested it. - - -Ambiguities -=========== -If ambiguities arise between similar hints, Netwm is preferred. Then -comes Icccm and Other. - - -Notes -===== -This document will be tried to be up to date with package. If you notice some -omissions, please mail me at [karijes at users.sf.net]. - -Important: since standard's documentation is very sparse (nothing unusual) and -possibility for bad/wrong interpretation of some parts exists, your notice about -them (or different behaviors among other window managers) will be much appreciated. -Mail is above. diff --git a/edewm/Cursor.cpp b/edewm/Cursor.cpp deleted file mode 100644 index 733f8ac..0000000 --- a/edewm/Cursor.cpp +++ /dev/null @@ -1,298 +0,0 @@ -/* - * $Id: Cursor.cpp 1700 2006-07-22 18:51:10Z karijes $ - * - * Edewm, window manager - * Part of Equinox Desktop Environment (EDE). - * Copyright (c) 2000-2006 EDE Authors. - * - * This program is licenced under terms of the - * GNU General Public Licence version 2 or newer. - * See COPYING for details. - */ - -#include "Cursor.h" -#include "Frame.h" -#include "Tracers.h" - -#include -#include - -#include - -#ifdef _DEBUG - #include - std::map cursors_map; -#endif - -/* Windows like cursors (copied from FLTK). - * These are cursors for some shapes (given in comments). For others, default X are used. - */ -#define CURSORSIZE 16 -#define HOTXY 8 -static struct TableEntry { - uchar bits[CURSORSIZE*CURSORSIZE/8]; - uchar mask[CURSORSIZE*CURSORSIZE/8]; - Cursor cursor; -} table[] = { - {{ // FL_CURSOR_NS - 0x00, 0x00, 0x80, 0x01, 0xc0, 0x03, 0xe0, 0x07, 0x80, 0x01, 0x80, 0x01, - 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, - 0xe0, 0x07, 0xc0, 0x03, 0x80, 0x01, 0x00, 0x00}, - { - 0x80, 0x01, 0xc0, 0x03, 0xe0, 0x07, 0xf0, 0x0f, 0xf0, 0x0f, 0xc0, 0x03, - 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xf0, 0x0f, - 0xf0, 0x0f, 0xe0, 0x07, 0xc0, 0x03, 0x80, 0x01}}, - {{ // FL_CURSOR_EW - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, - 0x0c, 0x30, 0xfe, 0x7f, 0xfe, 0x7f, 0x0c, 0x30, 0x08, 0x10, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, - { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x1c, 0x38, - 0xfe, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x7f, 0x1c, 0x38, 0x18, 0x18, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{ // FL_CURSOR_NWSE - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x38, 0x00, 0x78, 0x00, - 0xe8, 0x00, 0xc0, 0x01, 0x80, 0x03, 0x00, 0x17, 0x00, 0x1e, 0x00, 0x1c, - 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, - { - 0x00, 0x00, 0x00, 0x00, 0xfc, 0x00, 0xfc, 0x00, 0x7c, 0x00, 0xfc, 0x00, - 0xfc, 0x01, 0xec, 0x03, 0xc0, 0x37, 0x80, 0x3f, 0x00, 0x3f, 0x00, 0x3e, - 0x00, 0x3f, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00}}, - {{ // FL_CURSOR_NESW - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x1c, 0x00, 0x1e, - 0x00, 0x17, 0x80, 0x03, 0xc0, 0x01, 0xe8, 0x00, 0x78, 0x00, 0x38, 0x00, - 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, - { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x3f, 0x00, 0x3e, 0x00, 0x3f, - 0x80, 0x3f, 0xc0, 0x37, 0xec, 0x03, 0xfc, 0x01, 0xfc, 0x00, 0x7c, 0x00, - 0xfc, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0}, {0}} // FL_CURSOR_NONE & unknown -}; - -// Mozilla-like busy cursor -#define LAWATCH_WIDTH 32 -#define LAWATCH_HEIGHT 32 -#define LAWATCH_HOTXY 2 -const char left_arrow_watch_bits [] = -{ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, - 0x0c, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, - 0x7c, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0xfc, 0x01, 0x00, 0x00, - 0xfc, 0x3b, 0x00, 0x00, 0x7c, 0x38, 0x00, 0x00, 0x6c, 0x54, 0x00, 0x00, - 0xc4, 0xdc, 0x00, 0x00, 0xc0, 0x44, 0x00, 0x00, 0x80, 0x39, 0x00, 0x00, - 0x80, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -}; - -const char left_arrow_watch_mask [] = -{ - 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, - 0x1e, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, - 0xfe, 0x00, 0x00, 0x00, 0xfe, 0x01, 0x00, 0x00, 0xfe, 0x3b, 0x00, 0x00, - 0xfe, 0x7f, 0x00, 0x00, 0xfe, 0x7f, 0x00, 0x00, 0xfe, 0xfe, 0x00, 0x00, - 0xee, 0xff, 0x01, 0x00, 0xe4, 0xff, 0x00, 0x00, 0xc0, 0x7f, 0x00, 0x00, - 0xc0, 0x7f, 0x00, 0x00, 0x80, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -}; - -Cursor CreateLeftArrowWatch(void) -{ - XColor dummy; - Pixmap p = XCreateBitmapFromData(fl_display, RootWindow(fl_display, fl_screen), - left_arrow_watch_bits, LAWATCH_WIDTH, LAWATCH_HEIGHT); - Pixmap m = XCreateBitmapFromData(fl_display, RootWindow(fl_display, fl_screen), - left_arrow_watch_mask, LAWATCH_WIDTH, LAWATCH_HEIGHT); - - Cursor cursor = XCreatePixmapCursor(fl_display, p, m, &dummy, &dummy, LAWATCH_HOTXY, LAWATCH_HOTXY); - - // recolor created cursor to usefull colors - XColor fgc; - Fl_Color fg = fl_get_color(FL_BLACK); - fgc.red = (fg>>16)&0xFF00; - fgc.green = (fg>>8)&0xFF00; - fgc.blue = fg & 0xFF00; - - XColor bgc; - Fl_Color bg = fl_get_color(FL_WHITE); - bgc.red = (bg>>16)&0xFF00; - bgc.green = (bg>>8)&0xFF00; - bgc.blue = bg & 0xFF00; - XRecolorCursor(fl_display, cursor, &fgc, &bgc); - - return cursor; -} - -Cursor CreateFltkCursor(Fl_Cursor c) -{ - Cursor cursor; - if(!c) - return None; - - if(c >= FL_CURSOR_NS) - { - TableEntry* q = (c > FL_CURSOR_NESW) ? table+4 : table+(c-FL_CURSOR_NS); - if(!(q->cursor)) - { - XColor dummy; - Pixmap p = XCreateBitmapFromData(fl_display, RootWindow(fl_display, fl_screen), (const char*)q->bits, - CURSORSIZE, CURSORSIZE); - Pixmap m = XCreateBitmapFromData(fl_display, RootWindow(fl_display, fl_screen), (const char*)q->mask, - CURSORSIZE, CURSORSIZE); - q->cursor = XCreatePixmapCursor(fl_display, p, m, &dummy, &dummy, HOTXY, HOTXY); - - XFreePixmap(fl_display, m); - XFreePixmap(fl_display, p); - } - cursor = q->cursor; - } - else - cursor = XCreateFontCursor(fl_display, (c-1)*2); - - // recolor created cursor to usefull colors - XColor fgc; - Fl_Color fg = fl_get_color(FL_BLACK); - fgc.red = (fg>>16)&0xFF00; - fgc.green = (fg>>8)&0xFF00; - fgc.blue = fg & 0xFF00; - - XColor bgc; - Fl_Color bg = fl_get_color(FL_WHITE); - bgc.red = (bg>>16)&0xFF00; - bgc.green = (bg>>8)&0xFF00; - bgc.blue = bg & 0xFF00; - XRecolorCursor(fl_display, cursor, &fgc, &bgc); - - return cursor; -} - -CursorHandler::CursorHandler() -{ - cursors_loaded = false; - - /* In some cases curr_cursor_type can't be set - * fast enough (mostly for Frame::grab_cursor()) which - * will crash whole wm. This will prevent that. - */ - curr_cursor_type = CURSOR_DEFAULT; -} - -CursorHandler::~CursorHandler() -{ - if(st != X_CURSORS) - return; - - for(int i = 0; i < CURSOR_LIST_SIZE; i++) - XFreeCursor(fl_display, cursors[i]); -} - -void CursorHandler::load(CursorShapeType s) -{ - TRACE_FUNCTION("void CursorHandler::load(CursorShapeType s)"); - - st = s; - if(st == FLTK_CURSORS) - { - cursors[CURSOR_DEFAULT] = CreateFltkCursor(FL_CURSOR_ARROW); - cursors[CURSOR_MOVE] = CreateFltkCursor(FL_CURSOR_MOVE); - - //cursors[CURSOR_WAIT] = CreateFltkCursor(FL_CURSOR_WAIT); - cursors[CURSOR_WAIT] = CreateLeftArrowWatch(); - - cursors[CURSOR_HELP] = CreateFltkCursor(FL_CURSOR_HELP); - cursors[CURSOR_N] = CreateFltkCursor(FL_CURSOR_NS); - cursors[CURSOR_NE] = CreateFltkCursor(FL_CURSOR_NESW); - cursors[CURSOR_E] = CreateFltkCursor(FL_CURSOR_WE); - cursors[CURSOR_SE] = CreateFltkCursor(FL_CURSOR_NWSE); - cursors[CURSOR_S] = CreateFltkCursor(FL_CURSOR_NS); - cursors[CURSOR_SW] = CreateFltkCursor(FL_CURSOR_NESW); - cursors[CURSOR_W] = CreateFltkCursor(FL_CURSOR_WE); - cursors[CURSOR_NW] = CreateFltkCursor(FL_CURSOR_NWSE); - } - else - { - cursors[CURSOR_DEFAULT] = XCreateFontCursor(fl_display, XC_left_ptr); - cursors[CURSOR_MOVE] = XCreateFontCursor(fl_display, XC_fleur); - - //cursors[CURSOR_WAIT] = XCreateFontCursor(fl_display, XC_watch); - cursors[CURSOR_WAIT] = CreateLeftArrowWatch(); - - cursors[CURSOR_HELP] = XCreateFontCursor(fl_display, XC_question_arrow); - cursors[CURSOR_N] = XCreateFontCursor(fl_display, XC_top_side); - cursors[CURSOR_NE] = XCreateFontCursor(fl_display, XC_top_right_corner); - cursors[CURSOR_E] = XCreateFontCursor(fl_display, XC_right_side); - cursors[CURSOR_SE] = XCreateFontCursor(fl_display, XC_bottom_right_corner); - cursors[CURSOR_S] = XCreateFontCursor(fl_display, XC_bottom_side); - cursors[CURSOR_SW] = XCreateFontCursor(fl_display, XC_bottom_left_corner); - cursors[CURSOR_W] = XCreateFontCursor(fl_display, XC_left_side); - cursors[CURSOR_NW] = XCreateFontCursor(fl_display, XC_top_left_corner); - } - -#ifdef _DEBUG - cursors_map[CURSOR_DEFAULT] = "CURSOR_DEFAULT"; - cursors_map[CURSOR_MOVE] = "CURSOR_MOVE"; - cursors_map[CURSOR_WAIT] = "CURSOR_WAIT"; - cursors_map[CURSOR_HELP] = "CURSOR_HELP"; - cursors_map[CURSOR_N] = "CURSOR_N"; - cursors_map[CURSOR_NE] = "CURSOR_NE"; - cursors_map[CURSOR_E] = "CURSOR_E"; - cursors_map[CURSOR_SE] = "CURSOR_SE"; - cursors_map[CURSOR_S] = "CURSOR_S"; - cursors_map[CURSOR_SW] = "CURSOR_SW"; - cursors_map[CURSOR_W] = "CURSOR_W"; - cursors_map[CURSOR_NW] = "CURSOR_NW"; -#endif - - cursors_loaded = true; -} - -void CursorHandler::set_cursor(Frame* f, CursorType t) -{ - TRACE_FUNCTION("void CursorHandler::set_cursor(Frame* f, CursorType t)"); -#ifdef _DEBUG - ELOG("Cursor set to %s", cursors_map[t]); -#endif - assert(cursors_loaded != false); - assert(f != NULL); - - // do not set cursor to same type again - if(t == curr_cursor_type) - return; - - curr_cursor_type = t; - - XDefineCursor(fl_display, fl_xid(f), cursors[curr_cursor_type]); -} - -// only for root window -void CursorHandler::set_root_cursor(void) -{ - TRACE_FUNCTION("void CursorHandler::set_root_cursor(void)"); - assert(cursors_loaded != false); - - root_window_cursor = cursors[CURSOR_DEFAULT]; - XDefineCursor(fl_display, RootWindow(fl_display, fl_screen), root_window_cursor); -} - -void CursorHandler::set_root_cursor(CursorType t) -{ - TRACE_FUNCTION("void CursorHandler::set_root_cursor(CursorType t)"); - assert(cursors_loaded != false); - - root_window_cursor = cursors[t]; - XDefineCursor(fl_display, RootWindow(fl_display, fl_screen), root_window_cursor); -} - -Cursor CursorHandler::current_cursor(void) const -{ - TRACE_FUNCTION("Cursor CursorHandler::current_cursor(void) const"); - //assert(current_cursor > 0 && current_cursor < CURSOR_LIST_SIZE); - return cursors[curr_cursor_type]; -} diff --git a/edewm/Cursor.h b/edewm/Cursor.h deleted file mode 100644 index a393e18..0000000 --- a/edewm/Cursor.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * $Id: Cursor.h 1700 2006-07-22 18:51:10Z karijes $ - * - * Edewm, window manager - * Part of Equinox Desktop Environment (EDE). - * Copyright (c) 2000-2006 EDE Authors. - * - * This program is licenced under terms of the - * GNU General Public Licence version 2 or newer. - * See COPYING for details. - */ - -#ifndef __CURSOR_H__ -#define __CURSOR_H__ - -#include // Cursor - -/* Main existance of this class is - * to allow using efltk and X cursors - * (...and maybe bitmapped ones :). - */ - -enum CursorType -{ - CURSOR_DEFAULT = 0, - CURSOR_MOVE, - CURSOR_WAIT, - CURSOR_HELP, - CURSOR_N, - CURSOR_NE, - CURSOR_E, - CURSOR_SE, - CURSOR_S, - CURSOR_SW, - CURSOR_W, - CURSOR_NW, - CURSOR_NONE -}; - -#define CURSOR_LIST_SIZE 13 - -enum CursorShapeType -{ - FLTK_CURSORS = 0, - X_CURSORS -}; - -class Frame; - -class CursorHandler -{ - private: - int cursors[CURSOR_LIST_SIZE]; - CursorShapeType st; - CursorType curr_cursor_type; - Cursor root_window_cursor; - bool locked; - bool cursors_loaded; - public: - CursorHandler(); - ~CursorHandler(); - void load(CursorShapeType s); - void set_cursor(Frame* f, CursorType t); - void set_root_cursor(void); - void set_root_cursor(CursorType t); - Cursor current_cursor(void) const; - Cursor root_cursor(void) { return root_window_cursor; } - CursorShapeType cursor_shape_type(void) { return st; } -}; -#endif diff --git a/edewm/Desktop.h b/edewm/Desktop.h deleted file mode 100644 index 097c744..0000000 --- a/edewm/Desktop.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - * $Id: Desktop.h 1653 2006-06-09 13:08:58Z karijes $ - * - * Edewm, window manager - * Part of Equinox Desktop Environment (EDE). - * Copyright (c) 2000-2006 EDE Authors. - * - * This program is licenced under terms of the - * GNU General Public Licence version 2 or newer. - * See COPYING for details. - */ - -#ifndef _DESKTOP_H_ -#define _DESKTOP_H_ - -#include - -class Desktop { -public: - Desktop(const char *name); - ~Desktop(); - - const char* name() const { return name_; } - void name(const char *name); - int number() const { return number_; } - - static Desktop *desktop(int num); - - static Desktop *next(); - static Desktop *prev(); - - static Desktop *current() { return current_; } - static int current_num() { return current_ ? current_->number() : -1; } - - static Desktop* add(const char *name=0); - - static void current(Desktop *cur); - static void current(int cur) { current(desktop(cur)); } - - static int desktop_count() { return desktop_count_; } - - static void update_desktop_viewport(); - static void update_desktop_workarea(); - static void update_desktop_geometry(); - - static void update_desktop_count(uint cnt, bool send=true); - static void update_desktop_names(bool send=true); - - static void set_names(); - - int junk; // for temporary storage by menu builder - -private: - static Desktop* current_; - static int desktop_count_; - - const char* name_; - int number_; -}; - -class Desktop_List : public Fl_Ptr_List { -public: - Desktop_List() : Fl_Ptr_List() { } - - void append(Desktop *item) { Fl_Ptr_List::append((void *)item); } - void prepend(Desktop *item) { Fl_Ptr_List::prepend((void *)item); } - void insert(uint pos, Desktop *item) { Fl_Ptr_List::insert(pos, (void *)item); } - void replace(uint pos, Desktop *item) { Fl_Ptr_List::replace(pos, (void *)item); } - void remove(uint pos) { Fl_Ptr_List::remove(pos); } - bool remove(Desktop *item) { return Fl_Ptr_List::remove((void *)item); } - int index_of(const Desktop *w) const { return Fl_Ptr_List::index_of((void*)w); } - Desktop *item(uint index) const { return (Desktop*)Fl_Ptr_List::item(index); } - - Desktop **data() { return (Desktop**)items; } - - Desktop *operator [](uint ind) const { return (Desktop *)items[ind]; } -}; - -extern Desktop_List desktops; - -#endif diff --git a/edewm/Events.cpp b/edewm/Events.cpp deleted file mode 100644 index e7add63..0000000 --- a/edewm/Events.cpp +++ /dev/null @@ -1,508 +0,0 @@ -/* - * $Id: Events.cpp 1712 2006-07-25 10:04:41Z karijes $ - * - * Edewm, window manager - * Part of Equinox Desktop Environment (EDE). - * Copyright (c) 2000-2006 EDE Authors. - * - * This program is licenced under terms of the - * GNU General Public Licence version 2 or newer. - * See COPYING for details. - */ - -#include "Events.h" -#include "Frame.h" -#include "Titlebar.h" -#include "Windowmanager.h" -#include "Tracers.h" -#include "Atoms.h" -#include "Hints.h" -#include "Cursor.h" -#include "debug.h" - -#include - - -#define FRAME_NAME(frame) (frame->label ? frame->label : "NULL") - -FrameEventHandler::FrameEventHandler(Frame* f) : curr_frame(f) -{ - assert(curr_frame != NULL); -} - -FrameEventHandler::~FrameEventHandler() -{ -} - -/* Handle efltk events. - * Some events like FL_FOCUS and FL_UNFOCUS are not handled, since - * efltk does not receive this event when when should (for example: - * one window is focused, but other shoud be automatically unfocused). - * X on ther hand send FocusIn and FocusOut when above events ocurr. - */ -int FrameEventHandler::handle_fltk(int event) -{ - long gggg; - static long bbbb; - static CursorType ctype; - - if(curr_frame->show_titlebar) - { - Titlebar* tbar = curr_frame->titlebar; - assert(tbar != NULL); - - if(!curr_frame->resizing()) - { - if(Fl::event_inside(tbar->x(), tbar->y(), tbar->w(), tbar->h()) || curr_frame->moving()) - return tbar->handle(event); - } - } - - switch(event) - { - case FL_SHOW: - case FL_HIDE: - return 0; - - case FL_ENTER: - ELOG("FrameEventHandler: FL_ENTER"); - return 1; - - case FL_LEAVE: - ELOG("FrameEventHandler: FL_LEAVE"); - return 1; - - case FL_MOVE: - { - // note, I am using coordinates _inside_ window - gggg = curr_frame->resize_type(Fl::event_x(), Fl::event_y()); - switch(gggg) - { - case ResizeTypeUpLeft: - ELOG("FrameEventHandler (resizing): ResizeTypeUpLeft"); - curr_frame->set_cursor(CURSOR_NW); - ctype = CURSOR_NW; - bbbb = ResizeTypeUpLeft; - return 1; - case ResizeTypeUpRight: - ELOG("FrameEventHandler (resizing): ResizeTypeUpRight"); - curr_frame->set_cursor(CURSOR_NE); - ctype = CURSOR_NE; - bbbb = ResizeTypeUpRight; - return 1; - case ResizeTypeDownLeft: - ELOG("FrameEventHandler (resizing): ResizeTypeDownLeft"); - curr_frame->set_cursor(CURSOR_SW); - ctype = CURSOR_SW; - bbbb = ResizeTypeDownLeft; - return 1; - case ResizeTypeDownRight: - ELOG("FrameEventHandler (resizing): ResizeTypeDownRight"); - curr_frame->set_cursor(CURSOR_SE); - ctype = CURSOR_SE; - bbbb = ResizeTypeDownRight; - return 1; - case ResizeTypeUp: - ELOG("FrameEventHandler (resizing): ResizeTypeUp"); - curr_frame->set_cursor(CURSOR_N); - ctype = CURSOR_N; - bbbb = ResizeTypeUp; - return 1; - case ResizeTypeLeft: - ELOG("FrameEventHandler (resizing): ResizeTypeLeft"); - curr_frame->set_cursor(CURSOR_W); - ctype = CURSOR_W; - bbbb = ResizeTypeLeft; - return 1; - case ResizeTypeRight: - ELOG("FrameEventHandler (resizing): ResizeTypeRight"); - curr_frame->set_cursor(CURSOR_E); - ctype = CURSOR_E; - bbbb = ResizeTypeRight; - return 1; - case ResizeTypeDown: - ELOG("FrameEventHandler (resizing): ResizeTypeDown"); - curr_frame->set_cursor(CURSOR_S); - ctype = CURSOR_S; - bbbb = ResizeTypeDown; - return 1; - default: - //curr_frame->set_cursor(CURSOR_DEFAULT); - bbbb = ResizeTypeNone; - return 1; - } - return 1; - } - - case FL_PUSH: - ELOG("FrameEventHandler: FL_PUSH"); - - if(Fl::event_is_click()) - { - curr_frame->borders_color(CLICKED); - curr_frame->raise(); - } - return 1; - - case FL_DRAG: - ELOG("FrameEventHandler: FL_DRAG"); - if(bbbb != ResizeTypeNone) - { - if(!curr_frame->resizing()) - { - curr_frame->grab_cursor(); - curr_frame->resize_start(); - curr_frame->show_coordinates_window(); - } - - //XGrabServer(fl_display); - - curr_frame->set_cursor(ctype); - curr_frame->resize_window(Fl::event_x_root(), Fl::event_y_root(), bbbb); - curr_frame->update_coordinates_window(); - } - return 1; - - case FL_RELEASE: - ELOG("FrameEventHandler: FL_RELEASE"); - if(curr_frame->resizing()) - { - //XUngrabServer(fl_display); - curr_frame->resize_end(); - curr_frame->ungrab_cursor(); - curr_frame->hide_coordinates_window(); - curr_frame->set_cursor(CURSOR_DEFAULT); - } - - //curr_frame->color(FL_GRAY); - curr_frame->borders_color(FOCUSED); - return 1; - default: - // let other events go to sizers - return curr_frame->handle_parent(event); - } - return 0; - -} - -int FrameEventHandler::handle_x(XEvent* event) -{ - switch(event->type) - { - case MapRequest: - return map_event(event->xmaprequest); - case UnmapNotify: - return unmap_event(event->xunmap); - case ReparentNotify: - return reparent_event(event->xreparent); - case DestroyNotify: - return destroy_event(event->xdestroywindow); - /*case ClientMessage: - return client_message(event->xclient);*/ - case LeaveNotify: - case EnterNotify: - return enter_leave_event(event->xcrossing); - - /* FocusIn, as FocusOut is not used, but for - * debugging is here. When we map a large number - * of windows, X seems goes into (for me unknown) - * infinite FocusIn/FocusOut loop, which blocks - * everything. So, to keep us far away from pain, - * leave FocusIn for someone else. Here should not - * be used. - */ - case FocusIn: - { - ELOG("FrameEventHandler: FocusIn"); - switch(event->xfocus.mode) - { - case NotifyNormal: - ELOG(" - NotifyNormal"); - break; - case NotifyGrab: - ELOG(" - NotifyGrab"); - break; - case NotifyUngrab: - ELOG(" - NotifyUngrab"); - break; - } - - if(event->xfocus.send_event) - ELOG(" - got from SendEvent"); - - /* This will prevent menus, etc. - * to steal focus from parent. - */ - //if(event->xfocus.mode == NotifyNormal) - // curr_frame->focus(); - } - return 1; - - /* FocusOut really fuck up focusing so - * it is not handled. Either xfocus.mode == NotifyNormal - * does not helps when window emits menu, since menu - * itself will yield FocusOut for parent and FocusIn - * for itself. Unfortunately I don't know any toolkit - * which export some kind MENU flag, where we can check. - * So, let we shut it up, make ourself little bit happy - * and take all burden of FocusOut to ourself (which made - * use very very unhappy). - */ - case FocusOut: - { - ELOG("FrameEventHandler: FocusOut"); - switch(event->xfocus.mode) - { - case NotifyNormal: - ELOG(" - NotifyNormal"); - break; - case NotifyGrab: - ELOG(" - NotifyGrab"); - break; - case NotifyUngrab: - ELOG(" - NotifyUngrab"); - break; - } - - if(event->xfocus.send_event) - ELOG(" - got from SendEvent"); - //curr_frame->unfocus(); - } - return 1; - case PropertyNotify: - return property_event(event->xproperty); - case ConfigureRequest: - return configure_event(event->xconfigurerequest); - return 1; - - default: -#ifdef _DEBUG - const char* name = WindowManager::instance()->xevent_map[event->type]; - if(name) - ELOG("Got unhandled %s in frame", name); - else - ELOG("Got unhandled event in frame (%i)", event->type); -#endif - return 0; - } - return 0; -} - -int FrameEventHandler::map_event(const XMapRequestEvent& e) -{ - TRACE_FUNCTION("int FrameEventHandler::map_event(const XMapRequestEvent& e)"); - assert(e.window == curr_frame->window()); - - curr_frame->map(); - - return 1; -} - -int FrameEventHandler::unmap_event(const XUnmapEvent& e) -{ - TRACE_FUNCTION("int FrameEventHandler::unmap_event(const XUnmapEvent& e)"); - //assert(e.window == curr_frame->window()); - if(e.window != curr_frame->window()) - return 1; - - ELOG("FrameEventHandler: UnmapNotify (%s)", FRAME_NAME(curr_frame->fdata)); - if(e.from_configure) - return 1; - - if(curr_frame->option(FrameOptIgnoreUnmap)) - { - ELOG("Frame have FrameOptIgnoreUnmap, skiping this event"); - curr_frame->clear_option(FrameOptIgnoreUnmap); - } - else - curr_frame->unmap(); - - return 1; -} - -int FrameEventHandler::reparent_event(const XReparentEvent& e) -{ - TRACE_FUNCTION("int FrameEventHandler::reparent_event(const XReparentEvent& e)"); - ELOG("FrameEventHandler: ReparentNotify (%s)", FRAME_NAME(curr_frame->fdata)); - - // echo - if(e.parent == fl_xid(curr_frame)) - return 1; - // app is trying to tear-off again ??? - if(e.parent == fl_xid(WindowManager::instance())) - return 1; - - if(e.override_redirect) - { - ELOG("override_redirect from reparent_event"); - } - - EWARNING("Destroy in ReparentNotify!"); - curr_frame->destroy(); - - return 1; -} - -int FrameEventHandler::destroy_event(const XDestroyWindowEvent& e) -{ - TRACE_FUNCTION("int FrameEventHandler::destroy_event(const XDestroyWindowEvent& e)"); - - curr_frame->destroy(); - return 1; -} - -int FrameEventHandler::client_message(const XClientMessageEvent& e) -{ - TRACE_FUNCTION("int FrameEventHandler::client_message(const XClientMessageEvent& e)"); - - if(!ValidateDrawable(e.window)) - return 1; - -#ifdef _DEBUG - Atom a = e.message_type; - const char* name = WindowManager::instance()->atom_map[a]; - if(name) - ELOG("FrameEventHandler: unhandled atom %s", name); - else - ELOG("FrameEventHandler: unhandled atom %x", a); -#endif - - return 1; -} - -/* Handle property atoms. Here Netwm atoms are handled - * last, giving them precedence and chance to overwrite - * Icccm stuf (list XA_WM_NAME vs. _XA_NET_WM_NAME) - */ -int FrameEventHandler::property_event(const XPropertyEvent& e) -{ - TRACE_FUNCTION("int FrameEventHandler::property_event(const XPropertyEvent& e)"); - - if(e.atom == XA_WM_NAME) - ELOG("XA_WM_NAME"); - if(e.atom == XA_WM_ICON_NAME) - ELOG("XA_WM_ICON_NAME"); - if(e.atom == XA_WM_HINTS) - ELOG("XA_WM_HINTS"); - if(e.atom == XA_WM_NORMAL_HINTS) - ELOG("XA_WM_NORMAL_HINTS"); - if(e.atom == XA_WM_SIZE_HINTS) - ELOG("XA_WM_SIZE_HINTS"); - if(e.atom == XA_WM_TRANSIENT_FOR) - ELOG("XA_WM_TRANSIENT_FOR"); - if(e.atom == _XA_WM_COLORMAP_WINDOWS) - ELOG("_XA_WM_COLORMAP_WINDOWS"); - if(e.atom == _XA_WM_STATE) - ELOG("_XA_WM_STATE"); - if(e.atom == _XA_WM_PROTOCOLS) - ELOG("_XA_WM_PROTOCOLS"); - if(e.atom == _XA_NET_WM_WINDOW_TYPE) - ELOG("_XA_NET_WM_WINDOW_TYPE"); - if(e.atom == _XA_NET_WM_STRUT) - { - ELOG("_XA_NET_WM_STRUT"); - int dummy; - WindowManager::instance()->hints()->netwm_strut(curr_frame->fdata->window, - &dummy, &dummy, &dummy, &dummy); - } - if(e.atom == _XA_NET_WM_NAME) - ELOG("_XA_NET_WM_NAME"); - if(e.atom == _XA_NET_WM_ICON) - ELOG("_XA_NET_WM_ICON"); - if(e.atom == _XA_KWM_WIN_ICON) - ELOG("_XA_KWM_WIN_ICON"); - - return 1; -} - -/* Handle EnterNotify and LeaveNotify events. - * Here is used only LeaveNotify to change cursor, since it will be - * trigered only on window borders (exact what is needed). On other - * hand, entering frame's child (or plain window) is handled by - * window itself, with ability to change cursor as like. - * Note, this event could not be simulated with FL_LEAVE, since - * it will be trigered only when mouse if off from whole window - * (including childs). - * - * Also, checkings of frame resizings are must, since mouse moving is - * usually faster than window resizing, so we will get flickering in - * cursors changes if not checked. - * - * TODO: better will be cursor is grabbed ! - */ -int FrameEventHandler::enter_leave_event(const XCrossingEvent& e) -{ - TRACE_FUNCTION("int FrameEventHandler::enter_event(const XEnterWindowEvent& e)"); - if(curr_frame->state(FrameStateUnmapped)) - return 1; - - if(e.type == LeaveNotify && !curr_frame->resizing()) - curr_frame->set_cursor(CURSOR_DEFAULT); - - return 1; -} - -/* This message we can get for windows we know about and we don't know - * about (since all root messages are redirected to us). So we first check - * is window is managed by us, and apply changes to it via our functions. - * Otherwise, we configure window directly. - * - * Note: in fltk's fluid(1.1.6), setting x coords will send us pretty - * amount of junk (change x and y in the same time !!!). This is probably - * bug in fluid. - */ -int FrameEventHandler::configure_event(const XConfigureRequestEvent& e) -{ - TRACE_FUNCTION("int FrameEventHandler::configure_event(const XConfigureRequestEvent& e)"); - - if(curr_frame->state(FrameStateUnmapped)) - return 1; - - if(curr_frame->window() == e.window) - { - ELOG("ConfigureRequest from frame"); - if(!ValidateDrawable(curr_frame->window())) - return 1; - - int x_pos = curr_frame->fdata->plain.x; - int y_pos = curr_frame->fdata->plain.y; - int w_sz = curr_frame->fdata->plain.w; - int h_sz = curr_frame->fdata->plain.h; - - if(e.value_mask & CWX) - x_pos = e.x; - if(e.value_mask & CWY) - y_pos = e.y; - if(e.value_mask & CWWidth) - w_sz = e.width; - if(e.value_mask & CWHeight) - h_sz = e.height; - - if(e.value_mask & CWStackMode) - { - if(e.detail == Above) - curr_frame->raise(); - if(e.detail == Below) - curr_frame->lower(); - } - - curr_frame->set_size(x_pos, y_pos, w_sz, h_sz, true); - } - else - { - ELOG("ConfigureRequest from unhandled window"); - - if(ValidateDrawable(e.window)) - { - XWindowChanges wc; - wc.x = e.x; - wc.y = e.y; - wc.width = e.width; - wc.height = e.height; - wc.stack_mode = e.detail; - XConfigureWindow(fl_display, e.window, e.value_mask, &wc); - } - } - - return 1; -} diff --git a/edewm/Events.h b/edewm/Events.h deleted file mode 100644 index 1dfced1..0000000 --- a/edewm/Events.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * $Id: Events.h 1683 2006-07-17 14:05:47Z karijes $ - * - * Edewm, window manager - * Part of Equinox Desktop Environment (EDE). - * Copyright (c) 2000-2006 EDE Authors. - * - * This program is licenced under terms of the - * GNU General Public Licence version 2 or newer. - * See COPYING for details. - */ - -#ifndef __EVENTS_H__ -#define __EVENTS_H__ - -#include // XEvent - -/* Purpose of this class is to - * split and minimize already big Frame class - */ - -class Frame; - -class FrameEventHandler -{ - private: - Frame* curr_frame; - - int map_event(const XMapRequestEvent& e); - int unmap_event(const XUnmapEvent& e); - int reparent_event(const XReparentEvent& e); - int destroy_event(const XDestroyWindowEvent& e); - int client_message(const XClientMessageEvent& e); - int property_event(const XPropertyEvent& e); - int enter_event(const XCrossingEvent& e); - int configure_event(const XConfigureRequestEvent& e); - int enter_leave_event(const XCrossingEvent& e); - public: - FrameEventHandler(Frame* f); - ~FrameEventHandler(); - int handle_fltk(int e); - int handle_x(XEvent* e); -}; - -#endif diff --git a/edewm/Frame.cpp b/edewm/Frame.cpp deleted file mode 100644 index 14f8100..0000000 --- a/edewm/Frame.cpp +++ /dev/null @@ -1,1700 +0,0 @@ -/* - * $Id: Frame.cpp 1736 2006-08-19 00:38:53Z karijes $ - * - * Edewm, window manager - * Part of Equinox Desktop Environment (EDE). - * Copyright (c) 2000-2006 EDE Authors. - * - * This program is licenced under terms of the - * GNU General Public Licence version 2 or newer. - * See COPYING for details. - */ - -#include "Frame.h" -#include "Events.h" -#include "Hints.h" -#include "Windowmanager.h" -#include "Atoms.h" -#include "Utils.h" -#include "Titlebar.h" -#include "debug.h" -#include "Sound.h" -#include "Tracers.h" - -#include -#include // snprintf - -#ifdef SHAPE - #include -#endif // SHAPE - - -#define FRAME_NAME(frame) (frame->label ? frame->label : "NULL") - -// TODO: just for testing -#define BORDER_UPDOWN 3 -#define BORDER_LEFTRIGHT 3 - -#define BORDER_THIN_UPDOWN 1 -#define BORDER_THIN_LEFTRIGHT 1 - -#define SIZER_W 15 -#define SIZER_H 15 - -#define MIN_W 0 -#define MIN_H 0 - -#define TITLEBAR_H 20 - -#define EDGE_SNAP 10 - - -void FrameBorders::item_color(Fl_Color c, FrameBordersState s, bool is_border) -{ - switch(s) - { - case FOCUSED: - (is_border) ? (focused = c) : (sizers_focused = c); - break; - case UNFOCUSED: - (is_border) ? (unfocused = c) : (sizers_unfocused = c); - break; - case CLICKED: - (is_border) ? (clicked = c) : (sizers_clicked = c); - break; - } -} - -Fl_Color FrameBorders::item_color(FrameBordersState s, bool is_border) -{ - switch(s) - { - case FOCUSED: - if(is_border) - return focused; - else - return sizers_focused; - case UNFOCUSED: - if(is_border) - return unfocused; - else - return sizers_unfocused; - case CLICKED: - if(is_border) - return clicked; - else - return sizers_clicked; - } - - return FL_GRAY; -} - -void FrameBorders::updown(int s) -{ - updown_w = s; - updown2x_w = s * 2; -} - -void FrameBorders::leftright(int s) -{ - leftright_h = s; - leftright2x_h = s * 2; -} - -void FrameBorders::shaped(bool s) -{ - is_shaped = s; -} - -CoordinatesView::CoordinatesView() : Fl_Window(120, 20) -{ - color(FL_WHITE); - box(FL_BORDER_BOX); - data_box = new Fl_Box(0, 0, w(), h()); - data_box->label_size(11); - end(); -} - -CoordinatesView::~CoordinatesView() -{ -} - -void CoordinatesView::display_data(int x, int y, int w, int h) -{ - snprintf(data, sizeof(data)-1, "%i x %i x %i x %i", x, y, w, h); - data_box->label(data); - data_box->redraw_label(); - redraw(); -} - -Frame::Frame(Window win, XWindowAttributes* attrs) : - Fl_Window(0, 0), - fdata(new FrameData), - screen_x(0), - screen_y(0), - screen_w(0), - screen_h(0), - restore_x(0), - restore_y(0), - restore_w(0), - restore_h(0), - opaque_move_resize(false), - show_titlebar(true), - is_moving(false), - is_resizing(false), - cursor_grabbed(false), - snap_move(false), - show_coordinates(true) -{ - // register our events - events = new FrameEventHandler(this); - - if(show_coordinates) - cview = new CoordinatesView(); - - fdata->window = win; - fdata->transient_win = None; - fdata->colormap = DefaultColormap(fl_display, fl_screen); - fdata->option = 0; - fdata->type = FrameTypeNormal; - fdata->state = 0; - fdata->win_gravity = 0; - fdata->autoplace = true; - fdata->icon_pixmap = 0; - fdata->icon_mask = 0; - fdata->label = 0; - fdata->label_alocated = false; - - fdata->plain.x = fdata->plain.y = 0; - fdata->plain.w = fdata->plain.h = 0; - fdata->plain.offset_x = fdata->plain.offset_y = 0; - fdata->plain.inc_w = fdata->plain.inc_h = 0; - fdata->plain.max_w = fdata->plain.max_h = 0; - fdata->plain.min_w = fdata->plain.min_h = 0; - - overlay.x = overlay.y = overlay.w = overlay.h = 0; - - borders.border_color(fl_darker(FL_GRAY), FOCUSED); - borders.border_color(FL_WHITE, UNFOCUSED); - borders.border_color(FL_BLUE, CLICKED); - - borders.sizers_color(FL_GRAY, FOCUSED); - borders.sizers_color(FL_RED, UNFOCUSED); - borders.sizers_color(FL_RED, CLICKED); - // recalculated in setup_borders - borders.updown(0); - borders.leftright(0); - borders.shaped(false); - - // we does not use window specific borders - fdata->plain.border = 0; - - // collect data - WindowManager* wm = WindowManager::instance(); - - screen_x = wm->x(); - screen_y = wm->y(); - screen_w = wm->w(); - screen_h = wm->h(); - - XWindowAttributes init_attrs; - if(attrs) - { - init_attrs = *attrs; - set_option(FrameOptIgnoreUnmap); - } - else - XGetWindowAttributes(fl_display, fdata->window, &init_attrs); - - fdata->plain.x = init_attrs.x; - fdata->plain.y = init_attrs.y; - fdata->plain.w = init_attrs.width; - fdata->plain.h = init_attrs.height; - - load_colormap(init_attrs.colormap); - - if(init_attrs.map_state == IsViewable) - set_state(FrameStateNormal); - else if(init_attrs.map_state == IsUnmapped) - set_state(FrameStateIconized); - else if(init_attrs.map_state == IsUnviewable) - ELOG("Got IsUnviewable map_state, skiping for now..."); - - wm->hints()->icccm_size(fdata); - wm->hints()->icccm_wm_hints(fdata); - wm->hints()->netwm_window_type(fdata); - wm->hints()->netwm_window_state(fdata); - wm->hints()->mwm_load_hints(fdata); - - load_label(); - - // do this asap so we don't miss any events... - XSelectInput(fl_display, fdata->window, - VisibilityChangeMask | ColormapChangeMask | - PropertyChangeMask | FocusChangeMask /*| StructureNotifyMask*/); - - XGetTransientForHint(fl_display, fdata->window, &fdata->transient_win); - if(fdata->transient_win != None) - { - fdata->type = FrameTypeDialog; - ELOG("Got transient_win"); - } - - if(fdata->type == FrameTypeNormal || fdata->type == FrameTypeDialog) - { - set_option(FrameOptHaveTitlebar | FrameOptHaveBorder | FrameOptCloseable | FrameOptMoveable); - if(fdata->type == FrameTypeNormal) - set_option(FrameOptResizeable | FrameOptHideable); - - borders.leftright(BORDER_LEFTRIGHT); - borders.updown(BORDER_UPDOWN); - } - - init_overlay(borders.updown()); - - x(fdata->plain.x); - y(fdata->plain.y); - - w(fdata->plain.w + borders.leftright2x()); - h(fdata->plain.h + borders.updown2x()); - XSetWindowBorderWidth(fl_display, fdata->window, fdata->plain.border); - - XMoveResizeWindow(fl_display, fdata->window, fdata->plain.x, fdata->plain.y, - fdata->plain.w, fdata->plain.h); - - ELOG("XWindowAttributes: %i %i %i %i", fdata->plain.x, fdata->plain.y, fdata->plain.w, fdata->plain.h); - begin(); - Fl_Color szc = borders.sizers_color(FOCUSED); - sizer_top_left = new Fl_Box(1,1,SIZER_W,SIZER_H); - sizer_top_left->box(FL_FLAT_BOX); - sizer_top_left->color(szc); - - sizer_top_right = new Fl_Box(1,1,SIZER_W,SIZER_H); - sizer_top_right->box(FL_FLAT_BOX); - sizer_top_right->color(szc); - - sizer_bottom_left = new Fl_Box(1,1,SIZER_W,SIZER_H); - sizer_bottom_left->box(FL_FLAT_BOX); - sizer_bottom_left->color(szc); - - sizer_bottom_right = new Fl_Box(1,1,SIZER_W,SIZER_H); - sizer_bottom_right->box(FL_FLAT_BOX); - sizer_bottom_right->color(szc); - - - if(show_titlebar) - { - titlebar = new Titlebar(this, borders.leftright(), borders.updown(), - w() - borders.leftright2x(), TITLEBAR_H, "Untitled"); - - if(fdata->label) - titlebar->label(fdata->label); - - /* Offset for fdata->window in our frame. - * Used in reparenting. - */ - fdata->plain.offset_x = borders.leftright(); - fdata->plain.offset_y = borders.updown() + titlebar->h(); - } - else - { - fdata->plain.offset_x = borders.leftright(); - fdata->plain.offset_y = borders.updown(); - } - - end(); - - /* Reposition and resize main frame - * but skip it if position is already - * set by some hints or fdata->autoplace is false. - * - * NOTE: efltk set minimal position 2x2 - * so this is check. If window is initialy - * tried to be placed on 0x0 it will be - * misteriously hidden. - */ - int pos_x; - int pos_y; - if(fdata->autoplace && wm->query_best_position(&pos_x, &pos_y, w(), h())) - { - if(pos_x <= 2) - pos_x = x(); - if(pos_y <= 2) - pos_y = y(); - - ELOG("This window does use autoplace"); - } - else - { - // recorrect positions made up in setup_borders() ?@#@! including - // titlebar if present - if((x() - borders.leftright()) > screen_x) - pos_x = x() - borders.leftright(); - else - pos_x = x(); - - if(show_titlebar && (y() - titlebar->h() - borders.updown()) > screen_y) - pos_y = y() - titlebar->h() - borders.updown(); - else if((y() - borders.updown()) > screen_y) - pos_y = y() - borders.updown(); - else - pos_y = y(); - } - - if(show_titlebar) - resize(pos_x, pos_y, w(), h() + titlebar->h()); - else - resize(pos_x, pos_y, w(), h()); - - place_sizers(x(), y(), w(), h()); - - // only normal windows can be resized - if(fdata->type != FrameTypeNormal) - hide_sizers(); - - set_override(); - // color of main window background, aka borders - color(borders.border_color(FOCUSED)); - create(); - reparent_window(); - configure_notify(); - - // rest is in content_click() - XGrabButton(fl_display, AnyButton, AnyModifier, fdata->window, - False, ButtonPressMask, GrabModeSync, GrabModeAsync, None, None); - - // show our creation - XMapWindow(fl_display, fdata->window); - show(); - - if(borders.shaped()) - shape_borders(); - - //shape_edges(); - - XAddToSaveSet(fl_display, fdata->window); - - // TODO: this handling should be in WindowManager - wm->window_list.push_back(this); - - if(fdata->transient_win != None) - { - ELOG("Added to aot_list"); - // latest mapped windows will be _before_ others iff they are transient - wm->aot_list.push_front(this); - } - else - { - ELOG("Added to stack_list"); - wm->stack_list.push_front(this); - } - - if(fdata->option & FrameOptTakeFocus) - focus(); - - ELOG("Window loaded, frame: 0x%x plain: 0x%x", fl_xid(this), fdata->window); - XFlush(fl_display); -} - -Frame::~Frame() -{ - ELOG("Frame::~Frame"); - if(fdata->label_alocated) - free(fdata->label); - - XFreeGC(fl_display, overlay.inverted_gc); - - if(show_coordinates) - delete cview; - - delete events; - delete fdata; -} -#if 0 -void Frame::feed_data(XWindowAttributes* existing) -{ - WindowManager* wm = WindowManager::instance(); - - screen_x = wm->x(); - screen_y = wm->y(); - screen_w = wm->w(); - screen_h = wm->h(); - - wm->hints()->icccm_size(fdata); - - // TODO: For testing only. Better solution will be. - fdata->type = wm->hints()->netwm_window_type(fdata); - - setup_borders(); - - if(fdata->type == FrameTypeSplash - || fdata->type == FrameTypeMenu - || fdata->type == FrameTypeDesktop - || fdata->type == FrameTypeDock) - { - show_titlebar = false; - } - // ------------------------------------------------ - - wm->hints()->netwm_window_state(fdata); - wm->hints()->mwm_load_hints(fdata); - - load_wm_hints(); - load_colormap(); - load_label(); - - XWindowAttributes attrs; - if(existing) - attrs = *existing; - else - XGetWindowAttributes(fl_display, fdata->window, &attrs); - - // according to ICCCM standard, returned values must - // be used for window only, excluding decorations - fdata->plain.x = attrs.x; - fdata->plain.y = attrs.y; - // TODO: add checking if window out of screen - fdata->plain.w = attrs.width; - fdata->plain.h = attrs.height; - - ELOG("XWindowAttributes: %i %i %i %i", fdata->plain.x, fdata->plain.y, fdata->plain.w, fdata->plain.h); - - // Shorthand for: fdata->colormap = attrs->colormap; - // ...for easier tracking - if(fdata->colormap != attrs.colormap) - load_colormap(attrs.colormap); - - switch(attrs.map_state) - { - case IsUnmapped: - set_state(FrameStateIconized); - break; - case IsViewable: - set_state(FrameStateNormal); - break; - case IsUnviewable: - ELOG("Got IsUnviewable map_state, skiping for now..."); - break; - } -} -#endif -/* load WM_HINTS property, finding if window - * have icons and in what state is in - * TODO: place this as Hint::icccm_load_wm_hints() - */ -#if 0 -void Frame::load_wm_hints(void) -{ - XWMHints* wm_hints = XAllocWMHints(); - wm_hints = XGetWMHints(fl_display, fdata->window); - if(!wm_hints) - { - ELOG("XGetWMHints failed!"); - return; - } - - if((wm_hints->flags & IconPixmapHint) && wm_hints->icon_pixmap) - fdata->icon_pixmap = wm_hints->icon_pixmap; - if((wm_hints->flags & IconMaskHint) &&wm_hints->icon_mask) - fdata->icon_mask = wm_hints->icon_mask; - - switch(wm_hints->initial_state) - { - case WithdrawnState: - XRemoveFromSaveSet(fl_display, fdata->window); - break; - case IconicState: - fdata->state = FrameStateIconized; - break; - case NormalState: - default: - fdata->state = FrameStateNormal; - break; - } - - // check for focus - if((wm_hints->flags & InputHint) && !wm_hints->input) - fdata->option &= ~FrameOptTakeFocus; // window does not want focus - else - fdata->option |= FrameOptTakeFocus; // window want focus; - - XFree(wm_hints); -} -#endif -// guess title -void Frame::load_label(void) -{ - TRACE_FUNCTION("void Frame::load_label(void)"); - WindowManager* wm = WindowManager::instance(); - - // first try NETWM style - fdata->label = wm->hints()->netwm_label(fdata->window, &fdata->label_alocated); - if(!fdata->label) - { - // then ICCCM - fdata->label = wm->hints()->icccm_label(fdata->window, &fdata->label_alocated); - } - ELOG("Window: %s (%p) loaded", (fdata->label ? fdata->label : "NULL"), fdata->window); -} - -void Frame::destroy(void) -{ - TRACE_FUNCTION("void Frame::destroy(void)"); - - ELOG("window goes down"); - if(state(FrameStateDestroyed)) - return; - - if(!state(FrameStateUnmapped)) - { - if(ValidateDrawable(fdata->window)) - { - XRemoveFromSaveSet(fl_display, fdata->window); - XUnmapWindow(fl_display, fdata->window); - XUnmapWindow(fl_display, fl_xid(this)); - } - } - - set_state(FrameStateDestroyed); - WindowManager::instance()->update_client_list(); - Fl::awake(); -} - -void Frame::map(void) -{ - if(!state(FrameStateUnmapped)) - return; - - XAddToSaveSet(fl_display, fdata->window); - XMapWindow(fl_display, fdata->window); - XMapWindow(fl_display, fl_xid(this)); - - clear_state(FrameStateUnmapped); -} - -void Frame::unmap(void) -{ - if(state(FrameStateUnmapped)) - return; - - if(ValidateDrawable(fdata->window)) - { - XRemoveFromSaveSet(fl_display, fdata->window); - XUnmapWindow(fl_display, fdata->window); - XUnmapWindow(fl_display, fl_xid(this)); - } - - set_state(FrameStateUnmapped); -} - -// Install custom or default colormap. -// Default colormap is read only once, in Frame constructor. -void Frame::load_colormap(Colormap col) -{ - TRACE_FUNCTION("void Frame::load_colormap(Colormap col)"); - - if(col != 0) - { - ELOG("Installing custom colormap"); - fdata->colormap = col; - } - else - ELOG("Loading default colormap"); - - XInstallColormap(fl_display, fdata->colormap); -} - -// Recalculate framed based on plain. -// If window is outside screen, fix what needs to be fixed -void Frame::setup_borders(void) -{ - TRACE_FUNCTION("void Frame::setup_borders(void)"); - - int tx, ty; - switch(fdata->type) - { - case FrameTypeNormal: - /* border = BORDER_NORMAL; */ - borders.leftright(BORDER_LEFTRIGHT); - borders.updown(BORDER_UPDOWN); - break; - case FrameTypeDialog: - /*border = BORDER_THIN; */ - //borders.leftright(BORDER_THIN_LEFTRIGHT); - //borders.updown(BORDER_THIN_UPDOWN); - borders.leftright(BORDER_LEFTRIGHT); - borders.updown(BORDER_UPDOWN); - break; - case FrameTypeSplash: - case FrameTypeDesktop: - case FrameTypeMenu: - case FrameTypeDock: - borders.leftright(0); - borders.updown(0); - // they don't have visible borders - break; - } - - // TODO: setting up initial window sizes - // should not be in setup_borders(); - tx = fdata->plain.x - borders.leftright(); - ty = fdata->plain.y - borders.updown(); - if(tx < 0) - fdata->plain.x = borders.leftright(); - if(ty < 0) - fdata->plain.y = borders.updown(); - x(fdata->plain.x); - y(fdata->plain.y); - - w(fdata->plain.w + borders.leftright2x()); - h(fdata->plain.h + borders.updown2x()); - - // set fdata->window borders, althought fdata->plain.borders is - // always 0 - XSetWindowBorderWidth(fl_display, fdata->window, fdata->plain.border); -} -#if 0 -/* Setup window sizes to minimal usable (MIN_W, MIN_H) - * but only for normal windows. Transient should set - * their size internally. - */ -void Frame::init_sizes(void) -{ - if(fdata->type == FrameTypeDialog) - return; - - if(fdata->plain.w < MIN_W) - fdata->plain.w = MIN_W; - if(fdata->plain.h < MIN_H) - fdata->plain.h = MIN_H; -} -#endif -void Frame::init_overlay(int border_size) -{ - XGCValues v; - v.subwindow_mode = IncludeInferiors; - v.foreground = 0xffffffff; - v.function = GXxor; - v.line_width = border_size; - v.graphics_exposures = False; - int mask = GCForeground | GCSubwindowMode | GCFunction | GCLineWidth | GCGraphicsExposures; - overlay.inverted_gc = XCreateGC(fl_display, - WindowManager::instance()->root_window(), mask, &v); -} - -void Frame::reparent_window(void) -{ - TRACE_FUNCTION("void Frame::reparent_window(void)"); - - if(!ValidateDrawable(fdata->window)) - return; - - const int XEventMask = - ExposureMask | - StructureNotifyMask| - VisibilityChangeMask | - KeyPressMask| - KeyReleaseMask| - KeymapStateMask| - FocusChangeMask | - ButtonPressMask | - ButtonReleaseMask | - EnterWindowMask | - LeaveWindowMask | - PointerMotionMask | - SubstructureRedirectMask | - SubstructureNotifyMask; - - - XSetWindowAttributes sattr; - // TODO: some windows set bit_gravity too - sattr.bit_gravity = NorthWestGravity; - sattr.event_mask = XEventMask; - sattr.colormap = fl_colormap; - sattr.border_pixel = fl_xpixel(FL_BLACK); - sattr.override_redirect = 0; - sattr.background_pixel = fl_xpixel(FL_GRAY); - XChangeWindowAttributes(fl_display, fl_xid(this), - CWBitGravity | CWBorderPixel | CWColormap | CWEventMask | CWBackPixel | CWOverrideRedirect, &sattr); - - XReparentWindow(fl_display, fdata->window, fl_xid(this), fdata->plain.offset_x, fdata->plain.offset_y); -/* - if(!show_titlebar) - { - XReparentWindow(fl_display, fdata->window, fl_xid(this), - borders.leftright(), borders.updown()); - } - else - { - XReparentWindow(fl_display, fdata->window, fl_xid(this), - borders.leftright(), borders.updown() + titlebar->h()); - } -*/ - -} - -void Frame::recalc_geometry(int x_pos, int y_pos, int w_sz, int h_sz, short rtype) -{ - TRACE_FUNCTION("void Frame::recalc_geometry(int x_pos, int y_pos, int w_sz, int h_sz, short rtype"); - - if(rtype == GeometryRecalcAll) - { - x(x_pos); y(y_pos); - w(w_sz); h(h_sz); - - fdata->plain.x = x() + borders.leftright(); - fdata->plain.y = y() + borders.updown(); - fdata->plain.w = w() - borders.leftright2x(); - } - else if(rtype == GeometryRecalcAllXY) - { - // do not include fdata->plain.w - // FIXME: duplication as above - x(x_pos); y(y_pos); - w(w_sz); h(h_sz); - fdata->plain.x = x() + borders.leftright(); - fdata->plain.y = y() + borders.updown(); - } - else if(rtype == GeometryRecalcPlain) - { - fdata->plain.x = x_pos; - fdata->plain.y = y_pos; - fdata->plain.w = w_sz; - fdata->plain.h = h_sz; - - x(x_pos - borders.leftright()); - y(y_pos - borders.updown()); - w(w_sz + borders.leftright2x()); - } - else - { - // we should no be here - assert(0); - } - - - if(show_titlebar) - { - // titlebar->resize(border, border, w() - border2x, titlebar->h()); - if(rtype == GeometryRecalcAll) - { - fdata->plain.h = h() - (titlebar->h() + borders.updown2x()); - } - else if(rtype == GeometryRecalcPlain) - { - h(h_sz + titlebar->h() + borders.updown2x()); - } - - titlebar->size(w() - borders.leftright2x(), titlebar->h()); - } - else - { - if(rtype == GeometryRecalcAll) - { - fdata->plain.h = h() - borders.updown2x(); - } - else if(rtype == GeometryRecalcPlain) - { - h(h_sz + borders.updown2x()); - } - } - - /* Sanitize sizes. If we go below min width and height - * even X will start to yell. Who likes yelling ? - * - * TODO: maybe when we detect this, should disallow any - * further moves/resizes ? - */ - if(fdata->plain.w <= fdata->plain.min_w) - { - int offset = fdata->plain.min_w - fdata->plain.w; - fdata->plain.w = fdata->plain.min_w; - w(w() + offset); - } - - if(fdata->plain.h <= fdata->plain.min_h) - { - int offset = fdata->plain.min_h - fdata->plain.h; - fdata->plain.h = fdata->plain.min_h; - h(h() + offset); - } - - - ELOG("p: %i %i %i %i w: %i %i %i %i", - fdata->plain.x, fdata->plain.y, fdata->plain.w, fdata->plain.h, - x(), y(), w(), h()); -} - -/* Set size of window, accepting coordinates for fdata->window + frame, - * int which case it will be resized both. - */ -void Frame::set_size(int x_pos, int y_pos, int w_sz, int h_sz, bool apply_on_plain) -{ - TRACE_FUNCTION("void Frame::set_size(int x_pos, int y_pos, int w_sz, int h_sz, bool apply_on_plain)"); - - if(!ValidateDrawable(fdata->window)) - return; - - short how; - if(apply_on_plain) - how = GeometryRecalcPlain; - else - how = GeometryRecalcAll; - - recalc_geometry(x_pos, y_pos, w_sz, h_sz, how); - - XGrabServer(fl_display); - - place_sizers(x(), y(), w(), h()); - XMoveWindow(fl_display, fl_xid(this), x(), y()); - XResizeWindow(fl_display, fl_xid(this), w(), h()); - XResizeWindow(fl_display, fdata->window, fdata->plain.w, fdata->plain.h); - - if(borders.shaped()) - shape_borders(); - - XUngrabServer(fl_display); - - configure_notify(); - redraw(); -} - -void Frame::move_window(int x_pos, int y_pos) -{ - TRACE_FUNCTION("void Frame::move_window(int x_pos, int y_pos)"); - - //draw_overlay(x_pos, y_pos, w(), h()); - //return; - - // very dummy snapping with screen edges - // TODO: what about other window(s) edges ? - if(snap_move) - { - int snap_x = screen_x + EDGE_SNAP; - int snap_y = snap_x; - int snap_w = screen_w - EDGE_SNAP; - int snap_h = screen_h - EDGE_SNAP; - int w_pos = x_pos + w(); - int h_pos = y_pos + h(); - - if(snap_x > x_pos - EDGE_SNAP && snap_x < x_pos + EDGE_SNAP) - x_pos = screen_x; - if(snap_y > y_pos - EDGE_SNAP && snap_y < y_pos + EDGE_SNAP) - y_pos = screen_y; - - if(snap_w > w_pos - EDGE_SNAP && snap_w < w_pos + EDGE_SNAP) - x_pos = screen_w - w(); - if(snap_h > h_pos - EDGE_SNAP && snap_h < h_pos + EDGE_SNAP) - y_pos = screen_h - h(); - } - - recalc_geometry(x_pos, y_pos, w(), h(), GeometryRecalcAllXY); - XMoveWindow(fl_display, fl_xid(this), x(), y()); - configure_notify(); -} - -void Frame::draw_overlay(int x, int y, int w, int h) -{ - TRACE_FUNCTION("void Frame::draw_overlay(int x, int y, int w, int h)"); -/* - XGCValues v; - v.subwindow_mode = IncludeInferiors; - v.foreground = 0xffffffff; - v.function = GXxor; - v.line_width = borders.updown(); - v.graphics_exposures = False; - int mask = GCForeground|GCSubwindowMode|GCFunction|GCLineWidth|GCGraphicsExposures; - GC invertGc = XCreateGC(fl_display, RootWindow(fl_display, fl_screen), mask, &v); -*/ - - if (w < 0) {x += w; w = -w;} - else if (!w) w = 1; - if (h < 0) {y += h; h = -h;} - else if (!h) h = 1; - Window root = WindowManager::instance()->root_window(); - - if(overlay.w > 0) - { - if(x == overlay.x && y == overlay.y && w == overlay.w && h == overlay.h) - return; - XDrawRectangle(fl_display, root, overlay.inverted_gc, overlay.x, overlay.y, overlay.w, overlay.h); - } - - overlay.x = x; - overlay.y = y; - overlay.w = w; - overlay.h = h; - - XDrawRectangle(fl_display, root, overlay.inverted_gc, overlay.x, overlay.y, overlay.w, overlay.h); -} - -void Frame::clear_overlay(void) -{ - if(overlay.w > 0) - { - Window root = WindowManager::instance()->root_window(); - XDrawRectangle(fl_display, root, overlay.inverted_gc, overlay.x, overlay.y, overlay.w, overlay.h); - overlay.w = 0; - } -} - -void Frame::place_sizers(int x, int y, int w, int h) -{ - TRACE_FUNCTION("void Frame::place_sizers(int x, int y, int w, int h)"); - - // using position() instead resize() will be only - // valid if sizers are initialy set to SIZER_W and SIZER_H - - sizer_top_left->position(0, 0); - sizer_top_right->position(w - SIZER_W, 0); - sizer_bottom_left->position(0, h - SIZER_H); - sizer_bottom_right->position(w - SIZER_W, h - SIZER_H); -} - -/* Determine type of resizing based on position - * (NOTE: here is used relative position - Fl::event_x() and Fl::event_y(), - * which are valid only in frame window). - * - * TODO: any way this can be simplified ? - */ -long Frame::resize_type(int x, int y) -{ - // TRACE_FUNCTION("long Frame::resize_type(int x, int y)"); - - //ELOG("%i %i", x, y); - // we are in top left sizer - if((x >= sizer_top_left->x() && x <= sizer_top_left->w()) && - (y >= sizer_top_left->y() && y <= sizer_top_left->h())) - return ResizeTypeUpLeft; - - // we are in top right sizer - if((x >= sizer_top_right->x() && x <= sizer_top_right->x() + sizer_top_right->w()) && - (y >= sizer_top_right->y() && y <= sizer_top_right->y() + sizer_top_right->h())) - return ResizeTypeUpRight; - - // we are in bottom left sizer - if((x >= sizer_bottom_left->x() && x <= sizer_bottom_left->x() + sizer_bottom_left->w()) && - (y >= sizer_bottom_left->y() && y <= sizer_bottom_left->y() + sizer_bottom_left->h())) - return ResizeTypeDownLeft; - - // we are in bottom right sizer - if((x >= sizer_bottom_right->x() && x <= sizer_bottom_right->x() + sizer_bottom_right->w()) && - y >= sizer_bottom_right->y() && y <= sizer_bottom_right->y() + sizer_bottom_right->h()) - return ResizeTypeDownRight; - - // we are in top border - if((x > sizer_top_left->x() + sizer_top_left->w() && x < sizer_top_right->x()) && - (y < borders.updown())) - return ResizeTypeUp; - - // we are in left border - if((x < borders.leftright()) && (y > sizer_top_left->y() + sizer_top_left->h()) && - y < sizer_bottom_left->y()) - return ResizeTypeLeft; - - // we are in right border - if((x < sizer_top_right->x() + sizer_top_right->w()) && - (x > sizer_top_right->x() + sizer_top_right->w() - borders.leftright()) && - (y > sizer_top_right->y() + sizer_top_right->w()) && - (y < sizer_bottom_left->y())) - return ResizeTypeRight; - - // we are in bottom border - if((x > sizer_bottom_left->x() + sizer_bottom_left->w()) && - (x < sizer_bottom_right->x()) && - (y > sizer_bottom_left->y() + sizer_bottom_left->h() - borders.updown()) && - (y < sizer_bottom_left->y() + sizer_bottom_left->h())) - return ResizeTypeDown; - - - return ResizeTypeNone; -} - -/* unscramble direction, and check what combination it have - * - * TODO: direction should not have oposite sides included - * like ResizeTypeRight | ResizeTypeLeft - */ -void Frame::resize_window(int mouse_x, int mouse_y, long direction) -{ - TRACE_FUNCTION("void Frame::resize_window(int mouse_x, int mouse_y, long direction)"); - - if(direction == 0) - EFATAL("calling resize on possible unresizable window"); - - if(direction & ResizeTypeNone) - return; - -#warning "Add increment/decrement info from icccm" - - // use collected increment/decrement info from icccm - /*int inc_w = fdata->plain.inc_w; - int inc_h = fdata->plain.inc_h; */ - - int tw = 0, th = 0; - - if(direction & ResizeTypeLeft) - { - if(mouse_x > x()) - tw = w() - (mouse_x - x()); // decrease - else - tw = w() + (x() - mouse_x); // increase - - set_size(mouse_x, y(), tw, h(), false); - } - - if(direction & ResizeTypeRight) - { - tw = mouse_x - x(); - set_size(x(), y(), tw, h(), false); - } - - if(direction & ResizeTypeUp) - { - if(mouse_y > y()) - th = h() - (mouse_y - y()); //decrease - else - th = h() + (y() - mouse_y); //increase - - set_size(x(), mouse_y, w(), th, false); - } - - if(direction & ResizeTypeDown) - { - th = mouse_y - y(); - set_size(x(), y(), w(), th, false); - } - -} - -void Frame::configure_notify(void) -{ - TRACE_FUNCTION("void Frame::configure_notify(void)"); - if(!ValidateDrawable(fdata->window)) - return; - - WindowManager::instance()->hints()->icccm_configure(fdata); -} - -// apply shape on borders, based on shape mask -void Frame::shape_borders(void) -{ - TRACE_FUNCTION("void Frame::shape_borders(void)"); - -#ifdef SHAPE - Window shape = XCreateSimpleWindow(fl_display, RootWindow(fl_display, fl_screen), - x(), y(), w(), h(), 0, 0, 0); - - XRectangle rect[4]; - // top - rect[0].x = SIZER_W; - rect[0].y = 0; - rect[0].width = w() - SIZER_W * 2; - rect[0].height = borders.updown(); - - // right - rect[1].x = w() - borders.leftright(); - rect[1].y = SIZER_H; - rect[1].width = borders.leftright(); - rect[1].height = h() - SIZER_H * 2; - - // bottom - rect[2].x = SIZER_W; - rect[2].y = h() - borders.updown(); - rect[2].width = w() - SIZER_W * 2; - rect[2].height = borders.updown(); - - // left - rect[3].x = 0; - rect[3].y = SIZER_H; - rect[3].width = borders.leftright(); - rect[3].height = h() - SIZER_H * 2; - - // modify our shape window - XShapeCombineRectangles(fl_display, shape, ShapeBounding, 0, 0, rect, 4, ShapeSubtract, Unsorted); - // apply our shape window as mask - XShapeCombineShape(fl_display, fl_xid(this), ShapeBounding, 0, 0, shape, ShapeBounding, ShapeSet); - XDestroyWindow(fl_display, shape); -#endif -} - -// apply shape on edges, based on pixmap mask -#include "mask.xpm" -#include -void Frame::shape_edges(void) -{ - TRACE_FUNCTION("void Frame::shape_edges(void)"); -#if 0 - // TODO: finish with other three edges - Fl_Image img((const char**)mask_xpm); - Pixmap mask = img.create_mask(img.width(), img.height()); - - Window shape = XCreateSimpleWindow(fl_display, RootWindow(fl_display, fl_screen), - x(), y(), w(), h(), 0, 0, 0); - - XShapeCombineMask(fl_display, shape, ShapeBounding, 0, 0, mask, ShapeSubtract); - XShapeCombineShape(fl_display, fl_xid(this), ShapeBounding, 0, 0, shape, ShapeBounding, ShapeSet); - XDestroyWindow(fl_display, shape); -#endif -} - -void Frame::maximize(void) -{ - TRACE_FUNCTION("void Frame::maximize(void)"); - - if(state(FrameStateShaded)) - { - ELOG("Maximizing shaded windows is bugy as devil himself !"); - return; - } - - if(fdata->type == FrameTypeDialog) - { - ELOG("Dialogs should not be resized !"); - return; - } - - if(state(FrameStateMaximized)) - { - ELOG("Window is alread maximized"); - return; - } - - restore_x = x(); - restore_y = y(); - restore_w = w(); - restore_h = h(); - - set_size(screen_x, screen_y, screen_w, screen_h, false); - set_state(FrameStateMaximized); - - WindowManager::instance()->play_sound(SOUND_MAXIMIZE); -} - -void Frame::restore(void) -{ - TRACE_FUNCTION("void Frame::restore(void)"); - - if(!state(FrameStateMaximized)) - { - ELOG("Restore unmaximized window ???"); - return; - } - - set_size(restore_x, restore_y, restore_w, restore_h, false); - clear_state(FrameStateMaximized); - - WindowManager::instance()->play_sound(SOUND_RESTORE); -} - -/* First will inspect does window participate for WM_DELETE_WINDOW - * message, and if not, it will be killed. That is the life... - */ -void Frame::close_kill(void) -{ - TRACE_FUNCTION("void Frame::close_kill(void)"); - - Atom* protocols; - int n; - bool have_close = false; - - if(XGetWMProtocols(fl_display, fdata->window, &protocols, &n)) - { - for(int i = 0; i < n; i++) - { - if(protocols[i] == _XA_WM_DELETE_WINDOW) - have_close = true; - } - - XFree(protocols); - } - if(have_close) - SendMessage(fdata->window, _XA_WM_PROTOCOLS, _XA_WM_DELETE_WINDOW); - else - { - ELOG("Frame killed"); - XKillClient(fl_display, fdata->window); - } - - WindowManager::instance()->play_sound(SOUND_CLOSE); -} - -// window accepts input -void Frame::focus(void) -{ - TRACE_FUNCTION("void Frame::focus(void)"); - - if(state(FrameStateFocused)) - return; - - if(!ValidateDrawable(fdata->window)) - return; - - WindowManager::instance()->clear_focus_windows(); - - borders_color(FOCUSED); - if(show_titlebar) - titlebar->focus(); - - //XSetInputFocus(fl_display, fdata->window, RevertToPointerRoot, fl_event_time); - XSetInputFocus(fl_display, fdata->window, RevertToPointerRoot, CurrentTime); - XInstallColormap(fl_display, fdata->colormap); - - /* DO NOT use this ! - * SendMessage(fdata->window, _XA_WM_PROTOCOLS, _XA_WM_TAKE_FOCUS); - */ - - WindowManager::instance()->hints()->netwm_set_active_window(fdata->window); - set_state(FrameStateFocused); -} - -void Frame::unfocus(void) -{ - if(!state(FrameStateFocused)) - return; - - TRACE_FUNCTION("void Frame::unfocus(void)"); - - borders_color(UNFOCUSED); - if(show_titlebar) - titlebar->unfocus(); - - clear_state(FrameStateFocused); -} - -void Frame::raise(void) -{ - TRACE_FUNCTION("void Frame::raise(void)"); - - WindowManager* wm = WindowManager::instance(); - if(wm->stack_list.size() <= 1) - { - ELOG("Only one window, restacking skipped"); - focus(); - return; - } - - FrameList::iterator it = wm->stack_list.begin(); - FrameList::iterator last = wm->stack_list.end(); - - while(it != last) - { - if(*it == this) - { - wm->stack_list.erase(it); - wm->stack_list.push_front(*it); - } - - ++it; - } - wm->restack_windows(); - focus(); -} - -/* Send frame one stack position below. - * Note that as in raise(), aot_list is not checked - * since those windows are _always_ on top. This will - * rearange stack_list and call restack_windows(), as you guess. - * - * Yes, this can be avoided using XWindowChanges with - * x.sibling and x.stack_mode = Below, which is much faster - * but we will lose arangements in stack_list and posibility - * to update _NET_CLIENT_LIST_STACKING atom. So stick with this. - * - * PS: if you have idea how to combine XWindowChanges with X calls - * without needs to update stack_list, but to extract full stacking - * list for _NET_CLIENT_LIST_STACKING, let me know. - */ -void Frame::lower(void) -{ - TRACE_FUNCTION("void Frame::lower(void)"); - - WindowManager* wm = WindowManager::instance(); - - if(wm->stack_list.size() <= 1) - { - ELOG("Only one window, restacking skipped"); - return; - } - - FrameList::iterator top = wm->stack_list.begin(); - - /* We are not at the top. - * This will prevent rise-lower-rise effect when - * function is called multiple times. - */ - if(this != *top) - return; - - FrameList::iterator below = top; - ++below; - - if(*below) - { - std::swap(*top, *below); - } - - wm->restack_windows(); - focus(); -} - -/* When we want to shade window, child (fdata->window) must - * completely disapear (as should it be). Funny thing is - * if few pixels child is visible, some programs-windows - * will crash (like mrxvt). - */ -void Frame::shade(void) -{ - TRACE_FUNCTION("void Frame::shade(void)"); - - if(!show_titlebar) - return; - - if(state(FrameStateShaded)) - return; - - restore_x = x(); - restore_y = y(); - restore_w = w(); - restore_h = h(); - - // place it to outside frame - int px = -(fdata->plain.offset_x + fdata->plain.w); - int py = -(fdata->plain.offset_y + fdata->plain.h); - - XMoveWindow(fl_display, fdata->window, px, py); - XResizeWindow(fl_display, fl_xid(this), w(), titlebar->h() + borders.updown2x()); - - set_state(FrameStateShaded); - WindowManager::instance()->hints()->netwm_set_window_state(fdata); - - WindowManager::instance()->play_sound(SOUND_SHADE); - - // Configure not needed, since we do nothing usefull to window - //configure_notify(); -} - -void Frame::unshade(void) -{ - TRACE_FUNCTION("void Frame::unshade(void)"); - - if(!show_titlebar) - return; - - if(!state(FrameStateShaded)) - { - ELOG("Unshade not shaded window ???"); - return; - } - - XMoveResizeWindow(fl_display, fdata->window, fdata->plain.offset_x, fdata->plain.offset_y, - fdata->plain.w, fdata->plain.h); - XResizeWindow(fl_display, fl_xid(this), w(), restore_h); - - clear_state(FrameStateShaded); - WindowManager::instance()->hints()->netwm_set_window_state(fdata); - - WindowManager::instance()->play_sound(SOUND_SHADE); - - // Configure not needed, since we do nothing usefull to window - //configure_notify(); -} - -void Frame::borders_color(FrameBordersState s) -{ - TRACE_FUNCTION("void Frame::borders_color(FrameBordersState s)"); - - Fl_Color szc = borders.sizers_color(s); - sizer_top_left->color(szc); - sizer_top_right->color(szc); - sizer_bottom_left->color(szc); - sizer_bottom_right->color(szc); - - color(borders.border_color(s)); - redraw(); -} - -void Frame::show_sizers(void) -{ - TRACE_FUNCTION("void Frame::show_sizers(void)"); - - sizer_top_left->show(); - sizer_top_right->show(); - sizer_bottom_left->show(); - sizer_bottom_right->show(); -} - -void Frame::hide_sizers(void) -{ - TRACE_FUNCTION("void Frame::hide_sizers(void)"); - - sizer_top_left->hide(); - sizer_top_right->hide(); - sizer_bottom_left->hide(); - sizer_bottom_right->hide(); -} - -void Frame::set_cursor(CursorType t) -{ - WindowManager::instance()->set_cursor(this, t); -} - -#if 0 -/* This function will change window type, to some of - * netwm types. Note, this function should _not_ be used - * anywhere except from toolbar menu, where window can - * be modified (if allowed in options). - * - * TODO: If we want borderless window, netwm does not provide - * anything like _NET_WM_WINDOW_TYPE_SPLASH, but not for splashes. - * Maybe we should add something like _EDE_WM_WINDOW_TYPE_PLAIN ? - */ -void Frame::change_window_type(short type) -{ - TRACE_FUNCTION("void Frame::change_window_type(short type)"); - - if(type == fdata->type) - return; - - // set fdata->window borders, althought fdata->plain.borders is - // always 0 - XSetWindowBorderWidth(fl_display, fdata->window, fdata->plain.border); - - fdata->type = type; - - switch(fdata->type) - { - case FrameTypeNormal: - borders.leftright(BORDER_LEFTRIGHT); - borders.updown(BORDER_UPDOWN); - break; - case FrameTypeDialog: - borders.leftright(BORDER_THIN_LEFTRIGHT); - borders.updown(BORDER_THIN_UPDOWN); - break; - case FrameTypeSplash: - case FrameTypeDesktop: - case FrameTypeMenu: - case FrameTypeDock: - borders.leftright(0); - borders.updown(0); - if(show_titlebar && titlebar) - { - titlebar->hide(); - show_titlebar = false; - } - // they don't have visible borders - break; - } - - // TODO: setting up initial window sizes - // should not be in setup_borders(); - if(fdata->type == FrameTypeNormal || fdata->type == FrameTypeDialog) - { - int tx, ty; - tx = fdata->plain.x - borders.leftright(); - ty = fdata->plain.y - borders.updown(); - /* - if(tx < 0) - fdata->plain.x = borders.leftright(); - if(ty < 0) - fdata->plain.y = borders.updown(); - */ - x(fdata->plain.x); - y(fdata->plain.y); - - w(fdata->plain.w + borders.leftright2x()); - h(fdata->plain.h + borders.updown2x()); - } - // means only borders - else - { - /* First resize window to size of child (x,y will be preserved) - * then resize child. - * XXX: child window's x,y are offsets from x,y of parent, so - * they are 0. - * We can't use Fl_Window::size(), since explicit window sizing - * does not work. In that case, slap it with hammer ! - */ - XResizeWindow(fl_display, fl_xid(this), fdata->plain.w, fdata->plain.h); - XMoveResizeWindow(fl_display, fdata->window, 0, 0, fdata->plain.w, fdata->plain.h); - } - - WindowManager::instance()->hints()->netwm_set_window_type(fdata); -} -#endif -/* After XGrabButton, WindowManager will FL_PUSH events - * redirect here. We must make sure after processing them - * redirect events further to fdata->window. - * - * We should not worry about transients (or any window - * it aot_list) since they will be always on top. - * - * TODO: Should we allow events on below windows event - * if transients are shown ??? - */ -void Frame::content_click(void) -{ - TRACE_FUNCTION("void Frame::content_click(void)"); - - ELOG("Clicked on frame: %s", FRAME_NAME(fdata)); - - if(fl_xevent.xbutton.button == 1) - raise(); - - XAllowEvents(fl_display, ReplayPointer, CurrentTime); -} - -void Frame::show_coordinates_window(void) -{ - if(!show_coordinates) - return; - - TRACE_FUNCTION("void Frame::show_coordinates_window(void)"); - - // calculate center of frame, and show it there - int cx = (x() + w()/2) - (cview->w()/2); - int cy = (y() + h()/2) - (cview->h()/2); - - /* Check if we are inside screen coordinates or showing window - * beyond them will not show window at all! - */ - if(cx < screen_x) - cx = screen_x; - if(cy < screen_y) - cy = screen_y; - if((cx + cview->w()) > screen_w) - cx = screen_w - cview->w(); - if((cy + cview->h()) > screen_h) - cy = screen_h - cview->h(); - - cview->position(cx, cy); - //if(!cview->shown()) - cview->show(); -} - -void Frame::update_coordinates_window(void) -{ - if(!show_coordinates) - return; - - TRACE_FUNCTION("void Frame::update_coordinates_window(void)"); - int cx = (x() + w()/2) - (cview->w()/2); - int cy = (y() + h()/2) - (cview->h()/2); - - if(cx < screen_x) - cx = screen_x; - if(cy < screen_y) - cy = screen_y; - if((cx + cview->w()) > screen_w) - cx = screen_w - cview->w(); - if((cy + cview->h()) > screen_h) - cy = screen_h - cview->h(); - - cview->position(cx, cy); - cview->display_data(x(), y(), w(), h()); -} - -void Frame::hide_coordinates_window(void) -{ - if(!show_coordinates) - return; - - TRACE_FUNCTION("void Frame::hide_coordinates_window(void)"); - cview->hide(); -} - -// handle events that efltk understainds -int Frame::handle(int event) -{ - return events->handle_fltk(event); -} - -int Frame::handle(XEvent* event) -{ - return events->handle_x(event); -} - -// this is here so FrameEventHandler can access Fl_Window -int Frame::handle_parent(int event) -{ - return Fl_Window::handle(event); -} - -/* Grab pointer, scheduling pointer events for future use. - * The only thing I can say is this is the only way of correct - * usage, althought I would like to see pointer in GrabModeAsync. - * Later is hardly possible (think so) because efltk will not be - * able to synchronize itself with X events. - */ -void Frame::grab_cursor(void) -{ - TRACE_FUNCTION("void Frame::grab_cursor(void)"); - - if(cursor_grabbed) - return; - - // use currently set cursor - Cursor cc = WindowManager::instance()->cursor_handler()->current_cursor(); - - if(XGrabPointer(fl_display, fl_xid(this), - true, /* owner events */ - ButtonMotionMask | ButtonPressMask |ButtonReleaseMask | PointerMotionMask, - GrabModeAsync, /* pointer mode */ - GrabModeAsync, /* keyboard mode */ - None, - cc, fl_event_time) == GrabSuccess) - { - //XAllowEvents(fl_display, AsyncPointer, CurrentTime); - cursor_grabbed = true; - ELOG("Cursor grabbed"); - } -} - -void Frame::ungrab_cursor(void) -{ - TRACE_FUNCTION("void Frame::ungrab_cursor(void)"); - - if(!cursor_grabbed) - return; - - ELOG("Cursor ungrabbed"); - Fl::event_is_click(0); // avoid double click - //XAllowEvents(fl_display, Fl::event() == FL_PUSH ? ReplayPointer : AsyncPointer, CurrentTime); - XUngrabPointer(fl_display, fl_event_time); - XFlush(fl_display); // make sure we are out of danger before continuing... - // because we "pushed back" the FL_PUSH, make it think no buttons are down: - Fl::e_state &= 0xffffff; - Fl::e_keysym = 0; - - cursor_grabbed = false; -} - -void Frame::display_internals(void) -{ - EPRINTF("-----------------------------------\n"); - EPRINTF("window : %lx\n", fdata->window); - EPRINTF("transient : %lx\n", fdata->transient_win); - EPRINTF("colormap : %lx\n", fdata->colormap); - EPRINTF("state : %li\n", fdata->state); - EPRINTF("options : %li\n", fdata->option); - EPRINTF("type : %i\n", fdata->type); - EPRINTF("min width : %i\n", fdata->plain.min_w); - EPRINTF("min height : %i\n", fdata->plain.min_h); - EPRINTF("max width : %i\n", fdata->plain.max_w); - EPRINTF("max height : %i\n", fdata->plain.max_h); - EPRINTF("x : %i\n", fdata->plain.x); - EPRINTF("y : %i\n", fdata->plain.y); - EPRINTF("w : %i\n", fdata->plain.w); - EPRINTF("h : %i\n", fdata->plain.h); - EPRINTF("x (framed) : %i\n", x()); - EPRINTF("y (framed) : %i\n", y()); - EPRINTF("w (framed) : %i\n", w()); - EPRINTF("h (framed) : %i\n", h()); - EPRINTF("gravity : %i\n", fdata->win_gravity); - EPRINTF("autoplace : %i\n", fdata->autoplace); - EPRINTF("have icon : %s\n", (fdata->icon_pixmap ? "yes" : "no")); - EPRINTF("have icon mask : %s\n", (fdata->icon_mask ? "yes" : "no")); - EPRINTF("label : %s\n", (fdata->label ? fdata->label : "NULL")); - EPRINTF("-----------------------------------\n"); -} diff --git a/edewm/Frame.h b/edewm/Frame.h deleted file mode 100644 index affef12..0000000 --- a/edewm/Frame.h +++ /dev/null @@ -1,344 +0,0 @@ -/* - * $Id: Frame.h 1736 2006-08-19 00:38:53Z karijes $ - * - * Edewm, window manager - * Part of Equinox Desktop Environment (EDE). - * Copyright (c) 2000-2006 EDE Authors. - * - * This program is licenced under terms of the - * GNU General Public Licence version 2 or newer. - * See COPYING for details. - */ - -#ifndef _FRAME_H_ -#define _FRAME_H_ - -#include -#include -#include - -#include "Cursor.h" - -// frame states (internal) -#define FrameStateNormal (1 << 0) // neither of below states -#define FrameStateUnmapped (1 << 1) // or Withdrawn -#define FrameStateDestroyed (1 << 2) // destroyed window, handled by WindowManager -#define FrameStateFocused (1 << 3) - -// frame states (netwm) -#define FrameStateModal (1 << 4) // transients -#define FrameStateSticky (1 << 5) -#define FrameStateShaded (1 << 6) -#define FrameStateHidden (1 << 7) // or iconized -#define FrameStateIconized FrameStateHidden - -/* These two types are used to emit _NET_WM_STATE_ABOVE and _NET_WM_STATE_BELOW. - * For me it is unclear why they didn't called _NET_WM_STATE_ALWAYS_(ABOVE,BELOW) - * since all wm's set them in this state (except transient who are always above all - * windows), and stacking order can't be changed. Anyway, enjoy with more apropriate - * names. - */ -#define FrameStateAlwaysAbove (1 << 8) -#define FrameStateAlwaysBelow (1 << 9) - -#define FrameStateMaximizedHorz (1 << 10) -#define FrameStateMaximizedVert (1 << 11) -#define FrameStateMaximized (FrameStateMaximizedHorz | FrameStateMaximizedVert) - -// some options frame can have (or their combinations) -/* -#define FrameOptSkipList (1 << 0) // some reason why not in list -#define FrameOptBorder (1 << 1) -#define FrameOptThinBorder (1 << 2) -#define FrameOptTitlebar (1 << 3) -#define FrameOptSysmenu (1 << 4) // what a hell !?!? -#define FrameOptMinimize (1 << 5) -#define FrameOptMaxmize (1 << 6) -#define FrameOptClose (1 << 7) -#define FrameOptResize (1 << 8) -#define FrameOptMove (1 << 9) -#define FrameOptTakeFocus (1 << 10) -#define FrameOptKeepAspect (1 << 11) -*/ - -#define FrameOptSkipList (1 << 0) -#define FrameOptHaveBorder (1 << 1) -#define FrameOptHaveTitlebar (1 << 2) -#define FrameOptResizeable (1 << 3) -#define FrameOptMoveable (1 << 4) -#define FrameOptCloseable (1 << 5) -#define FrameOptHideable (1 << 6) -#define FrameOptTakeFocus (1 << 7) -#define FrameOptKeepAspect (1 << 8) - -/* some events echo UnmapNotify, like ReparentNotify, and if we - * start wm on existing X session with open windows, this flag will - * prevent they be unmapped - */ -#define FrameOptIgnoreUnmap (1 << 12) - -// frame type -#define FrameTypeNormal 0 -#define FrameTypeDialog 1 -#define FrameTypeSplash 2 -#define FrameTypeDock 3 -#define FrameTypeToolbar 4 -#define FrameTypeMenu 5 -#define FrameTypeUtil 6 -#define FrameTypeDesktop 7 - -// type of resizing; means from which -// side of window is resize doing -#define ResizeTypeNone (1 << 0) -#define ResizeTypeLeft (1 << 1) -#define ResizeTypeRight (1 << 2) -#define ResizeTypeUp (1 << 3) -#define ResizeTypeDown (1 << 4) -#define ResizeTypeUpLeft (ResizeTypeUp | ResizeTypeLeft) -#define ResizeTypeDownLeft (ResizeTypeDown | ResizeTypeLeft) -#define ResizeTypeUpRight (ResizeTypeUp | ResizeTypeRight) -#define ResizeTypeDownRight (ResizeTypeDown | ResizeTypeRight) -#define ResizeTypeAll (ResizeTypeUp | ResizeTypeDown | ResizeTypeLeft | ResizeTypeRight) - -// type of recalc_geometry() -#define GeometryRecalcAll 0 -#define GeometryRecalcAllXY 1 // recalc all, except for plain w and h -#define GeometryRecalcPlain 2 - -// now lets go to code... - -// window sizes without borders, titlebar etc. -struct WindowGeometry -{ - int x, y, w, h; - int offset_x, offset_y; - int min_w, min_h; - int max_w, max_h; - int inc_w, inc_h; - int border; -}; - -struct FrameData -{ - Window window; - Window transient_win; - Colormap colormap; - - WindowGeometry plain; - - Pixmap icon_pixmap; - Pixmap icon_mask; - char* label; - bool label_alocated; - long state; - long option; - short type; - - int win_gravity; - bool autoplace; - bool have_transient; - -// Icon* icon; -}; - -struct Overlay -{ - int x, y, w, h; - GC inverted_gc; -}; - -enum FrameBordersState -{ - FOCUSED = 1, - UNFOCUSED, - CLICKED -}; - -class FrameBorders -{ - private: - Fl_Color focused; - Fl_Color unfocused; - Fl_Color clicked; - Fl_Color sizers_focused; - Fl_Color sizers_unfocused; - Fl_Color sizers_clicked; - int updown_w; - int updown2x_w; - int leftright_h; - int leftright2x_h; - bool is_shaped; - bool is_border; - void item_color(Fl_Color c, FrameBordersState s, bool is_border); - Fl_Color item_color(FrameBordersState s, bool is_border); - - public: - void border_color(Fl_Color c, FrameBordersState s) { item_color(c, s, true); } - void sizers_color(Fl_Color c, FrameBordersState s) { item_color(c, s, false); } - void updown(int s); - void leftright(int s); - void shaped(bool s); - - Fl_Color border_color(FrameBordersState s) { return item_color(s, true); } - Fl_Color sizers_color(FrameBordersState s) { return item_color(s, false); } - int updown(void) { return updown_w; } - int updown2x(void) { return updown2x_w; } - int leftright(void) { return leftright_h; } - int leftright2x(void) { return leftright2x_h; } - bool shaped(void) { return is_shaped; } -}; - -/* Window responsible for displaying parent - * coordinates. It will _not_ be framed. - */ -class CoordinatesView : public Fl_Window -{ - private: - char data[100]; - Fl_Box* data_box; - public: - CoordinatesView(); - ~CoordinatesView(); - void display_data(int x, int y, int w, int h); -}; - - -class Titlebar; -class FrameEventHandler; - -// Head honcho of everything -class Frame : public Fl_Window -{ - private: - friend class FrameEventHandler; - - FrameData* fdata; - int screen_x, screen_y, screen_w, screen_h; - // sizes used when we do restore() - int restore_x, restore_y, restore_w, restore_h; - - bool opaque_move_resize; - bool show_titlebar; - bool is_moving; - bool is_resizing; - bool cursor_grabbed; - bool snap_move; - bool show_coordinates; - - FrameBorders borders; - FrameEventHandler* events; - - Titlebar* titlebar; - - Fl_Box* sizer_top_left; - Fl_Box* sizer_top_right; - Fl_Box* sizer_bottom_left; - Fl_Box* sizer_bottom_right; - - CoordinatesView* cview; - - Overlay overlay; - - // private loaders - void feed_data(XWindowAttributes* attrs); - //void load_wm_hints(void); - /* void load_size_hints(void); */ - void load_label(void); - - // preparers - void setup_borders(void); - // void init_sizes(void); - void init_overlay(int border_size); - void reparent_window(void); - void place_sizers(int x, int y, int w, int h); - long resize_type(int x, int y); - - void recalc_geometry(int x, int y, int w, int h, short rtype); - void configure_notify(void); - void shape_borders(void); - void shape_edges(void); - - void show_sizers(void); - void hide_sizers(void); - - void draw_overlay(int x, int y, int w, int h); - void clear_overlay(void); - - // this is here so FrameEventHandler can access Fl_Window - int handle_parent(int event); - - Frame(const Frame&); - Frame operator=(const Frame&); - - public: - Frame(Window, XWindowAttributes* = 0); - ~Frame(); - - Window window(void) { return fdata->window; } - Window transient_window(void) { return fdata->transient_win; } - - void settings_changed(void) { } - int handle(int e); - int handle(XEvent* e); - void destroy(void); - void display_internals(void); - void content_click(void); - - bool frame_type(short t) { return ((fdata->type == t) ? true : false); } - - void set_state(long s) { fdata->state |= s; } - bool state(long s) { return ((fdata->state & s) == s) ? true : false; } - void clear_state(long s) { fdata->state &= ~s; } - void clear_all_states(void) { fdata->state = 0; } - - void set_option(long o) { fdata->option |= o; } - bool option(long o) { return ((fdata->option & o) == o) ? true : false; } - void clear_option(long o) { fdata->option &= ~o; } - void clear_all_options(void) { fdata->option = 0; } - - // public loaders - void load_colormap(Colormap col = 0); - - // window manipulators - void set_size(int x, int y, int w, int h, bool apply_on_plain); - void move_window(int x, int y); - void resize_window(int mouse_x, int mouse_y, long direction); - void maximize(void); - void restore(void); - void shade(void); - void unshade(void); - void close_kill(void); - void focus(void); - void unfocus(void); - void raise(void); - void lower(void); - void borders_color(FrameBordersState s); - void set_cursor(CursorType t); - // void change_window_type(short t); - void map(void); - void unmap(void); - - void show_coordinates_window(void); - void update_coordinates_window(void); - void hide_coordinates_window(void); - - //const FrameBorders& frame_borders(void) { return borders; } - - /* These function are used to determine how Frame - * will dispatch events between titlebar and sizers - */ - void move_start(void) { is_moving = true; } - void move_end(void) { is_moving = false; } - bool moving(void) { return is_moving; } - void resize_start(void) { is_resizing = true; } - void resize_end(void) { is_resizing = false; } - bool resizing(void) { return is_resizing; } - - // TODO: should this be in WindowManager or here ??? - void grab_cursor(void); - void ungrab_cursor(void); - - bool destroy_scheduled(void) { return state(FrameStateDestroyed); } -}; - -#endif diff --git a/edewm/Hints.cpp b/edewm/Hints.cpp deleted file mode 100644 index 179cf55..0000000 --- a/edewm/Hints.cpp +++ /dev/null @@ -1,512 +0,0 @@ -/* - * $Id: Hints.cpp 1736 2006-08-19 00:38:53Z karijes $ - * - * Edewm, window manager - * Part of Equinox Desktop Environment (EDE). - * Copyright (c) 2000-2006 EDE Authors. - * - * This program is licenced under terms of the - * GNU General Public Licence version 2 or newer. - * See COPYING for details. - */ - -#include "Hints.h" -#include "Tracers.h" -#include "Frame.h" -#include "Atoms.h" -#include "Windowmanager.h" - -#include -#include // CARD32 -#include - -#define MwmHintsDecorations (1 << 1) - -#define MwmDecorAll (1 << 0) -#define MwmDecorBorder (1 << 1) -#define MwmDecorHandle (1 << 2) -#define MwmDecorTitle (1 << 3) -#define MwmDecorMenu (1 << 4) -#define MwmDecorMinimize (1 << 5) -#define MwmDecorMaximize (1 << 6) - -#define PropMotifHintsElements 3 - -struct MwmHints -{ - unsigned long flags; - unsigned long functions; - unsigned long decorations; -}; - -void Hints::icccm_size(FrameData* f) -{ - TRACE_FUNCTION("void Hints::icccm_size(FrameData* f)"); - - assert(f != 0); - long supplied; - XSizeHints* sh = XAllocSizeHints(); - - if(!XGetWMNormalHints(fl_display, f->window, sh, &supplied)) - sh->flags = 0; - - if(sh->flags & PResizeInc) - { - if(sh->width_inc < 1) - sh->width_inc = 1; - if(sh->height_inc < 1) - sh->height_inc = 1; - } - - /* Check if PBaseSize flag is set. If not - * fill it with minimal values and use them below. - */ - if(!(sh->flags & PBaseSize)) - sh->base_width = sh->base_height = 0; - - if(!(sh->flags & PMinSize)) - { - sh->min_width = sh->base_width; - sh->min_height= sh->base_height; - } - - if(!(sh->flags & PMaxSize)) - { - sh->max_width = 32767; - sh->max_height = 32767; - } - - if(sh->max_width < sh->min_width || sh->max_width <= 0) - sh->max_width = 32767; - if(sh->max_height < sh->min_height || sh->max_height <= 0) - sh->max_height = 32767; - - if(!(sh->flags & PWinGravity)) - { - sh->win_gravity = NorthWestGravity; - sh->flags |= PWinGravity; - } - - f->plain.max_w = sh->max_width; - f->plain.max_h = sh->max_height; - //f->plain.w = sh->base_width; - //f->plain.h = sh->base_height; - f->plain.min_w = sh->min_width; - f->plain.min_h = sh->min_height; - f->win_gravity = sh->win_gravity; - - // TODO: maybe calculate aspect_min and aspect_max ? - if(sh->flags & PAspect) - f->option |= FrameOptKeepAspect; - - f->autoplace = (!(sh->flags & (USPosition|PPosition))); - - XFree(sh); -} - -void Hints::icccm_wm_hints(FrameData* f) -{ - TRACE_FUNCTION("void Hints::icccm_wm_hints(FrameData* f)"); - assert(f != NULL); - - XWMHints* wm_hints = XAllocWMHints(); - wm_hints = XGetWMHints(fl_display, f->window); - if(!wm_hints) - { - ELOG("XGetWMHints failed!"); - return; - } - - if((wm_hints->flags & IconPixmapHint) && wm_hints->icon_pixmap) - f->icon_pixmap = wm_hints->icon_pixmap; - if((wm_hints->flags & IconMaskHint) &&wm_hints->icon_mask) - f->icon_mask = wm_hints->icon_mask; - - switch(wm_hints->initial_state) - { - case WithdrawnState: - XRemoveFromSaveSet(fl_display, f->window); - break; - case IconicState: - f->state = FrameStateIconized; - break; - case NormalState: - default: - f->state = FrameStateNormal; - break; - } - - // check for focus - if((wm_hints->flags & InputHint) && !wm_hints->input) - f->option &= ~FrameOptTakeFocus; // window does not want focus - else - f->option |= FrameOptTakeFocus; // window want focus; - - XFree(wm_hints); -} - -char* Hints::icccm_label(Window win, bool* allocated) -{ - TRACE_FUNCTION("char* Hints::icccm_label(Window win, bool* allocated)"); - - XTextProperty xtp; - char* title = 0; - if(XGetWMName(fl_display, win, &xtp)) - { - if(xtp.encoding == XA_STRING) - { - title = strdup((const char*)xtp.value); - *allocated = true; - } - else - { - ELOG("X11 UTF8 text property not supported, at least for now..."); - *allocated = false; - } - - XFree(xtp.value); - } - - return title; -} - -void Hints::icccm_set_iconsizes(WindowManager* wm) -{ - TRACE_FUNCTION("void Hints::icccm_set_iconsizes(WindowManager* wm)"); - assert(wm != 0); - - XIconSize* is = XAllocIconSize(); - if(!is) - { - ELOG("XAllocIconSize failed!"); - return; - } - - is->min_width = is->min_height = 8; - is->max_width = is->max_height = 48; - is->width_inc = is->height_inc = 1; - ELOG("setting icon sizes"); - XSetIconSizes(fl_display, WindowManager::instance()->root_window(), is, 1); - XFree(is); -} - -void Hints::icccm_configure(FrameData* f) const -{ - TRACE_FUNCTION("void Hints::icccm_configure(FrameData* f) const"); - - assert(f != 0); - - XConfigureEvent ce; - ce.send_event = True; - ce.display = fl_display; - ce.type = ConfigureNotify; - ce.event = f->window; - ce.window = f->window; - ce.x = f->plain.x; - ce.y = f->plain.y; - ce.width = f->plain.w; - ce.height = f->plain.h; - ce.border_width = f->plain.border; - ce.above = None; - ce.override_redirect = False; - XSendEvent(fl_display, f->window, False, StructureNotifyMask, (XEvent*)&ce); -} - -char* Hints::netwm_label(Window win, bool* allocated) -{ - TRACE_FUNCTION("char* Hints::netwm_label(Window win, bool* allocated)"); - - unsigned char* title = 0; - Atom real_type; - int real_format; - unsigned long items_read, items_left; - - int status = XGetWindowProperty(fl_display, win, _XA_NET_WM_NAME, - 0L, 0x7fffffff, False, _XA_UTF8_STRING, &real_type, &real_format, &items_read, &items_left, - (unsigned char**)&title); - - if(status != Success && items_read != 1) - { - *allocated = false; - if(title) - XFree(title); - - return 0; - } - - *allocated = true; - return (char*)title; -} - -void Hints::netwm_window_type(FrameData* fd) -{ - TRACE_FUNCTION("short Hints::netwm_window_type(FrameData* fd) const"); - - Atom *data; - Atom real_type; - int real_format; - unsigned long items_read, items_left; - short type = FrameTypeNormal; - - int status = XGetWindowProperty(fl_display, fd->window, _XA_NET_WM_WINDOW_TYPE, - 0L, 8L, false, XA_ATOM, &real_type, &real_format, &items_read, &items_left, - (unsigned char**)&data); - - if(status != Success || !items_read) - { - ELOG("Netwm say: unknown window type, using FrameTypeNormal"); - type = FrameTypeNormal; - } - - for(unsigned int i = 0; i < items_read; i++) - { - - if(data[i] == _XA_NET_WM_WINDOW_TYPE_DOCK) - { - ELOG("_XA_NET_WM_WINDOW_TYPE_DOCK"); - type = FrameTypeDock; - break; - } - - if(data[i] == _XA_NET_WM_WINDOW_TYPE_TOOLBAR) - { - ELOG("_XA_NET_WM_WINDOW_TYPE_TOOLBAR"); - type = FrameTypeToolbar; - break; - } - - if(data[i] == _XA_NET_WM_WINDOW_TYPE_MENU) - { - ELOG("_XA_NET_WM_WINDOW_TYPE_MENU"); - type = FrameTypeMenu; - break; - } - - if(data[i] == _XA_NET_WM_WINDOW_TYPE_UTIL) - { - ELOG("_XA_NET_WM_WINDOW_TYPE_UTIL"); - type = FrameTypeUtil; - break; - } - - if(data[i] == _XA_NET_WM_WINDOW_TYPE_DIALOG) - { - ELOG("_XA_NET_WM_WINDOW_TYPE_DIALOG"); - type = FrameTypeDialog; - break; - } - - if(data[i] == _XA_NET_WM_WINDOW_TYPE_SPLASH) - { - ELOG("_XA_NET_WM_WINDOW_TYPE_SPLASH"); - type = FrameTypeSplash; - break; - } - - if(data[i] == _XA_NET_WM_WINDOW_TYPE_DESKTOP) - { - ELOG("_XA_NET_WM_WINDOW_TYPE_DESKTOP"); - type = FrameTypeDesktop; - break; - } - - if(data[i] == _XA_NET_WM_WINDOW_TYPE_NORMAL) - { - ELOG("_XA_NET_WM_WINDOW_TYPE_NORMAL"); - type = FrameTypeNormal; - break; - } - } - - XFree(data); - fd->type = type; -} - -void Hints::netwm_set_window_type(FrameData* fd) -{ - TRACE_FUNCTION("void Hints::netwm_set_window_type(FrameData* fd)"); - assert(fd != 0); - - Atom to_set[1]; - switch(fd->type) - { - case FrameTypeNormal: - to_set[0] = _XA_NET_WM_WINDOW_TYPE_NORMAL; - break; - case FrameTypeDesktop: - to_set[0] = _XA_NET_WM_WINDOW_TYPE_DESKTOP; - break; - case FrameTypeSplash: - to_set[0] = _XA_NET_WM_WINDOW_TYPE_SPLASH; - break; - case FrameTypeUtil: - to_set[0] = _XA_NET_WM_WINDOW_TYPE_UTIL; - break; - case FrameTypeMenu: - to_set[0] = _XA_NET_WM_WINDOW_TYPE_MENU; - break; - case FrameTypeToolbar: - to_set[0] = _XA_NET_WM_WINDOW_TYPE_TOOLBAR; - break; - case FrameTypeDialog: - to_set[0] = _XA_NET_WM_WINDOW_TYPE_DIALOG; - break; - case FrameTypeDock: - to_set[0] = _XA_NET_WM_WINDOW_TYPE_DOCK; - break; - default: - EFATAL("Type unknown"); - to_set[0] = _XA_NET_WM_WINDOW_TYPE_NORMAL; - break; - } - - XChangeProperty(fl_display, fd->window, _XA_NET_WM_WINDOW_TYPE, XA_ATOM, 32, - PropModeReplace, (unsigned char*)to_set, 1); -} - -long Hints::netwm_window_state(FrameData* fd) const -{ - TRACE_FUNCTION("long Hints::netwm_window_state(FrameData* fd) const"); - assert(fd != 0); - - Atom *data; - Atom real_type; - int real_format; - unsigned long items_read, items_left; - - int status = XGetWindowProperty(fl_display, fd->window, _XA_NET_WM_STATE, - 0L, 12L, false, XA_ATOM, &real_type, &real_format, &items_read, &items_left, - (unsigned char**)&data); - - if(status != Success || !items_read) - return FrameTypeNormal; - - for(unsigned int i = 0; i < items_read; i++) - { - if(data[i] == _XA_NET_WM_STATE_MODAL) - ELOG("_XA_NET_WM_STATE_MODAL"); - else if(data[i] == _XA_NET_WM_STATE_STICKY) - ELOG("_XA_NET_WM_STATE_STICKY"); - else if(data[i] == _XA_NET_WM_STATE_MAXIMIZED_VERT) - ELOG("_XA_NET_WM_STATE_MAXIMIZED_VERT"); - else if(data[i] == _XA_NET_WM_STATE_MAXIMIZED_HORZ) - ELOG("_XA_NET_WM_STATE_MAXIMIZED_HORZ"); - else if(data[i] == _XA_NET_WM_STATE_SHADED) - ELOG("_XA_NET_WM_STATE_SHADED"); - else if(data[i] == _XA_NET_WM_STATE_SKIP_TASKBAR) - ELOG("_XA_NET_WM_STATE_SKIP_TASKBAR"); - else if(data[i] == _XA_NET_WM_STATE_SKIP_PAGER) - ELOG("_XA_NET_WM_STATE_SKIP_PAGER"); - else if(data[i] == _XA_NET_WM_STATE_HIDDEN) - ELOG("_XA_NET_WM_STATE_HIDDEN"); - else if(data[i] == _XA_NET_WM_STATE_FULLSCREEN) - ELOG("_XA_NET_WM_STATE_FULLSCREEN"); - else if(data[i] == _XA_NET_WM_STATE_ABOVE) - ELOG("_XA_NET_WM_STATE_ABOVE"); - else if(data[i] == _XA_NET_WM_STATE_BELOW) - ELOG("_XA_NET_WM_STATE_BELOW"); - else if(data[i] == _XA_NET_WM_STATE_DEMANDS_ATTENTION) - ELOG("_XA_NET_WM_STATE_DEMANDS_ATTENTION"); - } - - XFree(data); - return FrameStateNormal; -} - -void Hints::netwm_set_window_state(FrameData* fd) -{ - TRACE_FUNCTION("void Hints::set_window_state(FrameData* fd)"); - - assert(fd != 0); - Atom data[10]; - int i = 0; - - if(fd->state & FrameStateSticky) - data[i++] = _XA_NET_WM_STATE_STICKY; - if(fd->state & FrameStateShaded) - data[i++] = _XA_NET_WM_STATE_SHADED; - if(fd->state & FrameStateAlwaysAbove) - data[i++] = _XA_NET_WM_STATE_ABOVE; - if(fd->state & FrameStateAlwaysBelow) - data[i++] = _XA_NET_WM_STATE_BELOW; - if((fd->state & FrameStateMaximizedHorz) || (fd->state & FrameStateMaximized)) - data[i++] = _XA_NET_WM_STATE_MAXIMIZED_HORZ; - if((fd->state & FrameStateMaximizedVert) || (fd->state & FrameStateMaximized)) - data[i++] = _XA_NET_WM_STATE_MAXIMIZED_VERT; - - XChangeProperty(fl_display, fd->window, _XA_NET_WM_STATE, XA_ATOM, 32, - PropModeReplace, (unsigned char*)data, i); -} - -void Hints::netwm_set_active_window(Window win) -{ - TRACE_FUNCTION("void Hints::netwm_set_active_window(Window win)"); - - XChangeProperty(fl_display, WindowManager::instance()->root_window(), _XA_NET_ACTIVE_WINDOW, XA_WINDOW, 32, - PropModeReplace, (unsigned char *)&win, 1); -} - -void Hints::netwm_strut(Window win, int* x, int* y, int* w, int* h) const -{ - TRACE_FUNCTION("void Hints::netwm_strut(Window win, int* x, int* y, int* w, int* h) const"); - - CARD32 *data; - Atom real_type; - int real_format; - unsigned long items_read, items_left; - - int status = XGetWindowProperty(fl_display, win, _XA_NET_WM_STRUT, - 0L, 0x7fffffff, False, XA_CARDINAL, &real_type, &real_format, &items_read, &items_left, - (unsigned char**)&data); - - ELOG("STRUT: items_read %i", items_read); - if(status != Success) - return; - - if((items_read / sizeof(CARD32)) != 4) - { - ELOG("STRUT: window have wrong strut %i", items_read/sizeof(CARD32)); - return; - } - - ELOG("STRUT: %i %i %i %i", data[0], data[1], data[2], data[3]); - XFree((char*)data); -} - -void Hints::mwm_load_hints(FrameData* fd) -{ - TRACE_FUNCTION("void Hints::mwm_load_hints(FrameData* fd)"); - assert(fd != 0); - - Atom real_type; - int real_format; - unsigned long items_read, items_left; - MwmHints* mwm; - - int status = XGetWindowProperty(fl_display, fd->window, _XA_MOTIF_HINTS, - 0L, 20L, false, _XA_MOTIF_HINTS, &real_type, &real_format, &items_read, &items_left, - (unsigned char**)&mwm); - - if(status == Success && items_read /*>= PropMotifHintsElements*/) - { - ELOG("MWM: got hints !!!"); - if((mwm->flags & MwmHintsDecorations)) - { - if(mwm->decorations & MwmDecorAll) - ELOG("MwmDecorAll"); - else - { - if(mwm->decorations & MwmDecorTitle) - ELOG("MwmHintsDecorTitle"); - if(mwm->decorations & MwmDecorBorder) - ELOG("MwmHintsDecorBorder"); - if(mwm->decorations & MwmDecorHandle) - ELOG("MwmHintsDecorHandle"); - } - } - else - ELOG("mwm: no decor at all"); - } - - XFree(mwm); -} diff --git a/edewm/Hints.h b/edewm/Hints.h deleted file mode 100644 index 4f40449..0000000 --- a/edewm/Hints.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * $Id: Hints.h 1736 2006-08-19 00:38:53Z karijes $ - * - * Edewm, window manager - * Part of Equinox Desktop Environment (EDE). - * Copyright (c) 2000-2006 EDE Authors. - * - * This program is licenced under terms of the - * GNU General Public Licence version 2 or newer. - * See COPYING for details. - */ - -#ifndef __HINTS_H__ -#define __HINTS_H__ - -#include - -struct FrameData; -class WindowManager; - -struct Hints -{ - void icccm_size(FrameData* f); - void icccm_wm_hints(FrameData* f); - char* icccm_label(Window win, bool* allocated); - void icccm_set_iconsizes(WindowManager* wm); - void icccm_configure(FrameData* f) const; - - char* netwm_label(Window win, bool* allocated); - void netwm_window_type(FrameData* fd); - void netwm_set_window_type(FrameData* fd); - long netwm_window_state(FrameData* fd) const; - void netwm_set_window_state(FrameData* fd); - void netwm_set_active_window(Window win); - void netwm_strut(Window win, int* x, int* y, int* w, int* h) const; - - void mwm_load_hints(FrameData* fd); -}; - -#endif diff --git a/edewm/Jamfile b/edewm/Jamfile deleted file mode 100644 index b898509..0000000 --- a/edewm/Jamfile +++ /dev/null @@ -1,18 +0,0 @@ -# -# $Id$ -# -# Part of Equinox Desktop Environment (EDE). -# Copyright (c) 2000-2007 EDE Authors. -# -# This program is licensed under terms of the -# GNU General Public License version 2 or newer. -# See COPYING for details. - -SubDir TOP edewm ; - -SOURCE = [ Wildcard *.cpp ] ; -POFILES = [ Wildcard locale : *.po ] ; - -EfltkProgram edewm : $(SOURCE) ; -TranslationStrings locale : $(SOURCE) ; -Translation locale : $(POFILES) ; diff --git a/edewm/Sound.cpp b/edewm/Sound.cpp deleted file mode 100644 index 42e9306..0000000 --- a/edewm/Sound.cpp +++ /dev/null @@ -1,173 +0,0 @@ -/* - * $Id: Sound.cpp 1697 2006-07-21 15:01:05Z karijes $ - * - * Edewm, window manager - * Part of Equinox Desktop Environment (EDE). - * Copyright (c) 2000-2006 EDE Authors. - * - * This program is licenced under terms of the - * GNU General Public Licence version 2 or newer. - * See COPYING for details. - */ - -#include "Sound.h" -#include "debug.h" - -#ifdef SOUND - #include - #include -#endif - -#include -#include -#include // free -#include // strdup - -SoundSystem::SoundSystem() -{ -#ifdef SOUND - device = NULL; - inited = false; - down = false; -#endif -} - -SoundSystem::~SoundSystem() -{ -#ifdef SOUND - if(!down) - shutdown(); // just in case -#endif -} - -void SoundSystem::init(void) -{ -#ifdef SOUND - EPRINTF("Loading sound system\n"); - - ao_initialize(); - default_driver = ao_default_driver_id(); - - for(int i = 0; i < KNOWN_SOUNDS; i++) - { - event_sound[i].allocated = false; - event_sound[i].loaded = false; - event_sound[i].file_to_play = NULL; - } - - inited = true; -#endif -} - -void SoundSystem::shutdown(void) -{ -#ifdef SOUND - EPRINTF("Shutting down sound system\n"); - - ao_shutdown(); - - for(int i = 0; i < KNOWN_SOUNDS; i++) - { - if(event_sound[i].allocated) - free(event_sound[i].file_to_play); - } - - down = true; -#endif -} - -void SoundSystem::add(short event, const char* file) -{ -#ifdef SOUND - assert(event < KNOWN_SOUNDS); - if(event_sound[event].allocated) - free(event_sound[event].file_to_play); - - event_sound[event].file_to_play = strdup(file); - event_sound[event].allocated = true; - event_sound[event].loaded = true; -#endif -} - -int SoundSystem::play(short event) -{ -#ifdef SOUND - assert(event < KNOWN_SOUNDS); - if(event_sound[event].loaded) - play(event_sound[event].file_to_play); - else - ELOG("Skipping this sound, no file for it"); -#endif - return 1; -} - -int SoundSystem::play(const char* fname) -{ -#ifdef SOUND - assert(inited != false); - assert(fname != NULL); - - FILE* f = fopen(fname, "rb"); - if(f == NULL) - { - ELOG("Can't open %s\n", fname); - return 0; - } - - OggVorbis_File vf; - vorbis_info* vi; - - if(ov_open(f, &vf, NULL, 0) < 0) - { - ELOG("%s does not appear to be ogg file\n"); - fclose(f); - return 0; - } - - // read and print comments - char** comm = ov_comment(&vf, -1)->user_comments; - vi = ov_info(&vf, -1); - - while(*comm) - { - ELOG("%s", *comm); - comm++; - } - - assert(vi != NULL); - - format.bits = 4 * 8; // TODO: should be word_size * 8 - format.channels = vi->channels; - format.rate = vi->rate; - format.byte_format = AO_FMT_NATIVE; - - // now open device - device = ao_open_live(default_driver, &format, NULL); - if(device == NULL) - { - ELOG("Can't open device"); - ov_clear(&vf); - return 0; - } - - int current_section; - while(1) - { - long ret = ov_read(&vf, pcm_out, sizeof(pcm_out), 0, 2, 1, ¤t_section); - if(ret == 0) - break; - else if(ret < 0) - ELOG("Error in the stream, continuing..."); - else - ao_play(device, pcm_out, ret); - } - - ao_close(device); - device = NULL; - - // NOTE: fclose(f) is not needed, since ov_clear() will close file - ov_clear(&vf); -#endif // SOUND - - return 1; -} diff --git a/edewm/Sound.h b/edewm/Sound.h deleted file mode 100644 index 1b68259..0000000 --- a/edewm/Sound.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * $Id: Sound.h 1697 2006-07-21 15:01:05Z karijes $ - * - * Edewm, window manager - * Part of Equinox Desktop Environment (EDE). - * Copyright (c) 2000-2006 EDE Authors. - * - * This program is licenced under terms of the - * GNU General Public Licence version 2 or newer. - * See COPYING for details. - */ - -#ifndef __SOUND_H__ -#define __SOUND_H__ - -#ifdef SOUND - #include -#endif - -enum -{ - SOUND_MINIMIZE = 0, - SOUND_MAXIMIZE, - SOUND_RESTORE, - SOUND_SHADE, - SOUND_CLOSE -}; -#define KNOWN_SOUNDS 5 - -struct EventSound -{ - bool allocated; - bool loaded; - short event; - char* file_to_play; -}; - -#define PCM_BUF_SIZE 4096 - -class SoundSystem -{ -#ifdef SOUND - private: - ao_device* device; - ao_sample_format format; - int default_driver; - char pcm_out[PCM_BUF_SIZE]; - bool inited; - bool down; - EventSound event_sound[KNOWN_SOUNDS]; -#endif - public: - SoundSystem(); - ~SoundSystem(); - void init(void); - void shutdown(void); - - void add(short event, const char* file); - int play(const char* fname); - int play(short event); -}; - -#endif diff --git a/edewm/Titlebar.cpp b/edewm/Titlebar.cpp deleted file mode 100644 index 8000724..0000000 --- a/edewm/Titlebar.cpp +++ /dev/null @@ -1,429 +0,0 @@ -/* - * $Id: Titlebar.cpp 1718 2006-07-29 13:26:19Z karijes $ - * - * Edewm, window manager - * Part of Equinox Desktop Environment (EDE). - * Copyright (c) 2000-2006 EDE Authors. - * - * This program is licenced under terms of the - * GNU General Public Licence version 2 or newer. - * See COPYING for details. - */ - -#include "Titlebar.h" -#include "Frame.h" -#include "debug.h" -#include -#include -#include -#include -#include - -#include "app.xpm" -Fl_Image app_img((const char**)app_xpm); - -#define MAX_OF 0.6f -#define MIN_OF 0.5f -#define RES_OF 0.1f -#define vv(x,y) fl_vertex(x,y) - -void draw_close(Fl_Color col) -{ - fl_rotate(45); - fl_color(col); - - vv(-0.9f,-0.12f); vv(-0.9f,0.12f); vv(0.9f,0.12f); vv(0.9f,-0.12f); fl_fill_stroke(FL_DARK3); - vv(-0.12f,-0.9f); vv(-0.12f,0.9f); vv(0.12f,0.9f); vv(0.12f,-0.9f); fl_fill_stroke(FL_DARK3); -} - -void draw_max(Fl_Color col) -{ - fl_color(col); - - vv(-MAX_OF, -MAX_OF); vv(MAX_OF, -MAX_OF); - vv(MAX_OF,-MAX_OF+0.4); vv(-MAX_OF,-MAX_OF+0.4); - fl_fill(); - - vv(MAX_OF,-MAX_OF); vv(MAX_OF,MAX_OF); - vv(-MAX_OF,MAX_OF); vv(-MAX_OF,-MAX_OF); - fl_stroke(); -} - -void draw_maximized(Fl_Color col) -{ - fl_color(col); - - vv(-MAX_OF+RES_OF, -MAX_OF+RES_OF); vv(MAX_OF-RES_OF, -MAX_OF+RES_OF); - vv(MAX_OF-RES_OF,-MAX_OF+RES_OF); vv(MAX_OF-RES_OF,MAX_OF-RES_OF); - vv(-MAX_OF+RES_OF,MAX_OF-RES_OF); vv(-MAX_OF+RES_OF,-MAX_OF+RES_OF); - fl_stroke(); - - vv(-MAX_OF+RES_OF+0.2f, -MAX_OF+RES_OF+0.2f); vv(MAX_OF-RES_OF-0.2f, -MAX_OF+RES_OF+0.2f); - vv(MAX_OF-RES_OF-0.2f,-MAX_OF+RES_OF+0.2f); vv(MAX_OF-RES_OF-0.2f,MAX_OF-RES_OF-0.2f); - vv(-MAX_OF+RES_OF+0.2f,MAX_OF-RES_OF-0.2f); vv(-MAX_OF+RES_OF+0.2f,-MAX_OF+RES_OF+0.2f); - fl_stroke(); -} - - -void draw_min(Fl_Color col) -{ - fl_color(col); - - vv(-MIN_OF, MIN_OF); vv(MIN_OF, MIN_OF); - vv(MIN_OF, MIN_OF+0.3f); vv(-MIN_OF, MIN_OF+0.3f); - fl_fill(); -} - -void close_cb(Fl_Widget*, void* t) -{ - Titlebar* tb = (Titlebar*)t; - assert(tb != NULL); - tb->on_close(); -} - -void maximize_cb(Fl_Widget* b, void* t) -{ - Titlebar* tb = (Titlebar*)t; - assert(tb != NULL); - tb->on_maximize(); -} - -void shade_cb(Fl_Widget*, void* t) -{ - Titlebar* tb = (Titlebar*)t; - assert(tb != NULL); - tb->on_shade(); -} - -void minimize_cb(Fl_Widget*, void* t) -{ - Titlebar* tb = (Titlebar*)t; - assert(tb != NULL); - tb->on_minimize(); -} - -void lower_cb(Fl_Widget*, void* t) -{ - Titlebar* tb = (Titlebar*)t; - assert(tb != NULL); - tb->on_lower(); -} - -TitlebarButton::TitlebarButton(int type) : - Fl_Button(0, 0, 0, 0, 0), - button_type(type), - pos(PLACE_RIGHT) -{ - focus_box(FL_NO_BOX); - box(FL_FLAT_BOX); - label_type(FL_SYMBOL_LABEL); - - switch(button_type) - { - case TITLEBAR_CLOSE_UP: - label("@xx"); - break; - case TITLEBAR_MAX_UP: - label("@mx"); - break; - case TITLEBAR_MIN_UP: - label("@ii"); - break; - } -} - -TitlebarButton::~TitlebarButton() -{ -} - -/* Place buttons on titlebar. The can be either - * PLACE_RIGHT (standard in many wm-s) or PLACE_RIGHT - */ -void TitlebarButton::place(int p) -{ - if(p != PLACE_LEFT && p != PLACE_RIGHT) - pos = PLACE_RIGHT; - else - pos = p; -} - -Titlebar::Titlebar(Frame* f, int x, int y, int w, int h, const char* l) : - Fl_Group(x, y, w, h, l), - win_x(0), - win_y(0), - win_x1(0), - win_y1(0), - curr_frame(f), - minb(TITLEBAR_MIN_UP), - maxb(TITLEBAR_MAX_UP), - closeb(TITLEBAR_CLOSE_UP), - label_box(new Fl_Box(0, 0, 0, 0)), - icon_box(new Fl_Box(0, 0, 0, 0)), - focus_color(FL_GRAY), - unfocus_color(FL_WHITE) -{ - assert(curr_frame != NULL); - - box(FL_FLAT_BOX); - - fl_add_symbol("xx", draw_close, 1); - fl_add_symbol("mx", draw_max, 1); - fl_add_symbol("mz", draw_maximized, 1); - fl_add_symbol("ii", draw_min, 1); - label_box->box(FL_FLAT_BOX); - label_box->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE); - label_box->color(FL_GRAY); - - icon_box->image(app_img); - - title_menu = new Fl_Menu_(); - - /* XXX: any way this can be better ? - * When we change label of existing menu item, menu width will not be - * recalculated honoring size of that item. So we must initially fill - * them with blanks, which will keep longer labels fully visible. - */ - menu_max = title_menu->add(_("Maximize "), 0, maximize_cb, this); - menu_shade = title_menu->add(_("Shade "), 0, shade_cb, this); - menu_lower = title_menu->add(_("Lower "), 0, lower_cb, this); - menu_min = title_menu->add(_("Minimize "), 0, minimize_cb, this, FL_MENU_DIVIDER); - menu_close = title_menu->add(_("Close "), 0, close_cb, this); - - //closeb.place(PLACE_LEFT); - end(); - - closeb.callback(close_cb, this); - //minb.callback(minimize_cb, this); - minb.callback(shade_cb, this); - maxb.callback(maximize_cb, this); - - color(FL_GRAY); - //align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE); - if(curr_frame->frame_type(FrameTypeDialog)) - { - minb.hide(); - maxb.hide(); - } -} - -Titlebar::~Titlebar() -{ -} - -#define PLACE_BUTTON(btn, leftx, rightx, mid, offset, sz) \ - if(btn.place() == PLACE_LEFT) \ - {\ - btn.resize(leftx, mid, sz, sz); \ - if(btn.visible()) \ - leftx += sz + offset; \ - }\ - if(btn.place() == PLACE_RIGHT) \ - {\ - btn.resize(rightx, mid, sz, sz); \ - if(btn.visible()) \ - rightx -= sz + offset; \ - } - -void Titlebar::layout(void) -{ - int initial_offset = 2; // distance from borders - int W = w() - box()->dx() - initial_offset; - int X = box()->dx() + initial_offset; - - int lsize = h() / 2 + 2; - int offset = 0; - int mid = 0; - int sz = h(); - - label_size(lsize); - - sz -= 4; // button width/height - mid = 2; - offset = 2; - - int lx = X + offset; // left x - int rx = W - sz - offset; // right x - - PLACE_BUTTON(closeb, lx, rx, mid, offset, sz) - PLACE_BUTTON(maxb, lx, rx, mid, offset, sz) - PLACE_BUTTON(minb, lx, rx, mid, offset, sz) - - //rx -= sz + offset; - //lx += sz + offset; - - if(icon_box->visible()) - { - icon_box->resize(lx, mid, sz, sz); - lx += sz + offset; - } - - lx += offset; - rx -= lx; - label_box->resize(lx, mid, rx, sz); - - fl_font(label_font(), label_size()); - // take a label from titlebar object - if(!label().empty()) - label_box->label(label()); - - Fl_Group::layout(); -} - -void Titlebar::focus(void) -{ - // TODO: add colors for label_box, buttons - color(focus_color); - redraw(); -} - -void Titlebar::unfocus(void) -{ - // TODO: add colors for label_box, buttons - color(unfocus_color); - redraw(); -} - -void Titlebar::on_close(void) -{ - assert(curr_frame != NULL); - curr_frame->close_kill(); -} - -void Titlebar::on_maximize(void) -{ - assert(curr_frame != NULL); - - if(curr_frame->state(FrameStateMaximized)) - { - curr_frame->restore(); - maxb.label("@mx"); - menu_max->label(_("Maximize")); - } - else - { - curr_frame->maximize(); - maxb.label("@mz"); - menu_max->label(_("UnMaximize")); - } -} - -void Titlebar::on_minimize(void) -{ - assert(curr_frame != NULL); - // TODO: not implemented -} - -void Titlebar::on_shade(void) -{ - assert(curr_frame != NULL); - - if(curr_frame->state(FrameStateShaded)) - { - curr_frame->unshade(); - menu_shade->label(_("Shade")); - } - else - { - curr_frame->shade(); - menu_shade->label(_("UnShade")); - } -} - -void Titlebar::on_lower(void) -{ - curr_frame->lower(); -} - -int Titlebar::handle(int event) -{ - // check if event is directed to our buttons - if(event == FL_PUSH || event == FL_RELEASE) - { - Fl_Widget* ch = 0; - for(int i = 0; i < children(); i++) - { - ch = child(i); - - // do not send event to label_box - if(label_box && ch == label_box) - continue; - - if(ch && Fl::event_inside(ch->x(), ch->y(), ch->w(), ch->h())) - { - ch->send(event); - return 1; - } - } - } - - // proceed to our events - switch(event) - { - case FL_PUSH: - ELOG("Titlebar FL_PUSH"); - - if(Fl::event_state(FL_BUTTON3)) - { - title_menu->popup(Fl::event_x_root(), Fl::event_y_root()); - title_menu->redraw(); - return 1; - } - - // prevent double click - if(Fl::event_is_click()) - curr_frame->raise(); - - win_x = Fl::event_x_root() - curr_frame->x(); - win_y = Fl::event_y_root() - curr_frame->y(); - return 1; - - case FL_DRAG: - ELOG("Titlebar FL_DRAG"); - // TODO: correct behaviour ??? - if(curr_frame->state(FrameStateMaximized)) - return 1; - - win_x1 = Fl::event_x_root() - win_x; - win_y1 = Fl::event_y_root() - win_y; - - if(!curr_frame->moving()) - { - curr_frame->move_start(); - - /* We can safely call grab_cursor() as many times - * as we want, since it have internal checks - * - * TODO: add XGrabServer() here - */ - curr_frame->set_cursor(CURSOR_MOVE); - curr_frame->grab_cursor(); - curr_frame->show_coordinates_window(); - } - - curr_frame->move_window(win_x1, win_y1); - curr_frame->update_coordinates_window(); - - return 1; - - case FL_RELEASE: - ELOG("Titlebar FL_RELEASE"); - if(curr_frame->moving()) - { - curr_frame->ungrab_cursor(); - curr_frame->set_cursor(CURSOR_DEFAULT); - curr_frame->move_end(); - curr_frame->hide_coordinates_window(); - } - return 1; - - case FL_ENTER: - ELOG("Titlebar::FL_ENTER"); - return 1; - case FL_LEAVE: - ELOG("Titlebar::FL_LEAVE"); - return 1; - default: - return Fl_Group::handle(event); - } - return 0; -} diff --git a/edewm/Titlebar.h b/edewm/Titlebar.h deleted file mode 100644 index 2deeb6c..0000000 --- a/edewm/Titlebar.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - * $Id: Titlebar.h 1718 2006-07-29 13:26:19Z karijes $ - * - * Edewm, window manager - * Part of Equinox Desktop Environment (EDE). - * Copyright (c) 2000-2006 EDE Authors. - * - * This program is licenced under terms of the - * GNU General Public Licence version 2 or newer. - * See COPYING for details. - */ - -#ifndef __TITLEBAR_H__ -#define __TITLEBAR_H__ - -#include -#include -#include -#include -#include - -// TODO: remove this after themes are added -#define TITLEBAR_MAX_UP 1 -#define TITLEBAR_CLOSE_UP 2 -#define TITLEBAR_MIN_UP 3 - -#define PLACE_RIGHT 1 -#define PLACE_LEFT 2 - -class TitlebarButton : public Fl_Button -{ - private: - int button_type; - int pos; - public: - TitlebarButton(int type); - ~TitlebarButton(); - void place(int p); - int place(void) { return pos; } -}; - -class Frame; - -class Titlebar : public Fl_Group -{ - private: - int win_x, win_y, win_x1, win_y1; - Frame* curr_frame; - TitlebarButton minb; - TitlebarButton maxb; - TitlebarButton closeb; - Fl_Box* label_box; - Fl_Box* icon_box; - Fl_Color focus_color; - Fl_Color unfocus_color; - - Fl_Menu_* title_menu; - Fl_Widget* menu_max; - Fl_Widget* menu_min; - Fl_Widget* menu_close; - Fl_Widget* menu_shade; - Fl_Widget* menu_lower; - - public: - Titlebar(Frame* f, int x, int y, int w, int h, const char* l); - ~Titlebar(); - void layout(void); - int handle(int event); - void focus(void); - void unfocus(void); - - void on_close(void); - void on_maximize(void); - void on_minimize(void); - void on_shade(void); - void on_lower(void); -}; - -#endif diff --git a/edewm/Tracers.h b/edewm/Tracers.h deleted file mode 100644 index 12786b0..0000000 --- a/edewm/Tracers.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * $Id: Tracers.h 1671 2006-07-11 14:07:43Z karijes $ - * - * Edewm, window manager - * Part of Equinox Desktop Environment (EDE). - * Copyright (c) 2000-2006 EDE Authors. - * - * This program is licenced under terms of the - * GNU General Public Licence version 2 or newer. - * See COPYING for details. - */ - -#ifndef __TRACERS_H__ -#define __TRACERS_H__ - -#include "debug.h" - -#ifdef _DEBUG - class FunctionTracer - { - private: - const char* func; - public: - FunctionTracer(const char* f) : func(f) - { - if(func) - EPRINTF("Function [+]: \"%s\"\n", func); - } - - ~FunctionTracer() - { - if(func) - EPRINTF("Function [-]: \"%s\"\n", func); - } - }; - - #define TRACE_FUNCTION(name) FunctionTracer foo(name) -#else - #define TRACE_FUNCTION(name) (void)0 -#endif // _DEBUG - -#endif diff --git a/edewm/Utils.cpp b/edewm/Utils.cpp deleted file mode 100644 index 5818dbf..0000000 --- a/edewm/Utils.cpp +++ /dev/null @@ -1,29 +0,0 @@ -/* - * $Id: Utils.cpp 1705 2006-07-23 22:31:56Z karijes $ - * - * Edewm, window manager - * Part of Equinox Desktop Environment (EDE). - * Copyright (c) 2000-2006 EDE Authors. - * - * This program is licenced under terms of the - * GNU General Public Licence version 2 or newer. - * See COPYING for details. - */ - -#include "Utils.h" -#include - -void SendMessage(Window win, Atom a, Atom l) -{ - XEvent ev; - long mask; - memset(&ev, 0, sizeof(ev)); - ev.xclient.type = ClientMessage; - ev.xclient.window = win; - ev.xclient.message_type = a; - ev.xclient.format = 32; - ev.xclient.data.l[0] = long(l); - ev.xclient.data.l[1] = long(fl_event_time); - mask = 0L; - XSendEvent(fl_display, win, False, mask, &ev); -} diff --git a/edewm/Utils.h b/edewm/Utils.h deleted file mode 100644 index 23576be..0000000 --- a/edewm/Utils.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * $Id: Utils.h 1705 2006-07-23 22:31:56Z karijes $ - * - * Edewm, window manager - * Part of Equinox Desktop Environment (EDE). - * Copyright (c) 2000-2006 EDE Authors. - * - * This program is licenced under terms of the - * GNU General Public Licence version 2 or newer. - * See COPYING for details. - */ - -#ifndef __UTILS_H__ -#define __UTILS_H__ - -#include - -void SendMessage(Window win, Atom a, Atom l); - -#endif // _UTILS_H_ diff --git a/edewm/Windowmanager.cpp b/edewm/Windowmanager.cpp deleted file mode 100644 index 5dc6b1f..0000000 --- a/edewm/Windowmanager.cpp +++ /dev/null @@ -1,733 +0,0 @@ -/* - * $Id: Windowmanager.cpp 1711 2006-07-25 09:51:50Z karijes $ - * - * Edewm, window manager - * Part of Equinox Desktop Environment (EDE). - * Copyright (c) 2000-2006 EDE Authors. - * - * This program is licenced under terms of the - * GNU General Public Licence version 2 or newer. - * See COPYING for details. - */ - -#include "Windowmanager.h" -#include "Atoms.h" -#include "Hints.h" -#include "Frame.h" -#include "../exset/exset.h" -#include "Tracers.h" -#include "Sound.h" -#include "debug.h" - -#include -#include -#include -#include - -#define WM_CONFIG_FILE "wmanager.conf" -#define EDE_CONFIG_FILE "ede.conf" - - -WindowManager* WindowManager::pinstance = NULL; -int x_errors; - -/* This is one of the most important part of wm and reflects - * current design. Wm will try to send all messages to frame itself, - * after trying to find it's ID in collected list. All further processing - * is left to that frame. Other messages will process wm, - * minimizing spreading events all over the code. - * I'am not in love with this decision; it's roots are from previous - * edewm code (the real roots are from icewm). - * - * Future major versions will probably have different design. - */ -int wm_event_handler(int e) -{ - if(fl_xevent.type == KeyPress) - e = FL_KEY; - if(!e) - { - Window window = fl_xevent.xany.window; - switch(fl_xevent.type) - { - case CirculateNotify: - case CirculateRequest: - case ConfigureNotify: - case ConfigureRequest: - case CreateNotify: - case GravityNotify: - /*case MapNotify:*/ - case MapRequest: - case ReparentNotify: - case UnmapNotify: - window = fl_xevent.xmaprequest.window; - break; - } - - FrameList::iterator last = WindowManager::instance()->window_list.end(); - for(FrameList::iterator it = WindowManager::instance()->window_list.begin(); it != last; ++it) - { - Frame* c = *it; - if(c->window() == window || fl_xid(c) == window) - { - //ELOG("wm_event_handler-> window found (%i), sending a message", i); - return c->handle(&fl_xevent); - } - } - - return WindowManager::instance()->handle(&fl_xevent); - } - else - return WindowManager::instance()->handle(e); -} - -int convert_align(int a) -{ - switch(a) - { - default: - case 0: break; - case 1: return FL_ALIGN_RIGHT; - case 2: return FL_ALIGN_CENTER; - } - return FL_ALIGN_LEFT; -} - -int xerror_handler(Display* d, XErrorEvent* e) -{ - if(e->request_code == X_ChangeWindowAttributes && - e->error_code == BadAccess && - e->resourceid == RootWindow(fl_display, DefaultScreen(fl_display))) - { - // force cleaning data - WindowManager::shutdown(); - Fl::fatal(_("Another window manager is running. You must exit it before running edewm.")); - } - - x_errors++; - - char buff[128]; - - EPRINTF("\n"); - XGetErrorDatabaseText(fl_display, "XlibMessage", "XError", "", buff, 128); - EPRINTF("%s: ", buff); - XGetErrorText(fl_display, e->error_code, buff, 128); - EPRINTF("%s \n", buff); - - XGetErrorDatabaseText(fl_display, "XlibMessage", "MajorCode", "%d", buff, 128); - EPRINTF(" "); - EPRINTF(buff, e->request_code); - - sprintf(buff, "%d", e->request_code); - XGetErrorDatabaseText(fl_display, "XRequest", buff, "%d", buff, 128); - EPRINTF(" (%s)\n", buff); - - XGetErrorDatabaseText(fl_display, "XlibMessage", "MinorCode", "%d", buff, 128); - EPRINTF(" "); - EPRINTF(buff, e->minor_code); - EPRINTF(" "); - XGetErrorDatabaseText(fl_display, "XlibMessage", "ResourceID", "%d", buff, 128); - EPRINTF(buff, e->resourceid); - - EPRINTF("\n"); - EPRINTF("\n"); - - return 0; -} - -bool ValidateDrawable(Drawable d) -{ - Window w; - int dummy; - unsigned int dummy_ui; - - XSync(fl_display, False); - x_errors = 0; - XGetGeometry(fl_display, d, &w, &dummy, &dummy, &dummy_ui, &dummy_ui, &dummy_ui, &dummy_ui); - XSync(fl_display, False); - - bool ret = (x_errors == 0 ? true : false); - x_errors = 0; - -/* - if(ret != true) - { - WindowManager::shutdown(); - assert(ret == true); - } -*/ - - return ret; -} - -WindowManager::WindowManager() : Fl_Window(0, 0, Fl::w(), Fl::h()), is_running(false) -{ - box(FL_NO_BOX); - ELOG("WindowManager constructor"); -} - -WindowManager::~WindowManager() -{ - ELOG("WindowManager destructor"); - - FrameList::iterator last = window_list.end(); - for(FrameList::iterator it = window_list.begin(); it != last; ++it) - { - Frame* f = *it; - delete f; - } - window_list.clear(); - - sound_system->shutdown(); - delete sound_system; - - delete wm_conf; - delete hint_stuff; - delete cur; -} - -WindowManager* WindowManager::instance(void) -{ - assert(WindowManager::pinstance != NULL); - return WindowManager::pinstance; -} - -void WindowManager::init(int argc, char** argv) -{ - if(WindowManager::pinstance != NULL) - return; - - WindowManager::pinstance = new WindowManager(); - WindowManager::pinstance->init_internals(); -} - -void WindowManager::shutdown(void) -{ - if(WindowManager::pinstance != NULL) - { - delete WindowManager::pinstance; - WindowManager::pinstance = NULL; - } -} - -void WindowManager::init_internals(void) -{ - ELOG("Starting window manager"); - wm_conf = new WindowManagerConfig; - - app_starting = false; - - // defaults, in case world goes down - wm_conf->title_active_color = fl_rgb(0,0,128); - wm_conf->title_active_color_text = fl_rgb(255,255,255); - wm_conf->title_normal_color = fl_rgb(192,192,192); - wm_conf->title_normal_color_text = fl_rgb(0,0,128); - wm_conf->title_label_align = FL_ALIGN_LEFT; - wm_conf->title_height = 20; - wm_conf->title_box_type = 0; - wm_conf->frame_do_opaque = false; - wm_conf->frame_animate = true; - wm_conf->frame_animate_speed = 15; - - fl_open_display(); - XSetErrorHandler(xerror_handler); - wm_area.set(0, 0, Fl::w(), Fl::h()); - - read_configuration(); - read_xset_configuration(); - - //register_protocols(); -#ifdef _DEBUG - InitAtoms(fl_display, atom_map); - register_events(); -#else - InitAtoms(fl_display); -#endif - - //cur = XCreateFontCursor(fl_display, XC_left_ptr); - //XDefineCursor(fl_display, RootWindow(fl_display, fl_screen), cur); - // load cursor - cur = new CursorHandler; - cur->load(X_CURSORS); - cur->set_root_cursor(); - - sound_system = new SoundSystem(); - sound_system->init(); - - sound_system->add(SOUND_MINIMIZE, "sounds/minimize.ogg"); - sound_system->add(SOUND_MAXIMIZE, "sounds/maximize.ogg"); - sound_system->add(SOUND_CLOSE, "sounds/close.ogg"); - sound_system->add(SOUND_RESTORE, "sounds/restore.ogg"); - sound_system->add(SOUND_SHADE, "sounds/shade.ogg"); - - // the world is starting here - show(); - register_protocols(); - - hint_stuff = new Hints; - hint_stuff->icccm_set_iconsizes(this); - - init_clients(); - Fl::add_handler(wm_event_handler); - XSync(fl_display, 0); - - is_running = true; -} - -// load current visible clients -void WindowManager::init_clients(void) -{ - Frame* frame = 0; - uint win_num; - Window w1, w2, *wins; - XWindowAttributes attr; - XQueryTree(fl_display, fl_xid(this), &w1, &w2, &wins, &win_num); - - // XXX: excluding root parent !!! - //for (uint i = 0; i < win_num-1; i++) - for (uint i = 0; i < win_num; i++) - { - XGetWindowAttributes(fl_display, wins[i], &attr); - if(!attr.override_redirect && attr.map_state == IsViewable) - { - if(!attr.screen) - { - ELOG("Screen not as window, skiping..."); - continue; - } - - if(ValidateDrawable(wins[i])) - frame = new Frame(wins[i], &attr); - } - else - ELOG("Skipping override_redirect window"); - } - XFree((void *)wins); -} - -// register type messages wm understainds -void WindowManager::register_protocols(void) -{ - ELOG("Loading protocols"); - SetSupported(root_win); -} - -void WindowManager::read_configuration(void) -{ - ELOG("Reading config"); - Fl_Config conf(fl_find_config_file(WM_CONFIG_FILE, 0)); - conf.set_section("TitleBar"); - conf.read("Active color", wm_conf->title_active_color, fl_rgb(0, 0, 128)); - conf.read("Normal color", wm_conf->title_normal_color, fl_rgb(192, 192, 192)); - conf.read("Active color text", wm_conf->title_active_color_text, fl_rgb(255, 255, 255)); - conf.read("Normal color text", wm_conf->title_normal_color_text, fl_rgb(0, 0, 128)); - conf.read("Box type", wm_conf->title_box_type, 0); - conf.read("Height", wm_conf->title_height, 20); - - int la; - conf.read("Text align", la, 0); - wm_conf->title_label_align = convert_align(la); - - conf.set_section("Resize"); - conf.read("Opaque resize", wm_conf->frame_do_opaque, false); - conf.read("Animate", wm_conf->frame_animate, true); - conf.read("Animate Speed", wm_conf->frame_animate_speed, 15); - - conf.set_section("Misc"); - conf.read("Use theme", wm_conf->use_theme); - - notify_clients(); -} - -void WindowManager::read_xset_configuration(void) -{ - Fl_Config conf(fl_find_config_file(EDE_CONFIG_FILE, 1)); - int val1, val2, val3; - Exset xset; - - conf.set_section("Mouse"); - conf.read("Accel", val1, 4); - conf.read("Thress",val2, 4); - xset.set_mouse(val1, val2); - - conf.set_section("Bell"); - conf.read("Volume", val1, 50); - conf.read("Pitch", val2, 440); - conf.read("Duration", val3, 200); - xset.set_bell(val1, val2, val3); - - conf.set_section("Keyboard"); - conf.read("Repeat", val1, 1); - conf.read("ClickVolume", val2, 50); - xset.set_keybd(val1, val2); - - conf.set_section("Screen"); - conf.read("Delay", val1, 15); - conf.read("Pattern",val2, 2); - xset.set_pattern(val1, val2); - - conf.read("CheckBlank", val1, 1); - xset.set_check_blank(val1); - - conf.read("Pattern", val1, 2); - xset.set_blank(val1); -} - -void WindowManager::notify_clients(void) -{ -#warning "TODO: implement WindowManager::notify_clients()" -} - -void WindowManager::show(void) -{ - if(!shown()) - { - create(); - /* Destroy efltk window, set RootWindow to our - * xid and redirect all messages to us, which - * will make us a window manager. - */ - XDestroyWindow(fl_display, Fl_X::i(this)->xid); - Fl_X::i(this)->xid = RootWindow(fl_display, fl_screen); - root_win = RootWindow(fl_display, fl_screen); - XSelectInput(fl_display, fl_xid(this), - SubstructureRedirectMask | - SubstructureNotifyMask | - ColormapChangeMask | - PropertyChangeMask | - ButtonPressMask | - ButtonReleaseMask | - EnterWindowMask | - LeaveWindowMask | - KeyPressMask | - KeyReleaseMask | - KeymapStateMask); - - ELOG("RootWindow ID set to xid"); - draw(); - } -} - -void WindowManager::draw(void) -{ - ELOG("RootWindow draw"); - // redraw root window - XClearWindow(fl_display, fl_xid(this)); -} - -void WindowManager::idle(void) -{ - //ELOG("Idle"); - FrameList::iterator last = remove_list.end(); - for(FrameList::iterator it = remove_list.begin(); it != last; ++it) - { - Frame* f = *it; - delete f; - } - remove_list.clear(); -} - -void WindowManager::exit(void) -{ - if(is_running) - is_running = false; -} - -const Cursor WindowManager::root_cursor(void) -{ - assert(cur != NULL); - return cur->root_cursor(); -} - -void WindowManager::set_cursor(Frame* f, CursorType t) -{ - assert(f != NULL); - cur->set_cursor(f, t); -/* - if(cur->cursor_shape_type() == FLTK_CURSORS) - cur->set_fltk_cursor(f, t); - else - cur->set_x_cursor(f, t); -*/ -} - -const CursorHandler* WindowManager::cursor_handler(void) -{ - assert(cur != NULL); - return cur; -} - -int WindowManager::handle(int event) -{ - Window window = fl_xevent.xany.window; - switch(event) - { - case FL_PUSH: - { - FrameList::iterator last = window_list.end(); - for(FrameList::iterator it = window_list.begin(); it != last; ++it) - { - Frame* f = *it; - if(f->window() == window || fl_xid(f) == window) - { - f->content_click(); - return 1; - } - } - - ELOG("FL_PUSH on root"); - return 0; - } - - case FL_SHORTCUT: - case FL_KEY: - - ELOG("FL_SHORCUT | FL_KEY"); - return 1; - case FL_MOUSEWHEEL: - XAllowEvents(fl_display, ReplayPointer, CurrentTime); - return 0; - } - return 0; -} - -int WindowManager::handle(XEvent* event) -{ - switch(event->type) - { - /* ClientMessage is only used for desktop handling - * and startup notifications. - */ - case ClientMessage: - { - ELOG("ClientMessage in wm"); - if(event->xclient.message_type == _XA_EDE_WM_STARTUP_NOTIFY) - { - Atom data = event->xclient.data.l[0]; - if(data == _XA_EDE_WM_APP_STARTING) - { - app_starting = true; - cur->set_root_cursor(CURSOR_WAIT); - } - } - return 1; - } - case MapRequest: - { - ELOG("MapRequest from wm"); - const XMapRequestEvent* e = &(fl_xevent.xmaprequest); - - XWindowAttributes attrs; - XGetWindowAttributes(fl_display, e->window, &attrs); - if(!attrs.override_redirect) - { - ELOG("--- map from wm ---"); - new Frame(e->window); - - if(app_starting) - { - cur->set_root_cursor(CURSOR_DEFAULT); - app_starting = false; - } - } - - return 1; - } - case ConfigureRequest: - { - ELOG("ConfigureRequest from wm"); - const XConfigureRequestEvent *e = &(fl_xevent.xconfigurerequest); - XConfigureWindow(fl_display, e->window, e->value_mask&~(CWSibling|CWStackMode), - (XWindowChanges*)&(e->x)); - return 1; - } - - default: - return 0; - } - return 0; -} - -/* Clear stack_list and window_list for those - * windows schedulied for removal. - * Expensive operation, so use it with care. - */ -void WindowManager::update_client_list(void) -{ - bool found = false; - - // first clear aot_list - FrameList::iterator last = aot_list.end(); - for(FrameList::iterator it = aot_list.begin(); it != last; ++it) - { - Frame* f = *it; - if(f->destroy_scheduled()) - { - // erase current and let 'it' point to next element - it = aot_list.erase(it); - found = true; - } - } - - // then clear stack_list - if(!found) - { - last = stack_list.end(); - for(FrameList::iterator it = stack_list.begin(); it != last; ++it) - { - Frame* f = *it; - if(f->destroy_scheduled()) - it = stack_list.erase(it); - } - } - - // then window_list - last = window_list.end(); - for(FrameList::iterator it = window_list.begin(); it != last; ++it) - { - Frame* f = *it; - if(f->destroy_scheduled()) - { - // TODO: do I need this ??? - remove_list.push_back(*it); - it = window_list.erase(it); - } - } -} - -/* Used by frames. - * Window manager will check position of last client and - * return possible next one - * - * Accepted values are: current frame width and height, and - * returned is position where it should be placed. - */ -bool WindowManager::query_best_position(int* x, int* y, int w, int h) -{ - const int offset = 20; - - if(window_list.size() <= 0) - return false; - - //Frame* f = window_list[window_list.size()-1]; - Frame* f = *(--window_list.end()); - if(!f) - return false; - - *x = f->x() + offset; - *y = f->y() + offset; - - // if w-h of frame are larger than area - // place them to apropriate corners - if((*x + w) > wm_area.w()) - *x = wm_area.x(); - if((*y + h) > wm_area.h()) - *y = wm_area.y(); - - return true; -} - -Frame* WindowManager::find_xid(Window win) -{ - FrameList::iterator last = window_list.end(); - for(FrameList::iterator it = window_list.begin(); it != last; ++it) - { - Frame* f = *it; - if(f->window() == win) - return f; - } - - return 0; -} - -void WindowManager::restack_windows(void) -{ - TRACE_FUNCTION("void WindowManager::restack_windows(void)"); - - Window* stack = new Window[aot_list.size() + stack_list.size()]; - FrameList::iterator it = aot_list.begin(); - FrameList::iterator last = aot_list.end(); - unsigned int i = 0; - - for(; it != last && i < aot_list.size(); ++it, i++) - stack[i] = fl_xid(*it); - - it = stack_list.begin(); - last = stack_list.end(); - - - for(; it != last && i < aot_list.size() + stack_list.size(); ++it, i++) - stack[i] = fl_xid(*it); - - XRestackWindows(fl_display, stack, stack_list.size()); - delete [] stack; -} - -void WindowManager::clear_focus_windows(void) -{ - if(aot_list.size() > 0) - { - FrameList::iterator it = aot_list.begin(); - FrameList::iterator last = aot_list.end(); - for(; it != last; ++it) - (*it)->unfocus(); - } - - FrameList::iterator it = stack_list.begin(); - FrameList::iterator last = stack_list.end(); - for(; it != last; ++it) - (*it)->unfocus(); -} - -void WindowManager::play_sound(short event) -{ - assert(sound_system != NULL); - sound_system->play(event); -} - - -#ifdef _DEBUG -void WindowManager::register_events(void) -{ - xevent_map[CirculateNotify] = "CirculateNotify"; - xevent_map[CirculateRequest] = "CirculateRequest"; - xevent_map[ConfigureNotify] = "ConfigureNotify"; - xevent_map[ConfigureRequest] = "ConfigureRequest"; - xevent_map[CreateNotify] = "CreateNotify"; - xevent_map[GravityNotify] = "GravityNotify"; - xevent_map[MapNotify] = "MapNotify"; - xevent_map[MapRequest] = "MapRequest"; - xevent_map[ReparentNotify] = "ReparentNotify"; - xevent_map[UnmapNotify] = "UnmapNotify"; - xevent_map[DestroyNotify] = "DestroyNotify"; - xevent_map[PropertyNotify] = "PropertyNotify"; - xevent_map[EnterNotify] = "EnterNotify"; - xevent_map[LeaveNotify] = "LeaveNotify"; - xevent_map[VisibilityNotify] = "VisibilityNotify"; - xevent_map[FocusIn] = "FocusIn"; - xevent_map[FocusOut] = "FocusOut"; - xevent_map[ClientMessage] = "ClientMessage"; - - efltkevent_map[FL_PUSH] = "FL_PUSH"; - efltkevent_map[FL_RELEASE] = "FL_RELEASE"; - efltkevent_map[FL_ENTER] = "FL_ENTER"; - efltkevent_map[FL_LEAVE] = "FL_LEAVE"; - efltkevent_map[FL_DRAG] = "FL_DRAG"; - efltkevent_map[FL_FOCUS] = "FL_FOCUS"; - efltkevent_map[FL_UNFOCUS] = "FL_UNFOCUS"; - efltkevent_map[FL_KEY] = "FL_KEY"; - efltkevent_map[FL_KEYUP] = "FL_KEYUP"; - efltkevent_map[FL_MOVE] = "FL_MOVE"; - efltkevent_map[FL_SHORTCUT] = "FL_SHORTCUT"; - efltkevent_map[FL_ACTIVATE] = "FL_ACTIVATE"; - efltkevent_map[FL_DEACTIVATE]= "FL_DEACTIVATE"; - efltkevent_map[FL_SHOW] = "FL_SHOW"; - efltkevent_map[FL_HIDE] = "FL_HIDE"; - efltkevent_map[FL_MOUSEWHEEL]= "FL_MOUSEWHEEL"; - efltkevent_map[FL_PASTE] = "FL_PASTE"; - efltkevent_map[FL_DND_ENTER] = "FL_DND_ENTER"; - efltkevent_map[FL_DND_DRAG] = "FL_DND_DRAG"; - efltkevent_map[FL_DND_LEAVE] = "FL_DND_LEAVE"; - efltkevent_map[FL_DND_RELEASE] = "FL_DND_RELEASE"; -} -#endif diff --git a/edewm/Windowmanager.h b/edewm/Windowmanager.h deleted file mode 100644 index 15decd1..0000000 --- a/edewm/Windowmanager.h +++ /dev/null @@ -1,165 +0,0 @@ -/* - * $Id: Windowmanager.h 1711 2006-07-25 09:51:50Z karijes $ - * - * Edewm, window manager - * Part of Equinox Desktop Environment (EDE). - * Copyright (c) 2000-2006 EDE Authors. - * - * This program is licenced under terms of the - * GNU General Public Licence version 2 or newer. - * See COPYING for details. - */ - -#ifndef _WINDOWMANAGER_H_ -#define _WINDOWMANAGER_H_ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "Cursor.h" - -#ifdef _DEBUG -#include -#endif - -#include - -/* -class Frame_List : public Fl_Ptr_List { -public: - Frame_List() : Fl_Ptr_List() { } - - void append(Frame *item) { Fl_Ptr_List::append((void *)item); } - void prepend(Frame *item) { Fl_Ptr_List::prepend((void *)item); } - void insert(uint pos, Frame *item) { Fl_Ptr_List::insert(pos, (void *)item); } - void replace(uint pos, Frame *item) { Fl_Ptr_List::replace(pos, (void *)item); } - void remove(uint pos) { Fl_Ptr_List::remove(pos); } - bool remove(Frame *item) { return Fl_Ptr_List::remove((void *)item); } - int index_of(const Frame *w) const { return Fl_Ptr_List::index_of((void*)w); } - Frame *item(uint index) const { return (Frame*)Fl_Ptr_List::item(index); } - - Frame **data() { return (Frame**)items; } - - Frame *operator [](uint ind) const { return (Frame *)items[ind]; } -}; -*/ - -struct WindowManagerConfig -{ - Fl_Color title_active_color; - Fl_Color title_active_color_text; - Fl_Color title_normal_color; - Fl_Color title_normal_color_text; - - int title_label_align; - int title_height; - int title_box_type; - - bool frame_do_opaque; - bool frame_animate; - int frame_animate_speed; - - bool use_theme; -}; - - -// The WindowManager class looks like a window to efltk but is actually the -// screen's root window. This is done by setting xid to "show" it -// rather than have efltk create the window. Class handles all root -// windows X events - -struct Hints; -class Frame; -class CursorHandler; -class SoundSystem; -typedef std::list FrameList; - -class WindowManager : public Fl_Window -{ - private: - bool is_running; - static WindowManager* pinstance; - WindowManagerConfig* wm_conf; - Fl_Rect wm_area; - Window root_win; - Hints* hint_stuff; - - CursorHandler* cur; - SoundSystem* sound_system; - - bool app_starting; - - WindowManager(); - ~WindowManager(); - WindowManager(const WindowManager&); - WindowManager& operator=(WindowManager&); - void register_protocols(void); - void init_internals(void); - void init_clients(void); - - public: - static void init(int argc, char** argv); - static void shutdown(void); - static WindowManager* instance(); - void read_configuration(void); - void read_xset_configuration(void); - void notify_clients(void); - void show(void); - void hide(void) { } // prevent efltk from root window hiding - void draw(void); - int handle(int event); - int handle(XEvent* e); - void update_client_list(void); - bool running(void) { return is_running; } - Window root_window(void) { return root_win; } - void idle(void); - Hints* hints(void) { return hint_stuff; } - void exit(void); - int x(void) { return wm_area.x(); } - int y(void) { return wm_area.y(); } - int w(void) { return wm_area.w(); } - int h(void) { return wm_area.h(); } - - bool query_best_position(int* x, int* y, int w, int h); - Frame* find_xid(Window win); - void restack_windows(void); - void clear_focus_windows(void); - - void play_sound(short event); - - const Cursor root_cursor(void); - const CursorHandler* cursor_handler(void); - void set_cursor(Frame* f, CursorType t); - - //FrameList window_list; - //FrameList remove_list; - - // list of mapped windows (it is not changed excep window is destroyed) - FrameList window_list; - // stacking list of ordinary windows - FrameList stack_list; - // list of destroyed windows (cleared in WindowManager::idle() phase) - FrameList remove_list; - // list of always on top windows (transients etc.) - FrameList aot_list; - - -#ifdef _DEBUG - std::map atom_map; - std::map xevent_map; - std::map efltkevent_map; - - void register_events(void); -#endif -}; - - -bool ValidateDrawable(Drawable d); - -#endif diff --git a/edewm/app.xpm b/edewm/app.xpm deleted file mode 100644 index 2c5f3d9..0000000 --- a/edewm/app.xpm +++ /dev/null @@ -1,21 +0,0 @@ -/* XPM */ -static char * app_xpm[] = { -"16 16 2 1", -" c None", -". c #FF0000", -" ", -" ", -" ", -" .... . ", -" .... . ", -" .... . ", -" .... . ", -" ... . ", -" . .. ", -" . .... ", -" . .... ", -" . .... ", -" . .... ", -" . .... ", -" ", -" "}; diff --git a/edewm/debug.cpp b/edewm/debug.cpp deleted file mode 100644 index 2c53fc3..0000000 --- a/edewm/debug.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/* - * $Id: debug.cpp 1671 2006-07-11 14:07:43Z karijes $ - * - * Edewm, window manager - * Part of Equinox Desktop Environment (EDE). - * Copyright (c) 2000-2006 EDE Authors. - * - * This program is licenced under terms of the - * GNU General Public Licence version 2 or newer. - * See COPYING for details. - */ - -#include "debug.h" -#include -#include - -#define OUT_TYPE stdout - -void edewm_log(const char* str, ...) -{ -#ifdef _DEBUG - fprintf(OUT_TYPE, "wm: "); - va_list args; - va_start(args, str); - vfprintf(OUT_TYPE, str, args); - fprintf(OUT_TYPE, "\n"); - fflush(OUT_TYPE); -#endif -} -void edewm_warning(const char* str, ...) -{ -#ifdef _DEBUG - fprintf(OUT_TYPE, "wm (warning): "); - va_list args; - va_start(args, str); - vfprintf(OUT_TYPE, str, args); - fprintf(OUT_TYPE, "\n"); - fflush(OUT_TYPE); -#endif -} - -void edewm_fatal(const char* str, ...) -{ -#ifdef _DEBUG - fprintf(OUT_TYPE, "!!! wm (fatal): "); - va_list args; - va_start(args, str); - vfprintf(OUT_TYPE, str, args); - fprintf(OUT_TYPE, "\n"); - fflush(OUT_TYPE); -#endif -} - -void edewm_printf(const char* str, ...) -{ -#ifdef _DEBUG - va_list args; - va_start(args, str); - vfprintf(OUT_TYPE, str, args); - fflush(OUT_TYPE); -#endif -} diff --git a/edewm/debug.h b/edewm/debug.h deleted file mode 100644 index 8a64bac..0000000 --- a/edewm/debug.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * $Id: debug.h 1671 2006-07-11 14:07:43Z karijes $ - * - * Edewm, window manager - * Part of Equinox Desktop Environment (EDE). - * Copyright (c) 2000-2006 EDE Authors. - * - * This program is licenced under terms of the - * GNU General Public Licence version 2 or newer. - * See COPYING for details. - */ - -#ifndef __DEBUG_H__ -#define __DEBUG_H__ - -void edewm_log(const char* str, ...); -void edewm_printf(const char* str, ...); -void edewm_warning(const char* str, ...); -void edewm_fatal(const char* str, ...); - -#define ELOG edewm_log -#define EWARNING edewm_warning -#define EFATAL edewm_fatal -#define EPRINTF edewm_printf - -#endif diff --git a/edewm/locale/fi.po b/edewm/locale/fi.po deleted file mode 100644 index ffb9e61..0000000 --- a/edewm/locale/fi.po +++ /dev/null @@ -1,89 +0,0 @@ -# Finnish translation of edewm. -# Copyright (C) 2002 THE edewm'S COPYRIGHT HOLDER -# This file is distributed under the same license as the edewm package. -# Mikko L. , 2002. -# -msgid "" -msgstr "" -"Project-Id-Version: edewm 1.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2005-02-04 12:33+0100\n" -"PO-Revision-Date: 2002-09-16 11:07+0300\n" -"Last-Translator: Mikko L. \n" -"Language-Team: Finnish \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=iso-8859-15\n" -"Content-Transfer-Encoding: 8bit\n" - -#: Desktop.cpp:138 Desktop.cpp:180 -#, c-format -msgid "Workspace %d" -msgstr "Typyt %d" - -#: Frame.cpp:106 -msgid "Untitled" -msgstr "Nimetn" - -#: Frame.cpp:938 -#, c-format -msgid "EDEWM: Internal bug, when restacking (%d != %d)! Exiting... " -msgstr "" - -#: Titlebar.cpp:215 -msgid "Sticky" -msgstr "Kiinte" - -#: Titlebar.cpp:275 Titlebar.cpp:320 -msgid "Set size" -msgstr "" - -#: Titlebar.cpp:276 -msgid "Set size to window:" -msgstr "" - -#: Titlebar.cpp:285 -msgid "width:" -msgstr "" - -#: Titlebar.cpp:287 -msgid "height:" -msgstr "" - -#: Titlebar.cpp:291 -msgid "&OK" -msgstr "" - -#: Titlebar.cpp:294 -msgid "&Cancel" -msgstr "" - -#: Titlebar.cpp:318 Titlebar.cpp:331 -msgid "Maximize" -msgstr "Suurenna" - -#: Titlebar.cpp:319 -msgid "Minimize" -msgstr "Pienenn" - -#: Titlebar.cpp:321 -msgid "To Desktop" -msgstr "Typydlle:" - -#: Titlebar.cpp:322 -msgid "Kill" -msgstr "Tapa" - -#: Titlebar.cpp:323 -msgid "Close" -msgstr "Sulje" - -#: Titlebar.cpp:330 -msgid "Restore" -msgstr "Palauta" - -#: Windowmanager.cpp:90 -#, c-format -msgid "Another window manager is running. You must exit it before running %s." -msgstr "" -"Toinen ikkunointi jrjestelm kynniss. Sinun tytyy lopettaa se ennen kuin " -"voit ajaa: %s" diff --git a/edewm/locale/hu.po b/edewm/locale/hu.po deleted file mode 100644 index 2984a51..0000000 --- a/edewm/locale/hu.po +++ /dev/null @@ -1,85 +0,0 @@ -msgid "" -msgstr "" -"Project-Id-Version: \n" -"POT-Creation-Date: \n" -"PO-Revision-Date: 2005-02-09 11:21+0100\n" -"Last-Translator: Nemeth Otto \n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: Desktop.cpp:138 -#: Desktop.cpp:180 -#, c-format -msgid "Workspace %d" -msgstr "Munkaterület %d" - -#: Frame.cpp:106 -msgid "Untitled" -msgstr "Névtelen" - -#: Frame.cpp:938 -#, c-format -msgid "EDEWM: Internal bug, when restacking (%d != %d)! Exiting... " -msgstr "EDEWM: Belső hiba, restacking (%d != %d)! Kilépés... " - -#: Titlebar.cpp:215 -msgid "Sticky" -msgstr "Ragadós" - -#: Titlebar.cpp:275 -#: Titlebar.cpp:320 -msgid "Set size" -msgstr "Méret beállítása" - -#: Titlebar.cpp:276 -msgid "Set size to window:" -msgstr "Ablakméret beállítása:" - -#: Titlebar.cpp:285 -msgid "width:" -msgstr "szél.:" - -#: Titlebar.cpp:287 -msgid "height:" -msgstr "mag.:" - -#: Titlebar.cpp:291 -msgid "&OK" -msgstr "&OK" - -#: Titlebar.cpp:294 -msgid "&Cancel" -msgstr "Mégs&em" - -#: Titlebar.cpp:318 -#: Titlebar.cpp:331 -msgid "Maximize" -msgstr "Maximalizálás" - -#: Titlebar.cpp:319 -msgid "Minimize" -msgstr "Minimalizálás" - -#: Titlebar.cpp:321 -msgid "To Desktop" -msgstr "Munkaterületre" - -#: Titlebar.cpp:322 -msgid "Kill" -msgstr "Kilövés" - -#: Titlebar.cpp:323 -msgid "Close" -msgstr "Bezárás" - -#: Titlebar.cpp:330 -msgid "Restore" -msgstr "Visszaállítás" - -#: Windowmanager.cpp:90 -#, c-format -msgid "Another window manager is running. You must exit it before running %s." -msgstr "Egy másik ablakkezelő fut. Ki kell lépni belőle mielőtt ezt futtatod: %s." - diff --git a/edewm/locale/id.po b/edewm/locale/id.po deleted file mode 100644 index ad79606..0000000 --- a/edewm/locale/id.po +++ /dev/null @@ -1,89 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. -# -msgid "" -msgstr "" -"Project-Id-Version: edewm 1.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2005-02-04 12:33+0100\n" -"PO-Revision-Date: 202-11-29 14:20+0700\n" -"Last-Translator: Bambang Purnomosidi D. P. \n" -"Language-Team: id \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=iso-8859-2\n" -"Content-Transfer-Encoding: 8bit\n" - -#: Desktop.cpp:138 Desktop.cpp:180 -#, c-format -msgid "Workspace %d" -msgstr "Ruangkerja %d" - -#: Frame.cpp:106 -msgid "Untitled" -msgstr "Tanpa judul" - -#: Frame.cpp:938 -#, c-format -msgid "EDEWM: Internal bug, when restacking (%d != %d)! Exiting... " -msgstr "" - -#: Titlebar.cpp:215 -msgid "Sticky" -msgstr "Sticky" - -#: Titlebar.cpp:275 Titlebar.cpp:320 -msgid "Set size" -msgstr "" - -#: Titlebar.cpp:276 -msgid "Set size to window:" -msgstr "" - -#: Titlebar.cpp:285 -msgid "width:" -msgstr "" - -#: Titlebar.cpp:287 -msgid "height:" -msgstr "" - -#: Titlebar.cpp:291 -msgid "&OK" -msgstr "" - -#: Titlebar.cpp:294 -msgid "&Cancel" -msgstr "" - -#: Titlebar.cpp:318 Titlebar.cpp:331 -msgid "Maximize" -msgstr "Maksimalkan" - -#: Titlebar.cpp:319 -msgid "Minimize" -msgstr "Minimalkan" - -#: Titlebar.cpp:321 -msgid "To Desktop" -msgstr "Ke Desktop" - -#: Titlebar.cpp:322 -msgid "Kill" -msgstr "" - -#: Titlebar.cpp:323 -msgid "Close" -msgstr "Tutup" - -#: Titlebar.cpp:330 -msgid "Restore" -msgstr "Kembalikan" - -#: Windowmanager.cpp:90 -#, c-format -msgid "Another window manager is running. You must exit it before running %s." -msgstr "" -"Window manager lain sedang berjalan. Anda harus menghentikannya sebelum " -"menjalankan %s." diff --git a/edewm/locale/messages.po.default b/edewm/locale/messages.po.default deleted file mode 100644 index c33a66d..0000000 --- a/edewm/locale/messages.po.default +++ /dev/null @@ -1,63 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. -# -#: Desktop.cpp:233 Windowmanager.cpp:97 -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2002-09-16 10:58+0300\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" -"Content-Transfer-Encoding: 8bit\n" - -#: Desktop.cpp:247 -#, c-format -msgid "Workspace %d" -msgstr "" - - - -#: Frame.cpp:134 main.cpp:51 -msgid "Untitled" -msgstr "" - - - -#: Titlebar.cpp:211 -msgid "Sticky" -msgstr "" - -#: Titlebar.cpp:247 Titlebar.cpp:257 -msgid "Maximize" -msgstr "" - -#: Titlebar.cpp:248 -msgid "Minimize" -msgstr "" - -#: Titlebar.cpp:249 -msgid "To Desktop" -msgstr "" - -#: Titlebar.cpp:250 -msgid "Close" -msgstr "" - -#: Titlebar.cpp:272 -msgid "Kill" -msgstr "" - -#: Titlebar.cpp:256 -msgid "Restore" -msgstr "" - -#: Windowmanager.cpp:88 -#, c-format -msgid "Another window manager is running. You must exit it before running %s." -msgstr "" diff --git a/edewm/locale/messages.pot b/edewm/locale/messages.pot deleted file mode 100644 index 9512350..0000000 --- a/edewm/locale/messages.pot +++ /dev/null @@ -1,88 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2005-02-04 12:33+0100\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" -"Content-Transfer-Encoding: 8bit\n" - -#: Desktop.cpp:138 Desktop.cpp:180 -#, c-format -msgid "Workspace %d" -msgstr "" - -#: Frame.cpp:106 -msgid "Untitled" -msgstr "" - -#: Frame.cpp:938 -#, c-format -msgid "EDEWM: Internal bug, when restacking (%d != %d)! Exiting... " -msgstr "" - -#: Titlebar.cpp:215 -msgid "Sticky" -msgstr "" - -#: Titlebar.cpp:275 Titlebar.cpp:320 -msgid "Set size" -msgstr "" - -#: Titlebar.cpp:276 -msgid "Set size to window:" -msgstr "" - -#: Titlebar.cpp:285 -msgid "width:" -msgstr "" - -#: Titlebar.cpp:287 -msgid "height:" -msgstr "" - -#: Titlebar.cpp:291 -msgid "&OK" -msgstr "" - -#: Titlebar.cpp:294 -msgid "&Cancel" -msgstr "" - -#: Titlebar.cpp:318 Titlebar.cpp:331 -msgid "Maximize" -msgstr "" - -#: Titlebar.cpp:319 -msgid "Minimize" -msgstr "" - -#: Titlebar.cpp:321 -msgid "To Desktop" -msgstr "" - -#: Titlebar.cpp:322 -msgid "Kill" -msgstr "" - -#: Titlebar.cpp:323 -msgid "Close" -msgstr "" - -#: Titlebar.cpp:330 -msgid "Restore" -msgstr "" - -#: Windowmanager.cpp:90 -#, c-format -msgid "Another window manager is running. You must exit it before running %s." -msgstr "" diff --git a/edewm/locale/ru.po b/edewm/locale/ru.po deleted file mode 100644 index b10b539..0000000 --- a/edewm/locale/ru.po +++ /dev/null @@ -1,90 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2005-02-04 12:33+0100\n" -"PO-Revision-Date: 2002-11-28 HO:MI+ZONE\n" -"Last-Translator: aabbvv \n" -"Language-Team: RUSSIAN \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=koi8-r\n" -"Content-Transfer-Encoding: 8bit\n" - -#: Desktop.cpp:138 Desktop.cpp:180 -#, c-format -msgid "Workspace %d" -msgstr " %d" - -#: Frame.cpp:106 -msgid "Untitled" -msgstr "" - -#: Frame.cpp:938 -#, c-format -msgid "EDEWM: Internal bug, when restacking (%d != %d)! Exiting... " -msgstr "" - -#: Titlebar.cpp:215 -msgid "Sticky" -msgstr " " - -#: Titlebar.cpp:275 Titlebar.cpp:320 -msgid "Set size" -msgstr "" - -#: Titlebar.cpp:276 -msgid "Set size to window:" -msgstr "" - -#: Titlebar.cpp:285 -msgid "width:" -msgstr "" - -#: Titlebar.cpp:287 -msgid "height:" -msgstr "" - -#: Titlebar.cpp:291 -msgid "&OK" -msgstr "" - -#: Titlebar.cpp:294 -msgid "&Cancel" -msgstr "" - -#: Titlebar.cpp:318 Titlebar.cpp:331 -msgid "Maximize" -msgstr "" - -#: Titlebar.cpp:319 -msgid "Minimize" -msgstr "" - -#: Titlebar.cpp:321 -msgid "To Desktop" -msgstr " " - -#: Titlebar.cpp:322 -msgid "Kill" -msgstr "" - -#: Titlebar.cpp:323 -msgid "Close" -msgstr "" - -#: Titlebar.cpp:330 -msgid "Restore" -msgstr "" - -#: Windowmanager.cpp:90 -#, c-format -msgid "Another window manager is running. You must exit it before running %s." -msgstr "" -" . " -" %s." diff --git a/edewm/locale/sk.po b/edewm/locale/sk.po deleted file mode 100644 index d44ddd7..0000000 --- a/edewm/locale/sk.po +++ /dev/null @@ -1,87 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR Free Software Foundation, Inc. -# FIRST AUTHOR , YEAR. -# -msgid "" -msgstr "" -"Project-Id-Version: edewm 1.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2005-02-04 12:33+0100\n" -"PO-Revision-Date: 2002-04-21 14:50+0200\n" -"Last-Translator: Martin Pekar \n" -"Language-Team: Slovak \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: Desktop.cpp:138 Desktop.cpp:180 -#, c-format -msgid "Workspace %d" -msgstr "Plocha %d" - -#: Frame.cpp:106 -msgid "Untitled" -msgstr "Bez názvu" - -#: Frame.cpp:938 -#, c-format -msgid "EDEWM: Internal bug, when restacking (%d != %d)! Exiting... " -msgstr "" - -#: Titlebar.cpp:215 -msgid "Sticky" -msgstr "Lepkavý" - -#: Titlebar.cpp:275 Titlebar.cpp:320 -msgid "Set size" -msgstr "" - -#: Titlebar.cpp:276 -msgid "Set size to window:" -msgstr "" - -#: Titlebar.cpp:285 -msgid "width:" -msgstr "" - -#: Titlebar.cpp:287 -msgid "height:" -msgstr "" - -#: Titlebar.cpp:291 -msgid "&OK" -msgstr "" - -#: Titlebar.cpp:294 -msgid "&Cancel" -msgstr "" - -#: Titlebar.cpp:318 Titlebar.cpp:331 -msgid "Maximize" -msgstr "Maximalizovať" - -#: Titlebar.cpp:319 -msgid "Minimize" -msgstr "Minimalizovať" - -#: Titlebar.cpp:321 -msgid "To Desktop" -msgstr "Na plochu" - -#: Titlebar.cpp:322 -msgid "Kill" -msgstr "Ukončiť" - -#: Titlebar.cpp:323 -msgid "Close" -msgstr "Zavrieť" - -#: Titlebar.cpp:330 -msgid "Restore" -msgstr "Obnoviť" - -#: Windowmanager.cpp:90 -#, c-format -msgid "Another window manager is running. You must exit it before running %s." -msgstr "" -"Práve beží už iný manažér okien. Musíte ho ukončiť a chcete spustiť %s." diff --git a/edewm/locale/sr.po b/edewm/locale/sr.po deleted file mode 100644 index dd8865c..0000000 --- a/edewm/locale/sr.po +++ /dev/null @@ -1,87 +0,0 @@ -# EDEWM - Prevod na srpski jezik -# Copyright (C) 2002 EDE Team -# Dejan Lekic Dejan Lekic , 2002. -# -msgid "" -msgstr "" -"Project-Id-Version: EDEWM 0.1\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2005-02-04 12:33+0100\n" -"PO-Revision-Date: 2002-11-21 08:26+0100\n" -"Last-Translator: Dejan Lekic \n" -"Language-Team: LINUKS.org T.T. \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: Desktop.cpp:138 Desktop.cpp:180 -#, c-format -msgid "Workspace %d" -msgstr "Радни простор %d" - -#: Frame.cpp:106 -msgid "Untitled" -msgstr "Неименован" - -#: Frame.cpp:938 -#, c-format -msgid "EDEWM: Internal bug, when restacking (%d != %d)! Exiting... " -msgstr "" - -#: Titlebar.cpp:215 -msgid "Sticky" -msgstr "Стики" - -#: Titlebar.cpp:275 Titlebar.cpp:320 -msgid "Set size" -msgstr "" - -#: Titlebar.cpp:276 -msgid "Set size to window:" -msgstr "" - -#: Titlebar.cpp:285 -msgid "width:" -msgstr "" - -#: Titlebar.cpp:287 -msgid "height:" -msgstr "" - -#: Titlebar.cpp:291 -msgid "&OK" -msgstr "" - -#: Titlebar.cpp:294 -msgid "&Cancel" -msgstr "" - -#: Titlebar.cpp:318 Titlebar.cpp:331 -msgid "Maximize" -msgstr "Максимизуј" - -#: Titlebar.cpp:319 -msgid "Minimize" -msgstr "Минимизуј" - -#: Titlebar.cpp:321 -msgid "To Desktop" -msgstr "На десктоп" - -#: Titlebar.cpp:322 -msgid "Kill" -msgstr "" - -#: Titlebar.cpp:323 -msgid "Close" -msgstr "Затвори" - -#: Titlebar.cpp:330 -msgid "Restore" -msgstr "Врати" - -#: Windowmanager.cpp:90 -#, c-format -msgid "Another window manager is running. You must exit it before running %s." -msgstr "" -"Други менаџер прозора је активан. Мораћете га угасити пре покретања %s." diff --git a/edewm/main.cpp b/edewm/main.cpp deleted file mode 100644 index 0be914e..0000000 --- a/edewm/main.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/* - * $Id: main.cpp 1671 2006-07-11 14:07:43Z karijes $ - * - * Edewm, window manager - * Part of Equinox Desktop Environment (EDE). - * Copyright (c) 2000-2006 EDE Authors. - * - * This program is licenced under terms of the - * GNU General Public Licence version 2 or newer. - * See COPYING for details. - */ - -#include "Windowmanager.h" -#include "debug.h" -//#include - -#include -#include - -#include -#include -#include -#include - -bool got_signal = false; - - -void exit_signal(int signum) -{ - EWARNING("* Exiting (got signal %d) *", signum); - got_signal = true; -} - -int main(int argc, char ** argv) -{ - signal(SIGTERM, exit_signal); - signal(SIGKILL, exit_signal); - signal(SIGINT, exit_signal); - - Fl::args(argc, argv); - //fl_init_locale_support("edewm", PREFIX"/share/locale"); - - WindowManager::init(argc, argv); - Fl_Style::load_theme(); - - while(!got_signal && WindowManager::instance()->running()) - { - Fl::wait(); - WindowManager::instance()->idle(); - } - - WindowManager::shutdown(); - return 0; -} diff --git a/edewm/mask.xpm b/edewm/mask.xpm deleted file mode 100644 index c8a9cae..0000000 --- a/edewm/mask.xpm +++ /dev/null @@ -1,15 +0,0 @@ -/* XPM */ -static char * mask_xpm[] = { -"10 10 2 1", -" c None", -". c #000000", -"........ ", -"...... ", -"..... ", -".... ", -"... ", -".. ", -". ", -". ", -" ", -" "}; diff --git a/edewm/tests/basic_moveresize.cpp b/edewm/tests/basic_moveresize.cpp deleted file mode 100644 index 01ce29f..0000000 --- a/edewm/tests/basic_moveresize.cpp +++ /dev/null @@ -1,95 +0,0 @@ -#include -#include -#include -#include -#include -#include - -#define MRSIZE 2 - -void cb_move_left(Fl_Widget*, void* ww) -{ - Fl_Window* win = (Fl_Window*) ww; - printf("move left(before) x: %i y: %i\n", win->x(), win->y()); - win->position(win->x() - MRSIZE, win->y()); - printf("move left(after) x: %i y: %i\n", win->x(), win->y()); -} - -void cb_move_right(Fl_Widget*, void* ww) -{ - Fl_Window* win = (Fl_Window*) ww; - printf("move right(before) x: %i y: %i\n", win->x(), win->y()); - win->position(win->x() + MRSIZE, win->y()); - printf("move right(after) x: %i y: %i\n", win->x(), win->y()); -} - -void cb_move_up(Fl_Widget*, void* ww) -{ - Fl_Window* win = (Fl_Window*) ww; - printf("move up(before) x: %i y: %i\n", win->x(), win->y()); - win->position(win->x(), win->y() - MRSIZE); - printf("move up(after) x: %i y: %i\n", win->x(), win->y()); -} - -void cb_move_down(Fl_Widget*, void* ww) -{ - Fl_Window* win = (Fl_Window*) ww; - printf("move down(before) x: %i y: %i\n", win->x(), win->y()); - win->position(win->x(), win->y() + MRSIZE); - printf("move down(after) x: %i y: %i\n", win->x(), win->y()); -} - - -int main (int argc, char **argv) -{ - Fl_Window* win = new Fl_Window(300, 290, "Basic Window Operations"); - win->shortcut(0xff1b); - - Fl_Box* bbb = new Fl_Box(10, 10, 280, 50, "Below buttons should apply changes to this window"); - bbb->align(FL_ALIGN_INSIDE|FL_ALIGN_WRAP); - - Fl_Group* move_group = new Fl_Group(10, 85, 280, 75, "Move"); - move_group->box(FL_ENGRAVED_BOX); - move_group->align(FL_ALIGN_TOP|FL_ALIGN_LEFT); - - Fl_Button* move_up = new Fl_Button(130, 10, 25, 25, "^"); - move_up->callback(cb_move_up, win); - //move_left->label_type(FL_SYMBOL_LABEL); - - Fl_Button* move_down = new Fl_Button(130, 35, 25, 25, "v"); - move_down->callback(cb_move_down, win); - //move_right->label_type(FL_SYMBOL_LABEL); - - Fl_Button* move_left = new Fl_Button(105, 35, 25, 25, "<"); - move_left->callback(cb_move_left, win); - //move_up->label_type(FL_SYMBOL_LABEL); - - Fl_Button* move_right = new Fl_Button(155, 35, 25, 25, ">"); - move_right->callback(cb_move_right, win); - //move_down->label_type(FL_SYMBOL_LABEL); - - move_group->end(); - - - Fl_Group* resize_group = new Fl_Group(10, 190, 280, 75, "Resize"); - resize_group->box(FL_ENGRAVED_BOX); - resize_group->align(FL_ALIGN_TOP|FL_ALIGN_LEFT); - - Fl_Button* resize_up = new Fl_Button(130, 10, 25, 25, "^"); - //resize_left->label_type(FL_SYMBOL_LABEL); - - Fl_Button* resize_down = new Fl_Button(130, 35, 25, 25, "v"); - //resize_right->label_type(FL_SYMBOL_LABEL); - - Fl_Button* resize_left = new Fl_Button(105, 35, 25, 25, "<"); - //resize_up->label_type(FL_SYMBOL_LABEL); - - Fl_Button* resize_right = new Fl_Button(155, 35, 25, 25, ">"); - //resize_down->label_type(FL_SYMBOL_LABEL); - - resize_group->end(); - - win->end(); - win->show(argc, argv); - return Fl::run(); -} diff --git a/edewm/tests/basic_moveresize.fld b/edewm/tests/basic_moveresize.fld deleted file mode 100644 index d7dd61c..0000000 --- a/edewm/tests/basic_moveresize.fld +++ /dev/null @@ -1,61 +0,0 @@ -# data file for the eFLTK User Interface Designer (eFLUID) -version 2.0003 -header_name {.h} -code_name {.cpp} -gridx 5 -gridy 5 -snap 3 -Function {} {open -} { - Fl_Window {} { - label {Basic Window Operations} open - xywh {361 170 300 290} resizable visible - } { - Fl_Box {} { - label {Below buttons should apply changes to this window} - xywh {10 10 280 50} align FL_ALIGN_INSIDE|FL_ALIGN_WRAP - } - Fl_Group {} { - label Move open - xywh {10 85 280 75} align FL_ALIGN_TOP|FL_ALIGN_LEFT box ENGRAVED_BOX - } { - Fl_Button {} { - label {@<} - xywh {130 10 25 25} label_type SYMBOL_LABEL - } - Fl_Button {} { - label {@<} - xywh {130 35 25 25} label_type SYMBOL_LABEL - } - Fl_Button {} { - label {@<} - xywh {105 35 25 25} label_type SYMBOL_LABEL - } - Fl_Button {} { - label {@>} - xywh {155 35 25 25} label_type SYMBOL_LABEL - } - } - Fl_Group {} { - label Resize open selected - xywh {10 190 280 75} align FL_ALIGN_TOP|FL_ALIGN_LEFT box ENGRAVED_BOX - } { - Fl_Button {} { - label {@<} - xywh {130 10 25 25} label_type SYMBOL_LABEL - } - Fl_Button {} { - label {@<} - xywh {130 35 25 25} label_type SYMBOL_LABEL - } - Fl_Button {} { - label {@<} - xywh {105 35 25 25} label_type SYMBOL_LABEL - } - Fl_Button {} { - label {@>} - xywh {155 35 25 25} label_type SYMBOL_LABEL - } - } - } -} diff --git a/edewm/tests/demo.ogg b/edewm/tests/demo.ogg deleted file mode 100644 index 4091a9f..0000000 Binary files a/edewm/tests/demo.ogg and /dev/null differ diff --git a/edewm/tests/sound_test.cpp b/edewm/tests/sound_test.cpp deleted file mode 100644 index e000351..0000000 --- a/edewm/tests/sound_test.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include "../Sound.h" -#include - -int main() -{ - puts("playing...\n"); - SoundSystem ss; - ss.init(); - ss.play("demo.ogg"); - ss.shutdown(); - puts("done\n"); - - return 0; -} diff --git a/edewm/tests/testpositions.sh b/edewm/tests/testpositions.sh deleted file mode 100644 index 85d4c9d..0000000 --- a/edewm/tests/testpositions.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh -# -# $Id: testpositions.sh 1672 2006-07-11 14:13:16Z karijes $ -# -#= -#= Usage: testpositions.sh [OPTIONS] -#= -#= Test position where will be placed newly created windows. -#= -#= Options: -#= -p [program] run program -#= -t [number] run [program] [number] times -#= -h show this help -#= -#= Example: testpositions.sh -e gvim -t 1000, which -#= will run 1000 instances of gvim. -#= -#= NOTE: if you try this with some heavier programs -#= (mozilla, ooffice, etc.) swapping and possible X crashes -#= are not due window manager. Just warned you ! -#= - -PROGRAM="xterm" -TIMES="10" - -help() -{ - sed -ne "/^#= /{ s/^#= //p }" $0 - exit 0 -} - -main() -{ - if [ $# -eq 0 ]; then - help - fi - - argv=$@ - for argv do - case $argv in - -h) - help - continue;; - -p) - unset PROGRAM - continue;; - -t) - unset TIMES - continue;; - esac - - if [ "$PROGRAM" = "" ];then - PROGRAM=$argv - continue - elif [ "$TIMES" = "" ];then - TIMES=$argv - else - echo "Bad parameter '$argv'." - echo "Run $0 -h for options." - exit 0 - fi - done - - for((i = 1; i <= $TIMES; i++)) - do - `$PROGRAM`& - done -} - -main $@