53,17 → 53,7 |
|
panel->layout = 0; |
|
panel->bitmap.width = 1920; |
panel->bitmap.height = PANEL_HEIGHT; |
panel->bitmap.flags = 0; |
|
if( create_bitmap(&panel->bitmap) ) |
{ |
printf("not enough memory for panel bitmap\n"); |
return 0; |
} |
|
ctx->pixmap = &panel->bitmap; |
ctx->pixmap_data = user_alloc(1920*PANEL_HEIGHT*4); |
ctx->offset_x = 0; |
ctx->offset_y = 0; |
|
100,8 → 90,6 |
// btn->img_hilite = res_minimize_btn_hl; |
// btn->img_pressed = res_minimize_btn_pressed; |
|
|
|
update_panel_size(win); |
|
return 1; |
157,10 → 145,8 |
void update_panel_size(window_t *win) |
{ |
panel_t *panel = &win->panel; |
bitmap_t *bitmap = &panel->bitmap; |
|
bitmap->width = win->w; |
resize_bitmap(bitmap); |
panel->ctx.pixmap_pitch = win->w*4; |
|
panel->ctx.offset_x = 0; |
panel->ctx.offset_y = win->h-PANEL_HEIGHT; |
200,19 → 186,17 |
|
void draw_panel(panel_t *panel) |
{ |
ctx_t *ctx = &panel->ctx; |
int *pixmap, *src; |
int i, j, w; |
|
lock_bitmap(&panel->bitmap); |
|
blit_raw(&panel->ctx, res_panel_left, 0, 0, |
blit_raw(ctx, res_panel_left, 0, 0, |
PANEL_CORNER_W, PANEL_HEIGHT, PANEL_CORNER_W*4); |
|
|
w = panel->ctrl.w - (2*PANEL_CORNER_W); |
if( w > 0) |
{ |
pixmap = (int*)panel->ctx.pixmap->data; |
pixmap = (int*)ctx->pixmap_data; |
pixmap+= PANEL_CORNER_W; |
src = res_panel_body; |
|
220,7 → 204,7 |
{ |
for(j = 0; j < w; j++) |
pixmap[j] = src[i]; |
pixmap+= panel->ctx.pixmap->pitch/4; |
pixmap+= ctx->pixmap_pitch/4; |
} |
}; |
|
302,13 → 286,10 |
|
void blit_panel(panel_t *panel) |
{ |
// printf("%s w:%d h:%d stride: %d\n",__FUNCTION__, |
// cpt->ctrl.w, cpt->ctrl.h, cpt->ctx.stride); |
ctx_t *ctx = &panel->ctx; |
|
lock_bitmap(&panel->bitmap); |
|
Blit(panel->ctx.pixmap->data, panel->draw.l, panel->draw.t, |
Blit(ctx->pixmap_data, panel->draw.l, panel->draw.t, |
0, 0, panel->ctrl.w, panel->ctrl.h, |
panel->ctrl.w, panel->ctrl.h, panel->ctx.pixmap->pitch); |
panel->ctrl.w, panel->ctrl.h, ctx->pixmap_pitch); |
}; |
|