sync with sylpheed 0.6.6cvs3
authorPaul Mangan <paul@claws-mail.org>
Tue, 18 Dec 2001 07:36:38 +0000 (07:36 +0000)
committerPaul Mangan <paul@claws-mail.org>
Tue, 18 Dec 2001 07:36:38 +0000 (07:36 +0000)
13 files changed:
ChangeLog
ChangeLog.claws
ChangeLog.jp
configure.in
src/Makefile.am
src/compose.c
src/compose.h
src/imap.c
src/mainwindow.c
src/prefs_common.c
src/procmsg.c
src/undo.c
src/undo.h

index 3df96bd..5373df5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2001-12-18
+
+       * src/procmsg.c: procmsg_empty_trash()
+         src/mainwindow.c: main_window_empty_trash(): empty trash only if
+         it contains some messages.
+       * src/imap.c: search_array_str(): new.
+         imap_status(): fixed a bug that didn't parse the command response
+         correctly.
+
+2001-12-18
+
+       * merged undo function (by Jens Oberender).
+       * src/undo.[ch]: new.
+         undo_insert_text_cb(): fix for multibyte characters (obtain the
+         number of letters instead of bytes).
+       * src/compose.[ch]: added the code for undo.
+       * src/prefs_common.[ch]: added the interface for setting undo level.
+
 2001-12-16
 
        * src/compose.c: compose_template_apply()
index 34f35b9..b753471 100644 (file)
@@ -1,3 +1,8 @@
+2001-12-18 [paul]      0.6.6claws4
+
+       * sync with sylpheed 0.6.6cvs3
+               see ChangeLog entries 2001-12-18
+
 2001-12-18 [hiro]      0.6.6claws3
 
        * src/undo.c
index 5a702a4..73de5f6 100644 (file)
@@ -1,3 +1,20 @@
+2001-12-18
+
+       * src/procmsg.c: procmsg_empty_trash()
+         src/mainwindow.c: main_window_empty_trash(): ¤´¤ßÈ¢¤¬¥á¥Ã¥»¡¼¥¸¤ò
+         ´Þ¤ó¤Ç¤¤¤ë¾ì¹ç¤Î¤ß¶õ¤Ë¤¹¤ë¤è¤¦¤Ë¤·¤¿¡£
+       * src/imap.c: search_array_str(): ¿·µ¬¡£
+         imap_status(): ¥³¥Þ¥ó¥É¤Î±þÅú¤òÀµ¤·¤¯¥Ñ¡¼¥¹¤·¤Ê¤¤¥Ð¥°¤ò½¤Àµ¡£
+
+2001-12-18
+
+       * undo µ¡Ç½¤ò¥Þ¡¼¥¸ (Jens Oberender ¤µ¤óºî)¡£
+       * src/undo.[ch]: ¿·µ¬¡£
+         undo_insert_text_cb(): ¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤Î½¤Àµ(¥Ð¥¤¥È¿ô¤ÎÂå¤ï¤ê¤Ë
+         Ê¸»ú¿ô¤òÆÀ¤ë)¡£
+       * src/compose.[ch]: undo ¤Î¥³¡¼¥É¤òÄɲá£
+       * src/prefs_common.[ch]: ¥¢¥ó¥É¥¥¥ì¥Ù¥ëÀßÄêÍÑ¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤òÄɲá£
+
 2001-12-16
 
        * src/compose.c: compose_template_apply()
index 04cc513..29292ac 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=6
 MICRO_VERSION=6
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws3
+EXTRA_VERSION=claws4
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl
index d14ee1c..0919d5a 100644 (file)
@@ -66,6 +66,7 @@ sylpheed_SOURCES = \
        logwindow.c logwindow.h \
        sourcewindow.c sourcewindow.h \
        manage_window.c manage_window.h \
+       undo.c undo.h \
        alertpanel.c alertpanel.h \
        inputdialog.c inputdialog.h \
        progressdialog.c progressdialog.h \
@@ -121,7 +122,6 @@ sylpheed_SOURCES = \
        quote_fmt_lex.l quote_fmt_lex.h \
        quote_fmt_parse.y quote_fmt.h \
        gtkspell.c gtkspell.h gtkxtext.h \
-       undo.c undo.h \
        matcher_parser_lex.l matcher_parser_lex.h \
        matcher_parser_parse.y matcher_parser.h
 
index 10bb92e..30c0169 100644 (file)
@@ -126,10 +126,6 @@ static GdkColor quote_color = {0, 0, 0, 0xbfff};
 
 static GList *compose_list = NULL;
 
