/* Returns the number of undo's. */
static gint
test_undo_redo (GtkSourceBuffer *buffer,
		gint             max_actions)
{
	gint nb_actions;
	gint i;

	for (nb_actions = 0; nb_actions < max_actions; nb_actions++)
	{
		if (gtk_source_buffer_can_undo (buffer))
		{
			gtk_source_buffer_undo (buffer);
		}
		else
		{
			break;
		}
	}

	for (i = 0; i < nb_actions; i++)
	{
		g_assert (gtk_source_buffer_can_redo (buffer));
		gtk_source_buffer_redo (buffer);
	}

	return nb_actions;
}
Exemple #2
0
void mape_edit_view_undo(MapeEditView* edit_view)
{
	gtk_source_buffer_undo(
		GTK_SOURCE_BUFFER(
			gtk_text_view_get_buffer(GTK_TEXT_VIEW(edit_view->view))
		)
	);
}
Exemple #3
0
void
peacock_file_undo (PeacockFile *file)
{
	g_return_if_fail (file != NULL);
	g_return_if_fail (PEACOCK_IS_FILE (file));

	gtk_source_buffer_undo (GTK_SOURCE_BUFFER (file));
}
Exemple #4
0
/* Edit->Undo */
void
action_undo(GtkAction *action, I7Document *document)
{
	GtkSourceBuffer *buffer = i7_document_get_buffer(document);
	if(gtk_source_buffer_can_undo(buffer))
		gtk_source_buffer_undo(buffer);

	/* Update the "sensitive" state of the undo and redo actions */
	gtk_action_set_sensitive(action, gtk_source_buffer_can_undo(buffer));
	gtk_action_set_sensitive(document->redo, gtk_source_buffer_can_redo(buffer));
}
void
gtr_actions_edit_undo (GtkAction * action, GtrWindow * window)
{
  GtrView *active_view;
  GtkSourceBuffer *active_document;

  active_view = gtr_window_get_active_view (window);
  g_return_if_fail (active_view);

  active_document =
    GTK_SOURCE_BUFFER (gtk_text_view_get_buffer
                       (GTK_TEXT_VIEW (active_view)));

  gtk_text_buffer_begin_user_action (GTK_TEXT_BUFFER (active_document));
  gtk_source_buffer_undo (active_document);
  gtk_text_buffer_end_user_action (GTK_TEXT_BUFFER (active_document));

  gtk_widget_grab_focus (GTK_WIDGET (active_view));
}
Exemple #6
0
void
_xedit_cmd_edit_undo (GtkAction   *action,
		     XeditWindow *window)
{
	XeditView *active_view;
	GtkSourceBuffer *active_document;

	xedit_debug (DEBUG_COMMANDS);

	active_view = xedit_window_get_active_view (window);
	g_return_if_fail (active_view);

	active_document = GTK_SOURCE_BUFFER (gtk_text_view_get_buffer (GTK_TEXT_VIEW (active_view)));

	gtk_source_buffer_undo (active_document);

	xedit_view_scroll_to_cursor (active_view);

	gtk_widget_grab_focus (GTK_WIDGET (active_view));
}
Exemple #7
0
void
_gedit_cmd_edit_undo (GSimpleAction *action,
                      GVariant      *parameter,
                      gpointer       user_data)
{
	GeditWindow *window = GEDIT_WINDOW (user_data);
	GeditView *active_view;
	GtkSourceBuffer *active_document;

	gedit_debug (DEBUG_COMMANDS);

	active_view = gedit_window_get_active_view (window);
	g_return_if_fail (active_view);

	active_document = GTK_SOURCE_BUFFER (gtk_text_view_get_buffer (GTK_TEXT_VIEW (active_view)));

	gtk_source_buffer_undo (active_document);

	gedit_view_scroll_to_cursor (active_view);

	gtk_widget_grab_focus (GTK_WIDGET (active_view));
}
Exemple #8
0
void do_undo(){
   if(gtk_source_buffer_can_undo(GTK_SOURCE_BUFFER(mBuff))) gtk_source_buffer_undo(GTK_SOURCE_BUFFER(mBuff));
}
Exemple #9
0
//操作を元に戻す
void undo_action(void)
{
    gtk_source_buffer_undo(buffer);
}