Lines Matching full:window
12 #include "android/skin/window.h"
723 SkinWindow* window;
727 ball_state_reset( BallState* state, SkinWindow* window )
736 state->window = window;
757 skin_window_redraw( state->window, &state->rect );
764 skin_window_redraw( state->window, &state->rect );
973 skin_window_find_finger( SkinWindow* window,
977 FingerState* finger = &window->finger;
983 if (!window->enable_touch)
986 LAYOUT_LOOP_DISPLAYS(&window->layout,disp)
1000 skin_window_move_mouse( SkinWindow* window,
1004 FingerState* finger = &window->finger;
1005 ButtonState* button = &window->button;
1043 skin_window_redraw( window, &hover->rect );
1048 LAYOUT_LOOP_BUTTONS( &window->layout, butt )
1064 if (!window->enable_dpad)
1096 if (!window->enable_qwerty)
1103 skin_window_redraw( window, &hover->rect );
1110 skin_window_trackball_press( SkinWindow* window, int down )
1116 skin_window_trackball_move( SkinWindow* window, int xrel, int yrel )
1118 BallState* state = &window->ball;
1122 skin_window_redraw( window, &state->rect );
1127 skin_window_set_trackball( SkinWindow* window, SkinTrackBall* ball )
1129 BallState* state = &window->ball;
1135 skin_window_show_trackball( SkinWindow* window, int enable )
1137 BallState* state = &window->ball;
1139 if (state->ball != NULL && window->enable_trackball) {
1146 skin_window_hide_opengles( SkinWindow* window )
1151 /* Show the OpenGL ES framebuffer window */
1153 skin_window_show_opengles( SkinWindow* window )
1158 ADisplay* disp = window->layout.displays;
1164 winhandle = (void*)wminfo.window;
1168 winhandle = (void*)wminfo.info.x11.window;
1170 skin_scaler_get_scaled_rect(window->scaler, &drect, &drect);
1178 skin_window_redraw_opengles( SkinWindow* window )
1188 SkinWindow* window;
1190 /* If scale is <= 0, we want to check that the window's default size if
1201 /* To account for things like menu bars, window decorations etc..
1220 ANEW0(window);
1222 window->shrink_scale = scale;
1223 window->shrink = (scale != 1.0);
1224 window->scaler = skin_scaler_create();
1225 window->no_display = no_display;
1228 window->enable_touch = 1;
1229 window->enable_trackball = 1;
1230 window->enable_dpad = 1;
1231 window->enable_qwerty = 1;
1233 window->x_pos = x;
1234 window->y_pos = y;
1236 if (skin_window_reset_internal(window, slayout) < 0) {
1237 skin_window_free(window);
1242 /* Check that the window is fully visible */
1243 if ( !window->no_display && !SDL_WM_IsFullyVisible(0) ) {
1250 win_w = window->surface->w;
1251 win_h = window->surface->h;
1253 /* First, we recenter the window */
1263 dprint( "emulator window was out of view and was recentered\n" );
1266 skin_window_show_opengles(window);
1268 return window;
1272 skin_window_enable_touch( SkinWindow* window, int enabled )
1274 window->enable_touch = !!enabled;
1278 skin_window_enable_trackball( SkinWindow* window, int enabled )
1280 window->enable_trackball = !!enabled;
1284 skin_window_enable_dpad( SkinWindow* window, int enabled )
1286 window->enable_dpad = !!enabled;
1290 skin_window_enable_qwerty( SkinWindow* window, int enabled )
1292 window->enable_qwerty = !!enabled;
1296 skin_window_set_title( SkinWindow* window, const char* title )
1298 if (window && title)
1303 skin_window_resize( SkinWindow* window )
1305 if ( !window->no_display )
1306 skin_window_hide_opengles(window);
1308 /* now resize window */
1309 if (window->surface) {
1310 SDL_FreeSurface(window->surface);
1311 window->surface = NULL;
1314 if (window->shrink_surface) {
1315 SDL_FreeSurface(window->shrink_surface);
1316 window->shrink_surface = NULL;
1319 if (window->shrink_pixels) {
1320 AFREE(window->shrink_pixels);
1321 window->shrink_pixels = NULL;
1324 if ( !window->no_display ) {
1325 int layout_w = window->layout.rect.size.w;
1326 int layout_h = window->layout.rect.size.h;
1329 int window_x = window->x_pos;
1330 int window_y = window->y_pos;
1334 int fullscreen = window->fullscreen;
1354 else if (window->shrink) {
1355 scale = window->shrink_scale;
1373 fprintf(stderr, "### Error: could not create or resize SDL window: %s\n", SDL_GetError() );
1379 window->effective_scale = scale;
1380 window->effective_x = 0;
1381 window->effective_y = 0;
1384 window->effective_x = (window_w - layout_w*scale)*0.5;
1385 window->effective_y = (window_h - layout_h*scale)*0.5;
1390 window->surface = surface;
1391 skin_scaler_set( window->scaler, 1.0, 0, 0 );
1398 window->shrink_surface = surface;
1399 AARRAY_NEW0(window->shrink_pixels, window_w * window_h * 4);
1400 if (window->shrink_pixels == NULL) {
1404 window->surface = sdl_surface_from_argb32( window->shrink_pixels, window_w, window_h );
1405 if (window->surface == NULL) {
1406 fprintf(stderr, "### Error: could not create or resize SDL window: %s\n", SDL_GetError() );
1409 skin_scaler_set( window->scaler, scale, window->effective_x, window->effective_y );
1412 skin_window_show_opengles(window);
1417 skin_window_reset_internal ( SkinWindow* window, SkinLayout* slayout )
1425 layout_done( &window->layout );
1426 window->layout = layout;
1428 disp = window->layout.displays;
1429 if (disp != NULL && window->onion)
1431 window->onion,
1432 window->onion_rotation,
1433 window->onion_alpha );
1435 skin_window_resize(window);
1437 finger_state_reset( &window->finger );
1438 button_state_reset( &window->button );
1439 ball_state_reset( &window->ball, window );
1441 skin_window_redraw( window, NULL );
1456 skin_window_reset ( SkinWindow* window, SkinLayout* slayout )
1458 if (!window->fullscreen) {
1459 SDL_WM_GetPos(&window->x_pos, &window->y_pos);
1461 if (skin_window_reset_internal( window, slayout ) < 0)
1468 skin_window_set_lcd_brightness( SkinWindow* window, int brightness )
1470 ADisplay* disp = window->layout.displays;
1474 skin_window_redraw( window, NULL );
1479 skin_window_free ( SkinWindow* window )
1481 if (window) {
1482 if (window->surface) {
1483 SDL_FreeSurface(window->surface);
1484 window->surface = NULL;
1486 if (window->shrink_surface) {
1487 SDL_FreeSurface(window->shrink_surface);
1488 window->shrink_surface = NULL;
1490 if (window->shrink_pixels) {
1491 AFREE(window->shrink_pixels);
1492 window->shrink_pixels = NULL;
1494 if (window->onion) {
1495 skin_image_unref( &window->onion );
1496 window->onion_rotation = SKIN_ROTATION_0;
1498 if (window->scaler) {
1499 skin_scaler_free(window->scaler);
1500 window->scaler = NULL;
1502 layout_done( &window->layout );
1503 AFREE(window);
1508 skin_window_set_onion( SkinWindow* window,
1514 SkinImage* old = window->onion;
1516 window->onion = skin_image_ref(onion);
1517 window->onion_rotation = onion_rotation;
1518 window->onion_alpha = onion_alpha;
1522 disp = window->layout.displays;
1525 display_set_onion( disp, window->onion, onion_rotation, onion_alpha );
1529 skin_window_update_shrink( SkinWindow* window, SkinRect* rect )
1531 skin_scaler_scale( window->scaler, window->shrink_surface, window->surface,
1536 skin_window_set_scale( SkinWindow* window, double scale )
1538 window->shrink = (scale != 1.0);
1539 window->shrink_scale = scale;
1541 skin_window_resize( window );
1542 skin_window_redraw( window, NULL );
1546 skin_window_redraw( SkinWindow* window, SkinRect* rect )
1548 if (window != NULL && window->surface != NULL) {
1549 Layout* layout = &window->layout;
1564 SDL_FillRect( window->surface, &rd, layout->color );
1572 background_redraw( back, rect, window->surface );
1579 display_redraw( disp, rect, window->surface );
1586 button_redraw( button, rect, window->surface );
1589 if ( window->ball.tracking )
1590 ball_state_redraw( &window->ball, rect, window->surface );
1592 if (window->effective_scale != 1.0)
1593 skin_window_update_shrink( window, rect );
1602 SDL_UpdateRects( window->surface, 1, &rd );
1604 skin_window_redraw_opengles( window );
1609 skin_window_toggle_fullscreen( SkinWindow* window )
1611 if (window && window->surface) {
1612 if (!window->fullscreen)
1613 SDL_WM_GetPos( &window->x_pos, &window->y_pos );
1615 window->fullscreen = !window->fullscreen;
1616 skin_window_resize( window );
1617 skin_window_redraw( window, NULL );
1622 skin_window_get_display( SkinWindow* window, ADisplayInfo *info )
1624 ADisplay* disp = window->layout.displays;
1641 skin_window_map_to_scale( SkinWindow* window, int *x, int *y )
1643 *x = (*x - window->effective_x) / window->effective_scale;
1644 *y = (*y - window->effective_y) / window->effective_scale;
1648 skin_window_process_event( SkinWindow* window, SDL_Event* ev )
1653 if (!window->surface)
1658 if ( window->ball.tracking ) {
1659 skin_window_trackball_press( window, 1 );
1665 skin_window_map_to_scale( window, &mx, &my );
1666 skin_window_move_mouse( window, mx, my );
1667 skin_window_find_finger( window, mx, my );
1670 ev->button.x, ev->button.y, window->finger.pos.x,
1671 window->finger.pos.y, window->finger.inside);
1673 if (window->finger.inside) {
1674 window->finger.tracking = 1;
1675 add_finger_event(window->finger.pos.x, window->finger.pos.y, 1);
1677 window->button.pressed = NULL;
1678 button = window->button.hover;
1681 skin_window_redraw( window, &button->rect );
1682 window->button.pressed = button;
1691 if ( window->ball.tracking ) {
1692 skin_window_trackball_press( window, 0 );
1695 button = window->button.pressed;
1698 skin_window_map_to_scale( window, &mx, &my );
1702 skin_window_redraw( window, &button->rect );
1706 window->button.pressed = NULL;
1707 window->button.hover = NULL;
1708 skin_window_move_mouse( window, mx, my );
1710 else if (window->finger.tracking)
1712 skin_window_move_mouse( window, mx, my );
1713 window->finger.tracking = 0;
1714 add_finger_event( window->finger.pos.x, window->finger.pos.y, 0);
1719 if ( window->ball.tracking ) {
1720 skin_window_trackball_move( window, ev->motion.xrel, ev->motion.yrel );
1725 skin_window_map_to_scale( window, &mx, &my );
1726 if ( !window->button.pressed )
1728 window, mx, my );
1729 if ( window->finger.tracking ) {
1730 add_finger_event( window->finger.pos.x, window->finger.pos.y, 1 );
1736 skin_window_redraw_opengles(window);
1742 skin_window_display( SkinWindow* window )
1744 return window->layout.displays;
1748 skin_window_update_display( SkinWindow* window, int x, int y, int w, int h )
1750 ADisplay* disp = skin_window_display(window);
1752 if ( !window->surface )
1766 if (window->effective_scale != 1.0)
1767 skin_window_redraw( window, &r );
1769 display_redraw( disp, &r, window->surface );