-static void compose_set_undo                   (UndoMain       *undostruct, 
-                                                 gint            undo_state, 
-                                                gint            redo_state, 
-                                                GtkWidget      *changewidget);
 Compose *compose_generic_new                   (PrefsAccount   *account,
                                                 const gchar    *to,
                                                 FolderItem     *item);
@@ -233,6 +229,11 @@ static void compose_input_cb                       (gpointer           data,
 static void compose_set_ext_editor_sensitive   (Compose           *compose,
                                                 gboolean           sensitive);
 
+static void compose_set_undo                   (UndoMain       *undostruct,
+                                                gint            undo_state,
+                                                gint            redo_state,
+                                                GtkWidget      *changewidget);
+
 static gint calc_cursor_xpos   (GtkSText       *text,
                                 gint            extra,
                                 gint            char_width);
@@ -321,8 +322,8 @@ static gint compose_delete_cb               (GtkWidget      *widget,
 static void compose_destroy_cb         (GtkWidget      *widget,
                                         Compose        *compose);
 
-static void compose_undo_cb            (Compose *compose);
-static void compose_redo_cb            (Compose *compose);
+static void compose_undo_cb            (Compose        *compose);
+static void compose_redo_cb            (Compose        *compose);
 static void compose_cut_cb             (Compose        *compose);
 static void compose_copy_cb            (Compose        *compose);
 static void compose_paste_cb           (Compose        *compose);
@@ -4334,6 +4335,9 @@ static Compose *compose_create(PrefsAccount *account, ComposeMode mode)
                break;
        }
 
+       undostruct = undo_init(text);
+       undo_set_undo_change_funct(undostruct, &compose_set_undo, menubar);
+
        gtk_widget_show(window);
 
        address_completion_start(window);
@@ -4395,6 +4399,7 @@ static Compose *compose_create(PrefsAccount *account, ComposeMode mode)
        compose->exteditor_tag     = -1;
 
        compose->bounce_filename = NULL;
+       compose->undostruct = undostruct;
 
        compose_set_title(compose);
 
@@ -4408,11 +4413,6 @@ static Compose *compose_create(PrefsAccount *account, ComposeMode mode)
         compose->gtkpspell      = gtkpspell;
 #endif
 
-       undostruct = undo_init(text);
-
-       compose->undostruct = undostruct;
-       undo_set_undo_change_funct(undostruct, &compose_set_undo, GTK_WIDGET(compose->menubar));
-
 #if 0 /* NEW COMPOSE GUI */
        if (account->protocol != A_NNTP) {
                menuitem = gtk_item_factory_get_item(ifactory, "/Message/To");
@@ -5357,6 +5357,72 @@ static void compose_set_ext_editor_sensitive(Compose *compose,
        gtk_widget_set_sensitive(compose->linewrap_btn,  sensitive);
 }
 
+/**
+ * undo_set_undo:
+ *
+ * Change the sensivity of the menuentries undo and redo
+ **/
+static void compose_set_undo(UndoMain *undostruct, gint undo_state,
+                            gint redo_state, GtkWidget *changewidget)
+{
+       GtkItemFactory *ifactory;
+
+       g_return_if_fail(changewidget != NULL);
+
+       debug_print("Set_undo.  UNDO:%i  REDO:%i\n", undo_state, redo_state);
+
+       ifactory = gtk_item_factory_from_widget(changewidget);
+
+       switch (undo_state) {
+       case UNDO_STATE_TRUE:
+               if (!undostruct->undo_state) {
+                       debug_print ("Set_undo - Testpoint\n");
+                       undostruct->undo_state = TRUE;
+                       menu_set_sensitive(ifactory, "/Edit/Undo", TRUE);
+               }
+               break;
+       case UNDO_STATE_FALSE:
+               if (undostruct->undo_state) {
+                       undostruct->undo_state = FALSE;
+                       menu_set_sensitive(ifactory, "/Edit/Undo", FALSE);
+               }
+               break;
+       case UNDO_STATE_UNCHANGED:
+               break;
+       case UNDO_STATE_REFRESH:
+               menu_set_sensitive(ifactory, "/Edit/Undo",
+                                  undostruct->undo_state);
+               break;
+       default:
+               g_warning("Undo state not recognized");
+               break;
+       }
+
+       switch (redo_state) {
+       case UNDO_STATE_TRUE:
+               if (!undostruct->redo_state) {
+                       undostruct->redo_state = TRUE;
+                       menu_set_sensitive(ifactory, "/Edit/Redo", TRUE);
+               }
+               break;
+       case UNDO_STATE_FALSE:
+               if (undostruct->redo_state) {
+                       undostruct->redo_state = FALSE;
+                       menu_set_sensitive(ifactory, "/Edit/Redo", FALSE);
+               }
+               break;
+       case UNDO_STATE_UNCHANGED:
+               break;
+       case UNDO_STATE_REFRESH:
+               menu_set_sensitive(ifactory, "/Edit/Redo",
+                                  undostruct->redo_state);
+               break;
+       default:
+               g_warning("Redo state not recognized");
+               break;
+       }
+}
+
 static gint calc_cursor_xpos(GtkSText *text, gint extra, gint char_width)
 {
        gint cursor_pos;
@@ -5759,12 +5825,12 @@ static void compose_destroy_cb(GtkWidget *widget, Compose *compose)
        compose_destroy(compose);
 }
 
-static void compose_undo_cb(Compose *compose) 
+static void compose_undo_cb(Compose *compose)
 {
        undo_undo(compose->undostruct);
 }
 
-static void compose_redo_cb(Compose *compose) 
+static void compose_redo_cb(Compose *compose)
 {
        undo_redo(compose->undostruct);
 }
@@ -6162,70 +6228,3 @@ void compose_headerentry_changed_cb(GtkWidget *entry,
                         headerentry);
        }
 }
