Example #1
0
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;
}
Example #2
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);
    }
}
Example #3
0
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;
}