mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
Move delayed_open to src/terminal/tab.c
The two copies of delayed_open in src/ecmascript/spidermonkey/window.c and in src/ecmascript/see/window.c are identical, so move them to src/terminal/tab.c and eliminate the duplication.
This commit is contained in:
parent
1f68492d57
commit
466bb18be0
@ -48,7 +48,6 @@
|
|||||||
|
|
||||||
static struct js_window_object *js_get_global_object(void *);
|
static struct js_window_object *js_get_global_object(void *);
|
||||||
static struct js_window_object *js_try_resolve_frame(struct document_view *, unsigned char *);
|
static struct js_window_object *js_try_resolve_frame(struct document_view *, unsigned char *);
|
||||||
static void delayed_open(void *);
|
|
||||||
static void window_get(struct SEE_interpreter *, struct SEE_object *, struct SEE_string *, struct SEE_value *);
|
static void window_get(struct SEE_interpreter *, struct SEE_object *, struct SEE_string *, struct SEE_value *);
|
||||||
static void window_put(struct SEE_interpreter *, struct SEE_object *, struct SEE_string *, struct SEE_value *, int);
|
static void window_put(struct SEE_interpreter *, struct SEE_object *, struct SEE_string *, struct SEE_value *, int);
|
||||||
static int window_canput(struct SEE_interpreter *, struct SEE_object *, struct SEE_string *);
|
static int window_canput(struct SEE_interpreter *, struct SEE_object *, struct SEE_string *);
|
||||||
@ -95,18 +94,6 @@ js_try_resolve_frame(struct document_view *doc_view, unsigned char *id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
|
||||||
delayed_open(void *data)
|
|
||||||
{
|
|
||||||
struct delayed_open *deo = data;
|
|
||||||
|
|
||||||
assert(deo);
|
|
||||||
open_uri_in_new_tab(deo->ses, deo->uri, 0, 0);
|
|
||||||
done_uri(deo->uri);
|
|
||||||
mem_free(deo);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
window_get(struct SEE_interpreter *interp, struct SEE_object *o,
|
window_get(struct SEE_interpreter *interp, struct SEE_object *o,
|
||||||
|
@ -289,17 +289,6 @@ window_alert(JSContext *ctx, JSObject *obj, uintN argc, jsval *argv, jsval *rval
|
|||||||
return JS_TRUE;
|
return JS_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
delayed_open(void *data)
|
|
||||||
{
|
|
||||||
struct delayed_open *deo = data;
|
|
||||||
|
|
||||||
assert(deo);
|
|
||||||
open_uri_in_new_tab(deo->ses, deo->uri, 0, 0);
|
|
||||||
done_uri(deo->uri);
|
|
||||||
mem_free(deo);
|
|
||||||
}
|
|
||||||
|
|
||||||
static JSBool
|
static JSBool
|
||||||
window_open(JSContext *ctx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
window_open(JSContext *ctx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||||
{
|
{
|
||||||
|
@ -239,6 +239,17 @@ open_uri_in_new_tab(struct session *ses, struct uri *uri, int in_background,
|
|||||||
init_session(based ? ses : NULL, ses->tab->term, uri, in_background);
|
init_session(based ? ses : NULL, ses->tab->term, uri, in_background);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
delayed_open(void *data)
|
||||||
|
{
|
||||||
|
struct delayed_open *deo = data;
|
||||||
|
|
||||||
|
assert(deo);
|
||||||
|
open_uri_in_new_tab(deo->ses, deo->uri, 0, 0);
|
||||||
|
done_uri(deo->uri);
|
||||||
|
mem_free(deo);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
open_current_link_in_new_tab(struct session *ses, int in_background)
|
open_current_link_in_new_tab(struct session *ses, int in_background)
|
||||||
{
|
{
|
||||||
|
@ -25,6 +25,7 @@ void close_all_tabs_but_current(struct session *ses);
|
|||||||
((win)->type != WINDOW_NORMAL && (win) != get_current_tab((win->term)))
|
((win)->type != WINDOW_NORMAL && (win) != get_current_tab((win->term)))
|
||||||
|
|
||||||
void open_uri_in_new_tab(struct session *ses, struct uri *uri, int in_background, int based);
|
void open_uri_in_new_tab(struct session *ses, struct uri *uri, int in_background, int based);
|
||||||
|
void delayed_open(void *);
|
||||||
void open_current_link_in_new_tab(struct session *ses, int in_background);
|
void open_current_link_in_new_tab(struct session *ses, int in_background);
|
||||||
|
|
||||||
void move_current_tab(struct session *ses, int direction);
|
void move_current_tab(struct session *ses, int direction);
|
||||||
|
Loading…
Reference in New Issue
Block a user