Ejemplo n.º 1
0
Archivo: iopen.c Proyecto: szfn/teddy
void iopen_init(GtkWidget *window) {
	parent_window = window;

	GtkWidget *main_vbox = gtk_vbox_new(false, 0);

	iopen_buffer = buffer_create();
	iopen_buffer->single_line = true;
	load_empty(iopen_buffer);
	iopen_editor = new_editor(iopen_buffer, true);

	buffer_set_onchange(iopen_buffer, iopen_buffer_onchange);

	config_set(&(iopen_buffer->config), CFG_AUTOWRAP, "0");
	config_set(&(iopen_buffer->config), CFG_AUTOCOMPL_POPUP, "0");

	iopen_editor->single_line_escape = &iopen_escape;
	iopen_editor->single_line_return = &iopen_enter;
	iopen_editor->single_line_other_keys = &iopen_other_keys;

	gtk_box_pack_start(GTK_BOX(main_vbox), GTK_WIDGET(iopen_editor), FALSE, FALSE, 0);

	results_list = gtk_list_store_new(4, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_DOUBLE);
	gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(results_list), 3, GTK_SORT_ASCENDING);
	results_tree = gtk_tree_view_new();

	crt = gtk_cell_renderer_text_new();

	iopen_recoloring();

	gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(results_tree), -1, "Show", crt, "markup", 0, NULL);
	gtk_tree_view_set_model(GTK_TREE_VIEW(results_tree), GTK_TREE_MODEL(results_list));
	gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(results_tree), FALSE);
	gtk_tree_view_set_search_column(GTK_TREE_VIEW(results_tree), 1);

	g_signal_connect(G_OBJECT(results_tree), "row-activated", G_CALLBACK(result_activated_callback), NULL);

	GtkWidget *results_scroll = gtk_scrolled_window_new(NULL, NULL);
	gtk_container_add(GTK_CONTAINER(results_scroll), results_tree);

	gtk_box_pack_start(GTK_BOX(main_vbox), frame_piece(TRUE), FALSE, FALSE, 0);
	gtk_box_pack_start(GTK_BOX(main_vbox),  results_scroll, TRUE, TRUE, 0);

	iopen_window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
	gtk_window_set_decorated(GTK_WINDOW(iopen_window), TRUE);
	gtk_window_set_default_size(GTK_WINDOW(iopen_window), 640, 480);

	g_signal_connect(G_OBJECT(iopen_window), "delete-event", G_CALLBACK(delete_callback), NULL);
	g_signal_connect(G_OBJECT(iopen_window), "map_event", G_CALLBACK(map_callback), NULL);

	gtk_container_add(GTK_CONTAINER(iopen_window), main_vbox);

	file_recursor_requests = g_async_queue_new();
	tags_requests = g_async_queue_new();
	buffers_requests = g_async_queue_new();
	g_thread_new("iopen file recursion", iopen_recursor_thread, NULL);
	g_thread_new("tags iteration", iopen_tags_thread, NULL);
	g_thread_new("buffer iteration", iopen_buffer_thread, NULL);
}
Ejemplo n.º 2
0
Editor *build_skill_editor(Skill *skill)
{
    Editor *editor = new_editor();
    editor->data = skill;
    editor->edit = skill_editor;
    editor->show = skill_editor_menu;
    return editor;

}
Ejemplo n.º 3
0
Editor *build_area_editor(Area *area)
{
    Editor *editor = new_editor();
    editor->data = area;
    editor->edit = area_editor;
    editor->show = area_editor_menu;
    return editor;

}
Ejemplo n.º 4
0
Editor *build_exits_editor(Exit **exits)
{
    Editor *editor = new_editor();
    editor->data = exits;
    editor->edit = exits_editor;
    editor->show = exits_editor_menu;
    return editor;

}