mirror of https://github.com/GNOME/gimp.git
added gimp_text_layer_set(), a function that calls g_object_set() on the
2004-03-19 Sven Neumann <sven@gimp.org> * app/text/gimptextlayer.[ch]: added gimp_text_layer_set(), a function that calls g_object_set() on the text-layer's text object and pushes an undo step. * app/display/gimpdisplayshell-dnd.c (gimp_display_shell_bucket_fill): use the new function.
This commit is contained in:
parent
91b2f1e960
commit
520ee8b3ac
|
@ -1,3 +1,12 @@
|
|||
2004-03-19 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/text/gimptextlayer.[ch]: added gimp_text_layer_set(), a
|
||||
function that calls g_object_set() on the text-layer's text object
|
||||
and pushes an undo step.
|
||||
|
||||
* app/display/gimpdisplayshell-dnd.c (gimp_display_shell_bucket_fill):
|
||||
use the new function.
|
||||
|
||||
2004-03-19 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* HACKING: some minor updates.
|
||||
|
|
|
@ -191,9 +191,9 @@ gimp_display_shell_bucket_fill (GimpDisplayShell *shell,
|
|||
*/
|
||||
if (color && gimp_drawable_is_text_layer (drawable))
|
||||
{
|
||||
g_object_set (gimp_text_layer_get_text (GIMP_TEXT_LAYER (drawable)),
|
||||
"color", color,
|
||||
NULL);
|
||||
gimp_text_layer_set (GIMP_TEXT_LAYER (drawable), NULL,
|
||||
"color", color,
|
||||
NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -473,14 +473,30 @@ gimp_text_layer_get_text (GimpTextLayer *layer)
|
|||
return layer->text;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gimp_drawable_is_text_layer (GimpDrawable *drawable)
|
||||
void
|
||||
gimp_text_layer_set (GimpTextLayer *layer,
|
||||
const gchar *undo_desc,
|
||||
const gchar *first_property_name,
|
||||
...)
|
||||
{
|
||||
return (GIMP_IS_TEXT_LAYER (drawable) &&
|
||||
GIMP_TEXT_LAYER (drawable)->text &&
|
||||
GIMP_TEXT_LAYER (drawable)->modified == FALSE);
|
||||
}
|
||||
GimpText *text;
|
||||
va_list var_args;
|
||||
|
||||
g_return_if_fail (gimp_drawable_is_text_layer ((GimpDrawable *) layer));
|
||||
|
||||
text = gimp_text_layer_get_text (layer);
|
||||
if (! text)
|
||||
return;
|
||||
|
||||
gimp_image_undo_push_text_layer (gimp_item_get_image (GIMP_ITEM (layer)),
|
||||
undo_desc, layer);
|
||||
|
||||
va_start (var_args, first_property_name);
|
||||
|
||||
g_object_set_valist (G_OBJECT (text), first_property_name, var_args);
|
||||
|
||||
va_end (var_args);
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_text_layer_discard:
|
||||
|
@ -504,6 +520,15 @@ gimp_text_layer_discard (GimpTextLayer *layer)
|
|||
gimp_text_layer_set_text (layer, NULL);
|
||||
}
|
||||
|
||||
gboolean
|
||||
gimp_drawable_is_text_layer (GimpDrawable *drawable)
|
||||
{
|
||||
return (GIMP_IS_TEXT_LAYER (drawable) &&
|
||||
GIMP_TEXT_LAYER (drawable)->text &&
|
||||
GIMP_TEXT_LAYER (drawable)->modified == FALSE);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
gimp_text_layer_text_notify (GimpTextLayer *layer)
|
||||
{
|
||||
|
|
|
@ -63,6 +63,10 @@ GimpText * gimp_text_layer_get_text (GimpTextLayer *layer);
|
|||
void gimp_text_layer_set_text (GimpTextLayer *layer,
|
||||
GimpText *text);
|
||||
void gimp_text_layer_discard (GimpTextLayer *layer);
|
||||
void gimp_text_layer_set (GimpTextLayer *layer,
|
||||
const gchar *undo_desc,
|
||||
const gchar *first_property_name,
|
||||
...);
|
||||
|
||||
gboolean gimp_drawable_is_text_layer (GimpDrawable *drawable);
|
||||
|
||||
|
|
Loading…
Reference in New Issue