Compare commits

..

2 Commits

Author SHA1 Message Date
spider
0454ef3092 Add Display query
git-svn-id: svn://10.0.0.236/branches/TREX_WIDGET_BRANCH@3234 18797224-902f-48f8-a5cc-f745e15eee43
1998-06-04 18:39:17 +00:00
(no author)
2ff40f781d This commit was manufactured by cvs2svn to create branch
'TREX_WIDGET_BRANCH'.

git-svn-id: svn://10.0.0.236/branches/TREX_WIDGET_BRANCH@2891 18797224-902f-48f8-a5cc-f745e15eee43
1998-06-02 01:21:30 +00:00
10 changed files with 1448 additions and 498 deletions

View File

@@ -1,248 +0,0 @@
#
### hostname: bl-bldlnx03.office.mozilla.org
### uname: Linux bl-bldlnx03.office.mozilla.org 2.6.18-1.2798.fc6 #1 SMP Mon Oct 16 14:54:20 EDT 2006 i686 i686 i386 GNU/Linux
##
#
#- tinder-config.pl - Tinderbox configuration file.
#- Uncomment the variables you need to set.
#- The default values are the same as the commented variables.
# $ENV{XPCOM_CC_DO_NOTHING}
#-----------------------------------------------------------------------------
# Default: 0
# Values: 0 | 1
# Purpose: Turn graydon's cycle collector on/off
#$ENV{XPCOM_CC_DO_NOTHING} = 0;
# $ENV{MOZ_PACKAGE_MSI}
#-----------------------------------------------------------------------------
# Default: 0
# Values: 0 | 1
# Purpose: Controls whether a MSI package is made.
# Requires: Windows and a local MakeMSI installation.
#$ENV{MOZ_PACKAGE_MSI} = 0;
# $ENV{MOZ_SYMBOLS_TRANSFER_TYPE}
#-----------------------------------------------------------------------------
# Default: scp
# Values: scp | rsync
# Purpose: Use scp or rsync to transfer symbols to the Talkback server.
# Requires: The selected type requires the command be available both locally
# and on the Talkback server.
#$ENV{MOZ_SYMBOLS_TRANSFER_TYPE} = "scp";
#- PLEASE FILL THIS IN WITH YOUR PROPER EMAIL ADDRESS
#$BuildAdministrator = "$ENV{USER}\@$ENV{HOST}";
#$BuildAdministrator = ($ENV{USER} || "cltbld") . "\@" . ($ENV{HOST} || "dhcp");
#- You'll need to change these to suit your machine's needs
#$DisplayServer = ':0.0';
#- Default values of command-line opts
#-
#$BuildDepend = 1; # Depend or Clobber
#$BuildDebug = 0; # Debug or Opt (Darwin)
#$ReportStatus = 1; # Send results to server, or not
#$ReportFinalStatus = 1; # Finer control over $ReportStatus.
#$UseTimeStamp = 1; # Use the CVS 'pull-by-timestamp' option, or not
#$BuildOnce = 0; # Build once, don't send results to server
$TestOnly = 1; # Only run tests, don't pull/build
#$BuildEmbed = 0; # After building seamonkey, go build embed app.
#$SkipMozilla = 0; # Use to debug post-mozilla.pl scripts.
#$SkipCheckout = 0; # Use to debug build process without checking out new source.
#$BuildLocales = 0; # Do l10n packaging?
# Tests
$CleanProfile = 1;
#$ResetHomeDirForTests = 1;
#$ProductName = "Mozilla";
$VendorName = 'mozilla';
#$RunMozillaTests = 1; # Allow turning off of all tests if needed.
$RegxpcomTest = 1;
$AliveTest = 1;
#$JavaTest = 0;
#$ViewerTest = 0;
#$BloatTest = 0; # warren memory bloat test
#$BloatTest2 = 0; # dbaron memory bloat test, require tracemalloc
#$DomToTextConversionTest = 0;
#$XpcomGlueTest = 0;
$CodesizeTest = 0; # Z, require mozilla/tools/codesighs
$EmbedCodesizeTest = 0; # mZ, require mozilla/tools/codesigns
#$MailBloatTest = 0;
#$EmbedTest = 0; # Assumes you wanted $BuildEmbed=1
$LayoutPerformanceTest = 1; # Tp
$LayoutPerformanceLocalTest = 1; # Tp
$DHTMLPerformanceTest = 1; # Tdhtml
#$QATest = 0;
$XULWindowOpenTest = 1; # Txul
$StartupPerformanceTest = 1; # Ts
$TestsPhoneHome = 1; # Should test report back to server?
$TestOnlyTinderbox = 1;
$DownloadBuildFile = 'firefox-3.0a7pre.en-US.linux-i686.tar.bz2';
$DownloadBuildURL = 'http://stage.mozilla.org/pub/mozilla.org/firefox/tinderbox-builds/fx-linux-tbox-trunk';
$DownloadBuildDir = 'firefox';
# If TestOnlyTinderbox is enabled, fetch the latest build info from tinderbox in a
# parseable format
$TinderboxServerURL = 'http://tinderbox.mozilla.org/showbuilds.cgi?tree=Firefox&quickparse=1';
$MatchBuildname = 'Linux fx-linux-tbox Depend Nightly';
$GraphNameOverride = "bl-bldlnx03_fx-linux-tbox-HEAD"; # Override name built from ::hostname() and $BuildTag
# $results_server
#----------------------------------------------------------------------------
# Server on which test results will be accessible. This was originally tegu,
# then became axolotl. Once we moved services from axolotl, it was time
# to give this service its own hostname to make future transitions easier.
# - cmp@mozilla.org
#$results_server = "build-graphs.mozilla.org";
$pageload_server = "spider.office.mozilla.org";
#
# Timeouts, values are in seconds.
#
#$CVSCheckoutTimeout = 3600;
#$CreateProfileTimeout = 45;
#$RegxpcomTestTimeout = 120;
$AliveTestTimeout = 5;
#$ViewerTestTimeout = 45;
#$EmbedTestTimeout = 45;
#$BloatTestTimeout = 120; # seconds
#$MailBloatTestTimeout = 120; # seconds
#$JavaTestTimeout = 45;
#$DomTestTimeout = 45; # seconds
#$XpcomGlueTestTimeout = 15;
#$CodesizeTestTimeout = 900; # seconds
#$CodesizeTestType = "auto"; # {"auto"|"base"}
#$LayoutPerformanceTestTimeout = 1200; # entire test, seconds
#$LayoutPerformanceLocalTestTimeout = 1200; # entire test, seconds
#$DHTMLPerformanceTestTimeout = 1200; # entire test, seconds
#$QATestTimeout = 1200; # entire test, seconds
#$LayoutPerformanceTestPageTimeout = 30000; # each page, ms
#$StartupPerformanceTestTimeout = 15; # seconds
#$XULWindowOpenTestTimeout = 150; # seconds
#$MozConfigFileName = 'mozconfig';
#$UseMozillaProfile = 1;
#$MozProfileName = 'default';
#- Set these to what makes sense for your system
#$Make = 'gmake'; # Must be GNU make
#$MakeOverrides = '';
#$mail = '/bin/mail';
#$CVS = 'cvs -q';
#$CVSCO = 'checkout -P';
# win32 usually doesn't have /bin/mail
#$blat = 'c:/nstools/bin/blat';
#$use_blat = 0;
# Set moz_cvsroot to something like:
# :pserver:$ENV{USER}%netscape.com\@cvs.mozilla.org:/cvsroot
# :pserver:anonymous\@cvs-mirror.mozilla.org:/cvsroot
#
# Note that win32 may not need \@, depends on ' or ".
# :pserver:$ENV{USER}%netscape.com@cvs.mozilla.org:/cvsroot
#$moz_cvsroot = $ENV{CVSROOT};
#- Set these proper values for your tinderbox server
#$Tinderbox_server = 'tinderbox-daemon@tinderbox.mozilla.org';
# Allow for non-client builds, e.g. camino.
#$moz_client_mk = 'client.mk';
#- Set if you want to build in a separate object tree
#$ObjDir = '';
# Extra build name, if needed.
$BuildNameExtra = "fx-linux-tbox perf test";
# User comment, eg. ip address for dhcp builds.
# ex: $UserComment = "ip = 208.12.36.108";
#$UserComment = 0;
#-
#- The rest should not need to be changed
#-
#- Minimum wait period from start of build to start of next build in minutes.
$BuildSleep = 1;
#- Until you get the script working. When it works,
#- change to the tree you're actually building
$BuildTree = 'MozillaExperimental';
$BuildTag = 'HEAD';
#$BuildConfigDir = 'mozilla/config';
#$Topsrcdir = 'mozilla';
$BinaryName = 'firefox-bin';
#
# For embedding app, use:
#$EmbedBinaryName = 'TestGtkEmbed';
#$EmbedDistDir = 'dist/bin'
#$ShellOverride = ''; # Only used if the default shell is too stupid
#$ConfigureArgs = '';
#$ConfigureEnvArgs = '';
#$Compiler = 'gcc';
#$NSPRArgs = '';
#$ShellOverride = '';
# Release build options
#$ReleaseBuild = 1;
#$clean_objdir = 1; # remove objdir when starting release cycle?
#$clean_srcdir = 1; # remove srcdir when starting release cycle?
#$shiptalkback = 1;
#$ReleaseToLatest = 1; # Push the release to latest-<milestone>?
#$ReleaseToDated = 1; # Push the release to YYYY-MM-DD-HH-<milestone>?
#$ReleaseGroup = ''; # group to set uploaded files to
#$build_hour = "8";
#$package_creation_path = "/xpinstall/packager";
# needs setting for mac + talkback: $mac_bundle_path = "/browser/app";
#$ssh_version = "2";
#$ssh_user = "cltbld";
#$ssh_server = "stage.mozilla.org";
#$ftp_path = "/home/ftp/pub/mozilla/nightly/experimental";
#$url_path = "http://ftp.mozilla.org/pub/mozilla.org/mozilla/nightly/experimental";
#$tbox_ftp_path = $ftp_path;
#$tbox_url_path = $url_path;
#$milestone = "trunk";
#$notify_list = "cmp\@mozilla.org";
#$stub_installer = 1;
#$sea_installer = 1;
#$archive = 0;
#$push_raw_xpis = 1;
# Reboot the OS at the end of build-and-test cycle. This is primarily
# intended for Win9x, which can't last more than a few cycles before
# locking up (and testing would be suspect even after a couple of cycles).
# Right now, there is only code to force the reboot for Win9x, so even
# setting this to 1, will not have an effect on other platforms. Setting
# up win9x to automatically logon and begin running tinderbox is left
# as an exercise to the reader.
#$RebootSystem = 0;
# LogCompression specifies the type of compression used on the log file.
# Valid options are 'gzip', and 'bzip2'. Please make sure the binaries
# for 'gzip' or 'bzip2' are in the user's path before setting this
# option.
#$LogCompression = '';
# LogEncoding specifies the encoding format used for the logs. Valid
# options are 'base64', and 'uuencode'. If $LogCompression is set above,
# this needs to be set to 'base64' or 'uuencode' to ensure that the
# binary data is transferred properly.
#$LogEncoding = '';
# Prevent Extension Manager from spawning child processes during tests
# - processes that tbox scripts cannot kill.
#$ENV{NO_EM_RESTART} = '1';

