antiright-devel
[Top][All Lists]
Advanced

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

[Antiright-devel] antiright configure ACE-desktop/guidl/Horizonta...


From: Jeffrey Bedard
Subject: [Antiright-devel] antiright configure ACE-desktop/guidl/Horizonta...
Date: Mon, 10 Dec 2007 15:13:25 +0000

CVSROOT:        /sources/antiright
Module name:    antiright
Changes by:     Jeffrey Bedard <jefbed> 07/12/10 15:13:25

Modified files:
        .              : configure 
        ACE-desktop/guidl: Horizontal_Deskbar.gdl 
        gtkshell       : Makefile add_options.c app_mode.c button.c 
                         gtkshell.c gtkshell.h module_includes.h 
                         option_options.c quickstart.c text.c text.h 
                         undo.c undo.h view.h 
        libantiright   : system.c 

Log message:
        Remove duplicate text editor code.
        Use GtkToolItem base class for toolbar items.
        Clean up undo code.
        Build without libpthread.  

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/antiright/configure?cvsroot=antiright&r1=1.110&r2=1.111
http://cvs.savannah.gnu.org/viewcvs/antiright/ACE-desktop/guidl/Horizontal_Deskbar.gdl?cvsroot=antiright&r1=1.44&r2=1.45
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/Makefile?cvsroot=antiright&r1=1.47&r2=1.48
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/add_options.c?cvsroot=antiright&r1=1.52&r2=1.53
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/app_mode.c?cvsroot=antiright&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/button.c?cvsroot=antiright&r1=1.55&r2=1.56
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/gtkshell.c?cvsroot=antiright&r1=1.47&r2=1.48
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/gtkshell.h?cvsroot=antiright&r1=1.57&r2=1.58
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/module_includes.h?cvsroot=antiright&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/option_options.c?cvsroot=antiright&r1=1.37&r2=1.38
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/quickstart.c?cvsroot=antiright&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/text.c?cvsroot=antiright&r1=1.43&r2=1.44
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/text.h?cvsroot=antiright&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/undo.c?cvsroot=antiright&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/undo.h?cvsroot=antiright&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/view.h?cvsroot=antiright&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/antiright/libantiright/system.c?cvsroot=antiright&r1=1.9&r2=1.10

Patches:
Index: configure
===================================================================
RCS file: /sources/antiright/antiright/configure,v
retrieving revision 1.110
retrieving revision 1.111
diff -u -b -r1.110 -r1.111
--- configure   4 Dec 2007 23:45:30 -0000       1.110
+++ configure   10 Dec 2007 15:13:24 -0000      1.111
@@ -29,7 +29,7 @@
 USE_DISTCC=NO
 USE_CCACHE=NO
 USE_BOEHMGC=NO
-USE_THREADS=YES
+USE_THREADS=NO
 # Must be enabled.  
 USE_GTK=YES
 
@@ -53,6 +53,8 @@
                USE_BOEHMGC=YES
        elif [ "$ARG" = "--disable-threads" ]; then
                USE_THREADS=NO
+       elif [ "$ARG" = "--enable-quickstart-toolbar" ]; then
+               DEFS="$DEFS -DGSH_USE_QUICKSTART"
        else
                echo WARNING:  Unknown configure option passed: "$ARG"
        fi

Index: ACE-desktop/guidl/Horizontal_Deskbar.gdl
===================================================================
RCS file: 
/sources/antiright/antiright/ACE-desktop/guidl/Horizontal_Deskbar.gdl,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -b -r1.44 -r1.45
--- ACE-desktop/guidl/Horizontal_Deskbar.gdl    6 Dec 2007 14:40:49 -0000       
1.44
+++ ACE-desktop/guidl/Horizontal_Deskbar.gdl    10 Dec 2007 15:13:24 -0000      
1.45
@@ -62,7 +62,7 @@
                ::gnumeric & # Gnumeric_Spreadsheet,gnu_16.png::\n
                ::abiword & # AbiWord,word-processor_16.png::\n
                ::<--::\n
-       ::-->,gtk-directory::System::\n
+       ::-->,system_16.png::System::\n
                ::ACE File_Manager,gtk-directory::\n
                ::ACE System_Monitor,monitoring_16.png::\n
                ::ACE -A GUIDL File_System_Panel,gtk-harddisk::\n

