コード例 #1
0
ファイル: views.c プロジェクト: BYC/geany-plugins
void views_init(void)
{
	command_dialog = dialog_connect("command_dialog");
	command_view = get_widget("command_view");
	command_text = gtk_text_view_get_buffer(GTK_TEXT_VIEW(command_view));
	g_signal_connect(command_text, "changed", G_CALLBACK(on_command_text_changed), NULL);
	command_history = GTK_COMBO_BOX(get_widget("command_history"));
	command_store = SCP_TREE_STORE(gtk_combo_box_get_model(command_history));
	command_cell = get_object("command_cell");
	g_signal_connect(command_dialog, "configure-event",
		G_CALLBACK(on_command_dialog_configure), NULL);
	g_signal_connect(command_history, "size-request",
		G_CALLBACK(on_command_history_size_request), NULL);
	g_signal_connect(command_history, "changed", G_CALLBACK(on_command_history_changed),
		NULL);
	command_locale = GTK_TOGGLE_BUTTON(get_widget("command_locale"));

	g_signal_connect(get_widget("command_thread"), "clicked",
		G_CALLBACK(on_command_insert_button_clicked), GINT_TO_POINTER('t'));
	g_signal_connect(get_widget("command_group"), "clicked",
		G_CALLBACK(on_command_insert_button_clicked), GINT_TO_POINTER('g'));
	g_signal_connect(get_widget("command_frame"), "clicked",
		G_CALLBACK(on_command_insert_button_clicked), GINT_TO_POINTER('f'));
	command_send = get_widget("command_send");
	gtk_widget_grab_default(command_send);
	g_signal_connect(command_send, "clicked", G_CALLBACK(on_command_send_button_clicked),
		NULL);
	utils_enter_to_clicked(command_view, command_send);
}
コード例 #2
0
ファイル: views.c プロジェクト: BYC/geany-plugins
GtkTreeView *view_create(const char *name, ScpTreeStore **store, GtkTreeSelection **selection)
{
	GtkTreeView *tree = GTK_TREE_VIEW(get_widget(name));

	*store = SCP_TREE_STORE(gtk_tree_view_get_model(tree));
	*selection = gtk_tree_view_get_selection(tree);
	return tree;
}
コード例 #3
0
ファイル: views.c プロジェクト: budiprasetyo/geany-plugins
void views_init(void)
{
	if (pref_var_update_bug)
		views[VIEW_INSPECT].state = DS_DEBUG;

	command_dialog = dialog_connect("command_dialog");
	command_view = get_widget("command_view");
	command_text = gtk_text_view_get_buffer(GTK_TEXT_VIEW(command_view));
	g_signal_connect(command_text, "changed", G_CALLBACK(on_command_text_changed), NULL);
	command_history = GTK_COMBO_BOX(get_widget("command_history"));
	command_store = SCP_TREE_STORE(gtk_combo_box_get_model(command_history));
	command_cell = get_object("command_cell");
	g_signal_connect(command_dialog, "configure-event",
		G_CALLBACK(on_command_dialog_configure), NULL);
	g_signal_connect(command_history, "size-request",
		G_CALLBACK(on_command_history_size_request), NULL);
	g_signal_connect(command_history, "changed", G_CALLBACK(on_command_history_changed),
		NULL);
	command_locale = GTK_TOGGLE_BUTTON(get_widget("command_locale"));

	g_signal_connect(get_widget("command_thread"), "clicked",
		G_CALLBACK(on_command_insert_button_clicked), GINT_TO_POINTER('t'));
	g_signal_connect(get_widget("command_group"), "clicked",
		G_CALLBACK(on_command_insert_button_clicked), GINT_TO_POINTER('g'));
	g_signal_connect(get_widget("command_frame"), "clicked",
		G_CALLBACK(on_command_insert_button_clicked), GINT_TO_POINTER('f'));
	command_send = get_widget("command_send");
	gtk_widget_grab_default(command_send);
	g_signal_connect(command_send, "clicked", G_CALLBACK(on_command_send_button_clicked),
		NULL);
	utils_enter_to_clicked(command_view, command_send);

	geany_sidebar = GTK_NOTEBOOK(geany->main_widgets->sidebar_notebook);
	switch_sidebar_page_id = g_signal_connect(geany_sidebar, "switch-page",
		G_CALLBACK(on_geany_sidebar_switch_page), NULL);
	inspect_page = get_widget("inspect_page");
	gtk_notebook_append_page(geany_sidebar, inspect_page, get_widget("inspect_label"));
	register_page = get_widget("register_page");
	gtk_notebook_append_page(geany_sidebar, register_page, get_widget("register_label"));
}
コード例 #4
0
ファイル: program.c プロジェクト: Manasmitha/geany-plugins
void program_init(void)
{
	GtkWidget *widget;
	StashGroup *group = stash_group_new("program");
	extern gboolean thread_select_on_running;
	extern gboolean thread_select_on_stopped;
	extern gboolean thread_select_on_exited;
	extern gboolean thread_select_follow;

	program_dialog = dialog_connect("program_dialog");
	program_page_vbox = get_widget("program_page_vbox");

	program_exec_entry = GTK_ENTRY(get_widget("program_executable_entry"));
	gtk_entry_set_max_length(program_exec_entry, PATH_MAX);
	stash_group_add_entry(group, &program_executable, "executable", "", program_exec_entry);
	ui_setup_open_button_callback(get_widget("program_executable_button"), NULL,
		GTK_FILE_CHOOSER_ACTION_OPEN, program_exec_entry);

	stash_group_add_entry(group, &program_arguments, "arguments", "",
		get_widget("program_arguments_entry"));
	widget = get_widget("program_environment");
	environment = gtk_text_view_get_buffer(GTK_TEXT_VIEW(widget));
	stash_group_add_string(group, &program_environment, "environment", "");

	working_dir_entry = GTK_ENTRY(get_widget("program_working_dir_entry"));
	gtk_entry_set_max_length(working_dir_entry, PATH_MAX);
	stash_group_add_entry(group, &program_working_dir, "working_dir", "", working_dir_entry);
	ui_setup_open_button_callback(get_widget("program_working_dir_button"), NULL,
		GTK_FILE_CHOOSER_ACTION_OPEN, working_dir_entry);

	load_script_entry = GTK_ENTRY(get_widget("program_load_script_entry"));
	gtk_entry_set_max_length(load_script_entry, PATH_MAX);
	stash_group_add_entry(group, &program_load_script, "load_script", "", load_script_entry);
	ui_setup_open_button_callback(get_widget("program_load_script_button"), NULL,
		GTK_FILE_CHOOSER_ACTION_OPEN, load_script_entry);

	auto_run_exit = get_widget("program_auto_run_exit");
	stash_group_add_toggle_button(group, &program_auto_run_exit, "auto_run_exit", TRUE,
		auto_run_exit);
	stash_group_add_toggle_button(group, &program_non_stop_mode, "non_stop_mode", FALSE,
		get_widget("program_non_stop_mode"));

	temp_breakpoint = get_widget("program_temp_breakpoint");
	stash_group_add_toggle_button(group, &program_temp_breakpoint, "temp_breakpoint", FALSE,
		temp_breakpoint);
	widget = get_widget("program_temp_break_location");
	gtk_entry_set_max_length(GTK_ENTRY(widget), PATH_MAX + 0xFF);
	stash_group_add_entry(group, &program_temp_break_location, "temp_break_location", "",
		widget);
	program_group = group;
	delete_all_items = GTK_TOGGLE_BUTTON(get_widget("program_delete_all_items"));

	g_signal_connect(program_exec_entry, "changed",
		G_CALLBACK(on_program_name_entry_changed), NULL);
	g_signal_connect(load_script_entry, "changed",
		G_CALLBACK(on_program_name_entry_changed), NULL);
	g_signal_connect(temp_breakpoint, "toggled", G_CALLBACK(on_temp_breakpoint_toggled),
		widget);

	import_button = get_widget("program_import");
	g_signal_connect(import_button, "clicked", G_CALLBACK(on_program_import_button_clicked),
		NULL);

	widget = get_widget("program_ok");
	g_signal_connect(widget, "clicked", G_CALLBACK(on_program_ok_button_clicked), NULL);
	gtk_widget_grab_default(widget);

	group = stash_group_new("options");

	stash_group_add_toggle_button(group, &option_open_panel_on_load, "open_panel_on_load",
		TRUE, get_widget("option_open_panel_on_load"));
	stash_group_add_toggle_button(group, &option_open_panel_on_start, "open_panel_on_start",
		TRUE, get_widget("option_open_panel_on_start"));
	stash_group_add_toggle_button(group, &option_update_all_views, "update_all_views", FALSE,
		get_widget("option_update_all_views"));

	stash_group_add_radio_buttons(group, &option_high_bit_mode, "high_bit_mode", HB_7BIT,
		get_widget("option_high_bit_mode_7bit"), HB_7BIT,
		get_widget("option_high_bit_mode_locale"), HB_LOCALE,
		get_widget("option_high_bit_mode_utf8"), HB_UTF8, NULL);

	stash_group_add_toggle_button(group, &option_member_names, "member_names", TRUE,
		get_widget("option_member_names"));
	stash_group_add_toggle_button(group, &option_argument_names, "argument_names", TRUE,
		get_widget("option_argument_names"));
	long_mr_format = GTK_BUTTON(get_widget("option_mr_long_mr_format"));
	stash_group_add_boolean(group, &option_long_mr_format, "long_mr_format", TRUE);
	LONG_MR_FORMAT[FALSE] = _("as _Name=value");
	LONG_MR_FORMAT[TRUE] = _("as _Name = value");
	g_signal_connect(long_mr_format, "clicked", G_CALLBACK(on_long_mr_format_clicked), NULL);

	stash_group_add_toggle_button(group, &option_inspect_expand, "inspect_expand", TRUE,
		get_widget("option_inspect_expand"));
	stash_group_add_spin_button_integer(group, &option_inspect_count, "inspect_count", 100,
		get_widget("option_inspect_count"));

	stash_group_add_toggle_button(group, &option_library_messages, "library_messages", FALSE,
		get_widget("option_library_messages"));
	stash_group_add_toggle_button(group, &option_editor_tooltips, "editor_tooltips", TRUE,
		get_widget("option_editor_tooltips"));
	stash_group_add_boolean(group, &stack_show_address, "stack_show_address", TRUE);
	options_group = group;

	group = stash_group_new("terminal");
#ifdef G_OS_UNIX
	stash_group_add_boolean(group, &terminal_auto_show, "auto_show", FALSE);
	stash_group_add_boolean(group, &terminal_auto_hide, "auto_hide", FALSE);
	stash_group_add_boolean(group, &terminal_show_on_error, "show_on_error", FALSE);
#endif
	terminal_group = group;

	group = stash_group_new("thread");
	stash_group_add_boolean(group, &thread_select_on_running, "select_on_running", FALSE);
	stash_group_add_boolean(group, &thread_select_on_stopped, "select_on_stopped", TRUE);
	stash_group_add_boolean(group, &thread_select_on_exited, "select_on_exited", TRUE);
	stash_group_add_boolean(group, &thread_select_follow, "select_follow", TRUE);
	stash_group_add_boolean(group, &thread_show_group, "show_group", TRUE);
	stash_group_add_boolean(group, &thread_show_core, "show_core", TRUE);
	thread_group = group;

	recent_programs = SCP_TREE_STORE(get_object("recent_program_store"));
	recent_bitmap = 0;
	recent_menu = get_widget("program_recent_menu");
}