mirror of
https://github.com/edeproject/ede.git
synced 2023-08-10 21:13:03 +03:00
Removing unfinished wm
This commit is contained in:
parent
855d49fdf4
commit
b508ba671c
243
edewm/Atoms.cpp
243
edewm/Atoms.cpp
@ -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 <efltk/x.h>
|
||||
|
||||
// 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<Atom, const char*>& 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));
|
||||
}
|
||||
|
131
edewm/Atoms.h
131
edewm/Atoms.h
@ -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 <map>
|
||||
#endif
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
|
||||
// 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<Atom, const char*>& atoms_map);
|
||||
#else
|
||||
void InitAtoms(Display* display);
|
||||
#endif
|
||||
void SetSupported(Window root);
|
||||
|
||||
#endif // __ATOMS_H__
|
128
edewm/COMPLIANCE
128
edewm/COMPLIANCE
@ -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.
|
298
edewm/Cursor.cpp
298
edewm/Cursor.cpp
@ -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 <efltk/x.h>
|
||||
#include <X11/cursorfont.h>
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#ifdef _DEBUG
|
||||
#include <map>
|
||||
std::map<CursorType, const char*> 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];
|
||||
}
|
@ -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 <X11/Xlib.h> // 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
|
@ -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 <efltk/Fl_PtrList.h>
|
||||
|
||||
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
|
508
edewm/Events.cpp
508
edewm/Events.cpp
@ -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 <assert.h>
|
||||
|
||||
|
||||
#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;
|
||||
}
|
@ -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 <X11/Xlib.h> // 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
|
1700
edewm/Frame.cpp
1700
edewm/Frame.cpp
File diff suppressed because it is too large
Load Diff
344
edewm/Frame.h
344
edewm/Frame.h
@ -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 <X11/Xlib.h>
|
||||
#include <efltk/Fl_Window.h>
|
||||
#include <efltk/Fl_Box.h>
|
||||
|
||||
#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
|
512
edewm/Hints.cpp
512
edewm/Hints.cpp
@ -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 <efltk/x.h>
|
||||
#include <X11/Xproto.h> // CARD32
|
||||
#include <assert.h>
|
||||
|
||||
#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);
|
||||
}
|
@ -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 <X11/Xlib.h>
|
||||
|
||||
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
|
@ -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) ;
|
173
edewm/Sound.cpp
173
edewm/Sound.cpp
@ -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 <vorbis/vorbisfile.h>
|
||||
#include <vorbis/codec.h>
|
||||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h> // free
|
||||
#include <string.h> // 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;
|
||||
}
|
@ -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 <ao/ao.h>
|
||||
#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
|
@ -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 <efltk/fl_draw.h>
|
||||
#include <efltk/Fl.h>
|
||||
#include <efltk/Fl_Image.h>
|
||||
#include <efltk/Fl_Locale.h>
|
||||
#include <assert.h>
|
||||
|
||||
#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;
|
||||
}
|
@ -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 <efltk/Fl_Button.h>
|
||||
#include <efltk/Fl_Window.h>
|
||||
#include <efltk/Fl_Box.h>
|
||||
#include <efltk/Fl_Group.h>
|
||||
#include <efltk/Fl_Menu_.h>
|
||||
|
||||
// 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
|
@ -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
|
@ -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 <efltk/x.h>
|
||||
|
||||
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);
|
||||
}
|
@ -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 <X11/Xlib.h>
|
||||
|
||||
void SendMessage(Window win, Atom a, Atom l);
|
||||
|
||||
#endif // _UTILS_H_
|
@ -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 <efltk/Fl_Config.h>
|
||||
#include <assert.h>
|
||||
#include <X11/Xproto.h>
|
||||
#include <X11/cursorfont.h>
|
||||
|
||||
#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
|
@ -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 <efltk/Fl.h>
|
||||
#include <efltk/Fl_Window.h>
|
||||
#include <efltk/x.h>
|
||||
#include <efltk/fl_draw.h>
|
||||
#include <efltk/filename.h>
|
||||
#include <efltk/Fl_Ptr_List.h>
|
||||
#include <efltk/Fl_Config.h>
|
||||
#include <efltk/Fl_Locale.h>
|
||||
|
||||
#include "Cursor.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#include <map>
|
||||
#endif
|
||||
|
||||
#include <list>
|
||||
|
||||
/*
|
||||
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<Frame*> 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<Frame*> window_list;
|
||||
//FrameList<Frame*> 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, const char*> atom_map;
|
||||
std::map<int, const char*> xevent_map;
|
||||
std::map<int, const char*> efltkevent_map;
|
||||
|
||||
void register_events(void);
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
bool ValidateDrawable(Drawable d);
|
||||
|
||||
#endif
|
@ -1,21 +0,0 @@
|
||||
/* XPM */
|
||||
static char * app_xpm[] = {
|
||||
"16 16 2 1",
|
||||
" c None",
|
||||
". c #FF0000",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" .... . ",
|
||||
" .... . ",
|
||||
" .... . ",
|
||||
" .... . ",
|
||||
" ... . ",
|
||||
" . .. ",
|
||||
" . .... ",
|
||||
" . .... ",
|
||||
" . .... ",
|
||||
" . .... ",
|
||||
" . .... ",
|
||||
" ",
|
||||
" "};
|
@ -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 <stdio.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#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
|
||||
}
|
@ -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
|
@ -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. <Laza@Flashmail.com>, 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. <Laza@Flashmail.com>\n"
|
||||
"Language-Team: Finnish <fi@li.org>\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 "Työpöytä %d"
|
||||
|
||||
#: Frame.cpp:106
|
||||
msgid "Untitled"
|
||||
msgstr "Nimetön"
|
||||
|
||||
#: 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 "Työpöydälle:"
|
||||
|
||||
#: 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 järjestelmä käynnissä. Sinun täytyy lopettaa se ennen kuin "
|
||||
"voit ajaa: %s"
|
@ -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 <otto_nemeth@freemail.hu>\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."
|
||||
|
@ -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 <EMAIL@ADDRESS>, 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. <i-am-the-boss@bpdp.org>\n"
|
||||
"Language-Team: id <i-am-the-boss@bpdp.org>\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."
|
@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\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 ""
|
@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\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 ""
|
@ -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 <EMAIL@ADDRESS>, 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 <null@list.ru>\n"
|
||||
"Language-Team: RUSSIAN <LL@li.org>\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."
|
@ -1,87 +0,0 @@
|
||||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR Free Software Foundation, Inc.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 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 <cortex@nextra.sk>\n"
|
||||
"Language-Team: Slovak <LL@li.org>\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."
|
@ -1,87 +0,0 @@
|
||||
# EDEWM - Prevod na srpski jezik
|
||||
# Copyright (C) 2002 EDE Team
|
||||
# Dejan Lekic Dejan Lekic <dejan@nu6.org>, 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 <dejan@nu6.org>\n"
|
||||
"Language-Team: LINUKS.org T.T. <i18n@linuks.org>\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."
|
@ -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 <edeconf.h>
|
||||
|
||||
#include <efltk/filename.h>
|
||||
#include <efltk/fl_draw.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <signal.h>
|
||||
|
||||
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;
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
/* XPM */
|
||||
static char * mask_xpm[] = {
|
||||
"10 10 2 1",
|
||||
" c None",
|
||||
". c #000000",
|
||||
"........ ",
|
||||
"...... ",
|
||||
"..... ",
|
||||
".... ",
|
||||
"... ",
|
||||
".. ",
|
||||
". ",
|
||||
". ",
|
||||
" ",
|
||||
" "};
|
@ -1,95 +0,0 @@
|
||||
#include <efltk/Fl.h>
|
||||
#include <efltk/Fl_Window.h>
|
||||
#include <efltk/Fl_Box.h>
|
||||
#include <efltk/Fl_Group.h>
|
||||
#include <efltk/Fl_Button.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#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();
|
||||
}
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Binary file not shown.
@ -1,14 +0,0 @@
|
||||
#include "../Sound.h"
|
||||
#include <stdio.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
puts("playing...\n");
|
||||
SoundSystem ss;
|
||||
ss.init();
|
||||
ss.play("demo.ogg");
|
||||
ss.shutdown();
|
||||
puts("done\n");
|
||||
|
||||
return 0;
|
||||
}
|
@ -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 $@
|
Loading…
Reference in New Issue
Block a user