Exemplo n.º 1
0
void gui_window_redraw_window(struct gui_window *gw)
{
    CMP_BROWSER b;
    GRECT rect;
    if (gw == NULL)
        return;
    b = gw->browser;
    window_get_grect(gw->root, BROWSER_AREA_CONTENT, &rect);
    window_schedule_redraw_grect(gw->root, &rect);
}
Exemplo n.º 2
0
Arquivo: gui.c Projeto: mmuman/NetSurf
/**
 * Update the extent of the inside of a browser window to that of the
 * current content.
 *
 * It seems this method is called when content size got adjusted, so
 * that we can adjust scroll info. We also have to call it when tab
 * change occurs.
 *
 * \param gw gui_window to update the extent of
 */
static void gui_window_update_extent(struct gui_window *gw)
{

    if(browser_window_has_content(gw->browser->bw)) {
	/** @todo store content size. */
	if(window_get_active_gui_window(gw->root) == gw) {
	    int width, height;
	    GRECT area;
	    browser_window_get_extents(gw->browser->bw, false, &width, &height);
	    window_set_content_size(gw->root, width, height);
	    window_update_back_forward(gw->root);
	    window_get_grect(gw->root, BROWSER_AREA_CONTENT, &area);
	    window_schedule_redraw_grect(gw->root, &area);
	}
    }
}
Exemplo n.º 3
0
/* It seems this method is called when content size got adjusted,
	so that we can adjust scroll info. We also have to call it when tab
	change occurs.
*/
void gui_window_update_extent(struct gui_window *gw)
{

    if( gw->browser->bw->current_content != NULL ) {
        // TODO: store content size!
        if(window_get_active_gui_window(gw->root) == gw) {
            window_set_content_size( gw->root,
                                     content_get_width(gw->browser->bw->current_content),
                                     content_get_height(gw->browser->bw->current_content)
                                   );
            window_update_back_forward(gw->root);
            GRECT area;
            window_get_grect(gw->root, BROWSER_AREA_CONTENT, &area);
            window_schedule_redraw_grect(gw->root, &area);
        }
    }
}
Exemplo n.º 4
0
void gui_window_update_box(struct gui_window *gw, const struct rect *rect)
{
    GRECT area;
    struct gemtk_wm_scroll_info_s *slid;

    if (gw == NULL)
        return;

    slid = gemtk_wm_get_scroll_info(gw->root->win);

    window_get_grect(gw->root, BROWSER_AREA_CONTENT, &area);
    area.g_x += rect->x0 - (slid->x_pos * slid->x_unit_px);
    area.g_y += rect->y0 - (slid->y_pos * slid->y_unit_px);
    area.g_w = rect->x1 - rect->x0;
    area.g_h = rect->y1 - rect->y0;
    //dbg_grect("update box", &area);
    window_schedule_redraw_grect(gw->root, &area);
}
Exemplo n.º 5
0
void nsatari_search_set_back_state(bool active, void *p)
{
	struct gui_window *gw;
	OBJECT *toolbar;
	GRECT area;
	SEARCH_FORM_SESSION s = (SEARCH_FORM_SESSION)p;
	/* deactivate back cb */
	LOG(("%p: set back state: %d\n", p, active));

	s->state.back_avail = active;
	gw = s->bw->window;

	toolbar = toolbar_get_form(gw->root->toolbar);
	if(active)
		toolbar[TOOLBAR_BT_SEARCH_BACK].ob_state &= ~OS_DISABLED;
	else
		toolbar[TOOLBAR_BT_SEARCH_BACK].ob_state |= OS_DISABLED;
	window_get_grect(gw->root, BROWSER_AREA_SEARCH, &area);
	window_schedule_redraw_grect(gw->root, &area);
}
Exemplo n.º 6
0
/**
 * activate search forwards button in gui
 * \param active activate/inactivate
 * \param p the pointer sent to search_verify_new() / search_create_context()
 */
void nsatari_search_set_forward_state(bool active, void *p)
{
	struct gui_window *gw;
	OBJECT *toolbar;
	GRECT area;
	SEARCH_FORM_SESSION s = (SEARCH_FORM_SESSION)p;
	/* deactivate back cb */
	NSLOG(netsurf, INFO, "%p: set forward state: %d\n", p, active);

	gw = s->g;

	toolbar = toolbar_get_form(gw->root->toolbar);
	if (active) {
		toolbar[TOOLBAR_BT_SEARCH_FWD].ob_state &= ~OS_DISABLED;
	} else {
		toolbar[TOOLBAR_BT_SEARCH_FWD].ob_state |= OS_DISABLED;
	}
	window_get_grect(gw->root, BROWSER_AREA_SEARCH, &area);
	window_schedule_redraw_grect(gw->root, &area);
}