-
-/**
- * undo_set_undo:
- *
- * Change the sensivity of the menuentries undo and redo
- **/
-static void compose_set_undo(UndoMain *undostruct, gint undo_state, 
-                            gint redo_state, GtkWidget *changewidget) 
-{
-       GtkItemFactory *ifactory;
-        debug_print ("Set_undo.  UNDO:%i  REDO:%i\n",
-                 undo_state,
-                 redo_state);
-
-       g_return_if_fail (changewidget != NULL);
-
-       ifactory = gtk_item_factory_from_widget(changewidget);
-
-       /* Set undo */
-        switch (undo_state) {
-        case UNDO_STATE_TRUE:
-                if (!undostruct->undo_state) {
-                       debug_print ("Set_undo - Testpoint\n");
-                        undostruct->undo_state = TRUE;
-                       menu_set_sensitive(ifactory, "/Edit/Undo", TRUE);
-                }
-                break;
-        case UNDO_STATE_FALSE:
-                if (undostruct->undo_state) {
-                        undostruct->undo_state = FALSE;
-                       menu_set_sensitive(ifactory, "/Edit/Undo", FALSE);
-                }
-                break;
-        case UNDO_STATE_UNCHANGED:
-                break;
-        case UNDO_STATE_REFRESH:
-               menu_set_sensitive(ifactory, "/Edit/Undo", undostruct->undo_state);
-                break;
-        default:
-                g_warning ("Undo state not recognized");
-               break;
-        }
-
-        /* Set redo*/
-        switch (redo_state) {
-        case UNDO_STATE_TRUE:
-                if (!undostruct->redo_state) {
-                        undostruct->redo_state = TRUE;
-                       menu_set_sensitive(ifactory, "/Edit/Redo", TRUE);
-                }
-                break;
-        case UNDO_STATE_FALSE:
-                if (undostruct->redo_state) {
-                        undostruct->redo_state = FALSE;
-                       menu_set_sensitive(ifactory, "/Edit/Redo", FALSE);
-                }
-                break;
-        case UNDO_STATE_UNCHANGED:
-                break;
-        case UNDO_STATE_REFRESH:
-               menu_set_sensitive(ifactory, "/Edit/Redo", undostruct->redo_state);
-                break;
-        default:
-                g_warning ("Redo state not recognized");
-               break;
-        }
-}
index 1fd29bd..a9011b7 100644 (file)
@@ -183,14 +183,14 @@ struct _Compose
        PrefsAccount *account;
        PrefsAccount *orig_account;
 
+       UndoMain *undostruct;
+
        /* external editor */
        gchar *exteditor_file;
        pid_t  exteditor_pid;
        gint   exteditor_readdes;
        gint   exteditor_tag;
 
-       UndoMain *undostruct;
-
 #if USE_PSPELL
         /* Pspell spell checker */
         GtkPspell *gtkpspell;
index f9907f8..9796582 100644 (file)
@@ -236,6 +236,8 @@ static gchar *get_quoted                    (const gchar    *src,
                                                 gint            len);
 static gchar *search_array_contain_str         (GPtrArray      *array,
                                                 gchar          *str);