Index: gtkshell/Makefile
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/Makefile,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -b -r1.47 -r1.48
--- gtkshell/Makefile   12 Nov 2007 01:21:33 -0000      1.47
+++ gtkshell/Makefile   10 Dec 2007 15:13:24 -0000      1.48
@@ -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 undo.o 
+       GSHWidget.o quickstart.o undo.o color.o
 
 program=main.o 
 

Index: gtkshell/add_options.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/add_options.c,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -b -r1.52 -r1.53
--- gtkshell/add_options.c      7 Dec 2007 20:00:25 -0000       1.52
+++ gtkshell/add_options.c      10 Dec 2007 15:13:24 -0000      1.53
@@ -200,6 +200,7 @@
                break;
 
        case 'Q':
+#ifdef GSH_USE_QUICKSTART
        { /* FIXME: make it useful.  */
                GSHQuickStart * quickstart;
                quickstart=ARNEW(gsh, GSHQuickStart);
@@ -208,6 +209,9 @@
                GSH_COUNT(argc, counter);
                $(gsh, manage, quickstart->__column);
        }
+#else /* ! GSH_USE_QUICKSTART */
+               ARWARN("The quickstart feature is disabled.  ");
+#endif /* GSH_USE_QUICKSTART */
                break;
 
        case 'r': /* Force creation of a new row.  */
@@ -246,7 +250,7 @@
                add_new_window(gsh);
                break;
        case 'X':
-               gsh_add_embedded(gsh, (gchar *)argv[++(*counter)]);
+               gsh_add_embedded(gsh, (char *)argv[++(*counter)]);
                break;
        default:
                ARWARN("invalid add option");

Index: gtkshell/app_mode.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/app_mode.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- gtkshell/app_mode.c 11 Jun 2007 21:32:37 -0000      1.3
+++ gtkshell/app_mode.c 10 Dec 2007 15:13:24 -0000      1.4
@@ -36,8 +36,13 @@
 static void
 setup_app_mode_toolbar(GSH * gsh)
 {
-       GSH_SHOW_CREATE(GWA.toolbar, toolbar);
-       GSHCA_TIGHT(GWA.row, GWA.toolbar);
+       GtkWidget * toolbar;
+
+       
+       GSH_SHOW_CREATE(toolbar=GWA.toolbar, toolbar);
+       gtk_toolbar_set_tooltips(GTK_TOOLBAR(toolbar), TRUE);
+       gtk_toolbar_set_style(GTK_TOOLBAR(toolbar), GTK_TOOLBAR_ICONS);
+       GSHCA_TIGHT(GWA.row, toolbar);
 }
 
 static void

Index: gtkshell/button.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/button.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -b -r1.55 -r1.56
--- gtkshell/button.c   15 Nov 2007 03:17:38 -0000      1.55
+++ gtkshell/button.c   10 Dec 2007 15:13:24 -0000      1.56
@@ -23,6 +23,7 @@
 #include "gtkshell.h"
 #include <sys/stat.h>
 
+
 gboolean
 gsh_check_command_exists(GSH * gsh, const gchar * command)
 {
@@ -119,11 +120,16 @@
        guint mapping_count;
 
        for(mapping_count=0; mapping_count < mapping_size; mapping_count++)
+       {
                if(!strcmp(mapping[mapping_count].label, 
                        g_strstrip((gchar*)label)))
+               {
                        gtk_widget_show(image=gtk_image_new_from_stock(
                                mapping[mapping_count].icon, 
                                GTK_ICON_SIZE_SMALL_TOOLBAR));
+                       gtk_widget_set_tooltip_text(image, label);
+               }
+       }
 
        return image ? image : gtk_image_new_from_stock(
                GTK_STOCK_EXECUTE, GTK_ICON_SIZE_SMALL_TOOLBAR);
@@ -160,15 +166,19 @@
 static void
 setup_toolbutton_from_command_button(GSH * gsh, const gchar * command)
 {
+       GtkWidget * toolitem;
        GtkWidget * toolbutton;
 
        /* FIXME:  change to use the gtk tool_button widget.  */
+       toolitem=GTK_WIDGET(gtk_tool_item_new());
        toolbutton=gtk_button_new_with_label(command);
+       GSHCA(toolitem, toolbutton);
        common_button_setup(gsh, toolbutton, command);
-       GSHCA(gsh->widgets.app.toolbar, toolbutton);
+       GSHCA(gsh->widgets.app.toolbar, toolitem);
        setup_label_for_toolbutton(toolbutton, command);
        gtk_button_set_relief(GTK_BUTTON(toolbutton), GTK_RELIEF_NONE);
        gtk_widget_show(toolbutton);
+       gtk_widget_show(toolitem);
 }
 
 static void

Index: gtkshell/gtkshell.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/gtkshell.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -b -r1.47 -r1.48
--- gtkshell/gtkshell.c 7 Dec 2007 20:00:25 -0000       1.47
+++ gtkshell/gtkshell.c 10 Dec 2007 15:13:24 -0000      1.48
@@ -144,16 +144,4 @@
        return gsh;
 }
 
