File: manage.h

package info (click to toggle)
notion 4.0.3%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,656 kB
  • sloc: ansic: 47,365; sh: 2,093; makefile: 594; perl: 270
file content (112 lines) | stat: -rw-r--r-- 3,540 bytes parent folder | download | duplicates (3)
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
/*
 * ion/ioncore/manage.h
 *
 * Copyright (c) Tuomo Valkonen 1999-2007.
 *
 * See the included file LICENSE for details.
 */

#ifndef ION_IONCORE_MANAGE_H
#define ION_IONCORE_MANAGE_H

#include <libextl/extl.h>
#include "common.h"

INTRSTRUCT(WManageParams);

#include "clientwin.h"
#include "attach.h"
#include "rectangle.h"
#include "extlconv.h"
#include "pholder.h"


#define MANAGEPARAMS_INIT                                                \
  {FALSE, FALSE, FALSE, FALSE, FALSE, ForgetGravity, {0, 0, 0, 0}, NULL}

enum{
    MANAGE_PRIORITY_NONE,
    MANAGE_PRIORITY_LOW,
    MANAGE_PRIORITY_NORMAL,
    MANAGE_PRIORITY_GROUP,
    MANAGE_PRIORITY_NO,
    /* Special */
    MANAGE_PRIORITY_NOREDIR
};

#define MANAGE_PRIORITY_OK(PRIORITY, OUR)                        \
    ((PRIORITY) <= (OUR) || (PRIORITY)==MANAGE_PRIORITY_NOREDIR)

#define MANAGE_PRIORITY_SUB(PRIORITY, OUR)      \
    ((PRIORITY)==MANAGE_PRIORITY_NOREDIR        \
     ? MANAGE_PRIORITY_NO                       \
     : (PRIORITY) < (OUR) ? (OUR) : (PRIORITY))

#define MANAGE_PRIORITY_SUBX(PRIORITY, OUR)                    \
    ((PRIORITY)==MANAGE_PRIORITY_NOREDIR || (OUR) < (PRIORITY) \
     ? MANAGE_PRIORITY_NO                                      \
     : MANAGE_PRIORITY_NONE)


DECLSTRUCT(WManageParams){
    bool switchto;
    bool jumpto;
    bool userpos;
    bool dockapp;
    bool maprq;
    int gravity;
    WRectangle geom;
    WClientWin *tfor;
};


typedef WRegion *WRegionIterator(void *st);


extern ExtlTab manageparams_to_table(const WManageParams *mp);


extern WScreen *clientwin_find_suitable_screen(WClientWin *cwin,
                                               const WManageParams *param);

/* Manage */

extern bool clientwin_do_manage_default(WClientWin *cwin,
                                        const WManageParams *param);

extern bool region_manage_clientwin(WRegion *reg, WClientWin *cwin,
                                    const WManageParams *par, int redir);

DYNFUN WPHolder *region_prepare_manage(WRegion *reg, const WClientWin *cwin,
                                       const WManageParams *par, int redir);

extern WPHolder *region_prepare_manage_default(WRegion *reg,
                                               const WClientWin *cwin,
                                               const WManageParams *par,
                                               int redir);


extern WPHolder *region_prepare_manage_transient(WRegion *reg,
                                                 const WClientWin *cwin,
                                                 const WManageParams *param,
                                                 int unused);

extern WPHolder *region_prepare_manage_transient_default(WRegion *reg,
                                                         const WClientWin *cwin,
                                                         const WManageParams *param,
                                                         int unused);

/* Rescue */

INTRSTRUCT(WRescueInfo);

/* if ph is given, it is used, otherwise one is looked for when needed */
extern bool region_rescue(WRegion *reg, WPHolder *ph);
extern bool region_rescue_needed(WRegion *reg);
extern bool region_rescue_clientwins(WRegion *reg, WRescueInfo *info);
extern bool region_rescue_child_clientwins(WRegion *reg, WRescueInfo *info);
extern bool region_rescue_some_clientwins(WRegion *reg, WRescueInfo *info,
                                          WRegionIterator *iter, void *st);


#endif /* ION_IONCORE_MANAGE_H */