Exemple #1
0
void nsatari_search_set_hourglass(bool active, void *p)
{
	SEARCH_FORM_SESSION s = (SEARCH_FORM_SESSION)p;
	LOG(("active: %d, session: %p", active, p));
	if (active)
		gui_window_set_pointer(s->bw->window, GUI_POINTER_PROGRESS);
	else
		gui_window_set_pointer(s->bw->window, GUI_POINTER_DEFAULT);
}
Exemple #2
0
/**
 * display hourglass while searching
 * \param active start/stop indicator
 * \param p the pointer sent to search_verify_new() / search_create_context()
 */
void nsatari_search_set_hourglass(bool active, void *p)
{
	SEARCH_FORM_SESSION s = (SEARCH_FORM_SESSION)p;
	NSLOG(netsurf, INFO, "active: %d, session: %p", active, p);
	if (active) {
		gui_window_set_pointer(s->g, GUI_POINTER_PROGRESS);
	} else {
		gui_window_set_pointer(s->g, GUI_POINTER_DEFAULT);
	}
}
Exemple #3
0
/**
 * Create and open a gui window for a browsing context.
 *
 * \param bw		bw to create gui_window for
 * \param existing	an existing gui_window, may be NULL
 * \param flags		flags for gui window creation
 * \return gui window, or NULL on error
 *
 * If GW_CREATE_CLONE flag is set existing is non-NULL.
 *
 * The created gui_window must include a reference to the browser
 * window passed in the bw param.
 */
static struct gui_window *
gui_window_create(struct browser_window *bw,
		  struct gui_window *existing,
		  gui_window_create_flags flags)
{
    struct gui_window *gw=NULL;
    LOG("gw: %p, BW: %p, existing %p, flags: %d\n", gw, bw, existing, (int)flags);

    gw = calloc(1, sizeof(struct gui_window));
    if (gw == NULL)
	return NULL;

    LOG("new window: %p, bw: %p\n", gw, bw);
    window_create(gw, bw, existing, WIDGET_STATUSBAR|WIDGET_TOOLBAR|WIDGET_RESIZE\
		  |WIDGET_SCROLL);
    if (gw->root->win) {
	GRECT pos = {
	    option_window_x, option_window_y,
	    option_window_width, option_window_height
	};
	gui_window_set_url(gw, corestring_nsurl_about_blank);
	gui_window_set_pointer(gw, BROWSER_POINTER_DEFAULT);
	gui_set_input_gui_window(gw);
	window_open(gw->root, gw, pos);
    }

    /* add the window to the window list: */
    if( window_list == NULL ) {
	window_list = gw;
	gw->next = NULL;
	gw->prev = NULL;
    } else {
	struct gui_window * tmp = window_list;
	while( tmp->next != NULL ) {
	    tmp = tmp->next;
	}
	tmp->next = gw;
	gw->prev = tmp;
	gw->next = NULL;
    }

    /* Loose focus: */
    window_set_focus(gw->root, WIDGET_NONE, NULL );

    /* trigger on-focus event (select all text): */
    window_set_focus(gw->root, URL_WIDGET, NULL);

    /* delete selection: */
    toolbar_key_input(gw->root->toolbar, NK_DEL);

    return( gw );

}
Exemple #4
0
struct gui_window *
gui_create_browser_window(struct browser_window *bw,
                          struct browser_window *clone,
                          bool new_tab) {
    struct gui_window *gw=NULL;
    LOG(( "gw: %p, BW: %p, clone %p, tab: %d\n" , gw,  bw, clone,
          (int)new_tab
        ));

    gw = calloc( sizeof(struct gui_window), 1);
    if (gw == NULL)
        return NULL;

    LOG(("new window: %p, bw: %p\n", gw, bw));
    window_create(gw, bw, clone, WIDGET_STATUSBAR|WIDGET_TOOLBAR|WIDGET_RESIZE\
                  |WIDGET_SCROLL);
    if (gw->root->win) {
        GRECT pos = {
            option_window_x, option_window_y,
            option_window_width, option_window_height
        };
        gui_window_set_url(gw, "");
        gui_window_set_pointer(gw, BROWSER_POINTER_DEFAULT);
        gui_set_input_gui_window(gw);
        window_open(gw->root, gw, pos);
    }

    /* add the window to the window list: */
    if( window_list == NULL ) {
        window_list = gw;
        gw->next = NULL;
        gw->prev = NULL;
    } else {
        struct gui_window * tmp = window_list;
        while( tmp->next != NULL ) {
            tmp = tmp->next;
        }
        tmp->next = gw;
        gw->prev = tmp;
        gw->next = NULL;
    }

    return( gw );

}