+static gchar *search_array_str                 (GPtrArray      *array,
+                                                gchar          *str);
 static void imap_path_separator_subst          (gchar          *str,
                                                 gchar           separator);
 
@@ -1938,7 +1940,7 @@ static gint imap_status(IMAPSession *session, IMAPFolder *folder,
        ok = imap_cmd_ok(SESSION(session)->sock, argbuf);
        if (ok != IMAP_SUCCESS) THROW(ok);
 
-       str = search_array_contain_str(argbuf, "STATUS");
+       str = search_array_str(argbuf, "STATUS");
        if (!str) THROW(IMAP_ERROR);
 
        str = strchr(str, '(');
@@ -2020,7 +2022,7 @@ static gint imap_cmd_namespace(SockInfo *sock, gchar **ns_str)
        imap_cmd_gen_send(sock, "NAMESPACE");
        if ((ok = imap_cmd_ok(sock, argbuf)) != IMAP_SUCCESS) THROW(ok);
 
-       str = search_array_contain_str(argbuf, "NAMESPACE");
+       str = search_array_str(argbuf, "NAMESPACE");
        if (!str) THROW(IMAP_ERROR);
 
        *ns_str = g_strdup(str);
@@ -2394,6 +2396,24 @@ static gchar *search_array_contain_str(GPtrArray *array, gchar *str)
        return NULL;
 }
 
