summary refs log tree commit diff stats
path: root/doc/pydoc/ranger.ext.accumulator.html
blob: 170aeea0ebda60b5b405c32d31786994805317a4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
generated by cgit-pink 1.4.1-2-gfad0 (git 2.36.2.497.gbbea4dcf42) at 2025-01-08 19:06:32 +0000
 


*t)
{
	GtkWidget		*toolbar = gtk_toolbar_new();
	GtkToolItem		*i;

#if GTK_CHECK_VERSION(2,15,0)
	gtk_orientable_set_orientation(GTK_ORIENTABLE(toolbar),
	    GTK_ORIENTATION_HORIZONTAL);
#else
	gtk_toolbar_set_orientation(GTK_TOOLBAR(toolbar),
	    GTK_ORIENTATION_HORIZONTAL);
#endif
	gtk_toolbar_set_style(GTK_TOOLBAR(toolbar), GTK_TOOLBAR_BOTH_HORIZ);

	i = gtk_tool_item_new();
	gtk_tool_item_set_expand(i, TRUE);
	t->uri_entry = gtk_entry_new();
	gtk_container_add(GTK_CONTAINER(i), t->uri_entry);
	g_signal_connect(G_OBJECT(t->uri_entry), "activate",
	    G_CALLBACK(activate_uri_entry_cb), t);
	gtk_toolbar_insert(GTK_TOOLBAR(toolbar), i, -1);

	return (toolbar);
}

void
create_new_tab(char *title)
{
	struct tab		*t;

	t = g_malloc0(sizeof *t);
	t->label = gtk_label_new(title);
	t->vbox = gtk_vbox_new(FALSE, 0);
	t->toolbar = create_toolbar(t);
	t->browser_win = create_browser(t);
	gtk_box_pack_start(GTK_BOX(t->vbox), t->toolbar, FALSE, FALSE, 0);
	gtk_box_pack_start(GTK_BOX(t->vbox), t->browser_win, TRUE, TRUE, 0);
	gtk_notebook_append_page(GTK_NOTEBOOK(notebook), t->vbox, t->label);

	g_object_connect((GObject*)t->wv,
	    "signal::key-press-event", (GCallback)webview_keypress_cb, t,
	    NULL);

	gtk_widget_grab_focus(GTK_WIDGET(t->wv));
	webkit_web_view_load_uri(t->wv, title);
}

void
create_canvas(void)
{
	GtkWidget		*vbox;
	
	vbox = gtk_vbox_new(FALSE, 0);
	notebook = gtk_notebook_new();

	gtk_box_pack_start(GTK_BOX(vbox), notebook, TRUE, TRUE, 0);

	main_window = create_window();
	gtk_container_add(GTK_CONTAINER(main_window), vbox);

	create_new_tab("http://www.dell.com");
	create_new_tab("http://www.peereboom.us");

	gtk_widget_show_all(main_window);
}

int
main(int argc, char *argv[])
{
	TAILQ_INIT(&tabs);

	/* prepare gtk */
	gtk_init(&argc, &argv);
	if (!g_thread_supported())
		g_thread_init(NULL);

	create_canvas();

	gtk_main();

	return (0);
}