View File

@@ -1,250 +0,0 @@
#
#### hostname: bl-bldxp01.office.mozilla.org
#### uname: CYGWIN_NT-5.1 bl-bldxp01 1.5.19(0.150/4/2) 2006-01-20 13:28 i686 Cygwin
###
#
#- tinder-config.pl - Tinderbox configuration file.
#- Uncomment the variables you need to set.
#- The default values are the same as the commented variables.
# $ENV{XPCOM_CC_DO_NOTHING}
#-----------------------------------------------------------------------------
# Default: 0
# Values: 0 | 1
# Purpose: Turn graydon's cycle collector on/off
#$ENV{XPCOM_CC_DO_NOTHING} = 0;
# $ENV{MOZ_PACKAGE_MSI}
#-----------------------------------------------------------------------------
# Default: 0
# Values: 0 | 1
# Purpose: Controls whether a MSI package is made.
# Requires: Windows and a local MakeMSI installation.
#$ENV{MOZ_PACKAGE_MSI} = 0;
# $ENV{MOZ_SYMBOLS_TRANSFER_TYPE}
#-----------------------------------------------------------------------------
# Default: scp
# Values: scp | rsync
# Purpose: Use scp or rsync to transfer symbols to the Talkback server.
# Requires: The selected type requires the command be available both locally
# and on the Talkback server.
#$ENV{MOZ_SYMBOLS_TRANSFER_TYPE} = "scp";
#- PLEASE FILL THIS IN WITH YOUR PROPER EMAIL ADDRESS
#$BuildAdministrator = "$ENV{USER}\@$ENV{HOST}";
#$BuildAdministrator = ($ENV{USER} || "cltbld") . "\@" . ($ENV{HOST} || "dhcp");
#- You'll need to change these to suit your machine's needs
#$DisplayServer = ':0.0';
#- Default values of command-line opts
#-
#$BuildDepend = 1; # Depend or Clobber
#$BuildDebug = 0; # Debug or Opt (Darwin)
#$ReportStatus = 1; # Send results to server, or not
#$ReportFinalStatus = 1; # Finer control over $ReportStatus.
#$UseTimeStamp = 1; # Use the CVS 'pull-by-timestamp' option, or not
#$BuildOnce = 0; # Build once, don't send results to server
$TestOnly = 1; # Only run tests, don't pull/build
#$BuildEmbed = 0; # After building seamonkey, go build embed app.
#$SkipMozilla = 0; # Use to debug post-mozilla.pl scripts.
#$SkipCheckout = 0; # Use to debug build process without checking out new source.
#$BuildLocales = 0; # Do l10n packaging?
# Tests
$CleanProfile = 1;
#$ResetHomeDirForTests = 1;
#$ProductName = "Mozilla";
$VendorName = 'mozilla';
#$RunMozillaTests = 1; # Allow turning off of all tests if needed.
$RegxpcomTest = 0;
$AliveTest = 1;
#$JavaTest = 0;
#$ViewerTest = 0;
#$BloatTest = 0; # warren memory bloat test
#$BloatTest2 = 0; # dbaron memory bloat test, require tracemalloc
#$DomToTextConversionTest = 0;
#$XpcomGlueTest = 0;
$CodesizeTest = 0; # Z, require mozilla/tools/codesighs
$EmbedCodesizeTest = 0; # mZ, require mozilla/tools/codesigns
#$MailBloatTest = 0;
#$EmbedTest = 0; # Assumes you wanted $BuildEmbed=1
$LayoutPerformanceTest = 1; # Tp
$LayoutPerformanceLocalTest = 1; # Tp2
$DHTMLPerformanceTest = 1; # Tdhtml
#$QATest = 0;
$XULWindowOpenTest = 1; # Txul
$StartupPerformanceTest = 1; # Ts
$TestsPhoneHome = 1; # Should test report back to server?
# If TestOnlyTinderbox is enabled, fetch the latest build info from tinderbox in a
# parseable format
$TinderboxServerURL = 'http://tinderbox.mozilla.org/showbuilds.cgi?tree=MozillaExperimental&quickparse=1';
$MatchBuildname = 'WINNT 5.2 fxnewref-win32- Depend Fx-Newref';
#$GraphNameOverride = 'Fx-Trunk-win32-test1'; # Override name built from ::hostname() and $BuildTag
# $results_server
#----------------------------------------------------------------------------
# Server on which test results will be accessible. This was originally tegu,
# then became axolotl. Once we moved services from axolotl, it was time
# to give this service its own hostname to make future transitions easier.
# - cmp@mozilla.org
#$results_server = "build-graphs.mozilla.org";
$pageload_server = "spider.office.mozilla.org";
#
# Timeouts, values are in seconds.
#
#$CVSCheckoutTimeout = 3600;
#$CreateProfileTimeout = 45;
#$RegxpcomTestTimeout = 120;
$AliveTestTimeout = 45;
#$ViewerTestTimeout = 45;
#$EmbedTestTimeout = 45;
#$BloatTestTimeout = 120; # seconds
#$MailBloatTestTimeout = 120; # seconds
#$JavaTestTimeout = 45;
#$DomTestTimeout = 45; # seconds
#$XpcomGlueTestTimeout = 15;
#$CodesizeTestTimeout = 900; # seconds
#$CodesizeTestType = "auto"; # {"auto"|"base"}
#$LayoutPerformanceTestTimeout = 1200; # entire test, seconds
#$LayoutPerformanceLocalTestTimeout = 1200; # entire test, seconds
#$DHTMLPerformanceTestTimeout = 1200; # entire test, seconds
#$QATestTimeout = 1200; # entire test, seconds
#$LayoutPerformanceTestPageTimeout = 30000; # each page, ms
#$StartupPerformanceTestTimeout = 15; # seconds
#$XULWindowOpenTestTimeout = 150; # seconds
#$MozConfigFileName = 'mozconfig';
#$UseMozillaProfile = 1;
#$MozProfileName = 'default';
#- Set these to what makes sense for your system
#$Make = 'gmake'; # Must be GNU make
#$MakeOverrides = '';
#$mail = '/bin/mail';
#$CVS = 'cvs -q';
#$CVSCO = 'checkout -P';
# win32 usually doesn't have /bin/mail
#$blat = 'c:/nstools/bin/blat';
#$use_blat = 0;
# Set moz_cvsroot to something like:
# :pserver:$ENV{USER}%netscape.com\@cvs.mozilla.org:/cvsroot
# :pserver:anonymous\@cvs-mirror.mozilla.org:/cvsroot
#
# Note that win32 may not need \@, depends on ' or ".
# :pserver:$ENV{USER}%netscape.com@cvs.mozilla.org:/cvsroot
#$moz_cvsroot = $ENV{CVSROOT};
#- Set these proper values for your tinderbox server
#$Tinderbox_server = 'tinderbox-daemon@tinderbox.mozilla.org';
# Allow for non-client builds, e.g. camino.
#$moz_client_mk = 'client.mk';
#- Set if you want to build in a separate object tree
#$ObjDir = '';
# Extra build name, if needed.
$BuildNameExtra = 'fxnewref-win32-tbox perf test';
# User comment, eg. ip address for dhcp builds.
# ex: $UserComment = "ip = 208.12.36.108";
#$UserComment = 0;
#-
#- The rest should not need to be changed
#-
#- Minimum wait period from start of build to start of next build in minutes.
#$BuildSleep = 10;
#- Until you get the script working. When it works,
#- change to the tree you're actually building
$BuildTree = 'Firefox';
$BuildTag = 'HEAD';
#$BuildConfigDir = 'mozilla/config';
#$Topsrcdir = 'mozilla';
$BinaryName = 'firefox.exe';
#
# For embedding app, use:
#$EmbedBinaryName = 'TestGtkEmbed';
#$EmbedDistDir = 'dist/bin'
#$ShellOverride = ''; # Only used if the default shell is too stupid
#$ConfigureArgs = '';
#$ConfigureEnvArgs = '';
#$Compiler = 'gcc';
#$NSPRArgs = '';
#$ShellOverride = '';
# Release build options
#$ReleaseBuild = 1;
#$clean_objdir = 1; # remove objdir when starting release cycle?
#$clean_srcdir = 1; # remove srcdir when starting release cycle?
#$shiptalkback = 1;
#$ReleaseToLatest = 1; # Push the release to latest-<milestone>?
#$ReleaseToDated = 1; # Push the release to YYYY-MM-DD-HH-<milestone>?
#$ReleaseGroup = ''; # group to set uploaded files to
#$build_hour = "8";
#$package_creation_path = "/xpinstall/packager";
# needs setting for mac + talkback: $mac_bundle_path = "/browser/app";
#$ssh_version = "2";
#$ssh_user = "cltbld";
#$ssh_server = "stage.mozilla.org";
#$ftp_path = "/home/ftp/pub/mozilla/nightly/experimental";
#$url_path = "http://ftp.mozilla.org/pub/mozilla.org/mozilla/nightly/experimental";
#$tbox_ftp_path = $ftp_path;
#$tbox_url_path = $url_path;
#$milestone = "trunk";
#$notify_list = "cmp\@mozilla.org";
#$stub_installer = 1;
#$sea_installer = 1;
#$archive = 0;
#$push_raw_xpis = 1;
# Reboot the OS at the end of build-and-test cycle. This is primarily
# intended for Win9x, which can't last more than a few cycles before
# locking up (and testing would be suspect even after a couple of cycles).
# Right now, there is only code to force the reboot for Win9x, so even
# setting this to 1, will not have an effect on other platforms. Setting
# up win9x to automatically logon and begin running tinderbox is left
# as an exercise to the reader.
#$RebootSystem = 0;
# LogCompression specifies the type of compression used on the log file.
# Valid options are 'gzip', and 'bzip2'. Please make sure the binaries
# for 'gzip' or 'bzip2' are in the user's path before setting this
# option.
#$LogCompression = '';
# LogEncoding specifies the encoding format used for the logs. Valid
# options are 'base64', and 'uuencode'. If $LogCompression is set above,
# this needs to be set to 'base64' or 'uuencode' to ensure that the
# binary data is transferred properly.
#$LogEncoding = '';
# Prevent Extension Manager from spawning child processes during tests
# - processes that tbox scripts cannot kill.
#$ENV{NO_EM_RESTART} = '1';
# If tinderbox is running in a test-only mode, it needs to be able to download
# the latest build and unpack it rather than building it.
$TestOnlyTinderbox = 1;
$DownloadBuildFile = 'firefox-3.0a8pre.en-US.win32.zip';
$DownloadBuildURL = 'http://stage.mozilla.org/pub/mozilla.org/firefox/nightly/experimental/win32-newref/hourly-builds/latest-trunk';
$DownloadBuildDir = 'firefox';