+static gchar *search_array_str(GPtrArray *array, gchar *str)
+{
+       gint i;
+       gint len;
+
+       len = strlen(str);
+
+       for (i = 0; i < array->len; i++) {
+               gchar *tmp;
+
+               tmp = g_ptr_array_index(array, i);
+               if (!strncmp(tmp, str, len))
+                       return tmp;
+       }
+
+       return NULL;
+}
+
 static void imap_path_separator_subst(gchar *str, gchar separator)
 {
        if (separator && separator != '/')
index 31e6e37..fef7e2c 100644 (file)
@@ -1229,7 +1229,7 @@ void main_window_empty_trash(MainWindow *mainwin, gboolean confirm)
                Folder *folder;
 
                folder = list->data;
-               if (folder->trash) {
+               if (folder->trash && folder->trash->total != 0) {
                        folder_item_scan(folder->trash);
                        folderview_update_item(folder->trash, TRUE);
                }
index 8602504..60e9ab2 100644 (file)
@@ -105,14 +105,12 @@ static struct Compose {
        GtkWidget *text_fw_quotefmt;
 
        GtkWidget *checkbtn_autoextedit;
-
+       GtkWidget *spinbtn_undolevel;
+       GtkObject *spinbtn_undolevel_adj;
        GtkWidget *checkbtn_reply_account_autosel;
        GtkWidget *checkbtn_forward_account_autosel;
        GtkWidget *checkbtn_reedit_account_autosel;
 
-       GtkWidget *spinbtn_undolevels;
-       GtkObject *spinbtn_undolevels_adj;
-
        GtkWidget *spinbtn_linewrap;
        GtkObject *spinbtn_linewrap_adj;
        GtkWidget *checkbtn_wrapquote;
@@ -323,8 +321,8 @@ static PrefParam param[] = {
         &compose.checkbtn_autoextedit,
         prefs_set_data_from_toggle, prefs_set_toggle},
 
-       {"undolevels", "50", &prefs_common.undolevels, P_INT,
-        &compose.spinbtn_undolevels,
+       {"undo_level", "50", &prefs_common.undolevels, P_INT,
+        &compose.spinbtn_undolevel,
         prefs_set_data_from_spinbtn, prefs_set_spinbtn},
 
        {"linewrap_length", "74", &prefs_common.linewrap_len, P_INT,
@@ -1366,10 +1364,10 @@ static void prefs_compose_create(void)
        GtkWidget *checkbtn_forward_account_autosel;
        GtkWidget *checkbtn_reedit_account_autosel;
 
-       GtkWidget *hbox_undolevels;
-       GtkWidget *label_undolevels;
-       GtkObject *spinbtn_undolevels_adj;
-       GtkWidget *spinbtn_undolevels;
+       GtkWidget *hbox_undolevel;
+       GtkWidget *label_undolevel;
+       GtkObject *spinbtn_undolevel_adj;
+       GtkWidget *spinbtn_undolevel;
 
        GtkWidget *vbox_linewrap;
 
@@ -1514,21 +1512,21 @@ static void prefs_compose_create(void)
 
        PACK_VSPACER (vbox2, vbox3, VSPACING_NARROW_2);
 
-       hbox_undolevels = gtk_hbox_new (FALSE, 8);
+       hbox_undolevel = gtk_hbox_new (FALSE, 8);
        gtk_widget_show (hbox3);
-       gtk_box_pack_start (GTK_BOX (vbox1), hbox_undolevels, FALSE, FALSE, 0);
+       gtk_box_pack_start (GTK_BOX (vbox1), hbox_undolevel, FALSE, FALSE, 0);
 
-       label_undolevels = gtk_label_new (_("Undo levels"));
-       gtk_widget_show (label_undolevels);
-       gtk_box_pack_start (GTK_BOX (hbox_undolevels), label_undolevels, FALSE, FALSE, 0);
+       label_undolevel = gtk_label_new (_("Undo level"));
+       gtk_widget_show (label_undolevel);
+       gtk_box_pack_start (GTK_BOX (hbox_undolevel), label_undolevel, FALSE, FALSE, 0);
 
-       spinbtn_undolevels_adj = gtk_adjustment_new (50, 0, 100, 1, 10, 10);
-       spinbtn_undolevels = gtk_spin_button_new
-               (GTK_ADJUSTMENT (spinbtn_undolevels_adj), 1, 0);
-       gtk_widget_show (spinbtn_undolevels);
-       gtk_box_pack_start (GTK_BOX (hbox_undolevels), spinbtn_undolevels, FALSE, FALSE, 0);
-       gtk_widget_set_usize (spinbtn_undolevels, 64, -1);
-       gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_undolevels), TRUE);
+       spinbtn_undolevel_adj = gtk_adjustment_new (50, 0, 100, 1, 10, 10);
+       spinbtn_undolevel = gtk_spin_button_new
+               (GTK_ADJUSTMENT (spinbtn_undolevel_adj), 1, 0);
+       gtk_widget_show (spinbtn_undolevel);
+       gtk_box_pack_start (GTK_BOX (hbox_undolevel), spinbtn_undolevel, FALSE, FALSE, 0);
+       gtk_widget_set_usize (spinbtn_undolevel, 64, -1);
+       gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_undolevel), TRUE);
 
 #if USE_PSPELL
        /* spell checker defaults */                       
@@ -1598,8 +1596,8 @@ static void prefs_compose_create(void)
        compose.checkbtn_forward_account_autosel = checkbtn_forward_account_autosel;
        compose.checkbtn_reedit_account_autosel  = checkbtn_reedit_account_autosel;
 
-       compose.spinbtn_undolevels     = spinbtn_undolevels;
-       compose.spinbtn_undolevels_adj = spinbtn_undolevels_adj;
+       compose.spinbtn_undolevel     = spinbtn_undolevel;
+       compose.spinbtn_undolevel_adj = spinbtn_undolevel_adj;
 
        compose.spinbtn_linewrap     = spinbtn_linewrap;
        compose.spinbtn_linewrap_adj = spinbtn_linewrap_adj;
index 94142f9..7463492 100644 (file)
@@ -750,7 +750,8 @@ void procmsg_empty_trash(void)
 
        for (cur = folder_get_list(); cur != NULL; cur = cur->next) {
                trash = FOLDER(cur->data)->trash;
-               if (trash) folder_item_remove_all_msg(trash);
+               if (trash && trash->total > 0)
+                       folder_item_remove_all_msg(trash);
        }
 }
 
index 53dcf39..fb6f02d 100644 (file)
@@ -42,8 +42,8 @@ struct _UndoInfo
        gchar *text;
        gint start_pos;
        gint end_pos;
-       gfloat window_position;
-       gint mergeable;
+       float window_position;
+       int mergeable;
 };
 
 static void undo_free_list     (GList         **list_pointer);
