]> git.pld-linux.org Git - packages/evolution.git/commitdiff
new
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Wed, 17 Jan 2001 23:38:06 +0000 (23:38 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    evolution-bonobo.patch -> 1.1

evolution-bonobo.patch [new file with mode: 0644]

diff --git a/evolution-bonobo.patch b/evolution-bonobo.patch
new file mode 100644 (file)
index 0000000..d14cdc4
--- /dev/null
@@ -0,0 +1,515 @@
+Index: executive-summary/component/e-summary.c
+===================================================================
+RCS file: /cvs/gnome/evolution/executive-summary/component/e-summary.c,v
+retrieving revision 1.16
+retrieving revision 1.18
+diff -u -r1.16 -r1.18
+--- executive-summary/component/e-summary.c    2000/12/13 18:26:45     1.16
++++ executive-summary/component/e-summary.c    2000/12/30 01:34:03     1.18
+@@ -337,25 +337,13 @@
+ {
+       char *html, *tmp;
+       int id = GPOINTER_TO_INT (window);
+-      gboolean u, d, l, r, config;
++      gboolean config;
+-      u = d = l = r = config = TRUE;
++      config = TRUE;
+       if (window->propertycontrol == CORBA_OBJECT_NIL)
+               config = FALSE;
+-      if (row == 0) /* Top row */
+-              u = FALSE;
+-
+-      if (row >= numwindows - 3) /* Bottom row */
+-              d = FALSE;
+-
+-      if (col == 0) /* Leftmost column */
+-              l = FALSE;
+-      
+-      if (col == 2 || ((row * 3) + col) == numwindows - 1) /* Rightmost column */
+-              r = FALSE;
+-
+       html = g_strdup_printf ("<table><tr><td><a href=\"close://%d\">"
+                               "<img src=\"service-close.png\" border=\"0\">"
+                               "</a></td></tr><tr><td>", id);
+@@ -371,53 +359,6 @@
+       }
+       g_free (tmp);
+-#if 0
+-      tmp = html;
+-      if (!l) {
+-              html = g_strdup_printf ("%s<img src=\"service-left-disabled.png\">"
+-                                      "</td><td>", tmp);
+-      } else {
+-              html = g_strdup_printf ("%s<a href=\"left://%d\">"
+-                                      "<img src=\"service-left.png\" border=\"0\">"
+-                                      "</a></td><td>", tmp, id);
+-      }
+-      g_free (tmp);
+-      
+-      tmp = html;
+-      if (!r) {
+-              html = g_strdup_printf ("%s<img src=\"service-right-disabled.png\">"
+-                                      "</td></tr></table>", tmp);
+-      } else {
+-              html = g_strdup_printf ("%s<a href=\"right://%d\">"
+-                                      "<img src=\"service-right.png\" border=\"0\">"
+-                                      "</a></td></tr></table>", tmp, id);
+-      }
+-      g_free (tmp);
+-
+-
+-      tmp = html;
+-      if (!d) {
+-              html = g_strdup_printf ("%s<img src=\"service-down-disabled.png\">"
+-                                      "</td><td>", tmp);
+-      } else {
+-              html = g_strdup_printf ("%s<a href=\"down://%d\">"
+-                                      "<img src=\"service-down.png\" border=\"0\">"
+-                                      "</a></td><td>", tmp, id);
+-      }
+-      g_free (tmp);
+-
+-      tmp = html;
+-      if (!u) {
+-              html = g_strdup_printf ("%s<img src=\"service-up-disabled.png\">"
+-                                      "</td></tr></table>", tmp);
+-      } else {
+-              html = g_strdup_printf ("%s<a href=\"up://%d\">"
+-                                      "<img src=\"service-up.png\" border=\"0\">"
+-                                      "</a></td></tr></table>", tmp, id);
+-      }
+-      g_free (tmp);
+-
+-#endif
+       return html;
+ }
+@@ -631,43 +572,31 @@
+ }
+ static void
+-html_event (BonoboListener *listener,
+-          char *event_name,
+-          CORBA_any *any,
+-          CORBA_Environment *ev,
+-          gpointer user_data)
++listener_event (BonoboListener *listener,
++              char *event_name,
++              BonoboArg *event_data,
++              CORBA_Environment *ev,
++              gpointer user_data)
+ {
+       ESummaryWindow *window = (ESummaryWindow *) user_data;
+-      g_print ("Event: %s\n", event_name);
+-      if (strcmp (event_name, EXECUTIVE_SUMMARY_HTML_VIEW_HTML_CHANGED) != 0) {
+-              return;
+-      }
+-
+-      e_summary_queue_rebuild (window->esummary);
+-}
+-              
+-static void
+-prop_changed_cb (BonoboPropertyListener *listener,
+-               char *name,
+-               BonoboArg *arg,
+-               ESummaryWindow *window)
+-{
+-      if (strcmp (name, "window_title") == 0) {
++      if (strcmp (event_name, "Bonobo/Property:change:window_title") == 0) {
+               if (window->title != NULL)
+                       g_free (window->title);
+-              window->title = g_strdup (BONOBO_ARG_GET_STRING (arg));
+-              e_summary_queue_rebuild (window->esummary);
+-              return;
+-      }
+-      if (strcmp (name, "window_icon") == 0) {
++              window->title = g_strdup (BONOBO_ARG_GET_STRING (event_data));
++              e_summary_queue_rebuild (window->esummary);
++      } else if (strcmp (event_name, "Bonobo/Property:change:window_icon") == 0) {
+               if (window->icon != NULL)
+                       g_free (window->icon);
+-              window->icon = g_strdup (BONOBO_ARG_GET_STRING (arg));
++
++              window->icon = g_strdup (BONOBO_ARG_GET_STRING (event_data));
+               e_summary_queue_rebuild (window->esummary);
+-              return;
++      } else if (strcmp (event_name, EXECUTIVE_SUMMARY_HTML_VIEW_HTML_CHANGED) == 0) {
++              e_summary_queue_rebuild (window->esummary);
+       }
++
++      return;
+ }
+               
+ ESummaryWindow *
+@@ -678,7 +607,7 @@
+       ESummaryWindow *window;
+       ESummaryPrivate *priv;
+       Bonobo_Unknown unknown = CORBA_OBJECT_NIL;
+-      Bonobo_PropertyListener corba_listener;
++      Bonobo_Listener listener;
+       CORBA_Environment ev;
+       g_return_val_if_fail (esummary != NULL, NULL);
+@@ -718,26 +647,22 @@
+               return NULL;
+       }
+-      if (window->html != CORBA_OBJECT_NIL) {
+-              Bonobo_Listener listener;
+-              CORBA_Environment ev2;
+-
+-              /* If HTML view, then set up the listeners. */
+-              window->event_source = Bonobo_Unknown_queryInterface (window->html,
+-                                                                    "IDL:Bonobo/EventSource:1.0",
+-                                                                    &ev);
+-              window->html_listener = bonobo_listener_new (html_event,
+-                                                           window);
+-              listener = bonobo_object_corba_objref (BONOBO_OBJECT (window->html_listener));
+-              window->html_corba_listener = listener;
++      window->event_source = Bonobo_Unknown_queryInterface(window->component,
++                                                           "IDL:Bonobo/EventSource:1.0", &ev);
++      if (window->event_source == CORBA_OBJECT_NIL) {
++              g_warning ("There is no Bonobo::EventSource interface");
+-              CORBA_exception_init (&ev2);
+-              Bonobo_EventSource_addListener (window->event_source,
+-                                              listener, &ev2);
+-              /* Catch error? FIXME */
+-              CORBA_exception_free (&ev2);
++              /* FIXME: Free whatever objects exist */
++              g_free (window);
++              return NULL;
+       }
++      window->listener = bonobo_listener_new (NULL, NULL);
++      gtk_signal_connect (GTK_OBJECT (window->listener), "event_notify",
++                          GTK_SIGNAL_FUNC (listener_event), window);
++      listener = bonobo_object_corba_objref (BONOBO_OBJECT (window->listener));
++      window->listener_id = Bonobo_EventSource_addListener (window->event_source, listener, &ev);
++
+       unknown = Bonobo_Unknown_queryInterface (component,
+                                                "IDL:Bonobo/PropertyBag:1.0",
+                                                &ev);
+@@ -761,20 +686,8 @@
+       window->icon = g_strdup (bonobo_property_bag_client_get_value_string (
+                                           window->propertybag,
+                                         "window_icon", NULL));
+-      /* Listen to changes */
+-      window->listener = bonobo_property_listener_new ();
+-      gtk_signal_connect (GTK_OBJECT (window->listener), "prop_changed",
+-                          GTK_SIGNAL_FUNC (prop_changed_cb), window);
+-      corba_listener = bonobo_object_corba_objref (BONOBO_OBJECT (window->listener));
+-      Bonobo_PropertyBag_addChangeListener (window->propertybag, 
+-                                            "window_title", 
+-                                            corba_listener, &ev);
+-
+-      Bonobo_PropertyBag_addChangeListener (window->propertybag, 
+-                                            "window_icon", 
+-                                            corba_listener, &ev);
+-      CORBA_exception_free (&ev);
++      CORBA_exception_free (&ev);
+       priv->window_list = g_list_append (priv->window_list, window);
+       return window;
+@@ -821,7 +734,7 @@
+       if (window->event_source != CORBA_OBJECT_NIL) {
+               Bonobo_EventSource_removeListener (window->event_source,
+-                                                 window->html_corba_listener,
++                                                 window->listener_id,
+                                                  &ev);
+               if (ev._major != CORBA_NO_EXCEPTION) {
+                       g_warning ("CORBA ERROR: %s", CORBA_exception_id (&ev));
+@@ -829,10 +742,6 @@
+               bonobo_object_release_unref (window->event_source, &ev);
+       }
+-      if (window->html != CORBA_OBJECT_NIL) {
+-              bonobo_object_release_unref (window->html, &ev);
+-      }
+-
+       if (window->propertybag != CORBA_OBJECT_NIL) {
+               bonobo_object_release_unref (window->propertybag, &ev);
+       }
+@@ -849,8 +758,8 @@
+               bonobo_object_unref (BONOBO_OBJECT (window->listener));
+       }
+-      if (window->html_listener) {
+-              bonobo_object_unref (BONOBO_OBJECT (window->html_listener));
++      if (window->html != CORBA_OBJECT_NIL) {
++              bonobo_object_release_unref (window->html, &ev);
+       }
+       bonobo_object_release_unref (window->component, &ev);
+Index: executive-summary/component/e-summary.h
+===================================================================
+RCS file: /cvs/gnome/evolution/executive-summary/component/e-summary.h,v
+retrieving revision 1.9
+retrieving revision 1.11
+diff -u -r1.9 -r1.11
+--- executive-summary/component/e-summary.h    2000/12/11 20:00:24     1.9
++++ executive-summary/component/e-summary.h    2000/12/30 01:34:03     1.11
+@@ -55,10 +55,10 @@
+       Bonobo_PropertyBag propertybag;
+       Bonobo_PropertyControl propertycontrol;
+       Bonobo_EventSource event_source;
+-
+-      BonoboPropertyListener *listener;
+-      BonoboListener *html_listener;
+-      Bonobo_Listener html_corba_listener;
++      
++      /* Listener for the event_source */
++      BonoboListener *listener;
++      int listener_id;
+       char *iid;
+       char *title;
+Index: executive-summary/component/e-summary-url.c
+===================================================================
+RCS file: /cvs/gnome/evolution/executive-summary/component/e-summary-url.c,v
+retrieving revision 1.9
+retrieving revision 1.11
+diff -u -r1.9 -r1.11
+--- executive-summary/component/e-summary-url.c        2000/12/12 23:29:56     1.9
++++ executive-summary/component/e-summary-url.c        2000/12/30 01:34:03     1.11
+@@ -75,25 +75,96 @@
+ typedef struct _PropertyDialog {
+       BonoboListener *listener;
+-      Bonobo_Listener corba_listener;
++      int listener_id;
++
+       Bonobo_EventSource eventsource;
+       GtkWidget *dialog;
+ } PropertyDialog;
+ #define COMPOSER_IID "OAFIID:GNOME_Evolution_Mail_Composer"
++#if HAVECACHE
++static ESummaryCache *image_cache = NULL;
++#endif
++
+ gboolean e_summary_url_mail_compose (ESummary *esummary,
+                                    const char *url);
+ gboolean e_summary_url_exec (const char *exec);
++struct _DownloadInfo {
++      GtkHTMLStream *stream;
++      char *uri;
++      char *buffer;
++
++      gboolean error;
++};
++typedef struct _DownloadInfo DownloadInfo;
++
++static void
++close_callback (GnomeVFSAsyncHandle *handle,
++              GnomeVFSResult result,
++              DownloadInfo *info)
++{
++      if (info->error) {
++              gtk_html_stream_close (info->stream, GTK_HTML_STREAM_ERROR);
++      } else {
++              gtk_html_stream_close (info->stream, GTK_HTML_STREAM_OK);
++      }
++
++      g_free (info->uri);
++      g_free (info->buffer);
++      g_free (info);
++}
++
++static void
++read_callback (GnomeVFSAsyncHandle *handle,
++             GnomeVFSResult result,
++             gpointer buffer,
++             GnomeVFSFileSize bytes_requested,
++             GnomeVFSFileSize bytes_read,
++             DownloadInfo *info)
++{
++      if (result != GNOME_VFS_OK && result != GNOME_VFS_ERROR_EOF) {
++              g_warning ("Read error");
++              info->error = TRUE;
++              gnome_vfs_async_close (handle, close_callback, info);
++      }
++      
++      if (bytes_read == 0) {
++              info->error = FALSE;
++              gnome_vfs_async_close (handle, close_callback, info);
++      } else {
++              gtk_html_stream_write (info->stream, buffer, bytes_read);
++              gnome_vfs_async_read (handle, buffer, 4095, read_callback,
++                                    info);
++      }
++}
++
++static void
++open_callback (GnomeVFSAsyncHandle *handle,
++             GnomeVFSResult result,
++             DownloadInfo *info)
++{
++      if (result != GNOME_VFS_OK) {
++              gtk_html_stream_close (info->stream, GTK_HTML_STREAM_ERROR);
++              g_free (info->uri);
++              g_free (info);
++              return;
++      } 
++
++      info->buffer = g_new (char, 4096);
++      gnome_vfs_async_read (handle, info->buffer, 4095, read_callback, info);
++}
++
+ void
+ e_summary_url_request (GtkHTML *html,
+                      const gchar *url,
+                      GtkHTMLStream *stream)
+ {
+       char *filename;
+-      GnomeVFSHandle *handle = NULL;
+-      GnomeVFSResult result;
++      GnomeVFSAsyncHandle *handle;
++      DownloadInfo *info;
++      g_print ("url: %s\n", url);
+       if (strncasecmp (url, "file:", 5) == 0) {
+               url += 5;
+               filename = e_pixmap_file (url);
+@@ -108,40 +179,14 @@
+       }
+       g_print ("Filename: %s\n", filename);
+-      result = gnome_vfs_open (&handle, filename, GNOME_VFS_OPEN_READ);
+-      
+-      if (result != GNOME_VFS_OK) {
+-              g_warning ("%s: %s", filename, 
+-                         gnome_vfs_result_to_string (result));
+-              g_free (filename);
+-              gtk_html_stream_close (stream, GTK_HTML_STREAM_ERROR);
+-              return;
+-      }
+-
+-      g_free (filename);
+-      while (1) {
+-              char buffer[4096];
+-              GnomeVFSFileSize size;
+-
+-              /* Clear buffer */
+-              memset (buffer, 0x00, 4096);
+-
+-              result = gnome_vfs_read (handle, buffer, 4096, &size);
+-              if (result != GNOME_VFS_OK && result != GNOME_VFS_ERROR_EOF) {
+-                      g_warning ("Error reading data: %s", 
+-                                 gnome_vfs_result_to_string (result));
+-                      gnome_vfs_close (handle);
+-                      gtk_html_stream_close (stream, GTK_HTML_STREAM_ERROR);
+-              }
+-              if (size == 0)
+-                      break; /* EOF */
++      info = g_new (DownloadInfo, 1);
++      info->stream = stream;
++      info->uri = filename;
++      info->error = FALSE;
+-              gtk_html_stream_write (stream, buffer, size);
+-      }
+-      
+-      gtk_html_stream_close (stream, GTK_HTML_STREAM_OK);
+-      gnome_vfs_close (handle);
++      gnome_vfs_async_open (&handle, filename, GNOME_VFS_OPEN_READ,
++                            (GnomeVFSAsyncOpenCallback) open_callback, info);
+ }
+ static char *
+@@ -373,13 +418,12 @@
+       CORBA_exception_init (&ev);
+       Bonobo_EventSource_removeListener (dialog->eventsource,
+-                                         dialog->corba_listener, &ev);
++                                         dialog->listener_id, &ev);
+       if (ev._major != CORBA_NO_EXCEPTION) {
+               g_warning ("Error: %s", CORBA_exception_id (&ev));
+       }
+       bonobo_object_unref (BONOBO_OBJECT (dialog->listener));
+-      bonobo_object_release_unref (dialog->eventsource, &ev);
+       CORBA_exception_free (&ev);
+       g_free (dialog);
+ }
+@@ -394,6 +438,7 @@
+       int address;
+       ESummaryWindow *window;
+       Bonobo_Control control;
++      Bonobo_Listener corba_listener;
+       GtkWidget *prefsbox, *control_widget;
+       CORBA_Environment ev;
+       PropertyDialog *data;
+@@ -443,13 +488,11 @@
+               data->dialog = prefsbox;
+               CORBA_exception_init (&ev);
+-              data->eventsource = Bonobo_Unknown_queryInterface (window->propertycontrol,
+-                                                                 "IDL:Bonobo/EventSource:1.0", 
+-                                                                 &ev);
++              data->eventsource = window->event_source;
+               data->listener = bonobo_listener_new (property_event, data);
+-              data->corba_listener = bonobo_object_corba_objref (BONOBO_OBJECT (data->listener));
+-              Bonobo_EventSource_addListener (data->eventsource,
+-                                              data->corba_listener, &ev);
++              corba_listener = bonobo_object_corba_objref (BONOBO_OBJECT (data->listener));
++              data->listener_id = Bonobo_EventSource_addListener (data->eventsource,
++                                                                  corba_listener, &ev);
+               gtk_signal_connect (GTK_OBJECT (prefsbox), "apply",
+                                   GTK_SIGNAL_FUNC (property_apply), 
+@@ -746,3 +789,26 @@
+               e_summary_unset_message (esummary);
+       }
+ }
++
++/* Cache stuff */
++#if HAVECACHE
++void
++e_summary_url_init_cache (void)
++{
++      if (image_cache != NULL)
++              return;
++
++      image_cache = e_summary_cache_new ();
++}
++
++void
++e_summary_url_cache_destroy (void)
++{
++      if (image_cache == NULL)
++              return;
++
++      gtk_object_unref (GTK_OBJECT (image_cache));
++
++      image_cache = NULL;
++}
++#endif
+Index: executive-summary/component/e-summary-util.c
+===================================================================
+RCS file: /cvs/gnome/evolution/executive-summary/component/e-summary-util.c,v
+retrieving revision 1.4
+retrieving revision 1.5
+diff -u -r1.4 -r1.5
+--- executive-summary/component/e-summary-util.c       2000/12/13 18:26:45     1.4
++++ executive-summary/component/e-summary-util.c       2001/01/12 20:40:09     1.5
+@@ -102,6 +102,9 @@
+               g_warning ("Opening: %s", path);
+               base = opendir (path);
++              if (base == NULL)
++                      return;
++
+               contents = readdir (base);
+               while (contents != NULL) {
+                       char *fullpath;
This page took 0.051386 seconds and 4 git commands to generate.