diff --git a/pw3270.cbp b/pw3270.cbp
index a60ada9..52bfda0 100644
--- a/pw3270.cbp
+++ b/pw3270.cbp
@@ -9,8 +9,8 @@
-
-
+
+
@@ -20,8 +20,8 @@
-
-
+
+
@@ -35,7 +35,7 @@
-
+
@@ -45,277 +45,281 @@
-
-
+
+
-
+
-
-
+
+
-
+
-
+
-
-
+
+
-
+
-
+
-
-
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
+
+
-
-
+
+
-
+
-
-
+
+
-
+
-
+
-
+
+
-
-
+
-
+
+
-
+
-
+
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
-
-
-
+
+
-
-
-
-
-
+
+
+
-
-
-
+
+
+
+
+
-
-
-
-
+
+
+
-
+
+
+
+
-
-
-
+
-
-
-
-
-
+
+
+
-
-
+
+
+
+
+
-
-
-
+
+
-
-
+
+
+
-
-
-
+
+
-
+
+
+
-
+
-
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
-
-
+
+
-
-
+
+
+
+
-
+
+
-
-
-
-
+
-
-
+
+
+
+
-
-
+
+
-
-
-
+
+
-
-
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
-
+
+
-
-
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
diff --git a/src/gtk/v3270/accessible.c b/src/gtk/v3270/accessible.c
index b851772..be54de3 100644
--- a/src/gtk/v3270/accessible.c
+++ b/src/gtk/v3270/accessible.c
@@ -28,6 +28,7 @@
*/
#include
+ #include
#include "v3270.h"
#include "accessible.h"
@@ -40,42 +41,56 @@
/*--[ Prototipes ]-----------------------------------------------------------------------------------*/
static void atk_editable_text_interface_init (AtkEditableTextIface *iface);
-static void atk_text_interface_init (AtkTextIface *iface);
-static void atk_action_interface_init (AtkActionIface *iface);
static void v3270_accessible_class_init (v3270AccessibleClass *klass);
static void v3270_accessible_init (v3270Accessible *widget);
/*--[ Widget definition ]----------------------------------------------------------------------------*/
G_DEFINE_TYPE_WITH_CODE (v3270Accessible, v3270_accessible, GTK_TYPE_V3270_ACCESSIBLE,
- G_IMPLEMENT_INTERFACE (ATK_TYPE_EDITABLE_TEXT, atk_editable_text_interface_init)
- G_IMPLEMENT_INTERFACE (ATK_TYPE_TEXT, atk_text_interface_init)
- G_IMPLEMENT_INTERFACE (ATK_TYPE_ACTION, atk_action_interface_init))
+ G_IMPLEMENT_INTERFACE (ATK_TYPE_EDITABLE_TEXT, atk_editable_text_interface_init) )
+
+// G_IMPLEMENT_INTERFACE (ATK_TYPE_ACTION, atk_action_interface_init)
+// G_IMPLEMENT_INTERFACE (ATK_TYPE_EDITABLE_TEXT, atk_editable_text_interface_init)
+// G_IMPLEMENT_INTERFACE (ATK_TYPE_TEXT, atk_text_interface_init)
/*--[ Implement ]------------------------------------------------------------------------------------*/
static void v3270_accessible_class_init(v3270AccessibleClass *klass)
{
-
+ trace("******************************* %s",__FUNCTION__);
+/*
+ AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
+
+ klass->notify_gtk = gtk_widget_accessible_notify_gtk;
+
+ class->get_description = gtk_widget_accessible_get_description;
+ class->get_parent = gtk_widget_accessible_get_parent;
+ class->ref_relation_set = gtk_widget_accessible_ref_relation_set;
+ class->ref_state_set = gtk_widget_accessible_ref_state_set;
+ class->get_index_in_parent = gtk_widget_accessible_get_index_in_parent;
+ class->initialize = gtk_widget_accessible_initialize;
+ class->get_attributes = gtk_widget_accessible_get_attributes;
+ class->focus_event = gtk_widget_accessible_focus_event;
+*/
}
static void v3270_accessible_init(v3270Accessible *widget)
{
+ trace("*********************************** %s",__FUNCTION__);
}
static void atk_editable_text_interface_init(AtkEditableTextIface *iface)
{
-
-}
-
-static void atk_text_interface_init(AtkTextIface *iface)
-{
-
-}
-
-static void atk_action_interface_init(AtkActionIface *iface)
-{
-
+ trace("********************************** %s",__FUNCTION__);
+/*
+ iface->set_text_contents = gtk_entry_accessible_set_text_contents;
+ iface->insert_text = gtk_entry_accessible_insert_text;
+ iface->copy_text = gtk_entry_accessible_copy_text;
+ iface->cut_text = gtk_entry_accessible_cut_text;
+ iface->delete_text = gtk_entry_accessible_delete_text;
+ iface->paste_text = gtk_entry_accessible_paste_text;
+ iface->set_run_attributes = NULL;
+*/
}
diff --git a/src/gtk/v3270/accessible.h b/src/gtk/v3270/accessible.h
index c6b4f23..b679d9f 100644
--- a/src/gtk/v3270/accessible.h
+++ b/src/gtk/v3270/accessible.h
@@ -55,4 +55,7 @@ struct _v3270AccessibleClass
};
+GType v3270_accessible_get_type(void);
+
+
G_END_DECLS
diff --git a/src/gtk/v3270/v3270.h b/src/gtk/v3270/v3270.h
index 387354c..2b5accc 100644
--- a/src/gtk/v3270/v3270.h
+++ b/src/gtk/v3270/v3270.h
@@ -145,7 +145,7 @@
{
GtkWidget parent;
- /* private */
+ // private
int selecting : 1; /**< Selecting region */
int moving : 1; /**< Moving selected region */
int resizing : 1; /**< Resizing selected region */
@@ -166,7 +166,7 @@
unsigned char pointer; /** Mouse pointer ID */
int selection_addr; /** Selection addr */
- /* Font info */
+ // Font info
gchar * font_family;
cairo_font_weight_t font_weight;
cairo_scaled_font_t * font_scaled;
@@ -177,10 +177,10 @@
gint minimum_width;
gint minimum_height;
- /* Colors */
+ // Colors
GdkColor color[V3270_COLOR_COUNT]; /**< Terminal widget colors */
- /* Regions */
+ // Regions
GdkRectangle oia_rect[V3270_OIA_FIELD_COUNT];
struct
@@ -193,7 +193,10 @@
cairo_surface_t * surface; /**< Cursor image */
} cursor;
- /* lib3270 stuff */
+ // Acessibility
+ GtkAccessible * accessible;
+
+ // lib3270 stuff
H3270 * host; /**< Related 3270 session */
};
diff --git a/src/gtk/v3270/widget.c b/src/gtk/v3270/widget.c
index 8a07d15..37d3bdc 100644
--- a/src/gtk/v3270/widget.c
+++ b/src/gtk/v3270/widget.c
@@ -50,17 +50,17 @@
/*--[ Globals ]--------------------------------------------------------------------------------------*/
- guint v3270_widget_signal[LAST_SIGNAL] = { 0 };
- GdkCursor * v3270_cursor[V3270_CURSOR_COUNT] = { 0 };
+ guint v3270_widget_signal[LAST_SIGNAL] = { 0 };
+ GdkCursor * v3270_cursor[V3270_CURSOR_COUNT] = { 0 };
/*--[ Prototipes ]-----------------------------------------------------------------------------------*/
// http://git.gnome.org/browse/gtk+/tree/gtk/gtkdrawingarea.c?h=gtk-3-0
-static void v3270_realize (GtkWidget * widget);
-static void v3270_size_allocate (GtkWidget * widget,
- GtkAllocation * allocation);
-static void v3270_send_configure (v3270 * terminal);
+static void v3270_realize ( GtkWidget * widget);
+static void v3270_size_allocate ( GtkWidget * widget,
+ GtkAllocation * allocation);
+static void v3270_send_configure ( v3270 * terminal);
// Signals
static void v3270_activate (GtkWidget *widget);
@@ -432,6 +432,16 @@ static void v3270_class_init(v3270Class *klass)
NULL, NULL,
pw3270_VOID__VOID_BOOL,
G_TYPE_NONE, 1, G_TYPE_BOOLEAN);
+
+#ifdef DEBUG
+ trace("%s: Acessibility check starts",__FUNCTION__);
+ v3270_accessible_get_type();
+ trace("%s: Acessibility check ends",__FUNCTION__);
+#endif // DEBUG
+
+#if GTK_CHECK_VERSION(3,0,0)
+ gtk_widget_class_set_accessible_type(widget_class, GTK_TYPE_V3270_ACCESSIBLE);
+#endif
}
void v3270_update_font_metrics(v3270 *terminal, cairo_t *cr, int width, int height)
@@ -657,6 +667,13 @@ static void v3270_destroy(GtkObject *widget)
trace("%s %p",__FUNCTION__,widget);
+ if(terminal->accessible)
+ {
+ gtk_accessible_set_widget(terminal->accessible, NULL);
+ g_object_unref(terminal->accessible);
+ terminal->accessible = NULL;
+ }
+
if(terminal->host)
{
lib3270_session_free(terminal->host);
@@ -1084,3 +1101,5 @@ const GtkWidgetClass * v3270_get_parent_class(void)
{
return GTK_WIDGET_CLASS(v3270_parent_class);
}
+
+
--
libgit2 0.21.2