aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@helixcode.com>2000-03-21 10:53:55 +0800
committerChris Lahey <clahey@src.gnome.org>2000-03-21 10:53:55 +0800
commitf60b9107e9d0a10bc54307c279f789c26a794736 (patch)
treef4912fca26063ba92abbddf3240f7a38d4ed8651
parent5fe5e0f7431c00d4438eaed35825cb6a33dbe05f (diff)
downloadgsoc2013-evolution-f60b9107e9d0a10bc54307c279f789c26a794736.tar.gz
gsoc2013-evolution-f60b9107e9d0a10bc54307c279f789c26a794736.tar.zst
gsoc2013-evolution-f60b9107e9d0a10bc54307c279f789c26a794736.zip
Added the ability to access the text event processor.
2000-03-20 Christopher James Lahey <clahey@helixcode.com> * widgets/e-text/e-text.c, widgets/e-text/e-text.h: Added the ability to access the text event processor. 2000-03-13 Christopher James Lahey <clahey@helixcode.com> * addressbook/demo/addressbook-widget.c: Made the addressbook component look in the users home directory for the addressbook.xml file. svn path=/trunk/; revision=2125
-rw-r--r--ChangeLog11
-rw-r--r--addressbook/demo/addressbook-widget.c16
-rw-r--r--widgets/e-text/e-text.c52
-rw-r--r--widgets/e-text/e-text.h1
-rw-r--r--widgets/text/e-text.c52
-rw-r--r--widgets/text/e-text.h1
6 files changed, 97 insertions, 36 deletions
diff --git a/ChangeLog b/ChangeLog
index 38ed40b9fa..8878e4ff9b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2000-03-20 Christopher James Lahey <clahey@helixcode.com>
+
+ * widgets/e-text/e-text.c, widgets/e-text/e-text.h: Added the
+ ability to access the text event processor.
+
+2000-03-13 Christopher James Lahey <clahey@helixcode.com>
+
+ * addressbook/demo/addressbook-widget.c: Made the addressbook
+ component look in the users home directory for the addressbook.xml
+ file.
+
2000-03-20 Matt Loper <matt@helixcode.com>
* tests/ui-tests/.cvsignore: added filter.
diff --git a/addressbook/demo/addressbook-widget.c b/addressbook/demo/addressbook-widget.c
index 4efca22e3f..1252f9993c 100644
--- a/addressbook/demo/addressbook-widget.c
+++ b/addressbook/demo/addressbook-widget.c
@@ -79,25 +79,33 @@ static ETestModel *
get_model(char *filename)
{
ETestModel *model;
+ gboolean free_filename = FALSE;
- if ( filename == NULL )
- filename = "addressbook.xml";
+ if ( filename == NULL ) {
+ filename = gnome_util_prepend_user_home("addressbook.xml");
+ free_filename = TRUE;
+ }
if ( models == NULL ) {
models = g_hash_table_new(g_str_hash, g_str_equal);
}
model = g_hash_table_lookup(models, filename);
- if ( model )
+ if ( model ) {
+ if (free_filename)
+ g_free(filename);
return model;
+ }
- filename = g_strdup(filename);
+ if ( !free_filename )
+ filename = g_strdup(filename);
model = E_TEST_MODEL(e_test_model_new(filename));
g_hash_table_insert(models,
filename, model);
gtk_signal_connect(GTK_OBJECT(model), "destroy",
GTK_SIGNAL_FUNC(remove_model), filename);
+
return model;
}
diff --git a/widgets/e-text/e-text.c b/widgets/e-text/e-text.c
index 85950f149a..da4e2ba64b 100644
--- a/widgets/e-text/e-text.c
+++ b/widgets/e-text/e-text.c
@@ -30,7 +30,6 @@
#include "e-text-event-processor-emacs-like.h"
enum {
- E_TEXT_RESIZE,
E_TEXT_CHANGE,
E_TEXT_LAST_SIGNAL
};
@@ -53,6 +52,7 @@ struct line {
enum {
ARG_0,
ARG_MODEL,
+ ARG_EVENT_PROCESSOR,
ARG_TEXT,
ARG_X,
ARG_Y,
@@ -120,6 +120,8 @@ static void e_text_supply_selection (EText *text, guint time, GdkAtom selection,
static void e_text_text_model_changed(ETextModel *model, EText *text);
+static void _get_tep(EText *text);
+
static GtkWidget *e_text_get_invisible(EText *text);
static void _selection_clear_event (GtkInvisible *invisible,
GdkEventSelection *event,
@@ -188,15 +190,6 @@ e_text_class_init (ETextClass *klass)
parent_class = gtk_type_class (gnome_canvas_item_get_type ());
- e_text_signals[E_TEXT_RESIZE] =
- gtk_signal_new ("resize",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (ETextClass, resize),
- gtk_marshal_NONE__NONE,
- GTK_TYPE_NONE, 0);
-
-
e_text_signals[E_TEXT_CHANGE] =
gtk_signal_new ("change",
GTK_RUN_LAST,
@@ -210,6 +203,8 @@ e_text_class_init (ETextClass *klass)
gtk_object_add_arg_type ("EText::model",
GTK_TYPE_OBJECT, GTK_ARG_READWRITE, ARG_MODEL);
+ gtk_object_add_arg_type ("EText::event_processor",
+ GTK_TYPE_OBJECT, GTK_ARG_READWRITE, ARG_EVENT_PROCESSOR);
gtk_object_add_arg_type ("EText::text",
GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_TEXT);
gtk_object_add_arg_type ("EText::x",
@@ -270,7 +265,6 @@ e_text_class_init (ETextClass *klass)
- klass->resize = NULL;
klass->change = NULL;
object_class->destroy = e_text_destroy;
@@ -334,6 +328,7 @@ e_text_init (EText *text)
text->button_down = FALSE;
text->tep = NULL;
+ text->tep_command_id = 0;
text->has_selection = FALSE;
@@ -371,6 +366,10 @@ e_text_destroy (GtkObject *object)
if (text->model)
gtk_object_unref(GTK_OBJECT(text->model));
+ if (text->tep_command_id)
+ gtk_signal_disconnect(GTK_OBJECT(text->tep),
+ text->tep_command_id);
+
if (text->tep)
gtk_object_unref (GTK_OBJECT(text->tep));
@@ -428,7 +427,7 @@ get_bounds_item_relative (EText *text, double *px1, double *py1, double *px2, do
text->height = 0;
if (old_height != text->height)
- gtk_signal_emit_by_name (GTK_OBJECT (text), "resize");
+ e_canvas_item_request_parent_reflow(item);
/* Anchor text */
@@ -918,6 +917,21 @@ e_text_set_arg (GtkObject *object, GtkArg *arg, guint arg_id)
needs_reflow = 1;
break;
+ case ARG_EVENT_PROCESSOR:
+ if ( text->tep && text->tep_command_id )
+ gtk_signal_disconnect(GTK_OBJECT(text->tep),
+ text->tep_command_id);
+ if ( text->tep )
+ gtk_object_unref(GTK_OBJECT(text->tep));
+ text->tep = E_TEXT_EVENT_PROCESSOR(GTK_VALUE_OBJECT (*arg));
+ gtk_object_ref(GTK_OBJECT(text->tep));
+ text->tep_command_id =
+ gtk_signal_connect(GTK_OBJECT(text->tep),
+ "command",
+ GTK_SIGNAL_FUNC(e_text_command),
+ text);
+ break;
+
case ARG_TEXT:
e_text_model_set_text(text->model, GTK_VALUE_STRING (*arg));
break;
@@ -1180,6 +1194,11 @@ e_text_get_arg (GtkObject *object, GtkArg *arg, guint arg_id)
GTK_VALUE_OBJECT (*arg) = GTK_OBJECT(text->model);
break;
+ case ARG_EVENT_PROCESSOR:
+ _get_tep(text);
+ GTK_VALUE_OBJECT (*arg) = GTK_OBJECT(text->tep);
+ break;
+
case ARG_TEXT:
GTK_VALUE_STRING (*arg) = g_strdup (text->text);
break;
@@ -1529,10 +1548,11 @@ _get_tep(EText *text)
text->tep = e_text_event_processor_emacs_like_new();
gtk_object_ref (GTK_OBJECT (text->tep));
gtk_object_sink (GTK_OBJECT (text->tep));
- gtk_signal_connect(GTK_OBJECT(text->tep),
- "command",
- GTK_SIGNAL_FUNC(e_text_command),
- (gpointer) text);
+ text->tep_command_id =
+ gtk_signal_connect(GTK_OBJECT(text->tep),
+ "command",
+ GTK_SIGNAL_FUNC(e_text_command),
+ (gpointer) text);
}
}
diff --git a/widgets/e-text/e-text.h b/widgets/e-text/e-text.h
index a4bc06d820..e7dbd8761c 100644
--- a/widgets/e-text/e-text.h
+++ b/widgets/e-text/e-text.h
@@ -164,6 +164,7 @@ struct _EText {
gboolean button_down; /* Is mouse button 1 down */
ETextEventProcessor *tep; /* Text Event Processor */
+ gint tep_command_id;
GtkWidget *invisible; /* For selection handling */
gboolean has_selection; /* TRUE if we have the selection */
diff --git a/widgets/text/e-text.c b/widgets/text/e-text.c
index 85950f149a..da4e2ba64b 100644
--- a/widgets/text/e-text.c
+++ b/widgets/text/e-text.c
@@ -30,7 +30,6 @@
#include "e-text-event-processor-emacs-like.h"
enum {
- E_TEXT_RESIZE,
E_TEXT_CHANGE,
E_TEXT_LAST_SIGNAL
};
@@ -53,6 +52,7 @@ struct line {
enum {
ARG_0,
ARG_MODEL,
+ ARG_EVENT_PROCESSOR,
ARG_TEXT,
ARG_X,
ARG_Y,
@@ -120,6 +120,8 @@ static void e_text_supply_selection (EText *text, guint time, GdkAtom selection,
static void e_text_text_model_changed(ETextModel *model, EText *text);
+static void _get_tep(EText *text);
+
static GtkWidget *e_text_get_invisible(EText *text);
static void _selection_clear_event (GtkInvisible *invisible,
GdkEventSelection *event,
@@ -188,15 +190,6 @@ e_text_class_init (ETextClass *klass)
parent_class = gtk_type_class (gnome_canvas_item_get_type ());
- e_text_signals[E_TEXT_RESIZE] =
- gtk_signal_new ("resize",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (ETextClass, resize),
- gtk_marshal_NONE__NONE,
- GTK_TYPE_NONE, 0);
-
-
e_text_signals[E_TEXT_CHANGE] =
gtk_signal_new ("change",
GTK_RUN_LAST,
@@ -210,6 +203,8 @@ e_text_class_init (ETextClass *klass)
gtk_object_add_arg_type ("EText::model",
GTK_TYPE_OBJECT, GTK_ARG_READWRITE, ARG_MODEL);
+ gtk_object_add_arg_type ("EText::event_processor",
+ GTK_TYPE_OBJECT, GTK_ARG_READWRITE, ARG_EVENT_PROCESSOR);
gtk_object_add_arg_type ("EText::text",
GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_TEXT);
gtk_object_add_arg_type ("EText::x",
@@ -270,7 +265,6 @@ e_text_class_init (ETextClass *klass)
- klass->resize = NULL;
klass->change = NULL;
object_class->destroy = e_text_destroy;
@@ -334,6 +328,7 @@ e_text_init (EText *text)
text->button_down = FALSE;
text->tep = NULL;
+ text->tep_command_id = 0;
text->has_selection = FALSE;
@@ -371,6 +366,10 @@ e_text_destroy (GtkObject *object)
if (text->model)
gtk_object_unref(GTK_OBJECT(text->model));
+ if (text->tep_command_id)
+ gtk_signal_disconnect(GTK_OBJECT(text->tep),
+ text->tep_command_id);
+
if (text->tep)
gtk_object_unref (GTK_OBJECT(text->tep));
@@ -428,7 +427,7 @@ get_bounds_item_relative (EText *text, double *px1, double *py1, double *px2, do
text->height = 0;
if (old_height != text->height)
- gtk_signal_emit_by_name (GTK_OBJECT (text), "resize");
+ e_canvas_item_request_parent_reflow(item);
/* Anchor text */
@@ -918,6 +917,21 @@ e_text_set_arg (GtkObject *object, GtkArg *arg, guint arg_id)
needs_reflow = 1;
break;
+ case ARG_EVENT_PROCESSOR:
+ if ( text->tep && text->tep_command_id )
+ gtk_signal_disconnect(GTK_OBJECT(text->tep),
+ text->tep_command_id);
+ if ( text->tep )
+ gtk_object_unref(GTK_OBJECT(text->tep));
+ text->tep = E_TEXT_EVENT_PROCESSOR(GTK_VALUE_OBJECT (*arg));
+ gtk_object_ref(GTK_OBJECT(text->tep));
+ text->tep_command_id =
+ gtk_signal_connect(GTK_OBJECT(text->tep),
+ "command",
+ GTK_SIGNAL_FUNC(e_text_command),
+ text);
+ break;
+
case ARG_TEXT:
e_text_model_set_text(text->model, GTK_VALUE_STRING (*arg));
break;
@@ -1180,6 +1194,11 @@ e_text_get_arg (GtkObject *object, GtkArg *arg, guint arg_id)
GTK_VALUE_OBJECT (*arg) = GTK_OBJECT(text->model);
break;
+ case ARG_EVENT_PROCESSOR:
+ _get_tep(text);
+ GTK_VALUE_OBJECT (*arg) = GTK_OBJECT(text->tep);
+ break;
+
case ARG_TEXT:
GTK_VALUE_STRING (*arg) = g_strdup (text->text);
break;
@@ -1529,10 +1548,11 @@ _get_tep(EText *text)
text->tep = e_text_event_processor_emacs_like_new();
gtk_object_ref (GTK_OBJECT (text->tep));
gtk_object_sink (GTK_OBJECT (text->tep));
- gtk_signal_connect(GTK_OBJECT(text->tep),
- "command",
- GTK_SIGNAL_FUNC(e_text_command),
- (gpointer) text);
+ text->tep_command_id =
+ gtk_signal_connect(GTK_OBJECT(text->tep),
+ "command",
+ GTK_SIGNAL_FUNC(e_text_command),
+ (gpointer) text);
}
}
diff --git a/widgets/text/e-text.h b/widgets/text/e-text.h
index a4bc06d820..e7dbd8761c 100644
--- a/widgets/text/e-text.h
+++ b/widgets/text/e-text.h
@@ -164,6 +164,7 @@ struct _EText {
gboolean button_down; /* Is mouse button 1 down */
ETextEventProcessor *tep; /* Text Event Processor */
+ gint tep_command_id;
GtkWidget *invisible; /* For selection handling */
gboolean has_selection; /* TRUE if we have the selection */
td>2009-02-031-6/+15 * - Do not search for Linux-specific hald-addon-acpi module.jkim2009-02-034-5/+73 * Quiet the syslog messages from hal.marcus2009-02-012-1/+26 * Take another stab at fixing mouse support in X. This approach eliminatesmarcus2009-01-279-24/+556 * When changing the input.device property we need to remove the propertyrnoland2009-01-243-26/+9 * - Update X.org ports to 7.4+ (few ports are more recent than the katamari).flz2009-01-242-5/+11 * Add two additional properties to disc media so that applications canmarcus2009-01-162-1/+40 * Presenting GNOME 2.24 for FreeBSD.marcus2009-01-1012-44/+659 * - Remove conditional checks for FreeBSD 5.x and olderpav2009-01-071-4/+0 * Bump portrevision due to upgrade of devel/gettext.edwin2008-06-061-0/+1 * Fix patching when FIXED_MOUNTPOINTS is defined.marcus2008-05-211-10/+5 * Update to 0.5.11.marcus2008-05-194-115/+52 * Remove noexec from the list of hardcoded mount options. This was alreadymarcus2008-05-012-1/+12 * Fix the pkg-install script to create the haldaemon user/group even whenmarcus2008-04-212-15/+18 * * Do not probe disc media unless the media is known to contain datamarcus2008-04-143-1/+31 * Fix the build on 5.X.marcus2008-04-031-4/+7 * * Add an addon to poll mouse device files to see if moused or Xorg owns them.marcus2008-04-028-30/+633 * - Fix empty directory creation in packagepav2008-03-252-1/+2 * The FreeBSD GNOME team is proud to annunce the release of GNOME 2.22.0 formarcus2008-03-2411-181/+296 * Update to snapshot 20080203.marcus2008-02-042-4/+4 * * Make sure all PCI buses are probedmarcus2007-12-252-4/+4 * Update to 20071222 which allows hal to build on 6.0.marcus2007-12-232-4/+4 * Fix the build on 5.X.marcus2007-12-172-5/+5 * Actually remove dependency on cdrtools.marcus2007-12-161-2/+1 * Update to snapshot 20071215.marcus2007-12-162-4/+4 * Update to snapshot 20070909.marcus2007-09-102-5/+5 * - Welcome X.org 7.2 \o/.flz2007-05-202-19/+1 * Add devd to the list of hald's rc.d dependencies. Note: we cannot removemarcus2007-04-232-2/+2 * Add an option which makes hald use the device name rather than thejylefort2007-04-072-0/+36 * Update to snapshot 20070403.marcus2007-04-032-4/+4 * * Power down the system rather than simply shutting it down. [1]marcus2007-03-252-4/+4 * Update to snapshot 20070210.marcus2007-02-112-4/+4 * HAL is not supported on FreeBSD prior to 5.5-RELEASE so mark it as such.marcus2007-02-031-0/+4 * - Use new USE_CDRTOOLS variablepav2007-01-311-2/+2 * Update to snapshot 20070104.marcus2007-01-052-4/+4 * Update to snapshot 20061224.marcus2006-12-252-4/+4 * Update to snapshot 20061217.marcus2006-12-183-4/+5 * Update to snapshot 20661117.marcus2006-11-173-6/+20 * Revert the previous commit. It appears that the operator group is forjylefort2006-11-172-18/+3 * Give wheel group members the same rights as operator group members.jylefort2006-11-172-3/+18 * I wanted to press Cancel, not Done. Revert the previous commit.jylefort2006-11-171-2/+2 * Change operator to wheel (I believe the wheel group is more commonlyjylefort2006-11-161-3/+3 * Update to snapshot 20061107.marcus2006-11-082-5/+6 * Update to snapshot 20061102.marcus2006-11-032-5/+5 * - Make sure to create empty directories when adding from packagepav2006-10-312-1/+7 * Start hald if gnome_enable is set to yes in /etc/rc.confjylefort2006-10-312-4/+6 * Do not break when docbook is installed.jylefort2006-10-311-0/+1 * Update to the 20061030 snapshot which contains support for virtual GEOMmarcus2006-10-314-27/+6 * Allow usbd to start first (if enabled) so that hald does not stealmarcus2006-10-292-2/+2