antiright-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Antiright-devel] antiright ACE-desktop/guidl/Horizontal_Deskbar....


From: Jeffrey Bedard
Subject: [Antiright-devel] antiright ACE-desktop/guidl/Horizontal_Deskbar....
Date: Mon, 12 Nov 2007 01:21:34 +0000

CVSROOT:        /sources/antiright
Module name:    antiright
Changes by:     Jeffrey Bedard <jefbed> 07/11/12 01:21:34

Modified files:
        ACE-desktop/guidl: Horizontal_Deskbar.gdl 
        ACE-desktop/icons/gnome_medium: chat_32.png terminal_32.png 
        ACE-desktop/icons/gnome_small: chat_16.png terminal_16.png 
        gtkshell       : Makefile add_options.c text.c 
Added files:
        gtkshell       : undo.c undo.h view.h 

Log message:
        Begin to add undo support to text editor.  Updated icon for chat to
        one of my own design.  

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/antiright/ACE-desktop/guidl/Horizontal_Deskbar.gdl?cvsroot=antiright&r1=1.39&r2=1.40
http://cvs.savannah.gnu.org/viewcvs/antiright/ACE-desktop/icons/gnome_medium/chat_32.png?cvsroot=antiright&rev=1.3
http://cvs.savannah.gnu.org/viewcvs/antiright/ACE-desktop/icons/gnome_medium/terminal_32.png?cvsroot=antiright&rev=1.3
http://cvs.savannah.gnu.org/viewcvs/antiright/ACE-desktop/icons/gnome_small/chat_16.png?cvsroot=antiright&rev=1.3
http://cvs.savannah.gnu.org/viewcvs/antiright/ACE-desktop/icons/gnome_small/terminal_16.png?cvsroot=antiright&rev=1.3
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/Makefile?cvsroot=antiright&r1=1.46&r2=1.47
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/add_options.c?cvsroot=antiright&r1=1.48&r2=1.49
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/text.c?cvsroot=antiright&r1=1.38&r2=1.39
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/undo.c?cvsroot=antiright&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/undo.h?cvsroot=antiright&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/view.h?cvsroot=antiright&rev=1.1

Patches:
Index: ACE-desktop/guidl/Horizontal_Deskbar.gdl
===================================================================
RCS file: 
/sources/antiright/antiright/ACE-desktop/guidl/Horizontal_Deskbar.gdl,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -b -r1.39 -r1.40
--- ACE-desktop/guidl/Horizontal_Deskbar.gdl    11 Nov 2007 23:22:49 -0000      
1.39
+++ ACE-desktop/guidl/Horizontal_Deskbar.gdl    12 Nov 2007 01:21:33 -0000      
1.40
@@ -93,7 +93,7 @@
 add buttons 
        "ACE -A Command # Command ,gtk-execute",
        "ACE Lock ,gtk-dialog-authentication",
-       "ACE Terminal ,Terminal_32.png",
+       "ACE Terminal ,terminal_32.png",
        "ACE File_Manager ,gtk-open",
        "ACE Browser ,www_32.png",
        "ACE Text_Editor ,gtk-edit",

Index: ACE-desktop/icons/gnome_medium/chat_32.png
===================================================================
RCS file: 
/sources/antiright/antiright/ACE-desktop/icons/gnome_medium/chat_32.png,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
Binary files /tmp/cvsWtmWdC and /tmp/cvsk6acRH differ

Index: ACE-desktop/icons/gnome_medium/terminal_32.png
===================================================================
RCS file: 
/sources/antiright/antiright/ACE-desktop/icons/gnome_medium/terminal_32.png,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
Binary files /tmp/cvsJQgXJC and /tmp/cvseWy8nI differ

Index: ACE-desktop/icons/gnome_small/chat_16.png
===================================================================
RCS file: 
/sources/antiright/antiright/ACE-desktop/icons/gnome_small/chat_16.png,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
Binary files /tmp/cvs6vsTZC and /tmp/cvsQo7YEI differ