View File

@@ -0,0 +1,57 @@
#!gmake
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
DEPTH = ../../..
LIBRARY_NAME = widgetunix
MODULE=raptor
REQUIRES=util img xpcom raptor netlib
DEFINES = -D_IMPL_NS_WIDGET
EXTRA_DSO_LDOPTS+= \
$(DIST)/bin/libxpcom.so \
$(LIBNSPR) -lXm -lXt -lX11
CPPSRCS=nsWidgetFactory.cpp \
nsWindow.cpp \
nsXtEventHandler.cpp \
nsToolkit.cpp
CPP_OBJS= \
./$(OBJDIR)/nsWidgetFactory.o \
./$(OBJDIR)/nsWindow.o \
./$(OBJDIR)/nsToolkit.o \
./$(OBJDIR)/nsXtEventHandler.o \
$(NULL)
include $(DEPTH)/config/config.mk
TARGETS = $(LIBRARY)
include $(DEPTH)/config/rules.mk

View File

@@ -0,0 +1,70 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the 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.
*/
#include "nsToolkit.h"
#include "nsWindow.h"
#include "prmon.h"
#include "prtime.h"
#include "nsGUIEvent.h"
void RunPump(void* arg)
{
}
//-------------------------------------------------------------------------
//
// constructor
//
//-------------------------------------------------------------------------
nsToolkit::nsToolkit()
{
NS_INIT_REFCNT();
}
//-------------------------------------------------------------------------
//
// destructor
//
//-------------------------------------------------------------------------
nsToolkit::~nsToolkit()
{
}
//-------------------------------------------------------------------------
//
// nsISupports implementation macro
//
//-------------------------------------------------------------------------
NS_DEFINE_IID(kIToolkitIID, NS_ITOOLKIT_IID);
NS_IMPL_ISUPPORTS(nsToolkit,kIToolkitIID);
//-------------------------------------------------------------------------
//
//
//-------------------------------------------------------------------------
void nsToolkit::Init(PRThread *aThread)
{
}

