예제 #1
0
파일: history.c 프로젝트: kyllikki/netsurf
void atari_global_history_init(void)
{
	if (atari_global_history.init == false) {
		if( atari_global_history.window == NULL ) {
			int flags = ATARI_TREEVIEW_WIDGETS;
			short handle = -1;
			OBJECT * tree = gemtk_obj_get_tree(TOOLBAR_HISTORY);
			assert( tree );

			handle = wind_create(flags, 0, 0, desk_area.g_w, desk_area.g_h);
			atari_global_history.window = gemtk_wm_add(handle, GEMTK_WM_FLAG_DEFAULTS, NULL);
			if( atari_global_history.window == NULL ) {
				gemtk_msg_box_show(GEMTK_MSG_BOX_ALERT,
						   "Failed to allocate History");
				return;
			}
			wind_set_str(handle, WF_NAME, (char*)messages_get("History"));
			gemtk_wm_set_toolbar(atari_global_history.window, tree, 0, 0);
			gemtk_wm_unlink(atari_global_history.window);

			atari_global_history.tv = atari_treeview_create(
				atari_global_history.window,
				&atari_global_history_treeview_callbacks,
				NULL, flags);

			if (atari_global_history.tv == NULL) {
				/* handle it properly, clean up previous allocs */
				NSLOG(netsurf, INFO,
				      "Failed to allocate treeview");
				return;
			}
		}
	}
	atari_global_history.init = true;
}
예제 #2
0
void start_aktion(char *str, bool inter, long max)
{
	int	d;
	GRECT	r1, r2;

	if (aktion == NULL)
	{
		rsrc_gaddr(R_TREE, AKTION,	&aktion);
		fix_dial(aktion);
	}
		
	max_value = max(max, 1);
	set_string(aktion, ATEXT, str);
	aktion[ABOX2].ob_width = 1;
	set_flag(aktion, AESC, HIDETREE, !inter);
	interupt = inter;

	/* Zentrieren, nur beim ersten Mal */
	if (aktion[0].ob_x == 0 && aktion[0].ob_y == 0)
		form_center(aktion, &d, &d, &d, &d);	
	
	r1.g_x = aktion[0].ob_x;
	r1.g_y = aktion[0].ob_y;
	r1.g_w = aktion[0].ob_width;
	r1.g_h = aktion[0].ob_height;
	wind_calc_grect(WC_BORDER, (NAME|MOVER|BACKDROP), &r1, &r2);
	akt_handle = wind_create_grect((NAME|MOVER|BACKDROP), &r1);
	if (akt_handle > 0)
	{
		/* Men� abschalten */
		disable_menu();
		wind_set_str(akt_handle, WF_NAME, " qed ");
		wind_open_grect(akt_handle, &r2);
	}
}
예제 #3
0
파일: statusbar.c 프로젝트: ysei/NetSurf
void sb_set_text(CMP_STATUSBAR sb, const char * text )
{
	assert( sb != NULL );
	strncpy(sb->text, text, STATUSBAR_MAX_SLEN);
	sb->text[STATUSBAR_MAX_SLEN]=0;
	sb->textlen = strlen(sb->text);
	if(sb->attached){
		wind_set_str(sb->aes_win, WF_INFO, sb->text);
	}
}
예제 #4
0
void open_settings(void)
{
    if (h_aes_win == 0) {

        GRECT curr, area;
        struct gemtk_wm_scroll_info_s *slid;
        uint32_t kind = CLOSER | NAME | MOVER | VSLIDE | HSLIDE | UPARROW
                        | DNARROW | LFARROW | RTARROW | SIZER | FULLER;

        dlgtree = gemtk_obj_get_tree(SETTINGS);
        area.g_x = area.g_y = 0;
        area.g_w = MIN(dlgtree->ob_width, desk_area.g_w);
        area.g_h = MIN(dlgtree->ob_height, desk_area.g_h);
        wind_calc_grect(WC_BORDER, kind, &area, &area);
        h_aes_win = wind_create_grect(kind, &area);
        wind_set_str(h_aes_win, WF_NAME, "Settings");
        settings_guiwin = gemtk_wm_add(h_aes_win, GEMTK_WM_FLAG_DEFAULTS,
                                     on_aes_event);
        curr.g_w = MIN(dlgtree->ob_width, desk_area.g_w);
        curr.g_h = MIN(dlgtree->ob_height, desk_area.g_h-64);
        curr.g_x = 1;
        curr.g_y = (desk_area.g_h / 2) - (curr.g_h / 2);

        wind_calc_grect(WC_BORDER, kind, &curr, &curr);

        dlgtree->ob_x = curr.g_x;
        dlgtree->ob_y = curr.g_y;

        /* set current config values: */
        display_settings();

        wind_open_grect(h_aes_win, &curr);

        gemtk_wm_set_form(settings_guiwin, dlgtree, 0);
        gemtk_wm_set_scroll_grid(settings_guiwin, 32, 32);
        gemtk_wm_get_grect(settings_guiwin, GEMTK_WM_AREA_CONTENT, &area);

        slid = gemtk_wm_get_scroll_info(settings_guiwin);
        gemtk_wm_set_content_units(settings_guiwin,
                                 (dlgtree->ob_width/slid->x_unit_px),
                                 (dlgtree->ob_height/slid->y_unit_px));
        gemtk_wm_update_slider(settings_guiwin, GEMTK_WM_VH_SLIDER);
    }
}
예제 #5
0
OUTPUT_WINDOW* setup_output_window(short workstation) {
    OUTPUT_WINDOW *window = calloc(1, sizeof(OUTPUT_WINDOW));
    window->obj_tree_length = 2;
    window->obj_tree = calloc(window->obj_tree_length, sizeof(OBJECT));
    window->workstation = workstation;
    window->text = "Llama llama llama\nllama duck\nllama llama llama llama llama llama\nHOLLLLLLAAAAAAAAAAAAAAAAAAAAAAAAAA";

    short x_loc;
    short y_loc;
    short height;
    short width;

    wind_get(0, WF_CURRXYWH, &x_loc, &y_loc, &width, &height);
    window->handle = wind_create(NAME, x_loc, y_loc, width, height);
    wind_open(window->handle, x_loc + 10, y_loc + 10, width / 2, height / 2);

    OBJECT *box = &window->obj_tree[0];
    box->ob_next = -1;
    box->ob_head = -1;
    box->ob_tail = -1;
    box->ob_type = G_BOX;
    wind_get(window->handle, WF_WORKXYWH, &box->ob_x, &box->ob_y, &box->ob_width, &box->ob_height);

    //Add our own multiline handling block
    OBJECT *text = &window->obj_tree[1];
    text->ob_next = -1;
    text->ob_head = -1;
    text->ob_tail = -1;

    USERBLK *user_block = malloc(sizeof(USERBLK));
    user_block->ub_code = &draw_multiline;
    user_block->ub_parm = (int)window;

    objc_add(window->obj_tree, 0, 1);
    text->ob_type = G_USERDEF;
    text->ob_width = box->ob_width - 1; //adjust for border
    text->ob_height = box->ob_height - 1;
    text->ob_spec.userblk = user_block;

    wind_set_str(window->handle, WF_NAME, "Twitter");
    return window;
}
예제 #6
0
파일: certview.c 프로젝트: kyllikki/netsurf
static void atari_sslcert_viewer_init(struct atari_sslcert_viewer_s * cvwin,
				      struct sslcert_session_data *ssl_d)
{
	assert(cvwin->init == false);
	assert(cvwin->window == NULL);
	assert(cvwin->tv == NULL);

	int flags = ATARI_TREEVIEW_WIDGETS;
	short handle = -1;
	OBJECT * tree = gemtk_obj_get_tree(TOOLBAR_SSL_CERT);
	assert( tree );

	handle = wind_create(flags, 0, 0, desk_area.g_w, desk_area.g_h);
	cvwin->window = gemtk_wm_add(handle,
				     GEMTK_WM_FLAG_DEFAULTS, NULL);
	if (cvwin->window == NULL ) {
		gemtk_msg_box_show(GEMTK_MSG_BOX_ALERT,
				   "Failed to allocate Treeview:\nCertviewer");
		return;
	}
	wind_set_str(handle, WF_NAME, (char*)"SSL Certificate");
	gemtk_wm_set_toolbar(cvwin->window, tree, 0, 0);
	gemtk_wm_unlink(cvwin->window);

	cvwin->ssl_session_data = ssl_d;
	cvwin->tv = atari_treeview_create(cvwin->window,
					  &atari_sslcert_viewer_treeview_callbacks,
					  cvwin, flags);

	if (cvwin->tv == NULL) {
		/* handle it properly, clean up previous allocs */
		NSLOG(netsurf, INFO, "Failed to allocate treeview");
		return;
	}

	cvwin->init = true;
}