Ejemplo n.º 1
0
Archivo: textobj.c Proyecto: GNOME/dia
static ObjectChange *
_textobj_convert_to_path_callback (DiaObject *obj, Point *clicked, gpointer data)
{
  Textobj *textobj = (Textobj *)obj;
  const Text *text = textobj->text;
  DiaObject *path = NULL;

  if (!text_is_empty(text)) /* still screwed with empty lines ;) */
    path = create_standard_path_from_text (text);

  if (path) {
    ObjectChange *change;
    Color bg = textobj->fill_color;

    /* FIXME: otherwise object_substitue() will tint the text with bg */
    textobj->fill_color = text->color;
    change = object_substitute (obj, path);
    /* restore */
    textobj->fill_color = bg;

    return change;
  }
  /* silently fail */
  return change_list_create ();
}
Ejemplo n.º 2
0
static void
rendobj_draw(RenderObject *rend_obj, Renderer *renderer)
{
  render_store_render(rend_obj->desc->store,
		      renderer,
		      &rend_obj->element.corner,
		      rend_obj->magnify);
  if ( (rend_obj->desc->use_text) &&
       (!text_is_empty(rend_obj->text)) )
    text_draw(rend_obj->text, renderer);
}
Ejemplo n.º 3
0
int
text_delete_all(Text *text, ObjectChange **change, DiaObject *obj)
{
  if (!text_is_empty(text)) {
    *change = text_create_change(text, TYPE_DELETE_ALL,
				 0, text->cursor_pos, text->cursor_row,
				 obj);
    
    text_set_string(text, "");
    calc_ascent_descent(text);
    return TRUE;
  }
  return FALSE;
}