aboutsummaryrefslogtreecommitdiffstats
path: root/composer
diff options
context:
space:
mode:
Diffstat (limited to 'composer')
-rw-r--r--composer/ChangeLog8
-rw-r--r--composer/Makefile.am10
-rw-r--r--composer/e-msg-composer.c21
-rw-r--r--composer/e-msg-composer.h4
-rw-r--r--composer/listener.c80
-rw-r--r--composer/listener.h26
6 files changed, 81 insertions, 68 deletions
diff --git a/composer/ChangeLog b/composer/ChangeLog
index 93e9d630a7..74be956ba4 100644
--- a/composer/ChangeLog
+++ b/composer/ChangeLog
@@ -1,3 +1,11 @@
+2000-12-07 Radek Doulik <rodo@helixcode.com>
+
+ * e-msg-composer.c (prepare_engine): added warnings
+ (prepare_engine): updated to IDL:GNOME/GtkHTML/Editor/Engine:1.0
+
+ * Makefile.am: renamed HTMLEditor* to Editor*, added Editor-common.c:
+ $(HTML_EDITOR_GENERATED) rule
+
2000-12-05 Jeffrey Stedfast <fejj@helixcode.com>
* e-msg-composer.c (add_recipients): Use camel to construct the
diff --git a/composer/Makefile.am b/composer/Makefile.am
index d281725a83..7d83e5b7a7 100644
--- a/composer/Makefile.am
+++ b/composer/Makefile.am
@@ -11,10 +11,10 @@ IDL_GENERATED = \
Composer-stubs.c
HTML_EDITOR_GENERATED = \
- HTMLEditor.h \
- HTMLEditor-common.c \
- HTMLEditor-skels.c \
- HTMLEditor-stubs.c
+ Editor.h \
+ Editor-common.c \
+ Editor-skels.c \
+ Editor-stubs.c
selectnamesdir = $(top_srcdir)/addressbook/gui/component/select-names
@@ -22,6 +22,8 @@ $(IDL_GENERATED): $(IDLS) $(selectnamesdir)/Evolution-Addressbook-SelectNames.id
$(ORBIT_IDL) -I $(srcdir) -I $(datadir)/idl `$(GNOME_CONFIG) --cflags idl` \
-I $(selectnamesdir) $(srcdir)/Composer.idl
+Editor-commmon.c: $(GTK_HTML_EDITOR_IDL)
+
$(HTML_EDITOR_GENERATED): $(GTK_HTML_EDITOR_IDL)
$(ORBIT_IDL) -I $(srcdir) `$(GNOME_CONFIG) --cflags idl` $(GTK_HTML_EDITOR_IDL)
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index 6db5954871..908d59e352 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -58,12 +58,12 @@
#include "e-msg-composer-hdrs.h"
#include "e-msg-composer-select-file.h"
-#include "HTMLEditor.h"
+#include "Editor.h"
#include "listener.h"
#include <libgnomevfs/gnome-vfs.h>
-#define GNOME_GTKHTML_EDITOR_CONTROL_ID "OAFIID:control:html-editor:63c5499b-8b0c-475a-9948-81ec96a9662c"
+#define GNOME_GTKHTML_EDITOR_CONTROL_ID "OAFIID:GNOME_GtkHTML_Editor"
#define DEFAULT_WIDTH 600
@@ -458,19 +458,22 @@ prepare_engine (EMsgComposer *composer)
/* printf ("prepare_engine\n"); */
CORBA_exception_init (&ev);
- composer->editor_engine = (GNOME_HTMLEditor_Engine) bonobo_object_client_query_interface
- (bonobo_widget_get_server (BONOBO_WIDGET (composer->editor)), "IDL:GNOME/HTMLEditor/Engine:1.0", &ev);
+ composer->editor_engine = (GNOME_GtkHTML_Editor_Engine) bonobo_object_client_query_interface
+ (bonobo_widget_get_server (BONOBO_WIDGET (composer->editor)), "IDL:GNOME/GtkHTML/Editor/Engine:1.0", &ev);
if (composer->editor_engine != CORBA_OBJECT_NIL) {
/* printf ("trying set listener\n"); */
- composer->editor_listener = BONOBO_OBJECT (htmleditor_listener_new (composer));
+ composer->editor_listener = BONOBO_OBJECT (listener_new (composer));
if (composer->editor_listener != CORBA_OBJECT_NIL)
- GNOME_HTMLEditor_Engine__set_listener (composer->editor_engine,
- (GNOME_HTMLEditor_Listener)
+ GNOME_GtkHTML_Editor_Engine__set_listener (composer->editor_engine,
+ (GNOME_GtkHTML_Editor_Listener)
bonobo_object_dup_ref
(bonobo_object_corba_objref (composer->editor_listener), &ev),
&ev);
- }
+ else
+ g_warning ("Can't establish Editor Listener\n");
+ } else
+ g_warning ("Can't get Editor Engine\n");
CORBA_exception_free (&ev);
}
@@ -486,7 +489,7 @@ mark_orig_text (EMsgComposer *composer)
*((CORBA_boolean *) flag->_value) = CORBA_TRUE;
CORBA_exception_init (&ev);
- GNOME_HTMLEditor_Engine_setObjectDataByType (composer->editor_engine, "ClueFlow", "orig", flag, &ev);
+ GNOME_GtkHTML_Editor_Engine_setObjectDataByType (composer->editor_engine, "ClueFlow", "orig", flag, &ev);
CORBA_free (flag);
CORBA_exception_free (&ev);
}
diff --git a/composer/e-msg-composer.h b/composer/e-msg-composer.h
index 807f23256f..5c62c34f78 100644
--- a/composer/e-msg-composer.h
+++ b/composer/e-msg-composer.h
@@ -32,7 +32,7 @@ typedef struct _EMsgComposerClass EMsgComposerClass;
#include "e-msg-composer-attachment-bar.h"
#include "e-msg-composer-hdrs.h"
-#include "HTMLEditor.h"
+#include "Editor.h"
#ifdef __cplusplus
extern "C" {
@@ -65,7 +65,7 @@ struct _EMsgComposer {
Bonobo_PersistFile persist_file_interface;
Bonobo_PersistStream persist_stream_interface;
- GNOME_HTMLEditor_Engine editor_engine;
+ GNOME_GtkHTML_Editor_Engine editor_engine;
BonoboObject *editor_listener;
GHashTable *inline_images;
diff --git a/composer/listener.c b/composer/listener.c
index faa26b7644..938122a480 100644
--- a/composer/listener.c
+++ b/composer/listener.c
@@ -26,12 +26,12 @@
#include "listener.h"
static BonoboObjectClass *listener_parent_class;
-static POA_GNOME_HTMLEditor_Listener__vepv listener_vepv;
+static POA_GNOME_GtkHTML_Editor_Listener__vepv listener_vepv;
-inline static HTMLEditorListener *
-htmleditor_listener_from_servant (PortableServer_Servant servant)
+inline static EditorListener *
+listener_from_servant (PortableServer_Servant servant)
{
- return HTMLEDITOR_LISTENER (bonobo_object_from_servant (servant));
+ return EDITOR_LISTENER (bonobo_object_from_servant (servant));
}
static CORBA_any *
@@ -46,7 +46,7 @@ get_any_null ()
}
static gchar *
-resolve_image_url (HTMLEditorListener *l, gchar *url)
+resolve_image_url (EditorListener *l, gchar *url)
{
gchar *cid = NULL;
@@ -68,20 +68,20 @@ resolve_image_url (HTMLEditorListener *l, gchar *url)
}
static void
-reply_indent (HTMLEditorListener *l, CORBA_Environment * ev)
+reply_indent (EditorListener *l, CORBA_Environment * ev)
{
- if (!GNOME_HTMLEditor_Engine_isParagraphEmpty (l->composer->editor_engine, ev)) {
- if (GNOME_HTMLEditor_Engine_isPreviousParagraphEmpty (l->composer->editor_engine, ev))
- GNOME_HTMLEditor_Engine_runCommand (l->composer->editor_engine, "cursor-backward", ev);
+ if (!GNOME_GtkHTML_Editor_Engine_isParagraphEmpty (l->composer->editor_engine, ev)) {
+ if (GNOME_GtkHTML_Editor_Engine_isPreviousParagraphEmpty (l->composer->editor_engine, ev))
+ GNOME_GtkHTML_Editor_Engine_runCommand (l->composer->editor_engine, "cursor-backward", ev);
else {
- GNOME_HTMLEditor_Engine_runCommand (l->composer->editor_engine, "insert-paragraph", ev);
+ GNOME_GtkHTML_Editor_Engine_runCommand (l->composer->editor_engine, "insert-paragraph", ev);
return;
}
}
- GNOME_HTMLEditor_Engine_runCommand (l->composer->editor_engine, "style-normal", ev);
- GNOME_HTMLEditor_Engine_runCommand (l->composer->editor_engine, "indent-zero", ev);
- GNOME_HTMLEditor_Engine_runCommand (l->composer->editor_engine, "italic-off", ev);
+ GNOME_GtkHTML_Editor_Engine_runCommand (l->composer->editor_engine, "style-normal", ev);
+ GNOME_GtkHTML_Editor_Engine_runCommand (l->composer->editor_engine, "indent-zero", ev);
+ GNOME_GtkHTML_Editor_Engine_runCommand (l->composer->editor_engine, "italic-off", ev);
}
static CORBA_any *
@@ -89,7 +89,7 @@ impl_event (PortableServer_Servant _servant,
const CORBA_char * name, const CORBA_any * arg,
CORBA_Environment * ev)
{
- HTMLEditorListener *l = htmleditor_listener_from_servant (_servant);
+ EditorListener *l = listener_from_servant (_servant);
BonoboArg *data;
CORBA_any *rv = NULL;
@@ -97,12 +97,12 @@ impl_event (PortableServer_Servant _servant,
if (!strcmp (name, "command")) {
/* FIXME check for insert-paragraph command */
- data = GNOME_HTMLEditor_Engine_getParagraphData (l->composer->editor_engine, "orig", ev);
+ data = GNOME_GtkHTML_Editor_Engine_getParagraphData (l->composer->editor_engine, "orig", ev);
if (ev->_major == CORBA_NO_EXCEPTION && data) {
if (CORBA_TypeCode_equal (data->_type, TC_boolean, ev) && BONOBO_ARG_GET_BOOLEAN (data))
reply_indent (l, ev);
BONOBO_ARG_SET_BOOLEAN (data, CORBA_FALSE);
- GNOME_HTMLEditor_Engine_setParagraphData (l->composer->editor_engine, "orig", data, ev);
+ GNOME_GtkHTML_Editor_Engine_setParagraphData (l->composer->editor_engine, "orig", data, ev);
}
} else if (!strcmp (name, "image_url")) {
gchar *url;
@@ -118,12 +118,12 @@ impl_event (PortableServer_Servant _servant,
return rv ? rv : get_any_null ();
}
-POA_GNOME_HTMLEditor_Listener__epv *
-htmleditor_listener_get_epv (void)
+POA_GNOME_GtkHTML_Editor_Listener__epv *
+listener_get_epv (void)
{
- POA_GNOME_HTMLEditor_Listener__epv *epv;
+ POA_GNOME_GtkHTML_Editor_Listener__epv *epv;
- epv = g_new0 (POA_GNOME_HTMLEditor_Listener__epv, 1);
+ epv = g_new0 (POA_GNOME_GtkHTML_Editor_Listener__epv, 1);
epv->event = impl_event;
@@ -134,11 +134,11 @@ static void
init_listener_corba_class (void)
{
listener_vepv.Bonobo_Unknown_epv = bonobo_object_get_epv ();
- listener_vepv.GNOME_HTMLEditor_Listener_epv = htmleditor_listener_get_epv ();
+ listener_vepv.GNOME_GtkHTML_Editor_Listener_epv = listener_get_epv ();
}
static void
-listener_class_init (HTMLEditorListenerClass *klass)
+listener_class_init (EditorListenerClass *klass)
{
listener_parent_class = gtk_type_class (bonobo_object_get_type ());
@@ -146,15 +146,15 @@ listener_class_init (HTMLEditorListenerClass *klass)
}
GtkType
-htmleditor_listener_get_type (void)
+listener_get_type (void)
{
static GtkType type = 0;
if (!type){
GtkTypeInfo info = {
- "HTMLEditorListener",
- sizeof (HTMLEditorListener),
- sizeof (HTMLEditorListenerClass),
+ "EditorListener",
+ sizeof (EditorListener),
+ sizeof (EditorListenerClass),
(GtkClassInitFunc) listener_class_init,
(GtkObjectInitFunc) NULL,
NULL, /* reserved 1 */
@@ -168,11 +168,11 @@ htmleditor_listener_get_type (void)
return type;
}
-HTMLEditorListener *
-htmleditor_listener_construct (HTMLEditorListener *listener, GNOME_HTMLEditor_Listener corba_listener)
+EditorListener *
+listener_construct (EditorListener *listener, GNOME_GtkHTML_Editor_Listener corba_listener)
{
g_return_val_if_fail (listener != NULL, NULL);
- g_return_val_if_fail (IS_HTMLEDITOR_LISTENER (listener), NULL);
+ g_return_val_if_fail (IS_EDITOR_LISTENER (listener), NULL);
g_return_val_if_fail (corba_listener != CORBA_OBJECT_NIL, NULL);
if (!bonobo_object_construct (BONOBO_OBJECT (listener), (CORBA_Object) corba_listener))
@@ -181,17 +181,17 @@ htmleditor_listener_construct (HTMLEditorListener *listener, GNOME_HTMLEditor_Li
return listener;
}
-static GNOME_HTMLEditor_Listener
+static GNOME_GtkHTML_Editor_Listener
create_listener (BonoboObject *listener)
{
- POA_GNOME_HTMLEditor_Listener *servant;
+ POA_GNOME_GtkHTML_Editor_Listener *servant;
CORBA_Environment ev;
- servant = (POA_GNOME_HTMLEditor_Listener *) g_new0 (BonoboObjectServant, 1);
+ servant = (POA_GNOME_GtkHTML_Editor_Listener *) g_new0 (BonoboObjectServant, 1);
servant->vepv = &listener_vepv;
CORBA_exception_init (&ev);
- POA_GNOME_HTMLEditor_Listener__init ((PortableServer_Servant) servant, &ev);
+ POA_GNOME_GtkHTML_Editor_Listener__init ((PortableServer_Servant) servant, &ev);
ORBIT_OBJECT_KEY(servant->_private)->object = NULL;
if (ev._major != CORBA_NO_EXCEPTION){
@@ -202,16 +202,16 @@ create_listener (BonoboObject *listener)
CORBA_exception_free (&ev);
- return (GNOME_HTMLEditor_Listener) bonobo_object_activate_servant (listener, servant);
+ return (GNOME_GtkHTML_Editor_Listener) bonobo_object_activate_servant (listener, servant);
}
-HTMLEditorListener *
-htmleditor_listener_new (EMsgComposer *composer)
+EditorListener *
+listener_new (EMsgComposer *composer)
{
- HTMLEditorListener *listener;
- GNOME_HTMLEditor_Listener corba_listener;
+ EditorListener *listener;
+ GNOME_GtkHTML_Editor_Listener corba_listener;
- listener = gtk_type_new (HTMLEDITOR_LISTENER_TYPE);
+ listener = gtk_type_new (EDITOR_LISTENER_TYPE);
listener->composer = composer;
corba_listener = create_listener (BONOBO_OBJECT (listener));
@@ -221,5 +221,5 @@ htmleditor_listener_new (EMsgComposer *composer)
return NULL;
}
- return htmleditor_listener_construct (listener, corba_listener);
+ return listener_construct (listener, corba_listener);
}
diff --git a/composer/listener.h b/composer/listener.h
index 284924ffc6..0c50ef2111 100644
--- a/composer/listener.h
+++ b/composer/listener.h
@@ -25,31 +25,31 @@
#include <libgnome/gnome-defs.h>
#include <bonobo/bonobo-object.h>
-#include "HTMLEditor.h"
+#include "Editor.h"
#include "e-msg-composer.h"
BEGIN_GNOME_DECLS
-#define HTMLEDITOR_LISTENER_TYPE (htmleditor_listener_get_type ())
-#define HTMLEDITOR_LISTENER(o) (GTK_CHECK_CAST ((o), HTMLEDITOR_LISTENER_TYPE, HTMLEditorListener))
-#define HTMLEDITOR_LISTENER_CLASS(k) (GTK_CHECK_CLASS_CAST((k), HTMLEDITOR_LISTENER_TYPE, HTMLEditorListenerClass))
-#define IS_HTMLEDITOR_LISTENER(o) (GTK_CHECK_TYPE ((o), HTMLEDITOR_LISTENER_TYPE))
-#define IS_HTMLEDITOR_LISTENER_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), HTMLEDITOR_LISTENER_TYPE))
+#define EDITOR_LISTENER_TYPE (listener_get_type ())
+#define EDITOR_LISTENER(o) (GTK_CHECK_CAST ((o), EDITOR_LISTENER_TYPE, EditorListener))
+#define EDITOR_LISTENER_CLASS(k) (GTK_CHECK_CLASS_CAST((k), EDITOR_LISTENER_TYPE, EditorListenerClass))
+#define IS_EDITOR_LISTENER(o) (GTK_CHECK_TYPE ((o), EDITOR_LISTENER_TYPE))
+#define IS_EDITOR_LISTENER_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), EDITOR_LISTENER_TYPE))
typedef struct {
BonoboObject parent;
EMsgComposer *composer;
-} HTMLEditorListener;
+} EditorListener;
typedef struct {
BonoboObjectClass parent_class;
-} HTMLEditorListenerClass;
+} EditorListenerClass;
-GtkType htmleditor_listener_get_type (void);
-HTMLEditorListener *htmleditor_listener_construct (HTMLEditorListener *listener,
- GNOME_HTMLEditor_Listener corba_listener);
-HTMLEditorListener *htmleditor_listener_new (EMsgComposer *composer);
-POA_GNOME_HTMLEditor_Listener__epv *htmleditor_listener_get_epv (void);
+GtkType listener_get_type (void);
+EditorListener *listener_construct (EditorListener *listener,
+ GNOME_GtkHTML_Editor_Listener corba_listener);
+EditorListener *listener_new (EMsgComposer *composer);
+POA_GNOME_GtkHTML_Editor_Listener__epv *listener_get_epv (void);
END_GNOME_DECLS