@@ -256,8 +256,7 @@ static gint undo_merge (GList *list, guint start_pos, guint end_pos, gint action
                         g_free(last_undo->text);
                         last_undo->end_pos += 1;
                         last_undo->text = temp_string;
-                }
-                else if (checkit) {
+                } else if (checkit) {
                         /* Deleted with the backspace key */
                         if ( text[0] != ' ' && text[0] != '\t' && checkit &&
                              (last_undo->text[0] == ' '
@@ -268,9 +267,8 @@ static gint undo_merge (GList *list, guint start_pos, guint end_pos, gint action
                         g_free(last_undo->text);
                         last_undo->start_pos = start_pos;
                         last_undo->text = temp_string;
-                }
-        }
-        else if (action == UNDO_ACTION_INSERT && checkit) {
+               }
+       } else if (action == UNDO_ACTION_INSERT && checkit) {
                 if (last_undo->end_pos != start_pos && checkit)
                          checkit = FALSE;
 
@@ -285,15 +283,13 @@ static gint undo_merge (GList *list, guint start_pos, guint end_pos, gint action
                        last_undo->end_pos = end_pos;
                        last_undo->text = temp_string;
                }
-        }
-        else if (checkit)
+       } else if (checkit)
                 debug_print("Unknown action [%i] inside undo merge encountered", action);
 
        if (checkit) {
                debug_print("Merged: %s\n", text);
                return TRUE;
-       }
-       else {
+       } else {
                last_undo->mergeable = FALSE;
                return FALSE;
        }
@@ -517,7 +513,7 @@ void undo_insert_text_cb(GtkEditable *editable, gchar *new_text,
                         gint new_text_length, gint *position, 
                         UndoMain *undostruct) 
 {
-       guchar *text_to_insert;
+       gchar *text_to_insert;
        size_t wlen;
 
        if (prefs_common.undolevels <= 0) return;
@@ -539,7 +535,7 @@ void undo_insert_text_cb(GtkEditable *editable, gchar *new_text,
 void undo_delete_text_cb(GtkEditable *editable, gint start_pos,
                         gint end_pos, UndoMain *undostruct) 
 {
-        guchar *text_to_delete;
+        gchar *text_to_delete;
 
        if (prefs_common.undolevels <= 0) return;
        if (start_pos == end_pos) return;
@@ -548,7 +544,7 @@ void undo_delete_text_cb(GtkEditable *editable, gint start_pos,
                                                start_pos, end_pos);
        undo_add(text_to_delete, start_pos, end_pos, UNDO_ACTION_DELETE,
                 undostruct);
-       g_free (text_to_delete);
+       g_free(text_to_delete);
 }
 
 void undo_paste_clipboard_cb (GtkEditable *editable, UndoMain *undostruct) 
index 7dfbe19..096fd7d 100644 (file)
@@ -19,8 +19,8 @@
 
 /* code ported from gedit */
 
-#ifndef UNDO_H__
-#define UNDO_H__
+#ifndef __UNDO_H__
+#define __UNDO_H__
 
 #include <glib.h>
 #include <gtk/gtkwidget.h>
 typedef enum 
 {
        UNDO_ACTION_INSERT,
-        UNDO_ACTION_DELETE,
+       UNDO_ACTION_DELETE,
        UNDO_ACTION_REPLACE_INSERT,
        UNDO_ACTION_REPLACE_DELETE,
 } UndoAction;
 
 typedef enum 
 {
-        UNDO_STATE_TRUE,
-        UNDO_STATE_FALSE,
-        UNDO_STATE_UNCHANGED,
-        UNDO_STATE_REFRESH,
+       UNDO_STATE_TRUE,
+       UNDO_STATE_FALSE,
+       UNDO_STATE_UNCHANGED,
+       UNDO_STATE_REFRESH,
 } UndoState;
 
 typedef struct _UndoMain UndoMain;
 
-typedef void (*UndoChangeState) (UndoMain *undostruct,
-       gint undo_state, gint redo_state, GtkWidget *changewidget);
+typedef void (*UndoChangeState)        (UndoMain       *undostruct,
+                                gint            undo_state,
+                                gint            redo_state,
+                                GtkWidget      *changewidget);
 
 struct _UndoMain 
 {
@@ -59,11 +61,13 @@ struct _UndoMain
        gint paste;
 };
 
-UndoMain *undo_init (GtkWidget *text);
-void undo_destroy (UndoMain *undostruct);
-void undo_set_undo_change_funct (UndoMain *undostruct, UndoChangeState func, GtkWidget *changewidget);
+UndoMain *undo_init            (GtkWidget      *text);
+void undo_destroy              (UndoMain       *undostruct);
+void undo_set_undo_change_funct        (UndoMain       *undostruct,
+                                UndoChangeState func,
+                                GtkWidget      *changewidget);
 
-void undo_undo (UndoMain *undostruct); 
-void undo_redo (UndoMain *undostruct); 
+void undo_undo                 (UndoMain       *undostruct); 
+void undo_redo                 (UndoMain       *undostruct); 
 
-#endif /* UNDO_H__ */
+#endif /* __UNDO_H__ */