Index: ACE-desktop/icons/gnome_small/terminal_16.png
===================================================================
RCS file: 
/sources/antiright/antiright/ACE-desktop/icons/gnome_small/terminal_16.png,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
Binary files /tmp/cvsRp6kdB and /tmp/cvssFnhTG differ

Index: gtkshell/Makefile
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/Makefile,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -b -r1.46 -r1.47
--- gtkshell/Makefile   31 Oct 2007 13:57:38 -0000      1.46
+++ gtkshell/Makefile   12 Nov 2007 01:21:33 -0000      1.47
@@ -39,7 +39,7 @@
        guidl_util.o about_dialog.o init.o guidl_dialog.o guidl_dictionary.o\
        guidl_options.o guidl_widgets.o update_manager.o pane.o\
        command_shell.o app_mode.o clock.o tree.o form.o dialog.o swallow.o\
-       GSHWidget.o quickstart.o
+       GSHWidget.o quickstart.o undo.o 
 
 program=main.o 
 

Index: gtkshell/add_options.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/add_options.c,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -b -r1.48 -r1.49
--- gtkshell/add_options.c      25 Oct 2007 01:07:43 -0000      1.48
+++ gtkshell/add_options.c      12 Nov 2007 01:21:33 -0000      1.49
@@ -166,6 +166,7 @@
 
        case 'e':
                GSH_COUNT(argc, counter);
+               GSH_SET(GSH_APP_MODE);
                gsh_text_editor(gsh, argv[*counter]);
                break;
 

Index: gtkshell/text.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/text.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -b -r1.38 -r1.39
--- gtkshell/text.c     12 Nov 2007 00:16:53 -0000      1.38
+++ gtkshell/text.c     12 Nov 2007 01:21:33 -0000      1.39
@@ -21,6 +21,7 @@
 */
 
 #include "gtkshell.h"
+#include "undo.h"
 
 #define ADD_ENTRY(widget, str)\
        gtk_combo_box_prepend_text(GTK_COMBO_BOX(widget), str)
@@ -138,6 +139,25 @@
        return buffer;
 }
 
+static void
+setup_undo(GSH * gsh)
+{
+       GtkWidget * text_widget=gsh->editor.widget;
+
+       GtkWidget * redo_button;
+       GtkWidget * undo_button;
+       /*gsh->rows->total=1;
+       $(gsh->rows, check);
+       gsh->rows->total=8;
+       redo_button=$(gsh, add.button, "Undo,gtk-undo");
+       undo_button=$(gsh, add.button, "Redo,gtk-redo"); */
+       redo_button=gtk_button_new_with_label("Undo");
+       undo_button=gtk_button_new_with_label("Redo"); 
+       $(gsh, manage, redo_button);
+       $(gsh, manage, undo_button);
+       undo_init(text_widget, undo_button, redo_button);
+}
+
 /* This is currently just a text file viewer.  */
 void
 gsh_text_editor(struct GSH * gsh, const gchar *filename)
@@ -148,6 +168,7 @@
        text=antiright_read_named_file(filename);
        (void)gsh_text_area_set_text(gsh_text_area(gsh), text);
        g_free(text);
+       setup_undo(gsh);
        CHECK_GEOMETRY(gsh);
 }
 

