BonoboObject wrapper for Evolution::Component interface. Abstract, doesn't

2005-06-02  Not Zed  <NotZed@Ximian.com>

        * evolution-component.c: BonoboObject wrapper for
        Evolution::Component interface.  Abstract, doesn't implement
        methods.

        * Evolution-Shell.idl: add a method to find a component by
        component alias.

        * e-shell.c (impl_Shell_findComponent): & implement it

svn path=/trunk/; revision=29443
This commit is contained in:
Not Zed
2005-06-02 04:28:11 +00:00
committed by Michael Zucci
parent 91c107fa85
commit df95abe300
6 changed files with 136 additions and 0 deletions

View File

@ -1,3 +1,14 @@
2005-06-02 Not Zed <NotZed@Ximian.com>
* evolution-component.c: BonoboObject wrapper for
Evolution::Component interface. Abstract, doesn't implement
methods.
* Evolution-Shell.idl: add a method to find a component by
component alias.
* e-shell.c (impl_Shell_findComponent): & implement it
2005-06-01 Not Zed <NotZed@Ximian.com>
* e-shell-window-commands.c: fixed the utf8 in the last patch.

View File

@ -48,6 +48,12 @@ module Evolution {
*/
void setLineStatus (in boolean online)
raises (NotReady);
/*
* Lookup a component by id.
*/
Component findComponent(in string id)
raises (NotReady, ComponentNotFound);
};
};
};

View File

@ -80,11 +80,13 @@ eshellinclude_HEADERS = \
e-shell-utils.h \
e-user-creatable-items-handler.h \
evolution-config-control.h \
evolution-component.h \
evolution-shell-component-utils.h
libeshell_la_SOURCES = \
$(IDL_GENERATED) \
$(MARSHAL_GENERATED) \
evolution-component.c \
e-shell-utils.c \
e-user-creatable-items-handler.c \
evolution-config-control.c \

View File

@ -305,6 +305,30 @@ impl_Shell_setLineStatus (PortableServer_Servant servant,
e_shell_go_offline (shell, NULL);
}
static GNOME_Evolution_Component
impl_Shell_findComponent(PortableServer_Servant servant,
const CORBA_string id,
CORBA_Environment *ev)
{
EShell *shell;
EComponentInfo *ci;
if (raise_exception_if_not_ready (servant, ev))
return CORBA_OBJECT_NIL;
shell = (EShell *)bonobo_object_from_servant (servant);
ci = e_component_registry_peek_info(shell->priv->component_registry, ECR_FIELD_ALIAS, id);
if (ci == NULL) {
CORBA_exception_set (ev, CORBA_USER_EXCEPTION, ex_GNOME_Evolution_Shell_ComponentNotFound, NULL);
return CORBA_OBJECT_NIL;
} else if (ci->iface == NULL) {
CORBA_exception_set (ev, CORBA_USER_EXCEPTION, ex_GNOME_Evolution_Shell_NotReady, NULL);
return CORBA_OBJECT_NIL;
} else {
return ci->iface;
}
}
/* EShellWindow handling and bookkeeping. */
@ -491,6 +515,7 @@ e_shell_class_init (EShellClass *klass)
epv->createNewWindow = impl_Shell_createNewWindow;
epv->handleURI = impl_Shell_handleURI;
epv->setLineStatus = impl_Shell_setLineStatus;
epv->findComponent = impl_Shell_findComponent;
}
static void

View File

@ -0,0 +1,47 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/*
* Copyright (C) 2005 Novell, Inc.
*
* Authors: Michael Zucchi <notzed@novell.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "evolution-component.h"
#define PARENT_TYPE bonobo_object_get_type ()
static BonoboObjectClass *parent_class = NULL;
/* Evolution.Component */
/* Initialization */
static void
evolution_component_class_init (EvolutionComponentClass *klass)
{
parent_class = g_type_class_peek_parent (klass);
}
static void
evolution_component_init(EvolutionComponent *emf, EvolutionComponentClass *klass)
{
}
BONOBO_TYPE_FUNC_FULL (EvolutionComponent, GNOME_Evolution_Component, PARENT_TYPE, evolution_component)

View File

@ -0,0 +1,45 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/*
* Copyright (C) 2005 Novell, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
* Author: Michael Zucchi <notzed@novell.com>
*
* Abstract class wrapper for EvolutionComponent
*/
#ifndef _EVOLUTION_COMPONENT_H_
#define _EVOLUTION_COMPONENT_H_
#include <bonobo/bonobo-object.h>
#include "Evolution.h"
typedef struct _EvolutionComponent EvolutionComponent;
typedef struct _EvolutionComponentClass EvolutionComponentClass;
struct _EvolutionComponent {
BonoboObject parent;
};
struct _EvolutionComponentClass {
BonoboObjectClass parent_class;
POA_GNOME_Evolution_Component__epv epv;
};
GType evolution_component_get_type(void);
#endif /* _EVOLUTION_COMPONENT_H_ */