10bbfda8aSnia/* 20bbfda8aSnia * Copyright 1992, 2005, 2007 Stefan Monnier. 30bbfda8aSnia * 40bbfda8aSnia * $Id: otp.h,v 1.1.1.1 2021/04/11 08:36:51 nia Exp $ 50bbfda8aSnia * 60bbfda8aSnia * handles all the OnTopPriority-related issues. 70bbfda8aSnia * 80bbfda8aSnia */ 90bbfda8aSnia 100bbfda8aSnia#ifndef _CTWM_OTP_H 110bbfda8aSnia#define _CTWM_OTP_H 120bbfda8aSnia 130bbfda8aSnia/* kind of window */ 140bbfda8aSniatypedef enum WinType { WinWin, IconWin } WinType; 150bbfda8aSnia 160bbfda8aSnia/* Flags that might alter OTP (currently only EWMH bits) */ 170bbfda8aSnia#ifdef EWMH 180bbfda8aSnia#define OTP_AFLAG_ABOVE (1 << 0) 190bbfda8aSnia#define OTP_AFLAG_BELOW (1 << 1) 200bbfda8aSnia#define OTP_AFLAG_FULLSCREEN (1 << 2) 210bbfda8aSnia#endif 220bbfda8aSnia 230bbfda8aSnia 240bbfda8aSnia/* Wrapper functions to maintain the internal list uptodate. */ 250bbfda8aSniaint ReparentWindow(Display *display, TwmWindow *twm_win, 260bbfda8aSnia WinType wintype, Window parent, int x, int y); 270bbfda8aSniavoid ReparentWindowAndIcon(Display *display, TwmWindow *twm_win, 280bbfda8aSnia Window parent, int win_x, int win_y, 290bbfda8aSnia int icon_x, int icon_y); 300bbfda8aSnia 310bbfda8aSnia/* misc functions that are not specific to OTP */ 320bbfda8aSniabool isTransientOf(TwmWindow *, TwmWindow *); 330bbfda8aSniabool isSmallTransientOf(TwmWindow *, TwmWindow *); 340bbfda8aSniabool isGroupLeaderOf(TwmWindow *, TwmWindow *); 350bbfda8aSniabool isGroupLeader(TwmWindow *); 360bbfda8aSnia 370bbfda8aSnia/* functions to "move" windows */ 380bbfda8aSniavoid OtpRaise(TwmWindow *, WinType); 390bbfda8aSniavoid OtpLower(TwmWindow *, WinType); 400bbfda8aSniavoid OtpRaiseLower(TwmWindow *, WinType); 410bbfda8aSniavoid OtpTinyRaise(TwmWindow *, WinType); 420bbfda8aSniavoid OtpTinyLower(TwmWindow *, WinType); 430bbfda8aSniavoid OtpCirculateSubwindows(VirtualScreen *vs, int direction); 440bbfda8aSniavoid OtpHandleCirculateNotify(VirtualScreen *vs, TwmWindow *twm_win, 450bbfda8aSnia WinType wintype, int place); 460bbfda8aSnia 470bbfda8aSnia/* functions to change a window's OTP value */ 480bbfda8aSniavoid OtpSetPriority(TwmWindow *, WinType, int, int); 490bbfda8aSniavoid OtpChangePriority(TwmWindow *, WinType, int); 500bbfda8aSniavoid OtpSwitchPriority(TwmWindow *, WinType); 510bbfda8aSniavoid OtpToggleSwitching(TwmWindow *, WinType); 520bbfda8aSniavoid OtpRecomputePrefs(TwmWindow *); 530bbfda8aSniavoid OtpForcePlacement(TwmWindow *, int, TwmWindow *); 540bbfda8aSnia 550bbfda8aSniavoid OtpReassignIcon(TwmWindow *twm_win, Icon *old_icon); 560bbfda8aSniavoid OtpFreeIcon(TwmWindow *twm_win); 570bbfda8aSnia 580bbfda8aSniavoid OtpSetAflagMask(TwmWindow *twm_win, unsigned mask, unsigned setto); 590bbfda8aSniavoid OtpSetAflag(TwmWindow *twm_win, unsigned flag); 600bbfda8aSniavoid OtpClearAflag(TwmWindow *twm_win, unsigned flag); 610bbfda8aSniavoid OtpStashAflagsFirstTime(TwmWindow *twm_win); 620bbfda8aSniavoid OtpRestackWindow(TwmWindow *twm_win); 630bbfda8aSnia 640bbfda8aSniavoid OtpUnfocusWindow(TwmWindow *twm_win); 650bbfda8aSniavoid OtpFocusWindow(TwmWindow *twm_win); 660bbfda8aSnia 670bbfda8aSnia/* functions to manage the preferences. The second arg specifies icon prefs */ 680bbfda8aSniavoid OtpScrInitData(ScreenInfo *); 690bbfda8aSnianame_list **OtpScrSwitchingL(ScreenInfo *, WinType); 700bbfda8aSnianame_list **OtpScrPriorityL(ScreenInfo *, WinType, int); 710bbfda8aSniavoid OtpScrSetSwitching(ScreenInfo *, WinType, bool); 720bbfda8aSniavoid OtpScrSetZero(ScreenInfo *, WinType, int); 730bbfda8aSnia 740bbfda8aSnia/* functions to inform OTP-manager of window creation/destruction */ 750bbfda8aSniavoid OtpAdd(TwmWindow *, WinType); 760bbfda8aSniavoid OtpRemove(TwmWindow *, WinType); 770bbfda8aSnia 780bbfda8aSnia/* Iterators. */ 790bbfda8aSniaTwmWindow *OtpBottomWin(void); 800bbfda8aSniaTwmWindow *OtpTopWin(void); 810bbfda8aSniaTwmWindow *OtpNextWinUp(TwmWindow *); 820bbfda8aSniaTwmWindow *OtpNextWinDown(TwmWindow *); 830bbfda8aSnia 840bbfda8aSnia/* Other access functions */ 850bbfda8aSniaint OtpEffectiveDisplayPriority(TwmWindow *twm_win); 860bbfda8aSniaint OtpEffectivePriority(TwmWindow *twm_win); 870bbfda8aSniabool OtpIsFocusDependent(TwmWindow *twm_win); 880bbfda8aSnia 890bbfda8aSnia/* Other debugging functions */ 900bbfda8aSniabool OtpCheckConsistency(void); 910bbfda8aSnia 920bbfda8aSnia#endif /* _CTWM_OTP_H */ 93