Commit 5af094cd1f08f4287c0585d5664441054eb39105
1 parent
3c3aa221
Exists in
master
and in
5 other branches
Trabalhando com acessibilidade
Showing
3 changed files
with
39 additions
and
11 deletions
Show diff stats
src/gtk/v3270/accessible.c
@@ -83,24 +83,50 @@ static const gchar * v3270_accessible_get_description (AtkObject *accessible) | @@ -83,24 +83,50 @@ static const gchar * v3270_accessible_get_description (AtkObject *accessible) | ||
83 | return _( "3270 screen" ); | 83 | return _( "3270 screen" ); |
84 | } | 84 | } |
85 | 85 | ||
86 | +static void v3270_accessible_focus_event(AtkObject *obj, gboolean focus_in) | ||
87 | +{ | ||
88 | + AtkObject *focus_obj = g_object_get_data (G_OBJECT (obj), "gail-focus-object"); | ||
89 | + | ||
90 | + if(focus_obj == NULL) | ||
91 | + focus_obj = obj; | ||
92 | + | ||
93 | + atk_object_notify_state_change(focus_obj, ATK_STATE_FOCUSED, focus_in); | ||
94 | +} | ||
95 | + | ||
96 | +static AtkAttributeSet * v3270_accessible_get_attributes (AtkObject *obj) | ||
97 | +{ | ||
98 | + AtkAttributeSet * attributes; | ||
99 | + AtkAttribute * toolkit = g_new(AtkAttribute, 1); | ||
100 | + | ||
101 | + toolkit->name = g_strdup("toolkit"); | ||
102 | + toolkit->value = g_strdup("gtk"); | ||
103 | + | ||
104 | + attributes = g_slist_append (NULL, toolkit); | ||
105 | + | ||
106 | + return attributes; | ||
107 | +} | ||
108 | + | ||
109 | +static void v3270_accessible_initialize (AtkObject *obj, gpointer data) | ||
110 | +{ | ||
111 | + obj->role = ATK_ROLE_TEXT; | ||
112 | +} | ||
113 | + | ||
86 | static void v3270_accessible_class_init(v3270AccessibleClass *klass) | 114 | static void v3270_accessible_class_init(v3270AccessibleClass *klass) |
87 | { | 115 | { |
88 | AtkObjectClass *class = ATK_OBJECT_CLASS (klass); | 116 | AtkObjectClass *class = ATK_OBJECT_CLASS (klass); |
89 | 117 | ||
90 | - class->get_description = v3270_accessible_get_description; | 118 | + class->get_description = v3270_accessible_get_description; |
119 | + class->focus_event = v3270_accessible_focus_event; | ||
120 | + class->get_attributes = v3270_accessible_get_attributes; | ||
121 | + class->initialize = v3270_accessible_initialize; | ||
91 | 122 | ||
92 | /* | 123 | /* |
93 | - class->focus_event = gtk_widget_accessible_focus_event; | ||
94 | - | ||
95 | klass->notify_gtk = gtk_widget_accessible_notify_gtk; | 124 | klass->notify_gtk = gtk_widget_accessible_notify_gtk; |
96 | 125 | ||
97 | class->get_parent = gtk_widget_accessible_get_parent; | 126 | class->get_parent = gtk_widget_accessible_get_parent; |
98 | class->ref_relation_set = gtk_widget_accessible_ref_relation_set; | 127 | class->ref_relation_set = gtk_widget_accessible_ref_relation_set; |
99 | class->ref_state_set = gtk_widget_accessible_ref_state_set; | 128 | class->ref_state_set = gtk_widget_accessible_ref_state_set; |
100 | class->get_index_in_parent = gtk_widget_accessible_get_index_in_parent; | 129 | class->get_index_in_parent = gtk_widget_accessible_get_index_in_parent; |
101 | - class->initialize = gtk_widget_accessible_initialize; | ||
102 | - class->get_attributes = gtk_widget_accessible_get_attributes; | ||
103 | - class->focus_event = gtk_widget_accessible_focus_event; | ||
104 | */ | 130 | */ |
105 | } | 131 | } |
106 | 132 |
src/gtk/v3270/widget.c
@@ -616,8 +616,8 @@ static void update_model(H3270 *session, const char *name, int model, int rows, | @@ -616,8 +616,8 @@ static void update_model(H3270 *session, const char *name, int model, int rows, | ||
616 | 616 | ||
617 | static void changed(H3270 *session, int offset, int len) | 617 | static void changed(H3270 *session, int offset, int len) |
618 | { | 618 | { |
619 | - GtkWidget * widget = session->widget; | ||
620 | - AtkObject * obj = gtk_widget_get_accessible(widget); | 619 | + GtkWidget * widget = session->widget; |
620 | + GtkAccessible * obj = GTK_V3270(widget)->accessible; | ||
621 | 621 | ||
622 | trace("%s: offset=%d len=%d",__FUNCTION__,offset,len) | 622 | trace("%s: offset=%d len=%d",__FUNCTION__,offset,len) |
623 | 623 | ||
@@ -669,8 +669,8 @@ static void set_selection(H3270 *session, unsigned char status) | @@ -669,8 +669,8 @@ static void set_selection(H3270 *session, unsigned char status) | ||
669 | static void update_selection(H3270 *session, int start, int end) | 669 | static void update_selection(H3270 *session, int start, int end) |
670 | { | 670 | { |
671 | // Selected region changed | 671 | // Selected region changed |
672 | - GtkWidget * widget = GTK_WIDGET(session->widget); | ||
673 | - AtkObject * atk_obj = gtk_widget_get_accessible(widget); | 672 | + GtkWidget * widget = GTK_WIDGET(session->widget); |
673 | + GtkAccessible * atk_obj = GTK_V3270(widget)->accessible; | ||
674 | 674 | ||
675 | if(atk_obj) | 675 | if(atk_obj) |
676 | g_signal_emit_by_name(atk_obj,"text-selection-changed"); | 676 | g_signal_emit_by_name(atk_obj,"text-selection-changed"); |
@@ -1137,7 +1137,7 @@ int v3270_connect(GtkWidget *widget, const gchar *host) | @@ -1137,7 +1137,7 @@ int v3270_connect(GtkWidget *widget, const gchar *host) | ||
1137 | 1137 | ||
1138 | static gboolean notify_focus(GtkWidget *widget, GdkEventFocus *event) | 1138 | static gboolean notify_focus(GtkWidget *widget, GdkEventFocus *event) |
1139 | { | 1139 | { |
1140 | - AtkObject *obj = gtk_widget_get_accessible (widget); | 1140 | + GtkAccessible *obj = GTK_V3270(widget)->accessible; |
1141 | 1141 | ||
1142 | if(obj) | 1142 | if(obj) |
1143 | g_signal_emit_by_name (obj, "focus-event", event->in); | 1143 | g_signal_emit_by_name (obj, "focus-event", event->in); |
src/lib3270/selection.c
@@ -586,6 +586,7 @@ LIB3270_EXPORT int lib3270_drag_selection(H3270 *h, unsigned char flag, int orig | @@ -586,6 +586,7 @@ LIB3270_EXPORT int lib3270_drag_selection(H3270 *h, unsigned char flag, int orig | ||
586 | if(!lib3270_get_selection_bounds(h,&first,&last)) | 586 | if(!lib3270_get_selection_bounds(h,&first,&last)) |
587 | return origin; | 587 | return origin; |
588 | 588 | ||
589 | +/* | ||
589 | trace("%s: flag=%04x %s %s %s %s",__FUNCTION__, | 590 | trace("%s: flag=%04x %s %s %s %s",__FUNCTION__, |
590 | flag, | 591 | flag, |
591 | flag & SELECTION_LEFT ? "Left" : "-", | 592 | flag & SELECTION_LEFT ? "Left" : "-", |
@@ -593,6 +594,7 @@ LIB3270_EXPORT int lib3270_drag_selection(H3270 *h, unsigned char flag, int orig | @@ -593,6 +594,7 @@ LIB3270_EXPORT int lib3270_drag_selection(H3270 *h, unsigned char flag, int orig | ||
593 | flag & SELECTION_RIGHT ? "Right" : "-", | 594 | flag & SELECTION_RIGHT ? "Right" : "-", |
594 | flag & SELECTION_BOTTOM ? "Bottom" : "-" | 595 | flag & SELECTION_BOTTOM ? "Bottom" : "-" |
595 | ); | 596 | ); |
597 | +*/ | ||
596 | 598 | ||
597 | if(!flag) | 599 | if(!flag) |
598 | return origin; | 600 | return origin; |