[project @ 2005-01-24 20:59:15 by bursa]

Fix input focus behaviour. Remove obsolete gui_window_get_url().

svn path=/import/netsurf/; revision=1465
This commit is contained in:
James Bursa 2005-01-24 20:59:15 +00:00
parent a77f5b912d
commit 01b28b7538
3 changed files with 18 additions and 26 deletions

View File

@ -45,7 +45,6 @@ void gui_window_set_extent(struct gui_window *g, int width, int height);
void gui_window_set_status(struct gui_window *g, const char *text); void gui_window_set_status(struct gui_window *g, const char *text);
void gui_window_set_pointer(gui_pointer_shape shape); void gui_window_set_pointer(gui_pointer_shape shape);
void gui_window_set_url(struct gui_window *g, const char *url); void gui_window_set_url(struct gui_window *g, const char *url);
char *gui_window_get_url(struct gui_window *g);
void gui_window_start_throbber(struct gui_window *g); void gui_window_start_throbber(struct gui_window *g);
void gui_window_stop_throbber(struct gui_window *g); void gui_window_stop_throbber(struct gui_window *g);
void gui_window_place_caret(struct gui_window *g, int x, int y, int height); void gui_window_place_caret(struct gui_window *g, int x, int y, int height);

View File

@ -327,10 +327,6 @@ void gui_window_set_url(struct gui_window *g, const char *url)
gtk_entry_set_text(GTK_ENTRY(g->url_bar), url); gtk_entry_set_text(GTK_ENTRY(g->url_bar), url);
} }
char *gui_window_get_url(struct gui_window *g)
{
return gtk_entry_get_text(GTK_ENTRY(g->url_bar));
}
void gui_window_start_throbber(struct gui_window* g) void gui_window_start_throbber(struct gui_window* g)
{ {

View File

@ -791,20 +791,6 @@ void gui_window_set_url(struct gui_window *g, const char *url)
} }
} }
/**
* Get the contents of a window's address bar.
*
* \param g gui_window to update
* \return The url in the address bar or NULL
*/
char *gui_window_get_url(struct gui_window *g)
{
if (!g->toolbar)
return NULL;
return ro_gui_get_icon_string(g->toolbar->toolbar_handle,
ICON_TOOLBAR_URL);
}
/** /**
* Forces all windows to be set to the current theme * Forces all windows to be set to the current theme
@ -1350,25 +1336,36 @@ void gui_window_place_caret(struct gui_window *g, int x, int y, int height)
/** /**
* Remove/disown the caret. * Remove the caret, if present.
* *
* \param g window with caret * \param g window with caret
*
* \todo: do we want to do a test if g really owns the caret ?
*/ */
void gui_window_remove_caret(struct gui_window *g) void gui_window_remove_caret(struct gui_window *g)
{ {
wimp_caret caret;
os_error *error; os_error *error;
error = xwimp_set_caret_position((wimp_w)-1, (wimp_i)-1, error = xwimp_get_caret_position(&caret);
0, if (error) {
0, LOG(("xwimp_get_caret_position: 0x%x: %s",
0, -1); error->errnum, error->errmess));
warn_user("WimpError", error->errmess);
return;
}
if (caret.w != g->window)
/* we don't have the caret: do nothing */
return;
/* hide caret, but keep input focus */
error = xwimp_set_caret_position(g->window, -1,
-100, -100, 32, -1);
if (error) { if (error) {
LOG(("xwimp_set_caret_position: 0x%x: %s", LOG(("xwimp_set_caret_position: 0x%x: %s",
error->errnum, error->errmess)); error->errnum, error->errmess));
warn_user("WimpError", error->errmess); warn_user("WimpError", error->errmess);
return;
} }
} }