Index: gtkshell/undo.c
===================================================================
RCS file: gtkshell/undo.c
diff -N gtkshell/undo.c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ gtkshell/undo.c     12 Nov 2007 01:21:34 -0000      1.1
@@ -0,0 +1,408 @@
+/*
+ *  Leafpad - GTK+ based simple text editor
+ *  Copyright (C) 2004-2005 Tarot Osuji
+ *  
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *  
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *  
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <gtk/gtk.h>
+#include <gdk/gdkkeysyms.h>
+#include "view.h"
+#include "undo.h"
+
+#define DV(x)
+
+static GtkTextView * gsh_undo_text_view;
+
+/* BEGIN -- view.c extracts */
+static gint keyval;
+
+gint get_current_keyval(void)
+{
+       return keyval;
+}
+
+void clear_current_keyval(void)
+{
+       keyval = 0;
+}
+
+void scroll_to_cursor(GtkTextBuffer *buffer, gdouble within_margin)
+{
+       gtk_text_view_scroll_to_mark(gsh_undo_text_view,
+               gtk_text_buffer_get_insert(buffer),
+               within_margin, FALSE, 0, 0);
+}
+
+/* END - view.c extracts */
+
+//"GTK_TEXT_VIEW(view)->overwrite_mode" can get overwrite_mode state
+
+typedef struct {
+       gchar command;
+       gint start;
+       gint end;
+       gboolean seq; // sequency flag
+       gchar *str;
+} UndoInfo;
+
+enum {
+       INS = 0,
+       BS,
+       DEL
+};
+
+static GtkWidget *undo_w = NULL;
+static GtkWidget *redo_w = NULL;
+static GList *undo_list = NULL;
+static GList *redo_list = NULL;
+static GString *undo_gstr;
+static UndoInfo *ui_tmp;
+static gint modified_step;
+static guint prev_keyval;
+static gboolean seq_reserve = FALSE;
+
+static void undo_flush_temporal_buffer(GtkTextBuffer *buffer);
+
+static GList *undo_clear_info_list(GList *info_list)
+{
+       while (g_list_length(info_list)) {
+               g_free(((UndoInfo *)info_list->data)->str);
+               g_free(info_list->data);
+               info_list = g_list_delete_link(info_list, info_list);
+       }
+       return info_list;
+}
+
+static void undo_append_undo_info(GtkTextBuffer *buffer, gchar command, gint 
start, gint end, gchar *str)
+{
+       UndoInfo *ui = g_malloc(sizeof(UndoInfo));
+       
+       ui->command = command;
+       ui->start = start;
+       ui->end = end;
+//     ui->seq = FALSE;
+       ui->seq = seq_reserve;
+       ui->str = str;
+       
+       seq_reserve = FALSE;
+       
+       undo_list = g_list_append(undo_list, ui);
+DV(g_print("undo_cb: %d %s (%d-%d)\n", command, str, start, end));
+}
+
+static void undo_create_undo_info(GtkTextBuffer *buffer, gchar command, gint 
start, gint end)
+{
+       GtkTextIter start_iter, end_iter;
+       gboolean seq_flag = FALSE;
+       gchar *str;
+       gint keyval = get_current_keyval();
+       
+       gtk_text_buffer_get_iter_at_offset(buffer, &start_iter, start);
+       gtk_text_buffer_get_iter_at_offset(buffer, &end_iter, end);
+       str = gtk_text_buffer_get_text(buffer, &start_iter, &end_iter, FALSE);
+       
+       if (undo_gstr->len) {
+               if ((end - start == 1) && (command == ui_tmp->command)) {
+                       switch (keyval) {
+                       case GDK_BackSpace:
+                               if (end == ui_tmp->start)
+                                       seq_flag = TRUE;
+                               break;
+                       case GDK_Delete:
+                               if (start == ui_tmp->start)
+                                       seq_flag = TRUE;
+                               break;
+                       case GDK_Tab:
+                       case GDK_space:
+                               if (start == ui_tmp->end)
+                                       seq_flag = TRUE;
+                               break;
+                       default:
+                               if (start == ui_tmp->end)
+                                       if (keyval && keyval < 0xF000)
+                                               switch (prev_keyval) {
+                                               case GDK_Return:
+                                               case GDK_Tab:
+                                               case GDK_space:
+                                                       break;
+                                               default:
+                                                       seq_flag = TRUE;
+                                               }
+                       }
+               }
+               if (seq_flag) {
+                       switch (command) {
+                       case BS:
+                               undo_gstr = g_string_prepend(undo_gstr, str);
+                               ui_tmp->start--;
+                               break;
+                       default:
+                               undo_gstr = g_string_append(undo_gstr, str);
+                               ui_tmp->end++;
+                       }
+                       redo_list = undo_clear_info_list(redo_list);
+                       prev_keyval = keyval;
+                       gtk_widget_set_sensitive(undo_w, TRUE);
+                       gtk_widget_set_sensitive(redo_w, FALSE);
+                       return;
+               }
+               undo_append_undo_info(buffer, ui_tmp->command, ui_tmp->start, 
ui_tmp->end, g_strdup(undo_gstr->str));
+               undo_gstr = g_string_erase(undo_gstr, 0, -1);
+       }
+       
+       if (!keyval && prev_keyval)
+               undo_set_sequency(TRUE);
+       
+       if (end - start == 1 &&
+               ((keyval && keyval < 0xF000) ||
+                 keyval == GDK_BackSpace || keyval == GDK_Delete || keyval == 
GDK_Tab)) {
+               ui_tmp->command = command;
+               ui_tmp->start = start;
+               ui_tmp->end = end;
+               undo_gstr = g_string_erase(undo_gstr, 0, -1);
+               g_string_append(undo_gstr, str);
+       } else 
+               undo_append_undo_info(buffer, command, start, end, 
g_strdup(str));
+       
+       redo_list = undo_clear_info_list(redo_list);
+       prev_keyval = keyval;
+       clear_current_keyval();
+//     keyevent_setval(0);
+       gtk_widget_set_sensitive(undo_w, TRUE);
+       gtk_widget_set_sensitive(redo_w, FALSE);
+}
+
+static void cb_insert_text(GtkTextBuffer *buffer, GtkTextIter *iter, gchar 
*str,
+gint len)
+{
+       gint start, end;
+       
+DV(    g_print("insert-text\n"));
+       end = gtk_text_iter_get_offset(iter);
+       start = end - g_utf8_strlen(str, -1);
+       
+       undo_create_undo_info(buffer, INS, start, end);
+}
+
+static void cb_delete_range(GtkTextBuffer *buffer, GtkTextIter *start_iter, 
GtkTextIter *end_iter)
+{
+       gint start, end;
+       gchar command;
+       
+DV(    g_print("delete-range\n"));
+       start = gtk_text_iter_get_offset(start_iter);
+       end = gtk_text_iter_get_offset(end_iter);
+       
+       if (get_current_keyval() == GDK_BackSpace)
+               command = BS;
+       else
+               command = DEL;
+       undo_create_undo_info(buffer, command, start, end);
+}
+
+void undo_reset_modified_step(GtkTextBuffer *buffer)
+{
+       undo_flush_temporal_buffer(buffer);
+       modified_step = g_list_length(undo_list);
+DV(g_print("undo_reset_modified_step: Reseted modified_step by %d\n", 
modified_step));
+}
+
+static void undo_check_modified_step(GtkTextBuffer *buffer)
+{
+       gboolean flag;
+       
+       flag = (modified_step == g_list_length(undo_list));
+//g_print("%d - %d = %d\n", modified_step, g_list_length(undo_list), flag);
+       if (gtk_text_buffer_get_modified(buffer) == flag)
+               gtk_text_buffer_set_modified(buffer, !flag);
+//g_print("change!\n");}
+}
+/*
+static void undo_check_modified_step(GtkTextBuffer *buffer)
+{
+       if (modified_step == g_list_length(undo_list))
+               gtk_text_buffer_set_modified(buffer, FALSE);
+}
+*//* // ????? "modified-changed" signal isn't emitted properly...
+#include "window.h"
+static void undo_check_modified_step(GtkTextBuffer *buffer)
+{
+       if (modified_step == g_list_length(undo_list)) {
+               gtk_text_buffer_set_modified(buffer, FALSE);
+               set_main_window_title();
+       }
+}
+*/
+static void cb_begin_user_action(GtkTextBuffer *buffer)
+{
+       g_signal_handlers_unblock_by_func(G_OBJECT(buffer), 
+               G_CALLBACK(cb_insert_text), NULL);
+       g_signal_handlers_unblock_by_func(G_OBJECT(buffer),
+               G_CALLBACK(cb_delete_range), NULL);
+DV(g_print("begin-user-action(unblock_func)"));
+DV(g_print(": keyval = 0x%X\n", get_current_keyval()));
+}
+
+static void cb_end_user_action(GtkTextBuffer *buffer)
+{
+       g_signal_handlers_block_by_func(G_OBJECT(buffer), 
+               G_CALLBACK(cb_insert_text), NULL);
+       g_signal_handlers_block_by_func(G_OBJECT(buffer),
+               G_CALLBACK(cb_delete_range), NULL);
+DV(g_print("end-user-action(block_func)\n"));
+}
+
+void undo_clear_all(GtkTextBuffer *buffer)
+{
+       undo_list = undo_clear_info_list(undo_list);
+       redo_list = undo_clear_info_list(redo_list);
+       undo_reset_modified_step(buffer);
+       gtk_widget_set_sensitive(undo_w, FALSE);
+       gtk_widget_set_sensitive(redo_w, FALSE);
+       
+       ui_tmp->command = INS;
+       undo_gstr = g_string_erase(undo_gstr, 0, -1);
+       prev_keyval = 0;
+}
+
+void undo_init(GtkWidget *view, GtkWidget *undo_button, GtkWidget *redo_button)
+{
+       GtkTextBuffer *buffer = GTK_TEXT_VIEW(view)->buffer;
+        
+       undo_w = undo_button;
+       redo_w = redo_button;
+       gsh_undo_text_view=GTK_TEXT_VIEW(view);
+       
+       g_signal_connect_after(G_OBJECT(buffer), "insert-text",
+               G_CALLBACK(cb_insert_text), NULL);
+       g_signal_connect(G_OBJECT(buffer), "delete-range",
+               G_CALLBACK(cb_delete_range), NULL);
+       g_signal_connect_after(G_OBJECT(buffer), "begin-user-action",
+               G_CALLBACK(cb_begin_user_action), NULL);
+       g_signal_connect(G_OBJECT(buffer), "end-user-action",
+               G_CALLBACK(cb_end_user_action), NULL);
+       cb_end_user_action(buffer);
+       
+       ui_tmp = g_malloc(sizeof(UndoInfo));
+       undo_gstr = g_string_new("");
+       
+       undo_clear_all(buffer);
+}
+
+void undo_set_sequency(gboolean seq)
+{
+       if (g_list_length(undo_list))
+               ((UndoInfo *)g_list_last(undo_list)->data)->seq = seq;
+DV(g_print("<undo_set_sequency: %d>\n", seq)); 
+}
+
+void undo_set_sequency_reserve(void)
+{
+       seq_reserve = TRUE;
+}
+
+static void undo_flush_temporal_buffer(GtkTextBuffer *buffer)
+{
+       if (undo_gstr->len) {
+               undo_append_undo_info(buffer, ui_tmp->command,
+                       ui_tmp->start, ui_tmp->end, g_strdup(undo_gstr->str));
+               undo_gstr = g_string_erase(undo_gstr, 0, -1);
+       }
+}
+
+gboolean undo_undo_real(GtkTextBuffer *buffer)
+{
+       GtkTextIter start_iter, end_iter;
+       UndoInfo *ui;
+       
+       undo_flush_temporal_buffer(buffer);
+       if (g_list_length(undo_list)) {
+//             undo_block_signal(buffer);
+               ui = g_list_last(undo_list)->data;
+               gtk_text_buffer_get_iter_at_offset(buffer, &start_iter, 
ui->start);
+               switch (ui->command) {
+               case INS:
+                       gtk_text_buffer_get_iter_at_offset(buffer, &end_iter, 
ui->end);
+                       gtk_text_buffer_delete(buffer, &start_iter, &end_iter);
+                       break;
+               default:
+                       gtk_text_buffer_insert(buffer, &start_iter, ui->str, 
-1);
+               }
+               redo_list = g_list_append(redo_list, ui);
+               undo_list = g_list_delete_link(undo_list, 
g_list_last(undo_list));
+DV(g_print("cb_edit_undo: undo left = %d, redo left = %d\n",
+g_list_length(undo_list), g_list_length(redo_list)));
+//             undo_unblock_signal(buffer);
+               if (g_list_length(undo_list)) {
+                       if (((UndoInfo *)g_list_last(undo_list)->data)->seq)
+                               return TRUE;
+               } else
+                       gtk_widget_set_sensitive(undo_w, FALSE);
+               gtk_widget_set_sensitive(redo_w, TRUE);
+               if (ui->command == DEL)
+                       gtk_text_buffer_get_iter_at_offset(buffer, &start_iter, 
ui->start);
+               gtk_text_buffer_place_cursor(buffer, &start_iter);
+               scroll_to_cursor(buffer, 0.05);
+       }
+       undo_check_modified_step(buffer);
+       return FALSE;
+}
+
+gboolean undo_redo_real(GtkTextBuffer *buffer)
+{
+       GtkTextIter start_iter, end_iter;
+       UndoInfo *ri;
+       
+       if (g_list_length(redo_list)) {
+//             undo_block_signal(buffer);
+               ri = g_list_last(redo_list)->data;
+               gtk_text_buffer_get_iter_at_offset(buffer, &start_iter, 
ri->start);
+               switch (ri->command) {
+               case INS:
+                       gtk_text_buffer_insert(buffer, &start_iter, ri->str, 
-1);
+                       break;
+               default:
+                       gtk_text_buffer_get_iter_at_offset(buffer, &end_iter, 
ri->end);
+                       gtk_text_buffer_delete(buffer, &start_iter, &end_iter);
+               }
+               undo_list = g_list_append(undo_list, ri);
+               redo_list = g_list_delete_link(redo_list, 
g_list_last(redo_list));
+DV(g_print("cb_edit_redo: undo left = %d, redo left = %d\n",
+g_list_length(undo_list), g_list_length(redo_list)));
+//             undo_unblock_signal(buffer);
+               if (ri->seq) {
+                       undo_set_sequency(TRUE);
+                       return TRUE;
+               }
+               if (!g_list_length(redo_list))
+                       gtk_widget_set_sensitive(redo_w, FALSE);
+               gtk_widget_set_sensitive(undo_w, TRUE);
+               gtk_text_buffer_place_cursor(buffer, &start_iter);
+               scroll_to_cursor(buffer, 0.05);
+       }
+       undo_check_modified_step(buffer);
+       return FALSE;
+}
+
+void undo_undo(GtkTextBuffer *buffer)
+{
+       while (undo_undo_real(buffer)) {};
+}
+
+void undo_redo(GtkTextBuffer *buffer)
+{
+       while (undo_redo_real(buffer)) {};
+}

