void draw ()
 {
   if (!inverted)
     w->invert_colors ();
   XFillRectangle (w->display, w->win, w->gc, box.ul.x, box.ul.y,
                                              box.width (), box.height ());
   w->default_colors ();
   XDrawRectangle (w->display, w->win, w->gc, box.ul.x, box.ul.y,
                                              box.width (), box.height ());
 }
Exemple #2
0
bool window::update_geometry( rect &r )
{
	SetWindowPos( _hwnd, NULL, r.x(), r.y(), r.width(), r.height(),
				  SWP_NOOWNERZORDER | SWP_NOZORDER );
	r = query_geometry();
	return true;
}
void OpenGL3RenderState::set_viewport(OpenGL3ContextState& state, const rect<int>& viewport) const
{
    if (state.viewport == viewport)
        return;
    glViewport(viewport.ll().x(), viewport.ll().y(), viewport.width(), viewport.height());
    state.viewport = viewport;
}
Exemple #4
0
void
RiscosGui::setInvalidatedRegion(const rect& bounds)
{
    // Note: Bounds coordinates are in TWIPS

#ifdef RENDERER_AGG
    // forward to renderer
    _renderer->set_invalidated_region(bounds);

    if (bounds.width() > 1e10f) {
        // Region is entire screen. Don't convert to integer as this will
        // overflow.

        m_draw_minx = 0;
        m_draw_miny = 0;
        m_draw_maxx = _width - 1;
        m_draw_maxy = _height - 1;
    } else {
        // remember for renderBuffer()
        _renderer->world_to_pixel(&m_draw_minx, &m_draw_miny,
                                  bounds.get_x_min(), bounds.get_y_min());
        _renderer->world_to_pixel(&m_draw_maxx, &m_draw_maxy,
                                  bounds.get_x_max(), bounds.get_y_max());

        // add two pixels because of anti-aliasing...
        m_draw_minx = valid_coord(m_draw_minx - 2, _width);
        m_draw_miny = valid_coord(m_draw_miny - 2, _height);
        m_draw_maxx = valid_coord(m_draw_maxx + 2, _width);
        m_draw_maxy = valid_coord(m_draw_maxy + 2, _height);
    }

//    log_debug("DrawRect: (%i, %i), (%i, %i)\n",
//            m_draw_minx, m_draw_miny, m_draw_maxx, m_draw_maxy);
#endif
}
Exemple #5
0
void context::reset_clip( const rect &r )
{
    glEnable( GL_SCISSOR_TEST );
    glScissor( static_cast<GLint>( r.x() ),
			   static_cast<GLint>( _last_vp[3] - ( r.y() + r.height() ) ),
			   static_cast<GLsizei>( r.width() ),
			   static_cast<GLsizei>( r.height() ) );
}
Exemple #6
0
 inline void initialize(device_context* dc, rect pr)
 {
     dc_       =  dc;
     rect_     =  pr = pr.normalize();
     poffset_  = -pr.left_top();
     prect_    =  pr;
     mask_     =  nullptr;
     canvas_   =  std::make_shared<canvas_type>(pr.width(), pr.height());
 }