JWM Source Documentation
spacer.c
Go to the documentation of this file.
1 
10 #include "jwm.h"
11 #include "main.h"
12 #include "spacer.h"
13 #include "tray.h"
14 
15 static void Create(TrayComponentType *cp);
16 static void Destroy(TrayComponentType *cp);
17 static void SetSize(TrayComponentType *cp, int width, int height);
18 static void Resize(TrayComponentType *cp);
19 
21 TrayComponentType *CreateSpacer(int width, int height)
22 {
23 
25 
26  if(JUNLIKELY(width < 0)) {
27  width = 0;
28  }
29  if(JUNLIKELY(height < 0)) {
30  height = 0;
31  }
32 
33  cp = CreateTrayComponent();
34  cp->requestedWidth = width;
35  cp->requestedHeight = height;
36 
37  cp->Create = Create;
38  cp->Destroy = Destroy;
39  cp->SetSize = SetSize;
40  cp->Resize = Resize;
41 
42  return cp;
43 
44 }
45 
47 void SetSize(TrayComponentType *cp, int width, int height)
48 {
49  if(width == 0) {
50  cp->width = cp->requestedWidth;
51  cp->height = height;
52  } else {
53  cp->width = width;
54  cp->height = cp->requestedHeight;
55  }
56 }
57 
60 {
62  rootDepth);
64 }
65 
68 {
69  if(cp->pixmap != None) {
71  }
73  rootDepth);
75 }
76 
79 {
80  if(cp->pixmap != None) {
82  }
83 }
84 

joewing.net / Projects / JWM