struct xevent_watcher;
template<class watcher>
-struct event_vec : vector<watcher *> {
+struct event_vec : vector<watcher *>
+{
void erase_unordered (unsigned int pos)
{
watcher *w = (*this)[this->size () - 1];
}
};
-struct rxvt_watcher {
+struct rxvt_watcher
+{
int active; /* 0 == inactive, else index into respective vector */
bool is_active () { return active; }
rxvt_watcher () : active (0) { }
};
-struct refcounted {
+struct refcounted
+{
int referenced;
char *id;
};
template<class T>
-struct refcache : vector<T *> {
+struct refcache : vector<T *>
+{
T *get (const char *id);
void put (T *obj);
void clear ();
struct rxvt_screen;
-struct rxvt_drawable {
+struct rxvt_drawable
+{
rxvt_screen *screen;
Drawable drawable;
operator Drawable() { return drawable; }
/////////////////////////////////////////////////////////////////////////////
#ifdef USE_XIM
-struct rxvt_xim : refcounted {
+struct rxvt_xim : refcounted
+{
void destroy ();
rxvt_display *display;
};
#endif
-struct rxvt_screen {
+struct rxvt_screen
+{
rxvt_display *display;
Display *dpy;
int depth;
void clear ();
};
-struct rxvt_display : refcounted {
+struct rxvt_display : refcounted
+{
event_vec<xevent_watcher> xw;
ev::io x_ev; void x_cb (ev::io &w, int revents);
};
#endif
-struct xevent_watcher : rxvt_watcher, callback<void (XEvent &)> {
+struct xevent_watcher : rxvt_watcher, callback<void (XEvent &)>
+{
Window window;
void start (rxvt_display *display, Window window)
typedef unsigned long Pixel;
-struct rgba {
+struct rgba
+{
unsigned short r, g, b, a;
enum { MIN_CC = 0x0000, MAX_CC = 0xffff };
{ }
};
-struct rxvt_color {
+struct rxvt_color
+{
#if XFT
XftColor c;
#else