Can anyone help out? This is my story so far:
Ever since I was a young boy... I wanted to send emails through
evolution without having to load up the entire evolution client...In
other words if I click on a "mailto" link in mozzila, or and email
address in xchat, I'd like the mail composer to pop up with the selected
email in the "To:" field...
At first, I suspected that there *might* be a command line option for
evolution-mail....nope...checked evolution ... nope.. eh..
so I thought for a while.. bonobo! I have spent the last 24 hours
researching and reading and etc etc on bonobo and oaf and ORBit and
CORBA and and and.. well, you get the point :P
So I tried playing around with oaf-client, oaf-do-query, or
evolution-mail --oaf-activate-iid=....
This was about the extent of my success:
$ oaf-client -s "repo_ids.has ('IDL:GNOME/Evolution:Composer:1.0')"
Query spec is "repo_ids.has ('IDL:GNOME/Evolution:Composer:1.0')"
Activation ID
"OAFAID:[OAFIID:GNOME_Evolution_Mail_ComposerFactory,chuckjr,tower,session]"
RESULT_OBJECT
IOR:010000002100000049444c3a474e4f4d452f45766f6c7574696f6e2f436f6d706f7365723a312e300000000001000000caaedfba54000000010100002b0000002f746d702f6f726269742d636875636b6a722f6f72622d3533363331333235353137373232323932353700000000000018000000000000002aff5996fba00146c5000000983e3666bad8b015
.. I even tried passing some of those values to --oaf-activate-iid, eh.
That didn't go so well, and that's about as far as I got with such
tools.
So I decided to write my own, evo-comp.c is attached. I figured I'll
just make a container and load up the OAF object... Well, it doesn't
load, and now I'm here asking this list for an
answer/advice/suggestions..
What do you all say? How can this be done?
Thanks,
Charles
#include <gnome.h>
#include <liboaf/liboaf.h>
#include <bonobo.h>
#define EVOLUTION_COMPOSER "OAFIID:GNOME_Evolution_Mail_Composer"
static void
app_destroy_cb (GtkWidget *app, BonoboUIContainer *uic)
{
bonobo_object_unref (BONOBO_OBJECT (uic));
gtk_main_quit ();
}
static int
app_delete_cb (GtkWidget *widget, GdkEvent *event, gpointer dummy)
{
gtk_widget_destroy (GTK_WIDGET (widget));
return FALSE;
}
static guint
container_create (void)
{
GtkWidget *control;
GtkWidget *proplist;
GtkWidget *box;
GtkWidget *button;
GtkWidget *clock_button;
BonoboUIContainer *uic;
BonoboControlFrame *cf;
GtkWindow *window;
GtkWidget *app;
app = bonobo_window_new ("evolutoin-mail-composer",
"Evolution Mail-Composer Launcher");
window = GTK_WINDOW (app);
uic = bonobo_ui_container_new ();
bonobo_ui_container_set_win (uic, BONOBO_WINDOW (app));
gtk_window_set_default_size (window, 500, 440);
gtk_window_set_policy (window, TRUE, TRUE, FALSE);
gtk_signal_connect (GTK_OBJECT (window), "delete_event",
GTK_SIGNAL_FUNC (app_delete_cb), NULL);
gtk_signal_connect (GTK_OBJECT (window), "destroy",
GTK_SIGNAL_FUNC (app_destroy_cb), uic);
box = gtk_vbox_new (FALSE, 0);
bonobo_window_set_contents (BONOBO_WINDOW (app), box);
control = bonobo_widget_new_control (EVOLUTION_COMPOSER,
NULL);
if (control)
gtk_box_pack_start (GTK_BOX (box), control, TRUE, TRUE, 0);
else
g_print ("control is NULL.\n");
gtk_widget_show_all (GTK_WIDGET (window));
return FALSE;
}
int
main (int argc, char **argv)
{
CORBA_Environment ev;
CORBA_ORB orb;
CORBA_exception_init (&ev);
gnome_init_with_popt_table ("evolutoin-mail-composer", "0.1",
argc, argv,
oaf_popt_options, 0, NULL);
orb = oaf_init (argc, argv);
if (bonobo_init (orb, NULL, NULL) == FALSE)
g_error ("Could not initialize Bonobo");
gtk_idle_add ((GtkFunction) container_create, NULL);
bonobo_main ();
return 0;
}