|
20 | 20 | #include <assert.h>
|
21 | 21 | #include <stdlib.h>
|
22 | 22 |
|
23 |
| -#include "widget.h" |
| 23 | +#include "aux.h" |
24 | 24 | #include "cms.h"
|
| 25 | +#include "widget.h" |
25 | 26 |
|
26 | 27 | struct background {
|
27 | 28 | Pixmap pix;
|
@@ -54,27 +55,6 @@ struct palette p_spectr = {{ 120.0, 100.0, 75.0 }, { 0.0, 100.0, 25.0 }};
|
54 | 55 | struct palette p_shadow = {{ 120.0, 100.0, 10.0 }, { 0.0, 100.0, 10.0 }};
|
55 | 56 | struct palette p_waterfall = {{ 210.0, 75.0, 0.0 }, { 180.0, 100.0, 100.0 }};
|
56 | 57 |
|
57 |
| -static void |
58 |
| -blit(Display *d, Drawable p, GC gc, XRectangle r) |
59 |
| -{ |
60 |
| - XCopyArea(d, p, p, gc, 0, 0, r.width, r.height - 1, 0, 1); |
61 |
| -} |
62 |
| - |
63 |
| -static void |
64 |
| -clear(Display *d, Drawable p, GC gc, XRectangle r) |
65 |
| -{ |
66 |
| - XSetForeground(d, gc, BlackPixel(d, DefaultScreen(d))); |
67 |
| - XFillRectangle(d, p, gc, 0, 0, r.width, r.height); |
68 |
| -} |
69 |
| - |
70 |
| -static void |
71 |
| -copy(Display *d, Drawable from, Drawable to, GC gc, XRectangle r, Drawable mask) |
72 |
| -{ |
73 |
| - XSetClipMask(d, gc, mask); |
74 |
| - XCopyArea(d, from, to, gc, 0, 0, r.width, r.height, 0, 0); |
75 |
| - XSetClipMask(d, gc, None); |
76 |
| -} |
77 |
| - |
78 | 58 | void
|
79 | 59 | draw_panel(struct panel *p)
|
80 | 60 | {
|
@@ -117,20 +97,13 @@ draw_panel(struct panel *p)
|
117 | 97 | p->bg->mask);
|
118 | 98 | }
|
119 | 99 |
|
120 |
| -static void |
121 |
| -flip(Display *d, struct subwin *p) |
122 |
| -{ |
123 |
| - XCopyArea(d, p->pix, p->win, p->gc, |
124 |
| - 0, 0, p->geo.width, p->geo.height, 0, 0); |
125 |
| -} |
126 |
| - |
127 | 100 | void
|
128 | 101 | flip_panel(struct panel *p)
|
129 | 102 | {
|
130 | 103 | /* flip spectrogram */
|
131 |
| - flip(p->dsp, p->sp); |
| 104 | + copy(p->dsp, p->sp->pix, p->sp->win, p->sp->gc, p->sp->geo, None); |
132 | 105 | /* flip waterfall */
|
133 |
| - flip(p->dsp, p->wf); |
| 106 | + copy(p->dsp, p->wf->pix, p->wf->win, p->wf->gc, p->wf->geo, None); |
134 | 107 | }
|
135 | 108 |
|
136 | 109 | static void
|
|
0 commit comments