adding Unix Shell Makefile stuff

This commit is contained in:
spider 1998-05-05 20:17:21 +00:00
Родитель 33216ec61c
Коммит db8cb85bd9
2 изменённых файлов: 120 добавлений и 0 удалений

39
shell/src/unix/Makefile Normal file
Просмотреть файл

@ -0,0 +1,39 @@
#!gmake
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
DEPTH = ../../..
MODULE=shell
LIBRARY_NAME = shell_s
DEFINES = -D_IMPL_NS_SHELL
LCFLAGS=-I$(PUBLIC)/xpcom -I$(PUBLIC)/raptor \
-I$(PUBLIC)/dom -I$(PUBLIC)/js -I$(PUBLIC)/netlib -I$(PUBLIC)/shell
CPPSRCS= \
main.cpp \
$(NULL)
CPP_OBJS= \
./$(OBJDIR)/main.o \
$(NULL)
include $(DEPTH)/config/config.mk
include $(DEPTH)/config/rules.mk

81
shell/src/unix/main.cpp Normal file
Просмотреть файл

@ -0,0 +1,81 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the Private language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nsRepository.h"
#include "nsShellInstance.h"
#include "nsApplicationManager.h"
#define SHELL_DLL "libshell.so"
extern nsIID kIXPCOMApplicationShellCID ;
static NS_DEFINE_IID(kIApplicationShellIID, NS_IAPPLICATIONSHELL_IID);
static NS_DEFINE_IID(kCApplicationShellIID, NS_IAPPLICATIONSHELL_CID);
static NS_DEFINE_IID(kCShellInstanceIID, NS_ISHELLINSTANCE_IID);
void main(int argc, char **argv)
{
nsresult result = NS_OK ;
nsIShellInstance * pShellInstance ;
nsIApplicationShell * pApplicationShell ;
// Let get a ShellInstance for this Application instance
NSRepository::RegisterFactory(kCShellInstanceIID, SHELL_DLL, PR_FALSE, PR_FALSE);
result = NSRepository::CreateInstance(kCShellInstanceIID,
NULL,
kCShellInstanceIID,
(void **) &pShellInstance) ;
if (result != NS_OK)
return result ;
// Let's instantiate the Application's Shell
NS_RegisterApplicationShellFactory() ;
result = NSRepository::CreateInstance(kIXPCOMApplicationShellCID,
NULL,
kIXPCOMApplicationShellCID,
(void **) &pApplicationShell) ;
if (result != NS_OK)
return result ;
// Let the the State know who it's Application Instance is
pShellInstance->SetNativeInstance((nsNativeApplicationInstance) NULL);
pShellInstance->SetApplicationShell(pApplicationShell);
// Tell the application manager to store away the association so the
// Application can look up its State
NSApplicationManager::SetShellAssociation(pApplicationShell, pShellInstance);
// Initialize the system
pShellInstance->Init();
pApplicationShell->Init();
// Now, let actually start dispatching events.
result = pApplicationShell->Run();
// We're done, clean up
NSApplicationManager::DeleteShellAssociation(pApplicationShell, pShellInstance);
// book out of here
return result;
}