View File

@@ -0,0 +1,50 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the 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.
*/
#ifndef TOOLKIT_H
#define TOOLKIT_H
#include "nsIToolkit.h"
struct MethodInfo;
/**
* Wrapper around the thread running the message pump.
* The toolkit abstraction is necessary because the message pump must
* execute within the same thread that created the widget under Win32.
*/
class nsToolkit : public nsIToolkit
{
public:
nsToolkit();
NS_DECL_ISUPPORTS
virtual void Init(PRThread *aThread);
private:
~nsToolkit();
};
#endif // TOOLKIT_H

View File

@@ -0,0 +1,151 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the 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.
*/
#include "nsIFactory.h"
#include "nsISupports.h"
#include "nsWidgetsCID.h"
#include "nsToolkit.h"
#include "nsWindow.h"
static NS_DEFINE_IID(kCWindow, NS_WINDOW_CID);
static NS_DEFINE_IID(kIWidget, NS_IWIDGET_IID);
static NS_DEFINE_IID(kCChild, NS_CHILD_CID);
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
static NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID);
class nsWidgetFactory : public nsIFactory
{
public:
NS_DECL_ISUPPORTS
// nsIFactory methods
NS_IMETHOD CreateInstance(nsISupports *aOuter,
const nsIID &aIID,
void **aResult);
NS_IMETHOD LockFactory(PRBool aLock);
nsWidgetFactory();
~nsWidgetFactory();
};
nsWidgetFactory::nsWidgetFactory()
{
}
nsWidgetFactory::~nsWidgetFactory()
{
}
nsresult nsWidgetFactory::QueryInterface(const nsIID &aIID,
void **aInstancePtr)
{
if (NULL == aInstancePtr) {
return NS_ERROR_NULL_POINTER;
}
if (aIID.Equals(kIFactoryIID)) {
*aInstancePtr = (void*)(nsWidgetFactory*)this;
AddRef();
return NS_OK;
}
if (aIID.Equals(kISupportsIID)) {
*aInstancePtr = (void*)(nsISupports*)(nsWidgetFactory*)this;
AddRef();
return NS_OK;
}
return NS_NOINTERFACE;
}
NS_IMPL_ADDREF(nsWidgetFactory)
NS_IMPL_RELEASE(nsWidgetFactory)
nsresult nsWidgetFactory::CreateInstance(nsISupports *aOuter,
const nsIID &aIID,
void **aResult)
{
if (aResult == NULL) {
return NS_ERROR_NULL_POINTER;
}
*aResult = NULL;
if (nsnull != aOuter && !aIID.Equals(kISupportsIID)) {
// aggregation with IID != nsISupports
return NS_ERROR_ILLEGAL_VALUE;
}
nsIWidget *inst = nsnull;
if (aIID.Equals(kCWindow)) {
inst = (nsIWidget*)new nsWindow(aOuter);
}
else if (aIID.Equals(kIWidget)) {
inst = (nsIWidget*)new nsWindow(aOuter);
}
else if (aIID.Equals(kCChild)) {
inst = (nsIWidget*)new ChildWindow(aOuter);
}
if (inst == NULL) {
return NS_ERROR_OUT_OF_MEMORY;
}
nsresult res = inst->QueryInterface(aIID, aResult);
if (res != NS_OK) {
delete inst ;
}
return res;
return NS_OK;
}
nsresult nsWidgetFactory::LockFactory(PRBool aLock)
{
// Not implemented in simplest case.
return NS_OK;
}
// return the proper factory to the caller
extern "C" NS_WIDGET nsresult NSGetFactory(const nsCID &aClass, nsIFactory **aFactory)
{
if (nsnull == aFactory) {
return NS_ERROR_NULL_POINTER;
}
*aFactory = new nsWidgetFactory();
if (nsnull == aFactory) {
return NS_ERROR_OUT_OF_MEMORY;
}
return (*aFactory)->QueryInterface(kIFactoryIID, (void**)aFactory);
}

