Get the CORBA stuff compiling

This commit is contained in:
Miguel de Icaza 1998-12-14 06:45:07 +00:00
parent 8c2b018b56
commit 052e781898
4 changed files with 99 additions and 72 deletions

5
gnome/FileManager.goad Normal file
View File

@ -0,0 +1,5 @@
[FileManager]
type=exe
repo_id=IDL:GNOME/FileManager:1.0
description=File Manager
location_info=corba-gmc

View File

@ -111,7 +111,8 @@ CORBAOBJS = \
main-corba.o \
gcorba.o \
FileManager-impl.o \
FileManager-skels.o
FileManager-skels.o \
FileManager-common.o
OBJS = \
$(LOBJS) \
@ -159,10 +160,12 @@ CORBA_SOURCES = \
$(CORBA_GENERATED): $(rootdir)/idl/FileManager.idl
orbit-idl `gnome-config --cflags idl` $(rootdir)/idl/FileManager.idl
$(CORBA_SOURCES): $(CORBA_GENERATED)
FileManager-impl.c: FileManager.h
DISTGNOME = \
Makefile.in gnome.TODO layout gmc.gnorba \
Makefile.in gnome.TODO layout FileManager.goad \
$(PIXMAPS) $(ICONS) $(GNOMESRCS) $(GNOMEHDRS) \
$(CORBA_SOURCES)
@ -185,7 +188,7 @@ mx: @LIBVFS@ $(OBJS) $(NORMALOBJS) @LIBSLANG@ libgtkedit.a
touch mx
corba-gmc: @LIBVFS@ $(OBJS) $(CORBAOBJS) @LIBSLANG@ libgtkedit.a
$(CC) $(CORBA_LDFLAGS) -o gmc $(CORBAOBJS) $(OBJS) -L../vfs -L../slang -L../gtkedit $(EXTRALIBS) $(LIBS)
$(CC) $(CORBA_LDFLAGS) -o corba-gmc $(CORBAOBJS) $(OBJS) -L../vfs -L../slang -L../gtkedit $(EXTRALIBS) $(LIBS)
mc.metadata: mc.metadata.in Makefile
sed -e 's^\@icondir\@^$(icondir)^g' < $(srcdir)/mc.metadata.in > mc.metadata.tmp \

View File

