[gtk+/gtk-2-90: 200/200] Use accessor functions to access GtkLabel variables
- From: Javier Jardón <jjardon src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-2-90: 200/200] Use accessor functions to access GtkLabel variables
- Date: Mon, 3 May 2010 00:13:24 +0000 (UTC)
commit 0de8601327d541f644dc1882c99f44551870a7ab
Author: Javier Jardón <jjardon gnome org>
Date: Sat Mar 27 06:19:10 2010 +0100
Use accessor functions to access GtkLabel variables
gtk/gtknotebook.c | 8 ++++----
modules/other/gail/gaillabel.c | 16 ++++++++++------
2 files changed, 14 insertions(+), 10 deletions(-)
---
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index dca698b..62008ba 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -3749,7 +3749,7 @@ gtk_notebook_get_child_property (GtkContainer *container,
label = gtk_notebook_get_tab_label (notebook, child);
if (GTK_IS_LABEL (label))
- g_value_set_string (value, GTK_LABEL (label)->label);
+ g_value_set_string (value, gtk_label_get_label (GTK_LABEL (label)));
else
g_value_set_string (value, NULL);
break;
@@ -3757,7 +3757,7 @@ gtk_notebook_get_child_property (GtkContainer *container,
label = gtk_notebook_get_menu_label (notebook, child);
if (GTK_IS_LABEL (label))
- g_value_set_string (value, GTK_LABEL (label)->label);
+ g_value_set_string (value, gtk_label_get_label (GTK_LABEL (label)));
else
g_value_set_string (value, NULL);
break;
@@ -4643,7 +4643,7 @@ gtk_notebook_update_labels (GtkNotebook *notebook)
{
if (GTK_IS_LABEL (page->tab_label))
gtk_label_set_text (GTK_LABEL (page->menu_label),
- GTK_LABEL (page->tab_label)->label);
+ gtk_label_get_label (GTK_LABEL (page->tab_label)));
else
gtk_label_set_text (GTK_LABEL (page->menu_label), string);
}
@@ -6189,7 +6189,7 @@ gtk_notebook_menu_item_create (GtkNotebook *notebook,
if (page->default_menu)
{
if (GTK_IS_LABEL (page->tab_label))
- page->menu_label = gtk_label_new (GTK_LABEL (page->tab_label)->label);
+ page->menu_label = gtk_label_new (gtk_label_get_label (GTK_LABEL (page->tab_label)));
else
page->menu_label = gtk_label_new ("");
gtk_misc_set_alignment (GTK_MISC (page->menu_label), 0.0, 0.5);
diff --git a/modules/other/gail/gaillabel.c b/modules/other/gail/gaillabel.c
index 6653e72..c6d0278 100644
--- a/modules/other/gail/gaillabel.c
+++ b/modules/other/gail/gaillabel.c
@@ -457,7 +457,7 @@ gail_label_ref_relation_set (AtkObject *obj)
*
* The relation set is not updated if the mnemonic widget is changed
*/
- GtkWidget *mnemonic_widget = GTK_LABEL (widget)->mnemonic_widget;
+ GtkWidget *mnemonic_widget = gtk_label_get_mnemonic_widget (GTK_LABEL (widget));
if (mnemonic_widget)
{
@@ -726,7 +726,7 @@ gail_label_set_caret_offset (AtkText *text,
if (gtk_label_get_selectable (label) &&
offset >= 0 &&
- offset <= g_utf8_strlen (label->text, -1))
+ offset <= g_utf8_strlen (gtk_label_get_text (label), -1))
{
gtk_label_select_region (label, offset, offset);
return TRUE;
@@ -896,6 +896,7 @@ gail_label_get_character_extents (AtkText *text,
GtkWidget *widget;
GtkLabel *label;
PangoRectangle char_rect;
+ const gchar *label_text;
gint index, x_layout, y_layout;
widget = GTK_ACCESSIBLE (text)->widget;
@@ -907,7 +908,8 @@ gail_label_get_character_extents (AtkText *text,
label = GTK_LABEL (widget);
gtk_label_get_layout_offsets (label, &x_layout, &y_layout);
- index = g_utf8_offset_to_pointer (label->text, offset) - label->text;
+ label_text = gtk_label_get_text (label);
+ index = g_utf8_offset_to_pointer (label_text, offset) - label_text;
pango_layout_index_to_pos (gtk_label_get_layout (label), index, &char_rect);
gail_misc_get_extents_from_pango_rectangle (widget, &char_rect,
@@ -922,6 +924,7 @@ gail_label_get_offset_at_point (AtkText *text,
{
GtkWidget *widget;
GtkLabel *label;
+ const gchar *label_text;
gint index, x_layout, y_layout;
widget = GTK_ACCESSIBLE (text)->widget;
@@ -935,15 +938,16 @@ gail_label_get_offset_at_point (AtkText *text,
index = gail_misc_get_index_at_point_in_layout (widget,
gtk_label_get_layout (label),
x_layout, y_layout, x, y, coords);
+ label_text = gtk_label_get_text (label);
if (index == -1)
{
if (coords == ATK_XY_WINDOW || coords == ATK_XY_SCREEN)
- return g_utf8_strlen (label->text, -1);
+ return g_utf8_strlen (label_text, -1);
return index;
}
else
- return g_utf8_pointer_to_offset (label->text, label->text + index);
+ return g_utf8_pointer_to_offset (label_text, label_text + index);
}
static AtkAttributeSet*
@@ -983,7 +987,7 @@ gail_label_get_run_attributes (AtkText *text,
at_set = gail_misc_layout_get_run_attributes (at_set,
gtk_label_get_layout (label),
- label->text,
+ gtk_label_get_text (label),
offset,
start_offset,
end_offset);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]