/contrib/media/fplay/Makefile |
---|
19,7 → 19,7 |
INCLUDES= -I. -I$(SDK_DIR)/sources/newlib/libc/include -I$(SDK_DIR)/sources/ffmpeg -I$(SDK_DIR)/sources/freetype/include |
LIBS:= -lavdevice.dll -lavformat.dll -lavcodec.dll -lavutil.dll -lswscale.dll |
LIBS+= -lswresample.dll -lsound -lpixlib.dll -lfreetype.dll -lgcc -lc.dll -lapp |
LIBS+= -lswresample.dll -lsound -lpixlib3 -lfreetype.dll -lgcc -lc.dll -lapp |
LIBPATH:= -L$(LIB_DIR) -L/home/autobuild/tools/win32/mingw32/lib |
/contrib/media/fplay/fplay.h |
---|
1,5 → 1,5 |
#include "pixlib2.h" |
#include "pixlib3.h" |
#define BLACK_MAGIC_SOUND |
#define BLACK_MAGIC_VIDEO |
30,7 → 30,7 |
rect_t rcbottom; |
uint32_t layout; |
bitmap_t bitmap[4]; |
bitmap_t *bitmap[4]; |
bitmap_t *last_bitmap; |
uint32_t ctx_format; |
135,9 → 135,7 |
} |
int init_fontlib(); |
int draw_text(bitmap_t *winbitmap, int face, char *text, int x, int y, int color); |
int draw_text_ext(bitmap_t *winbitmap, int face, char *text, rect_t *rc, int color); |
//int draw_text_ext(void *pixmap, uint32_t pitch, FT_Face face, char *text, rect_t *rc, int color); |
char *get_moviefile(); |
/contrib/media/fplay/utils.c |
---|
100,18 → 100,18 |
void blit_raw(ctx_t *ctx, void *raw, int x, int y, int w, int h, int pitch) |
{ |
int *dst = (int*)ctx->pixmap->data; |
int *dst; |
int *src = raw; |
int i, j; |
dst+= y * ctx->pixmap->pitch/4 + x; |
dst = ctx->pixmap_data; |
dst+= y * ctx->pixmap_pitch/4 + x; |
for(i=0; i < h; i++) |
{ |
for(j = 0; j < w; j++) |
dst[j] = src[j]; |
dst+= ctx->pixmap->pitch/4; |
dst+= ctx->pixmap_pitch/4; |
src+= pitch/4; |
}; |
}; |
/contrib/media/fplay/video.c |
---|
184,8 → 184,6 |
extern volatile enum player_state decoder_state; |
extern volatile enum player_state sound_state; |
//rect_t win_rect; |
extern int64_t rewind_pos; |
static void player_stop() |
219,7 → 217,6 |
switch(msg) |
{ |
case MSG_SIZE: |
//printf("MSG_SIZE\n"); |
if(main_render) |
{ |
render_adjust_size(main_render, win); |
268,11 → 265,11 |
win->win_state = win->saved_state; |
window_update_layout(win); |
// if(win->saved_state == MAXIMIZED) |
{ |
blit_caption(&win->caption); |
blit_panel(&win->panel); |
// { |
// blit_caption(&win->caption); |
// blit_panel(&win->panel); |
// } |
} |
} |
ent_down = 1; |
}; |
break; |
567,6 → 564,9 |
AVCodecContext *ctx = param; |
window_t *MainWindow; |
printf("%s\n", __FUNCTION__); |
init_winlib(); |
MainWindow = create_window(movie_file,0, |
622,14 → 622,14 |
render->ctx_format = ctx->pix_fmt; |
mutex_lock(&driver_lock); |
render->caps = init_pixlib(flags); |
render->caps = pxInit(1); |
mutex_unlock(&driver_lock); |
right = win->w; |
bottom = win->h-CAPTION_HEIGHT-PANEL_HEIGHT; |
// printf("window width %d height %d\n", |
// right, bottom); |
printf("window width %d height %d\n", |
right, bottom); |
render->win_state = win->win_state; |
653,13 → 653,12 |
render_set_size(render, draw_w, draw_h); |
pxCreateClient(0, CAPTION_HEIGHT, right, bottom); |
if(render->caps==0) |
{ |
render->bitmap[0].width = draw_w; |
render->bitmap[0].height = draw_h; |
if( create_bitmap(&render->bitmap[0]) != 0 ) |
render->bitmap[0] = pxCreateBitmap(draw_w, draw_h); |
if(render->bitmap[0] == NULL) |
{ |
free(render); |
return NULL; |
668,31 → 667,24 |
} |
else |
{ |
int width, height, flags; |
int width, height; |
int i; |
if(render->caps & HW_TEX_BLIT) |
{ |
sna_create_mask(); |
width = render->ctx_width; |
height = render->ctx_height; |
flags = HW_TEX_BLIT; |
} |
else |
{ |
width = draw_w; |
height = draw_h;; |
flags = HW_BIT_BLIT; |
} |
for( i=0; i < 2; i++) |
{ |
render->bitmap[i].width = width; |
render->bitmap[i].height = height; |
render->bitmap[i].flags = flags; |
if( create_bitmap(&render->bitmap[i]) != 0 ) |
render->bitmap[i] = pxCreateBitmap(width, height); |
if( render->bitmap[i] == NULL ) |
{ |
player_state = CLOSED; |
free(render); |
705,7 → 697,6 |
render->draw = draw_hw_picture; |
}; |
printf("FPlay %s render engine: context %dx%d picture %dx%d\n", |
render->caps & HW_TEX_BLIT ? "hw_tex_blit": |
render->caps & HW_BIT_BLIT ? "hw_bit_blit":"software", |
712,9 → 703,6 |
render->ctx_width, render->ctx_height, |
draw_w, draw_h); |
// if(init_hw_context(ctx) == 0) |
// printf("create hardware decoder context\n"); |
return render; |
}; |
721,12 → 709,12 |
void destroy_render(render_t *render) |
{ |
destroy_bitmap(&render->bitmap[0]); |
pxDestroyBitmap(render->bitmap[0]); |
if(render->caps & (HW_BIT_BLIT|HW_TEX_BLIT)) /* hw blitter */ |
destroy_bitmap(&render->bitmap[1]); |
pxDestroyBitmap(render->bitmap[1]); |
done_pixlib(); |
pxFini(); |
}; |
void render_set_size(render_t *render, int width, int height) |
830,28 → 818,32 |
render_set_size(render, new_w, new_h); |
if(render->caps & HW_TEX_BLIT) /* hw scaler */ |
{ |
if(render->win->win_state == FULLSCREEN) |
pxResizeClient(render->rcvideo.l, render->rcvideo.t, new_w, new_h); |
else |
pxResizeClient(render->rcvideo.l, render->rcvideo.t+CAPTION_HEIGHT, new_w, new_h); |
return; |
}; |
render->bitmap[0].width = new_w; |
render->bitmap[0].height = new_h; |
resize_bitmap(&render->bitmap[0]); |
pxResizeBitmap(render->bitmap[0], new_w, new_h); |
if(render->caps & HW_BIT_BLIT) /* hw blitter */ |
{ |
render->bitmap[1].width = new_w; |
render->bitmap[1].height = new_h; |
resize_bitmap(&render->bitmap[1]); |
}; |
pxResizeBitmap(render->bitmap[1], new_w, new_h); |
return; |
}; |
void draw_hw_picture(render_t *render, AVPicture *picture) |
{ |
int dst_width, dst_height; |
int dst_width; |
int dst_height; |
bitmap_t *bitmap; |
uint8_t *bitmap_data; |
uint32_t bitmap_pitch; |
uint8_t *data[4]; |
int linesize[4]; |
int ret; |
if(render->win->win_state == MINIMIZED || |
render->win->win_state == ROLLED) |
878,10 → 870,10 |
return ; |
}; |
bitmap = &render->bitmap[render->target]; |
bitmap = render->bitmap[render->target]; |
ret = lock_bitmap(bitmap); |
if( ret != 0) |
bitmap_data = pxLockBitmap(bitmap, &bitmap_pitch); |
if( bitmap_data == NULL) |
{ |
printf("Cannot lock bitmap!\n"); |
return ; |
888,15 → 880,15 |
} |
// printf("sws_getCachedContext\n"); |
data[0] = bitmap->data; |
data[1] = bitmap->data+1; |
data[2] = bitmap->data+2; |
data[3] = bitmap->data+3; |
data[0] = bitmap_data; |
data[1] = bitmap_data+1; |
data[2] = bitmap_data+2; |
data[3] = bitmap_data+3; |
linesize[0] = bitmap->pitch; |
linesize[1] = bitmap->pitch; |
linesize[2] = bitmap->pitch; |
linesize[3] = bitmap->pitch; |
linesize[0] = bitmap_pitch; |
linesize[1] = bitmap_pitch; |
linesize[2] = bitmap_pitch; |
linesize[3] = bitmap_pitch; |
sws_scale(cvt_ctx, (const uint8_t* const *)picture->data, |
picture->linesize, 0, render->ctx_height, data, linesize); |
907,20 → 899,20 |
{ |
if(render->win->win_state == FULLSCREEN) |
fplay_blit_bitmap(bitmap,render->rcvideo.l,render->rcvideo.t, |
render->rcvideo.r, render->rcvideo.b); |
pxBlitBitmap(bitmap,render->rcvideo.l,render->rcvideo.t, |
render->rcvideo.r, render->rcvideo.b,0,0); |
else |
fplay_blit_bitmap(bitmap, render->rcvideo.l, |
pxBlitBitmap(bitmap, render->rcvideo.l, |
CAPTION_HEIGHT+render->rcvideo.t, |
render->rcvideo.r, render->rcvideo.b); |
render->rcvideo.r, render->rcvideo.b,0,0); |
} |
else |
{ |
if(render->win->win_state == FULLSCREEN) |
blit_bitmap(bitmap,render->rcvideo.l,render->rcvideo.t, |
pxBlitBitmap(bitmap,render->rcvideo.l,render->rcvideo.t, |
render->rcvideo.r, render->rcvideo.b, 0,0); |
else |
blit_bitmap(bitmap, render->rcvideo.l, |
pxBlitBitmap(bitmap, render->rcvideo.l, |
CAPTION_HEIGHT+render->rcvideo.t, |
render->rcvideo.r, render->rcvideo.b, 0, 0); |
}; |
932,6 → 924,8 |
void draw_sw_picture(render_t *render, AVPicture *picture) |
{ |
uint8_t *bitmap_data; |
uint32_t bitmap_pitch; |
uint8_t *data[4]; |
int linesize[4]; |
950,30 → 944,30 |
return ; |
} |
lock_bitmap(&render->bitmap[0]); |
bitmap_data = pxLockBitmap(render->bitmap[0],&bitmap_pitch); |
data[0] = render->bitmap[0].data; |
data[1] = render->bitmap[0].data+1; |
data[2] = render->bitmap[0].data+2; |
data[3] = render->bitmap[0].data+3; |
data[0] = bitmap_data; |
data[1] = bitmap_data+1; |
data[2] = bitmap_data+2; |
data[3] = bitmap_data+3; |
linesize[0] = render->bitmap[0].pitch; |
linesize[1] = render->bitmap[0].pitch; |
linesize[2] = render->bitmap[0].pitch; |
linesize[3] = render->bitmap[0].pitch; |
linesize[0] = bitmap_pitch; |
linesize[1] = bitmap_pitch; |
linesize[2] = bitmap_pitch; |
linesize[3] = bitmap_pitch; |
sws_scale(cvt_ctx, (const uint8_t* const *)picture->data, |
picture->linesize, 0, render->ctx_height, data, linesize); |
if(render->win->win_state == FULLSCREEN) |
fplay_blit_bitmap(&render->bitmap[0],render->rcvideo.l,render->rcvideo.t, |
render->rcvideo.r, render->rcvideo.b); |
pxBlitBitmap(render->bitmap[0],render->rcvideo.l,render->rcvideo.t, |
render->rcvideo.r, render->rcvideo.b,0,0); |
else |
fplay_blit_bitmap(&render->bitmap[0], render->rcvideo.l, |
pxBlitBitmap(render->bitmap[0], render->rcvideo.l, |
CAPTION_HEIGHT+render->rcvideo.t, |
render->rcvideo.r, render->rcvideo.b); |
render->rcvideo.r, render->rcvideo.b,0,0); |
render->last_bitmap = &render->bitmap[0]; |
render->last_bitmap = render->bitmap[0]; |
} |
void render_draw_client(render_t *render) |
/contrib/media/fplay/winlib/button.c |
---|
20,7 → 20,6 |
ctrl_t *create_control(size_t size, int id, int x, int y, |
int w, int h, ctrl_t *parent) |
{ |
ctrl_t *ctrl; |
if( !parent ) |
126,8 → 125,6 |
ctx = btn->ctrl.ctx; |
lock_bitmap(ctx->pixmap); |
x = btn->ctrl.rc.l - ctx->offset_x; |
y = btn->ctrl.rc.t - ctx->offset_y; |
259,8 → 256,6 |
ctx = prg->ctrl.ctx; |
lock_bitmap(ctx->pixmap); |
x = prg->ctrl.rc.l - ctx->offset_x; |
y = prg->ctrl.rc.t - ctx->offset_y; |
268,8 → 263,8 |
{ |
src = res_progress_bar; |
pixmap = (int*)ctx->pixmap->data; |
pixmap+= y * ctx->pixmap->pitch/4 + x; |
pixmap = (int*)ctx->pixmap_data; |
pixmap+= y * ctx->pixmap_pitch/4 + x; |
for(i=0; i < 10; i++) |
{ |
276,24 → 271,23 |
for(j = 0; j < len; j++) |
pixmap[j] = *src; |
pixmap+= ctx->pixmap->pitch/4; |
pixmap+= ctx->pixmap_pitch/4; |
src++; |
}; |
}; |
len = prg->current*prg->ctrl.w/(prg->max - prg->min); |
src = res_prg_level; |
pixmap = (int*)ctx->pixmap->data; |
pixmap+= y*ctx->pixmap->pitch/4 + x; |
pixmap = (int*)ctx->pixmap_data; |
pixmap+= y*ctx->pixmap_pitch/4 + x; |
for(i=0; i < prg->ctrl.h ;i++) |
{ |
for(j=0; j < len; j++) |
pixmap[j] = *src; |
pixmap+= ctx->pixmap->pitch/4; |
pixmap+= ctx->pixmap_pitch/4; |
src++; |
}; |
363,8 → 357,6 |
ctx = lvl->ctrl.ctx; |
lock_bitmap(ctx->pixmap); |
x = lvl->ctrl.rc.l - ctx->offset_x; |
y = lvl->ctrl.rc.t - ctx->offset_y; |
377,15 → 369,15 |
if(len > 96) |
len = 96; |
pixmap = (int*)ctx->pixmap->data; |
pixmap = (int*)ctx->pixmap_data; |
pixmap+= y*ctx->pixmap->pitch/4 + x; |
pixmap+= y*ctx->pixmap_pitch/4 + x; |
for(i=0; i < 10; i++) |
{ |
for(j = 0; j < 96; j++) |
pixmap[j] = 0xFF1C1C1C; |
pixmap+= ctx->pixmap->pitch/4; |
pixmap+= ctx->pixmap_pitch/4; |
}; |
blit_raw(ctx, lvl->img_level, x, y, len, 10, 96*4); |
397,7 → 389,6 |
int lvl_proc(ctrl_t *ctrl, uint32_t msg, uint32_t arg1, uint32_t arg2) |
{ |
level_t *lvl = (level_t*)ctrl; |
// int pos; |
switch( msg ) |
{ |
454,25 → 445,22 |
ctx = sld->ctrl.ctx; |
lock_bitmap(ctx->pixmap); |
x = sld->ctrl.rc.l - ctx->offset_x; |
y = sld->ctrl.rc.t - ctx->offset_y; |
len = 96 + 12; |
pixmap = (int*)ctx->pixmap->data; |
pixmap+= y*ctx->pixmap->pitch/4 + x; |
pixmap = (int*)ctx->pixmap_data; |
pixmap+= y*ctx->pixmap_pitch/4 + x; |
for(i=0; i < 11; i++) |
{ |
for(j = 0; j < len; j++) |
pixmap[j] = 0xFF1C1C1C; |
pixmap+= ctx->pixmap->pitch/4; |
pixmap+= ctx->pixmap_pitch/4; |
}; |
blit_raw(ctx, sld->img_vol_slider, x+6, y+4, 96, 4, 96*4); |
blit_raw(ctx, res_slider, x+sld->pos, y, 12, 11, 12*4); |
return 0; |
/contrib/media/fplay/winlib/caption.c |
---|
44,19 → 44,8 |
cpt->text = win->caption_txt; |
cpt->bitmap.width = 1920; |
cpt->bitmap.height = CAPTION_HEIGHT; |
cpt->bitmap.flags = 0; |
if( create_bitmap(&cpt->bitmap) ) |
{ |
printf("not enough memory for caption bitmap\n"); |
return 0; |
} |
// printf("win_w %d win_h %d\n", win->w, win->h); |
ctx->pixmap = &cpt->bitmap; |
ctx->pixmap_data = user_alloc(1920*CAPTION_HEIGHT*4); |
ctx->pixmap_pitch= 1920*4; |
ctx->offset_x = 0; |
ctx->offset_y = 0; |
92,10 → 81,9 |
void update_caption_size(window_t *win) |
{ |
caption_t *cpt = &win->caption; |
bitmap_t *bitmap = &cpt->bitmap; |
ctx_t *ctx = &cpt->ctx; |
bitmap->width = win->w; |
resize_bitmap(bitmap); |
ctx->pixmap_pitch = win->w * 4; |
cpt->ctrl.rc.l = 0; |
cpt->ctrl.rc.t = 0; |
116,27 → 104,24 |
cpt->full_btn->ctrl.rc.l = win->w - 27 - 18 -18 - 5 - 5; |
cpt->full_btn->ctrl.rc.r = cpt->full_btn->ctrl.rc.l + |
cpt->full_btn->ctrl.w; |
}; |
extern int win_font; |
void draw_caption(caption_t *cpt) |
{ |
ctx_t *ctx = &cpt->ctx; |
int *pixmap, *src; |
rect_t rc; |
int i, j, w; |
lock_bitmap(&cpt->bitmap); |
blit_raw(&cpt->ctx, res_caption_left, 0, 0, |
blit_raw(ctx, res_caption_left, 0, 0, |
CAPTION_CORNER_W, CAPTION_HEIGHT, CAPTION_CORNER_W*4); |
w = cpt->ctrl.w - (2*CAPTION_CORNER_W); |
if( w > 0) |
{ |
pixmap = (int*)cpt->ctx.pixmap->data; |
pixmap = (int*)ctx->pixmap_data; |
pixmap+= CAPTION_CORNER_W; |
src = res_caption_body; |
144,16 → 129,11 |
{ |
for(j = 0; j < w; j++) |
pixmap[j] = src[i]; |
pixmap+= cpt->ctx.pixmap->pitch/4; |
pixmap+= ctx->pixmap_pitch/4; |
} |
// blit_raw(&cpt->ctx,res_caption_body, CAPTION_CORNER_W, 0, |
// w, CAPTION_HEIGHT, 0); |
}; |
blit_raw(&cpt->ctx,res_caption_right, cpt->ctrl.w - CAPTION_CORNER_W, 0, |
blit_raw(ctx,res_caption_right, cpt->ctrl.w - CAPTION_CORNER_W, 0, |
CAPTION_CORNER_W, CAPTION_HEIGHT,CAPTION_CORNER_W*4); |
rc.l = 8; |
161,7 → 141,7 |
rc.r = cpt->ctrl.w - 27 - 18 - 18 - 5 - 5 - 8; |
rc.b = 18; |
draw_text_ext(cpt->ctx.pixmap, win_font, cpt->text, &rc, 0xFFFFFFFF); |
draw_text_ext(ctx->pixmap_data, ctx->pixmap_pitch, win_font, cpt->text, &rc, 0xFFFFFFFF); |
ctrl_t *child; |
child = (ctrl_t*)cpt->ctrl.child.next; |
264,9 → 244,8 |
// printf("%s w:%d h:%d stride: %d\n",__FUNCTION__, |
// cpt->ctrl.w, cpt->ctrl.h, cpt->ctx.stride); |
lock_bitmap(&cpt->bitmap); |
Blit(cpt->ctx.pixmap->data, 0, 0, 0, 0, cpt->ctrl.w, cpt->ctrl.h, |
cpt->ctrl.w, cpt->ctrl.h, cpt->ctx.pixmap->pitch); |
Blit(cpt->ctx.pixmap_data, 0, 0, 0, 0, cpt->ctrl.w, cpt->ctrl.h, |
cpt->ctrl.w, cpt->ctrl.h, cpt->ctx.pixmap_pitch); |
}; |
/contrib/media/fplay/winlib/control.h |
---|
1,7 → 1,7 |
#ifndef __CONTROL_H__ |
#define __CONTROL_H_ |
#include <pixlib2.h> |
#include <pixlib3.h> |
#include "link.h" |
typedef struct |
14,9 → 14,10 |
typedef struct ctx |
{ |
bitmap_t *pixmap; |
int offset_x; |
int offset_y; |
int *pixmap_data; |
int pixmap_pitch; |
}ctx_t; |
ctx_t *get_window_ctx(); |
/contrib/media/fplay/winlib/fontlib.c |
---|
23,7 → 23,7 |
unsigned int ansi2utf32(unsigned char ch); |
void my_draw_bitmap(bitmap_t *win, FT_Bitmap *bitmap, int dstx, int dsty, int col) |
static void my_draw_bitmap(uint8_t *pixmap, uint32_t pitch, FT_Bitmap *bitmap, int dstx, int dsty, int col) |
{ |
uint8_t *dst; |
uint8_t *src, *tmpsrc; |
31,7 → 31,7 |
uint32_t *tmpdst; |
int i, j; |
dst = win->data + dsty * win->pitch + dstx*4; |
dst = pixmap + dsty * pitch + dstx*4; |
src = bitmap->buffer; |
for( i = 0; i < bitmap->rows; i++ ) |
39,7 → 39,7 |
tmpdst = (uint32_t*)dst; |
tmpsrc = src; |
dst+= win->pitch; |
dst+= pitch; |
src+= bitmap->pitch; |
for( j = 0; j < bitmap->width; j++) |
68,7 → 68,7 |
}; |
int draw_text_ext(bitmap_t *winbitmap, FT_Face face, char *text, rect_t *rc, int color) |
int draw_text_ext(void *pixmap, uint32_t pitch, FT_Face face, char *text, rect_t *rc, int color) |
{ |
FT_UInt glyph_index; |
FT_Bool use_kerning = 0; |
107,7 → 107,7 |
if ( err ) |
continue; |
my_draw_bitmap(winbitmap, &face->glyph->bitmap, (x >> 6) + face->glyph->bitmap_left, |
my_draw_bitmap(pixmap, pitch, &face->glyph->bitmap, (x >> 6) + face->glyph->bitmap_left, |
y - face->glyph->bitmap_top, color); |
x += face->glyph->advance.x; |
/contrib/media/fplay/winlib/frame.c |
---|
67,8 → 67,12 |
extern int res_border_left[]; |
extern int res_border_right[]; |
#if 0 |
int draw_frame(window_t *win) |
{ |
void *pixmap_data; |
uint32_t pixmap_pitch; |
int *pixmap, *src; |
int i, j; |
124,7 → 128,9 |
return 0; |
}; |
#endif |
int frame_proc(ctrl_t *ctrl, uint32_t msg, uint32_t arg1, uint32_t arg2) |
{ |
static pos_t spos; |
/contrib/media/fplay/winlib/panel.c |
---|
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); |
}; |
/contrib/media/fplay/winlib/window.c |
---|
79,7 → 79,7 |
if(handler==0) return 0; |
BeginDraw(); |
DrawWindow(x, y, w-1, h-1, |
DrawWindow(x, y, w, h, |
NULL,0,0x41); |
EndDraw(); |
213,13 → 213,14 |
void blit_client(window_t *win) |
{ |
ctx_t *ctx = &win->ctx; |
int w, h; |
w = win->client.r - win->client.l; |
h = win->client.b - win->client.t; |
Blit(win->ctx->pixmap->data, win->client.l, win->client.t, |
0, 0, w, h, w, h,win->ctx->pixmap->pitch); |
Blit(ctx->pixmap_data, win->client.l, win->client.t, |
0, 0, w, h, w, h, ctx->pixmap_pitch); |
}; |
366,7 → 367,6 |
BeginDraw(); |
DrawWindow(0,0,0,0, NULL, 0x000000,0x41); |
// DefineButton(15, 15, 0x00000001, 0); |
EndDraw(); |
send_message((ctrl_t*)win, MSG_DRAW_CLIENT, 0, 0); |
628,6 → 628,8 |
void update_rect(ctrl_t *ctrl) |
{ |
ctx_t *ctx = ctrl->ctx; |
int ctx_w, ctx_h; |
int src_x, src_y; |
637,36 → 639,12 |
ctx_w = ctrl->parent->w; |
ctx_h = ctrl->parent->h; |
Blit(ctrl->ctx->pixmap->data, ctrl->rc.l, ctrl->rc.t, src_x, src_y, |
ctrl->w, ctrl->h, ctx_w, ctx_h, ctrl->ctx->pixmap->pitch); |
Blit(ctx->pixmap_data, ctrl->rc.l, ctrl->rc.t, src_x, src_y, |
ctrl->w, ctrl->h, ctx_w, ctx_h, ctx->pixmap_pitch); |
// need_update++; |
}; |
void Blit(void *bitmap, int dst_x, int dst_y, |
int src_x, int src_y, int w, int h, |
int src_w, int src_h, int stride) |
{ |
volatile struct blit_call bc; |
bc.dstx = dst_x; |
bc.dsty = dst_y; |
bc.w = w; |
bc.h = h; |
bc.srcx = src_x; |
bc.srcy = src_y; |
bc.srcw = src_w; |
bc.srch = src_h; |
bc.stride = stride; |
bc.bitmap = bitmap; |
__asm__ __volatile__( |
"int $0x40" |
::"a"(73),"b"(0x20),"c"(&bc.dstx)); |
}; |
ctrl_t *get_child(ctrl_t *ctrl, int x, int y) |
{ |
ctrl_t *child = NULL; |
/contrib/media/fplay/winlib/winlib.h |
---|
36,7 → 36,6 |
{ |
ctrl_t ctrl; |
ctx_t ctx; |
bitmap_t bitmap; |
char *text; |
ctrl_t *child_over; |
50,7 → 49,6 |
{ |
ctrl_t ctrl; |
ctx_t ctx; |
bitmap_t bitmap; |
rect_t draw; |
ctrl_t *child_over; |
int layout; |
73,7 → 71,7 |
handler_t *handler; |
ctrl_t *parent; |
ctx_t *ctx; |
ctx_t ctx; |
uint32_t id; |
uint32_t style; |
84,10 → 82,6 |
rect_t saved; |
rect_t client; |
// ctx_t client_ctx; |
// bitmap_t bitmap; |
bitmap_t bitmap; |
char *caption_txt; |
ctrl_t *child_over; |
ctrl_t *child_focus; |