View File

@@ -0,0 +1,704 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the 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.
*/
#include "nsWindow.h"
#include "nsIFontMetrics.h"
#include "nsIFontCache.h"
#include "nsGUIEvent.h"
#include "nsIRenderingContext.h"
#include "nsIDeviceContext.h"
#include "nsRect.h"
#include "nsTransform2D.h"
#include "nsGfxCIID.h"
#include "nsXtEventHandler.h"
#include "Xm/Xm.h"
#include "Xm/MainW.h"
#include "Xm/Frame.h"
#include "Xm/XmStrDefs.h"
#include "Xm/DrawingA.h"
#include "stdio.h"
static NS_DEFINE_IID(kIWidgetIID, NS_IWIDGET_IID);
NS_IMPL_QUERY_INTERFACE(nsWindow, kIWidgetIID)
NS_IMPL_ADDREF(nsWindow)
NS_IMPL_RELEASE(nsWindow)
void nsWindow::WidgetToScreen(const nsRect& aOldRect, nsRect& aNewRect)
{
}
void nsWindow::ScreenToWidget(const nsRect& aOldRect, nsRect& aNewRect)
{
}
//-------------------------------------------------------------------------
//
// Setup initial tooltip rectangles
//
//-------------------------------------------------------------------------
void nsWindow::SetTooltips(PRUint32 aNumberOfTips,nsRect* aTooltipAreas[])
{
}
//-------------------------------------------------------------------------
//
// Update all tooltip rectangles
//
//-------------------------------------------------------------------------
void nsWindow::UpdateTooltips(nsRect* aNewTips[])
{
}
//-------------------------------------------------------------------------
//
// Remove all tooltip rectangles
//
//-------------------------------------------------------------------------
void nsWindow::RemoveTooltips()
{
}
//-------------------------------------------------------------------------
//
// nsWindow constructor
//
//-------------------------------------------------------------------------
nsWindow::nsWindow(nsISupports *aOuter)
{
// XXX Til can deal with ColorMaps!
SetForegroundColor(1);
SetBackgroundColor(2);
mToolkit = nsnull ;
}
//-------------------------------------------------------------------------
//
// nsWindow destructor
//
//-------------------------------------------------------------------------
nsWindow::~nsWindow()
{
}
//-------------------------------------------------------------------------
//
// Create the proper widget
//
//-------------------------------------------------------------------------
void nsWindow::Create(nsIWidget *aParent,
const nsRect &aRect,
EVENT_CALLBACK aHandleEventFunction,
nsIDeviceContext *aContext,
nsIToolkit *aToolkit,
nsWidgetInitData *aInitData)
{
Widget mainWindow, frame;
Widget parentWidget;
if (nsnull == mToolkit) {
if (nsnull != aToolkit) {
mToolkit = (nsToolkit*)aToolkit;
mToolkit->AddRef();
}
else {
if (nsnull != aParent) {
mToolkit = (nsToolkit*)(aParent->GetToolkit()); // the call AddRef's, we don't have to
}
// it's some top level window with no toolkit passed in.
// Create a default toolkit with the current thread
else {
mToolkit = new nsToolkit();
mToolkit->AddRef();
mToolkit->Init(PR_GetCurrentThread());
}
}
}
// save the event callback function
mEventCallback = aHandleEventFunction;
// keep a reference to the toolkit object
if (aContext) {
mContext = aContext;
mContext->AddRef();
}
else {
nsresult res;
// XXX Move this! - For some reason Registering in another DLL (shell) isn't working
#define GFXWIN_DLL "libgfxunix.so"
static NS_DEFINE_IID(kCRenderingContextIID, NS_RENDERING_CONTEXT_CID);
static NS_DEFINE_IID(kCDeviceContextIID, NS_DEVICE_CONTEXT_CID);
static NS_DEFINE_IID(kCFontMetricsIID, NS_FONT_METRICS_CID);
static NS_DEFINE_IID(kCImageIID, NS_IMAGE_CID);
NSRepository::RegisterFactory(kCRenderingContextIID, GFXWIN_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCDeviceContextIID, GFXWIN_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCFontMetricsIID, GFXWIN_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCImageIID, GFXWIN_DLL, PR_FALSE, PR_FALSE);
static NS_DEFINE_IID(kDeviceContextCID, NS_DEVICE_CONTEXT_CID);
static NS_DEFINE_IID(kDeviceContextIID, NS_IDEVICE_CONTEXT_IID);
res = NSRepository::CreateInstance(kDeviceContextCID,
nsnull,
kDeviceContextIID,
(void **)&mContext);
if (NS_OK == res)
mContext->Init();
}
if (aParent)
parentWidget = (Widget) aParent->GetNativeData(NS_NATIVE_WIDGET);
else
parentWidget = (Widget) aInitData ;
if (!aParent)
mainWindow = ::XtVaCreateManagedWidget("mainWindow",
xmMainWindowWidgetClass,
parentWidget,
XmNwidth, aRect.width,
XmNheight, aRect.height,
nsnull);
frame = ::XtVaCreateManagedWidget("frame",
xmDrawingAreaWidgetClass,
(aParent) ? parentWidget : mainWindow,
XmNwidth, aRect.width,
XmNheight, aRect.height,
nsnull);
if (!aParent)
XmMainWindowSetAreas (mainWindow, nsnull, nsnull, nsnull, nsnull, frame);
mWidget = frame ;
if (aParent) {
aParent->AddChild(this);
}
// setup the event Handlers
XtAddEventHandler(mWidget,
ExposureMask,
PR_FALSE,
nsXtWidget_ExposureMask_EventHandler,
this);
XtAddEventHandler(mWidget,
ButtonPressMask,
PR_FALSE,
nsXtWidget_ButtonPressMask_EventHandler,
this);
XtAddEventHandler(mWidget,
ButtonReleaseMask,
PR_FALSE,
nsXtWidget_ButtonReleaseMask_EventHandler,
this);
XtAddEventHandler(mWidget,
ButtonMotionMask,
PR_FALSE,
nsXtWidget_ButtonMotionMask_EventHandler,
this);
// Force cursor to default setting
mCursor = eCursor_select;
SetCursor(eCursor_standard);
}
//-------------------------------------------------------------------------
//
// create with a native parent
//
//-------------------------------------------------------------------------
void nsWindow::Create(nsNativeWindow aParent,
const nsRect &aRect,
EVENT_CALLBACK aHandleEventFunction,
nsIDeviceContext *aContext,
nsIToolkit *aToolkit,
nsWidgetInitData *aInitData)
{
}
//-------------------------------------------------------------------------
//
// Close this nsWindow
//
//-------------------------------------------------------------------------
void nsWindow::Destroy()
{
}
//-------------------------------------------------------------------------
//
// Get this nsWindow parent
//
//-------------------------------------------------------------------------
nsIWidget* nsWindow::GetParent(void)
{
return nsnull;
}
//-------------------------------------------------------------------------
//
// Get this nsWindow's list of children
//
//-------------------------------------------------------------------------
nsIEnumerator* nsWindow::GetChildren()
{
return nsnull;
}
//-------------------------------------------------------------------------
//
// Add a child to the list of children
//
//-------------------------------------------------------------------------
void nsWindow::AddChild(nsIWidget* aChild)
{
}
//-------------------------------------------------------------------------
//
// Remove a child from the list of children
//
//-------------------------------------------------------------------------
void nsWindow::RemoveChild(nsIWidget* aChild)
{
}
//-------------------------------------------------------------------------
//
// Hide or show this component
//
//-------------------------------------------------------------------------
void nsWindow::Show(PRBool bState)
{
}
//-------------------------------------------------------------------------
//
// Move this component
//
//-------------------------------------------------------------------------
void nsWindow::Move(PRUint32 aX, PRUint32 aY)
{
}
//-------------------------------------------------------------------------
//
// Resize this component
//
//-------------------------------------------------------------------------
void nsWindow::Resize(PRUint32 aWidth, PRUint32 aHeight, PRBool aRepaint)
{
}
//-------------------------------------------------------------------------
//
// Resize this component
//
//-------------------------------------------------------------------------
void nsWindow::Resize(PRUint32 aX,
PRUint32 aY,
PRUint32 aWidth,
PRUint32 aHeight,
PRBool aRepaint)
{
}
//-------------------------------------------------------------------------
//
// Enable/disable this component
//
//-------------------------------------------------------------------------
void nsWindow::Enable(PRBool bState)
{
}
//-------------------------------------------------------------------------
//
// Give the focus to this component
//
//-------------------------------------------------------------------------
void nsWindow::SetFocus(void)
{
}
//-------------------------------------------------------------------------
//
// Get this component dimension
//
//-------------------------------------------------------------------------
void nsWindow::GetBounds(nsRect &aRect)
{
XWindowAttributes attrs ;
Display * d = ::XtDisplay(mWidget);
Window w = ::XtWindow(mWidget);
XGetWindowAttributes(d, w, &attrs);
aRect.x = attrs.x ;
aRect.y = attrs.y ;
aRect.width = attrs.width ;
aRect.height = attrs.height;
}
//-------------------------------------------------------------------------
//
// Get the foreground color
//
//-------------------------------------------------------------------------
nscolor nsWindow::GetForegroundColor(void)
{
return (mForeground);
}
//-------------------------------------------------------------------------
//
// Set the foreground color
//
//-------------------------------------------------------------------------
void nsWindow::SetForegroundColor(const nscolor &aColor)
{
mForeground = aColor;
}
//-------------------------------------------------------------------------
//
// Get the background color
//
//-------------------------------------------------------------------------
nscolor nsWindow::GetBackgroundColor(void)
{
return (mBackground);
}
//-------------------------------------------------------------------------
//
// Set the background color
//
//-------------------------------------------------------------------------
void nsWindow::SetBackgroundColor(const nscolor &aColor)
{
mBackground = aColor ;
}
//-------------------------------------------------------------------------
//
// Get this component font
//
//-------------------------------------------------------------------------
nsIFontMetrics* nsWindow::GetFont(void)
{
NS_NOTYETIMPLEMENTED("GetFont not yet implemented"); // to be implemented
return nsnull;
}
//-------------------------------------------------------------------------
//
// Set this component font
//
//-------------------------------------------------------------------------
void nsWindow::SetFont(const nsFont &aFont)
{
}
//-------------------------------------------------------------------------
//
// Get this component cursor
//
//-------------------------------------------------------------------------
nsCursor nsWindow::GetCursor()
{
}
//-------------------------------------------------------------------------
//
// Set this component cursor
//
//-------------------------------------------------------------------------
void nsWindow::SetCursor(nsCursor aCursor)
{
}
//-------------------------------------------------------------------------
//
// Invalidate this component visible area
//
//-------------------------------------------------------------------------
void nsWindow::Invalidate(PRBool aIsSynchronous)
{
}
//-------------------------------------------------------------------------
//
// Return some native data according to aDataType
//
//-------------------------------------------------------------------------
void* nsWindow::GetNativeData(PRUint32 aDataType)
{
switch(aDataType) {
case NS_NATIVE_DISPLAY:
{
return (void*)XtDisplay(mWidget);
}
break;
case NS_NATIVE_WINDOW:
{
return (void*)XtWindow(mWidget);
}
break;
case NS_NATIVE_WIDGET:
{
return (void*)(mWidget);
}
break;
case NS_NATIVE_GRAPHIC:
{
XGCValues values;
GC aGC;
aGC= ::XtGetGC(mWidget,
nsnull,
&values);
return (void*)aGC;
}
break;
case NS_NATIVE_COLORMAP:
default:
break;
}
return NULL;
}
//-------------------------------------------------------------------------
//
// Create a rendering context from this nsWindow
//
//-------------------------------------------------------------------------
nsIRenderingContext* nsWindow::GetRenderingContext()
{
return nsnull ;
}
//-------------------------------------------------------------------------
//
// Return the toolkit this widget was created on
//
//-------------------------------------------------------------------------
nsIToolkit* nsWindow::GetToolkit()
{
}
//-------------------------------------------------------------------------
//
// Set the colormap of the window
//
//-------------------------------------------------------------------------
void nsWindow::SetColorMap(nsColorMap *aColorMap)
{
}
//-------------------------------------------------------------------------
//
// Return the used device context
//
//-------------------------------------------------------------------------
nsIDeviceContext* nsWindow::GetDeviceContext()
{
}
//-------------------------------------------------------------------------
//
// Scroll the bits of a window
//
//-------------------------------------------------------------------------
void nsWindow::Scroll(PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect)
{
}
void nsWindow::SetBorderStyle(nsBorderStyle aBorderStyle)
{
}
void nsWindow::SetTitle(const nsString& aTitle)
{
}
/**
* Processes a mouse pressed event
*
**/
void nsWindow::AddMouseListener(nsIMouseListener * aListener)
{
}
/**
* Processes a mouse pressed event
*
**/
void nsWindow::AddEventListener(nsIEventListener * aListener)
{
}
PRBool nsWindow::ConvertStatus(nsEventStatus aStatus)
{
switch(aStatus) {
case nsEventStatus_eIgnore:
return(PR_FALSE);
break;
case nsEventStatus_eConsumeNoDefault:
return(PR_TRUE);
break;
case nsEventStatus_eConsumeDoDefault:
return(PR_FALSE);
break;
default:
NS_ASSERTION(0, "Illegal nsEventStatus enumeration value");
return(PR_FALSE);
break;
}
}
//-------------------------------------------------------------------------
//
// Invokes callback and ProcessEvent method on Event Listener object
//
//-------------------------------------------------------------------------
PRBool nsWindow::DispatchEvent(nsGUIEvent* event)
{
PRBool result = PR_FALSE;
if (nsnull != mEventCallback) {
result = ConvertStatus((*mEventCallback)(event));
}
// Dispatch to event listener if event was not consumed
if ((result != PR_TRUE) && (nsnull != mEventListener)) {
return ConvertStatus(mEventListener->ProcessEvent(*event));
}
else {
return(result);
}
}
/**
* Processes an Expose Event
*
**/
void nsWindow::OnPaint(nsPaintEvent &event)
{
nsresult result ;
// call the event callback
if (mEventCallback) {
nsRect rr ;
GetBounds(rr);
event.rect = &rr;
static NS_DEFINE_IID(kRenderingContextCID, NS_RENDERING_CONTEXT_CID);
static NS_DEFINE_IID(kRenderingContextIID, NS_IRENDERING_CONTEXT_IID);
if (NS_OK == NSRepository::CreateInstance(kRenderingContextCID,
nsnull,
kRenderingContextIID,
(void **)&event.renderingContext))
{
event.renderingContext->Init(mContext, this);
result = DispatchEvent(&event);
NS_RELEASE(event.renderingContext);
}
else
result = PR_FALSE;
}
}
void nsWindow::BeginResizingChildren(void)
{
}
void nsWindow::EndResizingChildren(void)
{
}

