~ctwm/ctwm/trunk

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/*
 * Copyright 1992, 2005, 2007 Stefan Monnier.
 *
 * $Id: otp.h,v 1.7 2005/04/08 16:59:17 monnier Exp $
 *
 * handles all the OnTopPriority-related issues.
 *
 */

#ifndef _CTWM_OTP_H
#define _CTWM_OTP_H

/* kind of window */
typedef enum WinType { WinWin, IconWin } WinType;

/* Flags that might alter OTP (currently only EWMH bits) */
#ifdef EWMH
#define OTP_AFLAG_ABOVE      (1 << 0)
#define OTP_AFLAG_BELOW      (1 << 1)
#define OTP_AFLAG_FULLSCREEN (1 << 2)
#endif


/* Wrapper functions to maintain the internal list uptodate.  */
int ReparentWindow(Display *display, TwmWindow *twm_win,
                   WinType wintype, Window parent, int x, int y);
void ReparentWindowAndIcon(Display *display, TwmWindow *twm_win,
                           Window parent, int win_x, int win_y,
                           int icon_x, int icon_y);

/* misc functions that are not specific to OTP */
bool isTransientOf(TwmWindow *, TwmWindow *);
bool isSmallTransientOf(TwmWindow *, TwmWindow *);
bool isGroupLeaderOf(TwmWindow *, TwmWindow *);
bool isGroupLeader(TwmWindow *);

/* functions to "move" windows */
void OtpRaise(TwmWindow *, WinType);
void OtpLower(TwmWindow *, WinType);
void OtpRaiseLower(TwmWindow *, WinType);
void OtpTinyRaise(TwmWindow *, WinType);
void OtpTinyLower(TwmWindow *, WinType);
void OtpCirculateSubwindows(VirtualScreen *vs, int direction);
void OtpHandleCirculateNotify(VirtualScreen *vs, TwmWindow *twm_win,
                              WinType wintype, int place);

/* functions to change a window's OTP value */
void OtpSetPriority(TwmWindow *, WinType, int, int);
void OtpChangePriority(TwmWindow *, WinType, int);
void OtpSwitchPriority(TwmWindow *, WinType);
void OtpToggleSwitching(TwmWindow *, WinType);
void OtpRecomputePrefs(TwmWindow *);
void OtpForcePlacement(TwmWindow *, int, TwmWindow *);

void OtpReassignIcon(TwmWindow *twm_win, Icon *old_icon);
void OtpFreeIcon(TwmWindow *twm_win);

void OtpSetAflagMask(TwmWindow *twm_win, unsigned mask, unsigned setto);
void OtpSetAflag(TwmWindow *twm_win, unsigned flag);
void OtpClearAflag(TwmWindow *twm_win, unsigned flag);
void OtpStashAflagsFirstTime(TwmWindow *twm_win);
void OtpRestackWindow(TwmWindow *twm_win);

void OtpUnfocusWindow(TwmWindow *twm_win);
void OtpFocusWindow(TwmWindow *twm_win);

/* functions to manage the preferences. The second arg specifies icon prefs */
void OtpScrInitData(ScreenInfo *);
name_list **OtpScrSwitchingL(ScreenInfo *, WinType);
name_list **OtpScrPriorityL(ScreenInfo *, WinType, int);
void OtpScrSetSwitching(ScreenInfo *, WinType, bool);
void OtpScrSetZero(ScreenInfo *, WinType, int);

/* functions to inform OTP-manager of window creation/destruction */
void OtpAdd(TwmWindow *, WinType);
void OtpRemove(TwmWindow *, WinType);

/* Iterators.  */
TwmWindow *OtpBottomWin(void);
TwmWindow *OtpTopWin(void);
TwmWindow *OtpNextWinUp(TwmWindow *);
TwmWindow *OtpNextWinDown(TwmWindow *);

/* Other access functions */
int OtpEffectiveDisplayPriority(TwmWindow *twm_win);
int OtpEffectivePriority(TwmWindow *twm_win);
bool OtpIsFocusDependent(TwmWindow *twm_win);

/* Other debugging functions */
bool OtpCheckConsistency(void);

#endif /* _CTWM_OTP_H */