예제 #1
0
파일: fb.cpp 프로젝트: ascendancy721/gnash
void
FBGui::setInvalidatedRegion(const SWFRect& bounds)
{
//  GNASH_REPORT_FUNCTION;

   setInvalidatedRegion(bounds);
}
예제 #2
0
bool
RiscosGui::run()
{
    GNASH_REPORT_FUNCTION;

    os_t t, now;
    wimp_block block;
    wimp_event_no event;
    osbool more;
    os_error *error;

    t = os_read_monotonic_time();

    while (!_quit) {
        error = xwimp_poll_idle(wimp_SAVE_FP, &block, t, NULL, &event);
        if (error) {
            log_debug("%s\n", error->errmess);
            return false;
        }

        switch (event) {
        case wimp_NULL_REASON_CODE:
            now = os_read_monotonic_time();
            if (now > t) {
                if (_timeout > now) {
                    _quit = true;
                } else {
                    // TODO: pay attention to interval
//            if ((os_t)_interval <= (now - t) * 10) {
                    advance_movie(this);
//            }
                    now = os_read_monotonic_time();
                    t = now + 10;
                }
            }
            break;
        case wimp_REDRAW_WINDOW_REQUEST:
            error = xwimp_redraw_window(&block.redraw, &more);
            if (error) {
                log_debug("%s\n", error->errmess);
                return false;
            }
            while (more) {
//          rect bounds(block.redraw.clip.x0 / 2, block.redraw.clip.y0 / 2,
//                      block.redraw.clip.x1 / 2, block.redraw.clip.y1 / 2);
//          log_debug("Clip rect: (%d, %d)(%d, %d)\n",
//                  block.redraw.clip.x0 / 2, block.redraw.clip.y0 / 2,
//                  block.redraw.clip.x1 / 2, block.redraw.clip.y1 / 2);
                // TODO: Make this use the clipping rectangle (convert to TWIPS)
                rect bounds(-1e10f, -1e10f, 1e10f, 1e10f);
#ifdef RENDERER_AGG
                setInvalidatedRegion(bounds);
#endif
                renderBuffer();
                error = xwimp_get_rectangle(&block.redraw, &more);
                if (error) {
                    log_debug("%s\n", error->errmess);
                    return false;
                }
            }
            break;
        case wimp_OPEN_WINDOW_REQUEST:
            error = xwimp_open_window(&block.open);
            if (error)
                log_debug("%s\n", error->errmess);
            break;
        case wimp_CLOSE_WINDOW_REQUEST:
            _quit = true;
            break;
        case wimp_POINTER_LEAVING_WINDOW:
            break;
        case wimp_POINTER_ENTERING_WINDOW:
            break;
        case wimp_MOUSE_CLICK:
            break;
        case wimp_USER_DRAG_BOX:
            break;
        case wimp_MENU_SELECTION:
            break;
        case wimp_SCROLL_REQUEST:
            break;
        case wimp_LOSE_CARET:
            break;
        case wimp_GAIN_CARET:
            break;
        case wimp_POLLWORD_NON_ZERO:
            break;
        case wimp_USER_MESSAGE:
        case wimp_USER_MESSAGE_RECORDED:
        case wimp_USER_MESSAGE_ACKNOWLEDGE:
            switch (block.message.action) {
            case message_QUIT:
                _quit = true;
                break;
            default:
//          user_message(event, &(block.message));
                break;
            }
            break;
        }
    }

    return true;
}