-void
-gsh_widget_set_color(GtkWidget * widget, 
-       const gchar * color_string, gboolean fg_color)
-{
-       GdkColor color;
-
-       gdk_color_parse(color_string, &color);
-       if(fg_color)
-               gtk_widget_modify_fg(widget, GTK_STATE_NORMAL, &color);
-       else
-               gtk_widget_modify_bg(widget, GTK_STATE_NORMAL, &color);
-}
 

Index: gtkshell/gtkshell.h
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/gtkshell.h,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -b -r1.57 -r1.58
--- gtkshell/gtkshell.h 25 Oct 2007 01:02:42 -0000      1.57
+++ gtkshell/gtkshell.h 10 Dec 2007 15:13:24 -0000      1.58
@@ -55,8 +55,5 @@
 struct GSH *
 gsh_new_GSH();
 
-void
-gsh_widget_set_color(GtkWidget * widget, 
-       const gchar * color_string, gboolean fg_color);
+#endif /* ! GSH_GTKSHELL_H */
 
-#endif

Index: gtkshell/module_includes.h
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/module_includes.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- gtkshell/module_includes.h  31 Oct 2007 13:57:38 -0000      1.12
+++ gtkshell/module_includes.h  10 Dec 2007 15:13:24 -0000      1.13
@@ -63,5 +63,6 @@
 #include "swallow.h"
 #include "GSHWidget.h"
 #include "quickstart.h"
+#include "color.h"
 
 #endif /* not GSH_MODULE_INCLUDES_H */

Index: gtkshell/option_options.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/option_options.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -b -r1.37 -r1.38
--- gtkshell/option_options.c   7 Dec 2007 20:00:25 -0000       1.37
+++ gtkshell/option_options.c   10 Dec 2007 15:13:24 -0000      1.38
@@ -99,9 +99,9 @@
        case 'c':
                /* Set text widget background and foreground colors.  */
                GSH_COUNT(argc, counter);
-               gsh->editor.bgcolor=argv[*counter];
+               gsh->editor.bgcolor=(gchar *)argv[*counter];
                GSH_COUNT(argc, counter);
-               gsh->editor.fgcolor=argv[*counter];
+               gsh->editor.fgcolor=(gchar *)argv[*counter];
                break;
        case 'D':
                /* Do not insert the dummy "guidl" string before the

Index: gtkshell/quickstart.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/quickstart.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- gtkshell/quickstart.c       25 Oct 2007 01:07:43 -0000      1.1
+++ gtkshell/quickstart.c       10 Dec 2007 15:13:24 -0000      1.2
@@ -1,6 +1,8 @@
 
 #include "gtkshell.h"
 
+#ifdef GSH_USE_QUICKSTART
+
 static void
 add_launcher(GSHQuickStart * this,
        GSH * gsh, const gchar * command, const gchar * icon_name)
@@ -48,3 +50,4 @@
        return quickstart;
 }
 
+#endif /* GSH_USE_QUICKSTART */

Index: gtkshell/text.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/text.c,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -b -r1.43 -r1.44
--- gtkshell/text.c     7 Dec 2007 20:00:25 -0000       1.43
+++ gtkshell/text.c     10 Dec 2007 15:13:24 -0000      1.44
@@ -140,16 +140,6 @@
                gsh->geometry=g_strdup("775x700");\
 }
 
