diff options
author | Christopher James Lahey <clahey@ximian.com> | 2001-02-20 11:25:48 +0800 |
---|---|---|
committer | Chris Lahey <clahey@src.gnome.org> | 2001-02-20 11:25:48 +0800 |
commit | 58eeaa097722114c9e6bf06cda6351692f0925de (patch) | |
tree | e851751e67d2eca479b6ed9d67b2c2ffa375dd34 /widgets/table | |
parent | ac1b347939cfb28beb56451c3a19c2b752ef3a8f (diff) | |
download | gsoc2013-evolution-58eeaa097722114c9e6bf06cda6351692f0925de.tar.gz gsoc2013-evolution-58eeaa097722114c9e6bf06cda6351692f0925de.tar.zst gsoc2013-evolution-58eeaa097722114c9e6bf06cda6351692f0925de.zip |
Changed the version number to 0.5.99.1.
2001-02-19 Christopher James Lahey <clahey@ximian.com>
* configure.in: Changed the version number to 0.5.99.1.
* gal/Makefile.am (libgal_la_LIBADD): Change the directories for
e-table-text-model.lo, e-text-event-processor.lo, and
e-text-event-processor-emacs-like.lo. Reordered the e-text
directory to be after the e-table directory in build order.
* gal/e-text/Makefile.am: Removed
e-text-event-processor-emacs-like.c,
e-text-event-processor-emacs-like.h,
e-text-event-processor-types.h, e-text-event-processor.c, and
e-text-event-processor.h. Added e-table-text-model.c and
e-table-text-model.h.
* gal/e-text/e-table-text-model.c: Changed the signature of these
mehtods to match the changed signature in ETextModel.
* gal/e-text/e-text-event-processor-emacs-like.c,
gal/e-text/e-text-event-processor-emacs-like.h,
gal/e-text/e-text-event-processor-types.h,
gal/e-text/e-text-event-processor.c,
gal/e-text/e-text-event-processor.h: Moved these to gal/util/.
* gal/e-text/e-text.c, gal/e-text/e-text.h: Changed the includes
to match the moved files.
* gal/util/Makefile.am: Added e-text-event-processor-emacs-like.c,
e-text-event-processor-emacs-like.h,
e-text-event-processor-types.h, e-text-event-processor.c, and
e-text-event-processor.h.
* gal/util/e-text-event-processor-emacs-like.h,
gal/util/e-text-event-processor.h: Changed the includes to match
the moved files.
2001-02-19 Christopher James Lahey <clahey@ximian.com>
* Makefile.am: Removed e-table-text-model.c and
e-table-text-model.h.
* e-table-text-model.c, e-table-text-model.h: Moved these to
gal/e-text/.
* e-cell-text.c: Changed the include line for
e-text-event-processor.h and e-text-event-processor-emacs-like.h.
svn path=/trunk/; revision=8298
Diffstat (limited to 'widgets/table')
-rw-r--r-- | widgets/table/e-cell-text.c | 4 | ||||
-rw-r--r-- | widgets/table/e-table-text-model.c | 225 | ||||
-rw-r--r-- | widgets/table/e-table-text-model.h | 61 |
3 files changed, 2 insertions, 288 deletions
diff --git a/widgets/table/e-cell-text.c b/widgets/table/e-cell-text.c index 89f6f427bb..2db05f7320 100644 --- a/widgets/table/e-cell-text.c +++ b/widgets/table/e-cell-text.c @@ -40,9 +40,9 @@ #include "gal/widgets/e-font.h" #include "gal/widgets/e-unicode.h" #include "e-table-item.h" -#include "gal/e-text/e-text-event-processor.h" +#include "gal/util/e-text-event-processor.h" #include "gal/e-text/e-text.h" -#include "gal/e-text/e-text-event-processor-emacs-like.h" +#include "gal/util/e-text-event-processor-emacs-like.h" #include "e-table-tooltip.h" #include <gdk/gdkx.h> /* for BlackPixel */ diff --git a/widgets/table/e-table-text-model.c b/widgets/table/e-table-text-model.c deleted file mode 100644 index 1569ce4af7..0000000000 --- a/widgets/table/e-table-text-model.c +++ /dev/null @@ -1,225 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* ETableTextModel - Text item model for evolution. - * Copyright (C) 2000 Ximian, Inc. - * - * Author: Chris Lahey <clahey@umich.edu> - * - * A majority of code taken from: - * - * Text item type for GnomeCanvas widget - * - * GnomeCanvas is basically a port of the Tk toolkit's most excellent - * canvas widget. Tk is copyrighted by the Regents of the University - * of California, Sun Microsystems, and other parties. - * - * Copyright (C) 1998 The Free Software Foundation - * - * Author: Federico Mena <federico@nuclecu.unam.mx> */ - -#include <config.h> -#include <ctype.h> -#include "e-table-text-model.h" - -static void e_table_text_model_class_init (ETableTextModelClass *class); -static void e_table_text_model_init (ETableTextModel *model); -static void e_table_text_model_destroy (GtkObject *object); - -static gchar *e_table_text_model_get_text (ETextModel *model); -static void e_table_text_model_set_text (ETextModel *model, gchar *text); -static void e_table_text_model_insert (ETextModel *model, gint postion, gchar *text); -static void e_table_text_model_insert_length (ETextModel *model, gint postion, gchar *text, gint length); -static void e_table_text_model_delete (ETextModel *model, gint postion, gint length); - -static GtkObject *parent_class; - - - -/** - * e_table_text_model_get_type: - * @void: - * - * Registers the &ETableTextModel class if necessary, and returns the type ID - * associated to it. - * - * Return value: The type ID of the &ETableTextModel class. - **/ -GtkType -e_table_text_model_get_type (void) -{ - static GtkType model_type = 0; - - if (!model_type) { - GtkTypeInfo model_info = { - "ETableTextModel", - sizeof (ETableTextModel), - sizeof (ETableTextModelClass), - (GtkClassInitFunc) e_table_text_model_class_init, - (GtkObjectInitFunc) e_table_text_model_init, - NULL, /* reserved_1 */ - NULL, /* reserved_2 */ - (GtkClassInitFunc) NULL - }; - - model_type = gtk_type_unique (e_text_model_get_type (), &model_info); - } - - return model_type; -} - -/* Class initialization function for the text item */ -static void -e_table_text_model_class_init (ETableTextModelClass *klass) -{ - GtkObjectClass *object_class; - ETextModelClass *model_class; - - object_class = (GtkObjectClass *) klass; - model_class = (ETextModelClass *) klass; - - parent_class = gtk_type_class (e_text_model_get_type ()); - - model_class->get_text = e_table_text_model_get_text; - model_class->set_text = e_table_text_model_set_text; - model_class->insert = e_table_text_model_insert; - model_class->insert_length = e_table_text_model_insert_length; - model_class->delete = e_table_text_model_delete; - - object_class->destroy = e_table_text_model_destroy; -} - -/* Object initialization function for the text item */ -static void -e_table_text_model_init (ETableTextModel *model) -{ - model->model = NULL; - model->row = 0; - model->model_col = 0; - model->cell_changed_signal_id = 0; - model->row_changed_signal_id = 0; -} - -/* Destroy handler for the text item */ -static void -e_table_text_model_destroy (GtkObject *object) -{ - ETableTextModel *model; - - g_return_if_fail (object != NULL); - g_return_if_fail (E_IS_TABLE_TEXT_MODEL (object)); - - model = E_TABLE_TEXT_MODEL (object); - - if (model->model) - g_assert (GTK_IS_OBJECT (model->model)); - - if (model->cell_changed_signal_id) - gtk_signal_disconnect (GTK_OBJECT(model->model), - model->cell_changed_signal_id); - - if (model->row_changed_signal_id) - gtk_signal_disconnect (GTK_OBJECT(model->model), - model->row_changed_signal_id); - - if (model->model) - gtk_object_unref (GTK_OBJECT(model->model)); - - if (GTK_OBJECT_CLASS (parent_class)->destroy) - (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); -} -static gchar * -e_table_text_model_get_text (ETextModel *text_model) -{ - ETableTextModel *model = E_TABLE_TEXT_MODEL(text_model); - if (model->model) - return (gchar *)e_table_model_value_at (model->model, model->model_col, model->row); - else - return ""; -} - -static void -e_table_text_model_set_text (ETextModel *text_model, gchar *text) -{ - ETableTextModel *model = E_TABLE_TEXT_MODEL(text_model); - if (model->model) - e_table_model_set_value_at (model->model, model->model_col, model->row, (void *) text); -} - -static void -e_table_text_model_insert (ETextModel *text_model, gint position, gchar *text) -{ - ETableTextModel *model = E_TABLE_TEXT_MODEL(text_model); - if (model->model){ - gchar *temp = (gchar *)e_table_model_value_at (model->model, model->model_col, model->row); - temp = g_strdup_printf ("%.*s%s%s", position, temp, text, temp + position); - e_table_model_set_value_at (model->model, model->model_col, model->row, temp); - g_free (temp); - } -} - -static void -e_table_text_model_insert_length (ETextModel *text_model, gint position, gchar *text, gint length) -{ - ETableTextModel *model = E_TABLE_TEXT_MODEL(text_model); - if (model->model){ - gchar *temp = (gchar *)e_table_model_value_at (model->model, model->model_col, model->row); - temp = g_strdup_printf ("%.*s%.*s%s", position, temp, length, text, temp + position); - e_table_model_set_value_at (model->model, model->model_col, model->row, temp); - g_free (temp); - } -} - -static void -e_table_text_model_delete (ETextModel *text_model, gint position, gint length) -{ - ETableTextModel *model = E_TABLE_TEXT_MODEL(text_model); - if (model->model){ - gchar *temp = (gchar *)e_table_model_value_at (model->model, model->model_col, model->row); - temp = g_strdup_printf ("%.*s%s", position, temp, temp + position + length); - e_table_model_set_value_at (model->model, model->model_col, model->row, temp); - g_free (temp); - } -} - -static void -cell_changed (ETableModel *table_model, int model_col, int row, ETableTextModel *model) -{ - if (model->model_col == model_col && - model->row == row) - e_text_model_changed (E_TEXT_MODEL(model)); -} - -static void -row_changed (ETableModel *table_model, int row, ETableTextModel *model) -{ - if (model->row == row) - e_text_model_changed (E_TEXT_MODEL(model)); -} - -ETableTextModel * -e_table_text_model_new (ETableModel *table_model, int row, int model_col) -{ - ETableTextModel *model; - - g_return_val_if_fail(table_model != NULL, NULL); - g_return_val_if_fail(E_IS_TABLE_MODEL(table_model), NULL); - - model = gtk_type_new (e_table_text_model_get_type ()); - model->model = table_model; - if (model->model){ - gtk_object_ref (GTK_OBJECT(model->model)); - model->cell_changed_signal_id = - gtk_signal_connect (GTK_OBJECT(model->model), - "model_cell_changed", - GTK_SIGNAL_FUNC(cell_changed), - model); - model->row_changed_signal_id = - gtk_signal_connect (GTK_OBJECT(model->model), - "model_row_changed", - GTK_SIGNAL_FUNC(row_changed), - model); - } - model->row = row; - model->model_col = model_col; - return model; -} - diff --git a/widgets/table/e-table-text-model.h b/widgets/table/e-table-text-model.h deleted file mode 100644 index 5cf0b8a231..0000000000 --- a/widgets/table/e-table-text-model.h +++ /dev/null @@ -1,61 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* ETableTextModel - Text item for evolution. - * Copyright (C) 2000 Ximian, Inc. - * - * Author: Chris Lahey <clahey@umich.edu> - * - * A majority of code taken from: - * - * Text item type for GnomeCanvas widget - * - * GnomeCanvas is basically a port of the Tk toolkit's most excellent - * canvas widget. Tk is copyrighted by the Regents of the University - * of California, Sun Microsystems, and other parties. - * - * Copyright (C) 1998 The Free Software Foundation - * - * Author: Federico Mena <federico@nuclecu.unam.mx> */ - -#ifndef E_TABLE_TEXT_MODEL_H -#define E_TABLE_TEXT_MODEL_H - -#include <gnome.h> -#include <gal/e-text/e-text-model.h> -#include <gal/e-table/e-table-model.h> - - -BEGIN_GNOME_DECLS - -#define E_TYPE_TABLE_TEXT_MODEL (e_table_text_model_get_type ()) -#define E_TABLE_TEXT_MODEL(obj) (GTK_CHECK_CAST ((obj), E_TYPE_TABLE_TEXT_MODEL, ETableTextModel)) -#define E_TABLE_TEXT_MODEL_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_TYPE_TABLE_TEXT_MODEL, ETableTextModelClass)) -#define E_IS_TABLE_TEXT_MODEL(obj) (GTK_CHECK_TYPE ((obj), E_TYPE_TABLE_TEXT_MODEL)) -#define E_IS_TABLE_TEXT_MODEL_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), E_TYPE_TABLE_TEXT_MODEL)) - -typedef struct _ETableTextModel ETableTextModel; -typedef struct _ETableTextModelClass ETableTextModelClass; - -struct _ETableTextModel { - ETextModel parent; - - ETableModel *model; - int row; - int model_col; - - int cell_changed_signal_id; - int row_changed_signal_id; -}; - -struct _ETableTextModelClass { - ETextModelClass parent_class; - -}; - - -/* Standard Gtk function */ -GtkType e_table_text_model_get_type (void); -ETableTextModel *e_table_text_model_new (ETableModel *table_model, int row, int model_col); - -END_GNOME_DECLS - -#endif |