From 0a97481d49815037059dc3d3fe578f68cb0b92c4 Mon Sep 17 00:00:00 2001 From: "bryner%netscape.com" Date: Wed, 21 Aug 2002 19:21:36 +0000 Subject: [PATCH] Phoenix files to use generic XUL application library. Not part of the build. git-svn-id: svn://10.0.0.236/trunk@127783 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/browser/app/Makefile.in | 58 +++++++++++++ mozilla/browser/app/module.ver | 1 + mozilla/browser/app/mozilla.ico | Bin 0 -> 3638 bytes mozilla/browser/app/mozilla.in | 120 +++++++++++++++++++++++++++ mozilla/browser/app/nsBrowserApp.cpp | 66 +++++++++++++++ mozilla/browser/app/splash.rc | 69 +++++++++++++++ 6 files changed, 314 insertions(+) create mode 100644 mozilla/browser/app/Makefile.in create mode 100644 mozilla/browser/app/module.ver create mode 100644 mozilla/browser/app/mozilla.ico create mode 100755 mozilla/browser/app/mozilla.in create mode 100644 mozilla/browser/app/nsBrowserApp.cpp create mode 100644 mozilla/browser/app/splash.rc diff --git a/mozilla/browser/app/Makefile.in b/mozilla/browser/app/Makefile.in new file mode 100644 index 00000000000..d06622c0785 --- /dev/null +++ b/mozilla/browser/app/Makefile.in @@ -0,0 +1,58 @@ + +DEPTH = ../.. +topsrcdir = @top_srcdir@ +srcdir = @srcdir@ +VPATH = @srcdir@ + +include $(DEPTH)/config/autoconf.mk + +ifeq ($(USE_SHORT_LIBNAME), 1) +PROGRAM = mozbrowser$(BIN_SUFFIX) +else +PROGRAM = mozbrowser-bin$(BIN_SUFFIX) +endif + +REQUIRES = \ + appshell \ + string \ + xpcom \ + xulapp \ + $(NULL) + +CPPSRCS = nsBrowserApp.cpp + +EXTRA_LIBS = \ + $(DIST)/lib/$(LIB_PREFIX)xulapp_s.$(LIB_SUFFIX) \ + $(MOZ_JS_LIBS) \ + $(MOZ_COMPONENT_LIBS) \ + $(TK_LIBS) \ + $(NULL) + +$(PROGRAM): $(DIST)/lib/$(LIB_PREFIX)xulapp_s.$(LIB_SUFFIX) + +ifeq ($(OS_ARCH),WINNT) +OS_LIBS += comctl32.lib comdlg32.lib uuid.lib shell32.lib ole32.lib oleaut32.lib version.lib winspool.lib +RCINCLUDE = splash.res +ifndef MOZ_DEBUG +MOZ_WINCONSOLE = 0 +endif +endif + +include $(topsrcdir)/config/rules.mk + +ifneq (,$(filter-out OS2 WINNT,$(OS_ARCH))) +mozbrowser:: mozilla.in Makefile.in Makefile $(DEPTH)/config/autoconf.mk + cat $< | sed -e "s|%MOZAPPDIR%|$(mozappdir)|" \ + -e "s|%MREDIR%|$(mredir)|" \ + -e "s|mozilla-bin|$(PROGRAM)|g" > $@ + chmod +x $@ + +libs:: mozbrowser + $(INSTALL) $< $(DIST)/bin + +install:: mozbrowser + $(SYSINSTALL) $< $(DESTDIR)$(bindir) + +GARBAGE += mozbrowser + +endif diff --git a/mozilla/browser/app/module.ver b/mozilla/browser/app/module.ver new file mode 100644 index 00000000000..c01eda0491b --- /dev/null +++ b/mozilla/browser/app/module.ver @@ -0,0 +1 @@ +WIN32_MODULE_DESCRIPTION=Mozilla diff --git a/mozilla/browser/app/mozilla.ico b/mozilla/browser/app/mozilla.ico new file mode 100644 index 0000000000000000000000000000000000000000..678075081cb4ac6221e5df6e6ff19da6b9c337fa GIT binary patch literal 3638 zcmeHJdwf&n8Gaz7N$D-Ur!A>HrKAavHmBtlD1{zqfpCwM%i&Tn-XjV|MTu;6M8~#F zod&O!!Cah7<84OlT&80h9no$g+w^^OrIz=t%@gzQ{#oy51{A2&@FW=wq%a`*# z@B5zjeZTK}-UE!mSeQ)UY{Uh6zzU$IX7u?!BX9%PY+R!XxICiA3G>Hjzh9J0CW99b zT!y3jx8u3HF2S>RZo}QX*5S&HZP>lF9Y^opj;2T4xHUr`N$glZ51mp2*0eQzaWlSt`nm%D=L%T6x~!+m<}Hw|ot@5BXK`m|r`4K; zm8)dy#^Ozln~Lk|I<0!FUAJnz)w58rEp6K1-H>c;6$NtVHSV}=FSacFv{4{aYlxBc?0 zVU%vJYdl-SF`q-@V@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CF$uG;LWo2cTHtewN(MW)G f=g_`3{@0;>MQG!5yVL)lzIN(sgPNyFH*G%y>GH#P literal 0 HcmV?d00001 diff --git a/mozilla/browser/app/mozilla.in b/mozilla/browser/app/mozilla.in new file mode 100755 index 00000000000..6cf41bb7348 --- /dev/null +++ b/mozilla/browser/app/mozilla.in @@ -0,0 +1,120 @@ +#!/bin/sh +# +# 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. +# + +## $Id: mozilla.in,v 1.1 2002-08-21 19:21:36 bryner%netscape.com Exp $ +## +## Usage: +## +## $ mozilla [args] +## +## This script is meant to run the mozilla-bin binary from either +## mozilla/xpfe/bootstrap or mozilla/dist/bin. +## +## The script will setup all the environment voodoo needed to make +## the mozilla-bin binary to work. +## + +#uncomment for debugging +#set -x + +moz_libdir=%MOZAPPDIR% +MRE_HOME=%MREDIR% + +# honor MOZILLA_FIVE_HOME if it's there +if [ -n "$MOZILLA_FIVE_HOME" ] ; then + dist_bin="$MOZILLA_FIVE_HOME" +else + # Use run-mozilla.sh in the current dir if it exists + # If not, then start resolving symlinks until we find run-mozilla.sh + found=0 + progname=$0 + curdir=`dirname "$progname"` + run_moz="$curdir/run-mozilla.sh" + if test -x "$run_moz"; then + dist_bin=$curdir + found=1 + else + here=`/bin/pwd` + while [ -h "$progname" ]; do + bn=`basename "$progname"` + cd `dirname "$progname"` + progname=`/bin/ls -l "$bn" |sed -e 's/^.* -> //' ` + if [ ! -x "$progname" ]; then + break + fi + curdir=`dirname "$progname"` + run_moz="$curdir/run-mozilla.sh" + if [ -x "$run_moz" ]; then + cd "$curdir" + dist_bin=`pwd` + found=1 + break + fi + done + cd "$here" + fi + if [ $found = 0 ]; then + # Check default compile-time libdir + if [ -x "$moz_libdir/run-mozilla.sh" ]; then + dist_bin=$moz_libdir + else + echo "Cannot find mozilla runtime directory. Exiting." + exit 1 + fi + fi +fi + +script_args="" +moreargs="" +debugging=0 +MOZILLA_BIN="mozilla-bin" + +if [ "$OSTYPE" = "beos" ]; then + mimeset -F $MOZILLA_BIN +fi + +while [ $# -gt 0 ] +do + case "$1" in + -p | -pure) + MOZILLA_BIN="mozilla-bin.pure" + shift + ;; + -g | --debug) + script_args="$script_args -g" + debugging=1 + shift + ;; + -d | --debugger) + script_args="$script_args -d $2" + shift 2 + ;; + *) + moreargs="$moreargs \"$1\"" + shift 1 + ;; + esac +done + +export MRE_HOME +eval "set -- $moreargs" +if [ $debugging = 1 ] +then + echo $dist_bin/run-mozilla.sh $script_args $dist_bin/$MOZILLA_BIN "$@" +fi +exec "$dist_bin/run-mozilla.sh" $script_args "$dist_bin/$MOZILLA_BIN" "$@" diff --git a/mozilla/browser/app/nsBrowserApp.cpp b/mozilla/browser/app/nsBrowserApp.cpp new file mode 100644 index 00000000000..6dd2e9d90ad --- /dev/null +++ b/mozilla/browser/app/nsBrowserApp.cpp @@ -0,0 +1,66 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 2002 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Brian Ryner + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +#include "nsXULAppAPI.h" +#ifdef XP_WIN +#include +#endif + +int main(int argc, char* argv[]) +{ + nsXREAppData appData; + appData.SetSplashEnabled(PR_FALSE); + appData.SetProductName(NS_LITERAL_CSTRING("MozBrowser")); + appData.SetUseStartupPrefs(PR_FALSE); + + return xre_main(argc, argv, appData); +} + +#ifdef MOZ_WIDGET_GTK +char* splash_xpm[] = {0}; +#endif + +#ifdef XP_WIN +// We need WinMain in order to not be a console app. This function is +// unused if we are a console application. +int WINAPI WinMain( HINSTANCE, HINSTANCE, LPSTR args, int ) +{ + // Do the real work. + return main( __argc, __argv ); +} +#endif diff --git a/mozilla/browser/app/splash.rc b/mozilla/browser/app/splash.rc new file mode 100644 index 00000000000..ab337a44d46 --- /dev/null +++ b/mozilla/browser/app/splash.rc @@ -0,0 +1,69 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: NPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Netscape Public License + * Version 1.1 (the "License"); you may not use this file except in + * compliance with the License. You may obtain a copy of the License at + * http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Mozilla Communicator client code. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1998 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Bill Law law@netscape.com + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the NPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the NPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ +#include +#include "nsINativeAppSupportWin.h" + +// Program icon. +IDI_APPLICATION ICON + "mozilla.ico" + +// Splash screen dialog. +IDD_SPLASH DIALOGEX + DISCARDABLE + 0,0,0,0 + STYLE DS_SETFOREGROUND | DS_CENTER | WS_POPUP + EXSTYLE WS_EX_TOOLWINDOW + FONT 8, "MS Sans Serif" + BEGIN + CONTROL + IDB_SPLASH, + IDB_SPLASH, + "Static", + SS_BITMAP, + 0,0,0,0 + END + +// Splash screen bitmap. +//IDB_SPLASH BITMAP +// "splash.bmp" + +STRINGTABLE DISCARDABLE +BEGIN + ID_DDE_APPLICATION_NAME, "Phoenix" + IDS_STARTMENU_APPNAME, "Phoenix" +END