summaryrefslogtreecommitdiff
path: root/atari/gui.c
diff options
context:
space:
mode:
authorOle Loots <ole@monochrom.net>2013-01-01 22:08:19 +0100
committerOle Loots <ole@monochrom.net>2013-01-01 22:08:19 +0100
commitc0e6cf65902f93bc2286c72e28d916341ec641a6 (patch)
tree4b60625e733639d49d631a6bfdde042cf66a27d5 /atari/gui.c
parentcecccf09edf7e7296e4765f7e70e4c42c5ad8805 (diff)
downloadnetsurf-c0e6cf65902f93bc2286c72e28d916341ec641a6.tar.gz
netsurf-c0e6cf65902f93bc2286c72e28d916341ec641a6.tar.bz2
Implemented caret redraw.
Diffstat (limited to 'atari/gui.c')
-rwxr-xr-xatari/gui.c52
1 files changed, 32 insertions, 20 deletions
diff --git a/atari/gui.c b/atari/gui.c
index ccf7c21ae..dac842c30 100755
--- a/atari/gui.c
+++ b/atari/gui.c
@@ -607,26 +607,30 @@ void gui_window_stop_throbber(struct gui_window *w)
/* Place caret in window */
void gui_window_place_caret(struct gui_window *w, int x, int y, int height)
{
-
- GRECT clip, dim;
- struct guiwin_scroll_info_s * slid;
- if (w == NULL)
- return;
-
- slid = guiwin_get_scroll_info(w->root->win);
- window_get_grect(w->root, BROWSER_AREA_CONTENT, &clip);
- dim.g_x = x - (slid->x_pos * slid->x_unit_px);
- dim.g_y = y - (slid->y_pos * slid->y_unit_px);
- dim.g_h = height;
- dim.g_w = 2;
- caret_show(&w->caret, guiwin_get_vdi_handle(w->root->win), &dim, &clip);
-// if( w->browser->caret.current.g_w > 0 )
-// gui_window_remove_caret( w );
-// w->browser->caret.requested.g_x = x;
-// w->browser->caret.requested.g_y = y;
-// w->browser->caret.requested.g_w = 1;
-// w->browser->caret.requested.g_h = height;
-// w->browser->caret.redraw = true;
+ //printf("gw place caret\n");
+
+ window_place_caret(w->root, 1, x, y, height, NULL);
+ w->root->caret.state |= CARET_STATE_ENABLED;
+//
+// GRECT clip, dim;
+// struct guiwin_scroll_info_s * slid;
+// if (w == NULL)
+// return;
+//
+// slid = guiwin_get_scroll_info(w->root->win);
+// window_get_grect(w->root, BROWSER_AREA_CONTENT, &clip);
+// dim.g_x = x - (slid->x_pos * slid->x_unit_px);
+// dim.g_y = y - (slid->y_pos * slid->y_unit_px);
+// dim.g_h = height;
+// dim.g_w = 2;
+// caret_show(&w->caret, guiwin_get_vdi_handle(w->root->win), &dim, &clip);
+//// if( w->browser->caret.current.g_w > 0 )
+//// gui_window_remove_caret( w );
+//// w->browser->caret.requested.g_x = x;
+//// w->browser->caret.requested.g_y = y;
+//// w->browser->caret.requested.g_w = 1;
+//// w->browser->caret.requested.g_h = height;
+//// w->browser->caret.redraw = true;
return;
}
@@ -640,6 +644,14 @@ gui_window_remove_caret(struct gui_window *w)
if (w == NULL)
return;
+
+
+ if(w->root->caret.dimensions.g_h > 0 ){
+ //printf("gw hide caret\n");
+ window_place_caret(w->root, 0, -1, -1, -1, NULL);
+ w->root->caret.state &= ~CARET_STATE_ENABLED;
+ }
+
// if( w->browser->caret.background.fd_addr != NULL ) {
// browser_restore_caret_background( w, NULL );
// w->browser->caret.requested.g_w = 0;