View File

@@ -0,0 +1,320 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the 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.
*/
#ifndef Window_h__
#define Window_h__
#include "nsToolkit.h"
#include "nsIWidget.h"
#include "nsIEnumerator.h"
#include "nsIMouseListener.h"
#include "nsIEventListener.h"
#include "nsString.h"
#include "Xm/Xm.h"
#define NSRGB_2_COLOREF(color) \
RGB(NS_GET_R(color),NS_GET_G(color),NS_GET_B(color))
/**
* Native WIN32 window wrapper.
*/
class nsWindow : public nsIWidget
{
public:
nsWindow(nsISupports *aOuter);
virtual ~nsWindow();
NS_DECL_ISUPPORTS
// nsIWidget interface
virtual void Create(nsIWidget *aParent,
const nsRect &aRect,
EVENT_CALLBACK aHandleEventFunction,
nsIDeviceContext *aContext,
nsIToolkit *aToolkit = nsnull,
nsWidgetInitData *aInitData = nsnull);
virtual void Create(nsNativeWindow aParent,
const nsRect &aRect,
EVENT_CALLBACK aHandleEventFunction,
nsIDeviceContext *aContext,
nsIToolkit *aToolkit = nsnull,
nsWidgetInitData *aInitData = nsnull);
virtual void Destroy();
virtual nsIWidget* GetParent(void);
virtual nsIEnumerator* GetChildren();
virtual void AddChild(nsIWidget* aChild);
virtual void RemoveChild(nsIWidget* aChild);
virtual void Show(PRBool bState);
virtual void Move(PRUint32 aX, PRUint32 aY);
virtual void Resize(PRUint32 aWidth,
PRUint32 aHeight,
PRBool aRepaint);
virtual void Resize(PRUint32 aX,
PRUint32 aY,
PRUint32 aWidth,
PRUint32 aHeight,
PRBool aRepaint);
virtual void Enable(PRBool bState);
virtual void SetFocus(void);
virtual void GetBounds(nsRect &aRect);
virtual nscolor GetForegroundColor(void);
virtual void SetForegroundColor(const nscolor &aColor);
virtual nscolor GetBackgroundColor(void);
virtual void SetBackgroundColor(const nscolor &aColor);
virtual nsIFontMetrics* GetFont(void);
virtual void SetFont(const nsFont &aFont);
virtual nsCursor GetCursor();
virtual void SetCursor(nsCursor aCursor);
virtual void Invalidate(PRBool aIsSynchronous);
virtual void* GetNativeData(PRUint32 aDataType);
virtual nsIRenderingContext* GetRenderingContext();
virtual void SetColorMap(nsColorMap *aColorMap);
virtual nsIDeviceContext* GetDeviceContext();
virtual void Scroll(PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect);
virtual nsIToolkit* GetToolkit();
virtual void SetBorderStyle(nsBorderStyle aBorderStyle);
virtual void SetTitle(const nsString& aTitle);
virtual void SetTooltips(PRUint32 aNumberOfTips,nsRect* aTooltipAreas[]);
virtual void RemoveTooltips();
virtual void UpdateTooltips(nsRect* aNewTips[]);
virtual void WidgetToScreen(const nsRect& aOldRect, nsRect& aNewRect);
virtual void ScreenToWidget(const nsRect& aOldRect, nsRect& aNewRect);
virtual void AddMouseListener(nsIMouseListener * aListener);
virtual void AddEventListener(nsIEventListener * aListener);
virtual void OnPaint(nsPaintEvent &event);
PRBool DispatchEvent(nsGUIEvent* event);
static PRBool ConvertStatus(nsEventStatus aStatus);
virtual void BeginResizingChildren(void);
virtual void EndResizingChildren(void);
private:
Widget mWidget;
EVENT_CALLBACK mEventCallback;
nsIDeviceContext *mContext;
nsIFontMetrics *mFontMetrics;
nsToolkit *mToolkit;
nsIMouseListener * mMouseListener;
nsIEventListener * mEventListener;
nscolor mBackground;
nscolor mForeground;
nsCursor mCursor;
nsBorderStyle mBorderStyle;
};
//
// A child window is a window with different style
//
class ChildWindow : public nsWindow {
public:
ChildWindow(nsISupports *aOuter) : nsWindow(aOuter) {}
};
#define BASE_IWIDGET_IMPL BASE_INITIALIZE_IMPL BASE_WINDOWS_METHODS
#define BASE_INITIALIZE_IMPL \
void Create(nsIWidget *aParent, \
const nsRect &aRect, \
EVENT_CALLBACK aHandleEventFunction, \
nsIDeviceContext *aContext, \
nsIToolkit *aToolkit = nsnull, \
void *aInitData = nsnull) \
{ \
nsWindow::Create(aParent, aRect, aHandleEventFunction, aContext, aToolkit, aInitData); \
} \
#define BASE_WINDOWS_METHODS \
void Create(nsNativeWindow aParent, \
const nsRect &aRect, \
EVENT_CALLBACK aHandleEventFunction, \
nsIDeviceContext *aContext, \
nsIToolkit *aToolkit = nsnull, \
void *aInitData = nsnull) \
{ \
nsWindow::Create(aParent, aRect, aHandleEventFunction, aContext, aToolkit, aInitData); \
} \
void Destroy(void) \
{ \
nsWindow::Destroy(); \
} \
nsIWidget* GetParent(void) \
{ \
return nsWindow::GetParent(); \
} \
nsIEnumerator* GetChildren(void) \
{ \
return nsWindow::GetChildren(); \
} \
void AddChild(nsIWidget* aChild) \
{ \
nsWindow::AddChild(aChild); \
} \
void RemoveChild(nsIWidget* aChild) \
{ \
nsWindow::RemoveChild(aChild); \
} \
void Show(PRBool bState) \
{ \
nsWindow::Show(bState); \
} \
void Move(PRUint32 aX, PRUint32 aY) \
{ \
nsWindow::Move(aX, aY); \
} \
void Resize(PRUint32 aWidth, \
PRUint32 aHeight, \
PRBool aRepaint) \
{ \
nsWindow::Resize(aWidth, aHeight, aRepaint); \
} \
void Resize(PRUint32 aX, \
PRUint32 aY, \
PRUint32 aWidth, \
PRUint32 aHeight, \
PRBool aRepaint) \
{ \
nsWindow::Resize(aX, aY, aWidth, aHeight, aRepaint); \
} \
void Enable(PRBool bState) \
{ \
nsWindow::Enable(bState); \
} \
void SetFocus(void) \
{ \
nsWindow::SetFocus(); \
} \
void GetBounds(nsRect &aRect) \
{ \
nsWindow::GetBounds(aRect); \
} \
nscolor GetForegroundColor(void) \
{ \
return nsWindow::GetForegroundColor(); \
} \
void SetForegroundColor(const nscolor &aColor) \
{ \
nsWindow::SetForegroundColor(aColor); \
} \
nscolor GetBackgroundColor(void) \
{ \
return nsWindow::GetBackgroundColor(); \
} \
void SetBackgroundColor(const nscolor &aColor) \
{ \
nsWindow::SetBackgroundColor(aColor); \
} \
nsIFontMetrics* GetFont(void) \
{ \
return nsWindow::GetFont(); \
} \
void SetFont(const nsFont &aFont) \
{ \
nsWindow::SetFont(aFont); \
} \
nsCursor GetCursor() \
{ \
return nsWindow::GetCursor(); \
} \
void SetCursor(nsCursor aCursor) \
{ \
nsWindow::SetCursor(aCursor); \
} \
void Invalidate(PRBool aIsSynchronous) \
{ \
nsWindow::Invalidate(aIsSynchronous); \
} \
void* GetNativeData(PRUint32 aDataType) \
{ \
return nsWindow::GetNativeData(aDataType); \
} \
nsIRenderingContext* GetRenderingContext() \
{ \
return nsWindow::GetRenderingContext(); \
} \
nsIDeviceContext* GetDeviceContext() \
{ \
return nsWindow::GetDeviceContext(); \
} \
void Scroll(PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect) \
{ \
nsWindow::Scroll(aDx, aDy, aClipRect); \
} \
nsIToolkit* GetToolkit() \
{ \
return nsWindow::GetToolkit(); \
} \
void SetColorMap(nsColorMap *aColorMap) \
{ \
nsWindow::SetColorMap(aColorMap); \
} \
void AddMouseListener(nsIMouseListener * aListener) \
{ \
nsWindow::AddMouseListener(aListener); \
} \
void AddEventListener(nsIEventListener * aListener) \
{ \
nsWindow::AddEventListener(aListener); \
} \
PRBool OnKey(PRUint32 aEventType, PRUint32 aKeyCode) \
{ \
return nsWindow::OnKey(aEventType, aKeyCode); \
} \
void SetBorderStyle(nsBorderStyle aBorderStyle) \
{ \
nsWindow::SetBorderStyle(aBorderStyle); \
} \
void SetTitle(const nsString& aTitle) \
{ \
nsWindow::SetTitle(aTitle); \
} \
void SetTooltips(PRUint32 aNumberOfTips,const nsRect* aTooltipAreas) \
{ \
nsWindow::SetTooltips(aNumberOfTips, aTooltipAreas); \
} \
void UpdateTooltips(const nsRect* aNewTips) \
{ \
nsWindow::UpdateTooltips(aNewTips); \
} \
void RemoveTooltips() \
{ \
nsWindow::RemoveTooltips(); \
} \
void WidgetToScreen(const nsRect& aOldRect, nsRect& aNewRect) \
{ \
nsWindow::WidgetToScreen(aOldRect, aNewRect); \
} \
void ScreenToWidget(const nsRect& aOldRect, nsRect& aNewRect) \
{ \
nsWindow::ScreenToWidget(aOldRect, aNewRect); \
}
#endif // Window_h__