@ -3,29 +3,40 @@
*
* Author:
* Miguel de Icaza (miguel@gnu.org)
* Elliot Lee (sopwith@cuc.edu)
*/
#include <config.h>
#include <libgnorba/gnorba.h>
#include <libgnorba/gnome-factory.h>
#include "FileManager.h"
#include <config.h>
#include "x.h"
#include <stdio.h>
#include <sys/stat.h>
#include "dir.h"
#include "global.h"
#include "panel.h"
#include "gscreen.h"
#include "main.h"
#include "gmain.h"
#include "gcorba.h"
PortableServer_POA poa;
PortableServer_POAManager poa_manager;
CORBA_ORB orb;
typedef struct {
POA_GNOME_FileManagerWindow servant;
PortableServer_POA poa;
WPanel *mywin;
POA_GNOME_FileManagerWindow servant;
PortableServer_POA poa;
WPanel *mywin;
} impl_POA_GNOME_FileManagerWindow;
typedef struct {
POA_GNOME_FileManagerFactory servant;
PortableServer_POA poa;
POA_GNOME_FileManagerFactory servant;
PortableServer_POA poa;
} impl_POA_GNOME_FileManagerFactory;
impl_POA_GNOME_FileManagerFactory poa_filemanagerfactory_servant;
GNOME_FileManagerFactory filemanagerfactory_server;
/*** Implementation stub prototypes ***/
static void
@ -55,7 +66,7 @@ static PortableServer_ServantBase__epv impl_GNOME_FileManagerWindow_base_epv =
};
static POA_GNOME_FileManagerWindow__epv impl_GNOME_FileManagerWindow_epv =
{
NULL /* _private */
NULL, /* _private */
(gpointer) & impl_GNOME_FileManagerWindow_close,
};
static PortableServer_ServantBase__epv impl_GNOME_FileManagerFactory_base_epv =
@ -91,30 +102,35 @@ static POA_GNOME_FileManagerFactory__vepv impl_GNOME_FileManagerFactory_vepv =
&impl_GNOME_FileManagerFactory_epv,
};
impl_POA_GNOME_FileManagerFactory poa_filemanagerfactory_servant = {
{ NULL, &impl_GNOME_FileManagerWindow_vepv}, NULL
};
GNOME_FileManagerFactory filemanagerfactory_server;
/*** Stub implementations ***/
static void
do_window_close(GtkWidget *widget, gpointer servant)
do_window_close(GtkWidget *widget, gpointer _servant)
{
CORBA_Environment ev;
CORBA_exception_init(&ev);
PortableServer_ObjectId *objid;
objid = PortableServer_POA_servant_to_id(servant->poa, servant, ev);
PortableServer_POA_deactivate_object(servant->poa, objid, ev);
CORBA_free(objid);
POA_GNOME_FileManagerWindow__fini((PortableServer_Servant) servant, ev);
g_free(servant);
CORBA_exception_free(&ev);
return TRUE;
CORBA_Environment ev;
PortableServer_ObjectId *objid;
impl_POA_GNOME_FileManagerWindow *servant = _servant;
CORBA_exception_init(&ev);
objid = PortableServer_POA_servant_to_id (servant->poa, _servant, &ev);
PortableServer_POA_deactivate_object (servant->poa, objid, &ev);
CORBA_free(objid);
POA_GNOME_FileManagerWindow__fini(_servant, &ev);
g_free(servant);
CORBA_exception_free(&ev);
}
static void
impl_GNOME_FileManagerWindow_close(impl_POA_GNOME_FileManagerWindow * servant, CORBA_Environment * ev)
{
gtk_widget_destroy(servant->mywin->xwindow);
gtk_widget_destroy(servant->mywin->xwindow);
}
GNOME_FileManagerWindow
@ -122,25 +138,25 @@ impl_GNOME_FileManagerFactory_create_window(impl_POA_GNOME_FileManagerFactory *
CORBA_char * dir,
CORBA_Environment * ev)
{
GNOME_FileManagerWindow retval;
impl_POA_GNOME_FileManagerWindow *newservant;
PortableServer_ObjectId *objid;
newservant = g_new0(impl_POA_GNOME_FileManagerWindow, 1);
newservant->servant.vepv = &impl_GNOME_FileManagerWindow_vepv;
newservant->poa = poa;
newservant->mywin = new_panel_at((dir && *dir)?dir:gnome_util_user_home());
gtk_signal_connect(GTK_OBJECT(newservant->mywin->xwindow),
"destroy", impl_GNOME_FileManagerWindow_close,
newservant);
POA_GNOME_FileManagerWindow__init((PortableServer_Servant) newservant, ev);
objid = PortableServer_POA_activate_object(poa, newservant, ev);
CORBA_free(objid);
retval = PortableServer_POA_servant_to_reference(poa, newservant, ev);
return retval;
GNOME_FileManagerWindow retval;
impl_POA_GNOME_FileManagerWindow *newservant;
PortableServer_ObjectId *objid;
newservant = g_new0(impl_POA_GNOME_FileManagerWindow, 1);
newservant->servant.vepv = &impl_GNOME_FileManagerWindow_vepv;
newservant->poa = poa;
newservant->mywin = new_panel_at ((dir && *dir) ? dir : home_dir);
gtk_signal_connect(GTK_OBJECT(newservant->mywin->xwindow),
"destroy", impl_GNOME_FileManagerWindow_close,
newservant);
POA_GNOME_FileManagerWindow__init((PortableServer_Servant) newservant, ev);
objid = PortableServer_POA_activate_object(poa, newservant, ev);
CORBA_free(objid);
retval = PortableServer_POA_servant_to_reference(poa, newservant, ev);
return retval;
}
CORBA_boolean
@ -148,7 +164,7 @@ impl_GNOME_FileManagerFactory_supports(impl_POA_GNOME_FileManagerFactory * serva
CORBA_char * obj_goad_id,
CORBA_Environment * ev)
{
return !strcmp(obj_goad_id, "gmc_filemanager_window");
return !strcmp(obj_goad_id, "gmc_filemanager_window");
}
CORBA_Object
@ -157,42 +173,42 @@ impl_GNOME_FileManagerFactory_create_object(impl_POA_GNOME_FileManagerFactory *
GNOME_stringlist * params,
CORBA_Environment * ev)
{
if(!strcmp(goad_id, "gmc_filemanager_window"))
return impl_GNOME_FileManagerFactory_create_window(servant,
params->_length?params->_buffer[0]:gnome_util_user_home(), ev);
CORBA_exception_set(ev, CORBA_USER_EXCEPTION,
ex_GNOME_GenericFactory_CannotActivate,
NULL);
return CORBA_OBJECT_NIL;
if(!strcmp(goad_id, "gmc_filemanager_window"))
return impl_GNOME_FileManagerFactory_create_window(
servant,
params->_length ? params->_buffer [0] : home_dir, ev);
CORBA_exception_set (ev, CORBA_USER_EXCEPTION,
ex_GNOME_GenericFactory_CannotActivate,
NULL);
return CORBA_OBJECT_NIL;
}
void
corba_register_server (void)
{
PortableServer_POAManager poa_manager;
int v;
CORBA_ORB orb;
CORBA_Environment ev;
CORBA_exception_init (&ev);
orb = gnome_CORBA_ORB();
poa = CORBA_ORB_resolve_initial_references (orb, "RootPOA", &ev);
if (ev.major != CORBA_NO_EXCEPTION){
if (ev._major != CORBA_NO_EXCEPTION){
printf ("Can not resolve initial reference to RootPOA");
return;
}
poa_manager = PortableServer_POA__get_the_POAManager (poa, &ev);
if (ev.major != CORBA_NO_EXCEPTION){
if (ev._major != CORBA_NO_EXCEPTION){
printf ("Can not get the POAmanager");
return;
}
PortableServer_POAManager_activate (poa_manager, &ev);
if (ev.major != CORBA_NO_EXCEPTION){
if (ev._major != CORBA_NO_EXCEPTION){
printf ("Can not get the POAmanager");
return;
}
@ -200,22 +216,25 @@ corba_register_server (void)
/*
* Initialize the Factory Object
*/
POA_GNOME_FileManagerFactory__init (&poa_filemanagerfactory_servant, &ev);
POA_GNOME_FileManagerFactory__init (
(POA_GNOME_FileManagerFactory*)&poa_filemanagerfactory_servant,
&ev);
if (ev._major != CORBA_NO_EXCEPTION){
printf ("Can not initialize FileManagerFactory object\n");
return;
}
/* Activate the object */
CORBA_free(PortableServer_POA_activate_object(poa,
&poa_filemanagerfactory_servant, &ev));
CORBA_free (PortableServer_POA_activate_object
(poa, &poa_filemanagerfactory_servant, &ev));
/* Get a refeerence to te object */
filemanagerfactory_server = PortableServer_POA_servant_to_reference (
poa, &poa_filemanagerfactory_servant, &ev);
v = goad_server_register (
NULL, file_manager_factory,
NULL, filemanagerfactory_server,
"gmc_FileManagerFactory", "server", &ev);
if (v != 0)

View File

@ -230,38 +230,38 @@ gview_status (WView *view)
return s;
}
void
static void
gview_quit (GtkWidget *widget, WView *view)
{
dlg_run_done (view->widget.parent);
destroy_dlg (view->widget.parent);
}
void
static void
gnome_normal_search_cmd (GtkWidget *widget, WView *view)
{
normal_search_cmd (view);
}
void
static void
gnome_regexp_search_cmd (GtkWidget *widget, WView *view)
{
regexp_search_cmd (view);
}
void
static void
gnome_continue_search (GtkWidget *widget, WView *view)
{
continue_search (view);
}
void
static void
gnome_goto_line (GtkWidget *widget, WView *view)
{
goto_line (view);
}
void
static void
gnome_toggle_wrap (GtkWidget *widget, WView *view)
{
toggle_wrap_mode (view);