aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/e-text-event-processor.c
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@helixcode.com>2000-10-27 22:48:20 +0800
committerChris Lahey <clahey@src.gnome.org>2000-10-27 22:48:20 +0800
commitdfdfa72ec5b7d56e9b6894b491e3b00d9bd21be2 (patch)
tree959b75aac9c36dc36b3c953e90727b0e8de691ed /e-util/e-text-event-processor.c
parent0e9dae0eb6c2f22aeb8904c7d161d68133a385b7 (diff)
downloadgsoc2013-evolution-dfdfa72ec5b7d56e9b6894b491e3b00d9bd21be2.tar
gsoc2013-evolution-dfdfa72ec5b7d56e9b6894b491e3b00d9bd21be2.tar.gz
gsoc2013-evolution-dfdfa72ec5b7d56e9b6894b491e3b00d9bd21be2.tar.bz2
gsoc2013-evolution-dfdfa72ec5b7d56e9b6894b491e3b00d9bd21be2.tar.lz
gsoc2013-evolution-dfdfa72ec5b7d56e9b6894b491e3b00d9bd21be2.tar.xz
gsoc2013-evolution-dfdfa72ec5b7d56e9b6894b491e3b00d9bd21be2.tar.zst
gsoc2013-evolution-dfdfa72ec5b7d56e9b6894b491e3b00d9bd21be2.zip
Added an "allow_newlines" argument.
2000-10-27 Christopher James Lahey <clahey@helixcode.com> * gal/e-text/e-entry.c, 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.c, gal/e-text/e-text-event-processor.h, gal/e-text/e-text.c: Added an "allow_newlines" argument. svn path=/trunk/; revision=6226
Diffstat (limited to 'e-util/e-text-event-processor.c')
-rw-r--r--e-util/e-text-event-processor.c72
1 files changed, 57 insertions, 15 deletions
diff --git a/e-util/e-text-event-processor.c b/e-util/e-text-event-processor.c
index cded8171e6..772ae5c12b 100644
--- a/e-util/e-text-event-processor.c
+++ b/e-util/e-text-event-processor.c
@@ -25,11 +25,15 @@
static void e_text_event_processor_init (ETextEventProcessor *card);
static void e_text_event_processor_class_init (ETextEventProcessorClass *klass);
+static void e_text_event_processor_set_arg (GtkObject *object, GtkArg *arg, guint arg_id);
+static void e_text_event_processor_get_arg (GtkObject *object, GtkArg *arg, guint arg_id);
+
static GtkObjectClass *parent_class = NULL;
/* The arguments we take */
enum {
- ARG_0
+ ARG_0,
+ ARG_ALLOW_NEWLINES,
};
enum {
@@ -67,30 +71,37 @@ e_text_event_processor_get_type (void)
static void
e_text_event_processor_class_init (ETextEventProcessorClass *klass)
{
- GtkObjectClass *object_class;
+ GtkObjectClass *object_class;
+
+ object_class = (GtkObjectClass*) klass;
- object_class = (GtkObjectClass*) klass;
+ parent_class = gtk_type_class (gtk_object_get_type ());
- parent_class = gtk_type_class (gtk_object_get_type ());
+ e_tep_signals[E_TEP_EVENT] =
+ gtk_signal_new ("command",
+ GTK_RUN_LAST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (ETextEventProcessorClass, command),
+ gtk_marshal_NONE__POINTER,
+ GTK_TYPE_NONE, 1,
+ GTK_TYPE_POINTER);
- e_tep_signals[E_TEP_EVENT] =
- gtk_signal_new ("command",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (ETextEventProcessorClass, command),
- gtk_marshal_NONE__POINTER,
- GTK_TYPE_NONE, 1,
- GTK_TYPE_POINTER);
+ gtk_object_class_add_signals (object_class, e_tep_signals, E_TEP_LAST_SIGNAL);
- gtk_object_class_add_signals (object_class, e_tep_signals, E_TEP_LAST_SIGNAL);
+ gtk_object_add_arg_type ("ETextEventProcessor::allow_newlines", GTK_TYPE_BOOL,
+ GTK_ARG_READWRITE, ARG_ALLOW_NEWLINES);
- klass->event = NULL;
- klass->command = NULL;
+ klass->event = NULL;
+ klass->command = NULL;
+
+ object_class->set_arg = e_text_event_processor_set_arg;
+ object_class->get_arg = e_text_event_processor_get_arg;
}
static void
e_text_event_processor_init (ETextEventProcessor *tep)
{
+ tep->allow_newlines = TRUE;
}
gint
@@ -102,3 +113,34 @@ e_text_event_processor_handle_event (ETextEventProcessor *tep, ETextEventProcess
return 0;
}
}
+
+/* Set_arg handler for the text item */
+static void
+e_text_event_processor_set_arg (GtkObject *object, GtkArg *arg, guint arg_id)
+{
+ ETextEventProcessor *tep = E_TEXT_EVENT_PROCESSOR (object);
+
+ switch (arg_id) {
+ case ARG_ALLOW_NEWLINES:
+ tep->allow_newlines = GTK_VALUE_BOOL (*arg);
+ break;
+ default:
+ return;
+ }
+}
+
+/* Get_arg handler for the text item */
+static void
+e_text_event_processor_get_arg (GtkObject *object, GtkArg *arg, guint arg_id)
+{
+ ETextEventProcessor *tep = E_TEXT_EVENT_PROCESSOR (object);
+
+ switch (arg_id) {
+ case ARG_ALLOW_NEWLINES:
+ GTK_VALUE_BOOL (*arg) = tep->allow_newlines;
+ break;
+ default:
+ arg->type = GTK_TYPE_INVALID;
+ break;
+ }
+}