本文整理汇总了C++中CORBA_exception_init函数的典型用法代码示例。如果您正苦于以下问题:C++ CORBA_exception_init函数的具体用法?C++ CORBA_exception_init怎么用?C++ CORBA_exception_init使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CORBA_exception_init函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: launch_alarm_daemon_cb
/* Does a simple activation and unreffing of the alarm notification service so
* that the daemon will be launched if it is not running yet.
*/
static gboolean
launch_alarm_daemon_cb (gpointer data)
{
CORBA_Environment ev;
CORBA_Object an;
guint *idle_id = (guint *) data;
/* remove the idle function */
g_source_remove (*idle_id);
g_free (idle_id);
/* activate the alarm daemon */
CORBA_exception_init (&ev);
an = bonobo_activation_activate_from_id ("OAFIID:GNOME_Evolution_Calendar_AlarmNotify:" BASE_VERSION, 0, NULL, &ev);
if (BONOBO_EX (&ev)) {
g_message ("launch_alarm_daemon_cb(): %s", bonobo_exception_get_text (&ev));
CORBA_exception_free (&ev);
return FALSE;
}
CORBA_exception_free (&ev);
/* Just get rid of it; what we are interested in is that it gets launched */
CORBA_exception_init (&ev);
bonobo_object_release_unref (an, &ev);
if (BONOBO_EX (&ev))
g_message ("add_alarms(): Could not unref the alarm notification service");
CORBA_exception_free (&ev);
return FALSE;
}
示例2: set_data_and_props
static void
set_data_and_props (SunOneInvitationList *list, int row)
{
SunOneInvitationListPrivate *priv = list->priv;
BonoboControlFrame *control_frame;
Bonobo_PropertyBag prop_bag;
ECalComponent *comp;
icalcomponent *top_level;
char *string;
CORBA_Environment ev;
if (row == -1) {
set_data (BONOBO_WIDGET (priv->control), "");
return;
}
comp = sunone_invitation_list_model_get_comp (priv->model, row);
if (!comp)
return;
/* Set the from address on the control */
control_frame = bonobo_widget_get_control_frame (BONOBO_WIDGET (priv->control));
prop_bag = bonobo_control_frame_get_control_property_bag (control_frame, NULL);
if (prop_bag != CORBA_OBJECT_NIL){
ECalComponentOrganizer organizer;
CORBA_exception_init (&ev);
e_cal_component_get_organizer (comp, &organizer);
bonobo_property_bag_client_set_value_string (prop_bag, "from_address",
organizer.value, &ev);
CORBA_exception_init (&ev);
bonobo_property_bag_client_set_value_gint (prop_bag, "view_only",
1, &ev);
Bonobo_Unknown_unref (prop_bag, &ev);
CORBA_exception_free (&ev);
}
/* Send the icalendar code over */
top_level = toplevel_with_zones (list, comp);
string = icalcomponent_as_ical_string_r (top_level);
set_data (BONOBO_WIDGET (priv->control), string);
g_free (string);
icalcomponent_free (top_level);
}
示例3: main
int main(int argc, char* argv[]) {
EchoApp_Echo echo_service = CORBA_OBJECT_NIL;
CosNaming_NamingContext name_service = CORBA_OBJECT_NIL;
gchar *id[] = {"EchoApp", "Echo", NULL};
CORBA_Environment ev[1];
CORBA_exception_init(ev);
client_init(&argc, argv, &global_orb, ev);
etk_abort_if_exception(ev, "init failed");
g_print("Resolving service reference from name-service with id\"%s\"\n", id[0]);
name_service = etk_get_name_service(global_orb, ev);
etk_abort_if_exception(ev, "failed resolving name-service");
echo_service = (EchoApp_Echo)etk_name_service_resolve(name_service, id, ev);
etk_abort_if_exception(ev, "failed resolving name service at name-service");
client_run(echo_service, ev);
etk_abort_if_exception(ev, "service not reachable");
client_cleanup(global_orb, echo_service, ev);
etk_abort_if_exception(ev, "cleanup failed");
exit(0);
}
示例4: matecomponent_foreign_object_new
MateComponentObject *
matecomponent_foreign_object_new (CORBA_Object corba_objref)
{
MateComponentObject *object;
CORBA_Environment ev[1];
g_return_val_if_fail (corba_objref != CORBA_OBJECT_NIL, NULL);
CORBA_exception_init (ev);
if (!CORBA_Object_is_a (corba_objref, "IDL:MateComponent/Unknown:1.0", ev)) {
if (ev->_major != CORBA_NO_EXCEPTION) {
char *text = matecomponent_exception_get_text (ev);
g_warning ("CORBA_Object_is_a: %s", text);
g_free (text);
} else
g_warning ("matecomponent_foreign_object_new: corba_objref"
" doesn't have interface MateComponent::Unknown");
object = NULL;
} else {
object = MATECOMPONENT_OBJECT (g_object_new (MATECOMPONENT_TYPE_FOREIGN_OBJECT, NULL));
object->corba_objref = CORBA_Object_duplicate (corba_objref, NULL);
matecomponent_running_context_add_object_T (object->corba_objref);
}
CORBA_exception_free (ev);
return object;
}
示例5: MateCORBA_imodule_create_alias_typecode
CORBA_TypeCode
MateCORBA_imodule_create_alias_typecode (GHashTable *typecodes,
IDL_tree tree,
CORBA_TypeCode original_type)
{
CORBA_Environment env;
CORBA_TypeCode retval;
CORBA_exception_init (&env);
g_return_val_if_fail (IDL_NODE_TYPE (tree) == IDLN_IDENT, NULL);
g_return_val_if_fail (g_hash_table_lookup (typecodes,
IDL_IDENT (tree).repo_id) == NULL, NULL);
retval = CORBA_ORB_create_alias_tc (NULL,
IDL_IDENT (tree).repo_id,
IDL_IDENT (tree).str,
original_type, &env);
MateCORBA_imodule_register_typecode (
typecodes, IDL_IDENT (tree).repo_id, retval);
if (env._major != CORBA_NO_EXCEPTION)
g_warning ("MateCORBA_imodule_create_alias_typecode: exception %s", env._id);
CORBA_exception_free (&env);
return retval;
}
示例6: matecomponent_stream_cache_create
/**
* matecomponent_stream_cache_create:
* @cs: a reference to the stream we want to cache
* @opt_ev: an optional environment
*
* Returns a new MateComponentStream object
*/
MateComponentObject *
matecomponent_stream_cache_create (MateComponent_Stream cs,
CORBA_Environment *opt_ev)
{
MateComponentStreamCache *stream;
CORBA_Environment ev, *my_ev;
matecomponent_return_val_if_fail (cs != NULL, NULL, opt_ev);
if (!(stream = g_object_new (matecomponent_stream_cache_get_type (), NULL))) {
if (opt_ev)
matecomponent_exception_set (opt_ev, ex_MateComponent_Storage_IOError);
return NULL;
}
if (!opt_ev) {
CORBA_exception_init (&ev);
my_ev = &ev;
} else
my_ev = opt_ev;
stream->priv->cs = matecomponent_object_dup_ref (cs, my_ev);
if (MATECOMPONENT_EX (my_ev)) {
if (!opt_ev)
CORBA_exception_free (&ev);
matecomponent_object_unref (MATECOMPONENT_OBJECT (stream));
return NULL;
}
if (!opt_ev)
CORBA_exception_free (&ev);
return (MateComponentObject *) stream;
}
示例7: impl_xml_rm
static void
impl_xml_rm (BonoboUIComponent *component,
const char *path,
CORBA_Environment *ev)
{
BonoboUIComponentPrivate *priv;
CORBA_Environment *real_ev, tmp_ev;
Bonobo_UIContainer container;
container = component->priv->container;
g_return_if_fail (container != CORBA_OBJECT_NIL);
if (ev)
real_ev = ev;
else {
CORBA_exception_init (&tmp_ev);
real_ev = &tmp_ev;
}
priv = component->priv;
Bonobo_UIContainer_removeNode (
container, path, priv->name, real_ev);
if (!ev && BONOBO_EX (real_ev))
g_warning ("Serious exception removing path '%s' '%s'",
path, bonobo_exception_get_text (real_ev));
if (!ev)
CORBA_exception_free (&tmp_ev);
}
示例8: bonobo_event_source_client_remove_listener
void
bonobo_event_source_client_remove_listener (Bonobo_Unknown object,
Bonobo_Listener listener,
CORBA_Environment *opt_ev)
{
Bonobo_Unknown es;
CORBA_Environment *ev, temp_ev;
g_return_if_fail (object != CORBA_OBJECT_NIL);
if (!opt_ev) {
CORBA_exception_init (&temp_ev);
ev = &temp_ev;
} else
ev = opt_ev;
es = Bonobo_Unknown_queryInterface (object,
"IDL:Bonobo/EventSource:1.0", ev);
if (!BONOBO_EX (ev) && es) {
Bonobo_EventSource_removeListener (es, listener, ev);
Bonobo_Unknown_unref (es, ev);
}
if (!opt_ev) {
if (BONOBO_EX (ev)) {
char *text = bonobo_exception_get_text (ev);
g_warning ("remove_listener failed '%s'", text);
g_free (text);
}
CORBA_exception_free (ev);
}
}
示例9: matecomponent_zoomable_frame_get_preferred_zoom_level_names
GList *
matecomponent_zoomable_frame_get_preferred_zoom_level_names (MateComponentZoomableFrame *zoomable_frame)
{
CORBA_Environment ev;
MateComponent_ZoomLevelNameList *zoom_level_names;
GList *list = NULL;
int i;
g_return_val_if_fail (MATECOMPONENT_IS_ZOOMABLE_FRAME (zoomable_frame), NULL);
CORBA_exception_init (&ev);
zoom_level_names = MateComponent_Zoomable__get_preferredLevelNames (
zoomable_frame->priv->zoomable, &ev);
if (MATECOMPONENT_EX (&ev)) {
matecomponent_object_check_env (MATECOMPONENT_OBJECT (zoomable_frame),
zoomable_frame->priv->zoomable, &ev);
CORBA_exception_free (&ev);
return NULL;
}
CORBA_exception_free (&ev);
if (zoom_level_names == CORBA_OBJECT_NIL)
return NULL;
for (i = 0; i < zoom_level_names->_length; i++)
list = g_list_prepend (list, g_strdup (zoom_level_names->_buffer [i]));
CORBA_free (zoom_level_names);
return g_list_reverse (list);
}
示例10: matecomponent_property_control_changed
/**
* matecomponent_property_control_changed:
* @property_control: The MateComponentPropertyControl that has changed.
* @opt_ev: An optional CORBA_Environment for exception handling.
*
* Tells the server that a value in the property control has been changed,
* and that it should indicate this somehow.
*/
void
matecomponent_property_control_changed (MateComponentPropertyControl *property_control,
CORBA_Environment *opt_ev)
{
MateComponentPropertyControlPrivate *priv;
CORBA_Environment ev;
CORBA_any any;
CORBA_short s;
g_return_if_fail (property_control != NULL);
g_return_if_fail (MATECOMPONENT_IS_PROPERTY_CONTROL (property_control));
priv = property_control->priv;
if (opt_ev == NULL)
CORBA_exception_init (&ev);
else
ev = *opt_ev;
s = 0;
any._type = (CORBA_TypeCode) TC_CORBA_short;
any._value = &s;
matecomponent_event_source_notify_listeners (priv->event_source,
MATECOMPONENT_PROPERTY_CONTROL_CHANGED,
&any, &ev);
if (opt_ev == NULL && MATECOMPONENT_EX (&ev)) {
g_warning ("ERROR: %s", CORBA_exception_id (&ev));
}
if (opt_ev == NULL)
CORBA_exception_free (&ev);
}
示例11: matecomponent_zoomable_frame_bind_to_zoomable
/**
* matecomponent_zoomable_frame_bind_to_zoomable:
* @zoomable_frame: A MateComponentZoomableFrame object.
* @zoomable: The CORBA object for the MateComponentZoomable embedded
* in this MateComponentZoomableFrame.
*
* Associates @zoomable with this @zoomable_frame.
*/
void
matecomponent_zoomable_frame_bind_to_zoomable (MateComponentZoomableFrame *zoomable_frame,
MateComponent_Zoomable zoomable,
CORBA_Environment *opt_ev)
{
CORBA_Environment *ev, temp_ev;
g_return_if_fail (zoomable != CORBA_OBJECT_NIL);
g_return_if_fail (MATECOMPONENT_IS_ZOOMABLE_FRAME (zoomable_frame));
if (zoomable_frame->priv->zoomable != CORBA_OBJECT_NIL)
CORBA_Object_release (zoomable_frame->priv->zoomable, NULL);
zoomable_frame->priv->zoomable = CORBA_Object_duplicate (zoomable, NULL);
if (!opt_ev) {
CORBA_exception_init (&temp_ev);
ev = &temp_ev;
} else
ev = opt_ev;
MateComponent_Zoomable_setFrame (zoomable, MATECOMPONENT_OBJREF (zoomable_frame), ev);
if (MATECOMPONENT_EX (ev))
matecomponent_object_check_env (MATECOMPONENT_OBJECT (zoomable_frame), zoomable, ev);
if (!opt_ev)
CORBA_exception_free (&temp_ev);
}
示例12: get_circle
MateCanvasItem* get_circle(MateCanvasGroup* group)
{
CORBA_Object server;
MateCanvasItem *item;
CORBA_Environment ev;
CORBA_exception_init (&ev);
server = matecomponent_activation_activate_from_id ("OAFIID:CircleItem",
0, NULL, &ev);
if (server == CORBA_OBJECT_NIL || MATECOMPONENT_EX (&ev))
{
g_warning (_("Could activate Circle: '%s'"),
matecomponent_exception_get_text (&ev));
CORBA_exception_free(&ev);
exit(0);
}
g_print("Got circle component connect.\n");
item = mate_canvas_item_new (group, matecomponent_canvas_item_get_type (),
"corba_factory", server, NULL);
/* I think this tells the object it is OK to exit.
Probably want to call this when I close.
or matecomponent_object_release_unref(server, &ev)
CORBA_Object_release(server, &ev);*/
matecomponent_object_release_unref(server, &ev);
CORBA_exception_free(&ev);
return item;
}
示例13: get_Wise2Corba_Singleton
Wise2Corba_Singleton * get_Wise2Corba_Singleton(int * argc,char ** argv,char * init_string)
{
if( static_init_string != NULL ) {
if( strcmp(static_init_string,init_string) == 0 ) {
return &singleton;
} else {
fprintf(stderr,"Trouble! Asked for orbs of different types %s and %s",init_string,static_init_string);
return NULL;
}
}
/* else, initiate orb */
singleton.ev = g_new0(CORBA_Environment,1);
CORBA_exception_init(singleton.ev);
singleton.orb = CORBA_ORB_init(argc,argv,init_string,singleton.ev);
/* FIXME: Exception check! */
singleton.poa = (PortableServer_POA)CORBA_ORB_resolve_initial_references(singleton.orb,
"RootPOA",singleton.ev);
static_init_string = CORBA_string_dup(init_string);
return &singleton;
}
示例14: impl_set_prop
static void
impl_set_prop (BonoboUIComponent *component,
const char *path,
const char *prop,
const char *value,
CORBA_Environment *opt_ev)
{
Bonobo_UIContainer container;
CORBA_Environment *real_ev, tmp_ev;
g_return_if_fail (path != NULL);
g_return_if_fail (prop != NULL);
g_return_if_fail (value != NULL);
container = component->priv->container;
g_return_if_fail (container != CORBA_OBJECT_NIL);
if (opt_ev)
real_ev = opt_ev;
else {
CORBA_exception_init (&tmp_ev);
real_ev = &tmp_ev;
}
Bonobo_UIContainer_setAttr (
container, path, prop, value,
component->priv->name, real_ev);
if (!opt_ev)
CORBA_exception_free (&tmp_ev);
}
示例15: dasher_action_speech_activate
static gboolean
dasher_action_speech_activate(DasherAction *pSelf) {
DasherActionSpeechPrivate *pDasherActionSpeechPrivate = DASHER_ACTION_SPEECH_GET_PRIVATE(pSelf);
pDasherActionSpeechPrivate->rv = 0;
Bonobo_ServerInfoList *servers;
Bonobo_ServerInfo *info;
servers = bonobo_activation_query("repo_ids.has_one(['IDL:GNOME/Speech/SynthesisDriver:0.2','IDL:GNOME/Speech/SynthesisDriver:0.3'])", NULL, &(pDasherActionSpeechPrivate->ev));
if(servers->_length == 0) {
pDasherActionSpeechPrivate->speaker = NULL;
printf(_("Unable to initialize speech support\n"));
fflush(stdout);
return false;
}
for(unsigned int i = 0; i < servers->_length; i++) {
CORBA_exception_init(&(pDasherActionSpeechPrivate->ev));
info = &servers->_buffer[i];
pDasherActionSpeechPrivate->rv = bonobo_activation_activate_from_id((const Bonobo_ActivationID)info->iid, 0, NULL, &(pDasherActionSpeechPrivate->ev));
if(!BONOBO_EX(&(pDasherActionSpeechPrivate->ev))) {
break;
}
}
CORBA_free(servers);
GNOME_Speech_SynthesisDriver_driverInit(pDasherActionSpeechPrivate->rv, &(pDasherActionSpeechPrivate->ev));
pDasherActionSpeechPrivate->voices = GNOME_Speech_SynthesisDriver_getAllVoices(pDasherActionSpeechPrivate->rv, &(pDasherActionSpeechPrivate->ev));
if(pDasherActionSpeechPrivate->voices == NULL || BONOBO_EX(&(pDasherActionSpeechPrivate->ev)) || pDasherActionSpeechPrivate->voices->_length == 0) {
g_warning(_("Unable to initialize voices\n"));
pDasherActionSpeechPrivate->speaker = NULL;
return false;
}
pDasherActionSpeechPrivate->speaker = GNOME_Speech_SynthesisDriver_createSpeaker(pDasherActionSpeechPrivate->rv, &pDasherActionSpeechPrivate->voices->_buffer[0], &(pDasherActionSpeechPrivate->ev));
GNOME_Speech_ParameterList *list;
list = GNOME_Speech_Speaker_getSupportedParameters(pDasherActionSpeechPrivate->speaker, &(pDasherActionSpeechPrivate->ev));
if(BONOBO_EX(&(pDasherActionSpeechPrivate->ev)) || list->_length == 0) {
if(!BONOBO_EX(&(pDasherActionSpeechPrivate->ev)))
CORBA_free(list);
g_warning(_("Warning: unable to set speech parameters\n"));
return false;
}
for(unsigned i = 0; i < list->_length; i++) {
GNOME_Speech_Parameter *p = &(list->_buffer[i]);
if(!strcmp(p->name, "rate")) {
GNOME_Speech_Speaker_setParameterValue(pDasherActionSpeechPrivate->speaker, p->name, 200.0, &(pDasherActionSpeechPrivate->ev));
}
}
CORBA_free(list);
return true;
}