зеркало из https://github.com/mozilla/gecko-dev.git
Unix Shell Implementation stuff
This commit is contained in:
Родитель
a60fbefc56
Коммит
2355830db1
|
@ -21,7 +21,7 @@ DIRS = unix
|
|||
|
||||
MODULE=shell
|
||||
|
||||
LIBRARY_NAME = shell
|
||||
LIBRARY_NAME = shell_s
|
||||
|
||||
DEFINES = -D_IMPL_NS_SHELL
|
||||
|
||||
|
@ -45,4 +45,6 @@ CPP_OBJS= \
|
|||
|
||||
include $(DEPTH)/config/config.mk
|
||||
|
||||
TARGETS = $(LIBRARY)
|
||||
|
||||
include $(DEPTH)/config/rules.mk
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
|
||||
#ifdef NS_WIN32
|
||||
#include "windows.h"
|
||||
#elif NS_UNIX
|
||||
#include <Xm/Xm.h>
|
||||
#endif
|
||||
|
||||
#include "nsApplicationManager.h"
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
|
||||
#ifdef NS_WIN32
|
||||
#include "windows.h"
|
||||
#elif NS_UNIX
|
||||
#include <Xm/Xm.h>
|
||||
#endif
|
||||
|
||||
#include "nsISupports.h"
|
||||
|
@ -78,6 +80,8 @@ nsresult nsShellInstance::Run()
|
|||
DispatchMessage(&msg);
|
||||
}
|
||||
return ((nsresult)msg.wParam);
|
||||
#elif NS_UNIX
|
||||
XtAppMainLoop(app_context) ;
|
||||
#else
|
||||
return NS_OK;
|
||||
#endif
|
||||
|
|
|
@ -17,9 +17,9 @@
|
|||
|
||||
DEPTH = ../../..
|
||||
|
||||
MODULE=shell
|
||||
MODULE=shel
|
||||
|
||||
LIBRARY_NAME = shell_s
|
||||
LIBRARY_NAME = shellentry_s
|
||||
|
||||
DEFINES = -D_IMPL_NS_SHELL
|
||||
|
||||
|
@ -36,4 +36,6 @@ CPP_OBJS= \
|
|||
|
||||
include $(DEPTH)/config/config.mk
|
||||
|
||||
TARGETS = $(LIBRARY)
|
||||
|
||||
include $(DEPTH)/config/rules.mk
|
||||
|
|
|
@ -20,21 +20,28 @@
|
|||
#include "nsShellInstance.h"
|
||||
#include "nsApplicationManager.h"
|
||||
|
||||
#include <Xm/Xm.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)
|
||||
{
|
||||
Widget topLevel;
|
||||
XtAppContext app_context ;
|
||||
|
||||
nsresult result = NS_OK ;
|
||||
|
||||
nsIShellInstance * pShellInstance ;
|
||||
nsIApplicationShell * pApplicationShell ;
|
||||
|
||||
XtSetLanguageProc(NULL, NULL, NULL);
|
||||
|
||||
topLevel = XtVaAppInitialize(&app_context, "Shell", NULL, 0, &argc, argv, NULL, NULL);
|
||||
|
||||
// Let get a ShellInstance for this Application instance
|
||||
NSRepository::RegisterFactory(kCShellInstanceIID, SHELL_DLL, PR_FALSE, PR_FALSE);
|
||||
|
||||
|
@ -44,7 +51,7 @@ void main(int argc, char **argv)
|
|||
(void **) &pShellInstance) ;
|
||||
|
||||
if (result != NS_OK)
|
||||
return result ;
|
||||
return ;
|
||||
|
||||
// Let's instantiate the Application's Shell
|
||||
NS_RegisterApplicationShellFactory() ;
|
||||
|
@ -55,15 +62,17 @@ void main(int argc, char **argv)
|
|||
(void **) &pApplicationShell) ;
|
||||
|
||||
if (result != NS_OK)
|
||||
return result ;
|
||||
return ;
|
||||
|
||||
// Let the the State know who it's Application Instance is
|
||||
pShellInstance->SetNativeInstance((nsNativeApplicationInstance) NULL);
|
||||
pShellInstance->SetNativeInstance((nsNativeApplicationInstance) topLevel);
|
||||
pShellInstance->SetApplicationShell(pApplicationShell);
|
||||
|
||||
// Tell the application manager to store away the association so the
|
||||
// Application can look up its State
|
||||
#ifdef NS_WIN32
|
||||
NSApplicationManager::SetShellAssociation(pApplicationShell, pShellInstance);
|
||||
#endif
|
||||
|
||||
// Initialize the system
|
||||
pShellInstance->Init();
|
||||
|
@ -73,9 +82,11 @@ void main(int argc, char **argv)
|
|||
result = pApplicationShell->Run();
|
||||
|
||||
// We're done, clean up
|
||||
#ifdef NS_WIN32
|
||||
NSApplicationManager::DeleteShellAssociation(pApplicationShell, pShellInstance);
|
||||
#endif
|
||||
|
||||
// book out of here
|
||||
return result;
|
||||
return ;
|
||||
}
|
||||
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
|
||||
DEPTH = ../..
|
||||
|
||||
DIRS = apptest
|
||||
|
||||
include $(DEPTH)/config/config.mk
|
||||
|
||||
include $(DEPTH)/config/rules.mk
|
||||
|
|
|
@ -15,7 +15,11 @@
|
|||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
#include "nscore.h"
|
||||
|
||||
#ifdef NS_WIN32
|
||||
#include <windows.h>
|
||||
#endif
|
||||
#include "nsAppTest.h"
|
||||
|
||||
void InitAppTest(nsAppTest * aAppTest);
|
||||
|
|
|
@ -0,0 +1,61 @@
|
|||
#!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=../../..
|
||||
|
||||
include $(DEPTH)/config/config.mk
|
||||
|
||||
CPPSRCS = \
|
||||
nsAppTest.cpp \
|
||||
$(NULL)
|
||||
|
||||
INCLUDES+= -I$(PUBLIC)/raptor -I$(PUBLIC)/xpcom -I$(PUBLIC)/shell
|
||||
|
||||
DIRS =
|
||||
|
||||
OBJS = $(CPPSRCS:.cpp=.o)
|
||||
|
||||
EX_LIBS = \
|
||||
$(DIST)/lib/libxpcom.a \
|
||||
$(DIST)/lib/libreg.a \
|
||||
$(DIST)/lib/libraptorbase.a \
|
||||
$(DIST)/lib/libplc21.a \
|
||||
$(DIST)/lib/libplds21.a \
|
||||
$(DIST)/lib/libnspr21.a \
|
||||
$(DIST)/lib/libshell_s.a \
|
||||
$(DIST)/lib/libshellentry_s.a \
|
||||
$(NULL)
|
||||
|
||||
PROGS = $(addprefix $(OBJDIR)/, $(CPPSRCS:.cpp=))
|
||||
|
||||
TARGETS = $(PROGS)
|
||||
|
||||
include $(DEPTH)/config/rules.mk
|
||||
|
||||
$(OBJDIR)/%.o: %.cpp
|
||||
@$(MAKE_OBJDIR)
|
||||
$(CCC) -o $@ $(CFLAGS) -c $*.cpp
|
||||
|
||||
$(PROGS):$(OBJDIR)/%: $(OBJDIR)/%.o $(EX_LIBS)
|
||||
@$(MAKE_OBJDIR)
|
||||
$(CCC) -o $@ $@.o $(LDFLAGS) $(EX_LIBS) $(OS_LIBS) -lXt -lX11
|
||||
|
||||
export::
|
||||
|
||||
install:: $(TARGETS)
|
||||
$(INSTALL) $(PROGS) $(DIST)/bin
|
||||
|
|
@ -15,6 +15,7 @@
|
|||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
#include "nscore.h"
|
||||
#include "nsAppTest.h"
|
||||
#include "AppTestImpl.h"
|
||||
|
||||
|
@ -45,19 +46,25 @@ nsAppTest::~nsAppTest()
|
|||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsAppTest)
|
||||
NS_IMPL_RELEASE(nsAppTest)
|
||||
NS_IMPL_QUERY_INTERFACE(nsAppTest,NS_IAPPTEST_IID);
|
||||
NS_DEFINE_IID(kIAppTestIID, NS_IAPPTEST_IID);
|
||||
NS_IMPL_ISUPPORTS(nsAppTest,kIAppTestIID);
|
||||
|
||||
nsresult nsAppTest::Init()
|
||||
{
|
||||
#ifdef NS_WIN32
|
||||
InitAppTest(this);
|
||||
#else
|
||||
PRUnichar * p;
|
||||
nsCRT::strlen(p);
|
||||
#endif
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult nsAppTest::Run()
|
||||
{
|
||||
#ifdef NS_WIN32
|
||||
RunAppTest(this);
|
||||
#endif
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -74,9 +81,9 @@ nsAppTestFactory::~nsAppTestFactory()
|
|||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsAppTestFactory)
|
||||
NS_IMPL_RELEASE(nsAppTestFactory)
|
||||
NS_IMPL_QUERY_INTERFACE(nsAppTestFactory,NS_IFACTORY_IID);
|
||||
NS_DEFINE_IID(kIAppTestFactoryIID, NS_IFACTORY_IID);
|
||||
NS_IMPL_ISUPPORTS(nsAppTestFactory,kIAppTestFactoryIID);
|
||||
|
||||
|
||||
nsresult nsAppTestFactory::CreateInstance(nsISupports * aOuter,
|
||||
const nsIID &aIID,
|
||||
|
|
Загрузка…
Ссылка в новой задаче