-#ifdef DEBUG
-#define VALIDATE_TEXT_EDITOR_PARAMETERS(gsh, filename)\
-{\
-       ARPASSERT(gsh);\
-       ARPASSERT(filename);\
-}
-#else /* not DEBUG */
-#define VALIDATE_TEXT_EDITOR_PARAMETERS(gsh, filename) /* undefined */
-#endif /* DEBUG */
-
 GtkTextBuffer *
 gsh_text_area_set_text(GtkWidget * widget, const gchar * text)
 {
@@ -171,39 +161,51 @@
 
        /* The undo and redo names are swapped within undo.c somehow,
           so a hack is to simply rename the buttons.  */
-       gtk_widget_show(redo_button=gtk_button_new_from_stock("gtk-redo"));
-       gtk_widget_show(undo_button=gtk_button_new_from_stock("gtk-undo"));
        if(gsh->widgets.app.toolbar)
+       {
+               GtkWidget * separator;
+
+               redo_button=GTK_WIDGET(
+                       gtk_tool_button_new_from_stock("gtk-redo"));
+               undo_button=GTK_WIDGET(
+                       gtk_tool_button_new_from_stock("gtk-undo"));
                destination=gsh->widgets.app.toolbar;
+               gtk_widget_show(
+                       separator=GTK_WIDGET(gtk_separator_tool_item_new()));
+               GSHCA(destination, separator);
+       }
        else
        {
+               redo_button=gtk_button_new_from_stock("gtk-redo");
+               undo_button=gtk_button_new_from_stock("gtk-undo");
                /* Set up a horizontal container 
                   for undo and redo buttons.  */
                GSH_SET(GSH_NO_EXPAND);
                GSH_SHOW_CREATE(destination, hbox, TRUE, 0);
                $(gsh, manage, destination);
        }
+       gtk_widget_show(undo_button);
+       gtk_widget_show(redo_button);
        GSHCA(destination, undo_button);
        GSHCA(destination, redo_button);
-       undo_init(text_widget, undo_button, redo_button);
+       gsh_undo_init(text_widget, undo_button, redo_button);
        g_signal_connect_swapped(G_OBJECT(undo_button), "clicked", 
-               (GCallback)undo_undo,
+               (GCallback)gsh_undo_undo,
                gtk_text_view_get_buffer(GTK_TEXT_VIEW(text_widget)));
        g_signal_connect_swapped(G_OBJECT(redo_button), "clicked", 
-               (GCallback)undo_redo,
+               (GCallback)gsh_undo_redo,
                gtk_text_view_get_buffer(GTK_TEXT_VIEW(text_widget)));
 }
 
-/* This is currently just a text file viewer.  */
+static void
+open_gsh_file_in_editor(GSH * gsh);
+
 void
 gsh_text_editor(struct GSH * gsh, const gchar *filename)
 {
-       gchar * text;
-
-       VALIDATE_TEXT_EDITOR_PARAMETERS(gsh, filename);
-       text=antiright_read_named_file(filename);
-       (void)gsh_text_area_set_text(gsh_text_area(gsh), text);
-       g_free(text);
+       gsh_text_area(gsh);
+       gsh->editor.filename=(gchar *)filename;
+       open_gsh_file_in_editor(gsh);
        CHECK_GEOMETRY(gsh);
 }
 
@@ -254,16 +256,18 @@
 {
        gchar * tmp_filename;
 
+       tmp_filename=g_strdup(gsh->editor.filename);
        /* Make sure that FILENAME is freed if previously used.  */
        if(gsh->editor.filename)
                g_free(gsh->editor.filename);
        /* Get the filename.  */
-       tmp_filename=gsh->editor.filename;
        gsh->editor.filename=PROMPT_FILENAME();
        /* Restore filename if empty, in case of open file, so that
           file will not have to be reopened/reselected on save.  */
        if(!FILENAME_NOT_EMPTY)
                gsh->editor.filename=tmp_filename;
+       else
+               g_free(tmp_filename);
 }
 
 void