Index: gtkshell/undo.h
===================================================================
RCS file: gtkshell/undo.h
diff -N gtkshell/undo.h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ gtkshell/undo.h     12 Nov 2007 01:21:34 -0000      1.1
@@ -0,0 +1,31 @@
+/*
+ *  Leafpad - GTK+ based simple text editor
+ *  Copyright (C) 2004-2005 Tarot Osuji
+ *  
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *  
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *  
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef _UNDO_H
+#define _UNDO_H
+
+void undo_reset_modified_step(GtkTextBuffer *buffer);
+void undo_clear_all(GtkTextBuffer *buffer);
+void undo_init(GtkWidget *view, GtkWidget *undo_button, GtkWidget 
*redo_button);
+void undo_set_sequency(gboolean seq);
+void undo_set_sequency_reserve(void);
+void undo_undo(GtkTextBuffer *buffer);
+void undo_redo(GtkTextBuffer *buffer);
+
+#endif /* _UNDO_H */

Index: gtkshell/view.h
===================================================================
RCS file: gtkshell/view.h
diff -N gtkshell/view.h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ gtkshell/view.h     12 Nov 2007 01:21:34 -0000      1.1
@@ -0,0 +1,33 @@
+/*
+ *  Leafpad - GTK+ based simple text editor
+ *  Copyright (C) 2004-2005 Tarot Osuji
+ *  
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *  
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *  
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef _VIEW_H
+#define _VIEW_H
+
+gint get_current_keyval(void);
+void clear_current_keyval(void);
+void scroll_to_cursor(GtkTextBuffer *buffer, gdouble within_margin);
+void force_call_cb_modified_changed(GtkWidget *view);
+void force_block_cb_modified_changed(GtkWidget *view);
+void force_unblock_cb_modified_changed(GtkWidget *view);
+void set_view_scroll(void);
+gint check_text_modification(void);
+GtkWidget *create_text_view(void);
+
+#endif /* _VIEW_H */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]