Beispiel #1
0
void widget::draw() const
{
	if(visible_) {
		color_save_context color_saver;

		GLint src = 0;
		GLint dst = 0;
#if !defined(USE_SHADERS)
			glGetIntegerv(GL_BLEND_SRC, &src);
			glGetIntegerv(GL_BLEND_DST, &dst);
#endif
			glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
		if(disabled_) {
			glColor4ub(255, 255, 255, disabled_opacity_);
		} else if(display_alpha_ < 256) {
			glColor4ub(255, 255, 255, display_alpha_);
		}
		if(frame_set_ != NULL) {
			frame_set_->blit(x() - get_pad_width() - frame_set_->corner_height(),
				y() - get_pad_height() - frame_set_->corner_height(), 
				width() + get_pad_width()*2 + 2*frame_set_->corner_height(), 
				height() + get_pad_height()*2 + 2*frame_set_->corner_height(), resolution_ != 0);
		}

		if(clip_area_) {
			const graphics::clip_scope clipping_scope(clip_area_->sdl_rect());
			handle_draw();
		} else {
			handle_draw();
		}
#if !defined(USE_SHADERS)
		glBlendFunc(src, dst);
#endif
	}
}
Beispiel #2
0
void Int_Slider::draw()
{
    const Box2i & geom = this->geom();

    const bool inside = Abstract_Widget::inside();

    fl_color(FL_BACKGROUND2_COLOR);
    fl_rectf(geom.x, geom.y, geom.w, geom.h);

    Abstract_Slider::draw();

    handle_draw(
        min() != max() ?
        ((get() - min()) / static_cast<double>(max() - min())) :
        0.0,
        frame_geom(),
        inside);
}
Beispiel #3
0
void widget::draw() const
{
	if(visible_) {
		GLint src = 0;
		GLint dst = 0;
		if(disabled_) {
#if !defined(USE_GLES2)
			glGetIntegerv(GL_BLEND_SRC, &src);
			glGetIntegerv(GL_BLEND_DST, &dst);
#endif
			glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
			glColor4ub(255, 255, 255, disabled_opacity_);
		}
		handle_draw();
		if(disabled_) {
#if !defined(USE_GLES2)
			glBlendFunc(src, dst);
#endif
			glColor4ub(255, 255, 255, 255);
		}
	}
}
Beispiel #4
0
void
ddisplay_render_pixmap(DDisplay *ddisp, Rectangle *update)
{
  GList *list;
  DiaObject *obj;
  int i;
  DiaInteractiveRendererInterface *renderer;
#ifdef TRACES
  GTimer *timer;
#endif
  
  if (ddisp->renderer==NULL) {
    printf("ERROR! Renderer was NULL!!\n");
    return;
  }

  renderer = DIA_GET_INTERACTIVE_RENDERER_INTERFACE (ddisp->renderer);

  /* Erase background */
  g_return_if_fail (renderer->fill_pixel_rect != NULL);
  DIA_RENDERER_GET_CLASS(ddisp->renderer)->begin_render(ddisp->renderer, update);
  if (update) {
    int x0, y0, x1, y1;

    ddisplay_transform_coords (ddisp, update->left, update->top, &x0, &y0);
    ddisplay_transform_coords (ddisp, update->right, update->bottom, &x1, &y1);
    renderer->fill_pixel_rect (ddisp->renderer,
			       x0, y0, x1-x0, y1-y0,
			       &ddisp->diagram->data->bg_color);
  } else
    renderer->fill_pixel_rect (ddisp->renderer,
			       0, 0,
		               dia_renderer_get_width_pixels (ddisp->renderer),
			       dia_renderer_get_height_pixels (ddisp->renderer),
			       &ddisp->diagram->data->bg_color);

  /* Draw grid */
  grid_draw(ddisp, update);
  pagebreak_draw(ddisp, update);

#ifdef TRACES
  timer = g_timer_new();
#endif
  data_render(ddisp->diagram->data, ddisp->renderer, update,
	      ddisplay_obj_render, (gpointer) ddisp);
#ifdef TRACES
  g_print ("data_render(%g%%) took %g seconds\n", ddisp->zoom_factor * 5.0, g_timer_elapsed (timer, NULL));
  g_timer_destroy (timer);
#endif
  /* Draw handles for all selected objects */
  list = ddisp->diagram->data->selected;
  while (list!=NULL) {
    obj = (DiaObject *) list->data;

    for (i=0;i<obj->num_handles;i++) {
       handle_draw(obj->handles[i], ddisp);
     }
    list = g_list_next(list);
  }
  DIA_RENDERER_GET_CLASS(ddisp->renderer)->end_render(ddisp->renderer);
}
Beispiel #5
0
			void draw() const {
				handle_draw();
			}
Beispiel #6
0
	void draw() const { if(visible_) { handle_draw(); } }