FPlay: fullscreen mode

git-svn-id: svn://kolibrios.org@3334 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Sergey Semyonov (Serge) 2013-03-05 15:33:29 +00:00
parent 8359c962a8
commit 13030ad148
5 changed files with 66 additions and 37 deletions

View File

@ -64,17 +64,6 @@ typedef struct
};
}hwcaps_t;
static inline uint32_t GetScreenSize()
{
uint32_t retval;
__asm__ __volatile__(
"int $0x40"
:"=a"(retval)
:"a"(61), "b"(1));
return retval;
}
static uint32_t get_service(char *name)
{
uint32_t retval = 0;

View File

@ -403,6 +403,8 @@ void render_time(render_t *render)
// sys_time*10, frames[vfx].pts, ctime, fdelay);
main_render->draw(main_render, &frames[vfx].picture);
if(main_render->win->win_state != FULLSCREEN)
{
prg->current = frames[vfx].pts*1000;
// printf("current %f\n", prg->current);
lvl->current = vfx & 1 ? sound_level_1 : sound_level_0;
@ -411,6 +413,7 @@ void render_time(render_t *render)
if(main_render->win->panel.layout)
send_message(&lvl->ctrl, MSG_PAINT, 0, 0);
}
frames_count--;
frames[vfx].ready = 0;
@ -707,7 +710,10 @@ void render_adjust_size(render_t *render, window_t *win)
uint8_t state;
right = win->w;
bottom = win->h-CAPTION_HEIGHT-PANEL_HEIGHT;
bottom = win->h;
if(win->win_state != FULLSCREEN)
bottom-= CAPTION_HEIGHT+PANEL_HEIGHT;
// printf("window width %d height %d\n",
// right, bottom);
@ -724,6 +730,8 @@ void render_adjust_size(render_t *render, window_t *win)
bottom == render->win_height)
return;
printf("%s r: %d b: %d\n", __FUNCTION__, right, bottom);
new_w = bottom*render->ctx_width/render->ctx_height;
new_h = right*render->ctx_height/render->ctx_width;
@ -738,8 +746,8 @@ void render_adjust_size(render_t *render, window_t *win)
new_w = bottom*render->ctx_width/render->ctx_height;
};
render->win_width = win->w;
render->win_height = win->h-CAPTION_HEIGHT-PANEL_HEIGHT;
render->win_width = right;
render->win_height = bottom;
render_set_size(render, new_w, new_h);
if(render->caps & HW_TEX_BLIT) /* hw scaler */
@ -815,6 +823,10 @@ void draw_hw_picture(render_t *render, AVPicture *picture)
picture->linesize, 0, render->ctx_height, data, linesize);
// printf("sws_scale\n");
if(render->win->win_state == FULLSCREEN)
blit_bitmap(bitmap,render->rcvideo.l,render->rcvideo.t,
render->rcvideo.r, render->rcvideo.b);
else
blit_bitmap(bitmap, render->rcvideo.l,
CAPTION_HEIGHT+render->rcvideo.t,
render->rcvideo.r, render->rcvideo.b);
@ -863,43 +875,54 @@ void draw_sw_picture(render_t *render, AVPicture *picture)
sws_scale(cvt_ctx, (const uint8_t* const *)picture->data,
picture->linesize, 0, render->ctx_height, data, linesize);
blit_bitmap(&render->bitmap[0], render->rcvideo.l,
render->rcvideo.t+CAPTION_HEIGHT,
if(render->win->win_state == FULLSCREEN)
blit_bitmap(&render->bitmap[0],render->rcvideo.l,render->rcvideo.t,
render->rcvideo.r, render->rcvideo.b);
else
blit_bitmap(&render->bitmap[0], render->rcvideo.l,
CAPTION_HEIGHT+render->rcvideo.t,
render->rcvideo.r, render->rcvideo.b);
render->last_bitmap = &render->bitmap[0];
}
void render_draw_client(render_t *render)
{
int y;
if(render->win_state == MINIMIZED ||
render->win_state == ROLLED )
return;
if(render->win_state == FULLSCREEN)
y = 0;
else
y = CAPTION_HEIGHT;
if(player_state == PAUSE)
{
if(frames[vfx].ready == 1 )
main_render->draw(main_render, &frames[vfx].picture);
else
draw_bar(0, CAPTION_HEIGHT, render->win_width,
draw_bar(0, y, render->win_width,
render->rcvideo.b, 0);
}
else if( player_state == STOP )
{
draw_bar(0, CAPTION_HEIGHT, render->win_width,
draw_bar(0,y, render->win_width,
render->rcvideo.b, 0);
};
if(render->layout & HAS_TOP)
draw_bar(0, CAPTION_HEIGHT, render->win_width,
draw_bar(0, y, render->win_width,
render->rctop.b, 0);
if(render->layout & HAS_LEFT)
draw_bar(0, render->rcvideo.t+CAPTION_HEIGHT, render->rcleft.r,
draw_bar(0, render->rcvideo.t+y, render->rcleft.r,
render->rcvideo.b, 0);
if(render->layout & HAS_RIGHT)
draw_bar(render->rcright.l, render->rcvideo.t+CAPTION_HEIGHT,
draw_bar(render->rcright.l, render->rcvideo.t+y,
render->rcright.r, render->rcvideo.b, 0);
if(render->layout & HAS_BOTTOM)
draw_bar(0, render->rcbottom.t+CAPTION_HEIGHT,
draw_bar(0, render->rcbottom.t+y,
render->win_width, render->rcbottom.b, 0);
}

View File

@ -1,5 +1,5 @@
#include "system.h"
#include <system.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
@ -77,7 +77,7 @@ int init_caption(window_t *win)
btn->img_hilite = res_minimize_btn_hl;
btn->img_pressed = res_minimize_btn_pressed;
btn = create_button(NULL, ID_FULL,0,5,18,18,(ctrl_t*)cpt);
btn = create_button(NULL, ID_FULLSCREEN,0,5,18,18,(ctrl_t*)cpt);
cpt->full_btn = btn;
btn->img_default = res_full_btn;
@ -243,6 +243,20 @@ int caption_proc(ctrl_t *ctrl, uint32_t msg, uint32_t arg1, uint32_t arg2)
win->win_state = MINIMIZED;
send_message((ctrl_t*)win, MSG_SIZE, 0, 0);
break;
case ID_FULLSCREEN:
{
int screensize;
screensize = GetScreenSize();
__asm__ __volatile__(
"int $0x40"
::"a"(67), "b"(0), "c"(0),
"d"((screensize >> 16)-1),"S"((screensize & 0xFFFF)-1) );
win->win_state = FULLSCREEN;
window_update_layout(win);
};
break;
default:
break;
};

View File

@ -139,6 +139,9 @@ int frame_proc(ctrl_t *ctrl, uint32_t msg, uint32_t arg1, uint32_t arg2)
rect_t *rc = NULL;
int x, y;
if(win->win_state == FULLSCREEN)
return 0;
x = ((pos_t)arg2).x;
y = ((pos_t)arg2).y;

View File

@ -269,9 +269,9 @@ void window_update_layout(window_t *win)
if( winw == win->w &&
winh == win->h &&
state == win->win_state)
return;
if(win->win_state != FULLSCREEN)
win->win_state = state;
#if 0