Add is_selectable to browser window API surface.
This commit is contained in:
parent
8dea0fe894
commit
85fb1fd45d
|
@ -430,6 +430,22 @@ browser_editor_flags browser_window_get_editor_flags(struct browser_window *bw)
|
|||
return ed_flags;
|
||||
}
|
||||
|
||||
/* exported interface, documented in browser.h */
|
||||
bool browser_window_can_select(struct browser_window *bw)
|
||||
{
|
||||
if (bw == NULL || bw->current_content == NULL)
|
||||
return false;
|
||||
|
||||
/* TODO: We shouldn't have to know about specific content types
|
||||
* here. There should be a content_is_selectable() call. */
|
||||
if (content_get_type(bw->current_content) != CONTENT_HTML &&
|
||||
content_get_type(bw->current_content) !=
|
||||
CONTENT_TEXTPLAIN)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* exported interface, documented in browser.h */
|
||||
char * browser_window_get_selection(struct browser_window *bw)
|
||||
{
|
||||
|
|
|
@ -453,6 +453,14 @@ struct browser_window * browser_window_get_root(struct browser_window *bw);
|
|||
*/
|
||||
browser_editor_flags browser_window_get_editor_flags(struct browser_window *bw);
|
||||
|
||||
/**
|
||||
* Find out if given browser window content is selectable
|
||||
*
|
||||
* \param bw browser window to look at
|
||||
* \return true iff browser window is selectable
|
||||
*/
|
||||
bool browser_window_can_select(struct browser_window *bw);
|
||||
|
||||
/**
|
||||
* Get the current selection from a root browser window, ownership passed to
|
||||
* caller, who must free() it.
|
||||
|
|
Loading…
Reference in New Issue