client side functions



Hi,

while looking at gnumeric, I noticed you still need to use
CORBA code for some things. I was thinking it might be a good
idea to have functions like this, instead of doing this in
the app every time:

gint
gnome_persist_file_client_load (GnomeObject *pfile, gchar *file)
{
  GNOME_PersistFile ret;
                
  if (GNOME_IS_PERSIST_FILE (pfile) {
    ret = (GNOME_PersistFile) gnome_object_corba_objref (pfile);
  } else {
    ret = (GNOME_PersistFile)
	GNOME_Unknown_query_interface (gnome_object_corba_objref (pfile),
	                               "IDL:GNOME/PersistFile:1.0",
	                                &pfile->ev);
    if (pfile->ev._major != CORBA_NO_EXCEPTION || ret == CORBA_OBJECT_NIL) {
      return FALSE;
    }
  }
  GNOME_PersistFile_load (ret, file, &ev);
  GNOME_Unknown_unref ((GNOME_Unknown) ret, &ev);
  CORBA_Object_release (ret, &ev);
  return TRUE;
}

cya,
Martijn


-- 
Martijn van Beers  <martijn@earthling.net>

'Don't worry if it sounds odd. Believe me, you are talking to
someone who has seen a lot of stuff that is odd. And I don't
mean biscuits.' --- Arthur Dent



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]