Commit 3f69724ee6acd72e5e65dac100ac7290884fa16f

Authored by perry.werneck@gmail.com
1 parent e9bd3b6d

wip

Showing 2 changed files with 19 additions and 8 deletions   Show diff stats
src/gtk/v3270/accessible.c
@@ -244,6 +244,16 @@ static gint v3270_accessible_get_offset_at_point(AtkText *atk_text, gint x, gint @@ -244,6 +244,16 @@ static gint v3270_accessible_get_offset_at_point(AtkText *atk_text, gint x, gint
244 return v3270_get_offset_at_point(GTK_V3270(widget),x,y); 244 return v3270_get_offset_at_point(GTK_V3270(widget),x,y);
245 } 245 }
246 246
  247 +/*
  248 +text : an AtkText
  249 +offset : The offset of the text character for which bounding information is required.
  250 +x : Pointer for the x cordinate of the bounding box
  251 +y : Pointer for the y cordinate of the bounding box
  252 +width : Pointer for the width of the bounding box
  253 +height : Pointer for the height of the bounding box
  254 +coords : specify whether coordinates are relative to the screen or widget window
  255 +*/
  256 +
247 static void v3270_accessible_get_character_extents( AtkText *text, 257 static void v3270_accessible_get_character_extents( AtkText *text,
248 gint offset, 258 gint offset,
249 gint *x, 259 gint *x,
@@ -255,7 +265,6 @@ static void v3270_accessible_get_character_extents( AtkText *text, @@ -255,7 +265,6 @@ static void v3270_accessible_get_character_extents( AtkText *text,
255 v3270 * widget = (v3270 *) gtk_accessible_get_widget(GTK_ACCESSIBLE (text)); 265 v3270 * widget = (v3270 *) gtk_accessible_get_widget(GTK_ACCESSIBLE (text));
256 int rows, cols; 266 int rows, cols;
257 GdkWindow * window; 267 GdkWindow * window;
258 - gint x_window, y_window;  
259 268
260 if (widget == NULL) 269 if (widget == NULL)
261 return; 270 return;
@@ -264,24 +273,26 @@ static void v3270_accessible_get_character_extents( AtkText *text, @@ -264,24 +273,26 @@ static void v3270_accessible_get_character_extents( AtkText *text,
264 273
265 // Get screen position 274 // Get screen position
266 window = gtk_widget_get_window(GTK_WIDGET(widget)); 275 window = gtk_widget_get_window(GTK_WIDGET(widget));
267 - gdk_window_get_origin(window, &x_window, &y_window); 276 + gdk_window_get_origin(window, x, y);
268 277
269 // Get screen position 278 // Get screen position
270 - *x = x_window + widget->metrics.left + ((offset/cols) * widget->metrics.width);  
271 - *y = y_window + widget->metrics.top + ((offset%cols) * widget->metrics.spacing);  
272 - *width = widget->metrics.width;  
273 - *height = widget->metrics.height+widget->metrics.descent; 279 + *x += widget->metrics.left + ((offset%cols) * widget->metrics.width);
  280 + *y += widget->metrics.top + ((offset/cols) * widget->metrics.spacing);
  281 + *width = widget->metrics.width;
  282 + *height = widget->metrics.spacing;
274 283
275 if(coords == ATK_XY_WINDOW) 284 if(coords == ATK_XY_WINDOW)
276 { 285 {
277 // Correct position based on toplevel 286 // Correct position based on toplevel
  287 + gint x_window, y_window;
  288 +
278 window = gdk_window_get_toplevel(window); 289 window = gdk_window_get_toplevel(window);
279 gdk_window_get_origin(window, &x_window, &y_window); 290 gdk_window_get_origin(window, &x_window, &y_window);
280 *x -= x_window; 291 *x -= x_window;
281 *y -= y_window; 292 *y -= y_window;
282 } 293 }
283 294
284 - trace("%s: offset=%d x=%d y=%d",__FUNCTION__,offset,x,y); 295 + trace("%s: offset=%d x=%d y=%d %s",__FUNCTION__,offset,*x,*y,coords == ATK_XY_WINDOW ? "ATK_XY_WINDOW" : "");
285 296
286 } 297 }
287 298
src/gtk/v3270/oia.c
@@ -408,7 +408,7 @@ static void draw_status_message(cairo_t *cr, LIB3270_MESSAGE id, struct v3270_me @@ -408,7 +408,7 @@ static void draw_status_message(cairo_t *cr, LIB3270_MESSAGE id, struct v3270_me
408 408
409 OIA_MESSAGE( LIB3270_MESSAGE_KYBDLOCK, 409 OIA_MESSAGE( LIB3270_MESSAGE_KYBDLOCK,
410 V3270_COLOR_OIA_STATUS_INVALID, 410 V3270_COLOR_OIA_STATUS_INVALID,
411 - NULL ), 411 + N_( "X") ),
412 412
413 OIA_MESSAGE( LIB3270_MESSAGE_X, 413 OIA_MESSAGE( LIB3270_MESSAGE_X,
414 V3270_COLOR_OIA_STATUS_INVALID, 414 V3270_COLOR_OIA_STATUS_INVALID,