diff options
author | Eamon Walsh <ewalsh@tycho.nsa.gov> | 2011-06-01 11:25:15 -0400 |
---|---|---|
committer | Eamon Walsh <ewalsh@tycho.nsa.gov> | 2011-06-01 11:25:15 -0400 |
commit | ec3068a14316948a20141f320d930dd841fd0b9d (patch) | |
tree | ec678ff8b46fe5b0c974376a73cbfcca38f669cb /src | |
parent | 9896e7a7da34e393b5ed2920c7406731382cf508 (diff) |
Remove unused client, buffer, view defines and structure fields.
Diffstat (limited to 'src')
-rw-r--r-- | src/buffer.c | 3 | ||||
-rw-r--r-- | src/buffer.h | 1 | ||||
-rw-r--r-- | src/client.h | 1 | ||||
-rw-r--r-- | src/common.h | 14 | ||||
-rw-r--r-- | src/view.c | 34 | ||||
-rw-r--r-- | src/view.h | 22 |
6 files changed, 16 insertions, 59 deletions
diff --git a/src/buffer.c b/src/buffer.c index 6a9b857..1a6436e 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -85,7 +85,7 @@ buffer_new(struct client *c, const DFBSurfaceDescription *desc, unsigned int fla struct view *v; if (c->num_buffers >= c->max_buffers) - return NULL; /* NITPICKER_ERR_OUT_OF_BUFS */ + return NULL; /* create DirectFB surface */ if (dfb->CreateSurface(dfb, desc, &surf) != DFB_OK) @@ -99,7 +99,6 @@ buffer_new(struct client *c, const DFBSurfaceDescription *desc, unsigned int fla TAILQ_INIT(&b->views); b->id = c->num_buffers; b->client = c; - b->state = STATE_ALLOCATED; b->flags = flags; memcpy(&b->desc, desc, sizeof(DFBSurfaceDescription)); b->bsurface = surf; diff --git a/src/buffer.h b/src/buffer.h index dcdbce6..1f30da9 100644 --- a/src/buffer.h +++ b/src/buffer.h @@ -17,7 +17,6 @@ struct buffer { int id; /* buffer id */ - int state; /* buffer state */ unsigned int flags; /* properties of the buffer */ struct view_tailq views; /* list of views into this buffer */ struct view *bg_view; /* view of entire buffer */ diff --git a/src/client.h b/src/client.h index 7dee5e3..642ddad 100644 --- a/src/client.h +++ b/src/client.h @@ -49,7 +49,6 @@ struct client { unsigned short max_views; /* size of buffer array */ unsigned short max_buffers; /* size of buffer array */ struct view *bg; /* background view */ - char *string; /* client-defined string */ LIST_ENTRY(client) next; /* linked list */ struct XenInput *input; /* Xen input device */ }; diff --git a/src/common.h b/src/common.h index c2b82ce..3a823e1 100644 --- a/src/common.h +++ b/src/common.h @@ -18,18 +18,8 @@ #define THUMB_PAD 25 #define BORDER_WIDTH 2 #define CURSOR_WIDTH 10 - -/* General defines */ -#define NITPICKER_OK 0 -#define NITPICKER_ERR_ILLEGAL_ID -11 -#define NITPICKER_ERR_OUT_OF_MEM -12 -#define NITPICKER_ERR_OUT_OF_CLIENTS -13 -#define NITPICKER_ERR_OUT_OF_BUFS -14 -#define NITPICKER_ERR_OUT_OF_VIEWS -15 -#define NITPICKER_ERR_NO_BUFFER -16 - -#define STATE_FREE 0 -#define STATE_ALLOCATED 1 +#define SEC_BORDER 3 +#define SEC_CORNER 18 /* Utility macros */ #define ARRAY_SIZE(a) (sizeof(a)/sizeof(*a)) @@ -82,7 +82,7 @@ view_refresh(struct view *v) v->wsurface->SetColor(v->wsurface, v->label->bg.r, v->label->bg.g, v->label->bg.b, 0xff); - for (i = 0; i < BORDER; i++) + for (i = 0; i < SEC_BORDER; i++) v->wsurface->DrawRectangle(v->wsurface, i, i, v->spos.w - 2 * i, @@ -94,20 +94,20 @@ view_refresh(struct view *v) 0xff); v->wsurface->FillTriangle(v->wsurface, 0, 0, - CORNER, 0, - 0, CORNER); + SEC_CORNER, 0, + 0, SEC_CORNER); v->wsurface->FillTriangle(v->wsurface, v->spos.w, 0, - v->spos.w, CORNER, - v->spos.w - CORNER, 0); + v->spos.w, SEC_CORNER, + v->spos.w - SEC_CORNER, 0); v->wsurface->FillTriangle(v->wsurface, v->spos.w, v->spos.h, - v->spos.w - CORNER, v->spos.h, - v->spos.w, v->spos.h - CORNER); + v->spos.w - SEC_CORNER, v->spos.h, + v->spos.w, v->spos.h - SEC_CORNER); v->wsurface->FillTriangle(v->wsurface, 0, v->spos.h, - 0, v->spos.h - CORNER, - CORNER, v->spos.h); + 0, v->spos.h - SEC_CORNER, + SEC_CORNER, v->spos.h); break; case BORDER_OVERLAY: @@ -141,7 +141,6 @@ view_free(struct view *v) v->window->Release(v->window); v->vsurface->Release(v->vsurface); - free(v->string); free(v); } @@ -159,7 +158,7 @@ view_new(struct client *c, struct buffer *b, int id, unsigned int flags) IDirectFBWindow *window; if (c->num_views >= c->max_views) - return NULL; /* NITPICKER_ERR_OUT_OF_VIEWS */ + return NULL; /* create subsurface */ if (b->bsurface->GetSubSurface(b->bsurface, NULL, &vsurf) != DFB_OK) @@ -189,10 +188,7 @@ view_new(struct client *c, struct buffer *b, int id, unsigned int flags) v->id = id; v->client = c; v->buffer = b; - v->state = STATE_ALLOCATED; v->flags = flags; - v->lw = 32; - v->lh = 16; v->label = &b->client->label; v->bsurface = b->bsurface; v->vsurface = vsurf; @@ -417,16 +413,6 @@ view_toggle_labeling(void) } } -/*** LONGERFACE: REDEFINE VIEW TITLE ***/ -int -view_set_title(struct view *v, const char *title) -{ - /* set new title */ - v->string = strdup(title); - - return NITPICKER_OK; -} - /*** DEBUG INTERFACES ***/ void view_debug_dump(void) @@ -21,37 +21,24 @@ #include "sys-queue.h" -#define VIEW_FLAGS_STAYTOP 0x01 /* keep view always on top */ -#define VIEW_FLAGS_BORDER 0x02 /* draw border */ -#define VIEW_FLAGS_TRANSPARENT 0x04 /* take rear views as background */ -#define VIEW_FLAGS_LABEL 0x08 /* display label */ -#define VIEW_FLAGS_FRONT 0x10 /* do not dim the view */ -#define VIEW_FLAGS_BACKGROUND 0x20 /* view is a background view */ -#define VIEW_FLAGS_SERVER 0x40 /* view is server-owned */ -#define VIEW_FLAGS_THUMBNAIL 0x80 /* view is a thumbnail view */ +#define VIEW_FLAGS_BACKGROUND 0x1 /* view is a background view */ +#define VIEW_FLAGS_SERVER 0x2 /* view is server-owned */ +#define VIEW_FLAGS_THUMBNAIL 0x4 /* view is a thumbnail view */ #define VIEW_STACK_TOP 0x1 /* top-most */ #define VIEW_STACK_BOTTOM 0x2 /* bottom-most */ #define VIEW_STACK_ABOVE 0x4 /* above sibling view */ #define VIEW_STACK_BELOW 0x8 /* below sibling view */ -#define BORDER 3 /* size of security border */ -#define CORNER 18 /* size of security corner */ -#define MAX_LABEL 32 /* max.characters of a label */ - struct client; struct buffer; struct view { int id; /* view ID */ - int state; /* state of view */ int flags; /* properties of the view */ struct sec_label *label; /* security label */ - unsigned long token; /* private token of the application */ DFBRectangle bpos; /* view location within its buffer */ DFBRectangle spos; /* view position and size on screen */ - int lx, ly, lw, lh; /* position and size of label */ - char *string; /* client-defined string */ struct client *client; /* client owner */ struct buffer *buffer; /* buffer that is visible within the view */ TAILQ_ENTRY(view) buffer_next; /* next view of the same buffer */ @@ -101,9 +88,6 @@ view_set_position(struct view *v, int x, int y); int view_translate(struct view *v, int dx, int dy); -int -view_set_title(struct view *view, const char *title); - void view_refresh(struct view *view); |