View File

@@ -0,0 +1,62 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the 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.
*/
#include "Xm/Xm.h"
#include "nsXtEventHandler.h"
#include "nsWindow.h"
#include "stdio.h"
void nsXtWidget_ExposureMask_EventHandler(Widget w, XtPointer p, XEvent * event, Boolean * b)
{
nsPaintEvent pevent ;
nsWindow * widgetWindow = (nsWindow *) p ;
if (event->xexpose.count != 0)
return ;
pevent.widget = widgetWindow;
pevent.point.x = event->xbutton.x;
pevent.point.y = event->xbutton.y;
pevent.time = 0; // XXX TBD...
pevent.message = NS_PAINT ;
widgetWindow->OnPaint(pevent);
}
void nsXtWidget_ButtonPressMask_EventHandler(Widget w, XtPointer p, XEvent * event, Boolean * b)
{
nsWindow * widgetWindow = (nsWindow *) p;
}
void nsXtWidget_ButtonReleaseMask_EventHandler(Widget w, XtPointer p, XEvent * event, Boolean * b)
{
nsWindow * widgetWindow = (nsWindow *) p ;
}
void nsXtWidget_ButtonMotionMask_EventHandler(Widget w, XtPointer p, XEvent * event, Boolean * b)
{
nsWindow * widgetWindow = (nsWindow *) p ;
}

View File

@@ -0,0 +1,34 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the 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.
*/
#ifndef __nsXtEventHandler_h
#define __nsXtEventHandler_h
#include "Xm/Xm.h"
void nsXtWidget_ExposureMask_EventHandler(Widget w, XtPointer p, XEvent * event, Boolean * b);
void nsXtWidget_ButtonPressMask_EventHandler(Widget w,XtPointer p, XEvent * event, Boolean * b);
void nsXtWidget_ButtonReleaseMask_EventHandler(Widget w, XtPointer p, XEvent * event, Boolean * b);
void nsXtWidget_ButtonMotionMask_EventHandler(Widget w, XtPointer p, XEvent * event, Boolean * b);
#endif // __nsXtEventHandler.h