mirror of
https://github.com/brl/mutter.git
synced 2024-12-24 12:02:04 +00:00
Coding style consistency
Channel mitch's spirit. This is also how I get to have the highest commit count on Clutter's repository.
This commit is contained in:
parent
d10f7127a2
commit
d84a88ac3b
@ -1888,14 +1888,12 @@ clutter_text_action_move_down (ClutterText *ttext,
|
|||||||
else
|
else
|
||||||
priv->x_pos = x;
|
priv->x_pos = x;
|
||||||
|
|
||||||
layout_line = pango_layout_get_line_readonly (
|
layout_line =
|
||||||
clutter_text_get_layout (ttext),
|
pango_layout_get_line_readonly (clutter_text_get_layout (ttext),
|
||||||
line_no + 1);
|
line_no + 1);
|
||||||
|
|
||||||
if (!layout_line)
|
if (!layout_line)
|
||||||
{
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
|
||||||
|
|
||||||
pango_layout_line_x_to_index (layout_line, x, &index_, NULL);
|
pango_layout_line_x_to_index (layout_line, x, &index_, NULL);
|
||||||
|
|
||||||
@ -1919,9 +1917,11 @@ clutter_text_action_move_start (ClutterText *ttext,
|
|||||||
ClutterTextPrivate *priv = ttext->priv;
|
ClutterTextPrivate *priv = ttext->priv;
|
||||||
|
|
||||||
clutter_text_set_cursor_position (ttext, 0);
|
clutter_text_set_cursor_position (ttext, 0);
|
||||||
|
|
||||||
if (!(priv->selectable && event &&
|
if (!(priv->selectable && event &&
|
||||||
(event->key.modifier_state & CLUTTER_SHIFT_MASK)))
|
(event->key.modifier_state & CLUTTER_SHIFT_MASK)))
|
||||||
clutter_text_clear_selection (ttext);
|
clutter_text_clear_selection (ttext);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1962,9 +1962,8 @@ clutter_text_action_move_start_line (ClutterText *ttext,
|
|||||||
&line_no,
|
&line_no,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
layout_line = pango_layout_get_line_readonly (
|
layout_line =
|
||||||
clutter_text_get_layout (ttext),
|
pango_layout_get_line_readonly (clutter_text_get_layout (ttext), line_no);
|
||||||
line_no);
|
|
||||||
|
|
||||||
pango_layout_line_x_to_index (layout_line, 0, &index_, NULL);
|
pango_layout_line_x_to_index (layout_line, 0, &index_, NULL);
|
||||||
|
|
||||||
@ -2002,9 +2001,8 @@ clutter_text_action_move_end_line (ClutterText *ttext,
|
|||||||
&line_no,
|
&line_no,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
layout_line = pango_layout_get_line_readonly (
|
layout_line =
|
||||||
clutter_text_get_layout (ttext),
|
pango_layout_get_line_readonly (clutter_text_get_layout (ttext), line_no);
|
||||||
line_no);
|
|
||||||
|
|
||||||
pango_layout_line_x_to_index (layout_line, G_MAXINT, &index_, &trailing);
|
pango_layout_line_x_to_index (layout_line, G_MAXINT, &index_, &trailing);
|
||||||
index_ += trailing;
|
index_ += trailing;
|
||||||
@ -2075,11 +2073,13 @@ clutter_text_action_delete_previous (ClutterText *ttext,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void init_commands (ClutterText *ttext)
|
static void
|
||||||
|
init_commands (ClutterText *ttext)
|
||||||
{
|
{
|
||||||
ClutterTextPrivate *priv = ttext->priv;
|
ClutterTextPrivate *priv = ttext->priv;
|
||||||
if (priv->commands)
|
if (priv->commands)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
clutter_text_add_action (ttext, "move-left", clutter_text_action_move_left);
|
clutter_text_add_action (ttext, "move-left", clutter_text_action_move_left);
|
||||||
clutter_text_add_action (ttext, "move-right", clutter_text_action_move_right);
|
clutter_text_add_action (ttext, "move-right", clutter_text_action_move_right);
|
||||||
clutter_text_add_action (ttext, "move-up", clutter_text_action_move_up);
|
clutter_text_add_action (ttext, "move-up", clutter_text_action_move_up);
|
||||||
@ -2137,18 +2137,18 @@ clutter_text_get_font_name (ClutterText *text)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
clutter_text_set_font_name (ClutterText *text,
|
clutter_text_set_font_name (ClutterText *self,
|
||||||
const gchar *font_name)
|
const gchar *font_name)
|
||||||
{
|
{
|
||||||
ClutterTextPrivate *priv;
|
ClutterTextPrivate *priv;
|
||||||
PangoFontDescription *desc;
|
PangoFontDescription *desc;
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_TEXT (text));
|
g_return_if_fail (CLUTTER_IS_TEXT (self));
|
||||||
|
|
||||||
if (!font_name || font_name[0] == '\0')
|
if (!font_name || font_name[0] == '\0')
|
||||||
font_name = DEFAULT_FONT_NAME;
|
font_name = DEFAULT_FONT_NAME;
|
||||||
|
|
||||||
priv = text->priv;
|
priv = self->priv;
|
||||||
|
|
||||||
if (priv->font_name && strcmp (priv->font_name, font_name) == 0)
|
if (priv->font_name && strcmp (priv->font_name, font_name) == 0)
|
||||||
return;
|
return;
|
||||||
@ -2170,20 +2170,20 @@ clutter_text_set_font_name (ClutterText *text,
|
|||||||
|
|
||||||
priv->font_desc = desc;
|
priv->font_desc = desc;
|
||||||
|
|
||||||
clutter_text_dirty_cache (text);
|
clutter_text_dirty_cache (self);
|
||||||
|
|
||||||
if (priv->text && priv->text[0] != '\0')
|
if (priv->text && priv->text[0] != '\0')
|
||||||
clutter_actor_queue_relayout (CLUTTER_ACTOR (text));
|
clutter_actor_queue_relayout (CLUTTER_ACTOR (self));
|
||||||
|
|
||||||
g_object_notify (G_OBJECT (text), "font-name");
|
g_object_notify (G_OBJECT (self), "font-name");
|
||||||
}
|
}
|
||||||
|
|
||||||
G_CONST_RETURN gchar *
|
G_CONST_RETURN gchar *
|
||||||
clutter_text_get_text (ClutterText *text)
|
clutter_text_get_text (ClutterText *self)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (CLUTTER_IS_TEXT (text), NULL);
|
g_return_val_if_fail (CLUTTER_IS_TEXT (self), NULL);
|
||||||
|
|
||||||
return text->priv->text;
|
return self->priv->text;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -2241,46 +2241,46 @@ clutter_text_set_text (ClutterText *self,
|
|||||||
}
|
}
|
||||||
|
|
||||||
PangoLayout *
|
PangoLayout *
|
||||||
clutter_text_get_layout (ClutterText *text)
|
clutter_text_get_layout (ClutterText *self)
|
||||||
{
|
{
|
||||||
ClutterUnit width;
|
ClutterUnit width;
|
||||||
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_TEXT (text), NULL);
|
g_return_val_if_fail (CLUTTER_IS_TEXT (self), NULL);
|
||||||
|
|
||||||
width = clutter_actor_get_widthu (CLUTTER_ACTOR (text));
|
width = clutter_actor_get_widthu (CLUTTER_ACTOR (self));
|
||||||
|
|
||||||
return clutter_text_create_layout (text, width);
|
return clutter_text_create_layout (self, width);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
clutter_text_set_color (ClutterText *text,
|
clutter_text_set_color (ClutterText *self,
|
||||||
const ClutterColor *color)
|
const ClutterColor *color)
|
||||||
{
|
{
|
||||||
ClutterTextPrivate *priv;
|
ClutterTextPrivate *priv;
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_TEXT (text));
|
g_return_if_fail (CLUTTER_IS_TEXT (self));
|
||||||
g_return_if_fail (color != NULL);
|
g_return_if_fail (color != NULL);
|
||||||
|
|
||||||
priv = text->priv;
|
priv = self->priv;
|
||||||
|
|
||||||
priv->text_color = *color;
|
priv->text_color = *color;
|
||||||
|
|
||||||
if (CLUTTER_ACTOR_IS_VISIBLE (text))
|
if (CLUTTER_ACTOR_IS_VISIBLE (self))
|
||||||
clutter_actor_queue_redraw (CLUTTER_ACTOR (text));
|
clutter_actor_queue_redraw (CLUTTER_ACTOR (self));
|
||||||
|
|
||||||
g_object_notify (G_OBJECT (text), "color");
|
g_object_notify (G_OBJECT (self), "color");
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
clutter_text_get_color (ClutterText *text,
|
clutter_text_get_color (ClutterText *self,
|
||||||
ClutterColor *color)
|
ClutterColor *color)
|
||||||
{
|
{
|
||||||
ClutterTextPrivate *priv;
|
ClutterTextPrivate *priv;
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_TEXT (text));
|
g_return_if_fail (CLUTTER_IS_TEXT (self));
|
||||||
g_return_if_fail (color != NULL);
|
g_return_if_fail (color != NULL);
|
||||||
|
|
||||||
priv = text->priv;
|
priv = self->priv;
|
||||||
|
|
||||||
*color = priv->text_color;
|
*color = priv->text_color;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user