@@ -279,11 +283,14 @@
 static void
 open_gsh_file_in_editor(GSH * gsh)
 {
+       if(gsh->editor.filename)
+       {
        gchar * text;
 
        text=antiright_read_named_file(gsh->editor.filename);
        gsh_text_area_set_text(gsh->editor.widget, text);
        g_free(text);
+       }
 }
 
 static void

Index: gtkshell/text.h
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/text.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- gtkshell/text.h     31 Oct 2007 13:57:38 -0000      1.13
+++ gtkshell/text.h     10 Dec 2007 15:13:24 -0000      1.14
@@ -1,6 +1,6 @@
 /*
   AntiRight
-  (c) 2002-2006 Jeffrey Bedard
+  (c) 2002-2007 Jeffrey Bedard
   address@hidden
 
   This file is part of AntiRight.

Index: gtkshell/undo.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/undo.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- gtkshell/undo.c     12 Nov 2007 01:21:34 -0000      1.1
+++ gtkshell/undo.c     10 Dec 2007 15:13:24 -0000      1.2
@@ -1,7 +1,9 @@
 /*
  *  Leafpad - GTK+ based simple text editor
  *  Copyright (C) 2004-2005 Tarot Osuji
- *  
+
+       AntiRight - Copyright (C) 2007, Jeffrey Bedard
+
  *  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
@@ -19,7 +21,6 @@
 
 #include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
-#include "view.h"
 #include "undo.h"
 
 #define DV(x)
@@ -74,9 +75,11 @@
 static guint prev_keyval;
 static gboolean seq_reserve = FALSE;
 
-static void undo_flush_temporal_buffer(GtkTextBuffer *buffer);
+static void 
+undo_flush_temporal_buffer(GtkTextBuffer *buffer);
 
-static GList *undo_clear_info_list(GList *info_list)
+static GList 
+*undo_clear_info_list(GList *info_list)
 {
        while (g_list_length(info_list)) {
                g_free(((UndoInfo *)info_list->data)->str);
@@ -86,14 +89,15 @@
        return info_list;
 }
 
-static void undo_append_undo_info(GtkTextBuffer *buffer, gchar command, gint 
start, gint end, gchar *str)
+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;
        
@@ -103,7 +107,18 @@
 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)
+static 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)); 
+}
+
+
+static void 
+undo_create_undo_info(GtkTextBuffer *buffer, gchar command, 
+       gint start, gint end)
 {
        GtkTextIter start_iter, end_iter;
        gboolean seq_flag = FALSE;
@@ -159,34 +174,39 @@
                        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_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)) {
+       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));
+       } 
+       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)
+static void 
+cb_insert_text(GtkTextBuffer *buffer, GtkTextIter *iter, 
+       gchar *str, gint len)
 {
        gint start, end;
        
@@ -197,7 +217,9 @@
        undo_create_undo_info(buffer, INS, start, end);
 }
 
-static void cb_delete_range(GtkTextBuffer *buffer, GtkTextIter *start_iter, 
GtkTextIter *end_iter)
+static void 
+cb_delete_range(GtkTextBuffer *buffer, 
+       GtkTextIter *start_iter, GtkTextIter *end_iter)
 {
        gint start, end;
        gchar command;
@@ -213,40 +235,27 @@
        undo_create_undo_info(buffer, command, start, end);
 }
 
-void undo_reset_modified_step(GtkTextBuffer *buffer)
+static 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));
+DV(g_print("undo_reset_modified_step: Reseted modified_step by %d\n", 
+       modified_step));
 }
 
-static void undo_check_modified_step(GtkTextBuffer *buffer)
+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)
+
+static void 
+cb_begin_user_action(GtkTextBuffer *buffer)
 {
        g_signal_handlers_unblock_by_func(G_OBJECT(buffer), 
                G_CALLBACK(cb_insert_text), NULL);
@@ -256,7 +265,8 @@
 DV(g_print(": keyval = 0x%X\n", get_current_keyval()));
 }
 
-static void cb_end_user_action(GtkTextBuffer *buffer)
+static void 
+cb_end_user_action(GtkTextBuffer *buffer)
 {
        g_signal_handlers_block_by_func(G_OBJECT(buffer), 
                G_CALLBACK(cb_insert_text), NULL);
@@ -265,7 +275,8 @@
 DV(g_print("end-user-action(block_func)\n"));
 }
 
-void undo_clear_all(GtkTextBuffer *buffer)
+void 
+undo_clear_all(GtkTextBuffer *buffer)
 {
        undo_list = undo_clear_info_list(undo_list);
        redo_list = undo_clear_info_list(redo_list);
@@ -278,7 +289,10 @@
        prev_keyval = 0;
 }
 
-void undo_init(GtkWidget *view, GtkWidget *undo_button, GtkWidget *redo_button)
+void 
+gsh_undo_init(GtkWidget *view, 
+       GtkWidget *undo_button, 
+       GtkWidget *redo_button)
 {
        GtkTextBuffer *buffer = GTK_TEXT_VIEW(view)->buffer;
         
@@ -302,19 +316,16 @@
        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)
+#if 0 /* Unused */
+static void 
+undo_set_sequency_reserve(void)
 {
        seq_reserve = TRUE;
 }
