Compare commits
6 Commits
NETSCAPE_7
...
NETSCAPE_7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9ef1ad9fbc | ||
|
|
10b01c369c | ||
|
|
104c8fe8d7 | ||
|
|
34f7e107ff | ||
|
|
a3bebc6b0f | ||
|
|
9c8991cc44 |
@@ -7,15 +7,15 @@
|
||||
# mozilla/gc, , 10/25/2000 12:00:00
|
||||
#
|
||||
|
||||
mozilla/nsprpub, MOZILLA_1_0_0_BRANCH
|
||||
mozilla/security/nss, MOZILLA_1_0_0_BRANCH
|
||||
mozilla/security/manager, MOZILLA_1_0_0_BRANCH
|
||||
mozilla/accessible, MOZILLA_1_0_0_BRANCH
|
||||
mozilla/directory/c-sdk, MOZILLA_1_0_0_BRANCH
|
||||
mozilla/lib/mac/Instrumentation, MOZILLA_1_0_0_BRANCH
|
||||
mozilla/gfx2, MOZILLA_1_0_0_BRANCH
|
||||
mozilla/modules/libpr0n, MOZILLA_1_0_0_BRANCH
|
||||
SeaMonkeyAll, MOZILLA_1_0_0_BRANCH
|
||||
mozilla/nsprpub, NETSCAPE_7_0_PR1_BRANCH
|
||||
mozilla/security/nss, NETSCAPE_7_0_PR1_BRANCH
|
||||
mozilla/security/manager, NETSCAPE_7_0_PR1_BRANCH
|
||||
mozilla/accessible, NETSCAPE_7_0_PR1_BRANCH
|
||||
mozilla/directory/c-sdk, NETSCAPE_7_0_PR1_BRANCH
|
||||
mozilla/lib/mac/Instrumentation, NETSCAPE_7_0_PR1_BRANCH
|
||||
mozilla/gfx2, NETSCAPE_7_0_PR1_BRANCH
|
||||
mozilla/modules/libpr0n, NETSCAPE_7_0_PR1_BRANCH
|
||||
SeaMonkeyAll, NETSCAPE_7_0_PR1_BRANCH
|
||||
|
||||
## You need this if you want to be able to use SVG
|
||||
## Note that this library is under the LGPL, not the MPL
|
||||
|
||||
@@ -40,14 +40,14 @@ MOZ_OBJDIR = WIN32_O.OBJ
|
||||
#// Figure out how to do the pull.
|
||||
#//------------------------------------------------------------------------
|
||||
# uncomment these, modify branch tag, and check in to branch for milestones
|
||||
MOZ_BRANCH=MOZILLA_1_0_0_BRANCH
|
||||
NSPR_CO_TAG=MOZILLA_1_0_0_BRANCH
|
||||
PSM_CO_TAG=MOZILLA_1_0_0_BRANCH
|
||||
NSS_CO_TAG=MOZILLA_1_0_0_BRANCH
|
||||
LDAPCSDK_CO_TAG=MOZILLA_1_0_0_BRANCH
|
||||
ACCESSIBLE_CO_TAG=MOZILLA_1_0_0_BRANCH
|
||||
IMGLIB2_CO_TAG=MOZILLA_1_0_0_BRANCH
|
||||
GFX2_CO_TAG=MOZILLA_1_0_0_BRANCH
|
||||
MOZ_BRANCH=NETSCAPE_7_0_PR1_BRANCH
|
||||
NSPR_CO_TAG=NETSCAPE_7_0_PR1_BRANCH
|
||||
PSM_CO_TAG=NETSCAPE_7_0_PR1_BRANCH
|
||||
NSS_CO_TAG=NETSCAPE_7_0_PR1_BRANCH
|
||||
LDAPCSDK_CO_TAG=NETSCAPE_7_0_PR1_BRANCH
|
||||
ACCESSIBLE_CO_TAG=NETSCAPE_7_0_PR1_BRANCH
|
||||
IMGLIB2_CO_TAG=NETSCAPE_7_0_PR1_BRANCH
|
||||
GFX2_CO_TAG=NETSCAPE_7_0_PR1_BRANCH
|
||||
|
||||
|
||||
!ifdef MOZ_BRANCH
|
||||
|
||||
@@ -52,14 +52,14 @@
|
||||
#
|
||||
# For branches, uncomment the MOZ_CO_TAG line with the proper tag,
|
||||
# and commit this file on that tag.
|
||||
MOZ_CO_TAG = MOZILLA_1_0_0_BRANCH
|
||||
NSPR_CO_TAG = MOZILLA_1_0_0_BRANCH
|
||||
PSM_CO_TAG = MOZILLA_1_0_0_BRANCH
|
||||
NSS_CO_TAG = MOZILLA_1_0_0_BRANCH
|
||||
LDAPCSDK_CO_TAG = MOZILLA_1_0_0_BRANCH
|
||||
ACCESSIBLE_CO_TAG = MOZILLA_1_0_0_BRANCH
|
||||
GFX2_CO_TAG = MOZILLA_1_0_0_BRANCH
|
||||
IMGLIB2_CO_TAG = MOZILLA_1_0_0_BRANCH
|
||||
MOZ_CO_TAG = NETSCAPE_7_0_PR1_BRANCH
|
||||
NSPR_CO_TAG = NETSCAPE_7_0_PR1_BRANCH
|
||||
PSM_CO_TAG = NETSCAPE_7_0_PR1_BRANCH
|
||||
NSS_CO_TAG = NETSCAPE_7_0_PR1_BRANCH
|
||||
LDAPCSDK_CO_TAG = NETSCAPE_7_0_PR1_BRANCH
|
||||
ACCESSIBLE_CO_TAG = NETSCAPE_7_0_PR1_BRANCH
|
||||
GFX2_CO_TAG = NETSCAPE_7_0_PR1_BRANCH
|
||||
IMGLIB2_CO_TAG = NETSCAPE_7_0_PR1_BRANCH
|
||||
BUILD_MODULES = all
|
||||
|
||||
#######################################################################
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* ***** 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.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
*
|
||||
* 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 "nsCOMPtr.h"
|
||||
#include "nsIDOMWindow.h"
|
||||
#include "nsIPrintingPrompt.h"
|
||||
#include "nsIPrintingPromptService.h"
|
||||
|
||||
class nsPrintingPrompt : public nsIPrintingPrompt {
|
||||
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIPRINTINGPROMPT
|
||||
|
||||
nsPrintingPrompt(nsIDOMWindow *window);
|
||||
virtual ~nsPrintingPrompt() {}
|
||||
|
||||
nsresult Init();
|
||||
|
||||
protected:
|
||||
nsCOMPtr<nsIDOMWindow> mParent;
|
||||
nsCOMPtr<nsIPrintingPromptService> mPromptService;
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewPrintingPrompter(nsIPrintingPrompt **result, nsIDOMWindow *aParent);
|
||||
|
||||
@@ -1,77 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* ***** 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.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2000
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Don Cone <dcone@netscape.com>
|
||||
* Conrad Carlen <ccarlen@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 "nsISupports.idl"
|
||||
|
||||
%{ C++
|
||||
#include <Printing.h>
|
||||
%}
|
||||
|
||||
/**
|
||||
* Native types
|
||||
*/
|
||||
native nsTHPrint(THPrint);
|
||||
|
||||
/**
|
||||
* Simplified PrintSettings for Mac interface
|
||||
*
|
||||
* @status UNDER_REVIEW
|
||||
*/
|
||||
[scriptable, uuid(3C85F9F5-3A9D-4bce-8CF8-A1B14E5E8508)]
|
||||
|
||||
interface nsIPrintSettingsMac : nsISupports
|
||||
{
|
||||
/*
|
||||
* thPrint attribute
|
||||
*
|
||||
* Getter returns a clone of the current data
|
||||
* Setter copies (does not take ownership of) the input
|
||||
*/
|
||||
|
||||
[noscript] attribute nsTHPrint tHPrint;
|
||||
|
||||
/*
|
||||
* readPageSetupFromPrefs and writePageSetupToPrefs
|
||||
*
|
||||
* Read and write a print record to/from prefs.
|
||||
*/
|
||||
[noscript] void readPageSetupFromPrefs();
|
||||
[noscript] void writePageSetupToPrefs();
|
||||
};
|
||||
@@ -1,82 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* ***** 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.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2000
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Conrad Carlen <ccarlen@netscape.com>
|
||||
* Don Cone <dcone@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 "nsISupports.idl"
|
||||
|
||||
%{ C++
|
||||
#include <PMApplication.h>
|
||||
%}
|
||||
|
||||
/**
|
||||
* Native types
|
||||
*/
|
||||
native nsPMPageFormat(PMPageFormat);
|
||||
native nsPMPrintSettings(PMPrintSettings);
|
||||
|
||||
|
||||
/**
|
||||
* Simplified PrintSettings for OSX interface
|
||||
*
|
||||
* @status UNDER_REVIEW
|
||||
*/
|
||||
[scriptable, uuid(CD2A0A4F-0DE9-4c51-9232-42668F559F94)]
|
||||
|
||||
interface nsIPrintSettingsX : nsISupports
|
||||
{
|
||||
|
||||
/*
|
||||
* PMPageFormat and PMPrintSettings attributes
|
||||
*
|
||||
* Getter returns a clone of the current data
|
||||
* Setter copies (does not take ownership of) the input
|
||||
*/
|
||||
[noscript] attribute nsPMPageFormat pMPageFormat;
|
||||
|
||||
[noscript] attribute nsPMPrintSettings pMPrintSettings;
|
||||
|
||||
/*
|
||||
* readPageFormatFromPrefs and writePageFormatToPrefs
|
||||
*
|
||||
* Read and write a flattened PMPageFormat to/from prefs.
|
||||
* This also contains any custom data we appended to the dialog
|
||||
*/
|
||||
[noscript] void readPageFormatFromPrefs();
|
||||
[noscript] void writePageFormatToPrefs();
|
||||
};
|
||||
@@ -1,70 +0,0 @@
|
||||
/* -*- 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.org 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):
|
||||
*
|
||||
*
|
||||
* 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 ***** */
|
||||
|
||||
#ifndef nsPDECommon_h___
|
||||
#define nsPDECommon_h___
|
||||
|
||||
|
||||
#define kPDE_Creator 'MOZZ'
|
||||
|
||||
|
||||
typedef struct {
|
||||
Boolean mHaveSelection;
|
||||
Boolean mHaveFrames;
|
||||
Boolean mHaveFrameSelected;
|
||||
Boolean mPrintSelection;
|
||||
Boolean mPrintFrameAsIs;
|
||||
Boolean mPrintSelectedFrame;
|
||||
Boolean mPrintFramesSeperatly;
|
||||
Boolean mShrinkToFit;
|
||||
} nsPrintExtensions;
|
||||
|
||||
|
||||
|
||||
#define kPrintTitlesDefault false // the initial default value of our page format custom data
|
||||
|
||||
// Our tag for the Print Settings ticket. This should be defined in an application
|
||||
// header that is common to this file and the applications' files so that it
|
||||
// can get access to the data set in the Print Settings.
|
||||
#define kAppPrintDialogPDEOnlyKey CFSTR("com.apple.print.PrintSettingsTicket.MOZZ")
|
||||
|
||||
#define kPrintSelectionOnlyDefault false // the initial default value of custom print settings custom data
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
@@ -1,107 +0,0 @@
|
||||
/* -*- Mode: c++; tab-width: 2; indent-tabs-mode: nil; -*- */
|
||||
/* ***** 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.org 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):
|
||||
*
|
||||
*
|
||||
* 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 ***** */
|
||||
|
||||
|
||||
#ifndef WatchTask_h__
|
||||
#define WatchTask_h__
|
||||
|
||||
|
||||
#ifndef XP_MACOSX
|
||||
#include <Retrace.h>
|
||||
#endif
|
||||
#include <Quickdraw.h>
|
||||
#include "prtypes.h"
|
||||
#include "nscore.h"
|
||||
|
||||
|
||||
//
|
||||
// class nsWatchTask
|
||||
//
|
||||
// A nice little class that installs/removes a VBL to set the cursor to
|
||||
// the watch if we're away from the event loop for a while. Will also
|
||||
// animate the watch cursor.
|
||||
//
|
||||
|
||||
class nsWatchTask
|
||||
{
|
||||
public:
|
||||
nsWatchTask ( ) ;
|
||||
~nsWatchTask ( ) ;
|
||||
|
||||
// Registers the VBL task and does other various init tasks to begin
|
||||
// watching for time away from the event loop. It is ok to call other
|
||||
// methods on this object w/out calling Start().
|
||||
NS_GFX void Start ( ) ;
|
||||
|
||||
// call from the main event loop
|
||||
NS_GFX void EventLoopReached ( ) ;
|
||||
|
||||
// turn off when we know we're going into an area where it's ok
|
||||
// that WNE is not called (eg, the menu code)
|
||||
void Suspend ( ) { mSuspended = PR_TRUE; };
|
||||
void Resume ( ) { mSuspended = PR_FALSE; };
|
||||
|
||||
static NS_GFX nsWatchTask& GetTask ( ) ;
|
||||
|
||||
private:
|
||||
|
||||
enum {
|
||||
kRepeatInterval = 10, // check every 1/6 of a second if we should show watch (10/60)
|
||||
kTicksToShowWatch = 45, // show watch if haven't seen WNE for 3/4 second (45/60)
|
||||
kStepsInAnimation = 12
|
||||
};
|
||||
|
||||
// the VBL task
|
||||
static pascal void DoWatchTask(nsWatchTask* theTaskPtr) ;
|
||||
|
||||
#if !TARGET_CARBON
|
||||
VBLTask mTask; // this must be first!!
|
||||
#endif
|
||||
long mChecksum; // 'mozz' to validate we have real data at interrupt time (not needed?)
|
||||
void* mSelf; // so we can get back to |this| from the static routine
|
||||
long mTicks; // last time the event loop was hit
|
||||
Cursor mWatchCursor; // the watch cursor
|
||||
PRPackedBool mBusy; // are we currently spinning the cursor?
|
||||
PRPackedBool mSuspended; // set if we've temporarily suspended operation
|
||||
PRPackedBool mInstallSucceeded; // did we succeed in installing the task? (used in dtor)
|
||||
short mAnimation; // stage of animation
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
@@ -1,56 +0,0 @@
|
||||
/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* 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 the Mozilla browser.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape
|
||||
* Communications, Inc. Portions created by Netscape are
|
||||
* Copyright (C) 1999, Mozilla. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef nsPrintSettingsMac_h__
|
||||
#define nsPrintSettingsMac_h__
|
||||
|
||||
#include "nsPrintSettingsImpl.h"
|
||||
#include "nsIPrintSettingsMac.h"
|
||||
#include <Printing.h>
|
||||
|
||||
|
||||
//*****************************************************************************
|
||||
//*** nsPrintSettingsMac
|
||||
//*****************************************************************************
|
||||
#if !TARGET_CARBON
|
||||
|
||||
class nsPrintSettingsMac : public nsPrintSettings,
|
||||
public nsIPrintSettingsMac
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
NS_DECL_NSIPRINTSETTINGSMAC
|
||||
|
||||
nsPrintSettingsMac();
|
||||
virtual ~nsPrintSettingsMac();
|
||||
|
||||
nsresult Init();
|
||||
|
||||
protected:
|
||||
|
||||
THPrint mPrintRecord;
|
||||
|
||||
};
|
||||
|
||||
#endif /* TARGET_CARBON */
|
||||
|
||||
#endif /* nsPrintSettingsMac_h__ */
|
||||
@@ -1,50 +0,0 @@
|
||||
/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* 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 the Mozilla browser.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape
|
||||
* Communications, Inc. Portions created by Netscape are
|
||||
* Copyright (C) 1999, Mozilla. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef nsPrintSettingsX_h__
|
||||
#define nsPrintSettingsX_h__
|
||||
|
||||
#include "nsPrintSettingsImpl.h"
|
||||
#include "nsIPrintSettingsX.h"
|
||||
|
||||
//*****************************************************************************
|
||||
//*** nsPrintSettingsX
|
||||
//*****************************************************************************
|
||||
|
||||
class nsPrintSettingsX : public nsPrintSettings,
|
||||
public nsIPrintSettingsX
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
NS_DECL_NSIPRINTSETTINGSX
|
||||
|
||||
nsPrintSettingsX();
|
||||
virtual ~nsPrintSettingsX();
|
||||
|
||||
nsresult Init();
|
||||
|
||||
protected:
|
||||
PMPageFormat mPageFormat;
|
||||
PMPrintSettings mPrintSettings;
|
||||
};
|
||||
|
||||
#endif /* nsPrintSettingsX_h__ */
|
||||
@@ -786,8 +786,6 @@ nsObjectFrame::CreateWidget(nsIPresContext* aPresContext,
|
||||
view->GetWidget(*getter_AddRefs(win));
|
||||
if (win)
|
||||
win->SetBackgroundColor(color->mBackgroundColor);
|
||||
else
|
||||
NS_ASSERTION(win, "failed to get widget to set background color on");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1400,7 +1398,7 @@ nsObjectFrame::ContentChanged(nsIPresContext* aPresContext,
|
||||
return rv;
|
||||
}
|
||||
|
||||
nsresult nsObjectFrame::GetWindowOriginInPixels(nsIPresContext * aPresContext, nsPoint * aOrigin)
|
||||
nsresult nsObjectFrame::GetWindowOriginInPixels(nsIPresContext * aPresContext, PRBool aWindowless, nsPoint * aOrigin)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aPresContext);
|
||||
NS_ENSURE_ARG_POINTER(aOrigin);
|
||||
@@ -1411,6 +1409,29 @@ nsresult nsObjectFrame::GetWindowOriginInPixels(nsIPresContext * aPresContext, n
|
||||
|
||||
GetOffsetFromView(aPresContext, origin, &parentWithView);
|
||||
|
||||
// if it's windowless, let's make sure we have our origin set right
|
||||
// it may need to be corrected, like after scrolling
|
||||
if (aWindowless && parentWithView) {
|
||||
nsPoint correction(0,0);
|
||||
nsCOMPtr<nsIViewManager> parentVM;
|
||||
parentWithView->GetViewManager(*getter_AddRefs(parentVM));
|
||||
|
||||
// Walk up all the views and add up their positions. This will give us our
|
||||
// absolute position which is what we want to give the plugin
|
||||
nsIView* theView = parentWithView;
|
||||
while (theView) {
|
||||
nsCOMPtr<nsIViewManager> vm;
|
||||
theView->GetViewManager(*getter_AddRefs(vm));
|
||||
if (vm != parentVM)
|
||||
break;
|
||||
|
||||
theView->GetPosition(&correction.x, &correction.y);
|
||||
origin += correction;
|
||||
|
||||
theView->GetParent(theView);
|
||||
}
|
||||
}
|
||||
|
||||
float t2p;
|
||||
aPresContext->GetTwipsToPixels(&t2p);
|
||||
aOrigin->x = NSTwipsToIntPixels(origin.x, t2p);
|
||||
@@ -1461,7 +1482,7 @@ nsObjectFrame::DidReflow(nsIPresContext* aPresContext,
|
||||
return rv;
|
||||
|
||||
nsPoint origin;
|
||||
GetWindowOriginInPixels(aPresContext, &origin);
|
||||
GetWindowOriginInPixels(aPresContext, windowless, &origin);
|
||||
|
||||
window->x = origin.x;
|
||||
window->y = origin.y;
|
||||
@@ -1683,6 +1704,15 @@ nsObjectFrame::Paint(nsIPresContext* aPresContext,
|
||||
doupdatewindow = PR_TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Layout now has an optimized way of painting. Now we always get
|
||||
* a new drawing surface, sized to be just what's needed. Windowsless
|
||||
* plugins need a transform applied to their origin so they paint
|
||||
* in the right place. Since |SetWindow| is no longer being used
|
||||
* to tell the plugin where it is, we dispatch a NPWindow through
|
||||
* |HandleEvent| to tell the plugin when its window moved
|
||||
*/
|
||||
|
||||
// Get the offset of the DC
|
||||
nsTransform2D* rcTransform;
|
||||
aRenderingContext.GetCurrentTransform(rcTransform);
|
||||
@@ -1695,8 +1725,62 @@ nsObjectFrame::Paint(nsIPresContext* aPresContext,
|
||||
doupdatewindow = PR_TRUE;
|
||||
}
|
||||
|
||||
if(doupdatewindow)
|
||||
inst->SetWindow(window);
|
||||
// if our location or visible area has changed, we need to tell the plugin
|
||||
if(doupdatewindow) {
|
||||
#ifdef XP_WIN // Windowless plugins on windows need a special event to update their location, see bug 135737
|
||||
|
||||
// first, lets find out how big the window is, in pixels
|
||||
nsCOMPtr<nsIPresShell> shell;
|
||||
nsCOMPtr<nsIViewManager> vm;
|
||||
aPresContext->GetShell(getter_AddRefs(shell));
|
||||
if (shell) {
|
||||
shell->GetViewManager(getter_AddRefs(vm));
|
||||
if (vm) {
|
||||
nsIView* view;
|
||||
vm->GetRootView(view);
|
||||
if (view) {
|
||||
nsCOMPtr<nsIWidget> win;
|
||||
view->GetWidget(*getter_AddRefs(win));
|
||||
if (win) {
|
||||
nsRect visibleRect;
|
||||
win->GetBounds(visibleRect);
|
||||
|
||||
// next, get our plugin's rect so we can intersect it with the visible rect so we
|
||||
// can tell the plugin where and how much to paint
|
||||
GetWindowOriginInPixels(aPresContext, window->type, &origin);
|
||||
nsRect winlessRect = nsRect(origin, nsSize(window->width, window->height));
|
||||
winlessRect.IntersectRect(winlessRect, visibleRect);
|
||||
|
||||
// now check our cached window and only update plugin if something has changed
|
||||
if (mWindowlessRect != winlessRect) {
|
||||
mWindowlessRect = winlessRect;
|
||||
|
||||
WINDOWPOS winpos;
|
||||
memset(&winpos, 0, sizeof(winpos));
|
||||
winpos.x = mWindowlessRect.x;
|
||||
winpos.y = mWindowlessRect.y;
|
||||
winpos.cx = mWindowlessRect.width;
|
||||
winpos.cy = mWindowlessRect.height;
|
||||
|
||||
// finally, update the plugin by sending it a WM_WINDOWPOSCHANGED event
|
||||
nsPluginEvent pluginEvent;
|
||||
pluginEvent.event = 0x0047;
|
||||
pluginEvent.wParam = 0;
|
||||
pluginEvent.lParam = (uint32)&winpos;
|
||||
PRBool eventHandled = PR_FALSE;
|
||||
|
||||
inst->HandleEvent(&pluginEvent, &eventHandled);
|
||||
|
||||
mInstanceOwner->ReleasePluginPort((nsPluginPort *)winpos.hwnd);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
inst->SetWindow(window);
|
||||
}
|
||||
|
||||
mInstanceOwner->Paint(aDirtyRect, hdc);
|
||||
}
|
||||
|
||||
@@ -161,13 +161,14 @@ protected:
|
||||
|
||||
nsresult NotifyContentObjectWrapper();
|
||||
|
||||
nsresult GetWindowOriginInPixels(nsIPresContext * aPresContext, nsPoint* aOrigin);
|
||||
nsresult GetWindowOriginInPixels(nsIPresContext * aPresContext, PRBool aWindoless, nsPoint* aOrigin);
|
||||
|
||||
private:
|
||||
nsPluginInstanceOwner *mInstanceOwner;
|
||||
nsIURI *mFullURL;
|
||||
nsIFrame *mFirstChild;
|
||||
nsIWidget *mWidget;
|
||||
nsRect mWindowlessRect;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
/* -*- 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.org 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):
|
||||
*
|
||||
* 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 ***** */
|
||||
#ifndef nsTextFrame_h___
|
||||
#define nsTextFrame_h___
|
||||
|
||||
extern PRBool
|
||||
BinarySearchForPosition(nsIRenderingContext* acx,
|
||||
const PRUnichar* aText,
|
||||
PRInt32 aBaseWidth,
|
||||
PRInt32 aBaseInx,
|
||||
PRInt32 aStartInx,
|
||||
PRInt32 aEndInx,
|
||||
PRInt32 aCursorPos,
|
||||
PRInt32& aIndex,
|
||||
PRInt32& aTextWidth);
|
||||
|
||||
#endif /* nsTextFrame_h___ */
|
||||
@@ -1,744 +0,0 @@
|
||||
<html>
|
||||
<body>
|
||||
<table border>
|
||||
<tr valign="top">
|
||||
<td>x</td>
|
||||
<td>
|
||||
<!-- this font, and the malformed table below trigger the bug -->
|
||||
<font face="Arial, sans-serif" size="-1">
|
||||
<table border>
|
||||
<tr>
|
||||
<td width="10"> </td>
|
||||
<td width="443" valign="top" align="left">
|
||||
<tr>
|
||||
<td>Search again...</td>
|
||||
</tr>
|
||||
<table>
|
||||
<tr>
|
||||
This text node only exists once in the original document!
|
||||
If it were a large collection of inlines, the page would
|
||||
hang forever.
|
||||
|
||||
<A NAME="Top_Of_Page"></A>
|
||||
<H2><A NAME="ToC">Table of Contents</A></H2>
|
||||
<P><B><A NAME="ToC_1" HREF="whatever.html">Introduction</A></B><BR>
|
||||
<BR><A NAME="ToC_2" HREF="whatever.html">Who Should Use This Book</A>
|
||||
<BR><A NAME="ToC_3" HREF="whatever.html">How To Use This Book</A>
|
||||
<BR><A NAME="ToC_4" HREF="whatever.html">How This Book is Structured</A>
|
||||
<BR><A NAME="ToC_5" HREF="whatever.html">How to Read the Syntax Diagrams</A>
|
||||
<BR><A NAME="ToC_6" HREF="whatever.html">Conventions Used in This Manual</A>
|
||||
<BR><A NAME="ToC_7" HREF="whatever.html">Error Conditions</A>
|
||||
<BR><A NAME="ToC_8" HREF="whatever.html">Highlighting Conventions</A>
|
||||
<BR><A NAME="ToC_9" HREF="whatever.html">Related Documentation for This Book</A>
|
||||
<P><B><A NAME="ToC_10" HREF="whatever.html">Concepts</A></B><BR>
|
||||
<BR><A NAME="ToC_11" HREF="whatever.html">Relational Database</A>
|
||||
<BR><A NAME="ToC_12" HREF="whatever.html">Structured Query Language (SQL)</A>
|
||||
<BR><A NAME="ToC_13" HREF="whatever.html">Embedded SQL</A>
|
||||
<BR><A NAME="ToC_14" HREF="whatever.html">Static SQL</A>
|
||||
<BR><A NAME="ToC_15" HREF="whatever.html">Dynamic SQL</A>
|
||||
<BR><A NAME="ToC_16" HREF="whatever.html">DB2 Call Level Interface (CLI) & Open Database Connectivity (ODBC)</A>
|
||||
<BR><A NAME="ToC_17" HREF="whatever.html">Java Database Connectivity (JDBC) and Embedded SQL for Java (SQLJ) Programs</A>
|
||||
<BR><A NAME="ToC_18" HREF="whatever.html">Interactive SQL</A>
|
||||
<BR><A NAME="ToC_19" HREF="whatever.html">Schemas</A>
|
||||
<BR><A NAME="ToC_20" HREF="whatever.html">Controlling Use of Schemas</A>
|
||||
<BR><A NAME="ToC_21" HREF="whatever.html">Tables</A>
|
||||
<BR><A NAME="ToC_22" HREF="whatever.html">Views</A>
|
||||
<BR><A NAME="ToC_23" HREF="whatever.html">Aliases</A>
|
||||
<BR><A NAME="ToC_24" HREF="whatever.html">Indexes</A>
|
||||
<BR><A NAME="ToC_25" HREF="whatever.html">Keys</A>
|
||||
<BR><A NAME="ToC_26" HREF="whatever.html">Unique Keys</A>
|
||||
<BR><A NAME="ToC_27" HREF="whatever.html">Primary Keys</A>
|
||||
<BR><A NAME="ToC_28" HREF="whatever.html">Foreign Keys</A>
|
||||
<BR><A NAME="ToC_29" HREF="whatever.html">Partitioning Keys</A>
|
||||
<BR><A NAME="ToC_30" HREF="whatever.html">Constraints</A>
|
||||
<BR><A NAME="ToC_31" HREF="whatever.html">Unique Constraints</A>
|
||||
<BR><A NAME="ToC_32" HREF="whatever.html">Referential Constraints</A>
|
||||
<BR><A NAME="ToC_36" HREF="whatever.html">Table Check Constraints</A>
|
||||
<BR><A NAME="ToC_37" HREF="whatever.html">Triggers</A>
|
||||
<BR><A NAME="ToC_38" HREF="whatever.html">Event Monitors</A>
|
||||
<BR><A NAME="ToC_39" HREF="whatever.html">Queries</A>
|
||||
<BR><A NAME="ToC_40" HREF="whatever.html">Table Expressions</A>
|
||||
<BR><A NAME="ToC_41" HREF="whatever.html">Common Table Expressions</A>
|
||||
<BR><A NAME="ToC_42" HREF="whatever.html">Packages</A>
|
||||
<BR><A NAME="ToC_43" HREF="whatever.html">Catalog Views</A>
|
||||
<BR><A NAME="ToC_44" HREF="whatever.html">Application Processes, Concurrency, and Recovery</A>
|
||||
<BR><A NAME="ToC_45" HREF="whatever.html">Isolation Level</A>
|
||||
<BR><A NAME="ToC_46" HREF="whatever.html">Repeatable Read (RR)</A>
|
||||
<BR><A NAME="ToC_47" HREF="whatever.html">Read Stability (RS)</A>
|
||||
<BR><A NAME="ToC_48" HREF="whatever.html">Cursor Stability (CS)</A>
|
||||
<BR><A NAME="ToC_49" HREF="whatever.html">Uncommitted Read (UR)</A>
|
||||
<BR><A NAME="ToC_50" HREF="whatever.html">Comparison of Isolation Levels</A>
|
||||
<BR><A NAME="ToC_51" HREF="whatever.html">Distributed Relational Database</A>
|
||||
<BR><A NAME="ToC_52" HREF="whatever.html">Application Servers</A>
|
||||
<BR><A NAME="ToC_53" HREF="whatever.html">CONNECT (Type 1) and CONNECT (Type 2)</A>
|
||||
<BR><A NAME="ToC_54" HREF="whatever.html">Remote Unit of Work</A>
|
||||
<BR><A NAME="ToC_56" HREF="whatever.html">Application-Directed Distributed Unit of Work</A>
|
||||
<BR><A NAME="ToC_64" HREF="whatever.html">Data Representation Considerations</A>
|
||||
<BR><A NAME="ToC_65" HREF="whatever.html">DB2 Federated Systems</A>
|
||||
<BR><A NAME="ToC_66" HREF="whatever.html">The Federated Server, Federated Database, and Data Sources</A>
|
||||
<BR><A NAME="ToC_67" HREF="whatever.html">Tasks to Perform in a DB2 Federated System</A>
|
||||
<BR><A NAME="ToC_68" HREF="whatever.html">Wrappers and Wrapper Modules</A>
|
||||
<BR><A NAME="ToC_69" HREF="whatever.html">Server Definitions and Server Options</A>
|
||||
<BR><A NAME="ToC_73" HREF="whatever.html">User Mappings and User Options</A>
|
||||
<BR><A NAME="ToC_74" HREF="whatever.html">Data Type Mappings</A>
|
||||
<BR><A NAME="ToC_75" HREF="whatever.html">Function Mappings, Function Templates, and Function Mapping Options</A>
|
||||
<BR><A NAME="ToC_76" HREF="whatever.html">Nicknames and Column Options</A>
|
||||
<BR><A NAME="ToC_77" HREF="whatever.html">Index Specifications</A>
|
||||
<BR><A NAME="ToC_78" HREF="whatever.html">Distributed Requests</A>
|
||||
<BR><A NAME="ToC_81" HREF="whatever.html">Compensation</A>
|
||||
<BR><A NAME="ToC_82" HREF="whatever.html">Pass-Through</A>
|
||||
<BR><A NAME="ToC_83" HREF="whatever.html">Character Conversion</A>
|
||||
<BR><A NAME="ToC_84" HREF="whatever.html">Character Sets and Code Pages</A>
|
||||
<BR><A NAME="ToC_85" HREF="whatever.html">Code Page Attributes</A>
|
||||
<BR><A NAME="ToC_87" HREF="whatever.html">Authorization and Privileges</A>
|
||||
<BR><A NAME="ToC_88" HREF="whatever.html">Table Spaces and Other Storage Structures</A>
|
||||
<BR><A NAME="ToC_89" HREF="whatever.html">Data Partitioning Across Multiple Partitions</A>
|
||||
<BR><A NAME="ToC_90" HREF="whatever.html">Partitioning Maps</A>
|
||||
<BR><A NAME="ToC_91" HREF="whatever.html">Table Collocation</A>
|
||||
<P><B><A NAME="ToC_92" HREF="whatever.html">Language Elements</A></B><BR>
|
||||
<BR><A NAME="ToC_93" HREF="whatever.html">Characters</A>
|
||||
<BR><A NAME="ToC_94" HREF="whatever.html">MBCS Considerations</A>
|
||||
<BR><A NAME="ToC_95" HREF="whatever.html">Tokens</A>
|
||||
<BR><A NAME="ToC_96" HREF="whatever.html">MBCS Considerations</A>
|
||||
<BR><A NAME="ToC_97" HREF="whatever.html">Identifiers</A>
|
||||
<BR><A NAME="ToC_98" HREF="whatever.html">SQL Identifiers</A>
|
||||
<BR><A NAME="ToC_99" HREF="whatever.html">Host Identifiers</A>
|
||||
<BR><A NAME="ToC_100" HREF="whatever.html">Naming Conventions and Implicit Object Name Qualifications</A>
|
||||
<BR><A NAME="ToC_101" HREF="whatever.html">Aliases</A>
|
||||
<BR><A NAME="ToC_102" HREF="whatever.html">Authorization IDs and authorization-names</A>
|
||||
<BR><A NAME="ToC_103" HREF="whatever.html">Dynamic SQL Characteristics at run-time</A>
|
||||
<BR><A NAME="ToC_104" HREF="whatever.html">Authorization IDs and Statement Preparation</A>
|
||||
<BR><A NAME="ToC_105" HREF="whatever.html">Data Types</A>
|
||||
<BR><A NAME="ToC_106" HREF="whatever.html">Nulls</A>
|
||||
<BR><A NAME="ToC_107" HREF="whatever.html">Large Objects (LOBs)</A>
|
||||
<BR><A NAME="ToC_112" HREF="whatever.html">Character Strings</A>
|
||||
<BR><A NAME="ToC_119" HREF="whatever.html">Graphic Strings</A>
|
||||
<BR><A NAME="ToC_123" HREF="whatever.html">Binary String</A>
|
||||
<BR><A NAME="ToC_124" HREF="whatever.html">Numbers</A>
|
||||
<BR><A NAME="ToC_131" HREF="whatever.html">Datetime Values</A>
|
||||
<BR><A NAME="ToC_140" HREF="whatever.html">DATALINK Values</A>
|
||||
<BR><A NAME="ToC_141" HREF="whatever.html">User Defined Types</A>
|
||||
<BR><A NAME="ToC_145" HREF="whatever.html">Promotion of Data Types</A>
|
||||
<BR><A NAME="ToC_146" HREF="whatever.html">Casting Between Data Types</A>
|
||||
<BR><A NAME="ToC_147" HREF="whatever.html">Assignments and Comparisons</A>
|
||||
<BR><A NAME="ToC_148" HREF="whatever.html">Numeric Assignments</A>
|
||||
<BR><A NAME="ToC_154" HREF="whatever.html">String Assignments</A>
|
||||
<BR><A NAME="ToC_160" HREF="whatever.html">Datetime Assignments</A>
|
||||
<BR><A NAME="ToC_161" HREF="whatever.html">DATALINK Assignments</A>
|
||||
<BR><A NAME="ToC_162" HREF="whatever.html">User-defined Type Assignments</A>
|
||||
<BR><A NAME="ToC_163" HREF="whatever.html">Reference Type Assignments</A>
|
||||
<BR><A NAME="ToC_164" HREF="whatever.html">Numeric Comparisons</A>
|
||||
<BR><A NAME="ToC_165" HREF="whatever.html">String Comparisons</A>
|
||||
<BR><A NAME="ToC_169" HREF="whatever.html">Datetime Comparisons</A>
|
||||
<BR><A NAME="ToC_170" HREF="whatever.html">User-defined Type Comparisons</A>
|
||||
<BR><A NAME="ToC_171" HREF="whatever.html">Reference Type Comparisons</A>
|
||||
<BR><A NAME="ToC_172" HREF="whatever.html">Rules for Result Data Types</A>
|
||||
<BR><A NAME="ToC_173" HREF="whatever.html">Character Strings</A>
|
||||
<BR><A NAME="ToC_174" HREF="whatever.html">Graphic Strings</A>
|
||||
<BR><A NAME="ToC_175" HREF="whatever.html">Binary Large Object (BLOB)</A>
|
||||
<BR><A NAME="ToC_176" HREF="whatever.html">Numeric</A>
|
||||
<BR><A NAME="ToC_177" HREF="whatever.html">DATE</A>
|
||||
<BR><A NAME="ToC_178" HREF="whatever.html">TIME</A>
|
||||
<BR><A NAME="ToC_179" HREF="whatever.html">TIMESTAMP</A>
|
||||
<BR><A NAME="ToC_180" HREF="whatever.html">DATALINK</A>
|
||||
<BR><A NAME="ToC_181" HREF="whatever.html">User-defined Types</A>
|
||||
<BR><A NAME="ToC_185" HREF="whatever.html">Nullable Attribute of Result</A>
|
||||
<BR><A NAME="ToC_186" HREF="whatever.html">Rules for String Conversions</A>
|
||||
<BR><A NAME="ToC_187" HREF="whatever.html">Partition Compatibility</A>
|
||||
<BR><A NAME="ToC_188" HREF="whatever.html">Constants</A>
|
||||
<BR><A NAME="ToC_189" HREF="whatever.html">Integer Constants</A>
|
||||
<BR><A NAME="ToC_190" HREF="whatever.html">Floating-Point Constants</A>
|
||||
<BR><A NAME="ToC_191" HREF="whatever.html">Decimal Constants</A>
|
||||
<BR><A NAME="ToC_192" HREF="whatever.html">Character String Constants</A>
|
||||
<BR><A NAME="ToC_194" HREF="whatever.html">Hexadecimal Constants</A>
|
||||
<BR><A NAME="ToC_195" HREF="whatever.html">Graphic String Constants</A>
|
||||
<BR><A NAME="ToC_197" HREF="whatever.html">Using Constants with User-defined Types</A>
|
||||
<BR><A NAME="ToC_198" HREF="whatever.html">Special Registers</A>
|
||||
<BR><A NAME="ToC_199" HREF="whatever.html">CURRENT DATE</A>
|
||||
<BR><A NAME="ToC_201" HREF="whatever.html">CURRENT DEFAULT TRANSFORM GROUP</A>
|
||||
<BR><A NAME="ToC_203" HREF="whatever.html">CURRENT DEGREE</A>
|
||||
<BR><A NAME="ToC_204" HREF="whatever.html">CURRENT EXPLAIN MODE</A>
|
||||
<BR><A NAME="ToC_205" HREF="whatever.html">CURRENT EXPLAIN SNAPSHOT</A>
|
||||
<BR><A NAME="ToC_207" HREF="whatever.html">CURRENT NODE</A>
|
||||
<BR><A NAME="ToC_209" HREF="whatever.html">CURRENT PATH</A>
|
||||
<BR><A NAME="ToC_211" HREF="whatever.html">CURRENT QUERY OPTIMIZATION</A>
|
||||
<BR><A NAME="ToC_213" HREF="whatever.html">CURRENT REFRESH AGE</A>
|
||||
<BR><A NAME="ToC_214" HREF="whatever.html">CURRENT SCHEMA</A>
|
||||
<BR><A NAME="ToC_216" HREF="whatever.html">CURRENT SERVER</A>
|
||||
<BR><A NAME="ToC_218" HREF="whatever.html">CURRENT TIME</A>
|
||||
<BR><A NAME="ToC_220" HREF="whatever.html">CURRENT TIMESTAMP</A>
|
||||
<BR><A NAME="ToC_222" HREF="whatever.html">CURRENT TIMEZONE</A>
|
||||
<BR><A NAME="ToC_224" HREF="whatever.html">USER</A>
|
||||
<BR><A NAME="ToC_226" HREF="whatever.html">Column Names</A>
|
||||
<BR><A NAME="ToC_227" HREF="whatever.html">Qualified Column Names</A>
|
||||
<BR><A NAME="ToC_228" HREF="whatever.html">Correlation Names</A>
|
||||
<BR><A NAME="ToC_229" HREF="whatever.html">Column Name Qualifiers to Avoid Ambiguity</A>
|
||||
<BR><A NAME="ToC_232" HREF="whatever.html">Column Name Qualifiers in Correlated References</A>
|
||||
<BR><A NAME="ToC_233" HREF="whatever.html">References to Host Variables</A>
|
||||
<BR><A NAME="ToC_234" HREF="whatever.html">Host Variables in Dynamic SQL</A>
|
||||
<BR><A NAME="ToC_236" HREF="whatever.html">References to BLOB, CLOB, and DBCLOB Host Variables</A>
|
||||
<BR><A NAME="ToC_237" HREF="whatever.html">References to Locator Variables</A>
|
||||
<BR><A NAME="ToC_238" HREF="whatever.html">References to BLOB, CLOB, and DBCLOB File Reference Variables</A>
|
||||
<BR><A NAME="ToC_241" HREF="whatever.html">References to Structured Type Host Variables</A>
|
||||
<BR><A NAME="ToC_243" HREF="whatever.html">Functions</A>
|
||||
<BR><A NAME="ToC_244" HREF="whatever.html">External, SQL and Sourced User-Defined Functions</A>
|
||||
<BR><A NAME="ToC_245" HREF="whatever.html">Scalar, Column, Row and Table User-Defined Functions</A>
|
||||
<BR><A NAME="ToC_246" HREF="whatever.html">Function signatures</A>
|
||||
<BR><A NAME="ToC_247" HREF="whatever.html">SQL Path</A>
|
||||
<BR><A NAME="ToC_248" HREF="whatever.html">Function Resolution</A>
|
||||
<BR><A NAME="ToC_252" HREF="whatever.html">Function Invocation</A>
|
||||
<BR><A NAME="ToC_253" HREF="whatever.html">Methods</A>
|
||||
<BR><A NAME="ToC_254" HREF="whatever.html">External and SQL User-Defined Methods</A>
|
||||
<BR><A NAME="ToC_255" HREF="whatever.html">Method Signatures</A>
|
||||
<BR><A NAME="ToC_256" HREF="whatever.html">Method Invocation</A>
|
||||
<BR><A NAME="ToC_257" HREF="whatever.html">Method Resolution</A>
|
||||
<BR><A NAME="ToC_258" HREF="whatever.html">Method of Choosing the Best Fit</A>
|
||||
<BR><A NAME="ToC_259" HREF="whatever.html">Example of Method Resolution</A>
|
||||
<BR><A NAME="ToC_260" HREF="whatever.html">Method Invocation</A>
|
||||
<BR><A NAME="ToC_261" HREF="whatever.html">Conservative Binding Semantics</A>
|
||||
<BR><A NAME="ToC_262" HREF="whatever.html">Expressions</A>
|
||||
<BR><A NAME="ToC_263" HREF="whatever.html">Without Operators</A>
|
||||
<BR><A NAME="ToC_264" HREF="whatever.html">With the Concatenation Operator</A>
|
||||
<BR><A NAME="ToC_266" HREF="whatever.html">With Arithmetic Operators</A>
|
||||
<BR><A NAME="ToC_268" HREF="whatever.html">Two Integer Operands</A>
|
||||
<BR><A NAME="ToC_269" HREF="whatever.html">Integer and Decimal Operands</A>
|
||||
<BR><A NAME="ToC_270" HREF="whatever.html">Two Decimal Operands</A>
|
||||
<BR><A NAME="ToC_271" HREF="whatever.html">Decimal Arithmetic in SQL</A>
|
||||
<BR><A NAME="ToC_275" HREF="whatever.html">Floating-Point Operands</A>
|
||||
<BR><A NAME="ToC_276" HREF="whatever.html">User-defined Types as Operands</A>
|
||||
<BR><A NAME="ToC_277" HREF="whatever.html">Scalar Fullselect</A>
|
||||
<BR><A NAME="ToC_278" HREF="whatever.html">Datetime Operations and Durations</A>
|
||||
<BR><A NAME="ToC_283" HREF="whatever.html">Datetime Arithmetic in SQL</A>
|
||||
<BR><A NAME="ToC_293" HREF="whatever.html">Precedence of Operations</A>
|
||||
<BR><A NAME="ToC_294" HREF="whatever.html">CASE Expressions</A>
|
||||
<BR><A NAME="ToC_296" HREF="whatever.html">CAST Specifications</A>
|
||||
<BR><A NAME="ToC_298" HREF="whatever.html">Dereference Operations</A>
|
||||
<BR><A NAME="ToC_300" HREF="whatever.html">OLAP Functions</A>
|
||||
<BR><A NAME="ToC_302" HREF="whatever.html">Method Invocation</A>
|
||||
<BR><A NAME="ToC_304" HREF="whatever.html">Subtype Treatment</A>
|
||||
<BR><A NAME="ToC_306" HREF="whatever.html">Predicates</A>
|
||||
<BR><A NAME="ToC_307" HREF="whatever.html">Basic Predicate</A>
|
||||
<BR><A NAME="ToC_308" HREF="whatever.html">Quantified Predicate</A>
|
||||
<BR><A NAME="ToC_309" HREF="whatever.html">BETWEEN Predicate</A>
|
||||
<BR><A NAME="ToC_310" HREF="whatever.html">EXISTS Predicate</A>
|
||||
<BR><A NAME="ToC_311" HREF="whatever.html">IN Predicate</A>
|
||||
<BR><A NAME="ToC_312" HREF="whatever.html">LIKE Predicate</A>
|
||||
<BR><A NAME="ToC_314" HREF="whatever.html">NULL Predicate</A>
|
||||
<BR><A NAME="ToC_315" HREF="whatever.html">TYPE Predicate</A>
|
||||
<BR><A NAME="ToC_316" HREF="whatever.html">Search Conditions</A>
|
||||
<BR><A NAME="ToC_317" HREF="whatever.html">Examples</A>
|
||||
<P><B><A NAME="ToC_318" HREF="whatever.html">Functions</A></B><BR>
|
||||
<BR><A NAME="ToC_319" HREF="whatever.html">Column Functions</A>
|
||||
<BR><A NAME="ToC_320" HREF="whatever.html">AVG</A>
|
||||
<BR><A NAME="ToC_321" HREF="whatever.html">CORRELATION</A>
|
||||
<BR><A NAME="ToC_322" HREF="whatever.html">COUNT</A>
|
||||
<BR><A NAME="ToC_323" HREF="whatever.html">COUNT_BIG</A>
|
||||
<BR><A NAME="ToC_324" HREF="whatever.html">COVARIANCE</A>
|
||||
<BR><A NAME="ToC_325" HREF="whatever.html">GROUPING</A>
|
||||
<BR><A NAME="ToC_326" HREF="whatever.html">MAX</A>
|
||||
<BR><A NAME="ToC_327" HREF="whatever.html">MIN</A>
|
||||
<BR><A NAME="ToC_328" HREF="whatever.html">REGRESSION Functions</A>
|
||||
<BR><A NAME="ToC_329" HREF="whatever.html">STDDEV</A>
|
||||
<BR><A NAME="ToC_330" HREF="whatever.html">SUM</A>
|
||||
<BR><A NAME="ToC_331" HREF="whatever.html">VARIANCE</A>
|
||||
<BR><A NAME="ToC_332" HREF="whatever.html">Scalar Functions</A>
|
||||
<BR><A NAME="ToC_333" HREF="whatever.html">ABS or ABSVAL</A>
|
||||
<BR><A NAME="ToC_334" HREF="whatever.html">ACOS</A>
|
||||
<BR><A NAME="ToC_335" HREF="whatever.html">ASCII</A>
|
||||
<BR><A NAME="ToC_336" HREF="whatever.html">ASIN</A>
|
||||
<BR><A NAME="ToC_337" HREF="whatever.html">ATAN</A>
|
||||
<BR><A NAME="ToC_338" HREF="whatever.html">ATAN2</A>
|
||||
<BR><A NAME="ToC_339" HREF="whatever.html">BIGINT</A>
|
||||
<BR><A NAME="ToC_340" HREF="whatever.html">BLOB</A>
|
||||
<BR><A NAME="ToC_341" HREF="whatever.html">CEILING or CEIL</A>
|
||||
<BR><A NAME="ToC_342" HREF="whatever.html">CHAR</A>
|
||||
<BR><A NAME="ToC_343" HREF="whatever.html">CHR</A>
|
||||
<BR><A NAME="ToC_344" HREF="whatever.html">CLOB</A>
|
||||
<BR><A NAME="ToC_345" HREF="whatever.html">COALESCE</A>
|
||||
<BR><A NAME="ToC_346" HREF="whatever.html">CONCAT</A>
|
||||
<BR><A NAME="ToC_347" HREF="whatever.html">COS</A>
|
||||
<BR><A NAME="ToC_348" HREF="whatever.html">COT</A>
|
||||
<BR><A NAME="ToC_349" HREF="whatever.html">DATE</A>
|
||||
<BR><A NAME="ToC_350" HREF="whatever.html">DAY</A>
|
||||
<BR><A NAME="ToC_351" HREF="whatever.html">DAYNAME</A>
|
||||
<BR><A NAME="ToC_352" HREF="whatever.html">DAYOFWEEK</A>
|
||||
<BR><A NAME="ToC_353" HREF="whatever.html">DAYOFWEEK_ISO</A>
|
||||
<BR><A NAME="ToC_354" HREF="whatever.html">DAYOFYEAR</A>
|
||||
<BR><A NAME="ToC_355" HREF="whatever.html">DAYS</A>
|
||||
<BR><A NAME="ToC_356" HREF="whatever.html">DBCLOB</A>
|
||||
<BR><A NAME="ToC_357" HREF="whatever.html">DECIMAL</A>
|
||||
<BR><A NAME="ToC_358" HREF="whatever.html">DEGREES</A>
|
||||
<BR><A NAME="ToC_359" HREF="whatever.html">DEREF</A>
|
||||
<BR><A NAME="ToC_360" HREF="whatever.html">DIFFERENCE</A>
|
||||
<BR><A NAME="ToC_361" HREF="whatever.html">DIGITS</A>
|
||||
<BR><A NAME="ToC_362" HREF="whatever.html">DLCOMMENT</A>
|
||||
<BR><A NAME="ToC_363" HREF="whatever.html">DLLINKTYPE</A>
|
||||
<BR><A NAME="ToC_364" HREF="whatever.html">DLURLCOMPLETE</A>
|
||||
<BR><A NAME="ToC_365" HREF="whatever.html">DLURLPATH</A>
|
||||
<BR><A NAME="ToC_366" HREF="whatever.html">DLURLPATHONLY</A>
|
||||
<BR><A NAME="ToC_367" HREF="whatever.html">DLURLSCHEME</A>
|
||||
<BR><A NAME="ToC_368" HREF="whatever.html">DLURLSERVER</A>
|
||||
<BR><A NAME="ToC_369" HREF="whatever.html">DLVALUE</A>
|
||||
<BR><A NAME="ToC_370" HREF="whatever.html">DOUBLE</A>
|
||||
<BR><A NAME="ToC_371" HREF="whatever.html">EVENT_MON_STATE</A>
|
||||
<BR><A NAME="ToC_372" HREF="whatever.html">EXP</A>
|
||||
<BR><A NAME="ToC_373" HREF="whatever.html">FLOAT</A>
|
||||
<BR><A NAME="ToC_374" HREF="whatever.html">FLOOR</A>
|
||||
<BR><A NAME="ToC_375" HREF="whatever.html">GENERATE_UNIQUE</A>
|
||||
<BR><A NAME="ToC_376" HREF="whatever.html">GRAPHIC</A>
|
||||
<BR><A NAME="ToC_377" HREF="whatever.html">HEX</A>
|
||||
<BR><A NAME="ToC_378" HREF="whatever.html">HOUR</A>
|
||||
<BR><A NAME="ToC_379" HREF="whatever.html">INSERT</A>
|
||||
<BR><A NAME="ToC_380" HREF="whatever.html">INTEGER</A>
|
||||
<BR><A NAME="ToC_381" HREF="whatever.html">JULIAN_DAY</A>
|
||||
<BR><A NAME="ToC_382" HREF="whatever.html">LCASE or LOWER</A>
|
||||
<BR><A NAME="ToC_383" HREF="whatever.html">LCASE (SYSFUN schema)</A>
|
||||
<BR><A NAME="ToC_384" HREF="whatever.html">LEFT</A>
|
||||
<BR><A NAME="ToC_385" HREF="whatever.html">LENGTH</A>
|
||||
<BR><A NAME="ToC_386" HREF="whatever.html">LN</A>
|
||||
<BR><A NAME="ToC_387" HREF="whatever.html">LOCATE</A>
|
||||
<BR><A NAME="ToC_388" HREF="whatever.html">LOG</A>
|
||||
<BR><A NAME="ToC_389" HREF="whatever.html">LOG10</A>
|
||||
<BR><A NAME="ToC_390" HREF="whatever.html">LONG_VARCHAR</A>
|
||||
<BR><A NAME="ToC_391" HREF="whatever.html">LONG_VARGRAPHIC</A>
|
||||
<BR><A NAME="ToC_392" HREF="whatever.html">LTRIM</A>
|
||||
<BR><A NAME="ToC_393" HREF="whatever.html">LTRIM (SYSFUN schema)</A>
|
||||
<BR><A NAME="ToC_394" HREF="whatever.html">MICROSECOND</A>
|
||||
<BR><A NAME="ToC_395" HREF="whatever.html">MIDNIGHT_SECONDS</A>
|
||||
<BR><A NAME="ToC_396" HREF="whatever.html">MINUTE</A>
|
||||
<BR><A NAME="ToC_397" HREF="whatever.html">MOD</A>
|
||||
<BR><A NAME="ToC_398" HREF="whatever.html">MONTH</A>
|
||||
<BR><A NAME="ToC_399" HREF="whatever.html">MONTHNAME</A>
|
||||
<BR><A NAME="ToC_400" HREF="whatever.html">NODENUMBER</A>
|
||||
<BR><A NAME="ToC_401" HREF="whatever.html">NULLIF</A>
|
||||
<BR><A NAME="ToC_402" HREF="whatever.html">PARTITION</A>
|
||||
<BR><A NAME="ToC_403" HREF="whatever.html">POSSTR</A>
|
||||
<BR><A NAME="ToC_404" HREF="whatever.html">POWER</A>
|
||||
<BR><A NAME="ToC_405" HREF="whatever.html">QUARTER</A>
|
||||
<BR><A NAME="ToC_406" HREF="whatever.html">RADIANS</A>
|
||||
<BR><A NAME="ToC_407" HREF="whatever.html">RAISE_ERROR</A>
|
||||
<BR><A NAME="ToC_408" HREF="whatever.html">RAND</A>
|
||||
<BR><A NAME="ToC_409" HREF="whatever.html">REAL</A>
|
||||
<BR><A NAME="ToC_410" HREF="whatever.html">REPEAT</A>
|
||||
<BR><A NAME="ToC_411" HREF="whatever.html">REPLACE</A>
|
||||
<BR><A NAME="ToC_412" HREF="whatever.html">RIGHT</A>
|
||||
<BR><A NAME="ToC_413" HREF="whatever.html">ROUND</A>
|
||||
<BR><A NAME="ToC_414" HREF="whatever.html">RTRIM</A>
|
||||
<BR><A NAME="ToC_415" HREF="whatever.html">RTRIM (SYSFUN schema)</A>
|
||||
<BR><A NAME="ToC_416" HREF="whatever.html">SECOND</A>
|
||||
<BR><A NAME="ToC_417" HREF="whatever.html">SIGN</A>
|
||||
<BR><A NAME="ToC_418" HREF="whatever.html">SIN</A>
|
||||
<BR><A NAME="ToC_419" HREF="whatever.html">SMALLINT</A>
|
||||
<BR><A NAME="ToC_420" HREF="whatever.html">SOUNDEX</A>
|
||||
<BR><A NAME="ToC_421" HREF="whatever.html">SPACE</A>
|
||||
<BR><A NAME="ToC_422" HREF="whatever.html">SQRT</A>
|
||||
<BR><A NAME="ToC_423" HREF="whatever.html">SUBSTR</A>
|
||||
<BR><A NAME="ToC_424" HREF="whatever.html">TABLE_NAME</A>
|
||||
<BR><A NAME="ToC_425" HREF="whatever.html">TABLE_SCHEMA</A>
|
||||
<BR><A NAME="ToC_426" HREF="whatever.html">TAN</A>
|
||||
<BR><A NAME="ToC_427" HREF="whatever.html">TIME</A>
|
||||
<BR><A NAME="ToC_428" HREF="whatever.html">TIMESTAMP</A>
|
||||
<BR><A NAME="ToC_429" HREF="whatever.html">TIMESTAMP_ISO</A>
|
||||
<BR><A NAME="ToC_430" HREF="whatever.html">TIMESTAMPDIFF</A>
|
||||
<BR><A NAME="ToC_431" HREF="whatever.html">TRANSLATE</A>
|
||||
<BR><A NAME="ToC_432" HREF="whatever.html">TRUNCATE or TRUNC</A>
|
||||
<BR><A NAME="ToC_433" HREF="whatever.html">TYPE_ID</A>
|
||||
<BR><A NAME="ToC_434" HREF="whatever.html">TYPE_NAME</A>
|
||||
<BR><A NAME="ToC_435" HREF="whatever.html">TYPE_SCHEMA</A>
|
||||
<BR><A NAME="ToC_436" HREF="whatever.html">UCASE or UPPER</A>
|
||||
<BR><A NAME="ToC_437" HREF="whatever.html">VALUE</A>
|
||||
<BR><A NAME="ToC_438" HREF="whatever.html">VARCHAR</A>
|
||||
<BR><A NAME="ToC_439" HREF="whatever.html">VARGRAPHIC</A>
|
||||
<BR><A NAME="ToC_440" HREF="whatever.html">WEEK</A>
|
||||
<BR><A NAME="ToC_441" HREF="whatever.html">WEEK_ISO</A>
|
||||
<BR><A NAME="ToC_442" HREF="whatever.html">YEAR</A>
|
||||
<BR><A NAME="ToC_443" HREF="whatever.html">Table Functions</A>
|
||||
<BR><A NAME="ToC_444" HREF="whatever.html">SQLCACHE_SNAPSHOT</A>
|
||||
<BR><A NAME="ToC_445" HREF="whatever.html">User-Defined Functions</A>
|
||||
<P><B><A NAME="ToC_446" HREF="whatever.html">Queries</A></B><BR>
|
||||
<BR><A NAME="ToC_447" HREF="whatever.html">subselect</A>
|
||||
<BR><A NAME="ToC_448" HREF="whatever.html">select-clause</A>
|
||||
<BR><A NAME="ToC_457" HREF="whatever.html">from-clause</A>
|
||||
<BR><A NAME="ToC_458" HREF="whatever.html">table-reference</A>
|
||||
<BR><A NAME="ToC_461" HREF="whatever.html">joined-table</A>
|
||||
<BR><A NAME="ToC_463" HREF="whatever.html">where-clause</A>
|
||||
<BR><A NAME="ToC_464" HREF="whatever.html">group-by-clause</A>
|
||||
<BR><A NAME="ToC_468" HREF="whatever.html">having-clause</A>
|
||||
<BR><A NAME="ToC_469" HREF="whatever.html">Examples of subselects</A>
|
||||
<BR><A NAME="ToC_470" HREF="whatever.html">Examples of Joins</A>
|
||||
<BR><A NAME="ToC_471" HREF="whatever.html">Examples of Grouping Sets, Cube, and Rollup</A>
|
||||
<BR><A NAME="ToC_472" HREF="whatever.html">fullselect</A>
|
||||
<BR><A NAME="ToC_473" HREF="whatever.html">Examples of a fullselect</A>
|
||||
<BR><A NAME="ToC_474" HREF="whatever.html">select-statement</A>
|
||||
<BR><A NAME="ToC_475" HREF="whatever.html">common-table-expression</A>
|
||||
<BR><A NAME="ToC_476" HREF="whatever.html">order-by-clause</A>
|
||||
<BR><A NAME="ToC_478" HREF="whatever.html">update-clause</A>
|
||||
<BR><A NAME="ToC_479" HREF="whatever.html">read-only-clause</A>
|
||||
<BR><A NAME="ToC_480" HREF="whatever.html">fetch-first-clause</A>
|
||||
<BR><A NAME="ToC_481" HREF="whatever.html">optimize-for-clause</A>
|
||||
<BR><A NAME="ToC_482" HREF="whatever.html">Examples of a select-statement</A>
|
||||
<P><B><A NAME="ToC_483" HREF="whatever.html">SQL Statements</A></B><BR>
|
||||
<BR><A NAME="ToC_484" HREF="whatever.html">How SQL Statements Are Invoked</A>
|
||||
<BR><A NAME="ToC_485" HREF="whatever.html">Embedding a Statement in an Application Program</A>
|
||||
<BR><A NAME="ToC_489" HREF="whatever.html">Dynamic Preparation and Execution</A>
|
||||
<BR><A NAME="ToC_490" HREF="whatever.html">Static Invocation of a select-statement</A>
|
||||
<BR><A NAME="ToC_491" HREF="whatever.html">Dynamic Invocation of a select-statement</A>
|
||||
<BR><A NAME="ToC_492" HREF="whatever.html">Interactive Invocation</A>
|
||||
<BR><A NAME="ToC_493" HREF="whatever.html">SQL Return Codes</A>
|
||||
<BR><A NAME="ToC_494" HREF="whatever.html">SQLCODE</A>
|
||||
<BR><A NAME="ToC_495" HREF="whatever.html">SQLSTATE</A>
|
||||
<BR><A NAME="ToC_496" HREF="whatever.html">SQL Comments</A>
|
||||
<BR><A NAME="ToC_497" HREF="whatever.html">ALTER BUFFERPOOL</A>
|
||||
<BR><A NAME="ToC_498" HREF="whatever.html">ALTER NICKNAME</A>
|
||||
<BR><A NAME="ToC_499" HREF="whatever.html">ALTER NODEGROUP</A>
|
||||
<BR><A NAME="ToC_500" HREF="whatever.html">ALTER SERVER</A>
|
||||
<BR><A NAME="ToC_501" HREF="whatever.html">ALTER TABLE</A>
|
||||
<BR><A NAME="ToC_504" HREF="whatever.html">ALTER TABLESPACE</A>
|
||||
<BR><A NAME="ToC_505" HREF="whatever.html">ALTER TYPE (Structured)</A>
|
||||
<BR><A NAME="ToC_507" HREF="whatever.html">ALTER USER MAPPING</A>
|
||||
<BR><A NAME="ToC_508" HREF="whatever.html">ALTER VIEW</A>
|
||||
<BR><A NAME="ToC_509" HREF="whatever.html">BEGIN DECLARE SECTION</A>
|
||||
<BR><A NAME="ToC_511" HREF="whatever.html">CALL</A>
|
||||
<BR><A NAME="ToC_513" HREF="whatever.html">CLOSE</A>
|
||||
<BR><A NAME="ToC_514" HREF="whatever.html">COMMENT ON</A>
|
||||
<BR><A NAME="ToC_515" HREF="whatever.html">COMMIT</A>
|
||||
<BR><A NAME="ToC_517" HREF="whatever.html">Compound SQL (Embedded)</A>
|
||||
<BR><A NAME="ToC_519" HREF="whatever.html">CONNECT (Type 1)</A>
|
||||
<BR><A NAME="ToC_524" HREF="whatever.html">CONNECT (Type 2)</A>
|
||||
<BR><A NAME="ToC_525" HREF="whatever.html">CREATE ALIAS</A>
|
||||
<BR><A NAME="ToC_526" HREF="whatever.html">CREATE BUFFERPOOL</A>
|
||||
<BR><A NAME="ToC_527" HREF="whatever.html">CREATE DISTINCT TYPE</A>
|
||||
<BR><A NAME="ToC_528" HREF="whatever.html">CREATE EVENT MONITOR</A>
|
||||
<BR><A NAME="ToC_529" HREF="whatever.html">CREATE FUNCTION</A>
|
||||
<BR><A NAME="ToC_530" HREF="whatever.html">CREATE FUNCTION (External Scalar)</A>
|
||||
<BR><A NAME="ToC_531" HREF="whatever.html">CREATE FUNCTION (External Table)</A>
|
||||
<BR><A NAME="ToC_532" HREF="whatever.html">CREATE FUNCTION (OLE DB External Table)</A>
|
||||
<BR><A NAME="ToC_533" HREF="whatever.html">CREATE FUNCTION (Source or Template)</A>
|
||||
<BR><A NAME="ToC_534" HREF="whatever.html">CREATE FUNCTION (SQL Scalar, Table or Row)</A>
|
||||
<BR><A NAME="ToC_535" HREF="whatever.html">CREATE FUNCTION MAPPING</A>
|
||||
<BR><A NAME="ToC_537" HREF="whatever.html">CREATE INDEX</A>
|
||||
<BR><A NAME="ToC_538" HREF="whatever.html">CREATE INDEX EXTENSION</A>
|
||||
<BR><A NAME="ToC_539" HREF="whatever.html">CREATE METHOD</A>
|
||||
<BR><A NAME="ToC_540" HREF="whatever.html">CREATE NICKNAME</A>
|
||||
<BR><A NAME="ToC_541" HREF="whatever.html">CREATE NODEGROUP</A>
|
||||
<BR><A NAME="ToC_542" HREF="whatever.html">CREATE PROCEDURE</A>
|
||||
<BR><A NAME="ToC_543" HREF="whatever.html">CREATE SCHEMA</A>
|
||||
<BR><A NAME="ToC_544" HREF="whatever.html">CREATE SERVER</A>
|
||||
<BR><A NAME="ToC_546" HREF="whatever.html">CREATE TABLE</A>
|
||||
<BR><A NAME="ToC_549" HREF="whatever.html">CREATE TABLESPACE</A>
|
||||
<BR><A NAME="ToC_550" HREF="whatever.html">CREATE TRANSFORM</A>
|
||||
<BR><A NAME="ToC_551" HREF="whatever.html">CREATE TRIGGER</A>
|
||||
<BR><A NAME="ToC_552" HREF="whatever.html">CREATE TYPE (Structured)</A>
|
||||
<BR><A NAME="ToC_553" HREF="whatever.html">CREATE TYPE MAPPING</A>
|
||||
<BR><A NAME="ToC_554" HREF="whatever.html">CREATE USER MAPPING</A>
|
||||
<BR><A NAME="ToC_555" HREF="whatever.html">CREATE VIEW</A>
|
||||
<BR><A NAME="ToC_557" HREF="whatever.html">CREATE WRAPPER</A>
|
||||
<BR><A NAME="ToC_558" HREF="whatever.html">DECLARE CURSOR</A>
|
||||
<BR><A NAME="ToC_560" HREF="whatever.html">DECLARE GLOBAL TEMPORARY TABLE</A>
|
||||
<BR><A NAME="ToC_561" HREF="whatever.html">DELETE</A>
|
||||
<BR><A NAME="ToC_562" HREF="whatever.html">DESCRIBE</A>
|
||||
<BR><A NAME="ToC_563" HREF="whatever.html">DISCONNECT</A>
|
||||
<BR><A NAME="ToC_564" HREF="whatever.html">DROP</A>
|
||||
<BR><A NAME="ToC_566" HREF="whatever.html">END DECLARE SECTION</A>
|
||||
<BR><A NAME="ToC_567" HREF="whatever.html">EXECUTE</A>
|
||||
<BR><A NAME="ToC_569" HREF="whatever.html">EXECUTE IMMEDIATE</A>
|
||||
<BR><A NAME="ToC_570" HREF="whatever.html">EXPLAIN</A>
|
||||
<BR><A NAME="ToC_571" HREF="whatever.html">FETCH</A>
|
||||
<BR><A NAME="ToC_572" HREF="whatever.html">FLUSH EVENT MONITOR</A>
|
||||
<BR><A NAME="ToC_573" HREF="whatever.html">FREE LOCATOR</A>
|
||||
<BR><A NAME="ToC_574" HREF="whatever.html">GRANT (Database Authorities)</A>
|
||||
<BR><A NAME="ToC_575" HREF="whatever.html">GRANT (Index Privileges)</A>
|
||||
<BR><A NAME="ToC_576" HREF="whatever.html">GRANT (Package Privileges)</A>
|
||||
<BR><A NAME="ToC_577" HREF="whatever.html">GRANT (Schema Privileges)</A>
|
||||
<BR><A NAME="ToC_578" HREF="whatever.html">GRANT (Server Privileges)</A>
|
||||
<BR><A NAME="ToC_579" HREF="whatever.html">GRANT (Table, View, or Nickname Privileges)</A>
|
||||
<BR><A NAME="ToC_580" HREF="whatever.html">GRANT (Table Space Privileges)</A>
|
||||
<BR><A NAME="ToC_581" HREF="whatever.html">INCLUDE</A>
|
||||
<BR><A NAME="ToC_582" HREF="whatever.html">INSERT</A>
|
||||
<BR><A NAME="ToC_584" HREF="whatever.html">LOCK TABLE</A>
|
||||
<BR><A NAME="ToC_585" HREF="whatever.html">OPEN</A>
|
||||
<BR><A NAME="ToC_587" HREF="whatever.html">PREPARE</A>
|
||||
<BR><A NAME="ToC_589" HREF="whatever.html">REFRESH TABLE</A>
|
||||
<BR><A NAME="ToC_590" HREF="whatever.html">RELEASE (Connection)</A>
|
||||
<BR><A NAME="ToC_591" HREF="whatever.html">RELEASE SAVEPOINT</A>
|
||||
<BR><A NAME="ToC_592" HREF="whatever.html">RENAME TABLE</A>
|
||||
<BR><A NAME="ToC_593" HREF="whatever.html">RENAME TABLESPACE</A>
|
||||
<BR><A NAME="ToC_594" HREF="whatever.html">REVOKE (Database Authorities)</A>
|
||||
<BR><A NAME="ToC_595" HREF="whatever.html">REVOKE (Index Privileges)</A>
|
||||
<BR><A NAME="ToC_596" HREF="whatever.html">REVOKE (Package Privileges)</A>
|
||||
<BR><A NAME="ToC_597" HREF="whatever.html">REVOKE (Schema Privileges)</A>
|
||||
<BR><A NAME="ToC_598" HREF="whatever.html">REVOKE (Server Privileges)</A>
|
||||
<BR><A NAME="ToC_599" HREF="whatever.html">REVOKE (Table, View, or Nickname Privileges)</A>
|
||||
<BR><A NAME="ToC_600" HREF="whatever.html">REVOKE (Table Space Privileges)</A>
|
||||
<BR><A NAME="ToC_601" HREF="whatever.html">ROLLBACK</A>
|
||||
<BR><A NAME="ToC_602" HREF="whatever.html">SAVEPOINT</A>
|
||||
<BR><A NAME="ToC_603" HREF="whatever.html">SELECT</A>
|
||||
<BR><A NAME="ToC_604" HREF="whatever.html">SELECT INTO</A>
|
||||
<BR><A NAME="ToC_605" HREF="whatever.html">SET CONNECTION</A>
|
||||
<BR><A NAME="ToC_606" HREF="whatever.html">SET CURRENT DEFAULT TRANSFORM GROUP</A>
|
||||
<BR><A NAME="ToC_607" HREF="whatever.html">SET CURRENT DEGREE</A>
|
||||
<BR><A NAME="ToC_608" HREF="whatever.html">SET CURRENT EXPLAIN MODE</A>
|
||||
<BR><A NAME="ToC_609" HREF="whatever.html">SET CURRENT EXPLAIN SNAPSHOT</A>
|
||||
<BR><A NAME="ToC_610" HREF="whatever.html">SET CURRENT PACKAGESET</A>
|
||||
<BR><A NAME="ToC_611" HREF="whatever.html">SET CURRENT QUERY OPTIMIZATION</A>
|
||||
<BR><A NAME="ToC_612" HREF="whatever.html">SET CURRENT REFRESH AGE</A>
|
||||
<BR><A NAME="ToC_613" HREF="whatever.html">SET EVENT MONITOR STATE</A>
|
||||
<BR><A NAME="ToC_614" HREF="whatever.html">SET INTEGRITY</A>
|
||||
<BR><A NAME="ToC_616" HREF="whatever.html">SET PASSTHRU</A>
|
||||
<BR><A NAME="ToC_617" HREF="whatever.html">SET PATH</A>
|
||||
<BR><A NAME="ToC_618" HREF="whatever.html">SET SCHEMA</A>
|
||||
<BR><A NAME="ToC_619" HREF="whatever.html">SET SERVER OPTION</A>
|
||||
<BR><A NAME="ToC_620" HREF="whatever.html">SET transition-variable</A>
|
||||
<BR><A NAME="ToC_621" HREF="whatever.html">SIGNAL SQLSTATE</A>
|
||||
<BR><A NAME="ToC_622" HREF="whatever.html">UPDATE</A>
|
||||
<BR><A NAME="ToC_623" HREF="whatever.html">VALUES</A>
|
||||
<BR><A NAME="ToC_624" HREF="whatever.html">VALUES INTO</A>
|
||||
<BR><A NAME="ToC_625" HREF="whatever.html">WHENEVER</A>
|
||||
<P><B><A NAME="ToC_626" HREF="whatever.html">SQL Procedures</A></B><BR>
|
||||
<BR><A NAME="ToC_627" HREF="whatever.html">SQL Procedure Statement</A>
|
||||
<BR><A NAME="ToC_628" HREF="whatever.html">ALLOCATE CURSOR Statement</A>
|
||||
<BR><A NAME="ToC_629" HREF="whatever.html">Assignment Statement</A>
|
||||
<BR><A NAME="ToC_630" HREF="whatever.html">ASSOCIATE LOCATORS Statement</A>
|
||||
<BR><A NAME="ToC_631" HREF="whatever.html">CASE Statement</A>
|
||||
<BR><A NAME="ToC_632" HREF="whatever.html">Compound Statement</A>
|
||||
<BR><A NAME="ToC_633" HREF="whatever.html">FOR Statement</A>
|
||||
<BR><A NAME="ToC_634" HREF="whatever.html">GET DIAGNOSTICS Statement</A>
|
||||
<BR><A NAME="ToC_635" HREF="whatever.html">GOTO Statement</A>
|
||||
<BR><A NAME="ToC_636" HREF="whatever.html">IF Statement</A>
|
||||
<BR><A NAME="ToC_637" HREF="whatever.html">ITERATE Statement</A>
|
||||
<BR><A NAME="ToC_638" HREF="whatever.html">LEAVE Statement</A>
|
||||
<BR><A NAME="ToC_639" HREF="whatever.html">LOOP Statement</A>
|
||||
<BR><A NAME="ToC_640" HREF="whatever.html">REPEAT Statement</A>
|
||||
<BR><A NAME="ToC_641" HREF="whatever.html">RESIGNAL Statement</A>
|
||||
<BR><A NAME="ToC_642" HREF="whatever.html">RETURN Statement</A>
|
||||
<BR><A NAME="ToC_643" HREF="whatever.html">SIGNAL Statement</A>
|
||||
<BR><A NAME="ToC_644" HREF="whatever.html">WHILE Statement</A>
|
||||
<P><B><A NAME="ToC_645" HREF="whatever.html">Appendix A. SQL Limits</A></B><BR>
|
||||
<P><B><A NAME="ToC_646" HREF="whatever.html">Appendix B. SQL Communications (SQLCA)</A></B><BR>
|
||||
<BR><A NAME="ToC_647" HREF="whatever.html">Viewing the SQLCA Interactively</A>
|
||||
<BR><A NAME="ToC_648" HREF="whatever.html">SQLCA Field Descriptions</A>
|
||||
<BR><A NAME="ToC_649" HREF="whatever.html">Order of Error Reporting</A>
|
||||
<BR><A NAME="ToC_650" HREF="whatever.html">DB2 Enterprise - Extended Edition Usage of the SQLCA</A>
|
||||
<P><B><A NAME="ToC_651" HREF="whatever.html">Appendix C. SQL Descriptor Area (SQLDA)</A></B><BR>
|
||||
<BR><A NAME="ToC_652" HREF="whatever.html">Field Descriptions</A>
|
||||
<BR><A NAME="ToC_653" HREF="whatever.html">Fields in the SQLDA Header</A>
|
||||
<BR><A NAME="ToC_654" HREF="whatever.html">Fields in an Occurrence of a Base SQLVAR</A>
|
||||
<BR><A NAME="ToC_655" HREF="whatever.html">Fields in an Occurrence of a Secondary SQLVAR</A>
|
||||
<BR><A NAME="ToC_656" HREF="whatever.html">Effect of DESCRIBE on the SQLDA</A>
|
||||
<BR><A NAME="ToC_657" HREF="whatever.html">SQLTYPE and SQLLEN</A>
|
||||
<BR><A NAME="ToC_658" HREF="whatever.html">Unrecognized and Unsupported SQLTYPES</A>
|
||||
<BR><A NAME="ToC_659" HREF="whatever.html">Packed Decimal Numbers</A>
|
||||
<BR><A NAME="ToC_660" HREF="whatever.html">SQLLEN Field for Decimal</A>
|
||||
<P><B><A NAME="ToC_661" HREF="whatever.html">Appendix D. Catalog Views</A></B><BR>
|
||||
<BR><A NAME="ToC_662" HREF="whatever.html">Updatable Catalog Views</A>
|
||||
<BR><A NAME="ToC_663" HREF="whatever.html">'Roadmap' to Catalog Views</A>
|
||||
<BR><A NAME="ToC_664" HREF="whatever.html">'Roadmap' to Updatable Catalog Views</A>
|
||||
<BR><A NAME="ToC_665" HREF="whatever.html">SYSIBM.SYSDUMMY1</A>
|
||||
<BR><A NAME="ToC_666" HREF="whatever.html">SYSCAT.ATTRIBUTES</A>
|
||||
<BR><A NAME="ToC_667" HREF="whatever.html">SYSCAT.BUFFERPOOLNODES</A>
|
||||
<BR><A NAME="ToC_668" HREF="whatever.html">SYSCAT.BUFFERPOOLS</A>
|
||||
<BR><A NAME="ToC_669" HREF="whatever.html">SYSCAT.CASTFUNCTIONS</A>
|
||||
<BR><A NAME="ToC_670" HREF="whatever.html">SYSCAT.CHECKS</A>
|
||||
<BR><A NAME="ToC_671" HREF="whatever.html">SYSCAT.COLAUTH</A>
|
||||
<BR><A NAME="ToC_672" HREF="whatever.html">SYSCAT.COLCHECKS</A>
|
||||
<BR><A NAME="ToC_673" HREF="whatever.html">SYSCAT.COLDIST</A>
|
||||
<BR><A NAME="ToC_674" HREF="whatever.html">SYSCAT.COLOPTIONS</A>
|
||||
<BR><A NAME="ToC_675" HREF="whatever.html">SYSCAT.COLUMNS</A>
|
||||
<BR><A NAME="ToC_676" HREF="whatever.html">SYSCAT.CONSTDEP</A>
|
||||
<BR><A NAME="ToC_677" HREF="whatever.html">SYSCAT.DATATYPES</A>
|
||||
<BR><A NAME="ToC_678" HREF="whatever.html">SYSCAT.DBAUTH</A>
|
||||
<BR><A NAME="ToC_679" HREF="whatever.html">SYSCAT.EVENTMONITORS</A>
|
||||
<BR><A NAME="ToC_680" HREF="whatever.html">SYSCAT.EVENTS</A>
|
||||
<BR><A NAME="ToC_681" HREF="whatever.html">SYSCAT.FULLHIERARCHIES</A>
|
||||
<BR><A NAME="ToC_682" HREF="whatever.html">SYSCAT.FUNCDEP</A>
|
||||
<BR><A NAME="ToC_683" HREF="whatever.html">SYSCAT.FUNCMAPOPTIONS</A>
|
||||
<BR><A NAME="ToC_684" HREF="whatever.html">SYSCAT.FUNCMAPPARMOPTIONS</A>
|
||||
<BR><A NAME="ToC_685" HREF="whatever.html">SYSCAT.FUNCMAPPINGS</A>
|
||||
<BR><A NAME="ToC_686" HREF="whatever.html">SYSCAT.FUNCPARMS</A>
|
||||
<BR><A NAME="ToC_687" HREF="whatever.html">SYSCAT.FUNCTIONS</A>
|
||||
<BR><A NAME="ToC_688" HREF="whatever.html">SYSCAT.HIERARCHIES</A>
|
||||
<BR><A NAME="ToC_689" HREF="whatever.html">SYSCAT.INDEXAUTH</A>
|
||||
<BR><A NAME="ToC_690" HREF="whatever.html">SYSCAT.INDEXCOLUSE</A>
|
||||
<BR><A NAME="ToC_691" HREF="whatever.html">SYSCAT.INDEXDEP</A>
|
||||
<BR><A NAME="ToC_692" HREF="whatever.html">SYSCAT.INDEXES</A>
|
||||
<BR><A NAME="ToC_693" HREF="whatever.html">SYSCAT.INDEXOPTIONS</A>
|
||||
<BR><A NAME="ToC_694" HREF="whatever.html">SYSCAT.KEYCOLUSE</A>
|
||||
<BR><A NAME="ToC_695" HREF="whatever.html">SYSCAT.NAMEMAPPINGS</A>
|
||||
<BR><A NAME="ToC_696" HREF="whatever.html">SYSCAT.NODEGROUPDEF</A>
|
||||
<BR><A NAME="ToC_697" HREF="whatever.html">SYSCAT.NODEGROUPS</A>
|
||||
<BR><A NAME="ToC_698" HREF="whatever.html">SYSCAT.PACKAGEAUTH</A>
|
||||
<BR><A NAME="ToC_699" HREF="whatever.html">SYSCAT.PACKAGEDEP</A>
|
||||
<BR><A NAME="ToC_700" HREF="whatever.html">SYSCAT.PACKAGES</A>
|
||||
<BR><A NAME="ToC_701" HREF="whatever.html">SYSCAT.PARTITIONMAPS</A>
|
||||
<BR><A NAME="ToC_702" HREF="whatever.html">SYSCAT.PASSTHRUAUTH</A>
|
||||
<BR><A NAME="ToC_703" HREF="whatever.html">SYSCAT.PROCEDURES</A>
|
||||
<BR><A NAME="ToC_704" HREF="whatever.html">SYSCAT.PROCOPTIONS</A>
|
||||
<BR><A NAME="ToC_705" HREF="whatever.html">SYSCAT.PROCPARMOPTIONS</A>
|
||||
<BR><A NAME="ToC_706" HREF="whatever.html">SYSCAT.PROCPARMS</A>
|
||||
<BR><A NAME="ToC_707" HREF="whatever.html">SYSCAT.REFERENCES</A>
|
||||
<BR><A NAME="ToC_708" HREF="whatever.html">SYSCAT.REVTYPEMAPPINGS</A>
|
||||
<BR><A NAME="ToC_709" HREF="whatever.html">SYSCAT.SCHEMAAUTH</A>
|
||||
<BR><A NAME="ToC_710" HREF="whatever.html">SYSCAT.SCHEMATA</A>
|
||||
<BR><A NAME="ToC_711" HREF="whatever.html">SYSCAT.SERVEROPTIONS</A>
|
||||
<BR><A NAME="ToC_712" HREF="whatever.html">SYSCAT.SERVERS</A>
|
||||
<BR><A NAME="ToC_713" HREF="whatever.html">SYSCAT.STATEMENTS</A>
|
||||
<BR><A NAME="ToC_714" HREF="whatever.html">SYSCAT.TABAUTH</A>
|
||||
<BR><A NAME="ToC_715" HREF="whatever.html">SYSCAT.TABCONST</A>
|
||||
<BR><A NAME="ToC_716" HREF="whatever.html">SYSCAT.TABLES</A>
|
||||
<BR><A NAME="ToC_717" HREF="whatever.html">SYSCAT.TABLESPACES</A>
|
||||
<BR><A NAME="ToC_718" HREF="whatever.html">SYSCAT.TABOPTIONS</A>
|
||||
<BR><A NAME="ToC_719" HREF="whatever.html">SYSCAT.TBSPACEAUTH</A>
|
||||
<BR><A NAME="ToC_720" HREF="whatever.html">SYSCAT.TRIGDEP</A>
|
||||
<BR><A NAME="ToC_721" HREF="whatever.html">SYSCAT.TRIGGERS</A>
|
||||
<BR><A NAME="ToC_722" HREF="whatever.html">SYSCAT.TYPEMAPPINGS</A>
|
||||
<BR><A NAME="ToC_723" HREF="whatever.html">SYSCAT.USEROPTIONS</A>
|
||||
<BR><A NAME="ToC_724" HREF="whatever.html">SYSCAT.VIEWDEP</A>
|
||||
<BR><A NAME="ToC_725" HREF="whatever.html">SYSCAT.VIEWS</A>
|
||||
<BR><A NAME="ToC_726" HREF="whatever.html">SYSCAT.WRAPOPTIONS</A>
|
||||
<BR><A NAME="ToC_727" HREF="whatever.html">SYSCAT.WRAPPERS</A>
|
||||
<BR><A NAME="ToC_728" HREF="whatever.html">SYSSTAT.COLDIST</A>
|
||||
<BR><A NAME="ToC_729" HREF="whatever.html">SYSSTAT.COLUMNS</A>
|
||||
<BR><A NAME="ToC_730" HREF="whatever.html">SYSSTAT.FUNCTIONS</A>
|
||||
<BR><A NAME="ToC_731" HREF="whatever.html">SYSSTAT.INDEXES</A>
|
||||
<BR><A NAME="ToC_732" HREF="whatever.html">SYSSTAT.TABLES</A>
|
||||
<P><B><A NAME="ToC_733" HREF="whatever.html">Appendix E. Catalog Views For Use With Structured Types</A></B><BR>
|
||||
<BR><A NAME="ToC_734" HREF="whatever.html">'Roadmap' to Catalog Views</A>
|
||||
<BR><A NAME="ToC_735" HREF="whatever.html">OBJCAT.INDEXES</A>
|
||||
<BR><A NAME="ToC_736" HREF="whatever.html">OBJCAT.INDEXEXPLOITRULES</A>
|
||||
<BR><A NAME="ToC_737" HREF="whatever.html">OBJCAT.INDEXEXTENSIONDEP</A>
|
||||
<BR><A NAME="ToC_738" HREF="whatever.html">OBJCAT.INDEXEXTENSIONMETHODS</A>
|
||||
<BR><A NAME="ToC_739" HREF="whatever.html">OBJCAT.INDEXEXTENSIONPARMS</A>
|
||||
<BR><A NAME="ToC_740" HREF="whatever.html">OBJCAT.INDEXEXTENSIONS</A>
|
||||
<BR><A NAME="ToC_741" HREF="whatever.html">OBJCAT.PREDICATESPECS</A>
|
||||
<BR><A NAME="ToC_742" HREF="whatever.html">OBJCAT.TRANSFORMS</A>
|
||||
<P><B><A NAME="ToC_743" HREF="whatever.html">Appendix F. Federated Systems</A></B><BR>
|
||||
<BR><A NAME="ToC_744" HREF="whatever.html">Server Types</A>
|
||||
<BR><A NAME="ToC_745" HREF="whatever.html">SQL Options for Federated Systems</A>
|
||||
<BR><A NAME="ToC_746" HREF="whatever.html">Column Options</A>
|
||||
<BR><A NAME="ToC_747" HREF="whatever.html">Function Mapping Options</A>
|
||||
<BR><A NAME="ToC_748" HREF="whatever.html">Server Options</A>
|
||||
<BR><A NAME="ToC_749" HREF="whatever.html">User Options</A>
|
||||
<BR><A NAME="ToC_750" HREF="whatever.html">Default Data Type Mappings</A>
|
||||
<BR><A NAME="ToC_751" HREF="whatever.html">Default Type Mappings between DB2 and DB2 Universal Database for OS/390 (and DB2 for MVS/ESA) Data Sources</A>
|
||||
<BR><A NAME="ToC_752" HREF="whatever.html">Default Type Mappings between DB2 and 2 Universal Database for AS/400 (and DB2 for OS/400) Data Sources</A>
|
||||
<BR><A NAME="ToC_753" HREF="whatever.html">Default Type Mappings between DB2 and Oracle Data Sources</A>
|
||||
<BR><A NAME="ToC_754" HREF="whatever.html">Default Type Mappings between DB2 and DB2 for VM and VSE (and SQL/DS) Data Sources</A>
|
||||
<BR><A NAME="ToC_755" HREF="whatever.html">Pass-Through Facility Processing</A>
|
||||
<BR><A NAME="ToC_756" HREF="whatever.html">SQL Processing in Pass-Through Sessions</A>
|
||||
<BR><A NAME="ToC_757" HREF="whatever.html">Considerations and Restrictions</A>
|
||||
<P><B><A NAME="ToC_760" HREF="whatever.html">Appendix G. Sample Database Tables</A></B><BR>
|
||||
<BR><A NAME="ToC_761" HREF="whatever.html">The Sample Database</A>
|
||||
<BR><A NAME="ToC_762" HREF="whatever.html">To Create the Sample Database</A>
|
||||
<BR><A NAME="ToC_763" HREF="whatever.html">To Erase the Sample Database</A>
|
||||
<BR><A NAME="ToC_764" HREF="whatever.html">CL_SCHED Table</A>
|
||||
<BR><A NAME="ToC_765" HREF="whatever.html">DEPARTMENT Table</A>
|
||||
<BR><A NAME="ToC_766" HREF="whatever.html">EMPLOYEE Table</A>
|
||||
<BR><A NAME="ToC_767" HREF="whatever.html">EMP_ACT Table</A>
|
||||
<BR><A NAME="ToC_768" HREF="whatever.html">EMP_PHOTO Table</A>
|
||||
<BR><A NAME="ToC_769" HREF="whatever.html">EMP_RESUME Table</A>
|
||||
<BR><A NAME="ToC_770" HREF="whatever.html">IN_TRAY Table</A>
|
||||
<BR><A NAME="ToC_771" HREF="whatever.html">ORG Table</A>
|
||||
<BR><A NAME="ToC_772" HREF="whatever.html">PROJECT Table</A>
|
||||
<BR><A NAME="ToC_773" HREF="whatever.html">SALES Table</A>
|
||||
<BR><A NAME="ToC_774" HREF="whatever.html">STAFF Table</A>
|
||||
<BR><A NAME="ToC_775" HREF="whatever.html">STAFFG Table</A>
|
||||
<BR><A NAME="ToC_776" HREF="whatever.html">Sample Files with BLOB and CLOB Data Type</A>
|
||||
<BR><A NAME="ToC_777" HREF="whatever.html">Quintana Photo</A>
|
||||
<BR><A NAME="ToC_778" HREF="whatever.html">Quintana Resume</A>
|
||||
<BR><A NAME="ToC_779" HREF="whatever.html">Nicholls Photo</A>
|
||||
<BR><A NAME="ToC_780" HREF="whatever.html">Nicholls Resume</A>
|
||||
<BR><A NAME="ToC_781" HREF="whatever.html">Adamson Photo</A>
|
||||
<BR><A NAME="ToC_782" HREF="whatever.html">Adamson Resume</A>
|
||||
<BR><A NAME="ToC_783" HREF="whatever.html">Walker Photo</A>
|
||||
<BR><A NAME="ToC_784" HREF="whatever.html">Walker Resume</A>
|
||||
<P><B><A NAME="ToC_785" HREF="whatever.html">Appendix H. Reserved Schema Names and Reserved Words</A></B><BR>
|
||||
<BR><A NAME="ToC_786" HREF="whatever.html">Reserved Schemas</A>
|
||||
<BR><A NAME="ToC_787" HREF="whatever.html">Reserved Words</A>
|
||||
<BR><A NAME="ToC_788" HREF="whatever.html">IBM SQL Reserved Words</A>
|
||||
<BR><A NAME="ToC_789" HREF="whatever.html">ISO/ANS SQL92 Reserved Words</A>
|
||||
<P><B><A NAME="ToC_790" HREF="whatever.html">Appendix I. Comparison of Isolation Levels</A></B><BR>
|
||||
<P><B><A NAME="ToC_791" HREF="whatever.html">Appendix J. Interaction of Triggers and Constraints</A></B><BR>
|
||||
<P><B><A NAME="ToC_792" HREF="whatever.html">Appendix K. Explain Tables and Definitions</A></B><BR>
|
||||
<BR><A NAME="ToC_793" HREF="whatever.html">EXPLAIN_ARGUMENT Table</A>
|
||||
<BR><A NAME="ToC_794" HREF="whatever.html">EXPLAIN_INSTANCE Table</A>
|
||||
<BR><A NAME="ToC_795" HREF="whatever.html">EXPLAIN_OBJECT Table</A>
|
||||
<BR><A NAME="ToC_796" HREF="whatever.html">EXPLAIN_OPERATOR Table</A>
|
||||
<BR><A NAME="ToC_797" HREF="whatever.html">EXPLAIN_PREDICATE Table</A>
|
||||
<BR><A NAME="ToC_798" HREF="whatever.html">EXPLAIN_STATEMENT Table</A>
|
||||
<BR><A NAME="ToC_799" HREF="whatever.html">EXPLAIN_STREAM Table</A>
|
||||
<BR><A NAME="ToC_800" HREF="whatever.html">ADVISE_INDEX Table</A>
|
||||
<BR><A NAME="ToC_801" HREF="whatever.html">ADVISE_WORKLOAD Table</A>
|
||||
<BR><A NAME="ToC_802" HREF="whatever.html">Table Definitions for Explain Tables</A>
|
||||
<BR><A NAME="ToC_803" HREF="whatever.html">EXPLAIN_ARGUMENT Table Definition</A>
|
||||
<BR><A NAME="ToC_804" HREF="whatever.html">EXPLAIN_INSTANCE Table Definition</A>
|
||||
<BR><A NAME="ToC_805" HREF="whatever.html">EXPLAIN_OBJECT Table Definition</A>
|
||||
<BR><A NAME="ToC_806" HREF="whatever.html">EXPLAIN_OPERATOR Table Definition</A>
|
||||
<BR><A NAME="ToC_807" HREF="whatever.html">EXPLAIN_PREDICATE Table Definition</A>
|
||||
<BR><A NAME="ToC_808" HREF="whatever.html">EXPLAIN_STATEMENT Table Definition</A>
|
||||
<BR><A NAME="ToC_809" HREF="whatever.html">EXPLAIN_STREAM Table Definition</A>
|
||||
<BR><A NAME="ToC_810" HREF="whatever.html">ADVISE_INDEX Table Definition</A>
|
||||
<BR><A NAME="ToC_811" HREF="whatever.html">ADVISE_WORKLOAD Table Definition</A>
|
||||
<P><B><A NAME="ToC_812" HREF="whatever.html">Appendix L. Explain Register Values</A></B><BR>
|
||||
<P><B><A NAME="ToC_813" HREF="whatever.html">Appendix M. Recursion Example: Bill of Materials</A></B><BR>
|
||||
<BR><A NAME="ToC_814" HREF="whatever.html">Example 1: Single Level Explosion</A>
|
||||
<BR><A NAME="ToC_815" HREF="whatever.html">Example 2: Summarized Explosion</A>
|
||||
<BR><A NAME="ToC_816" HREF="whatever.html">Example 3: Controlling Depth</A>
|
||||
<P><B><A NAME="ToC_817" HREF="whatever.html">Appendix N. Exception Tables</A></B><BR>
|
||||
<BR><A NAME="ToC_818" HREF="whatever.html">Rules for Creating an Exception Table</A>
|
||||
<BR><A NAME="ToC_819" HREF="whatever.html">Handling Rows in the Exception Tables</A>
|
||||
<BR><A NAME="ToC_820" HREF="whatever.html">Querying the Exception Tables</A>
|
||||
<P><B><A NAME="ToC_821" HREF="whatever.html">Appendix O. Japanese and Traditional-Chinese EUC Considerations</A></B><BR>
|
||||
<BR><A NAME="ToC_822" HREF="whatever.html">Language Elements</A>
|
||||
<BR><A NAME="ToC_823" HREF="whatever.html">Characters</A>
|
||||
<BR><A NAME="ToC_824" HREF="whatever.html">Tokens</A>
|
||||
<BR><A NAME="ToC_825" HREF="whatever.html">Identifiers</A>
|
||||
<BR><A NAME="ToC_827" HREF="whatever.html">Data Types</A>
|
||||
<BR><A NAME="ToC_830" HREF="whatever.html">Assignments and Comparisons</A>
|
||||
<BR><A NAME="ToC_833" HREF="whatever.html">Rules for Result Data Types</A>
|
||||
<BR><A NAME="ToC_834" HREF="whatever.html">Rules for String Conversions</A>
|
||||
<BR><A NAME="ToC_835" HREF="whatever.html">Constants</A>
|
||||
<BR><A NAME="ToC_837" HREF="whatever.html">Functions</A>
|
||||
<BR><A NAME="ToC_838" HREF="whatever.html">Expressions</A>
|
||||
<BR><A NAME="ToC_840" HREF="whatever.html">Predicates</A>
|
||||
<BR><A NAME="ToC_842" HREF="whatever.html">Functions</A>
|
||||
<BR><A NAME="ToC_843" HREF="whatever.html">LENGTH</A>
|
||||
<BR><A NAME="ToC_844" HREF="whatever.html">SUBSTR</A>
|
||||
<BR><A NAME="ToC_845" HREF="whatever.html">TRANSLATE</A>
|
||||
<BR><A NAME="ToC_846" HREF="whatever.html">VARGRAPHIC</A>
|
||||
<BR><A NAME="ToC_847" HREF="whatever.html">Statements</A>
|
||||
<BR><A NAME="ToC_848" HREF="whatever.html">CONNECT</A>
|
||||
<BR><A NAME="ToC_849" HREF="whatever.html">PREPARE</A>
|
||||
<P><B><A NAME="ToC_850" HREF="whatever.html">Appendix P. BNF Specifications for DATALINKs</A></B><BR>
|
||||
<P><B><A NAME="ToC_851" HREF="whatever.html">Appendix Q. Using the DB2 Library</A></B><BR>
|
||||
<BR><A NAME="ToC_852" HREF="whatever.html">DB2 PDF Files and Printed Books</A>
|
||||
<BR><A NAME="ToC_853" HREF="whatever.html">DB2 Information</A>
|
||||
<BR><A NAME="ToC_854" HREF="whatever.html">Printing the PDF Books</A>
|
||||
<BR><A NAME="ToC_855" HREF="whatever.html">Ordering the Printed Books</A>
|
||||
<BR><A NAME="ToC_856" HREF="whatever.html">DB2 Online Documentation</A>
|
||||
<BR><A NAME="ToC_857" HREF="whatever.html">Accessing Online Help</A>
|
||||
<BR><A NAME="ToC_858" HREF="whatever.html">Viewing Information Online</A>
|
||||
<BR><A NAME="ToC_861" HREF="whatever.html">Using DB2 Wizards</A>
|
||||
<BR><A NAME="ToC_862" HREF="whatever.html">Setting Up a Document Server</A>
|
||||
<BR><A NAME="ToC_863" HREF="whatever.html">Searching Information Online</A>
|
||||
<P><B><A NAME="ToC_864" HREF="whatever.html">Appendix R. Notices</A></B><BR>
|
||||
<BR><A NAME="ToC_865" HREF="whatever.html">Trademarks</A>
|
||||
<P><B><A NAME="ToC_866" HREF="whatever.html">Index</A></B><BR>
|
||||
<P><B><A NAME="ToC_867" HREF="whatever.html">Contacting IBM</A></B><BR>
|
||||
<BR><A NAME="ToC_868" HREF="whatever.html">Product Information</A>
|
||||
|
||||
<A NAME="Bot_Of_Page"></A>
|
||||
|
||||
</tr>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
<html>
|
||||
<body>
|
||||
<font face="Arial, sans-serif" size="-1">
|
||||
<table>
|
||||
<tr>
|
||||
<!-- add <td> and </td> inside the <tr> and nsCSSFrameConstructor::ReframeContainingBlock is
|
||||
not called. As the amount of tags inside here increases, the calls really slow things down -->
|
||||
This text node only exists once in the original document!
|
||||
If it were a large collection of inlines, the page would
|
||||
hang forever.
|
||||
|
||||
<A NAME="Top_Of_Page"></A>
|
||||
<H2><A NAME="ToC">Table of Contents</A></H2>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,105 +0,0 @@
|
||||
<HEAD>
|
||||
<SCRIPT>
|
||||
function doIt() {
|
||||
var font = document.getElementById("font1");
|
||||
var anchor = document.getElementById("anchor1a");
|
||||
var text = document.createTextNode("same line as X ");
|
||||
font.insertBefore(text, anchor);
|
||||
|
||||
font = document.getElementById("font2");
|
||||
var table = document.getElementById("table2");
|
||||
text = document.createTextNode(" same line as X");
|
||||
font.insertBefore(text, table);
|
||||
|
||||
font = document.getElementById("font3");
|
||||
anchor = document.getElementById("anchor3b");
|
||||
text = document.createTextNode("same line as Z ");
|
||||
font.insertBefore(text, anchor);
|
||||
|
||||
font = document.getElementById("font4");
|
||||
table = document.getElementById("table4");
|
||||
text = document.createTextNode("line before table");
|
||||
font.insertBefore(text, table);
|
||||
|
||||
font = document.getElementById("font5");
|
||||
anchor = document.getElementById("anchor5b");
|
||||
text = document.createTextNode("line after table ");
|
||||
font.insertBefore(text, anchor);
|
||||
|
||||
font = document.getElementById("font6");
|
||||
table = document.getElementById("table6");
|
||||
text = document.createTextNode("line before table");
|
||||
font.insertBefore(text, table);
|
||||
|
||||
font = document.getElementById("font7");
|
||||
anchor = document.getElementById("anchor7a");
|
||||
var div = document.createElement("DIV", null);
|
||||
text = document.createTextNode("div before X");
|
||||
div.appendChild(text);
|
||||
font.insertBefore(div, anchor);
|
||||
|
||||
font = document.getElementById("font8");
|
||||
table = document.getElementById("table8");
|
||||
div = document.createElement("DIV", null);
|
||||
text = document.createTextNode("div before table");
|
||||
div.appendChild(text);
|
||||
font.insertBefore(div, table);
|
||||
|
||||
font = document.getElementById("font9");
|
||||
anchor = document.getElementById("anchor9b");
|
||||
div = document.createElement("DIV", null);
|
||||
text = document.createTextNode("div after table");
|
||||
div.appendChild(text);
|
||||
font.insertBefore(div, anchor);
|
||||
|
||||
font = document.getElementById("font10");
|
||||
table = document.getElementById("table10");
|
||||
div = document.createElement("DIV", null);
|
||||
text = document.createTextNode("div before table");
|
||||
div.appendChild(text);
|
||||
font.insertBefore(div, table);
|
||||
|
||||
font = document.getElementById("font11");
|
||||
anchor = document.getElementById("anchor11b");
|
||||
div = document.createElement("DIV", null);
|
||||
text = document.createTextNode("div after table");
|
||||
div.appendChild(text);
|
||||
font.insertBefore(div, anchor);
|
||||
|
||||
font = document.getElementById("font12");
|
||||
table = document.getElementById("table12");
|
||||
div = document.createElement("DIV", null);
|
||||
text = document.createTextNode("div before table");
|
||||
div.appendChild(text);
|
||||
font.insertBefore(div, table);
|
||||
|
||||
}
|
||||
</SCRIPT>
|
||||
</HEAD>
|
||||
|
||||
<BODY onload="doIt()">
|
||||
|
||||
<font id=font1><a id=anchor1a>X</a><table id=table1 border><tr><td>table-1</td></tr></table><a id=anchor1b>Z</a><font>
|
||||
<HR>
|
||||
<font id=font2><a id=anchor2a>X</a><table id=table2 border><tr><td>table-2</td></tr></table><a id=anchor2b>Z</a><font>
|
||||
<HR>
|
||||
<font id=font3><a id=anchor3a>X</a><table id=table3 border><tr><td>table-3</td></tr></table><a id=anchor3b>Z</a><font>
|
||||
<HR>
|
||||
<font id=font4><table id=table4 border><tr><td>table-4</td></tr></table><a id=anchor4b>Z</a><font>
|
||||
<HR>
|
||||
<font id=font5><table id=table5 border><tr><td>table-5</td></tr></table><a id=anchor5b>Z</a><font>
|
||||
<HR>
|
||||
<font id=font6><table id=table6 border><tr><td>table-6</td></tr></table><font>
|
||||
|
||||
<HR>
|
||||
<font id=font7><a id=anchor7a>X</a><table id=table7 border><tr><td>table-7</td></tr></table><a id=anchor7b>Z</a><font>
|
||||
<HR>
|
||||
<font id=font8><a id=anchor8a>X</a><table id=table8 border><tr><td>table-8</td></tr></table><a id=anchor8b>Z</a><font>
|
||||
<HR>
|
||||
<font id=font9><a id=anchor9a>X</a><table id=table9 border><tr><td>table-9</td></tr></table><a id=anchor9b>Z</a><font>
|
||||
<HR>
|
||||
<font id=font10><table id=table10 border><tr><td>table-10</td></tr></table><a id=anchor10b>Z</a><font>
|
||||
<HR>
|
||||
<font id=font11><table id=table11 border><tr><td>table-11</td></tr></table><a id=anchor11b>Z</a><font>
|
||||
<HR>
|
||||
<font id=font12><table id=table12 border><tr><td>table-12</td></tr></table><font>
|
||||
@@ -1,32 +0,0 @@
|
||||
<html>
|
||||
<body>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<span>
|
||||
<span>
|
||||
<head>
|
||||
<title></title>
|
||||
</head>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<table align="left">
|
||||
<tr>
|
||||
<td>
|
||||
<form>
|
||||
<input type="submit" value="ApplyForThisPosition">
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</span>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,5 +0,0 @@
|
||||
#
|
||||
# This is a list of local files which get copied to the mozilla:dist directory
|
||||
#
|
||||
|
||||
nsComponentResContext.h
|
||||
@@ -1,101 +0,0 @@
|
||||
/* -*- 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.org 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):
|
||||
* Conrad Carlen <ccarlen@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 "nsComponentResContext.h"
|
||||
#include <Resources.h>
|
||||
|
||||
short nsComponentResourceContext::sCompResRefNum = kResFileNotOpened;
|
||||
|
||||
pascal OSErr __NSInitialize(const CFragInitBlock *theInitBlock);
|
||||
pascal OSErr __NSInitializeWithResources(const CFragInitBlock *theInitBlock);
|
||||
|
||||
pascal void __NSTerminate(void);
|
||||
pascal void __NSTerminateWithResources(void);
|
||||
|
||||
//****************************************************************************************
|
||||
// Fragment Init and Termination
|
||||
//****************************************************************************************
|
||||
|
||||
pascal OSErr __NSInitializeWithResources(const CFragInitBlock *theInitBlock)
|
||||
{
|
||||
OSErr err = __NSInitialize(theInitBlock);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
short saveResFile = ::CurResFile();
|
||||
|
||||
short refNum = ::FSpOpenResFile(theInitBlock->fragLocator.u.onDisk.fileSpec, fsRdPerm);
|
||||
nsComponentResourceContext::sCompResRefNum = refNum;
|
||||
|
||||
::UseResFile(saveResFile);
|
||||
|
||||
return ::ResError();
|
||||
}
|
||||
|
||||
pascal void __NSTerminateWithResources(void)
|
||||
{
|
||||
if (nsComponentResourceContext::sCompResRefNum != kResFileNotOpened)
|
||||
::CloseResFile(nsComponentResourceContext::sCompResRefNum);
|
||||
__NSTerminate();
|
||||
}
|
||||
|
||||
//****************************************************************************************
|
||||
// nsComponentResourceContext
|
||||
//****************************************************************************************
|
||||
|
||||
nsComponentResourceContext::nsComponentResourceContext() :
|
||||
mSavedResRefNum(kResFileNotOpened)
|
||||
{
|
||||
}
|
||||
|
||||
nsComponentResourceContext::~nsComponentResourceContext()
|
||||
{
|
||||
if (mSavedResRefNum != kResFileNotOpened)
|
||||
::UseResFile(mSavedResRefNum);
|
||||
}
|
||||
|
||||
Boolean nsComponentResourceContext::BecomeCurrent()
|
||||
{
|
||||
if (sCompResRefNum == kResFileNotOpened)
|
||||
return false;
|
||||
|
||||
mSavedResRefNum = ::CurResFile();
|
||||
::UseResFile(sCompResRefNum);
|
||||
return ::ResError() == noErr;
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
/* -*- 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.org 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):
|
||||
* Conrad Carlen <ccarlen@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 ***** */
|
||||
|
||||
#ifndef nsComponentResContext_h__
|
||||
#define nsComponentResContext_h__
|
||||
|
||||
#include <CodeFragments.h>
|
||||
|
||||
/*
|
||||
* Allows use of resources from the component's resource fork.
|
||||
*
|
||||
* Specify __NSInitializeWithResources and __NSTerminateWithResources
|
||||
* as the entry points of the component and then code within that
|
||||
* component can use this class.
|
||||
*
|
||||
*/
|
||||
|
||||
class nsComponentResourceContext
|
||||
{
|
||||
friend pascal OSErr __NSInitializeWithResources(const CFragInitBlock *theInitBlock);
|
||||
friend pascal void __NSTerminateWithResources(void);
|
||||
|
||||
public:
|
||||
nsComponentResourceContext();
|
||||
~nsComponentResourceContext();
|
||||
|
||||
Boolean BecomeCurrent(); // TRUE if success
|
||||
|
||||
private:
|
||||
static short sCompResRefNum;
|
||||
short mSavedResRefNum;
|
||||
};
|
||||
|
||||
#endif // nsComponentResources_h__
|
||||
@@ -2354,6 +2354,15 @@ nsresult nsImapIncomingServer::GetUnverifiedSubFolders(nsIFolder *parentFolder,
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsImapIncomingServer::ForgetSessionPassword()
|
||||
{
|
||||
nsresult rv = nsMsgIncomingServer::ForgetSessionPassword();
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
|
||||
m_userAuthenticated = PR_FALSE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsImapIncomingServer::GetServerRequiresPasswordForBiff(PRBool *_retval)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(_retval);
|
||||
|
||||
@@ -93,6 +93,7 @@ NS_IMETHOD GetCanUndoDeleteOnServer(PRBool *canUndoDeleteOnServer);
|
||||
NS_IMETHOD GetServerRequiresPasswordForBiff(PRBool *_retval);
|
||||
NS_IMETHOD OnUserOrHostNameChanged(const char *oldName, const char *newName);
|
||||
NS_IMETHOD GetNumIdleConnections(PRInt32 *aNumIdleConnections);
|
||||
NS_IMETHOD ForgetSessionPassword();
|
||||
protected:
|
||||
nsresult GetFolder(const char* name, nsIMsgFolder** pFolder);
|
||||
nsresult ResetFoldersToUnverified(nsIFolder *parentFolder);
|
||||
|
||||
@@ -1199,7 +1199,13 @@ NS_IMETHODIMP ns4xPluginInstance :: GetScriptablePeer(void * *aScriptablePeer)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
*aScriptablePeer = nsnull;
|
||||
return GetValue(nsPluginInstanceVariable_ScriptableInstance, aScriptablePeer);
|
||||
nsresult rv = GetValue(nsPluginInstanceVariable_ScriptableInstance, aScriptablePeer);
|
||||
if (NS_SUCCEEDED(rv) && *aScriptablePeer) {
|
||||
// scriptable plugins should always be cached to avoid the crash in
|
||||
// XPCWrappedNativeProto::~XPCWrappedNativeProto call from js_GC, bug 148889
|
||||
SetCached(PR_TRUE);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
|
||||
27
mozilla/other-licenses/libart_lgpl/README.CVS
Normal file
27
mozilla/other-licenses/libart_lgpl/README.CVS
Normal file
@@ -0,0 +1,27 @@
|
||||
This is mozilla's modified version of the libart source code. The original
|
||||
code can be found in the gnome.org cvs repository.
|
||||
|
||||
The below notice appears in the gnome.org cvs tree. It isn't a requirement
|
||||
to submitting a patch to this directory that people assign copyright.
|
||||
However, you should be aware of the below if you want your changes to be
|
||||
accepted into the official libart release. We strongly encourage all
|
||||
submitted patches (except, obviously, for mozilla-specific build hacks) to
|
||||
be sent to the maintainer. We don't want to fork the code, but we do want
|
||||
and need patches so that, for example, SVG can work on the mac.
|
||||
|
||||
---------------------------------------------------
|
||||
|
||||
Welcome to the libart source tree!
|
||||
|
||||
This code is being developed in a "free software for sale"
|
||||
model. Thus, it's available under a free software license (LGPL for
|
||||
this module), but I'm also requesting that for all changes to the code
|
||||
the copyright gets assigned back to me.
|
||||
|
||||
So if you want to contribute, please do, but contact me about getting
|
||||
the copyright assigned. Otherwise, I will have to back your changes
|
||||
out.
|
||||
|
||||
Thanks!
|
||||
|
||||
Raph Levien <raph@acm.org>
|
||||
@@ -1,393 +0,0 @@
|
||||
/*
|
||||
File: JavaEmbedding/JavaApplet.h
|
||||
|
||||
Contains: interface to embedding a Java Applet in a Carbon Control
|
||||
|
||||
Version: JavaEmbedding-3~36
|
||||
|
||||
Copyright: © 2000-2001 by Apple Computer, Inc., all rights reserved.
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
#ifndef __JAVAAPPLET__
|
||||
#define __JAVAAPPLET__
|
||||
|
||||
#if __MACHO__
|
||||
#ifndef __CORESERVICES__
|
||||
#include <CoreServices/CoreServices.h>
|
||||
#endif
|
||||
|
||||
#ifndef __JAVACONTROL__
|
||||
#include <JavaEmbedding/JavaControl.h>
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#ifndef __CFURL__
|
||||
#include <CFURL.h>
|
||||
#endif
|
||||
|
||||
#ifndef __JAVACONTROL__
|
||||
#include <JavaControl.h>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#if PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=mac68k
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(push, 2)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack(2)
|
||||
#endif
|
||||
|
||||
#if PRAGMA_ENUM_ALWAYSINT
|
||||
#if defined(__fourbyteints__) && !__fourbyteints__
|
||||
#define __JAVAAPPLET__RESTORE_TWOBYTEINTS
|
||||
#pragma fourbyteints on
|
||||
#endif
|
||||
#pragma enumsalwaysint on
|
||||
#elif PRAGMA_ENUM_OPTIONS
|
||||
#pragma option enum=int
|
||||
#elif PRAGMA_ENUM_PACK
|
||||
#if __option(pack_enums)
|
||||
#define __JAVAAPPLET__RESTORE_PACKED_ENUMS
|
||||
#pragma options(!pack_enums)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* AppletDescriptor
|
||||
*
|
||||
* Discussion:
|
||||
* The structure for describing applet. This is used as the
|
||||
* definition of the applet to create when you call CreateJavaApplet.
|
||||
*/
|
||||
struct AppletDescriptor {
|
||||
CFURLRef docBase;
|
||||
CFURLRef codeBase;
|
||||
|
||||
/*
|
||||
* The attributes found in the <applet ...> tag formatted as a
|
||||
* CFDictionary of CFStrings. For attributes like height and width
|
||||
* they should be in screen coordinates. some Applets define them as
|
||||
* % (for example 90%) and should be converted to pixels before put
|
||||
* into the dictionary.
|
||||
*/
|
||||
CFDictionaryRef htmlAttrs;
|
||||
|
||||
/*
|
||||
* The parameters to the applet formatted as a CFDictionary of
|
||||
* CFStrings. These are typically found in <param ...> tags inside of
|
||||
* the applet tag.
|
||||
*/
|
||||
CFDictionaryRef appletParams;
|
||||
};
|
||||
typedef struct AppletDescriptor AppletDescriptor;
|
||||
|
||||
/*
|
||||
* AppletArena
|
||||
*
|
||||
* Discussion:
|
||||
* This is an opaque type that represents an AppletArena - an applet
|
||||
* arena represents a single classloader, so all applets that share
|
||||
* an arena share a common classloader.
|
||||
*/
|
||||
typedef struct OpaqueAppletArena* AppletArena;
|
||||
/*
|
||||
kUniqueArena is the value to pass to CreateJavaApplet if you want the applet to be created
|
||||
in a unique arena. A unique arena is one which is guaranteed not to be shared with
|
||||
any other applet running in this Java VM. This is the appropriate default value to
|
||||
pass to CreateJavaApplet.
|
||||
*/
|
||||
#define kUniqueArena ((AppletArena)NULL)
|
||||
|
||||
/*
|
||||
* JE_ShowDocumentCallback
|
||||
*
|
||||
* Discussion:
|
||||
* Type of a callback function used for show document (link) message
|
||||
* from an applet.
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* applet:
|
||||
* The applet which sent this show document message.
|
||||
*
|
||||
* url:
|
||||
* The url to load.
|
||||
*
|
||||
* windowName:
|
||||
* A string definition of where to open the url. Null means open
|
||||
* in place, other strings are defined in the HTML spec, like
|
||||
* "_top" means the parent window of the applet if it happens to
|
||||
* be in a frame, etc.
|
||||
*
|
||||
* userData:
|
||||
* Data specified when this callback was registered using
|
||||
* RegisterShowDocumentCallback.
|
||||
*/
|
||||
typedef CALLBACK_API_C( void , JE_ShowDocumentCallback )(jobject applet, CFURLRef url, CFStringRef windowName, void *userData);
|
||||
|
||||
/*
|
||||
* JE_SetStatusCallback
|
||||
*
|
||||
* Discussion:
|
||||
* Type of a callback function used for a status message from an
|
||||
* applet.
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* applet:
|
||||
* The applet which sent this status message.
|
||||
*
|
||||
* statusMessage:
|
||||
* The message to be displayed.
|
||||
*
|
||||
* userData:
|
||||
* Data specified when this callback was registered using
|
||||
* RegisterStatusCallback.
|
||||
*/
|
||||
typedef CALLBACK_API_C( void , JE_SetStatusCallback )(jobject applet, CFStringRef statusMessage, void *userData);
|
||||
/*
|
||||
* CreateAppletArena()
|
||||
*
|
||||
* Discussion:
|
||||
* Create an applet arena. By default each applet you create will
|
||||
* have its own "arena". By creating an applet arena, and passing
|
||||
* that arena into two or more CreateJavaApplet calls, those applets
|
||||
* will share a single classloader and thus be able to communicate
|
||||
* with each other through static objects.
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* outNewArena:
|
||||
* The newly created applet arena.
|
||||
*
|
||||
* Availability:
|
||||
* Mac OS X: in version 10.1 and later in Carbon.framework
|
||||
* CarbonLib: not available
|
||||
* Non-Carbon CFM: not available
|
||||
*/
|
||||
extern OSStatus
|
||||
CreateAppletArena(AppletArena * outNewArena);
|
||||
|
||||
|
||||
/*
|
||||
* CreateJavaApplet()
|
||||
*
|
||||
* Discussion:
|
||||
* Creates a java applet from a descriptor.
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* env:
|
||||
* The JNI environment for the current thread.
|
||||
*
|
||||
* applet:
|
||||
* A full descriptor of the applet being loaded. See
|
||||
* AppletDescriptor.
|
||||
*
|
||||
* trusted:
|
||||
* Whether this applet should be loaded as trusted.
|
||||
*
|
||||
* arena:
|
||||
* The arena for this applet. If this is set to null then a new
|
||||
* arena will be created. This is the typcial case for applets.
|
||||
*
|
||||
* outJavaFrame:
|
||||
* The applet itself to be used for registering callbacks and
|
||||
* creating controls.
|
||||
*
|
||||
* Availability:
|
||||
* Mac OS X: in version 10.1 and later in Carbon.framework
|
||||
* CarbonLib: not available
|
||||
* Non-Carbon CFM: not available
|
||||
*/
|
||||
extern OSStatus
|
||||
CreateJavaApplet(
|
||||
JNIEnv * env,
|
||||
AppletDescriptor applet,
|
||||
Boolean trusted,
|
||||
AppletArena arena, /* can be NULL */
|
||||
jobject * outJavaFrame);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* AppletState
|
||||
*
|
||||
* Summary:
|
||||
* Constants that are passed to SetJavaAppletState.
|
||||
*/
|
||||
|
||||
enum AppletState {
|
||||
kAppletStart = 1, /* Starts the applet processing 3.*/
|
||||
kAppletStop = 2, /* Halts the applet, but it can be started again.*/
|
||||
kAppletDestroy = 4 /* Tears down the applet.*/
|
||||
};
|
||||
typedef enum AppletState AppletState;
|
||||
|
||||
|
||||
/*
|
||||
* SetJavaAppletState()
|
||||
*
|
||||
* Discussion:
|
||||
* Sets the state of the current applet as defined by the applet
|
||||
* spec. Applets can be started and stopped many times, but
|
||||
* destroying them is final.
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* env:
|
||||
* The JNI environment for the current VM and thread.
|
||||
*
|
||||
* inAppletFrame:
|
||||
* The applet to register the status callback (from
|
||||
* CreateJavaApplet).
|
||||
*
|
||||
* inNewState:
|
||||
* Host defined data passed into showStatusFunction.
|
||||
*
|
||||
* Availability:
|
||||
* Mac OS X: in version 10.1 and later in Carbon.framework
|
||||
* CarbonLib: not available
|
||||
* Non-Carbon CFM: not available
|
||||
*/
|
||||
extern OSStatus
|
||||
SetJavaAppletState(
|
||||
JNIEnv * env,
|
||||
jobject inAppletFrame,
|
||||
AppletState inNewState);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* RegisterStatusCallback()
|
||||
*
|
||||
* Discussion:
|
||||
* Registers your function that will be called to update the
|
||||
* applet's status area. Status typically is put in a web browser as
|
||||
* a text area at the bottom of the page.
|
||||
*
|
||||
* Note that this callback will be called from a preemptive thread,
|
||||
* and if the host application is using cooperative threads they
|
||||
* will need to push this into their own event system in order to
|
||||
* handle this correctly.
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* env:
|
||||
* The JNI environment for the current VM and thread.
|
||||
*
|
||||
* inJavaFrame:
|
||||
* The applet to register the status callback (from
|
||||
* CreateJavaApplet).
|
||||
*
|
||||
* showStatusFunction:
|
||||
* The function that will be called when the applet calls
|
||||
* showStatus(...).
|
||||
*
|
||||
* userData:
|
||||
* Host defined data passed into showStatusFunction.
|
||||
*
|
||||
* Availability:
|
||||
* Mac OS X: in version 10.1 and later in Carbon.framework
|
||||
* CarbonLib: not available
|
||||
* Non-Carbon CFM: not available
|
||||
*/
|
||||
extern OSStatus
|
||||
RegisterStatusCallback(
|
||||
JNIEnv * env,
|
||||
jobject inJavaFrame,
|
||||
JE_SetStatusCallback showStatusFunction,
|
||||
void * userData);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* RegisterShowDocumentCallback()
|
||||
*
|
||||
* Discussion:
|
||||
* Registers your function that will be called when the applet
|
||||
* behaves like a hyperlink. This will be called to move an
|
||||
* embedding host application to a new URL.
|
||||
*
|
||||
* Note that this callback will be called from a preemptive thread,
|
||||
* and if the host application is using cooperative threads they
|
||||
* will need to push this into their own event system in order to
|
||||
* handle this correctly.
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* env:
|
||||
* The JNI environment for the current VM and thread.
|
||||
*
|
||||
* inJavaFrame:
|
||||
* The applet to register the show document callback (from
|
||||
* CreateJavaApplet).
|
||||
*
|
||||
* showDocumentFunction:
|
||||
* The function that will be called when the applet calls
|
||||
* showDocument().
|
||||
*
|
||||
* userData:
|
||||
* Host defined data passed into showDocumentFunction.
|
||||
*
|
||||
* Result:
|
||||
* An operating system status code.
|
||||
*
|
||||
* Availability:
|
||||
* Mac OS X: in version 10.1 and later in Carbon.framework
|
||||
* CarbonLib: not available
|
||||
* Non-Carbon CFM: not available
|
||||
*/
|
||||
extern OSStatus
|
||||
RegisterShowDocumentCallback(
|
||||
JNIEnv * env,
|
||||
jobject inJavaFrame,
|
||||
JE_ShowDocumentCallback showDocumentFunction,
|
||||
void * userData);
|
||||
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_ENUM_ALWAYSINT
|
||||
#pragma enumsalwaysint reset
|
||||
#ifdef __JAVAAPPLET__RESTORE_TWOBYTEINTS
|
||||
#pragma fourbyteints off
|
||||
#endif
|
||||
#elif PRAGMA_ENUM_OPTIONS
|
||||
#pragma option enum=reset
|
||||
#elif defined(__JAVAAPPLET__RESTORE_PACKED_ENUMS)
|
||||
#pragma options(pack_enums)
|
||||
#endif
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=reset
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(pop)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack()
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __JAVAAPPLET__ */
|
||||
|
||||
@@ -1,461 +0,0 @@
|
||||
/*
|
||||
File: JavaEmbedding/JavaControl.h
|
||||
|
||||
Contains: interface to embedding Java code in a Carbon Control
|
||||
|
||||
Version: JavaEmbedding-3~36
|
||||
|
||||
Copyright: © 2000-2001 by Apple Computer, Inc., all rights reserved.
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
#ifndef __JAVACONTROL__
|
||||
#define __JAVACONTROL__
|
||||
|
||||
#if __MACHO__
|
||||
#ifndef __HITOOLBOX__
|
||||
#include <HIToolbox/HIToolbox.h>
|
||||
#endif
|
||||
|
||||
#include <JavaVM/jni.h>
|
||||
#else
|
||||
#include <jni.h>
|
||||
#endif
|
||||
|
||||
#if PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=mac68k
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(push, 2)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack(2)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Summary:
|
||||
* JavaControl Embedding errors
|
||||
*
|
||||
* Discussion:
|
||||
* The following are all errors which can be returned from the
|
||||
* routines contained in this file. Most are self explanatory.
|
||||
*/
|
||||
enum {
|
||||
errJavaEmbeddingNotYetImplemented = -9950,
|
||||
errJavaEmbeddingIntializationFailed = -9962, /* previously errClassConstructorNotFound, errClassNotFound, and errMethodNotFound*/
|
||||
errJavaEmbeddingMissingURL = -9955, /* previously errMissingURL*/
|
||||
errJavaEmbeddingCouldNotCreateApplet = -9956, /* previously errCouldNotCreateApplet*/
|
||||
errJavaEmbeddingCouldNotEmbedFrame = -9957, /* previously errCouldNotEmbedFrame */
|
||||
errJavaEmbeddingCouldNotConvertURL = -9958, /* previously errCouldNotConvertURL*/
|
||||
errJavaEmbeddingNotAFrame = -9959, /* previously errNotAFrame*/
|
||||
errJavaEmbeddingControlNotEmbedded = -9960, /* previously errControlNotEmbedded*/
|
||||
errJavaEmbeddingExceptionThrown = -9961 /* previously errExceptionThrown*/
|
||||
};
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* MoveAndClipJavaControl()
|
||||
*
|
||||
* Summary:
|
||||
* Positions the control in the containing window, and sets the clip
|
||||
* bounds for drawing.
|
||||
*
|
||||
* Discussion:
|
||||
* All coordinates are local to the host window, and 0,0 is the top
|
||||
* left corner of the content area of the host window - just below
|
||||
* the title bar.
|
||||
* Usually a call to MoveAndClipJavaControl is followed by a call to
|
||||
* DrawJavaControl.
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* env:
|
||||
* The JNI Environment for the current thread.
|
||||
*
|
||||
* theControl:
|
||||
* The Java control (applet).
|
||||
*
|
||||
* posX:
|
||||
* The x position of the control.
|
||||
*
|
||||
* posY:
|
||||
* The y position of the control.
|
||||
*
|
||||
* clipX:
|
||||
* The left of the clip region.
|
||||
*
|
||||
* clipY:
|
||||
* The top of the clip region.
|
||||
*
|
||||
* clipWidth:
|
||||
* The width of the clip region. (Notice this is not right, but
|
||||
* width)
|
||||
*
|
||||
* clipHeight:
|
||||
* The height of the clip region. (Notice this is not bottom, but
|
||||
* height)
|
||||
*
|
||||
* Availability:
|
||||
* Mac OS X: in version 10.1 and later in Carbon.framework
|
||||
* CarbonLib: not available
|
||||
* Non-Carbon CFM: not available
|
||||
*/
|
||||
extern OSStatus
|
||||
MoveAndClipJavaControl(
|
||||
JNIEnv * env,
|
||||
ControlRef theControl,
|
||||
int posX,
|
||||
int posY,
|
||||
int clipX,
|
||||
int clipY,
|
||||
int clipWidth,
|
||||
int clipHeight);
|
||||
|
||||
|
||||
/*
|
||||
* SizeJavaControl()
|
||||
*
|
||||
* Summary:
|
||||
* Sets the size of the Java control.
|
||||
*
|
||||
* Availability:
|
||||
* Mac OS X: in version 10.1 and later in Carbon.framework
|
||||
* CarbonLib: not available
|
||||
* Non-Carbon CFM: not available
|
||||
*/
|
||||
extern OSStatus
|
||||
SizeJavaControl(
|
||||
JNIEnv * env,
|
||||
ControlRef theControl,
|
||||
int width,
|
||||
int height);
|
||||
|
||||
|
||||
/*
|
||||
* ShowHideJavaControl()
|
||||
*
|
||||
* Summary:
|
||||
* Makes a Java control visible or invisible.
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* env:
|
||||
* The JNI Environment for the current thread.
|
||||
*
|
||||
* theControl:
|
||||
* The Java control (applet).
|
||||
*
|
||||
* visible:
|
||||
* True shows the control.
|
||||
*
|
||||
* Availability:
|
||||
* Mac OS X: in version 10.1 and later in Carbon.framework
|
||||
* CarbonLib: not available
|
||||
* Non-Carbon CFM: not available
|
||||
*/
|
||||
extern OSStatus
|
||||
ShowHideJavaControl(
|
||||
JNIEnv * env,
|
||||
ControlRef theControl,
|
||||
Boolean visible);
|
||||
|
||||
|
||||
/*
|
||||
* StopJavaControlAsyncDrawing()
|
||||
*
|
||||
* Summary:
|
||||
* Stops a Java applet from drawing asynchonously.
|
||||
*
|
||||
* Discussion:
|
||||
* Many applets are used for animation and they draw themselves at
|
||||
* times other than when the control is drawn. In order to handle
|
||||
* things like live resize and scrolling a host app must be able to
|
||||
* suspend asynchronous drawing otherwise a draw may occur before
|
||||
* the host app is able to reposition/reclip the control thus
|
||||
* causing drawing in the wrong location. When async drawing is off
|
||||
* normal paint events in an applet are ignored. Only
|
||||
* DrawJavaControl events are allowed to paint. This allows
|
||||
* temporary fine grained control of when an applet can paint, and
|
||||
* should only be used when needed.
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* env:
|
||||
* The JNI Environment for the current thread.
|
||||
*
|
||||
* theControl:
|
||||
* The Java control (applet).
|
||||
*
|
||||
* Availability:
|
||||
* Mac OS X: in version 10.1 and later in Carbon.framework
|
||||
* CarbonLib: not available
|
||||
* Non-Carbon CFM: not available
|
||||
*/
|
||||
extern OSStatus
|
||||
StopJavaControlAsyncDrawing(
|
||||
JNIEnv * env,
|
||||
ControlRef theControl);
|
||||
|
||||
|
||||
/*
|
||||
* RestartJavaControlAsyncDrawing()
|
||||
*
|
||||
* Summary:
|
||||
* Allows a Java applet to draw asynchonously.
|
||||
*
|
||||
* Discussion:
|
||||
* This should be called when it is safe again for an applet to draw
|
||||
* asynchronously. See StopJavaControlAsyncDrawing.
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* env:
|
||||
* The JNI Environment for the current thread.
|
||||
*
|
||||
* theControl:
|
||||
* The Java control (applet).
|
||||
*
|
||||
* Availability:
|
||||
* Mac OS X: in version 10.1 and later in Carbon.framework
|
||||
* CarbonLib: not available
|
||||
* Non-Carbon CFM: not available
|
||||
*/
|
||||
extern OSStatus
|
||||
RestartJavaControlAsyncDrawing(
|
||||
JNIEnv * env,
|
||||
ControlRef theControl);
|
||||
|
||||
|
||||
/*
|
||||
* DrawJavaControl()
|
||||
*
|
||||
* Summary:
|
||||
* Causes a Java control that to be drawn.
|
||||
*
|
||||
* Discussion:
|
||||
* This should be called whenever the host app needs the
|
||||
* applet/control to be redrawn. In the case where Async drawing is
|
||||
* paused, DrawJavaControl will still cause the applet to draw. So
|
||||
* if the host app is stopping async drawing for something like live
|
||||
* scrolling, if there are convenient times the host app should call
|
||||
* DrawJavaControl (usually after a call to MoveAndClipJavaControl)
|
||||
* to provide some feedback to the user.
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* env:
|
||||
* The JNI Environment for the current thread.
|
||||
*
|
||||
* theControl:
|
||||
* The corresponding Java control (applet) that is to be drawn.
|
||||
*
|
||||
* Availability:
|
||||
* Mac OS X: in version 10.1 and later in Carbon.framework
|
||||
* CarbonLib: not available
|
||||
* Non-Carbon CFM: not available
|
||||
*/
|
||||
extern OSStatus
|
||||
DrawJavaControl(
|
||||
JNIEnv * env,
|
||||
ControlRef theControl);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
========================================================================================
|
||||
UTILITY API - functions to determine the status of a window or control
|
||||
========================================================================================
|
||||
*/
|
||||
|
||||
/*
|
||||
* GetJavaWindowFromWindow()
|
||||
*
|
||||
* Discussion:
|
||||
* Given a native Carbon window this returns the corresponding Java
|
||||
* window.
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* env:
|
||||
* The JNI Environment for the current thread.
|
||||
*
|
||||
* inMacWindow:
|
||||
* A reference to a native window.
|
||||
*
|
||||
* outJavaWindow:
|
||||
* The corresponding Java window.
|
||||
*
|
||||
* Availability:
|
||||
* Mac OS X: in version 10.1 and later in Carbon.framework
|
||||
* CarbonLib: not available
|
||||
* Non-Carbon CFM: not available
|
||||
*/
|
||||
extern OSStatus
|
||||
GetJavaWindowFromWindow(
|
||||
JNIEnv * env,
|
||||
WindowRef inMacWindow,
|
||||
jobject * outJavaWindow);
|
||||
|
||||
|
||||
/*
|
||||
* GetWindowFromJavaWindow()
|
||||
*
|
||||
* Discussion:
|
||||
* Given a Java window this returns the corresponding native Carbon
|
||||
* window.
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* env:
|
||||
* The JNI Environment for the current thread.
|
||||
*
|
||||
* inJavaWindow:
|
||||
* A reference to a Java window.
|
||||
*
|
||||
* outMacWindow:
|
||||
* The corresponding native window.
|
||||
*
|
||||
* Availability:
|
||||
* Mac OS X: in version 10.1 and later in Carbon.framework
|
||||
* CarbonLib: not available
|
||||
* Non-Carbon CFM: not available
|
||||
*/
|
||||
extern OSStatus
|
||||
GetWindowFromJavaWindow(
|
||||
JNIEnv * env,
|
||||
jobject inJavaWindow,
|
||||
WindowRef * outMacWindow);
|
||||
|
||||
|
||||
/*
|
||||
* GetJavaFrameFromControl()
|
||||
*
|
||||
* Discussion:
|
||||
* Given an embedded control this returns the corresponding Java
|
||||
* applet frame.
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* env:
|
||||
* The JNI Environment for the current thread.
|
||||
*
|
||||
* inMacControl:
|
||||
* A reference to the control for the applet.
|
||||
*
|
||||
* outJavaFrame:
|
||||
* The applet reference.
|
||||
*
|
||||
* Availability:
|
||||
* Mac OS X: in version 10.1 and later in Carbon.framework
|
||||
* CarbonLib: not available
|
||||
* Non-Carbon CFM: not available
|
||||
*/
|
||||
extern OSStatus
|
||||
GetJavaFrameFromControl(
|
||||
JNIEnv * env,
|
||||
ControlRef inMacControl,
|
||||
jobject * outJavaFrame);
|
||||
|
||||
|
||||
/*
|
||||
* GetControlFromJavaFrame()
|
||||
*
|
||||
* Discussion:
|
||||
* Given a Java applet frame reference this returns the embedded
|
||||
* control.
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* env:
|
||||
* The JNI Environment for the current thread.
|
||||
*
|
||||
* inJavaFrame:
|
||||
* The applet reference obtained from CreateJavaApplet.
|
||||
*
|
||||
* outMacControl:
|
||||
* A reference to the control for the applet.
|
||||
*
|
||||
* Availability:
|
||||
* Mac OS X: in version 10.1 and later in Carbon.framework
|
||||
* CarbonLib: not available
|
||||
* Non-Carbon CFM: not available
|
||||
*/
|
||||
extern OSStatus
|
||||
GetControlFromJavaFrame(
|
||||
JNIEnv * env,
|
||||
jobject inJavaFrame,
|
||||
ControlRef * outMacControl);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* CreateJavaControl()
|
||||
*
|
||||
* Discussion:
|
||||
* Creates a control for the specified applet whose content is drawn
|
||||
* and events processed by java.
|
||||
* All communication to this control should be through the APIs
|
||||
* specified here in JavaControl.h.
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* env:
|
||||
* The JNI Environment for the current thread.
|
||||
*
|
||||
* inNativeWindow:
|
||||
* The carbon window that will host the applet.
|
||||
*
|
||||
* inBounds:
|
||||
* The starting location for the applet.
|
||||
*
|
||||
* inAppletFrame:
|
||||
* The applet reference obtained from CreateJavaApplet.
|
||||
*
|
||||
* inVisible:
|
||||
* True if the applet should start out hidden.
|
||||
*
|
||||
* outControl:
|
||||
* A reference to the control that is created for the applet.
|
||||
*
|
||||
* Availability:
|
||||
* Mac OS X: in version 10.1 and later in Carbon.framework
|
||||
* CarbonLib: not available
|
||||
* Non-Carbon CFM: not available
|
||||
*/
|
||||
extern OSStatus
|
||||
CreateJavaControl(
|
||||
JNIEnv * env,
|
||||
WindowRef inNativeWindow,
|
||||
const Rect * inBounds,
|
||||
jobject inAppletFrame,
|
||||
Boolean inVisible,
|
||||
ControlRef * outControl);
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=reset
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(pop)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack()
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __JAVACONTROL__ */
|
||||
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -1,22 +0,0 @@
|
||||
/*
|
||||
* @(#)jni_md.h 1.12 00/02/02
|
||||
*
|
||||
* Copyright 1996-2000 Sun Microsystems, Inc. All Rights Reserved.
|
||||
*
|
||||
* This software is the proprietary information of Sun Microsystems, Inc.
|
||||
* Use is subject to license terms.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _JAVASOFT_JNI_MD_H_
|
||||
#define _JAVASOFT_JNI_MD_H_
|
||||
|
||||
#define JNIEXPORT
|
||||
#define JNIIMPORT
|
||||
#define JNICALL
|
||||
|
||||
typedef long jint;
|
||||
typedef long long jlong;
|
||||
typedef signed char jbyte;
|
||||
|
||||
#endif /* !_JAVASOFT_JNI_MD_H_ */
|
||||
@@ -1,4 +0,0 @@
|
||||
// MRJPlugin.policy
|
||||
grant codeBase "file:${netscape.oji.plugin.home}/MRJPlugin.jar" {
|
||||
permission java.security.AllPermission;
|
||||
};
|
||||
Binary file not shown.
@@ -1,74 +0,0 @@
|
||||
/* ----- 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 the MRJ Carbon OJI Plugin.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Patrick C. Beard <beard@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 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 ----- */
|
||||
|
||||
/*
|
||||
AWTUtils.java
|
||||
*/
|
||||
|
||||
package netscape.oji;
|
||||
|
||||
|
||||
import java.awt.Container;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Point;
|
||||
|
||||
import com.apple.mrj.internal.awt.PrintingPort;
|
||||
|
||||
public class AWTUtils {
|
||||
/**
|
||||
* Prints the components of a specified Container.
|
||||
*/
|
||||
public static void printContainer(Container container, int printingPort, int originX, int originY, Object notifier) {
|
||||
try {
|
||||
// obtain a graphics object to draw with.
|
||||
PrintingPort printer = new PrintingPort(printingPort, originX, originY);
|
||||
Graphics graphics = printer.getGraphics(container);
|
||||
|
||||
// print the specified container.
|
||||
container.printAll(graphics);
|
||||
|
||||
graphics.dispose();
|
||||
printer.dispose();
|
||||
} finally {
|
||||
// if caller is waiting for this to complete, then notify.
|
||||
if (notifier != null) {
|
||||
synchronized(notifier) {
|
||||
notifier.notifyAll();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
/* ----- 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 the MRJ Carbon OJI Plugin.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Patrick C. Beard <beard@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 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 ----- */
|
||||
|
||||
/*
|
||||
AsyncMessage.h
|
||||
|
||||
Base class for messages that are executed asynchronously, during MRJSession idle time.
|
||||
|
||||
by Patrick C. Beard.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "MRJSession.h"
|
||||
|
||||
class AsyncMessage : public NativeMessage {
|
||||
public:
|
||||
AsyncMessage(MRJSession* session) : mSession(session) {}
|
||||
virtual ~AsyncMessage() {}
|
||||
|
||||
void send(Boolean async = false);
|
||||
|
||||
protected:
|
||||
MRJSession* mSession;
|
||||
};
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,331 +0,0 @@
|
||||
/* ----- 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 the MRJ Carbon OJI Plugin.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Patrick C. Beard <beard@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 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 ----- */
|
||||
|
||||
/*
|
||||
TopLevelFrame.cpp
|
||||
|
||||
An MRJFrame sub-class that manages the behavior of a top-level window
|
||||
running inside the Communicator.
|
||||
|
||||
by Patrick C. Beard.
|
||||
*/
|
||||
|
||||
#include <Controls.h>
|
||||
#include <Events.h>
|
||||
|
||||
#include "EmbeddedFrame.h"
|
||||
#include "EmbeddedFramePluginInstance.h"
|
||||
#include "MRJPlugin.h"
|
||||
#include "MRJSession.h"
|
||||
|
||||
#include "nsIPluginInstancePeer.h"
|
||||
#include "nsIOutputStream.h"
|
||||
#include "JSEvaluator.h"
|
||||
#include "LocalPort.h"
|
||||
#include "StringUtils.h"
|
||||
|
||||
static void UnsetPort(GrafPtr port);
|
||||
|
||||
EmbeddedFrame::EmbeddedFrame(MRJPluginInstance* pluginInstance, JMFrameRef frameRef, JMFrameKind kind,
|
||||
const Rect* initialBounds, Boolean resizeable)
|
||||
: MRJFrame(frameRef),
|
||||
mPluginInstance(NULL), mEvaluator(NULL), mWindow(NULL), mBounds(*initialBounds)
|
||||
{
|
||||
Boolean hasGoAway = true;
|
||||
SInt16 windowProc = documentProc;
|
||||
SInt16 resizeHeight = resizeable ? 15 : 0;
|
||||
|
||||
switch (kind) {
|
||||
case eBorderlessModelessWindowFrame:
|
||||
hasGoAway = false;
|
||||
windowProc = plainDBox;
|
||||
// mBounds.bottom += resizeHeight;
|
||||
resizeable = false;
|
||||
break;
|
||||
case eModelessWindowFrame:
|
||||
case eModelessDialogFrame:
|
||||
hasGoAway = true;
|
||||
windowProc = resizeable ? zoomDocProc : documentProc;
|
||||
// mBounds.bottom += resizeHeight;
|
||||
break;
|
||||
case eModalWindowFrame:
|
||||
hasGoAway = true;
|
||||
// We have to allow resizeable modal windows.
|
||||
windowProc = resizeable ? documentProc : movableDBoxProc;
|
||||
break;
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
// Note: opening a new window on a stream using the following code crashes 4.X browsers.
|
||||
// The problem is that the window has no URL assigned to it, and so some variables are
|
||||
// unitialized and the browser crashes in a call to strlen().
|
||||
|
||||
class NewStreamMessage : public NativeMessage {
|
||||
nsIPluginInstancePeer* mPeer;
|
||||
const char* mType;
|
||||
public:
|
||||
NewStreamMessage(nsIPluginInstancePeer* peer, const char* type) : mPeer(peer), mType(type) {}
|
||||
|
||||
virtual void execute() {
|
||||
nsIOutputStream* output = NULL;
|
||||
if (mPeer->NewStream(mType, "_new", &output) == NS_OK) {
|
||||
// write some data to the stream.
|
||||
output->Close();
|
||||
NS_RELEASE(output);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// open a stream of type "application/x-java-frame", which should cause a full-screen plugin to get created for a Java frame's
|
||||
// behalf. communicate with the other instance via this stream.
|
||||
nsIPluginInstancePeer* peer = NULL;
|
||||
if (pluginInstance->GetPeer(&peer) == NS_OK) {
|
||||
NewStreamMessage msg(peer, "application/x-java-frame");
|
||||
pluginInstance->getSession()->sendMessage(&msg);
|
||||
NS_RELEASE(peer);
|
||||
}
|
||||
|
||||
#else
|
||||
// var w = window.open('', '_new','resizable=no,status=no,width=200,height=200'); d = w.document; d.open(); d.write('<BODY MARGINHEIGHT=0 MARGINWIDTH=0>Hi</BODY>'); d.close();
|
||||
|
||||
static UInt32 embeddedFrameCounter = 0;
|
||||
|
||||
// Use JavaScript to create a window with an <EMBED TYPE="application/x-java-frame"> tag.
|
||||
const char* kEmbeddedFrameScript = "var w = window.open('','__MRJ_JAVA_FRAME_%d__','resizable=no,status=no,width=%d,height=%d,screenX=%d,screenY=%d');"
|
||||
"var d = w.document; d.open();"
|
||||
"d.writeln('<BODY BGCOLOR=#FFFFFF MARGINWIDTH=0 MARGINHEIGHT=0> <EMBED TYPE=application/x-java-frame WIDTH=%d HEIGHT=%d JAVAFRAME=%08X>');"
|
||||
"d.close();";
|
||||
|
||||
int width = mBounds.right - mBounds.left;
|
||||
int height = mBounds.bottom - mBounds.top;
|
||||
int screenX = mBounds.left;
|
||||
int screenY = mBounds.top;
|
||||
|
||||
char* script = new char[::strlen(kEmbeddedFrameScript) + 100];
|
||||
::sprintf(script, kEmbeddedFrameScript, ++embeddedFrameCounter, width, height, screenX, screenY, width, height, this);
|
||||
|
||||
JSEvaluator* evaluator = new JSEvaluator(pluginInstance);
|
||||
evaluator->AddRef();
|
||||
|
||||
// create the window. It will have been created after returning from eval.
|
||||
const char* result = evaluator->eval(script);
|
||||
|
||||
evaluator->Release();
|
||||
|
||||
delete[] script;
|
||||
|
||||
#endif
|
||||
|
||||
if (mWindow != NULL) {
|
||||
Point zeroPt = { 0, 0 };
|
||||
::JMSetFrameVisibility(mFrameRef, mWindow, zeroPt, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
EmbeddedFrame::~EmbeddedFrame()
|
||||
{
|
||||
if (mPluginInstance != NULL)
|
||||
mPluginInstance->setFrame(NULL);
|
||||
|
||||
// make sure the window is hidden (and unregistered with the browser).
|
||||
showHide(false);
|
||||
|
||||
// make sure this port isn't ever current again.
|
||||
::UnsetPort(mWindow);
|
||||
|
||||
// if (mWindow != NULL)
|
||||
// ::DisposeWindow(mWindow);
|
||||
}
|
||||
|
||||
void EmbeddedFrame::setSize(const Rect* newSize)
|
||||
{
|
||||
mBounds = *newSize;
|
||||
|
||||
if (mWindow != NULL) {
|
||||
SInt16 width = newSize->right - newSize->left;
|
||||
SInt16 height = newSize->bottom - newSize->top;
|
||||
::SizeWindow(mWindow, width, height, true);
|
||||
::MoveWindow(mWindow, newSize->left, newSize->top, false);
|
||||
}
|
||||
}
|
||||
|
||||
void EmbeddedFrame::invalRect(const Rect* invalidRect)
|
||||
{
|
||||
if (mWindow != NULL) {
|
||||
::InvalRect(invalidRect);
|
||||
}
|
||||
}
|
||||
|
||||
void EmbeddedFrame::showHide(Boolean visible)
|
||||
{
|
||||
if (mWindow != NULL && visible != IsWindowVisible(mWindow)) {
|
||||
if (visible) {
|
||||
// Have to notify the browser that this window exists, so that it will receive events.
|
||||
::ShowWindow(mWindow);
|
||||
::SelectWindow(mWindow);
|
||||
} else {
|
||||
::HideWindow(mWindow);
|
||||
}
|
||||
|
||||
// ::ShowHide(mWindow, visible);
|
||||
}
|
||||
}
|
||||
|
||||
void EmbeddedFrame::setTitle(const StringPtr title)
|
||||
{
|
||||
if (mWindow != NULL) {
|
||||
::SetWTitle(mWindow, title);
|
||||
}
|
||||
}
|
||||
|
||||
void EmbeddedFrame::checkUpdate()
|
||||
{
|
||||
}
|
||||
|
||||
void EmbeddedFrame::reorder(ReorderRequest request)
|
||||
{
|
||||
switch (request) {
|
||||
case eBringToFront: /* bring the window to front */
|
||||
break;
|
||||
case eSendToBack: /* send the window to back */
|
||||
break;
|
||||
case eSendBehindFront: /* send the window behind the front window */
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void EmbeddedFrame::setResizeable(Boolean resizeable)
|
||||
{
|
||||
// this might have to recreate the window, no?
|
||||
}
|
||||
|
||||
static void computeBounds(WindowRef window, Rect* bounds)
|
||||
{
|
||||
LocalPort port(window);
|
||||
port.Enter();
|
||||
|
||||
Point position = { 0, 0 };
|
||||
::LocalToGlobal(&position);
|
||||
|
||||
*bounds = window->portRect;
|
||||
|
||||
port.Exit();
|
||||
|
||||
::OffsetRect(bounds, position.h, position.v);
|
||||
}
|
||||
|
||||
void EmbeddedFrame::activate(Boolean active)
|
||||
{
|
||||
focusEvent(active);
|
||||
MRJFrame::activate(active);
|
||||
}
|
||||
|
||||
void EmbeddedFrame::click(const EventRecord* event)
|
||||
{
|
||||
Point where = event->where;
|
||||
SInt16 modifiers = event->modifiers;
|
||||
WindowRef hitWindow;
|
||||
short partCode = ::FindWindow(where, &hitWindow);
|
||||
switch (partCode) {
|
||||
case inContent:
|
||||
::SelectWindow(mWindow);
|
||||
MRJFrame::click(event);
|
||||
break;
|
||||
case inDrag:
|
||||
Rect bounds = (**GetGrayRgn()).rgnBBox;
|
||||
DragWindow(mWindow, where, &bounds);
|
||||
computeBounds(mWindow, &mBounds);
|
||||
break;
|
||||
case inGrow:
|
||||
Rect limits = { 30, 30, 5000, 5000 };
|
||||
long result = GrowWindow(mWindow, where, &limits);
|
||||
if (result != 0) {
|
||||
short width = (result & 0xFFFF);
|
||||
short height = (result >> 16) & 0xFFFF;
|
||||
Rect newBounds;
|
||||
topLeft(newBounds) = topLeft(mBounds);
|
||||
newBounds.right = newBounds.left + width;
|
||||
newBounds.bottom = newBounds.top + height;
|
||||
::JMSetFrameSize(mFrameRef, &newBounds);
|
||||
}
|
||||
break;
|
||||
case inGoAway:
|
||||
if (::TrackGoAway(mWindow, where))
|
||||
::JMFrameGoAway(mFrameRef);
|
||||
break;
|
||||
case inZoomIn:
|
||||
case inZoomOut:
|
||||
if (::TrackBox(mWindow, where, partCode)) {
|
||||
ZoomWindow(mWindow, partCode, true);
|
||||
computeBounds(mWindow, &mBounds);
|
||||
::JMSetFrameSize(mFrameRef, &mBounds);
|
||||
}
|
||||
break;
|
||||
case inCollapseBox:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void EmbeddedFrame::setPluginInstance(EmbeddedFramePluginInstance* embeddedInstance)
|
||||
{
|
||||
mPluginInstance = embeddedInstance;
|
||||
}
|
||||
|
||||
void EmbeddedFrame::setWindow(WindowRef window)
|
||||
{
|
||||
mWindow = window;
|
||||
}
|
||||
|
||||
WindowRef EmbeddedFrame::getWindow()
|
||||
{
|
||||
return mWindow;
|
||||
}
|
||||
|
||||
GrafPtr EmbeddedFrame::getPort()
|
||||
{
|
||||
return mWindow;
|
||||
}
|
||||
|
||||
static void UnsetPort(GrafPtr port)
|
||||
{
|
||||
GrafPtr curPort;
|
||||
::GetPort(&curPort);
|
||||
if (curPort == port) {
|
||||
::GetWMgrPort(&port);
|
||||
::SetPort(port);
|
||||
}
|
||||
}
|
||||
@@ -1,87 +0,0 @@
|
||||
/* ----- 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 the MRJ Carbon OJI Plugin.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Patrick C. Beard <beard@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 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 ----- */
|
||||
|
||||
/*
|
||||
EmbeddedFrame.h
|
||||
|
||||
An MRJFrame sub-class that manages the behavior of a top-level window
|
||||
running inside the Communicator.
|
||||
|
||||
by Patrick C. Beard.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "MRJFrame.h"
|
||||
|
||||
#ifndef __MACWINDOWS__
|
||||
#include <MacWindows.h>
|
||||
#endif
|
||||
|
||||
class MRJPluginInstance;
|
||||
class EmbeddedFramePluginInstance;
|
||||
class JSEvaluator;
|
||||
|
||||
class EmbeddedFrame : public MRJFrame {
|
||||
public:
|
||||
EmbeddedFrame(MRJPluginInstance* pluginInstance, JMFrameRef frameRef, JMFrameKind kind, const Rect* initialBounds, Boolean resizeable);
|
||||
virtual ~EmbeddedFrame();
|
||||
|
||||
virtual void setSize(const Rect* newSize);
|
||||
virtual void invalRect(const Rect* invalidRect);
|
||||
virtual void showHide(Boolean visible);
|
||||
virtual void setTitle(const StringPtr title);
|
||||
virtual void checkUpdate();
|
||||
virtual void reorder(ReorderRequest request);
|
||||
virtual void setResizeable(Boolean resizeable);
|
||||
|
||||
virtual void activate(Boolean active);
|
||||
virtual void click(const EventRecord* event);
|
||||
|
||||
void setPluginInstance(EmbeddedFramePluginInstance* embeddedInstance);
|
||||
|
||||
void setWindow(WindowRef window);
|
||||
WindowRef getWindow();
|
||||
|
||||
protected:
|
||||
virtual GrafPtr getPort();
|
||||
|
||||
private:
|
||||
EmbeddedFramePluginInstance* mPluginInstance;
|
||||
JSEvaluator* mEvaluator;
|
||||
WindowRef mWindow;
|
||||
Rect mBounds;
|
||||
};
|
||||
@@ -1,127 +0,0 @@
|
||||
/* ----- 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 the MRJ Carbon OJI Plugin.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Patrick C. Beard <beard@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 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 ----- */
|
||||
|
||||
/*
|
||||
EmbeddedFramePluginInstance.cpp
|
||||
*/
|
||||
|
||||
#include "EmbeddedFramePluginInstance.h"
|
||||
#include "EmbeddedFrame.h"
|
||||
#include "MRJPlugin.h"
|
||||
|
||||
#include "nsIPluginInstancePeer.h"
|
||||
#include "nsIPluginTagInfo.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
EmbeddedFramePluginInstance::EmbeddedFramePluginInstance()
|
||||
: mPeer(NULL), mFrame(NULL)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
}
|
||||
|
||||
EmbeddedFramePluginInstance::~EmbeddedFramePluginInstance()
|
||||
{
|
||||
if (mFrame != NULL)
|
||||
delete mFrame;
|
||||
}
|
||||
|
||||
NS_METHOD EmbeddedFramePluginInstance::Initialize(nsIPluginInstancePeer* peer)
|
||||
{
|
||||
mPeer = peer;
|
||||
NS_ADDREF(mPeer);
|
||||
|
||||
nsIPluginTagInfo* tagInfo = NULL;
|
||||
if (mPeer->QueryInterface(NS_GET_IID(nsIPluginTagInfo), (void**)&tagInfo) == NS_OK) {
|
||||
const char* frameValue = NULL;
|
||||
if (tagInfo->GetAttribute("JAVAFRAME", &frameValue) == NS_OK) {
|
||||
sscanf(frameValue, "%X", &mFrame);
|
||||
}
|
||||
if (mFrame != NULL)
|
||||
mFrame->setPluginInstance(this);
|
||||
NS_RELEASE(tagInfo);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_METHOD EmbeddedFramePluginInstance::GetPeer(nsIPluginInstancePeer* *resultingPeer)
|
||||
{
|
||||
if (mPeer != NULL) {
|
||||
*resultingPeer = mPeer;
|
||||
mPeer->AddRef();
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_METHOD EmbeddedFramePluginInstance::Destroy()
|
||||
{
|
||||
NS_IF_RELEASE(mPeer);
|
||||
|
||||
// assume that Java will release this frame.
|
||||
if (mFrame != NULL) {
|
||||
mFrame->showHide(false);
|
||||
// delete mFrame;
|
||||
mFrame = NULL;
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_METHOD EmbeddedFramePluginInstance::SetWindow(nsPluginWindow* pluginWindow)
|
||||
{
|
||||
if (mFrame != NULL) {
|
||||
if (pluginWindow != NULL)
|
||||
mFrame->setWindow(WindowRef(pluginWindow->window->port));
|
||||
else
|
||||
mFrame->setWindow(NULL);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_METHOD EmbeddedFramePluginInstance::HandleEvent(nsPluginEvent* pluginEvent, PRBool* eventHandled)
|
||||
{
|
||||
if (mFrame != NULL)
|
||||
*eventHandled = mFrame->handleEvent(pluginEvent->event);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void EmbeddedFramePluginInstance::setFrame(EmbeddedFrame* frame)
|
||||
{
|
||||
mFrame = frame;
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS1(EmbeddedFramePluginInstance, nsIPluginInstance)
|
||||
@@ -1,196 +0,0 @@
|
||||
/* ----- 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 the MRJ Carbon OJI Plugin.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Patrick C. Beard <beard@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 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 ----- */
|
||||
|
||||
/*
|
||||
EmbeddedFramePluginInstance.h
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "nsIPluginInstance.h"
|
||||
|
||||
class EmbeddedFrame;
|
||||
class MRJPluginInstance;
|
||||
|
||||
class EmbeddedFramePluginInstance : public nsIPluginInstance {
|
||||
public:
|
||||
EmbeddedFramePluginInstance();
|
||||
virtual ~EmbeddedFramePluginInstance();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
/**
|
||||
* Initializes a newly created plugin instance, passing to it the plugin
|
||||
* instance peer which it should use for all communication back to the browser.
|
||||
*
|
||||
* @param peer - the corresponding plugin instance peer
|
||||
* @result - NS_OK if this operation was successful
|
||||
*/
|
||||
NS_IMETHOD
|
||||
Initialize(nsIPluginInstancePeer* peer);
|
||||
|
||||
/**
|
||||
* Returns a reference back to the plugin instance peer. This method is
|
||||
* used whenever the browser needs to obtain the peer back from a plugin
|
||||
* instance. The implementation of this method should be sure to increment
|
||||
* the reference count on the peer by calling AddRef.
|
||||
*
|
||||
* @param resultingPeer - the resulting plugin instance peer
|
||||
* @result - NS_OK if this operation was successful
|
||||
*/
|
||||
NS_IMETHOD
|
||||
GetPeer(nsIPluginInstancePeer* *resultingPeer);
|
||||
|
||||
/**
|
||||
* Called to instruct the plugin instance to start. This will be called after
|
||||
* the plugin is first created and initialized, and may be called after the
|
||||
* plugin is stopped (via the Stop method) if the plugin instance is returned
|
||||
* to in the browser window's history.
|
||||
*
|
||||
* @result - NS_OK if this operation was successful
|
||||
*/
|
||||
NS_IMETHOD
|
||||
Start(void)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called to instruct the plugin instance to stop, thereby suspending its state.
|
||||
* This method will be called whenever the browser window goes on to display
|
||||
* another page and the page containing the plugin goes into the window's history
|
||||
* list.
|
||||
*
|
||||
* @result - NS_OK if this operation was successful
|
||||
*/
|
||||
NS_IMETHOD
|
||||
Stop(void)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called to instruct the plugin instance to destroy itself. This is called when
|
||||
* it become no longer possible to return to the plugin instance, either because
|
||||
* the browser window's history list of pages is being trimmed, or because the
|
||||
* window containing this page in the history is being closed.
|
||||
*
|
||||
* @result - NS_OK if this operation was successful
|
||||
*/
|
||||
NS_IMETHOD
|
||||
Destroy(void);
|
||||
|
||||
/**
|
||||
* Called when the window containing the plugin instance changes.
|
||||
*
|
||||
* (Corresponds to NPP_SetWindow.)
|
||||
*
|
||||
* @param window - the plugin window structure
|
||||
* @result - NS_OK if this operation was successful
|
||||
*/
|
||||
NS_IMETHOD
|
||||
SetWindow(nsPluginWindow* window);
|
||||
|
||||
/**
|
||||
* Called to tell the plugin that the initial src/data stream is
|
||||
* ready. Expects the plugin to return a nsIPluginStreamListener.
|
||||
*
|
||||
* (Corresponds to NPP_NewStream.)
|
||||
*
|
||||
* @param listener - listener the browser will use to give the plugin the data
|
||||
* @result - NS_OK if this operation was successful
|
||||
*/
|
||||
NS_IMETHOD
|
||||
NewStream(nsIPluginStreamListener** listener)
|
||||
{
|
||||
*listener = NULL;
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called to instruct the plugin instance to print itself to a printer.
|
||||
*
|
||||
* (Corresponds to NPP_Print.)
|
||||
*
|
||||
* @param platformPrint - platform-specific printing information
|
||||
* @result - NS_OK if this operation was successful
|
||||
*/
|
||||
NS_IMETHOD
|
||||
Print(nsPluginPrint* platformPrint)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value of a variable associated with the plugin instance.
|
||||
*
|
||||
* @param variable - the plugin instance variable to get
|
||||
* @param value - the address of where to store the resulting value
|
||||
* @result - NS_OK if this operation was successful
|
||||
*/
|
||||
NS_IMETHOD
|
||||
GetValue(nsPluginInstanceVariable variable, void *value)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles an event. An nsIEventHandler can also get registered with with
|
||||
* nsIPluginManager2::RegisterWindow and will be called whenever an event
|
||||
* comes in for that window.
|
||||
*
|
||||
* Note that for Unix and Mac the nsPluginEvent structure is different
|
||||
* from the old NPEvent structure -- it's no longer the native event
|
||||
* record, but is instead a struct. This was done for future extensibility,
|
||||
* and so that the Mac could receive the window argument too. For Windows
|
||||
* and OS2, it's always been a struct, so there's no change for them.
|
||||
*
|
||||
* (Corresponds to NPP_HandleEvent.)
|
||||
*
|
||||
* @param event - the event to be handled
|
||||
* @param handled - set to PR_TRUE if event was handled
|
||||
* @result - NS_OK if this operation was successful
|
||||
*/
|
||||
NS_IMETHOD
|
||||
HandleEvent(nsPluginEvent* event, PRBool* handled);
|
||||
|
||||
void setFrame(EmbeddedFrame* frame);
|
||||
|
||||
private:
|
||||
nsIPluginInstancePeer* mPeer;
|
||||
MRJPluginInstance* mParentInstance;
|
||||
EmbeddedFrame* mFrame;
|
||||
};
|
||||
@@ -1,174 +0,0 @@
|
||||
/* ----- 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 the MRJ Carbon OJI Plugin.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Patrick C. Beard <beard@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 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 ----- */
|
||||
|
||||
/*
|
||||
EventFilter.cpp
|
||||
|
||||
Provides a generalized event filtering service.
|
||||
|
||||
Patches WaitNextEvent for events, and MenuSelect for menus.
|
||||
|
||||
by Patrick C. Beard.
|
||||
*/
|
||||
|
||||
#include "EventFilter.h"
|
||||
|
||||
#include <MixedMode.h>
|
||||
#include <Memory.h>
|
||||
#include <LowMem.h>
|
||||
#include <Menus.h>
|
||||
#include <Patches.h>
|
||||
#include <Traps.h>
|
||||
|
||||
enum {
|
||||
uppWaitNextEventProcInfo = kPascalStackBased
|
||||
| RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
|
||||
| STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(EventMask)))
|
||||
| STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(EventRecord*)))
|
||||
| STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(UInt32)))
|
||||
| STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(RgnHandle))),
|
||||
uppMenuSelectProcInfo = kPascalStackBased
|
||||
| RESULT_SIZE(SIZE_CODE(sizeof(long)))
|
||||
| STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(Point)))
|
||||
};
|
||||
|
||||
static pascal Boolean NewWaitNextEvent(EventMask eventMask, EventRecord* event, UInt32 sleep, RgnHandle mouseRgn);
|
||||
static pascal long NewMenuSelect(Point where);
|
||||
|
||||
enum {
|
||||
kIsToolboxTrap = (1 << 11)
|
||||
};
|
||||
|
||||
inline TrapType getTrapType(UInt16 trapNum)
|
||||
{
|
||||
return ((trapNum & kIsToolboxTrap) != 0 ? kToolboxTrapType : kOSTrapType);
|
||||
}
|
||||
|
||||
static UniversalProcPtr SwapTrapAddress(UInt16 trapNum, UniversalProcPtr newTrapAddress)
|
||||
{
|
||||
TrapType type = getTrapType(trapNum);
|
||||
UniversalProcPtr oldTrapAddress = NGetTrapAddress(trapNum, type);
|
||||
NSetTrapAddress(newTrapAddress, trapNum, type);
|
||||
return oldTrapAddress;
|
||||
}
|
||||
|
||||
struct Patch {
|
||||
UInt16 trap;
|
||||
RoutineDescriptor descriptor;
|
||||
UniversalProcPtr original;
|
||||
|
||||
void Install() { original = SwapTrapAddress(trap, &descriptor); }
|
||||
void Remove() { SwapTrapAddress(trap, original); original = NULL; }
|
||||
};
|
||||
|
||||
static Patch WaitNextEventPatch = {
|
||||
_WaitNextEvent,
|
||||
BUILD_ROUTINE_DESCRIPTOR(uppWaitNextEventProcInfo, NewWaitNextEvent),
|
||||
NULL
|
||||
};
|
||||
|
||||
static Patch MenuSelectPatch = {
|
||||
_MenuSelect,
|
||||
BUILD_ROUTINE_DESCRIPTOR(uppMenuSelectProcInfo, NewMenuSelect),
|
||||
NULL
|
||||
};
|
||||
|
||||
static EventFilterProcPtr theEventFilter;
|
||||
static MenuFilterProcPtr theMenuFilter;
|
||||
|
||||
OSStatus InstallEventFilters(EventFilterProcPtr eventFilter, MenuFilterProcPtr menuFilter)
|
||||
{
|
||||
if (theEventFilter == NULL) {
|
||||
theEventFilter = eventFilter;
|
||||
theMenuFilter = menuFilter;
|
||||
|
||||
// Patch WNE, which will be used to filter events.
|
||||
WaitNextEventPatch.Install();
|
||||
|
||||
// Patch MenuSelect, which will be used to filter menu selections.
|
||||
MenuSelectPatch.Install();
|
||||
|
||||
return noErr;
|
||||
}
|
||||
return paramErr;
|
||||
}
|
||||
|
||||
OSStatus RemoveEventFilters()
|
||||
{
|
||||
if (theEventFilter != NULL) {
|
||||
WaitNextEventPatch.Remove();
|
||||
MenuSelectPatch.Remove();
|
||||
|
||||
theEventFilter = NULL;
|
||||
theMenuFilter = NULL;
|
||||
|
||||
return noErr;
|
||||
}
|
||||
return paramErr;
|
||||
}
|
||||
|
||||
static pascal Boolean NewWaitNextEvent(EventMask eventMask, EventRecord* event, UInt32 sleep, RgnHandle mouseRgn)
|
||||
{
|
||||
Boolean gotEvent = CALL_FOUR_PARAMETER_UPP(WaitNextEventPatch.original, uppWaitNextEventProcInfo, eventMask, event, sleep, mouseRgn);
|
||||
if (true) {
|
||||
// prevent recursive calls to the filter.
|
||||
static Boolean inFilter = false;
|
||||
if (! inFilter) {
|
||||
inFilter = true;
|
||||
Boolean filteredEvent = theEventFilter(event);
|
||||
if (filteredEvent) {
|
||||
// consume the event by making it a nullEvent.
|
||||
event->what = nullEvent;
|
||||
gotEvent = false;
|
||||
}
|
||||
inFilter = false;
|
||||
}
|
||||
}
|
||||
return gotEvent;
|
||||
}
|
||||
|
||||
static pascal long NewMenuSelect(Point where)
|
||||
{
|
||||
long menuSelection = CALL_ONE_PARAMETER_UPP(MenuSelectPatch.original, uppMenuSelectProcInfo, where);
|
||||
if (menuSelection != 0) {
|
||||
Boolean filteredEvent = theMenuFilter(menuSelection);
|
||||
if (filteredEvent) {
|
||||
// consume the menu selection by zeroing it out.
|
||||
menuSelection = 0;
|
||||
}
|
||||
}
|
||||
return menuSelection;
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
/* ----- 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 the MRJ Carbon OJI Plugin.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Patrick C. Beard <beard@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 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 ----- */
|
||||
|
||||
#pragma once
|
||||
|
||||
/*
|
||||
EventFilter.h
|
||||
|
||||
Provides a generalized event filtering service.
|
||||
|
||||
by Patrick C. Beard.
|
||||
*/
|
||||
|
||||
#ifndef __EVENTS__
|
||||
#include <Events.h>
|
||||
#endif
|
||||
|
||||
typedef Boolean (*EventFilterProcPtr) (EventRecord* event);
|
||||
typedef Boolean (*MenuFilterProcPtr) (long menuSelection);
|
||||
|
||||
OSStatus InstallEventFilters(EventFilterProcPtr eventFilter, MenuFilterProcPtr menuFilter);
|
||||
OSStatus RemoveEventFilters();
|
||||
@@ -1,69 +0,0 @@
|
||||
/* ----- 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 the MRJ Carbon OJI Plugin.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Patrick C. Beard <beard@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 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 ----- */
|
||||
|
||||
/*
|
||||
JNIThread.java
|
||||
|
||||
Provides a communication channel between native threads and Java threads.
|
||||
|
||||
by Patrick C. Beard.
|
||||
*/
|
||||
|
||||
package netscape.oji;
|
||||
|
||||
class JNIThread extends Thread {
|
||||
private int fSecureEnv;
|
||||
|
||||
private JNIThread(int secureEnv) {
|
||||
super("JNIThread->0x" + Integer.toHexString(secureEnv));
|
||||
fSecureEnv = secureEnv;
|
||||
setPriority(NORM_PRIORITY);
|
||||
// setPriority(MAX_PRIORITY);
|
||||
start();
|
||||
}
|
||||
|
||||
public native void run();
|
||||
}
|
||||
|
||||
class JNIRunnable implements Runnable {
|
||||
private int mJavaMessage;
|
||||
|
||||
private JNIRunnable(int javaMessage) {
|
||||
mJavaMessage = javaMessage;
|
||||
}
|
||||
|
||||
public native void run();
|
||||
}
|
||||
@@ -1,80 +0,0 @@
|
||||
/* ----- 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 the MRJ Carbon OJI Plugin.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Patrick C. Beard <beard@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 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 ----- */
|
||||
|
||||
/*
|
||||
JNIUtils.java
|
||||
*/
|
||||
|
||||
package netscape.oji;
|
||||
|
||||
public class JNIUtils {
|
||||
/**
|
||||
* Returns a local reference for a passed-in global reference.
|
||||
*/
|
||||
public static Object NewLocalRef(Object object) {
|
||||
return object;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the currently running thread.
|
||||
*/
|
||||
public static Object GetCurrentThread() {
|
||||
return Thread.currentThread();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Stub SecurityManager class, to expose access to class loaders.
|
||||
*/
|
||||
static class StubSecurityManager extends SecurityManager {
|
||||
public ClassLoader getCurrentClassLoader() {
|
||||
return currentClassLoader();
|
||||
}
|
||||
}
|
||||
|
||||
private static StubSecurityManager stubManager = new StubSecurityManager();
|
||||
|
||||
/**
|
||||
* Returns the current class loader.
|
||||
*/
|
||||
public static Object GetCurrentClassLoader() {
|
||||
return stubManager.getCurrentClassLoader();
|
||||
}
|
||||
|
||||
public static Object GetObjectClassLoader(Object object) {
|
||||
return object.getClass().getClassLoader();
|
||||
}
|
||||
}
|
||||
@@ -1,130 +0,0 @@
|
||||
/* ----- 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 the MRJ Carbon OJI Plugin.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Patrick C. Beard <beard@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 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 ----- */
|
||||
|
||||
/*
|
||||
JSEvaluator.cpp
|
||||
*/
|
||||
|
||||
#include "JSEvaluator.h"
|
||||
#include "MRJPlugin.h"
|
||||
#include "MRJSession.h"
|
||||
#include "MRJMonitor.h"
|
||||
#include "nsIPluginManager.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
extern nsIPluginManager* thePluginManager;
|
||||
|
||||
JSEvaluator::JSEvaluator(MRJPluginInstance* pluginInstance)
|
||||
: mPluginInstance(pluginInstance)
|
||||
{
|
||||
NS_ADDREF(pluginInstance);
|
||||
mSession = pluginInstance->getSession();
|
||||
mJSMonitor = new MRJMonitor(mSession);
|
||||
}
|
||||
|
||||
JSEvaluator::~JSEvaluator()
|
||||
{
|
||||
NS_IF_RELEASE(mPluginInstance);
|
||||
if (mJSMonitor != NULL)
|
||||
delete mJSMonitor;
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS1(JSEvaluator, nsIPluginStreamListener)
|
||||
|
||||
const char* JSEvaluator::eval(const char* script)
|
||||
{
|
||||
JNIEnv* env = mSession->getCurrentEnv();
|
||||
nsIPluginStreamListener* listener = this;
|
||||
|
||||
mJSMonitor->enter();
|
||||
|
||||
while (mScript != NULL) {
|
||||
// some other thread is evaluating a script.
|
||||
mJSMonitor->wait();
|
||||
}
|
||||
|
||||
// construct a "javascript:" URL from the passed-in script.
|
||||
const char* kJavaScriptPrefix = "javascript:";
|
||||
mScript = new char[strlen(kJavaScriptPrefix) + strlen(script) + 1];
|
||||
if (mScript != NULL) {
|
||||
strcpy(mScript, kJavaScriptPrefix);
|
||||
strcat(mScript, script);
|
||||
|
||||
// start an async evaluation of this script.
|
||||
nsresult result = thePluginManager->GetURL((nsIPluginInstance*)mPluginInstance, mScript, NULL, (nsIPluginStreamListener*)this);
|
||||
|
||||
// default result is NULL, in case JavaScript returns undefined value.
|
||||
if (mResult != NULL) {
|
||||
delete[] mResult;
|
||||
mResult = NULL;
|
||||
}
|
||||
|
||||
// need to block until the result is ready.
|
||||
mJSMonitor->wait();
|
||||
|
||||
// can now delete the script.
|
||||
delete[] mScript;
|
||||
mScript = NULL;
|
||||
}
|
||||
|
||||
mJSMonitor->notifyAll();
|
||||
|
||||
mJSMonitor->exit();
|
||||
|
||||
return mResult;
|
||||
}
|
||||
|
||||
NS_METHOD JSEvaluator::OnDataAvailable(nsIPluginStreamInfo* pluginInfo, nsIInputStream* input, PRUint32 length)
|
||||
{
|
||||
// hopefully all our data is available.
|
||||
mResult = new char[length + 1];
|
||||
if (mResult != NULL) {
|
||||
if (input->Read(mResult, length, &length) == NS_OK) {
|
||||
// We've delayed processing the applet tag, because we
|
||||
// don't know the location of the curren document yet.
|
||||
mResult[length] = '\0';
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_METHOD JSEvaluator::OnStopBinding(nsIPluginStreamInfo* pluginInfo, nsresult status)
|
||||
{
|
||||
// the stream has been closed, notify any waiting Java threads.
|
||||
mJSMonitor->notifyAll();
|
||||
return NS_OK;
|
||||
}
|
||||
@@ -1,131 +0,0 @@
|
||||
/* ----- 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 the MRJ Carbon OJI Plugin.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Patrick C. Beard <beard@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 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 ----- */
|
||||
|
||||
/*
|
||||
JSEvaluator.h
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "nsIPluginStreamListener.h"
|
||||
|
||||
#ifndef JNI_H
|
||||
#include "jni.h"
|
||||
#endif
|
||||
|
||||
class MRJMonitor;
|
||||
class MRJSession;
|
||||
class MRJPluginInstance;
|
||||
|
||||
class JSEvaluator : public nsIPluginStreamListener {
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
JSEvaluator(MRJPluginInstance* pluginInstance);
|
||||
virtual ~JSEvaluator();
|
||||
|
||||
const char* eval(const char* script);
|
||||
|
||||
const char* getResult()
|
||||
{
|
||||
return mResult;
|
||||
}
|
||||
|
||||
// nsIPluginStreamListener implementation.
|
||||
|
||||
/**
|
||||
* Notify the observer that the URL has started to load. This method is
|
||||
* called only once, at the beginning of a URL load.<BR><BR>
|
||||
*
|
||||
* @return The return value is currently ignored. In the future it may be
|
||||
* used to cancel the URL load..
|
||||
*/
|
||||
NS_IMETHOD
|
||||
OnStartBinding(nsIPluginStreamInfo* pluginInfo)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* Notify the client that data is available in the input stream. This
|
||||
* method is called whenver data is written into the input stream by the
|
||||
* networking library...<BR><BR>
|
||||
*
|
||||
* @param aIStream The input stream containing the data. This stream can
|
||||
* be either a blocking or non-blocking stream.
|
||||
* @param length The amount of data that was just pushed into the stream.
|
||||
* @return The return value is currently ignored.
|
||||
*/
|
||||
NS_IMETHOD
|
||||
OnDataAvailable(nsIPluginStreamInfo* pluginInfo, nsIInputStream* input, PRUint32 length);
|
||||
|
||||
NS_IMETHOD
|
||||
OnFileAvailable(nsIPluginStreamInfo* pluginInfo, const char* fileName)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/**
|
||||
* Notify the observer that the URL has finished loading. This method is
|
||||
* called once when the networking library has finished processing the
|
||||
* URL transaction initiatied via the nsINetService::Open(...) call.<BR><BR>
|
||||
*
|
||||
* This method is called regardless of whether the URL loaded successfully.<BR><BR>
|
||||
*
|
||||
* @param status Status code for the URL load.
|
||||
* @param msg A text string describing the error.
|
||||
* @return The return value is currently ignored.
|
||||
*/
|
||||
NS_IMETHOD
|
||||
OnStopBinding(nsIPluginStreamInfo* pluginInfo, nsresult status);
|
||||
|
||||
/**
|
||||
* What is this method supposed to do?
|
||||
*/
|
||||
NS_IMETHOD
|
||||
GetStreamType(nsPluginStreamType *result)
|
||||
{
|
||||
*result = nsPluginStreamType_Normal;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
private:
|
||||
MRJPluginInstance* mPluginInstance;
|
||||
MRJSession* mSession;
|
||||
MRJMonitor* mJSMonitor;
|
||||
char* mScript;
|
||||
char* mResult;
|
||||
};
|
||||
@@ -1,82 +0,0 @@
|
||||
/* ----- 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 the MRJ Carbon OJI Plugin.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Patrick C. Beard <beard@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 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 ----- */
|
||||
|
||||
/*
|
||||
JavaMessageQueue.h
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef JNI_H
|
||||
#include "jni.h"
|
||||
#endif
|
||||
|
||||
class Monitor;
|
||||
|
||||
class JavaMessage {
|
||||
public:
|
||||
JavaMessage() : mNext(NULL) {}
|
||||
virtual ~JavaMessage() {}
|
||||
|
||||
void setNext(JavaMessage* next) { mNext = next; }
|
||||
JavaMessage* getNext() { return mNext; }
|
||||
|
||||
virtual void execute(JNIEnv* env) = 0;
|
||||
|
||||
private:
|
||||
JavaMessage* mNext;
|
||||
};
|
||||
|
||||
class JavaMessageQueue {
|
||||
public:
|
||||
JavaMessageQueue(Monitor* monitor);
|
||||
|
||||
void putMessage(JavaMessage* msg);
|
||||
JavaMessage* getMessage();
|
||||
|
||||
void enter();
|
||||
void exit();
|
||||
|
||||
void wait();
|
||||
void wait(long long millis);
|
||||
void notify();
|
||||
|
||||
private:
|
||||
// Message queue.
|
||||
JavaMessage* mFirst;
|
||||
JavaMessage* mLast;
|
||||
Monitor* mMonitor;
|
||||
};
|
||||
@@ -1,118 +0,0 @@
|
||||
/* ----- 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 the MRJ Carbon OJI Plugin.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Patrick C. Beard <beard@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 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 ----- */
|
||||
|
||||
/*
|
||||
JavaVMFramework.cpp
|
||||
|
||||
CFM glue for the JavaVM.framework.
|
||||
|
||||
by Patrick C. Beard.
|
||||
*/
|
||||
|
||||
#include <jni.h>
|
||||
#include <JavaControl.h>
|
||||
|
||||
#include <CFURL.h>
|
||||
#include <CFBundle.h>
|
||||
#include <CFString.h>
|
||||
#include <MacErrors.h>
|
||||
|
||||
static CFBundleRef getBundle(CFStringRef frameworkPath)
|
||||
{
|
||||
CFBundleRef bundle = NULL;
|
||||
|
||||
// Make a CFURLRef from the CFString representation of the bundle's path.
|
||||
// See the Core Foundation URL Services chapter for details.
|
||||
CFURLRef bundleURL = CFURLCreateWithFileSystemPath(NULL, frameworkPath, kCFURLPOSIXPathStyle, true);
|
||||
if (bundleURL != NULL) {
|
||||
bundle = CFBundleCreate(NULL, bundleURL);
|
||||
if (bundle != NULL)
|
||||
CFBundleLoadExecutable(bundle);
|
||||
CFRelease(bundleURL);
|
||||
}
|
||||
|
||||
return bundle;
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
static void* getSystemFunction(CFStringRef functionName)
|
||||
{
|
||||
static CFBundleRef systemBundle = getBundle(CFSTR("/System/Library/Frameworks/System.framework"));
|
||||
if (systemBundle) return CFBundleGetFunctionPointerForName(systemBundle, functionName);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Useful Carbon-CFM debugging tool, printf that goes to the system console.
|
||||
|
||||
typedef int (*printf_proc_ptr) (const char* format, ...);
|
||||
static printf_proc_ptr kprintf = (printf_proc_ptr) getSystemFunction(CFSTR("printf"));
|
||||
|
||||
#endif
|
||||
|
||||
// CFM glue functions for JNI_GetDefaultJavaVMInitArgs & JNI_CreateJavaVM.
|
||||
|
||||
static void* getJavaVMFunction(CFStringRef functionName)
|
||||
{
|
||||
static CFBundleRef javaBundle = getBundle(CFSTR("/System/Library/Frameworks/JavaVM.framework"));
|
||||
if (javaBundle) return CFBundleGetFunctionPointerForName(javaBundle, functionName);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
typedef jint JNICALL (*JNI_GetDefaultJavaVMInitArgs_proc_ptr) (void *args);
|
||||
static JNI_GetDefaultJavaVMInitArgs_proc_ptr _JNI_GetDefaultJavaVMInitArgs = (JNI_GetDefaultJavaVMInitArgs_proc_ptr) getJavaVMFunction(CFSTR("JNI_GetDefaultJavaVMInitArgs"));
|
||||
|
||||
_JNI_IMPORT_OR_EXPORT_ jint JNICALL
|
||||
JNI_GetDefaultJavaVMInitArgs(void *args)
|
||||
{
|
||||
#if DEBUG
|
||||
kprintf("_JNI_GetDefaultJavaVMInitArgs = 0x%08X\n", _JNI_GetDefaultJavaVMInitArgs);
|
||||
#endif
|
||||
if (_JNI_GetDefaultJavaVMInitArgs) return _JNI_GetDefaultJavaVMInitArgs(args);
|
||||
return -1;
|
||||
}
|
||||
|
||||
typedef jint JNICALL (*JNI_CreateJavaVM_proc_ptr) (JavaVM **pvm, void **penv, void *args);
|
||||
static JNI_CreateJavaVM_proc_ptr _JNI_CreateJavaVM = (JNI_CreateJavaVM_proc_ptr) getJavaVMFunction(CFSTR("JNI_CreateJavaVM"));
|
||||
|
||||
_JNI_IMPORT_OR_EXPORT_ jint JNICALL
|
||||
JNI_CreateJavaVM(JavaVM **pvm, void **penv, void *args)
|
||||
{
|
||||
#if DEBUG
|
||||
kprintf("_JNI_CreateJavaVM = 0x%08X\n", _JNI_CreateJavaVM);
|
||||
#endif
|
||||
if (_JNI_CreateJavaVM) return _JNI_CreateJavaVM(pvm, penv, args);
|
||||
return -1;
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,53 +0,0 @@
|
||||
/* ----- 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 the MRJ Carbon OJI Plugin.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Patrick C. Beard <beard@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 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 ----- */
|
||||
|
||||
/*
|
||||
LiveConnectNativeMethods.h
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "nsError.h"
|
||||
|
||||
#include "jni.h"
|
||||
|
||||
class MRJPlugin;
|
||||
|
||||
nsresult InitLiveConnectSupport(MRJPlugin* jvmPlugin);
|
||||
nsresult ShutdownLiveConnectSupport(void);
|
||||
|
||||
jobject Wrap_JSObject(JNIEnv* env, jint js_obj);
|
||||
jint Unwrap_JSObject(JNIEnv* env, jobject java_wrapper_obj);
|
||||
@@ -1,50 +0,0 @@
|
||||
/* ----- 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 the MRJ Carbon OJI Plugin.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Patrick C. Beard <beard@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 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 ----- */
|
||||
|
||||
package netscape.oji;
|
||||
|
||||
/**
|
||||
* This class is designed simply to be loaded into each class loader created
|
||||
* by the ProxyClassLoaderFactory, so that code from that protection domain
|
||||
* will appear on the stack.
|
||||
* @see netscape.oji.ProxyClassLoaderFactory
|
||||
* @see netscape.oji.ProxyClassLoaderFactory.ProxyClassLoader
|
||||
*/
|
||||
public class LiveConnectProxy {
|
||||
public static void run(Runnable r) {
|
||||
r.run();
|
||||
}
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
/* ----- 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 the MRJ Carbon OJI Plugin.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Patrick C. Beard <beard@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 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 ----- */
|
||||
|
||||
/*
|
||||
LocalPort.h
|
||||
|
||||
Simple utility class to put a Quickdraw GrafPort into a known state.
|
||||
|
||||
by Patrick C. Beard.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <Quickdraw.h>
|
||||
|
||||
class LocalPort {
|
||||
public:
|
||||
LocalPort(GrafPtr port)
|
||||
{
|
||||
fPort = port;
|
||||
fOrigin.h = fOrigin.v = 0;
|
||||
}
|
||||
|
||||
LocalPort(GrafPtr port, Point origin)
|
||||
{
|
||||
fPort = port;
|
||||
fOrigin.h = origin.h;
|
||||
fOrigin.v = origin.v;
|
||||
}
|
||||
|
||||
void Enter();
|
||||
void Exit();
|
||||
|
||||
private:
|
||||
GrafPtr fPort;
|
||||
Point fOrigin;
|
||||
GrafPtr fOldPort;
|
||||
Point fOldOrigin;
|
||||
};
|
||||
@@ -1,419 +0,0 @@
|
||||
/* ----- 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 the MRJ Carbon OJI Plugin.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Patrick C. Beard <beard@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 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 ----- */
|
||||
|
||||
/*
|
||||
MRJConsole.cpp
|
||||
|
||||
Implements the JVM console interface.
|
||||
|
||||
by Patrick C. Beard.
|
||||
*/
|
||||
|
||||
#include <Appearance.h>
|
||||
#include <Gestalt.h>
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "MRJConsole.h"
|
||||
#include "MRJPlugin.h"
|
||||
#include "MRJSession.h"
|
||||
#include "TopLevelFrame.h"
|
||||
|
||||
#include "nsIPluginManager2.h"
|
||||
|
||||
extern nsIPluginManager2* thePluginManager2;
|
||||
|
||||
MRJConsole* theConsole = NULL;
|
||||
|
||||
const InterfaceInfo MRJConsole::sInterfaces[] = {
|
||||
{ NS_IJVMCONSOLE_IID, INTERFACE_OFFSET(MRJConsole, nsIJVMConsole) },
|
||||
{ NS_IEVENTHANDLER_IID, INTERFACE_OFFSET(MRJConsole, nsIEventHandler) },
|
||||
};
|
||||
const UInt32 MRJConsole::kInterfaceCount = sizeof(sInterfaces) / sizeof(InterfaceInfo);
|
||||
|
||||
MRJConsole::MRJConsole(MRJPlugin* plugin)
|
||||
: SupportsMixin(this, sInterfaces, kInterfaceCount, (nsIPlugin*) plugin),
|
||||
mPlugin(plugin), mSession(NULL), mIsInitialized(PR_FALSE),
|
||||
mConsoleClass(NULL), mInitMethod(NULL), mDisposeMethod(NULL),
|
||||
mShowMethod(NULL), mHideMethod(NULL), mVisibleMethod(NULL), mPrintMethod(NULL), mFinishMethod(NULL),
|
||||
mResults(NULL), mContext(NULL), mFrame(NULL)
|
||||
{
|
||||
// Initialize();
|
||||
}
|
||||
|
||||
MRJConsole::~MRJConsole()
|
||||
{
|
||||
theConsole = NULL;
|
||||
|
||||
if (mSession != NULL) {
|
||||
JNIEnv* env = mSession->getCurrentEnv();
|
||||
|
||||
if (mConsoleClass != NULL) {
|
||||
if (mDisposeMethod != NULL)
|
||||
env->CallStaticVoidMethod(mConsoleClass, mDisposeMethod);
|
||||
env->DeleteGlobalRef(mConsoleClass);
|
||||
mConsoleClass = NULL;
|
||||
}
|
||||
|
||||
if (mResults != NULL) {
|
||||
env->DeleteGlobalRef(mResults);
|
||||
mResults = NULL;
|
||||
}
|
||||
|
||||
#if !TARGET_CARBON
|
||||
if (mContext != NULL) {
|
||||
JMDisposeAWTContext(mContext);
|
||||
mContext = NULL;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
NS_METHOD MRJConsole::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
||||
{
|
||||
nsresult result = queryInterface(aIID, aInstancePtr);
|
||||
if (result == NS_NOINTERFACE)
|
||||
result = mPlugin->queryInterface(aIID, aInstancePtr);
|
||||
return result;
|
||||
}
|
||||
nsrefcnt MRJConsole::AddRef() { return addRef(); }
|
||||
nsrefcnt MRJConsole::Release() { return release(); }
|
||||
|
||||
#pragma mark ***** MRJConsole *****
|
||||
|
||||
NS_METHOD MRJConsole::Show()
|
||||
{
|
||||
Initialize();
|
||||
|
||||
if (mShowMethod != NULL) {
|
||||
CallConsoleMethod(mShowMethod);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_METHOD MRJConsole::Hide()
|
||||
{
|
||||
Initialize();
|
||||
|
||||
if (mHideMethod != NULL) {
|
||||
CallConsoleMethod(mHideMethod);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_METHOD MRJConsole::IsVisible(PRBool* isVisible)
|
||||
{
|
||||
// don't initialize here, because if we haven't been initialized, it can't be visible.
|
||||
*isVisible = PR_FALSE;
|
||||
if (mVisibleMethod != NULL) {
|
||||
CallConsoleMethod(mVisibleMethod, mResults);
|
||||
jboolean isCopy;
|
||||
JNIEnv* env = mSession->getCurrentEnv();
|
||||
jboolean* elements = env->GetBooleanArrayElements(mResults, &isCopy);
|
||||
*isVisible = elements[0];
|
||||
env->ReleaseBooleanArrayElements(mResults, elements, JNI_ABORT);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// Prints a message to the Java console. The encodingName specifies the
|
||||
// encoding of the message, and if NULL, specifies the default platform
|
||||
// encoding.
|
||||
|
||||
NS_METHOD MRJConsole::Print(const char* msg, const char* encodingName)
|
||||
{
|
||||
Initialize();
|
||||
|
||||
if (mPrintMethod != NULL) {
|
||||
JNIEnv* env = mSession->getCurrentEnv();
|
||||
jstring jmsg = env->NewStringUTF(msg);
|
||||
jvalue args[1]; args[0].l = jmsg;
|
||||
#if TARGET_CARBON
|
||||
// just use JNI?
|
||||
#else
|
||||
JMExecJNIStaticMethodInContext(mContext, env, mConsoleClass, mPrintMethod, 1, args);
|
||||
#endif
|
||||
env->DeleteLocalRef(jmsg);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
// Writes a message to the Java console immediately, in the current thread.
|
||||
|
||||
void MRJConsole::write(const void *message, UInt32 messageLengthInBytes)
|
||||
{
|
||||
if (mPrintMethod != NULL) {
|
||||
char* buffer = new char[messageLengthInBytes + 1];
|
||||
if (buffer != NULL) {
|
||||
memcpy(buffer, message, messageLengthInBytes);
|
||||
buffer[messageLengthInBytes] = '\0';
|
||||
|
||||
JNIEnv* env = mSession->getCurrentEnv();
|
||||
jstring jmsg = env->NewStringUTF(buffer);
|
||||
if (jmsg != NULL) {
|
||||
env->CallStaticVoidMethod(mConsoleClass, mPrintMethod, jmsg);
|
||||
env->DeleteLocalRef(jmsg);
|
||||
}
|
||||
|
||||
delete buffer;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
NS_METHOD MRJConsole::HandleEvent(nsPluginEvent* pluginEvent, PRBool* eventHandled)
|
||||
{
|
||||
*eventHandled = PR_TRUE;
|
||||
|
||||
if (pluginEvent != NULL) {
|
||||
EventRecord* event = pluginEvent->event;
|
||||
|
||||
if (event->what == nullEvent) {
|
||||
// Give MRJ another quantum of time.
|
||||
MRJSession* session = mPlugin->getSession();
|
||||
session->idle(kDefaultJMTime);
|
||||
} else {
|
||||
TopLevelFrame* frame = mFrame;
|
||||
if (frame != NULL) {
|
||||
switch (event->what) {
|
||||
case nsPluginEventType_GetFocusEvent:
|
||||
frame->focusEvent(true);
|
||||
break;
|
||||
|
||||
case nsPluginEventType_LoseFocusEvent:
|
||||
frame->focusEvent(false);
|
||||
break;
|
||||
|
||||
case nsPluginEventType_AdjustCursorEvent:
|
||||
frame->idle(event->modifiers);
|
||||
break;
|
||||
|
||||
case nsPluginEventType_MenuCommandEvent:
|
||||
frame->menuSelected(event->message, event->modifiers);
|
||||
break;
|
||||
|
||||
default:
|
||||
*eventHandled = frame->handleEvent(event);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
OSStatus MRJConsole::CallConsoleMethod(jmethodID method)
|
||||
{
|
||||
JNIEnv* env = mSession->getCurrentEnv();
|
||||
#if TARGET_CARBON
|
||||
// just call directly?
|
||||
env->CallStaticVoidMethod(mConsoleClass, method);
|
||||
return noErr;
|
||||
#else
|
||||
OSStatus status = JMExecJNIStaticMethodInContext(mContext, env, mConsoleClass, method, 0, NULL);
|
||||
env->CallStaticVoidMethod(mConsoleClass, mFinishMethod);
|
||||
return status;
|
||||
#endif
|
||||
}
|
||||
|
||||
OSStatus MRJConsole::CallConsoleMethod(jmethodID method, jobject arg)
|
||||
{
|
||||
JNIEnv* env = mSession->getCurrentEnv();
|
||||
#if TARGET_CARBON
|
||||
// just call directly?
|
||||
env->CallStaticVoidMethod(mConsoleClass, method, arg);
|
||||
return noErr;
|
||||
#else
|
||||
jvalue args[1];
|
||||
args[0].l = arg;
|
||||
OSStatus status = JMExecJNIStaticMethodInContext(mContext, env, mConsoleClass, method, 1, args);
|
||||
env->CallStaticVoidMethod(mConsoleClass, mFinishMethod);
|
||||
return status;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !TARGET_CARBON
|
||||
|
||||
static OSStatus requestFrame(JMAWTContextRef contextRef, JMFrameRef frameRef, JMFrameKind kind,
|
||||
const Rect* initialBounds, Boolean resizeable, JMFrameCallbacks* cb)
|
||||
{
|
||||
extern JMFrameCallbacks theFrameCallbacks;
|
||||
// set up the viewer frame's callbacks.
|
||||
BlockMoveData(&theFrameCallbacks, cb, sizeof(theFrameCallbacks));
|
||||
|
||||
MRJConsole* thisConsole = NULL;
|
||||
OSStatus status = ::JMGetAWTContextData(contextRef, (JMClientData*)&thisConsole);
|
||||
if (status == noErr && thePluginManager2 != NULL) {
|
||||
// Can only do this safely if we are using the new API.
|
||||
TopLevelFrame* frame = new TopLevelFrame(thisConsole, frameRef, kind, initialBounds, resizeable);
|
||||
status = ::JMSetFrameData(frameRef, frame);
|
||||
thisConsole->setFrame(frame);
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
static OSStatus releaseFrame(JMAWTContextRef contextRef, JMFrameRef frameRef)
|
||||
{
|
||||
MRJConsole* thisConsole = NULL;
|
||||
OSStatus status = ::JMGetAWTContextData(contextRef, (JMClientData*)&thisConsole);
|
||||
MRJFrame* thisFrame = NULL;
|
||||
status = ::JMGetFrameData(frameRef, (JMClientData*)&thisFrame);
|
||||
if (thisFrame != NULL) {
|
||||
status = ::JMSetFrameData(frameRef, NULL);
|
||||
thisConsole->setFrame(NULL);
|
||||
delete thisFrame;
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
static SInt16 getUniqueMenuID(JMAWTContextRef contextRef, Boolean isSubmenu)
|
||||
{
|
||||
MRJConsole* thisConsole = NULL;
|
||||
OSStatus status = ::JMGetAWTContextData(contextRef, (JMClientData*)&thisConsole);
|
||||
if (thePluginManager2 != NULL) {
|
||||
PRInt16 menuID;
|
||||
if (thePluginManager2->AllocateMenuID(thisConsole, isSubmenu, &menuID) == NS_OK)
|
||||
return menuID;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
static Boolean appearanceManagerExists()
|
||||
{
|
||||
long response = 0;
|
||||
return (Gestalt(gestaltAppearanceAttr, &response) == noErr && (response & (1 << gestaltAppearanceExists)));
|
||||
}
|
||||
|
||||
static OSStatus JMTextToStr255(JMTextRef textRef, Str255 str)
|
||||
{
|
||||
UInt32 length = 0;
|
||||
OSStatus status = JMGetTextBytes(textRef, kTextEncodingMacRoman, &str[1], sizeof(Str255) - 1, &length);
|
||||
if (status == noErr)
|
||||
str[0] = (unsigned char)(status == noErr ? length : 0);
|
||||
return status;
|
||||
}
|
||||
|
||||
inline int min(int x, int y) { return (x <= y ? x : y); }
|
||||
|
||||
static void push(StringPtr dest, StringPtr str)
|
||||
{
|
||||
int length = dest[0];
|
||||
int newLength = min(255, length + str[0]);
|
||||
if (newLength > length)
|
||||
::BlockMoveData(&str[1], &dest[1] + length, newLength - length);
|
||||
}
|
||||
|
||||
static void exceptionOccurred(JMAWTContextRef context, JMTextRef exceptionName, JMTextRef exceptionMsg, JMTextRef stackTrace)
|
||||
{
|
||||
// why not display this using the Appearance Manager's wizzy new alert?
|
||||
if (appearanceManagerExists()) {
|
||||
OSStatus status;
|
||||
Str255 preason = { '\0' }, pmessage = { '\0'}, ptrace = { '\0' };
|
||||
if (exceptionName != NULL) {
|
||||
status = ::JMTextToStr255(exceptionName, preason);
|
||||
if (exceptionMsg != NULL) {
|
||||
status = ::JMTextToStr255(exceptionMsg, pmessage);
|
||||
push(preason, "\p (");
|
||||
push(preason, pmessage);
|
||||
push(preason, "\p)");
|
||||
}
|
||||
}
|
||||
|
||||
if (stackTrace != NULL)
|
||||
status = ::JMTextToStr255(stackTrace, ptrace);
|
||||
|
||||
SInt16 itemHit = 0;
|
||||
OSErr result = ::StandardAlert(kAlertPlainAlert, preason, ptrace, NULL, &itemHit);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void MRJConsole::Initialize()
|
||||
{
|
||||
if (mIsInitialized)
|
||||
return;
|
||||
|
||||
mSession = mPlugin->getSession();
|
||||
JNIEnv* env = mSession->getCurrentEnv();
|
||||
|
||||
jclass consoleClass = env->FindClass("netscape/oji/MRJConsole");
|
||||
if (consoleClass == NULL) return;
|
||||
mConsoleClass = (jclass) env->NewGlobalRef(consoleClass);
|
||||
|
||||
mInitMethod = env->GetStaticMethodID(consoleClass, "init", "()V");
|
||||
mDisposeMethod = env->GetStaticMethodID(consoleClass, "dispose", "()V");
|
||||
mShowMethod = env->GetStaticMethodID(consoleClass, "show", "()V");
|
||||
mHideMethod = env->GetStaticMethodID(consoleClass, "hide", "()V");
|
||||
mVisibleMethod = env->GetStaticMethodID(consoleClass, "visible", "([Z)V");
|
||||
mPrintMethod = env->GetStaticMethodID(consoleClass, "print", "(Ljava/lang/String;)V");
|
||||
mFinishMethod = env->GetStaticMethodID(consoleClass, "finish", "()V");
|
||||
env->DeleteLocalRef(consoleClass);
|
||||
|
||||
jbooleanArray results = env->NewBooleanArray(1);
|
||||
mResults = (jbooleanArray) env->NewGlobalRef(results);
|
||||
env->DeleteLocalRef(results);
|
||||
|
||||
OSStatus status = noErr;
|
||||
|
||||
#if !TARGET_CARBON
|
||||
// Create an AWT context to work in.
|
||||
JMAWTContextCallbacks callbacks = {
|
||||
kJMVersion, /* should be set to kJMVersion */
|
||||
&requestFrame, /* a new frame is being created. */
|
||||
&releaseFrame, /* an existing frame is being destroyed. */
|
||||
&getUniqueMenuID, /* a new menu will be created with this id. */
|
||||
&exceptionOccurred, /* just some notification that some recent operation caused an exception. You can't do anything really from here. */
|
||||
};
|
||||
status = ::JMNewAWTContext(&mContext, mSession->getSessionRef(), &callbacks, this);
|
||||
#endif
|
||||
|
||||
// Finally, call the Java initialize method, and wait for it to complete.
|
||||
|
||||
if (mInitMethod != NULL && status == noErr)
|
||||
status = CallConsoleMethod(mInitMethod);
|
||||
|
||||
mIsInitialized = (status == noErr);
|
||||
|
||||
if (mIsInitialized)
|
||||
theConsole = this;
|
||||
}
|
||||
@@ -1,241 +0,0 @@
|
||||
/* ----- 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 the MRJ Carbon OJI Plugin.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Patrick C. Beard <beard@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 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 ----- */
|
||||
|
||||
/*
|
||||
MJRConsole.java
|
||||
|
||||
Simple Java console for MRJ.
|
||||
|
||||
All methods are called asynchronously, using JMExecJNIStaticMethodInContext(). After posting
|
||||
each call this way, MRJConsole.finish() is called, which waits on MRJConsole.class. Each
|
||||
public method calls MRJConsole.done(), which notifies. This should probably be changed
|
||||
to a pure Java approach.
|
||||
|
||||
by Patrick C. Beard.
|
||||
*/
|
||||
|
||||
package netscape.oji;
|
||||
|
||||
import java.io.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
|
||||
class ConsoleWindow extends Frame {
|
||||
TextArea text;
|
||||
|
||||
ConsoleWindow(String title) {
|
||||
super("Java Console");
|
||||
|
||||
addWindowListener(
|
||||
new WindowAdapter() {
|
||||
public void windowClosing(WindowEvent e) {
|
||||
hide();
|
||||
}
|
||||
});
|
||||
|
||||
add(text = new TextArea());
|
||||
setSize(300, 200);
|
||||
|
||||
ActionListener dumpThreadsListener =
|
||||
new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
dumpThreads();
|
||||
}
|
||||
};
|
||||
|
||||
// Create a console menu.
|
||||
MenuBar menuBar = new MenuBar();
|
||||
Menu consoleMenu = new Menu("Console");
|
||||
consoleMenu.add(newItem("Dump Threads", dumpThreadsListener));
|
||||
|
||||
menuBar.add(consoleMenu);
|
||||
setMenuBar(menuBar);
|
||||
}
|
||||
|
||||
private MenuItem newItem(String title, ActionListener listener) {
|
||||
MenuItem item = new MenuItem(title);
|
||||
item.addActionListener(listener);
|
||||
return item;
|
||||
}
|
||||
|
||||
public void dumpThreads() {
|
||||
System.out.println("Dumping threads...");
|
||||
}
|
||||
}
|
||||
|
||||
public class MRJConsole {
|
||||
// Save primordial System streams.
|
||||
private static InputStream in;
|
||||
private static PrintStream out;
|
||||
private static PrintStream err;
|
||||
private static ConsoleWindow window;
|
||||
|
||||
native static int readLine(byte[] buffer, int offset, int length);
|
||||
native static void writeLine(byte[] buffer, int offset, int length);
|
||||
|
||||
private static class Input extends InputStream {
|
||||
byte[] buffer = new byte[1024];
|
||||
int position = 0;
|
||||
int count = 0;
|
||||
|
||||
private void fillBuffer() throws EOFException {
|
||||
// int length = readLine(buffer, 0, buffer.length);
|
||||
int length = 1024;
|
||||
if (length == -1)
|
||||
throw new EOFException();
|
||||
count = length;
|
||||
position = 0;
|
||||
}
|
||||
|
||||
public int read() throws IOException {
|
||||
synchronized(this) {
|
||||
if (position >= count)
|
||||
fillBuffer();
|
||||
return buffer[position++];
|
||||
}
|
||||
}
|
||||
|
||||
public int read(byte[] b, int offset, int length) throws IOException {
|
||||
synchronized(this) {
|
||||
// only fill the buffer at the outset, always returns at most one line of data.
|
||||
if (position >= count)
|
||||
fillBuffer();
|
||||
int initialOffset = offset;
|
||||
while (offset < length && position < count) {
|
||||
b[offset++] = buffer[position++];
|
||||
}
|
||||
return (offset - initialOffset);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static class Output extends OutputStream implements Runnable {
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
|
||||
public Output() {
|
||||
Thread flusher = new Thread(this, getClass().getName() + "-Flusher");
|
||||
flusher.setDaemon(true);
|
||||
flusher.start();
|
||||
}
|
||||
|
||||
public synchronized void write(int b) throws IOException {
|
||||
this.buffer.append((char)b);
|
||||
notify();
|
||||
}
|
||||
|
||||
public synchronized void write(byte[] buffer, int offset, int count) throws IOException {
|
||||
this.buffer.append(new String(buffer, 0, offset, count));
|
||||
notify();
|
||||
}
|
||||
|
||||
public synchronized void flush() throws IOException {
|
||||
String value = this.buffer.toString();
|
||||
window.text.append(value);
|
||||
this.buffer.setLength(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* When I/O occurs, it is placed in a StringBuffer, which is flushed in a different thread.
|
||||
* This prevents deadlocks that could occur when the AWT itself is printing messages.
|
||||
*/
|
||||
public synchronized void run() {
|
||||
for (;;) {
|
||||
try {
|
||||
wait();
|
||||
flush();
|
||||
} catch (InterruptedException ie) {
|
||||
} catch (IOException ioe) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static class Error extends Output {}
|
||||
|
||||
public static void init() {
|
||||
in = System.in;
|
||||
out = System.out;
|
||||
err = System.err;
|
||||
|
||||
window = new ConsoleWindow("Java Console");
|
||||
|
||||
System.setIn(new Input());
|
||||
System.setOut(new PrintStream(new Output()));
|
||||
System.setErr(new PrintStream(new Error()));
|
||||
|
||||
done();
|
||||
}
|
||||
|
||||
public static void dispose() {
|
||||
System.setIn(in);
|
||||
System.setOut(out);
|
||||
System.setErr(err);
|
||||
window.dispose();
|
||||
window = null;
|
||||
done();
|
||||
}
|
||||
|
||||
public static void show() {
|
||||
window.show();
|
||||
done();
|
||||
}
|
||||
|
||||
public static void hide() {
|
||||
window.hide();
|
||||
done();
|
||||
}
|
||||
|
||||
public static void visible(boolean[] result) {
|
||||
result[0] = window.isVisible();
|
||||
done();
|
||||
}
|
||||
|
||||
public static void print(String text) {
|
||||
System.out.print(text);
|
||||
done();
|
||||
}
|
||||
|
||||
public static synchronized void finish() {
|
||||
try {
|
||||
MRJConsole.class.wait();
|
||||
} catch (InterruptedException ie) {
|
||||
}
|
||||
}
|
||||
|
||||
private static synchronized void done() {
|
||||
MRJConsole.class.notify();
|
||||
}
|
||||
}
|
||||
@@ -1,223 +0,0 @@
|
||||
/* ----- 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 the MRJ Carbon OJI Plugin.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Patrick C. Beard <beard@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 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 ----- */
|
||||
|
||||
/*
|
||||
MRJFrame.cpp
|
||||
|
||||
Encapsulates a JManager frame.
|
||||
|
||||
by Patrick C. Beard.
|
||||
*/
|
||||
|
||||
#include "MRJFrame.h"
|
||||
#include "LocalPort.h"
|
||||
#include "nsplugindefs.h"
|
||||
|
||||
MRJFrame::MRJFrame(JMFrameRef frameRef)
|
||||
: mFrameRef(frameRef), mActive(false), mFocused(false)
|
||||
{
|
||||
}
|
||||
|
||||
MRJFrame::~MRJFrame()
|
||||
{
|
||||
}
|
||||
|
||||
/* Stub implementations. */
|
||||
void MRJFrame::setSize(const Rect* newSize) {}
|
||||
void MRJFrame::invalRect(const Rect* invalidRect) {}
|
||||
void MRJFrame::showHide(Boolean visible) {}
|
||||
void MRJFrame::setTitle(const StringPtr title) {}
|
||||
void MRJFrame::checkUpdate() {}
|
||||
void MRJFrame::reorder(ReorderRequest request) {}
|
||||
void MRJFrame::setResizeable(Boolean resizeable) {}
|
||||
|
||||
Boolean MRJFrame::handleEvent(const EventRecord* event)
|
||||
{
|
||||
Boolean eventHandled = true;
|
||||
|
||||
switch (event->what) {
|
||||
case nsPluginEventType_AdjustCursorEvent:
|
||||
idle(event->modifiers);
|
||||
break;
|
||||
|
||||
case ::mouseDown:
|
||||
click(event);
|
||||
break;
|
||||
|
||||
case keyDown:
|
||||
case autoKey:
|
||||
keyPress(event->message, event->modifiers);
|
||||
break;
|
||||
|
||||
case keyUp:
|
||||
keyRelease(event->message, event->modifiers);
|
||||
break;
|
||||
|
||||
case updateEvt:
|
||||
update();
|
||||
break;
|
||||
|
||||
case activateEvt:
|
||||
activate((event->modifiers & activeFlag) != 0);
|
||||
break;
|
||||
|
||||
#if 0
|
||||
case osEvt:
|
||||
resume((event->message & resumeFlag) != 0);
|
||||
eventHandled = false;
|
||||
break;
|
||||
#endif
|
||||
|
||||
default:
|
||||
eventHandled = false;
|
||||
break;
|
||||
}
|
||||
|
||||
return eventHandled;
|
||||
}
|
||||
|
||||
void MRJFrame::idle(SInt16 modifiers)
|
||||
{
|
||||
LocalPort port(getPort());
|
||||
port.Enter();
|
||||
|
||||
Point pt;
|
||||
::GetMouse(&pt);
|
||||
::JMFrameMouseOver(mFrameRef, pt, modifiers);
|
||||
|
||||
port.Exit();
|
||||
}
|
||||
|
||||
void MRJFrame::update()
|
||||
{
|
||||
GrafPtr framePort = getPort();
|
||||
if (framePort != NULL)
|
||||
::JMFrameUpdate(mFrameRef, framePort->clipRgn);
|
||||
}
|
||||
|
||||
void MRJFrame::activate(Boolean active)
|
||||
{
|
||||
if (mActive != active) {
|
||||
mActive = active;
|
||||
::JMFrameActivate(mFrameRef, active);
|
||||
}
|
||||
}
|
||||
|
||||
void MRJFrame::focusEvent(Boolean gotFocus)
|
||||
{
|
||||
if (&::JMFrameFocus != NULL) {
|
||||
if (gotFocus != mFocused) {
|
||||
if (gotFocus) {
|
||||
// HACK, until focus really works.
|
||||
if (mActive != gotFocus) {
|
||||
mActive = gotFocus;
|
||||
::JMFrameActivate(mFrameRef, gotFocus);
|
||||
}
|
||||
}
|
||||
mFocused = gotFocus;
|
||||
::JMFrameFocus(mFrameRef, gotFocus);
|
||||
}
|
||||
} else {
|
||||
if (mActive != gotFocus) {
|
||||
mActive = gotFocus;
|
||||
::JMFrameActivate(mFrameRef, gotFocus);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MRJFrame::resume(Boolean inFront)
|
||||
{
|
||||
::JMFrameResume(mFrameRef, inFront);
|
||||
}
|
||||
|
||||
void MRJFrame::click(const EventRecord* event)
|
||||
{
|
||||
// make the frame's port current, and move its origin to (0, 0).
|
||||
// this is needed to transform the mouse click location to frame coordinates.
|
||||
LocalPort port(getPort());
|
||||
port.Enter();
|
||||
|
||||
Point localWhere = event->where;
|
||||
::GlobalToLocal(&localWhere);
|
||||
click(event, localWhere);
|
||||
|
||||
// restore the plugin port's origin, and restore the current port.
|
||||
port.Exit();
|
||||
}
|
||||
|
||||
void MRJFrame::click(const EventRecord* event, Point localWhere)
|
||||
{
|
||||
if (&::JMFrameClickWithEventRecord != NULL)
|
||||
::JMFrameClickWithEventRecord(mFrameRef, localWhere, event);
|
||||
else
|
||||
::JMFrameClick(mFrameRef, localWhere, event->modifiers);
|
||||
}
|
||||
|
||||
void MRJFrame::keyPress(UInt32 message, SInt16 modifiers)
|
||||
{
|
||||
::JMFrameKey(mFrameRef, message & charCodeMask, (message & keyCodeMask) >> 8, modifiers);
|
||||
}
|
||||
|
||||
void MRJFrame::keyRelease(UInt32 message, SInt16 modifiers)
|
||||
{
|
||||
::JMFrameKeyRelease(mFrameRef, message & charCodeMask, (message & keyCodeMask) >> 8, modifiers);
|
||||
}
|
||||
|
||||
void MRJFrame::menuSelected(UInt32 message, SInt16 modifiers)
|
||||
{
|
||||
MenuHandle menu = ::GetMenuHandle(short(message >> 16));
|
||||
if (menu != NULL) {
|
||||
short item = short(message);
|
||||
if (&::JMMenuSelectedWithModifiers != NULL)
|
||||
::JMMenuSelectedWithModifiers(::JMGetFrameContext(mFrameRef), menu, item, modifiers);
|
||||
else
|
||||
::JMMenuSelected(::JMGetFrameContext(mFrameRef), menu, item);
|
||||
}
|
||||
}
|
||||
|
||||
void MRJFrame::print(GrafPtr printingPort, Point frameOrigin)
|
||||
{
|
||||
#if 0
|
||||
// this doesn't work, as Apple hasn't implemented it yet.
|
||||
OSStatus status = JMDrawFrameInPort(mFrameRef, printingPort, frameOrigin, printingPort->clipRgn, false);
|
||||
if (status != noErr) {
|
||||
::MoveTo(10, 12);
|
||||
::TextFont(0);
|
||||
::TextSize(12);
|
||||
::DrawString("\pMRJPlugin: printing failed.");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -1,95 +0,0 @@
|
||||
/* ----- 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 the MRJ Carbon OJI Plugin.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Patrick C. Beard <beard@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 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 ----- */
|
||||
|
||||
/*
|
||||
MRJFrame.h
|
||||
|
||||
Encapsulates a JManager frame.
|
||||
|
||||
by Patrick C. Beard.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef CALL_NOT_IN_CARBON
|
||||
#define CALL_NOT_IN_CARBON 1
|
||||
#endif
|
||||
|
||||
#include "jni.h"
|
||||
#include "JManager.h"
|
||||
|
||||
struct EventRecord;
|
||||
struct nsPluginPrint;
|
||||
|
||||
class MRJFrame {
|
||||
public:
|
||||
MRJFrame(JMFrameRef frameRef);
|
||||
virtual ~MRJFrame();
|
||||
|
||||
/** Methods used to implement the JMFrame callback protocol. */
|
||||
virtual void setSize(const Rect* newSize);
|
||||
virtual void invalRect(const Rect* invalidRect);
|
||||
virtual void showHide(Boolean visible);
|
||||
virtual void setTitle(const StringPtr title);
|
||||
virtual void checkUpdate();
|
||||
virtual void reorder(ReorderRequest request);
|
||||
virtual void setResizeable(Boolean resizeable);
|
||||
|
||||
/** Methods to handle various events. */
|
||||
virtual Boolean handleEvent(const EventRecord* event);
|
||||
|
||||
virtual void idle(SInt16 modifiers);
|
||||
virtual void update();
|
||||
virtual void activate(Boolean active);
|
||||
virtual void resume(Boolean inFront);
|
||||
virtual void click(const EventRecord* event);
|
||||
virtual void click(const EventRecord* event, Point localWhere);
|
||||
virtual void keyPress(UInt32 message, SInt16 modifiers);
|
||||
virtual void keyRelease(UInt32 message, SInt16 modifiers);
|
||||
|
||||
virtual void focusEvent(Boolean gotFocus);
|
||||
virtual void menuSelected(UInt32 message, SInt16 modifiers);
|
||||
|
||||
virtual void print(GrafPtr printingPort, Point frameOrigin);
|
||||
|
||||
protected:
|
||||
virtual GrafPtr getPort() = 0;
|
||||
|
||||
protected:
|
||||
JMFrameRef mFrameRef;
|
||||
Boolean mActive;
|
||||
Boolean mFocused;
|
||||
};
|
||||
@@ -1,138 +0,0 @@
|
||||
/* ----- 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 the MRJ Carbon OJI Plugin.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Patrick C. Beard <beard@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 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 ----- */
|
||||
|
||||
/*
|
||||
MRJMonitor.cpp
|
||||
|
||||
Provides a C++ interface to Java monitors.
|
||||
|
||||
by Patrick C. Beard.
|
||||
*/
|
||||
|
||||
#include "MRJMonitor.h"
|
||||
#include "MRJSession.h"
|
||||
|
||||
MRJMonitor::MRJMonitor(MRJSession* session, jobject monitor)
|
||||
: mSession(session), mMonitor(NULL), mWaitMethod(NULL), mNotifyMethod(NULL), mNotifyAllMethod(NULL)
|
||||
{
|
||||
JNIEnv* env = mSession->getCurrentEnv();
|
||||
jclass javaLangObject = env->FindClass("java/lang/Object");
|
||||
if (javaLangObject != NULL) {
|
||||
// look up method IDs.
|
||||
mWaitMethod = env->GetMethodID(javaLangObject, "wait", "()V");
|
||||
mTimedWaitMethod = env->GetMethodID(javaLangObject, "wait", "(J)V");
|
||||
mNotifyMethod = env->GetMethodID(javaLangObject, "notify", "()V");
|
||||
mNotifyAllMethod = env->GetMethodID(javaLangObject, "notifyAll", "()V");
|
||||
|
||||
Boolean allocateMonitor = (monitor == NULL);
|
||||
if (allocateMonitor)
|
||||
monitor = env->AllocObject(javaLangObject);
|
||||
|
||||
if (monitor != NULL)
|
||||
mMonitor = env->NewGlobalRef(monitor);
|
||||
|
||||
if (allocateMonitor)
|
||||
env->DeleteLocalRef(monitor);
|
||||
|
||||
env->DeleteLocalRef(javaLangObject);
|
||||
}
|
||||
}
|
||||
|
||||
MRJMonitor::~MRJMonitor()
|
||||
{
|
||||
if (mMonitor != NULL) {
|
||||
JNIEnv* env = mSession->getCurrentEnv();
|
||||
env->DeleteGlobalRef(mMonitor);
|
||||
mMonitor = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void MRJMonitor::enter()
|
||||
{
|
||||
JNIEnv* env = mSession->getCurrentEnv();
|
||||
env->MonitorEnter(mMonitor);
|
||||
}
|
||||
|
||||
void MRJMonitor::exit()
|
||||
{
|
||||
JNIEnv* env = mSession->getCurrentEnv();
|
||||
env->MonitorExit(mMonitor);
|
||||
}
|
||||
|
||||
void MRJMonitor::wait()
|
||||
{
|
||||
if (mMonitor != NULL && mWaitMethod != NULL) {
|
||||
JNIEnv* env = mSession->getCurrentEnv();
|
||||
env->MonitorEnter(mMonitor);
|
||||
env->CallVoidMethod(mMonitor, mWaitMethod);
|
||||
env->MonitorExit(mMonitor);
|
||||
}
|
||||
}
|
||||
|
||||
void MRJMonitor::wait(long long millis)
|
||||
{
|
||||
if (mMonitor != NULL && mWaitMethod != NULL) {
|
||||
JNIEnv* env = mSession->getCurrentEnv();
|
||||
env->MonitorEnter(mMonitor);
|
||||
env->CallVoidMethod(mMonitor, mTimedWaitMethod, jlong(millis));
|
||||
env->MonitorExit(mMonitor);
|
||||
}
|
||||
}
|
||||
|
||||
void MRJMonitor::notify()
|
||||
{
|
||||
if (mMonitor != NULL && mNotifyMethod != NULL) {
|
||||
JNIEnv* env = mSession->getCurrentEnv();
|
||||
env->MonitorEnter(mMonitor);
|
||||
env->CallVoidMethod(mMonitor, mNotifyMethod);
|
||||
env->MonitorExit(mMonitor);
|
||||
}
|
||||
}
|
||||
|
||||
void MRJMonitor::notifyAll()
|
||||
{
|
||||
if (mMonitor != NULL && mNotifyAllMethod != NULL) {
|
||||
JNIEnv* env = mSession->getCurrentEnv();
|
||||
env->MonitorEnter(mMonitor);
|
||||
env->CallVoidMethod(mMonitor, mNotifyAllMethod);
|
||||
env->MonitorExit(mMonitor);
|
||||
}
|
||||
}
|
||||
|
||||
jobject MRJMonitor::getObject()
|
||||
{
|
||||
return mMonitor;
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
/* ----- 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 the MRJ Carbon OJI Plugin.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Patrick C. Beard <beard@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 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 ----- */
|
||||
|
||||
/*
|
||||
MRJMonitor.h
|
||||
|
||||
Provides a C++ interface to Java monitors.
|
||||
|
||||
by Patrick C. Beard.
|
||||
*/
|
||||
|
||||
#include "Monitor.h"
|
||||
|
||||
#ifndef JNI_H
|
||||
#include "jni.h"
|
||||
#endif
|
||||
|
||||
class MRJSession;
|
||||
|
||||
class MRJMonitor : public Monitor {
|
||||
public:
|
||||
MRJMonitor(MRJSession* session, jobject monitor = NULL);
|
||||
~MRJMonitor();
|
||||
|
||||
virtual void enter();
|
||||
virtual void exit();
|
||||
|
||||
virtual void wait();
|
||||
virtual void wait(long long millis);
|
||||
virtual void notify();
|
||||
virtual void notifyAll();
|
||||
|
||||
virtual jobject getObject();
|
||||
|
||||
private:
|
||||
MRJSession* mSession;
|
||||
jobject mMonitor;
|
||||
jmethodID mWaitMethod;
|
||||
jmethodID mTimedWaitMethod;
|
||||
jmethodID mNotifyMethod;
|
||||
jmethodID mNotifyAllMethod;
|
||||
};
|
||||
@@ -1,483 +0,0 @@
|
||||
/* ----- 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 the MRJ Carbon OJI Plugin.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Patrick C. Beard <beard@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 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 ----- */
|
||||
|
||||
/*
|
||||
MRJPlugin.h
|
||||
|
||||
MRJPlugin encapsulates the global state of the MRJ plugin as a single COM object.
|
||||
MRJPluginInstance represents an instance of the MRJ plugin.
|
||||
|
||||
by Patrick C. Beard.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "nsIPlugin.h"
|
||||
#include "nsIPluginInstance.h"
|
||||
#include "nsIJVMPlugin.h"
|
||||
#include "nsIJVMConsole.h"
|
||||
#include "nsIJVMPluginInstance.h"
|
||||
#include "nsIThreadManager.h"
|
||||
#include "nsIEventHandler.h"
|
||||
#include "nsIPluginStreamListener.h"
|
||||
#include "SupportsMixin.h"
|
||||
|
||||
class MRJPlugin;
|
||||
class MRJPluginInstance;
|
||||
class MRJSession;
|
||||
class MRJContext;
|
||||
class MRJConsole;
|
||||
|
||||
class nsIJVMManager;
|
||||
|
||||
class MRJPlugin : public nsIPlugin, public nsIJVMPlugin,
|
||||
public nsIJVMConsole, public nsIRunnable,
|
||||
public SupportsMixin {
|
||||
public:
|
||||
MRJPlugin();
|
||||
virtual ~MRJPlugin();
|
||||
|
||||
static nsresult GetService(const nsCID &aCID, const nsIID& aIID, void* *aService);
|
||||
static nsresult GetService(const char* aContractID, const nsIID& aIID, void* *aService);
|
||||
|
||||
// NS_DECL_ISUPPORTS
|
||||
#if USE_SYSTEM_CONSOLE
|
||||
DECL_SUPPORTS_MIXIN
|
||||
#else
|
||||
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
|
||||
NS_IMETHOD_(nsrefcnt) AddRef(void) { return addRef(); }
|
||||
NS_IMETHOD_(nsrefcnt) Release(void) { return release(); }
|
||||
#endif
|
||||
|
||||
// The Release method on NPIPlugin corresponds to NPP_Shutdown.
|
||||
|
||||
// The old NPP_New call has been factored into two plugin instance methods:
|
||||
//
|
||||
// NewInstance -- called once, after the plugin instance is created. This
|
||||
// method is used to initialize the new plugin instance (although the actual
|
||||
// plugin instance object will be created by the plugin manager).
|
||||
//
|
||||
// NPIPluginInstance::Start -- called when the plugin instance is to be
|
||||
// started. This happens in two circumstances: (1) after the plugin instance
|
||||
// is first initialized, and (2) after a plugin instance is returned to
|
||||
// (e.g. by going back in the window history) after previously being stopped
|
||||
// by the Stop method.
|
||||
|
||||
// nsIFactory Methods.
|
||||
|
||||
NS_IMETHOD
|
||||
CreateInstance(nsISupports *aOuter, const nsIID& aIID, void **aResult);
|
||||
|
||||
NS_IMETHOD
|
||||
LockFactory(PRBool aLock) { return NS_ERROR_NOT_IMPLEMENTED; }
|
||||
|
||||
// nsIPlugin Methods.
|
||||
|
||||
/**
|
||||
* Creates a new plugin instance, based on the MIME type. This
|
||||
* allows different impelementations to be created depending on
|
||||
* the specified MIME type.
|
||||
*/
|
||||
NS_IMETHOD CreatePluginInstance(nsISupports *aOuter, REFNSIID aIID,
|
||||
const char* aPluginMIMEType,
|
||||
void **aResult);
|
||||
|
||||
/**
|
||||
* Initializes the plugin and will be called before any new instances are
|
||||
* created. This separates out the phase when a plugin is loaded just to
|
||||
* query for its mime type from the phase when a plugin is used for real.
|
||||
* The plugin should load up any resources at this point.
|
||||
* @result - NS_OK if this operation was successful
|
||||
*/
|
||||
NS_IMETHOD
|
||||
Initialize(void);
|
||||
|
||||
/**
|
||||
* Called when the browser is done with the plugin factory, or when
|
||||
* the plugin is disabled by the user.
|
||||
*
|
||||
* (Corresponds to NPP_Shutdown.)
|
||||
*
|
||||
* @result - NS_OK if this operation was successful
|
||||
*/
|
||||
NS_IMETHOD
|
||||
Shutdown(void);
|
||||
|
||||
/**
|
||||
* Returns the MIME description for the plugin. The MIME description
|
||||
* is a colon-separated string containg the plugin MIME type, plugin
|
||||
* data file extension, and plugin name, e.g.:
|
||||
*
|
||||
* "application/x-simple-plugin:smp:Simple LiveConnect Sample Plug-in"
|
||||
*
|
||||
* (Corresponds to NPP_GetMIMEDescription.)
|
||||
*
|
||||
* @param resultingDesc - the resulting MIME description
|
||||
* @result - NS_OK if this operation was successful
|
||||
*/
|
||||
NS_IMETHOD
|
||||
GetMIMEDescription(const char* *result);
|
||||
|
||||
/**
|
||||
* Returns the value of a variable associated with the plugin.
|
||||
*
|
||||
* (Corresponds to NPP_GetValue.)
|
||||
*
|
||||
* @param variable - the plugin variable to get
|
||||
* @param value - the address of where to store the resulting value
|
||||
* @result - NS_OK if this operation was successful
|
||||
*/
|
||||
NS_IMETHOD
|
||||
GetValue(nsPluginVariable variable, void *value);
|
||||
|
||||
// nsIJVMPlugin Methods.
|
||||
|
||||
// This method us used to start the Java virtual machine.
|
||||
// It sets up any global state necessary to host Java programs.
|
||||
// Note that calling this method is distinctly separate from
|
||||
// initializing the nsIJVMPlugin object (done by the Initialize
|
||||
// method).
|
||||
nsresult
|
||||
StartupJVM(void);
|
||||
|
||||
// Causes the JVM to append a new directory to its classpath.
|
||||
// If the JVM doesn't support this operation, an error is returned.
|
||||
NS_IMETHOD
|
||||
AddToClassPath(const char* dirPath);
|
||||
|
||||
// Causes the JVM to remove a directory from its classpath.
|
||||
// If the JVM doesn't support this operation, an error is returned.
|
||||
NS_IMETHOD
|
||||
RemoveFromClassPath(const char* dirPath)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
// Returns the current classpath in use by the JVM.
|
||||
NS_IMETHOD
|
||||
GetClassPath(const char* *result);
|
||||
|
||||
NS_IMETHOD
|
||||
GetJavaWrapper(JNIEnv* env, jint jsobj, jobject *jobj);
|
||||
|
||||
/**
|
||||
* This creates a new secure communication channel with Java. The second parameter,
|
||||
* nativeEnv, if non-NULL, will be the actual thread for Java communication.
|
||||
* Otherwise, a new thread should be created.
|
||||
* @param proxyEnv the env to be used by all clients on the browser side
|
||||
* @return outSecureEnv the secure environment used by the proxyEnv
|
||||
*/
|
||||
NS_IMETHOD
|
||||
CreateSecureEnv(JNIEnv* proxyEnv, nsISecureEnv* *outSecureEnv);
|
||||
|
||||
/**
|
||||
* Gives time to the JVM from the main event loop of the browser. This is
|
||||
* necessary when there aren't any plugin instances around, but Java threads exist.
|
||||
*/
|
||||
NS_IMETHOD
|
||||
SpendTime(PRUint32 timeMillis);
|
||||
|
||||
NS_IMETHOD
|
||||
UnwrapJavaWrapper(JNIEnv* jenv, jobject jobj, jint* obj);
|
||||
|
||||
|
||||
// nsIJVMConsole methods
|
||||
|
||||
NS_IMETHOD
|
||||
Show(void);
|
||||
|
||||
NS_IMETHOD
|
||||
Hide(void);
|
||||
|
||||
NS_IMETHOD
|
||||
IsVisible(PRBool *result);
|
||||
|
||||
NS_IMETHOD
|
||||
Print(const char* msg, const char* encodingName = NULL);
|
||||
|
||||
// nsIRunnable methods
|
||||
|
||||
/**
|
||||
* The Run method gives time to the JVM periodically. This makes SpendTIme() obsolete.
|
||||
*/
|
||||
NS_IMETHOD
|
||||
Run();
|
||||
|
||||
// NON-INTERFACE methods, for internal use only.
|
||||
|
||||
MRJSession* getSession();
|
||||
nsIJVMManager* getManager();
|
||||
nsIThreadManager* getThreadManager();
|
||||
|
||||
MRJPluginInstance* getPluginInstance(jobject applet);
|
||||
MRJPluginInstance* getPluginInstance(JNIEnv* jenv);
|
||||
|
||||
Boolean inPluginThread();
|
||||
|
||||
private:
|
||||
nsIJVMManager* mManager;
|
||||
nsIThreadManager* mThreadManager;
|
||||
MRJSession* mSession;
|
||||
MRJConsole* mConsole;
|
||||
nsPluginThread *mPluginThreadID;
|
||||
Boolean mIsEnabled;
|
||||
|
||||
// support for SupportsMixin.
|
||||
static const InterfaceInfo sInterfaces[];
|
||||
static const UInt32 kInterfaceCount;
|
||||
};
|
||||
|
||||
class MRJPluginInstance : public nsIPluginInstance, public nsIJVMPluginInstance,
|
||||
public nsIEventHandler, public nsIPluginStreamListener,
|
||||
private SupportsMixin {
|
||||
public:
|
||||
MRJPluginInstance(MRJPlugin* plugin);
|
||||
virtual ~MRJPluginInstance();
|
||||
|
||||
// NS_DECL_ISUPPORTS
|
||||
DECL_SUPPORTS_MIXIN
|
||||
|
||||
// (Corresponds to NPP_HandleEvent.)
|
||||
NS_IMETHOD
|
||||
HandleEvent(nsPluginEvent* event, PRBool* handled);
|
||||
|
||||
/**
|
||||
* Initializes a newly created plugin instance, passing to it the plugin
|
||||
* instance peer which it should use for all communication back to the browser.
|
||||
*
|
||||
* @param peer - the corresponding plugin instance peer
|
||||
* @result - NS_OK if this operation was successful
|
||||
*/
|
||||
NS_IMETHOD
|
||||
Initialize(nsIPluginInstancePeer* peer);
|
||||
|
||||
/**
|
||||
* Returns a reference back to the plugin instance peer. This method is
|
||||
* used whenever the browser needs to obtain the peer back from a plugin
|
||||
* instance. The implementation of this method should be sure to increment
|
||||
* the reference count on the peer by calling AddRef.
|
||||
*
|
||||
* @param resultingPeer - the resulting plugin instance peer
|
||||
* @result - NS_OK if this operation was successful
|
||||
*/
|
||||
NS_IMETHOD
|
||||
GetPeer(nsIPluginInstancePeer* *result);
|
||||
|
||||
/**
|
||||
* Called to instruct the plugin instance to start. This will be called after
|
||||
* the plugin is first created and initialized, and may be called after the
|
||||
* plugin is stopped (via the Stop method) if the plugin instance is returned
|
||||
* to in the browser window's history.
|
||||
*
|
||||
* @result - NS_OK if this operation was successful
|
||||
*/
|
||||
NS_IMETHOD
|
||||
Start(void);
|
||||
|
||||
/**
|
||||
* Called to instruct the plugin instance to stop, thereby suspending its state.
|
||||
* This method will be called whenever the browser window goes on to display
|
||||
* another page and the page containing the plugin goes into the window's history
|
||||
* list.
|
||||
*
|
||||
* @result - NS_OK if this operation was successful
|
||||
*/
|
||||
NS_IMETHOD
|
||||
Stop(void);
|
||||
|
||||
/**
|
||||
* Called to instruct the plugin instance to destroy itself. This is called when
|
||||
* it become no longer possible to return to the plugin instance, either because
|
||||
* the browser window's history list of pages is being trimmed, or because the
|
||||
* window containing this page in the history is being closed.
|
||||
*
|
||||
* @result - NS_OK if this operation was successful
|
||||
*/
|
||||
NS_IMETHOD
|
||||
Destroy(void);
|
||||
|
||||
/**
|
||||
* Called when the window containing the plugin instance changes.
|
||||
*
|
||||
* (Corresponds to NPP_SetWindow.)
|
||||
*
|
||||
* @param window - the plugin window structure
|
||||
* @result - NS_OK if this operation was successful
|
||||
*/
|
||||
NS_IMETHOD
|
||||
SetWindow(nsPluginWindow* window);
|
||||
|
||||
/**
|
||||
* Called to tell the plugin that the initial src/data stream is
|
||||
* ready. Expects the plugin to return a nsIPluginStreamListener.
|
||||
*
|
||||
* (Corresponds to NPP_NewStream.)
|
||||
*
|
||||
* @param listener - listener the browser will use to give the plugin the data
|
||||
* @result - NS_OK if this operation was successful
|
||||
*/
|
||||
NS_IMETHOD
|
||||
NewStream(nsIPluginStreamListener** listener)
|
||||
{
|
||||
*listener = this;
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called to instruct the plugin instance to print itself to a printer.
|
||||
*
|
||||
* (Corresponds to NPP_Print.)
|
||||
*
|
||||
* @param platformPrint - platform-specific printing information
|
||||
* @result - NS_OK if this operation was successful
|
||||
*/
|
||||
NS_IMETHOD
|
||||
Print(nsPluginPrint* platformPrint);
|
||||
|
||||
/**
|
||||
* Returns the value of a variable associated with the plugin instance.
|
||||
*
|
||||
* @param variable - the plugin instance variable to get
|
||||
* @param value - the address of where to store the resulting value
|
||||
* @result - NS_OK if this operation was successful
|
||||
*/
|
||||
NS_IMETHOD
|
||||
GetValue(nsPluginInstanceVariable variable, void *value);
|
||||
|
||||
// nsIJVMPluginInstance methods.
|
||||
|
||||
// This method is called when LiveConnect wants to find the Java object
|
||||
// associated with this plugin instance, e.g. the Applet or JavaBean object.
|
||||
NS_IMETHOD
|
||||
GetJavaObject(jobject *result);
|
||||
|
||||
NS_IMETHOD
|
||||
GetText(const char* *result)
|
||||
{
|
||||
*result = NULL;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// nsIPluginStreamListener implementation.
|
||||
|
||||
/**
|
||||
* Notify the observer that the URL has started to load. This method is
|
||||
* called only once, at the beginning of a URL load.<BR><BR>
|
||||
*
|
||||
* @return The return value is currently ignored. In the future it may be
|
||||
* used to cancel the URL load..
|
||||
*/
|
||||
NS_IMETHOD
|
||||
OnStartBinding(nsIPluginStreamInfo* pluginInfo)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* Notify the client that data is available in the input stream. This
|
||||
* method is called whenver data is written into the input stream by the
|
||||
* networking library...<BR><BR>
|
||||
*
|
||||
* @param aIStream The input stream containing the data. This stream can
|
||||
* be either a blocking or non-blocking stream.
|
||||
* @param length The amount of data that was just pushed into the stream.
|
||||
* @return The return value is currently ignored.
|
||||
*/
|
||||
NS_IMETHOD
|
||||
OnDataAvailable(nsIPluginStreamInfo* pluginInfo, nsIInputStream* input, PRUint32 length);
|
||||
|
||||
NS_IMETHOD
|
||||
OnFileAvailable(nsIPluginStreamInfo* pluginInfo, const char* fileName)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/**
|
||||
* Notify the observer that the URL has finished loading. This method is
|
||||
* called once when the networking library has finished processing the
|
||||
* URL transaction initiatied via the nsINetService::Open(...) call.<BR><BR>
|
||||
*
|
||||
* This method is called regardless of whether the URL loaded successfully.<BR><BR>
|
||||
*
|
||||
* @param status Status code for the URL load.
|
||||
* @param msg A text string describing the error.
|
||||
* @return The return value is currently ignored.
|
||||
*/
|
||||
NS_IMETHOD
|
||||
OnStopBinding(nsIPluginStreamInfo* pluginInfo, nsresult status)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* What is this method supposed to do?
|
||||
*/
|
||||
NS_IMETHOD
|
||||
GetStreamType(nsPluginStreamType *result)
|
||||
{
|
||||
*result = nsPluginStreamType_Normal;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// Accessing the list of instances.
|
||||
static MRJPluginInstance* getInstances(void);
|
||||
MRJPluginInstance* getNextInstance(void);
|
||||
|
||||
MRJContext* getContext(void);
|
||||
MRJSession* getSession(void);
|
||||
|
||||
private:
|
||||
void pushInstance(void);
|
||||
void popInstance(void);
|
||||
void inspectInstance(Boolean isUpdateEvt);
|
||||
|
||||
private:
|
||||
nsIPluginInstancePeer* mPeer;
|
||||
nsIWindowlessPluginInstancePeer* mWindowlessPeer;
|
||||
MRJPlugin* mPlugin;
|
||||
MRJSession* mSession;
|
||||
MRJContext* mContext;
|
||||
jobject mApplet;
|
||||
nsPluginWindow* mPluginWindow;
|
||||
|
||||
// maintain a list of instances.
|
||||
MRJPluginInstance* mNext;
|
||||
|
||||
// support for SupportsMixin.
|
||||
static const InterfaceInfo sInterfaces[];
|
||||
static const UInt32 kInterfaceCount;
|
||||
};
|
||||
@@ -1,48 +0,0 @@
|
||||
/* ----- 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 the MRJ Carbon OJI Plugin.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Patrick C. Beard <beard@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 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 ----- */
|
||||
|
||||
/*
|
||||
MRJPluginCarbon_config.h
|
||||
|
||||
Global configuration defines used by the MRJ plugin.
|
||||
|
||||
by Patrick C. Beard.
|
||||
*/
|
||||
|
||||
#define TARGET_CARBON 1
|
||||
#define USE_SYSTEM_CONSOLE 1
|
||||
|
||||
#include <MacHeadersCarbon.h>
|
||||
@@ -1,48 +0,0 @@
|
||||
/* ----- 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 the MRJ Carbon OJI Plugin.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Patrick C. Beard <beard@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 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 ----- */
|
||||
|
||||
/*
|
||||
MRJPlugin_4.x_config.h
|
||||
|
||||
Global configuration defines used by the MRJ plugin.
|
||||
|
||||
by Patrick C. Beard.
|
||||
*/
|
||||
|
||||
#include "MacHeaders.h"
|
||||
|
||||
#define MRJPLUGIN_4X 1
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
/* ----- 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 the MRJ Carbon OJI Plugin.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Patrick C. Beard <beard@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 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 ----- */
|
||||
|
||||
/*
|
||||
MRJPlugin_GC_config.h
|
||||
|
||||
Global configuration defines used by the MRJ plugin.
|
||||
|
||||
by Patrick C. Beard.
|
||||
*/
|
||||
|
||||
#include "MacHeaders.h"
|
||||
|
||||
#define MRJPLUGIN_GC 1
|
||||
@@ -1,47 +0,0 @@
|
||||
/* ----- 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 the MRJ Carbon OJI Plugin.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Patrick C. Beard <beard@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 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 ----- */
|
||||
|
||||
/*
|
||||
MRJPlugin_config.h
|
||||
|
||||
Global configuration defines used by the MRJ plugin.
|
||||
|
||||
by Patrick C. Beard.
|
||||
*/
|
||||
|
||||
#include "MacHeaders.h"
|
||||
|
||||
/* #define NEW_PLUGIN_STREAM_API */
|
||||
@@ -1,59 +0,0 @@
|
||||
/* ----- 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 the MRJ Carbon OJI Plugin.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Patrick C. Beard <beard@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 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 ----- */
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "nsISecurityContext.h"
|
||||
|
||||
class nsILiveconnect;
|
||||
|
||||
class MRJSecurityContext : public nsISecurityContext {
|
||||
public:
|
||||
MRJSecurityContext(const char* location);
|
||||
~MRJSecurityContext();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
NS_IMETHOD Implies(const char* target, const char* action, PRBool *bAllowedAccess);
|
||||
NS_IMETHOD GetOrigin(char* buf, int len);
|
||||
NS_IMETHOD GetCertificateID(char* buf, int len);
|
||||
|
||||
nsILiveconnect* getConnection() { return mConnection; }
|
||||
|
||||
private:
|
||||
char* mLocation;
|
||||
nsILiveconnect* mConnection;
|
||||
};
|
||||
@@ -1,105 +0,0 @@
|
||||
/* ----- 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 the MRJ Carbon OJI Plugin.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Patrick C. Beard <beard@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 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 ----- */
|
||||
|
||||
package netscape.oji;
|
||||
|
||||
import java.io.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
import java.util.Date;
|
||||
import java.util.Properties;
|
||||
import java.net.URL;
|
||||
|
||||
/**
|
||||
* Performs startup actions on behalf of the MRJ plugin.
|
||||
* 1. Sends System.out/err to a specified disk file.
|
||||
* 2. Installs an appropriate security manager for
|
||||
* integrating with the Netscape 6 security system.
|
||||
*/
|
||||
public class MRJSession {
|
||||
// Save primordial System streams.
|
||||
private static PrintStream out;
|
||||
private static PrintStream err;
|
||||
private static PrintStream console;
|
||||
|
||||
private static Properties loadProperties(String pluginHome) {
|
||||
Properties props = new Properties();
|
||||
try {
|
||||
InputStream propsStream = new FileInputStream(pluginHome + "/MRJPlugin.properties");
|
||||
props.load(propsStream);
|
||||
propsStream.close();
|
||||
} catch (IOException ex) {
|
||||
}
|
||||
return props;
|
||||
}
|
||||
|
||||
public static void open(String consolePath) throws IOException {
|
||||
String pluginHome = System.getProperty("netscape.oji.plugin.home");
|
||||
Properties props = loadProperties(pluginHome);
|
||||
boolean append = Boolean.valueOf(props.getProperty("netscape.oji.plugin.console.append")).booleanValue();
|
||||
|
||||
// redirect I/O to specified file.
|
||||
MRJSession.out = System.out;
|
||||
MRJSession.err = System.err;
|
||||
console = new PrintStream(new FileOutputStream(consolePath, append));
|
||||
System.setOut(console);
|
||||
System.setErr(console);
|
||||
|
||||
Date date = new Date();
|
||||
String version = props.getProperty("netscape.oji.plugin.version");
|
||||
System.out.println("MRJ Plugin for Mac OS X v" + version);
|
||||
System.out.println("[starting up Java Applet Security @ " + date + "]");
|
||||
|
||||
// bring up MRJ Applet Security.
|
||||
if (System.getSecurityManager() == null) {
|
||||
try {
|
||||
// make sure that the classes in MRJPlugin.jar are granted all permissions.
|
||||
// see p. 117 of "Inside Java 2 Platform Security" for more information.
|
||||
System.setProperty("java.security.policy", "file:" + pluginHome + "/MRJPlugin.policy");
|
||||
String name = props.getProperty("netscape.oji.plugin.security");
|
||||
SecurityManager securityManager = (SecurityManager) Class.forName(name).newInstance();
|
||||
System.setSecurityManager(securityManager);
|
||||
} catch (Exception ex) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void close() throws IOException {
|
||||
System.setOut(MRJSession.out);
|
||||
System.setErr(MRJSession.err);
|
||||
console.close();
|
||||
}
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
/* ----- 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 the MRJ Carbon OJI Plugin.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Patrick C. Beard <beard@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 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 ----- */
|
||||
|
||||
/*
|
||||
Monitor.h
|
||||
|
||||
Abstract class representing monitors.
|
||||
|
||||
by Patrick C. Beard.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
class Monitor {
|
||||
public:
|
||||
virtual ~Monitor() {}
|
||||
|
||||
virtual void enter() = 0;
|
||||
virtual void exit() = 0;
|
||||
|
||||
virtual void wait() = 0;
|
||||
virtual void wait(long long millis) = 0;
|
||||
virtual void notify() = 0;
|
||||
virtual void notifyAll() = 0;
|
||||
};
|
||||
@@ -1,106 +0,0 @@
|
||||
/* ----- 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 the MRJ Carbon OJI Plugin.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Patrick C. Beard <beard@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 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 ----- */
|
||||
|
||||
/*
|
||||
NativeMonitor.cpp
|
||||
|
||||
Provides a C++ interface to native monitors.
|
||||
|
||||
by Patrick C. Beard.
|
||||
*/
|
||||
|
||||
#include "NativeMonitor.h"
|
||||
#include "MRJSession.h"
|
||||
#include "nsIThreadManager.h"
|
||||
|
||||
NativeMonitor::NativeMonitor(MRJSession* session, nsIThreadManager* manager, void* address)
|
||||
: mSession(session), mManager(manager), mAddress(address)
|
||||
{
|
||||
if (address == NULL)
|
||||
mAddress = this;
|
||||
}
|
||||
|
||||
NativeMonitor::~NativeMonitor() {}
|
||||
|
||||
void NativeMonitor::enter()
|
||||
{
|
||||
mManager->EnterMonitor(mAddress);
|
||||
}
|
||||
|
||||
void NativeMonitor::exit()
|
||||
{
|
||||
mManager->ExitMonitor(mAddress);
|
||||
}
|
||||
|
||||
void NativeMonitor::wait()
|
||||
{
|
||||
// this is weird hackery, but we don't want to let the VM be reentered while we wait on a native monitor.
|
||||
Boolean inJavaThread = (mSession->getMainEnv() != mSession->getCurrentEnv());
|
||||
if (inJavaThread)
|
||||
mSession->lock();
|
||||
|
||||
if (mManager->EnterMonitor(mAddress) == NS_OK) {
|
||||
mManager->Wait(mAddress);
|
||||
mManager->ExitMonitor(mAddress);
|
||||
}
|
||||
|
||||
if (inJavaThread)
|
||||
mSession->unlock();
|
||||
}
|
||||
|
||||
void NativeMonitor::wait(long long millis)
|
||||
{
|
||||
if (mManager->EnterMonitor(mAddress) == NS_OK) {
|
||||
mManager->Wait(mAddress, PRUint32(millis));
|
||||
mManager->ExitMonitor(mAddress);
|
||||
}
|
||||
}
|
||||
|
||||
void NativeMonitor::notify()
|
||||
{
|
||||
if (mManager->EnterMonitor(mAddress) == NS_OK) {
|
||||
mManager->Notify(mAddress);
|
||||
mManager->ExitMonitor(mAddress);
|
||||
}
|
||||
}
|
||||
|
||||
void NativeMonitor::notifyAll()
|
||||
{
|
||||
if (mManager->EnterMonitor(mAddress) == NS_OK) {
|
||||
mManager->NotifyAll(mAddress);
|
||||
mManager->ExitMonitor(mAddress);
|
||||
}
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
/* ----- 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 the MRJ Carbon OJI Plugin.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Patrick C. Beard <beard@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 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 ----- */
|
||||
|
||||
/*
|
||||
PluginNew.cpp
|
||||
|
||||
new & delete operators for plugins.
|
||||
|
||||
by Patrick C. Beard.
|
||||
*/
|
||||
|
||||
#include <new>
|
||||
|
||||
#include "nsIMemory.h"
|
||||
|
||||
// Warning: this forces all C++ allocation to go through Navigator's memory allocation
|
||||
// Routines. As such, static constructors that use operator new may not work. This can
|
||||
// be fixed if we delay static construction (see the call to __InitCode__() in npmac.cpp).
|
||||
|
||||
extern nsIMemory* theMemoryAllocator;
|
||||
|
||||
void* operator new(size_t size)
|
||||
{
|
||||
if (theMemoryAllocator)
|
||||
return theMemoryAllocator->Alloc(size);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void operator delete(void* ptr)
|
||||
{
|
||||
if (ptr && theMemoryAllocator)
|
||||
theMemoryAllocator->Free(ptr);
|
||||
}
|
||||
|
||||
void* operator new[](size_t size)
|
||||
{
|
||||
if (theMemoryAllocator)
|
||||
return theMemoryAllocator->Alloc(size);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void operator delete[](void* ptr)
|
||||
{
|
||||
if (ptr && theMemoryAllocator)
|
||||
theMemoryAllocator->Free(ptr);
|
||||
}
|
||||
@@ -1,164 +0,0 @@
|
||||
/* ----- 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 the MRJ Carbon OJI Plugin.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Patrick C. Beard <beard@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 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 ----- */
|
||||
|
||||
/*
|
||||
PrintingPort.java
|
||||
|
||||
Wraps a Quickdraw printing port and provides a way to image on it
|
||||
with a java.awt.Graphics object.
|
||||
|
||||
by Patrick C. Beard.
|
||||
*/
|
||||
|
||||
package com.apple.mrj.internal.awt;
|
||||
|
||||
import com.apple.mrj.macos.generated.RectStruct;
|
||||
import com.apple.mrj.macos.generated.QuickdrawFunctions;
|
||||
import java.awt.*;
|
||||
|
||||
public class PrintingPort implements GraphicsHost {
|
||||
private int mPrintingPort;
|
||||
private int mOriginX;
|
||||
private int mOriginY;
|
||||
private PortManager mPortManager;
|
||||
private QDPipeline mPipeline;
|
||||
private Rectangle mClipping;
|
||||
|
||||
public PrintingPort(int printingPort, int originX, int originY) {
|
||||
mPrintingPort = printingPort;
|
||||
mOriginX = originX;
|
||||
mOriginY = originY;
|
||||
mPortManager = new PortManager(printingPort, 0, 0, PortManager.kPrinting, 0);
|
||||
mPipeline = new QDPipeline();
|
||||
mPortManager.setPipeline(mPipeline);
|
||||
}
|
||||
|
||||
public void dispose() {
|
||||
// dispose of port manager flushes the pipeline.
|
||||
if (mPortManager != null) {
|
||||
mPortManager.dispose();
|
||||
mPortManager = null;
|
||||
}
|
||||
if (mPipeline != null) {
|
||||
mPipeline.dispose();
|
||||
mPipeline = null;
|
||||
}
|
||||
}
|
||||
|
||||
private static final short MAXSHORT = 32767, MINSHORT = -32768;
|
||||
|
||||
static short pinToShort(int value) {
|
||||
if (value > MAXSHORT)
|
||||
return MAXSHORT;
|
||||
else if (value < MINSHORT)
|
||||
return MINSHORT;
|
||||
return (short) value;
|
||||
}
|
||||
|
||||
final class PrintingGraphics extends QDGraphics {
|
||||
/** Creates a new PrintingGraphics. You must call <code>initialize</code> on it next. */
|
||||
public PrintingGraphics() {
|
||||
super();
|
||||
}
|
||||
|
||||
public synchronized Graphics create() {
|
||||
if( !internalMarkHostInUse ( ) )
|
||||
throw new AWTError("Using invalid Graphics object");
|
||||
try {
|
||||
return (new PrintingGraphics()).initialize(this,fXoff,fYoff,fClip);
|
||||
} finally {
|
||||
internalDoneUsingHost ( );
|
||||
}
|
||||
}
|
||||
|
||||
public synchronized Graphics create(int x, int y, int width, int height) {
|
||||
if( !internalMarkHostInUse() )
|
||||
throw new AWTError("Using invalid Graphics object");
|
||||
try {
|
||||
VToolkit.intersect(sRectangle, fClip, fXoff+x,fYoff+y,width,height);
|
||||
return (new PrintingGraphics()).initialize(this,fXoff+x,fYoff+y,sRectangle);
|
||||
} finally {
|
||||
internalDoneUsingHost ( );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Override QDGraphics.restore(), to reset origin and clipping during drawing.
|
||||
*/
|
||||
void restore() {
|
||||
super.restore();
|
||||
|
||||
int port = VAWTDirect.FastGetThePort();
|
||||
if (port != mPrintingPort)
|
||||
QuickdrawFunctions.SetPort(mPrintingPort);
|
||||
|
||||
// restore default orgin.
|
||||
QuickdrawFunctions.SetOrigin((short)0, (short)0);
|
||||
|
||||
// set up correct clipping.
|
||||
QDRectStruct clipRect = new QDRectStruct();
|
||||
clipRect.Set(pinToShort(mClipping.x), pinToShort(mClipping.y),
|
||||
pinToShort(mClipping.x + mClipping.width), pinToShort(mClipping.y + mClipping.width));
|
||||
QuickdrawFunctions.ClipRect(clipRect);
|
||||
|
||||
if (port != mPrintingPort)
|
||||
QuickdrawFunctions.SetPort(port);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a graphics object that wraps the specified printing port.
|
||||
* Assumes that the underlying port's coordinate system is already
|
||||
* set up to have (0, 0) as the upper left corner.
|
||||
*/
|
||||
public Graphics getGraphics(Component component) {
|
||||
mClipping = component.getBounds();
|
||||
mClipping.x = mOriginX; mClipping.y = mOriginY;
|
||||
QDGraphics graphics = new PrintingGraphics();
|
||||
graphics.initialize(mPrintingPort, this, mPortManager,
|
||||
mOriginX, mOriginY, mClipping, component.getForeground(),
|
||||
component.getFont());
|
||||
return graphics;
|
||||
}
|
||||
|
||||
/** methods to satisfy GraphicsHost interface. */
|
||||
public void graphicsCreated(QDGraphics g) throws OutOfMemoryError {}
|
||||
public void graphicsDisposed(QDGraphics g) {}
|
||||
public RGBColorValue getBackgroundRGB() { return new RGBColorValue(Color.white); }
|
||||
public void repaint(RectStruct r) {}
|
||||
public boolean markInUse() { return (mPortManager != null); }
|
||||
public void doneUsingIt() {}
|
||||
}
|
||||
@@ -1,119 +0,0 @@
|
||||
/* ----- 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 the MRJ Carbon OJI Plugin.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Patrick C. Beard <beard@netscape.com>
|
||||
* Xiaobin Lu <Xiaobin.Lu@eng.Sun.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 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 ----- */
|
||||
|
||||
package netscape.oji;
|
||||
|
||||
import java.net.URLClassLoader;
|
||||
import java.net.URL;
|
||||
import java.net.MalformedURLException;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.zip.*;
|
||||
import java.util.WeakHashMap;
|
||||
|
||||
import java.security.CodeSource;
|
||||
|
||||
public abstract class ProxyClassLoaderFactory {
|
||||
static void debug(String message) {
|
||||
System.out.println("<<< " + message + " >>>");
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads specified class file as an array of bytes from ${netscape.oji.plugin.home}/MRJPlugin.jar.
|
||||
*/
|
||||
private static byte[] getMRJPluginClassFile(String path) {
|
||||
try {
|
||||
String homeDir = System.getProperty("netscape.oji.plugin.home");
|
||||
ZipFile jarFile = new ZipFile(new File(homeDir, "MRJPlugin.jar"));
|
||||
ZipEntry classEntry = jarFile.getEntry(path);
|
||||
int size = (int) classEntry.getSize();
|
||||
if (size > 0) {
|
||||
byte[] data = new byte[size];
|
||||
DataInputStream input = new DataInputStream(jarFile.getInputStream(classEntry));
|
||||
input.readFully(data);
|
||||
input.close();
|
||||
jarFile.close();
|
||||
return data;
|
||||
}
|
||||
} catch (IOException ioe) {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Trivial subclass of URLClassLoader that predefines the class netscape.oji.LiveConnectProxy
|
||||
* as if it were loaded from the specified codebase URL passed to the constructor.
|
||||
* @see netscape.oji.LiveConnectProxy
|
||||
*/
|
||||
private static class ProxyClassLoader extends URLClassLoader {
|
||||
private static byte[] data = getMRJPluginClassFile("netscape/oji/LiveConnectProxy.class");
|
||||
ProxyClassLoader(URL[] documentURLs) {
|
||||
super(documentURLs);
|
||||
if (data != null) {
|
||||
Class proxyClass = defineClass("netscape.oji.LiveConnectProxy",
|
||||
data, 0, data.length,
|
||||
new CodeSource(documentURLs[0], null));
|
||||
debug("ProxyClassLoader: defined LiveConnectProxy class.");
|
||||
debug("Here're the permisssions you've got:");
|
||||
debug(proxyClass.getProtectionDomain().getPermissions().toString());
|
||||
} else {
|
||||
debug("ProxyClassLoader: failed to define LiveConnectProxy class.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// XXX Should this be a weak table of some sort?
|
||||
private static WeakHashMap mClassLoaders = new WeakHashMap();
|
||||
|
||||
public static ClassLoader createClassLoader(final String documentURL) throws MalformedURLException {
|
||||
ClassLoader loader = (ClassLoader) mClassLoaders.get(documentURL);
|
||||
if (loader == null) {
|
||||
try {
|
||||
URL[] documentURLs = new URL[] { new URL(documentURL) };
|
||||
loader = new ProxyClassLoader(documentURLs);
|
||||
mClassLoaders.put(documentURL, loader);
|
||||
} catch (MalformedURLException e) {
|
||||
}
|
||||
}
|
||||
return loader;
|
||||
}
|
||||
|
||||
public static void destroyClassLoader(final String documentURL) {
|
||||
mClassLoaders.remove(documentURL);
|
||||
}
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
/* ----- 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 the MRJ Carbon OJI Plugin.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Patrick C. Beard <beard@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 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 ----- */
|
||||
|
||||
/*
|
||||
RunnableMixin.cpp
|
||||
|
||||
Provides a mixin nsIRunnable implementation.
|
||||
|
||||
by Patrick C. Beard.
|
||||
*/
|
||||
|
||||
#include "RunnableMixin.h"
|
||||
|
||||
const InterfaceInfo RunnableMixin::sInterfaces[] = {
|
||||
{ NS_IRUNNABLE_IID, INTERFACE_OFFSET(RunnableMixin, nsIRunnable) },
|
||||
};
|
||||
const UInt32 RunnableMixin::kInterfaceCount = sizeof(sInterfaces) / sizeof(InterfaceInfo);
|
||||
|
||||
RunnableMixin::RunnableMixin()
|
||||
: SupportsMixin(this, sInterfaces, kInterfaceCount)
|
||||
{
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
/* ----- 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 the MRJ Carbon OJI Plugin.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Patrick C. Beard <beard@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 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 ----- */
|
||||
|
||||
/*
|
||||
RunnableMixin.h
|
||||
|
||||
Provides a mixin nsIRunnable implementation.
|
||||
|
||||
by Patrick C. Beard.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <Types.h>
|
||||
|
||||
#include "nsIThreadManager.h"
|
||||
#include "SupportsMixin.h"
|
||||
|
||||
class RunnableMixin : public nsIRunnable, private SupportsMixin {
|
||||
public:
|
||||
RunnableMixin();
|
||||
|
||||
DECL_SUPPORTS_MIXIN
|
||||
|
||||
NS_IMETHOD Run() = 0;
|
||||
|
||||
private:
|
||||
// support for SupportsMixin.
|
||||
static const InterfaceInfo sInterfaces[];
|
||||
static const UInt32 kInterfaceCount;
|
||||
};
|
||||
@@ -1,86 +0,0 @@
|
||||
/* ----- 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 the MRJ Carbon OJI Plugin.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Patrick C. Beard <beard@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 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 ----- */
|
||||
|
||||
/*
|
||||
StringUtils.cpp
|
||||
*/
|
||||
|
||||
#include "StringUtils.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
inline unsigned char toupper(unsigned char c)
|
||||
{
|
||||
return (c >= 'a' && c <= 'z') ? (c - ('a' - 'A')) : c;
|
||||
}
|
||||
|
||||
int strcasecmp(const char * str1, const char * str2)
|
||||
{
|
||||
#if !__POWERPC__
|
||||
|
||||
const unsigned char * p1 = (unsigned char *) str1;
|
||||
const unsigned char * p2 = (unsigned char *) str2;
|
||||
unsigned char c1, c2;
|
||||
|
||||
while (toupper(c1 = *p1++) == toupper(c2 = *p2++))
|
||||
if (!c1)
|
||||
return(0);
|
||||
|
||||
#else
|
||||
|
||||
const unsigned char * p1 = (unsigned char *) str1 - 1;
|
||||
const unsigned char * p2 = (unsigned char *) str2 - 1;
|
||||
unsigned long c1, c2;
|
||||
|
||||
while (toupper(c1 = *++p1) == toupper(c2 = *++p2))
|
||||
if (!c1)
|
||||
return(0);
|
||||
|
||||
#endif
|
||||
|
||||
return(toupper(c1) - toupper(c2));
|
||||
}
|
||||
|
||||
char* strdup(const char* str)
|
||||
{
|
||||
if (str != NULL) {
|
||||
char* result = new char[::strlen(str) + 1];
|
||||
if (result != NULL)
|
||||
::strcpy(result, str);
|
||||
return result;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
/* ----- 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 the MRJ Carbon OJI Plugin.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Patrick C. Beard <beard@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 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 ----- */
|
||||
|
||||
/*
|
||||
StringUtils.h
|
||||
|
||||
String utilities.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
/**
|
||||
* Case-insensitive string comparison.
|
||||
*/
|
||||
int strcasecmp(const char * str1, const char * str2);
|
||||
|
||||
/**
|
||||
* Duplicates a C string, returns NULL if failed, or passed NULL.
|
||||
*/
|
||||
char* strdup(const char* str);
|
||||
@@ -1,171 +0,0 @@
|
||||
/* ----- 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 the MRJ Carbon OJI Plugin.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Patrick C. Beard <beard@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 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 ----- */
|
||||
|
||||
/*
|
||||
SupportsMixin.cpp
|
||||
|
||||
Experimental way to implement nsISupports interface.
|
||||
|
||||
by Patrick C. Beard.
|
||||
*/
|
||||
|
||||
#include "SupportsMixin.h"
|
||||
#include "nsAgg.h"
|
||||
#include <DriverSynchronization.h>
|
||||
|
||||
// Standard nsISupport method implementations.
|
||||
|
||||
#ifdef SUPPORT_AGGREGATION
|
||||
|
||||
SupportsMixin::SupportsMixin(void* instance, const InterfaceInfo interfaces[], UInt32 interfaceCount, nsISupports* outer)
|
||||
: mInstance(instance), mRefCount(0), mInterfaces(interfaces), mInterfaceCount(interfaceCount), mOuter(outer)
|
||||
{
|
||||
if (mOuter != NULL)
|
||||
mInner = new Inner(this);
|
||||
}
|
||||
|
||||
SupportsMixin::~SupportsMixin()
|
||||
{
|
||||
if (mRefCount > 0) {
|
||||
::DebugStr("\pmRefCount > 0!");
|
||||
}
|
||||
if (mInner != NULL)
|
||||
delete mInner;
|
||||
}
|
||||
|
||||
/**
|
||||
* The uppercase versions QueryInterface, AddRef, and Release are meant to be called by subclass
|
||||
* implementations. They take aggregation into account.
|
||||
*/
|
||||
nsresult SupportsMixin::OuterQueryInterface(const nsIID& aIID, void** aInstancePtr)
|
||||
{
|
||||
// first, see if we really implement this interface.
|
||||
nsresult result = queryInterface(aIID, aInstancePtr);
|
||||
// if not, then delegate to the outer object, if any.
|
||||
if (result != NS_OK && mOuter != NULL)
|
||||
return mOuter->QueryInterface(aIID, aInstancePtr);
|
||||
else
|
||||
return result;
|
||||
}
|
||||
|
||||
nsrefcnt SupportsMixin::OuterAddRef()
|
||||
{
|
||||
nsrefcnt result = addRef();
|
||||
if (mOuter != NULL)
|
||||
return mOuter->AddRef();
|
||||
return result;
|
||||
}
|
||||
|
||||
nsrefcnt SupportsMixin::OuterRelease()
|
||||
{
|
||||
if (mOuter != NULL) {
|
||||
nsIOuter* outer = NULL;
|
||||
nsISupports* supports = mOuter;
|
||||
static NS_DEFINE_IID(kIOuterIID, NS_IOUTER_IID);
|
||||
if (mRefCount == 1 && supports->QueryInterface(kIOuterIID, &outer) == NS_OK) {
|
||||
outer->ReleaseInner(mInner);
|
||||
outer->Release();
|
||||
} else
|
||||
release();
|
||||
return supports->Release();
|
||||
} else {
|
||||
return release();
|
||||
}
|
||||
}
|
||||
|
||||
#else /* !SUPPORT_AGGREGATION */
|
||||
|
||||
SupportsMixin::SupportsMixin(void* instance, const InterfaceInfo interfaces[], UInt32 interfaceCount, nsISupports* /* outer */)
|
||||
: mInstance(instance), mRefCount(0), mInterfaces(interfaces), mInterfaceCount(interfaceCount)
|
||||
{
|
||||
}
|
||||
|
||||
SupportsMixin::~SupportsMixin()
|
||||
{
|
||||
if (mRefCount > 0) {
|
||||
::DebugStr("\pmRefCount > 0!");
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* !SUPPORT_AGGREGATION */
|
||||
|
||||
/**
|
||||
* The lowercase implementations of queryInterface, addRef, and release all act locally
|
||||
* on the current object, regardless of aggregation. They are meant to be called by
|
||||
* aggregating outer objects.
|
||||
*/
|
||||
NS_IMETHODIMP SupportsMixin::queryInterface(const nsIID& aIID, void** aInstancePtr)
|
||||
{
|
||||
if (aInstancePtr == NULL) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
// first check to see if it's one of our known interfaces.
|
||||
// need to solve the non-left inheritance graph case.
|
||||
const InterfaceInfo* interfaces = mInterfaces;
|
||||
UInt32 count = mInterfaceCount;
|
||||
for (UInt32 i = 0; i < count; i++) {
|
||||
if (aIID.Equals(interfaces[i].mIID)) {
|
||||
*aInstancePtr = (void*) (UInt32(mInstance) + interfaces[i].mOffset);
|
||||
addRef();
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
// finally, does the interface match nsISupports?
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
if (aIID.Equals(kISupportsIID)) {
|
||||
*aInstancePtr = (void*) mInstance;
|
||||
addRef();
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP_(nsrefcnt) SupportsMixin::addRef()
|
||||
{
|
||||
IncrementAtomic((SInt32*)&mRefCount);
|
||||
return mRefCount;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP_(nsrefcnt) SupportsMixin::release()
|
||||
{
|
||||
// NOTE: IncrementAtomic increments the value by 1 and DecrementAtomic decrements it by 1.
|
||||
// These functions return the value as it was before the change.
|
||||
if (DecrementAtomic((SInt32*)&mRefCount) == 1) {
|
||||
delete this;
|
||||
return 0;
|
||||
}
|
||||
return mRefCount;
|
||||
}
|
||||
@@ -1,123 +0,0 @@
|
||||
/* ----- 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 the MRJ Carbon OJI Plugin.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Patrick C. Beard <beard@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 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 ----- */
|
||||
|
||||
/*
|
||||
SupportsMixin.h
|
||||
|
||||
Experimental way to implement nsISupports interface.
|
||||
|
||||
Uses table-driven approach for fast lookup.
|
||||
|
||||
Aggregation support isn't quite here yet, it requires a helper object that is referenced only by the outer object,
|
||||
whose QueryInterace, AddRef, and Release act only locally (i.e. they call queryInterface, addRef, and release).
|
||||
However, if we're not using aggregation (hardly ever are) it seems wasteful to define the helper object.
|
||||
|
||||
by Patrick C. Beard.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <Types.h>
|
||||
|
||||
#include "nsISupports.h"
|
||||
|
||||
// #define SUPPORT_AGGREGATION
|
||||
|
||||
struct InterfaceInfo {
|
||||
nsID mIID; // the IID of this interface.
|
||||
UInt32 mOffset; // the offset of this interface.
|
||||
};
|
||||
|
||||
class SupportsMixin {
|
||||
public:
|
||||
// These act locally on the current object, and are meant to be called by sub-classes.
|
||||
nsresult queryInterface(const nsIID& aIID, void** aInstancePtr);
|
||||
nsrefcnt addRef(void);
|
||||
nsrefcnt release(void);
|
||||
|
||||
protected:
|
||||
SupportsMixin(void* instance, const InterfaceInfo interfaces[], UInt32 interfaceCount, nsISupports* outer = NULL);
|
||||
virtual ~SupportsMixin();
|
||||
|
||||
#ifdef SUPPORT_AGGREGATION
|
||||
NS_METHOD OuterQueryInterface(REFNSIID aIID, void** aInstancePtr);
|
||||
NS_METHOD_(nsrefcnt) OuterAddRef(void);
|
||||
NS_METHOD_(nsrefcnt) OuterRelease(void);
|
||||
#endif
|
||||
|
||||
private:
|
||||
void* mInstance;
|
||||
nsrefcnt mRefCount;
|
||||
const InterfaceInfo* mInterfaces;
|
||||
UInt32 mInterfaceCount;
|
||||
|
||||
#ifdef SUPPORT_AGGREGATION
|
||||
nsISupports* mOuter;
|
||||
|
||||
class Inner : public nsISupports {
|
||||
public:
|
||||
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr) { return mSupports->queryInterface(aIID, aInstancePtr); }
|
||||
NS_IMETHOD_(nsrefcnt) AddRef(void) { return mSupports->addRef(); }
|
||||
NS_IMETHOD_(nsrefcnt) Release(void) { return mSupports->release(); }
|
||||
|
||||
Inner(SupportsMixin* supports) : mSupports(supports) {}
|
||||
|
||||
private:
|
||||
SupportsMixin* mSupports;
|
||||
};
|
||||
|
||||
Inner* mInner;
|
||||
#endif
|
||||
};
|
||||
|
||||
#ifdef SUPPORT_AGGREGATION
|
||||
|
||||
#define DECL_SUPPORTS_MIXIN \
|
||||
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr) { return OuterQueryInterface(aIID, aInstancePtr); } \
|
||||
NS_IMETHOD_(nsrefcnt) AddRef(void) { return OuterAddRef(); } \
|
||||
NS_IMETHOD_(nsrefcnt) Release(void) { return OuterRelease(); }
|
||||
|
||||
#else
|
||||
|
||||
#define DECL_SUPPORTS_MIXIN \
|
||||
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr) { return queryInterface(aIID, aInstancePtr); } \
|
||||
NS_IMETHOD_(nsrefcnt) AddRef(void) { return addRef(); } \
|
||||
NS_IMETHOD_(nsrefcnt) Release(void) { return release(); }
|
||||
|
||||
#endif
|
||||
|
||||
#define INTERFACE_OFFSET(leafType, interfaceType) \
|
||||
UInt32((interfaceType*) ((leafType*)0))
|
||||
@@ -1,56 +0,0 @@
|
||||
/* ----- 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 the MRJ Carbon OJI Plugin.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Patrick C. Beard <beard@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 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 ----- */
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <CarbonEvents.h>
|
||||
|
||||
class TimedMessage {
|
||||
public:
|
||||
// Override operator new/delete for thread-safe memory allocation.
|
||||
void* operator new(size_t n);
|
||||
void operator delete(void* ptr);
|
||||
|
||||
TimedMessage();
|
||||
virtual ~TimedMessage();
|
||||
|
||||
OSStatus send();
|
||||
virtual void execute() = 0;
|
||||
|
||||
private:
|
||||
static pascal void TimedMessageHandler(EventLoopTimerRef inTimer, void *inUserData);
|
||||
EventLoopTimerUPP mTimerUPP;
|
||||
};
|
||||
@@ -1,304 +0,0 @@
|
||||
/* ----- 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 the MRJ Carbon OJI Plugin.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Patrick C. Beard <beard@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 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 ----- */
|
||||
|
||||
/*
|
||||
TopLevelFrame.cpp
|
||||
|
||||
An MRJFrame sub-class that manages the behavior of a top-level window
|
||||
running inside the Communicator.
|
||||
|
||||
by Patrick C. Beard.
|
||||
*/
|
||||
|
||||
#include <Controls.h>
|
||||
#include <Events.h>
|
||||
|
||||
#include "TopLevelFrame.h"
|
||||
#include "LocalPort.h"
|
||||
|
||||
#include "nsIPluginManager2.h"
|
||||
#include "nsIEventHandler.h"
|
||||
|
||||
#if !defined(MRJPLUGIN_4X)
|
||||
#define USE_ALT_WINDOW_HANDLING
|
||||
#endif
|
||||
|
||||
#ifdef USE_ALT_WINDOW_HANDLING
|
||||
#include "AltWindowHandling.h"
|
||||
#endif
|
||||
|
||||
#include "nsIEventHandler.h"
|
||||
#include "AltWindowHandling.h"
|
||||
|
||||
extern nsIPluginManager2* thePluginManager2;
|
||||
|
||||
static void UnsetPort(GrafPtr port);
|
||||
static short getModifiers();
|
||||
|
||||
TopLevelFrame::TopLevelFrame(nsIEventHandler* handler, JMFrameRef frameRef, JMFrameKind kind,
|
||||
const Rect* initialBounds, Boolean resizeable)
|
||||
: MRJFrame(frameRef),
|
||||
mHandler(handler), mWindow(NULL), mBounds(*initialBounds)
|
||||
{
|
||||
Boolean hasGoAway = true;
|
||||
SInt16 windowProc = documentProc;
|
||||
SInt16 resizeHeight = resizeable ? 15 : 0;
|
||||
|
||||
switch (kind) {
|
||||
case eBorderlessModelessWindowFrame:
|
||||
hasGoAway = false;
|
||||
windowProc = plainDBox;
|
||||
// mBounds.bottom += resizeHeight;
|
||||
resizeable = false;
|
||||
break;
|
||||
case eModelessWindowFrame:
|
||||
case eModelessDialogFrame:
|
||||
hasGoAway = true;
|
||||
windowProc = resizeable ? zoomDocProc : documentProc;
|
||||
// mBounds.bottom += resizeHeight;
|
||||
break;
|
||||
case eModalWindowFrame:
|
||||
hasGoAway = true;
|
||||
// We have to allow resizeable modal windows.
|
||||
windowProc = resizeable ? documentProc : movableDBoxProc;
|
||||
break;
|
||||
}
|
||||
|
||||
mWindow = ::NewCWindow(NULL, &mBounds, "\p", false, windowProc, WindowPtr(-1), hasGoAway, long(this));
|
||||
if (mWindow != NULL) {
|
||||
Point zeroPt = { 0, 0 };
|
||||
::JMSetFrameVisibility(frameRef, mWindow, zeroPt, mWindow->clipRgn);
|
||||
}
|
||||
}
|
||||
|
||||
TopLevelFrame::~TopLevelFrame()
|
||||
{
|
||||
// make sure the window is hidden (and unregistered with the browser).
|
||||
showHide(false);
|
||||
|
||||
// make sure this port isn't ever current again.
|
||||
::UnsetPort(mWindow);
|
||||
|
||||
if (mWindow != NULL)
|
||||
::DisposeWindow(mWindow);
|
||||
}
|
||||
|
||||
void TopLevelFrame::setSize(const Rect* newSize)
|
||||
{
|
||||
mBounds = *newSize;
|
||||
|
||||
if (mWindow != NULL) {
|
||||
SInt16 width = newSize->right - newSize->left;
|
||||
SInt16 height = newSize->bottom - newSize->top;
|
||||
::SizeWindow(mWindow, width, height, true);
|
||||
::MoveWindow(mWindow, newSize->left, newSize->top, false);
|
||||
}
|
||||
}
|
||||
|
||||
void TopLevelFrame::invalRect(const Rect* invalidRect)
|
||||
{
|
||||
if (mWindow != NULL) {
|
||||
::InvalRect(invalidRect);
|
||||
}
|
||||
}
|
||||
|
||||
void TopLevelFrame::showHide(Boolean visible)
|
||||
{
|
||||
if (mWindow != NULL && visible != IsWindowVisible(mWindow)) {
|
||||
if (visible) {
|
||||
#if !defined(USE_ALT_WINDOW_HANDLING)
|
||||
// Have to notify the browser that this window exists, so that it will receive events.
|
||||
thePluginManager2->RegisterWindow(mHandler, mWindow);
|
||||
// the plugin manager takes care of showing the window.
|
||||
// ::ShowWindow(mWindow);
|
||||
// ::SelectWindow(mWindow);
|
||||
#else
|
||||
AltRegisterWindow(mHandler, mWindow);
|
||||
#endif
|
||||
} else {
|
||||
#if defined(USE_ALT_WINDOW_HANDLING)
|
||||
AltUnregisterWindow(mHandler, mWindow);
|
||||
#else
|
||||
// the plugin manager takes care of hiding the window.
|
||||
// ::HideWindow(mWindow);
|
||||
// Let the browser know it doesn't have to send events anymore.
|
||||
thePluginManager2->UnregisterWindow(mHandler, mWindow);
|
||||
#endif
|
||||
activate(false);
|
||||
}
|
||||
|
||||
// ::ShowHide(mWindow, visible);
|
||||
}
|
||||
}
|
||||
|
||||
void TopLevelFrame::setTitle(const StringPtr title)
|
||||
{
|
||||
if (mWindow != NULL) {
|
||||
::SetWTitle(mWindow, title);
|
||||
}
|
||||
}
|
||||
|
||||
void TopLevelFrame::checkUpdate()
|
||||
{
|
||||
}
|
||||
|
||||
void TopLevelFrame::reorder(ReorderRequest request)
|
||||
{
|
||||
switch (request) {
|
||||
case eBringToFront: /* bring the window to front */
|
||||
::BringToFront(mWindow);
|
||||
break;
|
||||
case eSendToBack: /* send the window to back */
|
||||
::SendBehind(mWindow, NULL);
|
||||
break;
|
||||
case eSendBehindFront: /* send the window behind the front window */
|
||||
WindowPtr frontWindow = ::FrontWindow();
|
||||
if (mWindow == frontWindow) {
|
||||
::SendBehind(mWindow, GetNextWindow(mWindow));
|
||||
} else {
|
||||
::SendBehind(mWindow, frontWindow);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void TopLevelFrame::setResizeable(Boolean resizeable)
|
||||
{
|
||||
// this might have to recreate the window, no?
|
||||
}
|
||||
|
||||
static void computeBounds(WindowRef window, Rect* bounds)
|
||||
{
|
||||
LocalPort port(window);
|
||||
port.Enter();
|
||||
|
||||
Point position = { 0, 0 };
|
||||
::LocalToGlobal(&position);
|
||||
|
||||
*bounds = window->portRect;
|
||||
|
||||
port.Exit();
|
||||
|
||||
::OffsetRect(bounds, position.h, position.v);
|
||||
}
|
||||
|
||||
void TopLevelFrame::activate(Boolean active)
|
||||
{
|
||||
focusEvent(active);
|
||||
MRJFrame::activate(active);
|
||||
}
|
||||
|
||||
void TopLevelFrame::click(const EventRecord* event)
|
||||
{
|
||||
Point where = event->where;
|
||||
SInt16 modifiers = event->modifiers;
|
||||
WindowRef hitWindow;
|
||||
short partCode = ::FindWindow(where, &hitWindow);
|
||||
switch (partCode) {
|
||||
case inContent:
|
||||
::SelectWindow(mWindow);
|
||||
MRJFrame::click(event);
|
||||
break;
|
||||
case inDrag:
|
||||
{
|
||||
Rect bounds = (**GetGrayRgn()).rgnBBox;
|
||||
DragWindow(mWindow, where, &bounds);
|
||||
computeBounds(mWindow, &bounds);
|
||||
::JMSetFrameSize(mFrameRef, &bounds);
|
||||
|
||||
Point zeroPt = { 0, 0 };
|
||||
::JMSetFrameVisibility(mFrameRef, mWindow, zeroPt, mWindow->clipRgn);
|
||||
}
|
||||
break;
|
||||
case inGrow:
|
||||
Rect limits = { 30, 30, 5000, 5000 };
|
||||
long result = GrowWindow(mWindow, where, &limits);
|
||||
if (result != 0) {
|
||||
short width = (result & 0xFFFF);
|
||||
short height = (result >> 16) & 0xFFFF;
|
||||
Rect newBounds;
|
||||
topLeft(newBounds) = topLeft(mBounds);
|
||||
newBounds.right = newBounds.left + width;
|
||||
newBounds.bottom = newBounds.top + height;
|
||||
::JMSetFrameSize(mFrameRef, &newBounds);
|
||||
|
||||
Point zeroPt = { 0, 0 };
|
||||
::JMSetFrameVisibility(mFrameRef, mWindow, zeroPt, mWindow->clipRgn);
|
||||
}
|
||||
break;
|
||||
case inGoAway:
|
||||
if (::TrackGoAway(mWindow, where))
|
||||
::JMFrameGoAway(mFrameRef);
|
||||
break;
|
||||
case inZoomIn:
|
||||
case inZoomOut:
|
||||
if (::TrackBox(mWindow, where, partCode)) {
|
||||
ZoomWindow(mWindow, partCode, true);
|
||||
computeBounds(mWindow, &mBounds);
|
||||
::JMSetFrameSize(mFrameRef, &mBounds);
|
||||
}
|
||||
break;
|
||||
case inCollapseBox:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
WindowRef TopLevelFrame::getWindow()
|
||||
{
|
||||
return mWindow;
|
||||
}
|
||||
|
||||
GrafPtr TopLevelFrame::getPort()
|
||||
{
|
||||
return mWindow;
|
||||
}
|
||||
|
||||
static void UnsetPort(GrafPtr port)
|
||||
{
|
||||
GrafPtr curPort;
|
||||
::GetPort(&curPort);
|
||||
if (curPort == port) {
|
||||
::GetWMgrPort(&port);
|
||||
::SetPort(port);
|
||||
}
|
||||
}
|
||||
|
||||
static short getModifiers()
|
||||
{
|
||||
EventRecord event;
|
||||
::OSEventAvail(0, &event);
|
||||
return event.modifiers;
|
||||
}
|
||||
@@ -1,81 +0,0 @@
|
||||
/* ----- 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 the MRJ Carbon OJI Plugin.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Patrick C. Beard <beard@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 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 ----- */
|
||||
|
||||
/*
|
||||
TopLevelFrame.h
|
||||
|
||||
An MRJFrame sub-class that manages the behavior of a top-level window
|
||||
running inside the Communicator.
|
||||
|
||||
by Patrick C. Beard.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "MRJFrame.h"
|
||||
|
||||
#ifndef __MACWINDOWS__
|
||||
#include <MacWindows.h>
|
||||
#endif
|
||||
|
||||
class nsIEventHandler;
|
||||
|
||||
class TopLevelFrame : public MRJFrame {
|
||||
public:
|
||||
TopLevelFrame(nsIEventHandler* handler, JMFrameRef frameRef, JMFrameKind kind, const Rect* initialBounds, Boolean resizeable);
|
||||
virtual ~TopLevelFrame();
|
||||
|
||||
virtual void setSize(const Rect* newSize);
|
||||
virtual void invalRect(const Rect* invalidRect);
|
||||
virtual void showHide(Boolean visible);
|
||||
virtual void setTitle(const StringPtr title);
|
||||
virtual void checkUpdate();
|
||||
virtual void reorder(ReorderRequest request);
|
||||
virtual void setResizeable(Boolean resizeable);
|
||||
|
||||
virtual void activate(Boolean active);
|
||||
virtual void click(const EventRecord* event);
|
||||
|
||||
WindowRef getWindow();
|
||||
|
||||
protected:
|
||||
virtual GrafPtr getPort();
|
||||
|
||||
private:
|
||||
nsIEventHandler* mHandler;
|
||||
WindowRef mWindow;
|
||||
Rect mBounds;
|
||||
};
|
||||
@@ -1,150 +0,0 @@
|
||||
/* ----- 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 the MRJ Carbon OJI Plugin.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Patrick C. Beard <beard@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 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 ----- */
|
||||
|
||||
/*
|
||||
jGNE.cpp
|
||||
|
||||
Provides a generalized jGNE filtering service.
|
||||
|
||||
by Patrick C. Beard.
|
||||
*/
|
||||
|
||||
#include "jGNE.h"
|
||||
|
||||
#include <MixedMode.h>
|
||||
#include <Memory.h>
|
||||
#include <LowMem.h>
|
||||
#include <TextUtils.h>
|
||||
|
||||
/**
|
||||
* A 68K jump vector.
|
||||
*/
|
||||
#pragma options align=mac68k
|
||||
|
||||
struct Jump {
|
||||
unsigned short jmp;
|
||||
UniversalProcPtr addr;
|
||||
};
|
||||
|
||||
#pragma options align=reset
|
||||
|
||||
static void GNEFilter(EventRecord *event, Boolean* result);
|
||||
|
||||
static RoutineDescriptor theGNEFilterDescriptor = BUILD_ROUTINE_DESCRIPTOR(uppGetNextEventFilterProcInfo, GNEFilter);
|
||||
static Jump* theGNEFilterJump;
|
||||
static GetNextEventFilterUPP theOldGNEFilterUPP = NULL;
|
||||
static EventFilterProcPtr theEventFilter = NULL;
|
||||
|
||||
static Str63 theAppName;
|
||||
|
||||
OSStatus InstallEventFilter(EventFilterProcPtr filter)
|
||||
{
|
||||
if (theEventFilter == NULL) {
|
||||
theEventFilter = filter;
|
||||
|
||||
// record the current application's name.
|
||||
StringPtr currentAppName = LMGetCurApName();
|
||||
::BlockMoveData(currentAppName, theAppName, 1 + currentAppName[0]);
|
||||
|
||||
// allocate a jump vector in the System heap, so it will be retained after termination.
|
||||
if (theGNEFilterJump == NULL) {
|
||||
theGNEFilterJump = (Jump*) NewPtrSys(sizeof(Jump));
|
||||
if (theGNEFilterJump == NULL)
|
||||
return MemError();
|
||||
|
||||
theGNEFilterJump->jmp = 0x4EF9;
|
||||
theGNEFilterJump->addr = &theGNEFilterDescriptor;
|
||||
|
||||
// get previous event filter routine.
|
||||
theOldGNEFilterUPP = LMGetGNEFilter();
|
||||
LMSetGNEFilter(GetNextEventFilterUPP(theGNEFilterJump));
|
||||
} else {
|
||||
// our previously allocated Jump is still installed, use it.
|
||||
theOldGNEFilterUPP = theGNEFilterJump->addr;
|
||||
theGNEFilterJump->addr = &theGNEFilterDescriptor;
|
||||
}
|
||||
|
||||
return noErr;
|
||||
}
|
||||
return paramErr;
|
||||
}
|
||||
|
||||
OSStatus RemoveEventFilter()
|
||||
{
|
||||
if (theEventFilter != NULL) {
|
||||
// It's only truly safe to remove our filter, if nobody else installed one after us.
|
||||
if (LMGetGNEFilter() == GetNextEventFilterUPP(theGNEFilterJump)) {
|
||||
// can safely restore the old filter.
|
||||
LMSetGNEFilter(theOldGNEFilterUPP);
|
||||
DisposePtr(Ptr(theGNEFilterJump));
|
||||
theGNEFilterJump = NULL;
|
||||
} else {
|
||||
// modify the jump instruction to point to the previous filter.
|
||||
theGNEFilterJump->addr = theOldGNEFilterUPP;
|
||||
}
|
||||
theOldGNEFilterUPP = NULL;
|
||||
theEventFilter = NULL;
|
||||
return noErr;
|
||||
}
|
||||
return paramErr;
|
||||
}
|
||||
|
||||
static void GNEFilter(EventRecord *event, Boolean* result)
|
||||
{
|
||||
// call next filter in chain first.
|
||||
if (theOldGNEFilterUPP != NULL)
|
||||
CallGetNextEventFilterProc(theOldGNEFilterUPP, event, result);
|
||||
|
||||
// now, let the filter proc have a crack at the event.
|
||||
if (*result) {
|
||||
// only call the filter if called in the current application's context.
|
||||
/* if (::EqualString(theAppName, LMGetCurApName(), true, true)) */
|
||||
{
|
||||
// prevent recursive calls to the filter.
|
||||
static Boolean inFilter = false;
|
||||
if (! inFilter) {
|
||||
inFilter = true;
|
||||
Boolean filteredEvent = theEventFilter(event);
|
||||
if (filteredEvent) {
|
||||
// consume the event by making it a nullEvent.
|
||||
event->what = nullEvent;
|
||||
*result = false;
|
||||
}
|
||||
inFilter = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
/* ----- 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 the MRJ Carbon OJI Plugin.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Patrick C. Beard <beard@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 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 ----- */
|
||||
|
||||
#pragma once
|
||||
|
||||
/*
|
||||
jGNE.h
|
||||
|
||||
Provides a generalized jGNE filtering service.
|
||||
|
||||
by Patrick C. Beard.
|
||||
*/
|
||||
|
||||
#ifndef __EVENTS__
|
||||
#include <Events.h>
|
||||
#endif
|
||||
|
||||
typedef Boolean (*EventFilterProcPtr) (EventRecord* event);
|
||||
|
||||
OSStatus InstallEventFilter(EventFilterProcPtr filter);
|
||||
OSStatus RemoveEventFilter();
|
||||
@@ -1,207 +0,0 @@
|
||||
#
|
||||
# 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 the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
#
|
||||
|
||||
#
|
||||
# Configuration common to all versions of Windows CE and Pocket PC x.
|
||||
#
|
||||
|
||||
ifeq ($(CPU_ARCH),x86)
|
||||
DEFAULT_COMPILER = cl
|
||||
CC = cl
|
||||
CCC = cl
|
||||
else
|
||||
ifeq ($(CPU_ARCH),ARM)
|
||||
DEFAULT_COMPILER = clarm
|
||||
CC = clarm
|
||||
CCC = clarm
|
||||
else
|
||||
include CPU_ARCH_is_not_recognized
|
||||
include _$(CPU_ARCH)
|
||||
endif
|
||||
endif
|
||||
|
||||
LINK = link
|
||||
AR = lib
|
||||
AR += -NOLOGO -OUT:"$@"
|
||||
RANLIB = echo
|
||||
BSDECHO = echo
|
||||
|
||||
ifdef BUILD_TREE
|
||||
NSINSTALL_DIR = $(BUILD_TREE)/nss
|
||||
else
|
||||
NSINSTALL_DIR = $(CORE_DEPTH)/coreconf/nsinstall
|
||||
endif
|
||||
NSINSTALL = nsinstall
|
||||
|
||||
MKDEPEND_DIR = $(CORE_DEPTH)/coreconf/mkdepend
|
||||
MKDEPEND = $(MKDEPEND_DIR)/$(OBJDIR_NAME)/mkdepend.exe
|
||||
# Note: MKDEPENDENCIES __MUST__ be a relative pathname, not absolute.
|
||||
# If it is absolute, gmake will crash unless the named file exists.
|
||||
MKDEPENDENCIES = $(OBJDIR_NAME)/depend.mk
|
||||
|
||||
INSTALL = $(NSINSTALL)
|
||||
MAKE_OBJDIR = mkdir
|
||||
MAKE_OBJDIR += $(OBJDIR)
|
||||
RC = rc.exe
|
||||
GARBAGE += $(OBJDIR)/vc20.pdb $(OBJDIR)/vc40.pdb
|
||||
XP_DEFINE += -DXP_PC
|
||||
LIB_SUFFIX = lib
|
||||
DLL_SUFFIX = dll
|
||||
|
||||
ifdef BUILD_OPT
|
||||
# OS_CFLAGS += -MD
|
||||
OPTIMIZER += -O2
|
||||
DEFINES += -UDEBUG -U_DEBUG -DNDEBUG
|
||||
DLLFLAGS += -OUT:"$@"
|
||||
else
|
||||
#
|
||||
# Define USE_DEBUG_RTL if you want to use the debug runtime library
|
||||
# (RTL) in the debug build
|
||||
#
|
||||
ifdef USE_DEBUG_RTL
|
||||
# OS_CFLAGS += -MDd
|
||||
else
|
||||
# OS_CFLAGS += -MD
|
||||
endif
|
||||
OPTIMIZER += -Od -Z7
|
||||
#OPTIMIZER += -Zi -Fd$(OBJDIR)/ -Od
|
||||
DEFINES += -DDEBUG -D_DEBUG -UNDEBUG -DDEBUG_$(USERNAME)
|
||||
DLLFLAGS += -DEBUG -DEBUGTYPE:CV -OUT:"$@"
|
||||
LDFLAGS += -DEBUG -DEBUGTYPE:CV
|
||||
endif
|
||||
|
||||
# DEFINES += -DWIN32
|
||||
|
||||
ifdef MAPFILE
|
||||
DLLFLAGS += -DEF:$(MAPFILE)
|
||||
endif
|
||||
|
||||
# Change PROCESS to put the mapfile in the correct format for this platform
|
||||
PROCESS_MAP_FILE = cp $(LIBRARY_NAME).def $@
|
||||
|
||||
#
|
||||
# The following is NOT needed for the NSPR 2.0 library.
|
||||
#
|
||||
|
||||
DEFINES += -D_WINDOWS
|
||||
|
||||
# override default, which is ASFLAGS = CFLAGS
|
||||
AS = ml.exe
|
||||
ASFLAGS = -Cp -Sn -Zi -coff $(INCLUDES)
|
||||
|
||||
#
|
||||
# override the definitions of RELEASE_TREE found in tree.mk
|
||||
#
|
||||
ifndef RELEASE_TREE
|
||||
ifdef BUILD_SHIP
|
||||
ifdef USE_SHIPS
|
||||
RELEASE_TREE = $(NTBUILD_SHIP)
|
||||
else
|
||||
RELEASE_TREE = //redbuild/components
|
||||
endif
|
||||
else
|
||||
RELEASE_TREE = //redbuild/components
|
||||
endif
|
||||
endif
|
||||
|
||||
#
|
||||
# override the definitions of LIB_PREFIX and DLL_PREFIX in prefix.mk
|
||||
#
|
||||
|
||||
ifndef LIB_PREFIX
|
||||
LIB_PREFIX = $(NULL)
|
||||
endif
|
||||
|
||||
ifndef DLL_PREFIX
|
||||
DLL_PREFIX = $(NULL)
|
||||
endif
|
||||
|
||||
#
|
||||
# override the definitions of various _SUFFIX symbols in suffix.mk
|
||||
#
|
||||
|
||||
#
|
||||
# Object suffixes
|
||||
#
|
||||
ifndef OBJ_SUFFIX
|
||||
OBJ_SUFFIX = .obj
|
||||
endif
|
||||
|
||||
#
|
||||
# Assembler source suffixes
|
||||
#
|
||||
ifndef ASM_SUFFIX
|
||||
ASM_SUFFIX = .asm
|
||||
endif
|
||||
|
||||
#
|
||||
# Library suffixes
|
||||
#
|
||||
|
||||
ifndef IMPORT_LIB_SUFFIX
|
||||
IMPORT_LIB_SUFFIX = .$(LIB_SUFFIX)
|
||||
endif
|
||||
|
||||
ifndef DYNAMIC_LIB_SUFFIX_FOR_LINKING
|
||||
DYNAMIC_LIB_SUFFIX_FOR_LINKING = $(IMPORT_LIB_SUFFIX)
|
||||
endif
|
||||
|
||||
#
|
||||
# Program suffixes
|
||||
#
|
||||
ifndef PROG_SUFFIX
|
||||
PROG_SUFFIX = .exe
|
||||
endif
|
||||
|
||||
#
|
||||
# override ruleset.mk, removing the "lib" prefix for library names, and
|
||||
# adding the "32" after the LIBRARY_VERSION.
|
||||
#
|
||||
ifdef LIBRARY_NAME
|
||||
SHARED_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION)32$(JDK_DEBUG_SUFFIX).dll
|
||||
IMPORT_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION)32$(JDK_DEBUG_SUFFIX).lib
|
||||
endif
|
||||
|
||||
#
|
||||
# override the TARGETS defined in ruleset.mk, adding IMPORT_LIBRARY
|
||||
#
|
||||
ifndef TARGETS
|
||||
TARGETS = $(LIBRARY) $(SHARED_LIBRARY) $(IMPORT_LIBRARY) $(PROGRAM)
|
||||
endif
|
||||
|
||||
|
||||
#
|
||||
# Always set CPU_TAG on Linux, OpenVMS, WINCE.
|
||||
#
|
||||
CPU_TAG = _$(CPU_ARCH)
|
||||
|
||||
@@ -1,99 +0,0 @@
|
||||
#
|
||||
# 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 the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
#
|
||||
|
||||
#
|
||||
# Config stuff for WINCE 3.0 (MS Pocket PC 2002)
|
||||
#
|
||||
# CPU_ARCH must already be defined to one of:
|
||||
# x86, ARM
|
||||
#
|
||||
# This makefile defines the following variables:
|
||||
# OS_CFLAGS, and OS_DLLFLAGS.
|
||||
|
||||
include $(CORE_DEPTH)/coreconf/WINCE.mk
|
||||
|
||||
CEVersion = 300
|
||||
CePlatform = WIN32_PLATFORM_PSPC=310
|
||||
|
||||
ifeq ($(CPU_ARCH), x86)
|
||||
DEFINES += -D_X86_ -D_i386_ -Di_386_ -Dx86
|
||||
OS_CFLAGS += -Gs8192 -GF
|
||||
OS_DLLFLAGS += -machine:IX86
|
||||
else
|
||||
ifeq ($(CPU_ARCH), ARM)
|
||||
DEFINES += -DARM -D_ARM_
|
||||
OS_DLLFLAGS += -machine:ARM
|
||||
else
|
||||
include CPU_ARCH_is_undefined
|
||||
endif
|
||||
endif
|
||||
|
||||
DEFINES += -D_WIN32_WCE=300 -DUNDER_CE=300
|
||||
DEFINES += -DWIN32_PLATFORM_PSPC=310
|
||||
DEFINES += -DUNICODE -D_UNICODE
|
||||
OS_CFLAGS += -W3 -nologo
|
||||
|
||||
OS_DLLFLAGS += -DLL
|
||||
|
||||
LINKFLAGS = -nologo -PDB:NONE -subsystem:windowsce,3.00 \
|
||||
-nodefaultlib:libc.lib \
|
||||
-nodefaultlib:libcd.lib \
|
||||
-nodefaultlib:libcmt.lib \
|
||||
-nodefaultlib:libcmtd.lib \
|
||||
-nodefaultlib:msvcrt.lib \
|
||||
-nodefaultlib:msvcrtd.lib \
|
||||
-nodefaultlib:oldnames.lib \
|
||||
$(NULL)
|
||||
|
||||
LINK += $(LINKFLAGS)
|
||||
LDFLAGS += $(LINKFLAGS)
|
||||
|
||||
OS_LIBS= coredll.lib corelibc.lib
|
||||
|
||||
#DLLBASE = -base:"0x00100000" -stack:0x10000,0x1000 -entry:"_DllMainCRTStartup"
|
||||
DLLBASE += -align:"4096"
|
||||
|
||||
#SUB_SHLOBJS =
|
||||
#EXTRA_LIBS =
|
||||
#EXTRA_SHARED_LIBS =
|
||||
#OS_LIBS=
|
||||
#LD_LIBS=
|
||||
|
||||
#
|
||||
# Win NT needs -GT so that fibers can work
|
||||
#
|
||||
#OS_CFLAGS += -GT
|
||||
#DEFINES += -DWINNT
|
||||
|
||||
# WINNT uses the lib prefix, Win95 and WinCE don't
|
||||
#NSPR31_LIB_PREFIX = lib
|
||||
@@ -1,58 +0,0 @@
|
||||
/*
|
||||
* 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 the Netscape security libraries.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the
|
||||
* terms of the GNU General Public License Version 2 or later (the
|
||||
* "GPL"), in which case the provisions of the GPL are applicable
|
||||
* instead of those above. If you wish to allow use of your
|
||||
* version of this file only under the terms of the GPL and not to
|
||||
* allow others to use your version of this file under the MPL,
|
||||
* indicate your decision by deleting the provisions above and
|
||||
* replace them with the notice and other provisions required by
|
||||
* the GPL. If you do not delete the provisions above, a recipient
|
||||
* may use your version of this file under either the MPL or the
|
||||
* GPL.
|
||||
*/
|
||||
|
||||
#ifndef DEVTM_H
|
||||
#define DEVTM_H
|
||||
|
||||
#ifdef DEBUG
|
||||
static const char DEVTM_CVS_ID[] = "@(#) $RCSfile: devtm.h,v $ $Revision: 1.2 $ $Date: 2002-04-18 17:29:54 $ $Name: not supported by cvs2svn $";
|
||||
#endif /* DEBUG */
|
||||
|
||||
/*
|
||||
* devtm.h
|
||||
*
|
||||
* This file contains module-private definitions for the low-level
|
||||
* cryptoki devices.
|
||||
*/
|
||||
|
||||
#ifndef DEVT_H
|
||||
#include "devt.h"
|
||||
#endif /* DEVT_H */
|
||||
|
||||
PR_BEGIN_EXTERN_C
|
||||
|
||||
#define MAX_LOCAL_CACHE_OBJECTS 10
|
||||
|
||||
PR_END_EXTERN_C
|
||||
|
||||
#endif /* DEVTM_H */
|
||||
@@ -1,72 +0,0 @@
|
||||
/*
|
||||
* 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 the Netscape security libraries.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the
|
||||
* terms of the GNU General Public License Version 2 or later (the
|
||||
* "GPL"), in which case the provisions of the GPL are applicable
|
||||
* instead of those above. If you wish to allow use of your
|
||||
* version of this file only under the terms of the GPL and not to
|
||||
* allow others to use your version of this file under the MPL,
|
||||
* indicate your decision by deleting the provisions above and
|
||||
* replace them with the notice and other provisions required by
|
||||
* the GPL. If you do not delete the provisions above, a recipient
|
||||
* may use your version of this file under either the MPL or the
|
||||
* GPL.
|
||||
*/
|
||||
|
||||
#ifndef NSSDEV_H
|
||||
#define NSSDEV_H
|
||||
|
||||
#ifdef DEBUG
|
||||
static const char NSSDEV_CVS_ID[] = "@(#) $RCSfile: nssdev.h,v $ $Revision: 1.1 $ $Date: 2002-04-04 20:00:23 $ $Name: not supported by cvs2svn $";
|
||||
#endif /* DEBUG */
|
||||
/*
|
||||
* nssdev.h
|
||||
*
|
||||
* High-level methods for interaction with cryptoki devices
|
||||
*/
|
||||
|
||||
#ifndef NSSDEVT_H
|
||||
#include "nssdevt.h"
|
||||
#endif /* NSSDEVT_H */
|
||||
|
||||
PR_BEGIN_EXTERN_C
|
||||
|
||||
/* NSSAlgorithmAndParameters
|
||||
*
|
||||
* NSSAlgorithmAndParameters_CreateSHA1Digest
|
||||
* NSSAlgorithmAndParameters_CreateMD5Digest
|
||||
*/
|
||||
|
||||
NSS_EXTERN NSSAlgorithmAndParameters *
|
||||
NSSAlgorithmAndParameters_CreateSHA1Digest
|
||||
(
|
||||
NSSArena *arenaOpt
|
||||
);
|
||||
|
||||
NSS_EXTERN NSSAlgorithmAndParameters *
|
||||
NSSAlgorithmAndParameters_CreateMD5Digest
|
||||
(
|
||||
NSSArena *arenaOpt
|
||||
);
|
||||
|
||||
PR_END_EXTERN_C
|
||||
|
||||
#endif /* DEV_H */
|
||||
@@ -1,119 +0,0 @@
|
||||
#!/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-04-25 02:51:10 seawood%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`
|
||||
until test $found != 0 -o ! -L "$progname" ; do
|
||||
run_moz="$curdir/run-mozilla.sh"
|
||||
if [ -x $run_moz ]; then
|
||||
dist_bin=$curdir
|
||||
found=1
|
||||
else
|
||||
bn=`basename "$progname"`
|
||||
cd `dirname "$progname"`
|
||||
progname=`/bin/ls -l "$bn" |sed -e 's/^.* -> //' `
|
||||
if [ ! -x "$progname" ]; then
|
||||
break
|
||||
fi
|
||||
curdir=`dirname $progname`
|
||||
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 "$@"
|
||||
@@ -42,6 +42,8 @@ Contributor(s): ______________________________________. -->
|
||||
%buildDTD;
|
||||
<!ENTITY % navigatorDTD SYSTEM "chrome://navigator/locale/navigator.dtd" >
|
||||
%navigatorDTD;
|
||||
<!ENTITY % navigatorTitleDTD SYSTEM "chrome://navigator/locale/navigator-title.dtd" >
|
||||
%navigatorTitleDTD;
|
||||
]>
|
||||
|
||||
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
|
||||
Reference in New Issue
Block a user