2 * Copyright (C) 2012, The AROS Development Team
4 * Author: Jason S. McMullan <jason.mcmullan@gmail.com>
6 * Licensed under the AROS PUBLIC LICENSE (APL) Version 1.1
8 #include <proto/graphics.h>
9 #include <proto/layers.h>
11 #include "workbook_intern.h"
13 struct Region
*wbClipWindow(struct WorkbookBase
*wb
, struct Window
*win
)
17 /* Install new clip region */
18 if ((clip
= NewRegion())) {
19 struct Rectangle rect
= {
20 .MinX
= win
->BorderLeft
,
21 .MinY
= win
->BorderTop
,
22 .MaxX
= win
->Width
- win
->BorderRight
- 1,
23 .MaxY
= win
->Height
- win
->BorderBottom
- 1,
25 if (!OrRectRegion(clip
, &rect
)) {
31 /* Install new clip region */
32 return InstallClipRegion(win
->WLayer
, clip
);
35 void wbUnclipWindow(struct WorkbookBase
*wb
, struct Window
*win
, struct Region
*clip
)
37 clip
= InstallClipRegion(win
->WLayer
, clip
);