+#endif /* 0 */
 
-static void undo_flush_temporal_buffer(GtkTextBuffer *buffer)
+static void 
+undo_flush_temporal_buffer(GtkTextBuffer *buffer)
 {
        if (undo_gstr->len) {
                undo_append_undo_info(buffer, ui_tmp->command,
@@ -323,29 +334,35 @@
        }
 }
 
-gboolean undo_undo_real(GtkTextBuffer *buffer)
+static 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);
+       if (g_list_length(undo_list)) 
+       {
                ui = g_list_last(undo_list)->data;
-               gtk_text_buffer_get_iter_at_offset(buffer, &start_iter, 
ui->start);
-               switch (ui->command) {
+               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);
+                       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);
+                       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));
+               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;
@@ -353,7 +370,8 @@
                        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_get_iter_at_offset(buffer, 
+                               &start_iter, ui->start);
                gtk_text_buffer_place_cursor(buffer, &start_iter);
                scroll_to_cursor(buffer, 0.05);
        }
@@ -367,23 +385,27 @@
        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);
+               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);
+                       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);
+                       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));
+               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) {
+               if (ri->seq) 
+               {
                        undo_set_sequency(TRUE);
                        return TRUE;
                }
@@ -397,12 +419,14 @@
        return FALSE;
 }
 
-void undo_undo(GtkTextBuffer *buffer)
+void 
+gsh_undo_undo(GtkTextBuffer *buffer)
 {
        while (undo_undo_real(buffer)) {};
 }
 
-void undo_redo(GtkTextBuffer *buffer)
+void 
+gsh_undo_redo(GtkTextBuffer *buffer)
 {
        while (undo_redo_real(buffer)) {};
 }

Index: gtkshell/undo.h
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/undo.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- gtkshell/undo.h     12 Nov 2007 01:21:34 -0000      1.1
+++ gtkshell/undo.h     10 Dec 2007 15:13:24 -0000      1.2
@@ -20,12 +20,24 @@
 #ifndef _UNDO_H
 #define _UNDO_H
 
+void 
+gsh_undo_init(GtkWidget *view, 
+       GtkWidget *undo_button, 
+       GtkWidget *redo_button);
+
+void 
+gsh_undo_undo(GtkTextBuffer *buffer);
+
+void 
+gsh_undo_redo(GtkTextBuffer *buffer);
+
+/* These are not currently used by gtkshell.  */
+#if 0
 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 /* 0 */
 
 #endif /* _UNDO_H */
+

Index: gtkshell/view.h
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/view.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- gtkshell/view.h     12 Nov 2007 01:21:34 -0000      1.1
+++ gtkshell/view.h     10 Dec 2007 15:13:25 -0000      1.2
@@ -20,14 +20,4 @@
 #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 */

Index: libantiright/system.c
===================================================================
RCS file: /sources/antiright/antiright/libantiright/system.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- libantiright/system.c       7 Dec 2007 20:00:25 -0000       1.9
+++ libantiright/system.c       10 Dec 2007 15:13:25 -0000      1.10
@@ -101,3 +101,4 @@
        va_end(list);
        return (return_value);
 }
+




reply via email to

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