Compare commits
2 Commits
alecf_modu
...
FAST-GTK-G
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
33a0a6fec0 | ||
|
|
58b1c92ba4 |
@@ -1,3 +1,4 @@
|
||||
#!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
|
||||
@@ -13,37 +14,40 @@
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
|
||||
DEPTH = ../../..
|
||||
DEPTH = ../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MODULE = addrbook
|
||||
LIBRARY_NAME = addrbook
|
||||
IS_COMPONENT = 1
|
||||
include $(topsrcdir)/config/config.mk
|
||||
|
||||
CPPSRCS = nsAbFactory.cpp
|
||||
EXPORTS = nsAbBaseCID.h
|
||||
LIBRARY_NAME = gfxgtk
|
||||
|
||||
SHARED_LIBRARY_LIBS = \
|
||||
$(DIST)/lib/libaddrbook_s.a \
|
||||
$(DIST)/lib/librdfutil_s.a \
|
||||
$(NULL)
|
||||
MODULE=raptor
|
||||
|
||||
EXTRA_DSO_LDOPTS = \
|
||||
$(MKSHLIB_FORCE_ALL) \
|
||||
$(SHARED_LIBRARY_LIBS) \
|
||||
$(MKSHLIB_UNFORCE_ALL) \
|
||||
-L$(DIST)/bin \
|
||||
$(NSPR_LIBS) \
|
||||
-lxpcom \
|
||||
$(NULL)
|
||||
REQUIRES=util img xpcom raptor netlib ps
|
||||
|
||||
DEFINES += -D_IMPL_NS_GFXONXP
|
||||
CXXFLAGS += $(TK_CFLAGS)
|
||||
INCLUDES += $(TK_CFLAGS) -I$(srcdir)/..
|
||||
|
||||
CPPSRCS = \
|
||||
nsDrawingSurfaceGTK.cpp \
|
||||
nsDeviceContextGTK.cpp \
|
||||
nsDeviceContextSpecFactoryG.cpp \
|
||||
nsDeviceContextSpecG.cpp \
|
||||
nsFontMetricsGTK.cpp \
|
||||
nsGfxFactoryGTK.cpp \
|
||||
nsRenderingContextGTK.cpp \
|
||||
nsImageGTK.cpp \
|
||||
nsRegionGTK.cpp
|
||||
|
||||
CSRCS = \
|
||||
nsPrintdGTK.c
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
$(LIBRARY) $(SHARED_LIBRARY): $(SHARED_LIBRARY_LIBS) Makefile
|
||||
|
||||
375
mozilla/gfx/src/gtk/nsDeviceContextGTK.cpp
Normal file
375
mozilla/gfx/src/gtk/nsDeviceContextGTK.cpp
Normal file
@@ -0,0 +1,375 @@
|
||||
/* -*- 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 <math.h>
|
||||
|
||||
#include "nspr.h"
|
||||
#include "il_util.h"
|
||||
|
||||
#include "nsDeviceContextGTK.h"
|
||||
#include "nsGfxCIID.h"
|
||||
|
||||
#include "../ps/nsDeviceContextPS.h"
|
||||
|
||||
#include <gdk/gdk.h>
|
||||
#include <gdk/gdkx.h>
|
||||
|
||||
#define NS_TO_GDK_RGB(ns) (ns & 0xff) << 16 | (ns & 0xff00) | ((ns >> 16) & 0xff)
|
||||
|
||||
#define GDK_COLOR_TO_NS_RGB(c) \
|
||||
((nscolor) NS_RGB(c.red, c.green, c.blue))
|
||||
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
static NS_DEFINE_IID(kDeviceContextIID, NS_IDEVICE_CONTEXT_IID);
|
||||
|
||||
nsDeviceContextGTK::nsDeviceContextGTK()
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mTwipsToPixels = 1.0;
|
||||
mPixelsToTwips = 1.0;
|
||||
mDepth = 0 ;
|
||||
mPaletteInfo.isPaletteDevice = PR_FALSE;
|
||||
mPaletteInfo.sizePalette = 0;
|
||||
mPaletteInfo.numReserved = 0;
|
||||
mPaletteInfo.palette = NULL;
|
||||
mNumCells = 0;
|
||||
}
|
||||
|
||||
nsDeviceContextGTK::~nsDeviceContextGTK()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_QUERY_INTERFACE(nsDeviceContextGTK, kDeviceContextIID)
|
||||
NS_IMPL_ADDREF(nsDeviceContextGTK)
|
||||
NS_IMPL_RELEASE(nsDeviceContextGTK)
|
||||
|
||||
NS_IMETHODIMP nsDeviceContextGTK::Init(nsNativeWidget aNativeWidget)
|
||||
{
|
||||
GdkVisual *vis;
|
||||
GtkRequisition req;
|
||||
GtkWidget *sb;
|
||||
|
||||
mWidget = aNativeWidget;
|
||||
|
||||
// Compute dpi of display
|
||||
float screenWidth = float(::gdk_screen_width());
|
||||
float screenWidthIn = float(::gdk_screen_width_mm()) / 25.4f;
|
||||
nscoord dpi = nscoord(screenWidth / screenWidthIn);
|
||||
|
||||
// Now for some wacky heuristics.
|
||||
if (dpi < 84) dpi = 72;
|
||||
else if (dpi < 108) dpi = 96;
|
||||
else if (dpi < 132) dpi = 120;
|
||||
|
||||
mTwipsToPixels = float(dpi) / float(NSIntPointsToTwips(72));
|
||||
mPixelsToTwips = 1.0f / mTwipsToPixels;
|
||||
|
||||
#if 0
|
||||
mTwipsToPixels = ( ((float)::gdk_screen_width()) /
|
||||
((float)::gdk_screen_width_mm()) * 25.4) /
|
||||
(float)NSIntPointsToTwips(72);
|
||||
|
||||
mPixelsToTwips = 1.0f / mTwipsToPixels;
|
||||
#endif
|
||||
|
||||
vis = gdk_rgb_get_visual();
|
||||
mDepth = vis->depth;
|
||||
|
||||
sb = gtk_vscrollbar_new(NULL);
|
||||
gtk_widget_ref(sb);
|
||||
gtk_object_sink(GTK_OBJECT(sb));
|
||||
gtk_widget_size_request(sb,&req);
|
||||
mScrollbarWidth = req.width;
|
||||
gtk_widget_destroy(sb);
|
||||
gtk_widget_unref(sb);
|
||||
|
||||
sb = gtk_hscrollbar_new(NULL);
|
||||
gtk_widget_ref(sb);
|
||||
gtk_object_sink(GTK_OBJECT(sb));
|
||||
gtk_widget_size_request(sb,&req);
|
||||
mScrollbarHeight = req.height;
|
||||
gtk_widget_destroy(sb);
|
||||
gtk_widget_unref(sb);
|
||||
|
||||
#ifdef DEBUG
|
||||
static PRBool once = PR_TRUE;
|
||||
if (once) {
|
||||
printf("GFX: dpi=%d t2p=%g p2t=%g depth=%d\n", dpi, mTwipsToPixels, mPixelsToTwips,mDepth);
|
||||
once = PR_FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsDeviceContextGTK::CreateRenderingContext(nsIRenderingContext *&aContext)
|
||||
{
|
||||
nsIRenderingContext *pContext;
|
||||
nsresult rv;
|
||||
nsDrawingSurfaceGTK *surf;
|
||||
|
||||
// to call init for this, we need to have a valid nsDrawingSurfaceGTK created
|
||||
pContext = new nsRenderingContextGTK();
|
||||
|
||||
if (nsnull != pContext)
|
||||
{
|
||||
NS_ADDREF(pContext);
|
||||
|
||||
// create the nsDrawingSurfaceGTK
|
||||
surf = new nsDrawingSurfaceGTK();
|
||||
|
||||
if (nsnull != surf)
|
||||
{
|
||||
GdkDrawable *win = nsnull;
|
||||
// FIXME
|
||||
if (GTK_IS_LAYOUT((GtkWidget*)mWidget))
|
||||
win = (GdkDrawable*)gdk_window_ref(GTK_LAYOUT((GtkWidget*)mWidget)->bin_window);
|
||||
else
|
||||
win = (GdkDrawable*)gdk_window_ref(((GtkWidget*)mWidget)->window);
|
||||
|
||||
GdkGC *gc = gdk_gc_new(win);
|
||||
|
||||
// init the nsDrawingSurfaceGTK
|
||||
rv = surf->Init(win,gc);
|
||||
|
||||
if (NS_OK == rv)
|
||||
// Init the nsRenderingContextGTK
|
||||
rv = pContext->Init(this, surf);
|
||||
}
|
||||
else
|
||||
rv = NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
else
|
||||
rv = NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
if (NS_OK != rv)
|
||||
{
|
||||
NS_IF_RELEASE(pContext);
|
||||
}
|
||||
|
||||
aContext = pContext;
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsDeviceContextGTK::SupportsNativeWidgets(PRBool &aSupportsWidgets)
|
||||
{
|
||||
//XXX it is very critical that this not lie!! MMP
|
||||
// read the comments in the mac code for this
|
||||
aSupportsWidgets = PR_TRUE;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsDeviceContextGTK::GetScrollBarDimensions(float &aWidth, float &aHeight) const
|
||||
{
|
||||
aWidth = mScrollbarWidth * mPixelsToTwips;
|
||||
aHeight = mScrollbarHeight * mPixelsToTwips;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsDeviceContextGTK::GetSystemAttribute(nsSystemAttrID anID, SystemAttrStruct * aInfo) const
|
||||
{
|
||||
nsresult status = NS_OK;
|
||||
GtkStyle *style = gtk_style_new(); // get the default styles
|
||||
|
||||
switch (anID) {
|
||||
//---------
|
||||
// Colors
|
||||
//---------
|
||||
case eSystemAttr_Color_WindowBackground:
|
||||
*aInfo->mColor = GDK_COLOR_TO_NS_RGB(style->bg[GTK_STATE_NORMAL]);
|
||||
break;
|
||||
case eSystemAttr_Color_WindowForeground:
|
||||
*aInfo->mColor = GDK_COLOR_TO_NS_RGB(style->fg[GTK_STATE_NORMAL]);
|
||||
break;
|
||||
case eSystemAttr_Color_WidgetBackground:
|
||||
*aInfo->mColor = GDK_COLOR_TO_NS_RGB(style->bg[GTK_STATE_NORMAL]);
|
||||
break;
|
||||
case eSystemAttr_Color_WidgetForeground:
|
||||
*aInfo->mColor = GDK_COLOR_TO_NS_RGB(style->fg[GTK_STATE_NORMAL]);
|
||||
break;
|
||||
case eSystemAttr_Color_WidgetSelectBackground:
|
||||
*aInfo->mColor = GDK_COLOR_TO_NS_RGB(style->bg[GTK_STATE_SELECTED]);
|
||||
break;
|
||||
case eSystemAttr_Color_WidgetSelectForeground:
|
||||
*aInfo->mColor = GDK_COLOR_TO_NS_RGB(style->fg[GTK_STATE_SELECTED]);
|
||||
break;
|
||||
case eSystemAttr_Color_Widget3DHighlight:
|
||||
*aInfo->mColor = NS_RGB(0xa0,0xa0,0xa0);
|
||||
break;
|
||||
case eSystemAttr_Color_Widget3DShadow:
|
||||
*aInfo->mColor = NS_RGB(0x40,0x40,0x40);
|
||||
break;
|
||||
case eSystemAttr_Color_TextBackground:
|
||||
*aInfo->mColor = GDK_COLOR_TO_NS_RGB(style->bg[GTK_STATE_NORMAL]);
|
||||
break;
|
||||
case eSystemAttr_Color_TextForeground:
|
||||
*aInfo->mColor = GDK_COLOR_TO_NS_RGB(style->fg[GTK_STATE_NORMAL]);
|
||||
break;
|
||||
case eSystemAttr_Color_TextSelectBackground:
|
||||
*aInfo->mColor = GDK_COLOR_TO_NS_RGB(style->bg[GTK_STATE_SELECTED]);
|
||||
break;
|
||||
case eSystemAttr_Color_TextSelectForeground:
|
||||
*aInfo->mColor = GDK_COLOR_TO_NS_RGB(style->text[GTK_STATE_SELECTED]);
|
||||
break;
|
||||
//---------
|
||||
// Size
|
||||
//---------
|
||||
case eSystemAttr_Size_ScrollbarHeight:
|
||||
aInfo->mSize = mScrollbarHeight;
|
||||
break;
|
||||
case eSystemAttr_Size_ScrollbarWidth:
|
||||
aInfo->mSize = mScrollbarWidth;
|
||||
break;
|
||||
case eSystemAttr_Size_WindowTitleHeight:
|
||||
aInfo->mSize = 0;
|
||||
break;
|
||||
case eSystemAttr_Size_WindowBorderWidth:
|
||||
aInfo->mSize = style->klass->xthickness;
|
||||
break;
|
||||
case eSystemAttr_Size_WindowBorderHeight:
|
||||
aInfo->mSize = style->klass->ythickness;
|
||||
break;
|
||||
case eSystemAttr_Size_Widget3DBorder:
|
||||
aInfo->mSize = 4;
|
||||
break;
|
||||
//---------
|
||||
// Fonts
|
||||
//---------
|
||||
case eSystemAttr_Font_Caption:
|
||||
case eSystemAttr_Font_Icon:
|
||||
case eSystemAttr_Font_Menu:
|
||||
case eSystemAttr_Font_MessageBox:
|
||||
case eSystemAttr_Font_SmallCaption:
|
||||
case eSystemAttr_Font_StatusBar:
|
||||
case eSystemAttr_Font_Tooltips:
|
||||
case eSystemAttr_Font_Widget:
|
||||
status = NS_ERROR_FAILURE;
|
||||
break;
|
||||
} // switch
|
||||
|
||||
gtk_style_unref(style);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsDeviceContextGTK::GetDrawingSurface(nsIRenderingContext &aContext,
|
||||
nsDrawingSurface &aSurface)
|
||||
{
|
||||
aContext.CreateDrawingSurface(nsnull, 0, aSurface);
|
||||
return nsnull == aSurface ? NS_ERROR_OUT_OF_MEMORY : NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsDeviceContextGTK::ConvertPixel(nscolor aColor,
|
||||
PRUint32 & aPixel)
|
||||
{
|
||||
aPixel = ::gdk_rgb_xpixel_from_rgb (NS_TO_GDK_RGB(aColor));
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsDeviceContextGTK::CheckFontExistence(const nsString& aFontName)
|
||||
{
|
||||
char **fnames = nsnull;
|
||||
PRInt32 namelen = aFontName.Length() + 1;
|
||||
char *wildstring = (char *)PR_Malloc(namelen + 200);
|
||||
float t2d;
|
||||
GetTwipsToDevUnits(t2d);
|
||||
PRInt32 dpi = NSToIntRound(t2d * 1440);
|
||||
int numnames = 0;
|
||||
XFontStruct *fonts;
|
||||
nsresult rv = NS_ERROR_FAILURE;
|
||||
|
||||
if (nsnull == wildstring)
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
|
||||
if (abs(dpi - 75) < abs(dpi - 100))
|
||||
dpi = 75;
|
||||
else
|
||||
dpi = 100;
|
||||
|
||||
char* fontName = aFontName.ToNewCString();
|
||||
PR_snprintf(wildstring, namelen + 200,
|
||||
"*-%s-*-*-normal--*-*-%d-%d-*-*-*",
|
||||
fontName, dpi, dpi);
|
||||
delete [] fontName;
|
||||
|
||||
fnames = ::XListFontsWithInfo(GDK_DISPLAY(), wildstring, 1, &numnames, &fonts);
|
||||
|
||||
if (numnames > 0)
|
||||
{
|
||||
::XFreeFontInfo(fnames, fonts, numnames);
|
||||
rv = NS_OK;
|
||||
}
|
||||
|
||||
PR_Free(wildstring);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsDeviceContextGTK::GetDeviceSurfaceDimensions(PRInt32 &aWidth, PRInt32 &aHeight)
|
||||
{
|
||||
aWidth = 1;
|
||||
aHeight = 1;
|
||||
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsDeviceContextGTK::GetDeviceContextFor(nsIDeviceContextSpec *aDevice,
|
||||
nsIDeviceContext *&aContext)
|
||||
{
|
||||
// Create a Postscript device context
|
||||
aContext = new nsDeviceContextPS();
|
||||
((nsDeviceContextPS *)aContext)->SetSpec(aDevice);
|
||||
NS_ADDREF(aDevice);
|
||||
return((nsDeviceContextPS *) aContext)->Init((nsIDeviceContext*)aContext, (nsIDeviceContext*)this);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsDeviceContextGTK::BeginDocument(void)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsDeviceContextGTK::EndDocument(void)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsDeviceContextGTK::BeginPage(void)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsDeviceContextGTK::EndPage(void)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsDeviceContextGTK::GetDepth(PRUint32& aDepth)
|
||||
{
|
||||
GdkVisual * rgb_visual = gdk_rgb_get_visual();
|
||||
|
||||
gint rgb_depth = rgb_visual->depth;
|
||||
|
||||
aDepth = (PRUint32) rgb_depth;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
79
mozilla/gfx/src/gtk/nsDeviceContextGTK.h
Normal file
79
mozilla/gfx/src/gtk/nsDeviceContextGTK.h
Normal file
@@ -0,0 +1,79 @@
|
||||
/* -*- 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 nsDeviceContextGTK_h___
|
||||
#define nsDeviceContextGTK_h___
|
||||
|
||||
#include "nsDeviceContext.h"
|
||||
#include "nsUnitConversion.h"
|
||||
#include "nsIWidget.h"
|
||||
#include "nsIView.h"
|
||||
#include "nsIRenderingContext.h"
|
||||
|
||||
#include "nsRenderingContextGTK.h"
|
||||
|
||||
class nsDeviceContextGTK : public DeviceContextImpl
|
||||
{
|
||||
public:
|
||||
nsDeviceContextGTK();
|
||||
virtual ~nsDeviceContextGTK();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
NS_IMETHOD Init(nsNativeWidget aNativeWidget);
|
||||
|
||||
NS_IMETHOD CreateRenderingContext(nsIRenderingContext *&aContext);
|
||||
NS_IMETHOD SupportsNativeWidgets(PRBool &aSupportsWidgets);
|
||||
|
||||
NS_IMETHOD GetScrollBarDimensions(float &aWidth, float &aHeight) const;
|
||||
NS_IMETHOD GetSystemAttribute(nsSystemAttrID anID, SystemAttrStruct * aInfo) const;
|
||||
|
||||
//get a low level drawing surface for rendering. the rendering context
|
||||
//that is passed in is used to create the drawing surface if there isn't
|
||||
//already one in the device context. the drawing surface is then cached
|
||||
//in the device context for re-use.
|
||||
|
||||
NS_IMETHOD GetDrawingSurface(nsIRenderingContext &aContext, nsDrawingSurface &aSurface);
|
||||
|
||||
NS_IMETHOD ConvertPixel(nscolor aColor, PRUint32 & aPixel);
|
||||
NS_IMETHOD CheckFontExistence(const nsString& aFontName);
|
||||
|
||||
NS_IMETHOD GetDeviceSurfaceDimensions(PRInt32 &aWidth, PRInt32 &aHeight);
|
||||
|
||||
NS_IMETHOD GetDeviceContextFor(nsIDeviceContextSpec *aDevice,
|
||||
nsIDeviceContext *&aContext);
|
||||
|
||||
NS_IMETHOD BeginDocument(void);
|
||||
NS_IMETHOD EndDocument(void);
|
||||
|
||||
NS_IMETHOD BeginPage(void);
|
||||
NS_IMETHOD EndPage(void);
|
||||
|
||||
NS_IMETHOD GetDepth(PRUint32& aDepth);
|
||||
|
||||
private:
|
||||
PRUint32 mDepth;
|
||||
PRBool mWriteable;
|
||||
nsPaletteInfo mPaletteInfo;
|
||||
PRUint32 mNumCells;
|
||||
PRInt16 mScrollbarHeight;
|
||||
PRInt16 mScrollbarWidth;
|
||||
};
|
||||
|
||||
#endif /* nsDeviceContextGTK_h___ */
|
||||
|
||||
77
mozilla/gfx/src/gtk/nsDeviceContextSpecFactoryG.cpp
Normal file
77
mozilla/gfx/src/gtk/nsDeviceContextSpecFactoryG.cpp
Normal file
@@ -0,0 +1,77 @@
|
||||
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#include "nsDeviceContextSpecFactoryG.h"
|
||||
#include "nsDeviceContextSpecG.h"
|
||||
#include "nsGfxCIID.h"
|
||||
#include "plstr.h"
|
||||
|
||||
/** -------------------------------------------------------
|
||||
* Constructor
|
||||
* @update dc 2/16/98
|
||||
*/
|
||||
nsDeviceContextSpecFactoryGTK :: nsDeviceContextSpecFactoryGTK()
|
||||
{
|
||||
}
|
||||
|
||||
/** -------------------------------------------------------
|
||||
* Destructor
|
||||
* @update dc 2/16/98
|
||||
*/
|
||||
nsDeviceContextSpecFactoryGTK :: ~nsDeviceContextSpecFactoryGTK()
|
||||
{
|
||||
}
|
||||
|
||||
static NS_DEFINE_IID(kDeviceContextSpecFactoryIID, NS_IDEVICE_CONTEXT_SPEC_FACTORY_IID);
|
||||
static NS_DEFINE_IID(kIDeviceContextSpecIID, NS_IDEVICE_CONTEXT_SPEC_IID);
|
||||
static NS_DEFINE_IID(kDeviceContextSpecCID, NS_DEVICE_CONTEXT_SPEC_CID);
|
||||
|
||||
NS_IMPL_QUERY_INTERFACE(nsDeviceContextSpecFactoryGTK, kDeviceContextSpecFactoryIID)
|
||||
NS_IMPL_ADDREF(nsDeviceContextSpecFactoryGTK)
|
||||
NS_IMPL_RELEASE(nsDeviceContextSpecFactoryGTK)
|
||||
|
||||
/** -------------------------------------------------------
|
||||
* Initialize the device context spec factory
|
||||
* @update dc 2/16/98
|
||||
*/
|
||||
NS_IMETHODIMP nsDeviceContextSpecFactoryGTK :: Init(void)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/** -------------------------------------------------------
|
||||
* Get a device context specification
|
||||
* @update dc 2/16/98
|
||||
*/
|
||||
NS_IMETHODIMP nsDeviceContextSpecFactoryGTK :: CreateDeviceContextSpec(nsIDeviceContextSpec *aOldSpec,
|
||||
nsIDeviceContextSpec *&aNewSpec,
|
||||
PRBool aQuiet)
|
||||
{
|
||||
nsresult rv = NS_ERROR_FAILURE;
|
||||
nsIDeviceContextSpec *devSpec = nsnull;
|
||||
|
||||
nsComponentManager::CreateInstance(kDeviceContextSpecCID, nsnull, kIDeviceContextSpecIID, (void **)&devSpec);
|
||||
|
||||
if (nsnull != devSpec){
|
||||
if (NS_OK == ((nsDeviceContextSpecGTK *)devSpec)->Init(aQuiet)){
|
||||
aNewSpec = devSpec;
|
||||
rv = NS_OK;
|
||||
}
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
@@ -12,26 +12,30 @@
|
||||
*
|
||||
* 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
|
||||
* Copyright (C) 1999 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#include "nsISupports.idl"
|
||||
#include "nsIAbCard.idl"
|
||||
#ifndef nsDeviceContextSpecFactoryG_h___
|
||||
#define nsDeviceContextSpecFactoryG_h___
|
||||
|
||||
interface nsIAddrDBListener;
|
||||
#include "nsIDeviceContextSpecFactory.h"
|
||||
#include "nsIDeviceContextSpec.h"
|
||||
|
||||
[scriptable, uuid(A4186D8A-1DD0-11d3-A303-001083003D0C)]
|
||||
interface nsIAddrDBAnnouncer : nsISupports {
|
||||
class nsDeviceContextSpecFactoryGTK : public nsIDeviceContextSpecFactory
|
||||
{
|
||||
public:
|
||||
nsDeviceContextSpecFactoryGTK();
|
||||
|
||||
void AddListener(in nsIAddrDBListener listener);
|
||||
void RemoveListener(in nsIAddrDBListener listener);
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
void NotifyCardAttribChange(in unsigned long abCode,
|
||||
in nsIAddrDBListener instigator);
|
||||
void NotifyCardEntryChange (in unsigned long abCode,
|
||||
in nsIAbCard card,
|
||||
in nsIAddrDBListener instigator);
|
||||
NS_IMETHOD Init(void);
|
||||
NS_IMETHOD CreateDeviceContextSpec(nsIDeviceContextSpec *aOldSpec,
|
||||
nsIDeviceContextSpec *&aNewSpec,
|
||||
PRBool aQuiet);
|
||||
|
||||
void NotifyAnnouncerGoingAway();
|
||||
protected:
|
||||
virtual ~nsDeviceContextSpecFactoryGTK();
|
||||
};
|
||||
|
||||
#endif
|
||||
197
mozilla/gfx/src/gtk/nsDeviceContextSpecG.cpp
Normal file
197
mozilla/gfx/src/gtk/nsDeviceContextSpecG.cpp
Normal file
@@ -0,0 +1,197 @@
|
||||
/* -*- 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 "nsDeviceContextSpecG.h"
|
||||
#include "prenv.h" /* for PR_GetEnv */
|
||||
|
||||
//#include "prmem.h"
|
||||
//#include "plstr.h"
|
||||
|
||||
/** -------------------------------------------------------
|
||||
* Construct the nsDeviceContextSpecGTK
|
||||
* @update dc 12/02/98
|
||||
*/
|
||||
nsDeviceContextSpecGTK :: nsDeviceContextSpecGTK()
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
|
||||
}
|
||||
|
||||
/** -------------------------------------------------------
|
||||
* Destroy the nsDeviceContextSpecGTK
|
||||
* @update dc 2/15/98
|
||||
*/
|
||||
nsDeviceContextSpecGTK :: ~nsDeviceContextSpecGTK()
|
||||
{
|
||||
}
|
||||
|
||||
static NS_DEFINE_IID(kIDeviceContextSpecIID, NS_IDEVICE_CONTEXT_SPEC_IID);
|
||||
static NS_DEFINE_IID(kIDeviceContextSpecPSIID, NS_IDEVICE_CONTEXT_SPEC_PS_IID);
|
||||
|
||||
#if 0
|
||||
NS_IMPL_QUERY_INTERFACE(nsDeviceContextSpecGTK, kDeviceContextSpecIID)
|
||||
NS_IMPL_ADDREF(nsDeviceContextSpecGTK)
|
||||
NS_IMPL_RELEASE(nsDeviceContextSpecGTK)
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP nsDeviceContextSpecGTK :: QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
if (nsnull == aInstancePtr)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
if (aIID.Equals(kIDeviceContextSpecIID))
|
||||
{
|
||||
nsIDeviceContextSpec* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (aIID.Equals(kIDeviceContextSpecPSIID))
|
||||
{
|
||||
nsIDeviceContextSpecPS* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
|
||||
if (aIID.Equals(kISupportsIID))
|
||||
{
|
||||
nsIDeviceContextSpec* tmp = this;
|
||||
nsISupports* tmp2 = tmp;
|
||||
*aInstancePtr = (void*) tmp2;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsDeviceContextSpecGTK)
|
||||
NS_IMPL_RELEASE(nsDeviceContextSpecGTK)
|
||||
|
||||
/** -------------------------------------------------------
|
||||
* Initialize the nsDeviceContextSpecGTK
|
||||
* @update dc 2/15/98
|
||||
* @update syd 3/2/99
|
||||
*/
|
||||
NS_IMETHODIMP nsDeviceContextSpecGTK :: Init(PRBool aQuiet)
|
||||
{
|
||||
char *path;
|
||||
|
||||
// XXX these settings should eventually come out of preferences
|
||||
|
||||
mPrData.toPrinter = PR_TRUE;
|
||||
mPrData.fpf = PR_TRUE;
|
||||
mPrData.grayscale = PR_FALSE;
|
||||
mPrData.size = NS_LETTER_SIZE;
|
||||
sprintf( mPrData.command, "lpr" );
|
||||
|
||||
// PWD, HOME, or fail
|
||||
|
||||
if ( ( path = PR_GetEnv( "PWD" ) ) == (char *) NULL )
|
||||
if ( ( path = PR_GetEnv( "HOME" ) ) == (char *) NULL )
|
||||
strcpy( mPrData.path, "netscape.ps" );
|
||||
if ( path != (char *) NULL )
|
||||
sprintf( mPrData.path, "%s/netscape.ps", path );
|
||||
else
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
::UnixPrDialog( &mPrData );
|
||||
if ( mPrData.cancel == PR_TRUE )
|
||||
return NS_ERROR_FAILURE;
|
||||
else
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsDeviceContextSpecGTK :: GetToPrinter( PRBool &aToPrinter )
|
||||
{
|
||||
aToPrinter = mPrData.toPrinter;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsDeviceContextSpecGTK :: GetFirstPageFirst ( PRBool &aFpf )
|
||||
{
|
||||
aFpf = mPrData.fpf;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsDeviceContextSpecGTK :: GetGrayscale ( PRBool &aGrayscale )
|
||||
{
|
||||
aGrayscale = mPrData.grayscale;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsDeviceContextSpecGTK :: GetSize ( int &aSize )
|
||||
{
|
||||
aSize = mPrData.size;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsDeviceContextSpecGTK :: GetTopMargin ( float &value )
|
||||
{
|
||||
value = mPrData.top;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsDeviceContextSpecGTK :: GetBottomMargin ( float &value )
|
||||
{
|
||||
value = mPrData.bottom;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsDeviceContextSpecGTK :: GetRightMargin ( float &value )
|
||||
{
|
||||
value = mPrData.right;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsDeviceContextSpecGTK :: GetLeftMargin ( float &value )
|
||||
{
|
||||
value = mPrData.left;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsDeviceContextSpecGTK :: GetCommand ( char **aCommand )
|
||||
{
|
||||
*aCommand = &mPrData.command[0];
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsDeviceContextSpecGTK :: GetPath ( char **aPath )
|
||||
{
|
||||
*aPath = &mPrData.path[0];
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsDeviceContextSpecGTK :: GetUserCancelled( PRBool &aCancel )
|
||||
{
|
||||
aCancel = mPrData.cancel;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/** -------------------------------------------------------
|
||||
* Closes the printmanager if it is open.
|
||||
* @update dc 2/15/98
|
||||
*/
|
||||
NS_IMETHODIMP nsDeviceContextSpecGTK :: ClosePrintManager()
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
97
mozilla/gfx/src/gtk/nsDeviceContextSpecG.h
Normal file
97
mozilla/gfx/src/gtk/nsDeviceContextSpecG.h
Normal file
@@ -0,0 +1,97 @@
|
||||
/* -*- 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 nsDeviceContextSpecG_h___
|
||||
#define nsDeviceContextSpecG_h___
|
||||
|
||||
#include "nsIDeviceContextSpec.h"
|
||||
#include "nsDeviceContextSpecG.h"
|
||||
#include "nsIDeviceContextSpecPS.h"
|
||||
|
||||
#include "nsPrintdGTK.h"
|
||||
|
||||
class nsDeviceContextSpecGTK : public nsIDeviceContextSpec ,
|
||||
public nsIDeviceContextSpecPS
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Construct a nsDeviceContextSpecMac, which is an object which contains and manages a mac printrecord
|
||||
* @update dc 12/02/98
|
||||
*/
|
||||
nsDeviceContextSpecGTK();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
/**
|
||||
* Initialize the nsDeviceContextSpecMac for use. This will allocate a printrecord for use
|
||||
* @update dc 2/16/98
|
||||
* @param aQuiet if PR_TRUE, prevent the need for user intervention
|
||||
* in obtaining device context spec. if nsnull is passed in for
|
||||
* the aOldSpec, this will typically result in getting a device
|
||||
* context spec for the default output device (i.e. default
|
||||
* printer).
|
||||
* @return error status
|
||||
*/
|
||||
NS_IMETHOD Init(PRBool aQuiet);
|
||||
|
||||
|
||||
/**
|
||||
* Closes the printmanager if it is open.
|
||||
* @update dc 2/13/98
|
||||
* @update syd 3/20/99
|
||||
* @return error status
|
||||
*/
|
||||
|
||||
NS_IMETHOD ClosePrintManager();
|
||||
|
||||
NS_IMETHOD GetToPrinter( PRBool &aToPrinter );
|
||||
|
||||
NS_IMETHOD GetFirstPageFirst ( PRBool &aFpf );
|
||||
|
||||
NS_IMETHOD GetGrayscale( PRBool &aGrayscale );
|
||||
|
||||
NS_IMETHOD GetSize ( int &aSize );
|
||||
|
||||
NS_IMETHOD GetTopMargin ( float &value );
|
||||
|
||||
NS_IMETHOD GetBottomMargin ( float &value );
|
||||
|
||||
NS_IMETHOD GetLeftMargin ( float &value );
|
||||
|
||||
NS_IMETHOD GetRightMargin ( float &value );
|
||||
|
||||
NS_IMETHOD GetCommand ( char **aCommand );
|
||||
|
||||
NS_IMETHOD GetPath ( char **aPath );
|
||||
|
||||
NS_IMETHOD GetUserCancelled( PRBool &aCancel );
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Destuct a nsDeviceContextSpecMac, this will release the printrecord
|
||||
* @update dc 2/16/98
|
||||
*/
|
||||
virtual ~nsDeviceContextSpecGTK();
|
||||
|
||||
protected:
|
||||
|
||||
UnixPrData mPrData;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
367
mozilla/gfx/src/gtk/nsDrawingSurfaceGTK.cpp
Normal file
367
mozilla/gfx/src/gtk/nsDrawingSurfaceGTK.cpp
Normal file
@@ -0,0 +1,367 @@
|
||||
/* -*- 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.
|
||||
*/
|
||||
|
||||
#if defined (HAVE_IPC_H) && defined (HAVE_SHM_H) && defined (HAVE_XSHM_H)
|
||||
#define USE_SHM
|
||||
#endif
|
||||
|
||||
//#define USE_SHM
|
||||
|
||||
#include <gdk/gdkx.h>
|
||||
#include <gdk/gdkprivate.h>
|
||||
#ifdef USE_SHM
|
||||
#include <sys/ipc.h>
|
||||
#include <sys/shm.h>
|
||||
#include <X11/extensions/XShm.h>
|
||||
#endif /* USE_SHM */
|
||||
#include "nsDrawingSurfaceGTK.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDrawingSurfaceIID, NS_IDRAWING_SURFACE_IID);
|
||||
static NS_DEFINE_IID(kIDrawingSurfaceGTKIID, NS_IDRAWING_SURFACE_GTK_IID);
|
||||
|
||||
nsDrawingSurfaceGTK :: nsDrawingSurfaceGTK()
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
GdkVisual *v;
|
||||
|
||||
mPixmap = nsnull;
|
||||
mGC = nsnull;
|
||||
mDepth = 0;
|
||||
mWidth = mHeight = 0;
|
||||
mFlags = 0;
|
||||
|
||||
mImage = nsnull;
|
||||
mLockWidth = mLockHeight = 0;
|
||||
mLockFlags = 0;
|
||||
mLocked = PR_FALSE;
|
||||
|
||||
v = ::gdk_rgb_get_visual();
|
||||
|
||||
mPixFormat.mRedMask = v->red_mask;
|
||||
mPixFormat.mGreenMask = v->green_mask;
|
||||
mPixFormat.mBlueMask = v->blue_mask;
|
||||
// FIXME
|
||||
mPixFormat.mAlphaMask = 0;
|
||||
|
||||
mPixFormat.mRedShift = v->red_shift;
|
||||
mPixFormat.mGreenShift = v->green_shift;
|
||||
mPixFormat.mBlueShift = v->blue_shift;
|
||||
// FIXME
|
||||
mPixFormat.mAlphaShift = 0;
|
||||
|
||||
mDepth = v->depth;
|
||||
}
|
||||
|
||||
nsDrawingSurfaceGTK :: ~nsDrawingSurfaceGTK()
|
||||
{
|
||||
if (mPixmap)
|
||||
::gdk_pixmap_unref(mPixmap);
|
||||
|
||||
if (mImage)
|
||||
::gdk_image_destroy(mImage);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsDrawingSurfaceGTK :: QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
if (nsnull == aInstancePtr)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
if (aIID.Equals(kIDrawingSurfaceIID))
|
||||
{
|
||||
nsIDrawingSurface* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (aIID.Equals(kIDrawingSurfaceGTKIID))
|
||||
{
|
||||
nsDrawingSurfaceGTK* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
|
||||
if (aIID.Equals(kISupportsIID))
|
||||
{
|
||||
nsIDrawingSurface* tmp = this;
|
||||
nsISupports* tmp2 = tmp;
|
||||
*aInstancePtr = (void*) tmp2;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsDrawingSurfaceGTK);
|
||||
NS_IMPL_RELEASE(nsDrawingSurfaceGTK);
|
||||
|
||||
|
||||
/**
|
||||
* Lock a rect of a drawing surface and return a
|
||||
* pointer to the upper left hand corner of the
|
||||
* bitmap.
|
||||
* @param aX x position of subrect of bitmap
|
||||
* @param aY y position of subrect of bitmap
|
||||
* @param aWidth width of subrect of bitmap
|
||||
* @param aHeight height of subrect of bitmap
|
||||
* @param aBits out parameter for upper left hand
|
||||
* corner of bitmap
|
||||
* @param aStride out parameter for number of bytes
|
||||
* to add to aBits to go from scanline to scanline
|
||||
* @param aWidthBytes out parameter for number of
|
||||
* bytes per line in aBits to process aWidth pixels
|
||||
* @return error status
|
||||
*
|
||||
**/
|
||||
NS_IMETHODIMP nsDrawingSurfaceGTK :: Lock(PRInt32 aX, PRInt32 aY,
|
||||
PRUint32 aWidth, PRUint32 aHeight,
|
||||
void **aBits, PRInt32 *aStride,
|
||||
PRInt32 *aWidthBytes, PRUint32 aFlags)
|
||||
{
|
||||
#if 0
|
||||
g_print("nsDrawingSurfaceGTK::Lock() called\n" \
|
||||
" aX = %i, aY = %i,\n" \
|
||||
" aWidth = %i, aHeight = %i,\n" \
|
||||
" aBits, aStride, aWidthBytes,\n" \
|
||||
" aFlags = %i\n", aX, aY, aWidth, aHeight, aFlags);
|
||||
#endif
|
||||
|
||||
if (mLocked)
|
||||
{
|
||||
NS_ASSERTION(0, "nested lock attempt");
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
mLocked = PR_TRUE;
|
||||
|
||||
mLockX = aX;
|
||||
mLockY = aY;
|
||||
mLockWidth = aWidth;
|
||||
mLockHeight = aHeight;
|
||||
mLockFlags = aFlags;
|
||||
|
||||
// Obtain an ximage from the pixmap.
|
||||
#ifdef USE_SHM
|
||||
if (gdk_get_use_xshm())
|
||||
{
|
||||
mImage = gdk_image_new(GDK_IMAGE_FASTEST,
|
||||
gdk_rgb_get_visual(),
|
||||
mLockWidth,
|
||||
mLockHeight);
|
||||
|
||||
XShmGetImage(GDK_DISPLAY(),
|
||||
GDK_WINDOW_XWINDOW(mPixmap),
|
||||
GDK_IMAGE_XIMAGE(mImage),
|
||||
mLockX, mLockY,
|
||||
0xFFFFFFFF);
|
||||
|
||||
gdk_flush();
|
||||
}
|
||||
else
|
||||
{
|
||||
#endif /* USE_SHM */
|
||||
mImage = ::gdk_image_get(mPixmap, mLockX, mLockY, mLockWidth, mLockHeight);
|
||||
#ifdef USE_SHM
|
||||
}
|
||||
#endif /* USE_SHM */
|
||||
|
||||
*aBits = GDK_IMAGE_XIMAGE(mImage)->data;
|
||||
|
||||
*aWidthBytes = GDK_IMAGE_XIMAGE(mImage)->bytes_per_line;
|
||||
*aStride = GDK_IMAGE_XIMAGE(mImage)->bytes_per_line;
|
||||
|
||||
|
||||
#if 0
|
||||
int bytes_per_line = GDK_IMAGE_XIMAGE(mImage)->bytes_per_line;
|
||||
|
||||
//
|
||||
// All this code is a an attempt to set the stride width properly.
|
||||
// Needs to be cleaned up alot. For now, it will only work in the
|
||||
// case where aWidthBytes and aStride are the same. One is assigned to
|
||||
// the other.
|
||||
//
|
||||
|
||||
*aWidthBytes = mImage->bpl;
|
||||
*aStride = mImage->bpl;
|
||||
|
||||
int width_in_pixels = *aWidthBytes << 8;
|
||||
|
||||
|
||||
int bitmap_pad = GDK_IMAGE_XIMAGE(mImage)->bitmap_pad;
|
||||
int depth = GDK_IMAGE_XIMAGE(mImage)->depth;
|
||||
|
||||
#define RASWIDTH8(width, bpp) (width)
|
||||
#define RASWIDTH16(width, bpp) ((((width) * (bpp) + 15) >> 4) << 1)
|
||||
#define RASWIDTH32(width, bpp) ((((width) * (bpp) + 31) >> 5) << 2)
|
||||
|
||||
switch(bitmap_pad)
|
||||
{
|
||||
case 8:
|
||||
*aStride = RASWIDTH8(aWidth,bitmap_pad);
|
||||
break;
|
||||
|
||||
case 16:
|
||||
*aStride = bytes_per_line;
|
||||
*aStride = RASWIDTH16(aWidth,bitmap_pad);
|
||||
break;
|
||||
|
||||
case 32:
|
||||
*aStride = bytes_per_line;
|
||||
*aStride = RASWIDTH32(aWidth,bitmap_pad);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
NS_ASSERTION(nsnull,"something got screwed");
|
||||
|
||||
}
|
||||
|
||||
*aStride = (*aWidthBytes) + ((bitmap_pad >> 3) - 1);
|
||||
|
||||
GDK_IMAGE_XIMAGE(mImage)->bitmap_pad;
|
||||
|
||||
*aWidthBytes = mImage->bpl;
|
||||
#endif
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsDrawingSurfaceGTK :: Unlock(void)
|
||||
{
|
||||
// g_print("nsDrawingSurfaceGTK::UnLock() called\n");
|
||||
if (!mLocked)
|
||||
{
|
||||
NS_ASSERTION(0, "attempting to unlock an DS that isn't locked");
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
// If the lock was not read only, put the bits back on the pixmap
|
||||
if (!(mLockFlags & NS_LOCK_SURFACE_READ_ONLY))
|
||||
{
|
||||
#if 0
|
||||
g_print("gdk_draw_image(pixmap=%p,lockx=%d,locky=%d,lockw=%d,lockh=%d)\n",
|
||||
mPixmap,
|
||||
mLockX, mLockY,
|
||||
mLockWidth, mLockHeight);
|
||||
#endif
|
||||
|
||||
gdk_draw_image(mPixmap,
|
||||
mGC,
|
||||
mImage,
|
||||
0, 0,
|
||||
mLockX, mLockY,
|
||||
mLockWidth, mLockHeight);
|
||||
|
||||
}
|
||||
|
||||
// FIXME if we are using shared mem, we shouldn't destroy the image...
|
||||
if (mImage)
|
||||
::gdk_image_destroy(mImage);
|
||||
mImage = nsnull;
|
||||
|
||||
mLocked = PR_FALSE;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsDrawingSurfaceGTK :: GetDimensions(PRUint32 *aWidth, PRUint32 *aHeight)
|
||||
{
|
||||
*aWidth = mWidth;
|
||||
*aHeight = mHeight;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsDrawingSurfaceGTK :: IsOffscreen(PRBool *aOffScreen)
|
||||
{
|
||||
*aOffScreen = mIsOffscreen;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsDrawingSurfaceGTK :: IsPixelAddressable(PRBool *aAddressable)
|
||||
{
|
||||
// FIXME
|
||||
*aAddressable = PR_FALSE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsDrawingSurfaceGTK :: GetPixelFormat(nsPixelFormat *aFormat)
|
||||
{
|
||||
*aFormat = mPixFormat;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsDrawingSurfaceGTK :: Init(GdkDrawable *aDrawable, GdkGC *aGC)
|
||||
{
|
||||
mGC = aGC;
|
||||
mPixmap = aDrawable;
|
||||
// this is definatly going to be on the screen, as it will be the window of a
|
||||
// widget or something.
|
||||
mIsOffscreen = PR_FALSE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsDrawingSurfaceGTK :: Init(GdkGC *aGC, PRUint32 aWidth,
|
||||
PRUint32 aHeight, PRUint32 aFlags)
|
||||
{
|
||||
// ::g_return_val_if_fail (aGC != nsnull, NS_ERROR_FAILURE);
|
||||
// ::g_return_val_if_fail ((aWidth > 0) && (aHeight > 0), NS_ERROR_FAILURE);
|
||||
|
||||
mGC = aGC;
|
||||
mWidth = aWidth;
|
||||
mHeight = aHeight;
|
||||
mFlags = aFlags;
|
||||
|
||||
// we can draw on this offscreen because it has no parent
|
||||
mIsOffscreen = PR_TRUE;
|
||||
|
||||
mPixmap = ::gdk_pixmap_new(nsnull, mWidth, mHeight, mDepth);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsDrawingSurfaceGTK :: GetGC(GdkGC *aGC)
|
||||
{
|
||||
aGC = ::gdk_gc_ref(mGC);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsDrawingSurfaceGTK :: ReleaseGC(void)
|
||||
{
|
||||
::gdk_gc_unref(mGC);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* below are utility functions used mostly for nsRenderingContext and nsImage
|
||||
* to plug into gdk_* functions for drawing. You should not set a pointer
|
||||
* that might hang around with the return from these. instead use the ones
|
||||
* above. pav
|
||||
*/
|
||||
GdkGC *nsDrawingSurfaceGTK::GetGC(void)
|
||||
{
|
||||
return mGC;
|
||||
}
|
||||
|
||||
GdkDrawable *nsDrawingSurfaceGTK::GetDrawable(void)
|
||||
{
|
||||
return mPixmap;
|
||||
}
|
||||
|
||||
85
mozilla/gfx/src/gtk/nsDrawingSurfaceGTK.h
Normal file
85
mozilla/gfx/src/gtk/nsDrawingSurfaceGTK.h
Normal file
@@ -0,0 +1,85 @@
|
||||
/* -*- 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 nsDrawingSurfaceGTK_h___
|
||||
#define nsDrawingSurfaceGTK_h___
|
||||
|
||||
#include "nsIDrawingSurface.h"
|
||||
#include "nsIDrawingSurfaceGTK.h"
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
class nsDrawingSurfaceGTK : public nsIDrawingSurface,
|
||||
public nsIDrawingSurfaceGTK
|
||||
{
|
||||
public:
|
||||
nsDrawingSurfaceGTK();
|
||||
virtual ~nsDrawingSurfaceGTK();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
//nsIDrawingSurface interface
|
||||
|
||||
NS_IMETHOD Lock(PRInt32 aX, PRInt32 aY, PRUint32 aWidth, PRUint32 aHeight,
|
||||
void **aBits, PRInt32 *aStride, PRInt32 *aWidthBytes,
|
||||
PRUint32 aFlags);
|
||||
NS_IMETHOD Unlock(void);
|
||||
NS_IMETHOD GetDimensions(PRUint32 *aWidth, PRUint32 *aHeight);
|
||||
NS_IMETHOD IsOffscreen(PRBool *aOffScreen);
|
||||
NS_IMETHOD IsPixelAddressable(PRBool *aAddressable);
|
||||
NS_IMETHOD GetPixelFormat(nsPixelFormat *aFormat);
|
||||
|
||||
//nsIDrawingSurfaceGTK interface
|
||||
|
||||
NS_IMETHOD Init(GdkDrawable *aDrawable, GdkGC *aGC);
|
||||
NS_IMETHOD Init(GdkGC *aGC, PRUint32 aWidth, PRUint32 aHeight, PRUint32 aFlags);
|
||||
|
||||
/* get the GC and manage the GdkGC's refcount */
|
||||
NS_IMETHOD GetGC(GdkGC *aGC);
|
||||
NS_IMETHOD ReleaseGC(void);
|
||||
|
||||
/* below are utility functions used mostly for nsRenderingContext and nsImage
|
||||
* to plug into gdk_* functions for drawing. You should not set a pointer
|
||||
* that might hang around with the return from these. instead use the ones
|
||||
* above. pav
|
||||
*/
|
||||
GdkGC *GetGC(void);
|
||||
GdkDrawable *GetDrawable(void);
|
||||
|
||||
private:
|
||||
/* general */
|
||||
GdkPixmap *mPixmap;
|
||||
GdkGC *mGC;
|
||||
gint mDepth;
|
||||
nsPixelFormat mPixFormat;
|
||||
PRUint32 mWidth;
|
||||
PRUint32 mHeight;
|
||||
PRUint32 mFlags;
|
||||
PRBool mIsOffscreen;
|
||||
|
||||
/* for locks */
|
||||
GdkImage *mImage;
|
||||
PRInt32 mLockX;
|
||||
PRInt32 mLockY;
|
||||
PRUint32 mLockWidth;
|
||||
PRUint32 mLockHeight;
|
||||
PRUint32 mLockFlags;
|
||||
PRBool mLocked;
|
||||
};
|
||||
|
||||
#endif
|
||||
2170
mozilla/gfx/src/gtk/nsFontMetricsGTK.cpp
Normal file
2170
mozilla/gfx/src/gtk/nsFontMetricsGTK.cpp
Normal file
File diff suppressed because it is too large
Load Diff
162
mozilla/gfx/src/gtk/nsFontMetricsGTK.h
Normal file
162
mozilla/gfx/src/gtk/nsFontMetricsGTK.h
Normal file
@@ -0,0 +1,162 @@
|
||||
/* -*- 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 nsFontMetricsGTK_h__
|
||||
#define nsFontMetricsGTK_h__
|
||||
|
||||
#include "nsIFontMetrics.h"
|
||||
#include "nsFont.h"
|
||||
#include "nsString.h"
|
||||
#include "nsUnitConversion.h"
|
||||
#include "nsIDeviceContext.h"
|
||||
#include "nsCRT.h"
|
||||
#include "nsDeviceContextGTK.h"
|
||||
|
||||
#include <gdk/gdk.h>
|
||||
#include <gdk/gdkx.h>
|
||||
|
||||
#define FONT_SWITCHING
|
||||
#ifdef FONT_SWITCHING
|
||||
|
||||
#ifdef ADD_GLYPH
|
||||
#undef ADD_GLYPH
|
||||
#endif
|
||||
#define ADD_GLYPH(map, g) (map)[(g) >> 3] |= (1 << ((g) & 7))
|
||||
|
||||
#ifdef FONT_HAS_GLYPH
|
||||
#undef FONT_HAS_GLYPH
|
||||
#endif
|
||||
#define FONT_HAS_GLYPH(map, g) (((map)[(g) >> 3] >> ((g) & 7)) & 1)
|
||||
|
||||
typedef struct nsFontCharSetInfo nsFontCharSetInfo;
|
||||
|
||||
typedef gint (*nsFontCharSetConverter)(nsFontCharSetInfo* aSelf,
|
||||
const PRUnichar* aSrcBuf, PRUint32 aSrcLen, PRUint8* aDestBuf,
|
||||
PRUint32 aDestLen);
|
||||
|
||||
struct nsFontCharSet;
|
||||
class nsFontMetricsGTK;
|
||||
|
||||
struct nsFontGTK
|
||||
{
|
||||
NS_DECL_AND_IMPL_ZEROING_OPERATOR_NEW
|
||||
|
||||
void LoadFont(nsFontCharSet* aCharSet, nsFontMetricsGTK* aMetrics);
|
||||
|
||||
GdkFont* mFont;
|
||||
PRUint8* mMap;
|
||||
nsFontCharSetInfo* mCharSetInfo;
|
||||
char* mName;
|
||||
PRUint16 mSize;
|
||||
PRUint16 mActualSize;
|
||||
PRInt16 mBaselineAdjust;
|
||||
};
|
||||
|
||||
struct nsFontStretch;
|
||||
struct nsFontFamily;
|
||||
typedef struct nsFontSearch nsFontSearch;
|
||||
|
||||
#endif /* FONT_SWITCHING */
|
||||
|
||||
class nsFontMetricsGTK : public nsIFontMetrics
|
||||
{
|
||||
public:
|
||||
nsFontMetricsGTK();
|
||||
virtual ~nsFontMetricsGTK();
|
||||
|
||||
NS_DECL_AND_IMPL_ZEROING_OPERATOR_NEW
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
NS_IMETHOD Init(const nsFont& aFont, nsIDeviceContext* aContext);
|
||||
NS_IMETHOD Destroy();
|
||||
|
||||
NS_IMETHOD GetXHeight(nscoord& aResult);
|
||||
NS_IMETHOD GetSuperscriptOffset(nscoord& aResult);
|
||||
NS_IMETHOD GetSubscriptOffset(nscoord& aResult);
|
||||
NS_IMETHOD GetStrikeout(nscoord& aOffset, nscoord& aSize);
|
||||
NS_IMETHOD GetUnderline(nscoord& aOffset, nscoord& aSize);
|
||||
|
||||
NS_IMETHOD GetHeight(nscoord &aHeight);
|
||||
NS_IMETHOD GetLeading(nscoord &aLeading);
|
||||
NS_IMETHOD GetMaxAscent(nscoord &aAscent);
|
||||
NS_IMETHOD GetMaxDescent(nscoord &aDescent);
|
||||
NS_IMETHOD GetMaxAdvance(nscoord &aAdvance);
|
||||
NS_IMETHOD GetFont(const nsFont *&aFont);
|
||||
NS_IMETHOD GetFontHandle(nsFontHandle &aHandle);
|
||||
|
||||
#ifdef FONT_SWITCHING
|
||||
|
||||
nsFontGTK* FindFont(PRUnichar aChar);
|
||||
static gint GetWidth(nsFontGTK* aFont, const PRUnichar* aString,
|
||||
PRUint32 aLength);
|
||||
static void DrawString(nsDrawingSurfaceGTK* aSurface, nsFontGTK* aFont,
|
||||
nscoord aX, nscoord aY, const PRUnichar* aString,
|
||||
PRUint32 aLength);
|
||||
static void InitFonts(void);
|
||||
|
||||
friend void PickASizeAndLoad(nsFontSearch* aSearch, nsFontStretch* aStretch,
|
||||
nsFontCharSet* aCharSet);
|
||||
friend void TryCharSet(nsFontSearch* aSearch, nsFontCharSet* aCharSet);
|
||||
friend void TryFamily(nsFontSearch* aSearch, nsFontFamily* aFamily);
|
||||
friend struct nsFontGTK;
|
||||
|
||||
nsFontGTK **mLoadedFonts;
|
||||
PRUint16 mLoadedFontsAlloc;
|
||||
PRUint16 mLoadedFontsCount;
|
||||
|
||||
nsString *mFonts;
|
||||
PRUint16 mFontsAlloc;
|
||||
PRUint16 mFontsCount;
|
||||
PRUint16 mFontsIndex;
|
||||
|
||||
#endif /* FONT_SWITCHING */
|
||||
|
||||
protected:
|
||||
char *PickAppropriateSize(char **names, XFontStruct *fonts, int cnt, nscoord desired);
|
||||
void RealizeFont();
|
||||
|
||||
nsIDeviceContext *mDeviceContext;
|
||||
nsFont *mFont;
|
||||
GdkFont *mFontHandle;
|
||||
|
||||
nscoord mHeight;
|
||||
nscoord mAscent;
|
||||
nscoord mDescent;
|
||||
nscoord mLeading;
|
||||
nscoord mMaxAscent;
|
||||
nscoord mMaxDescent;
|
||||
nscoord mMaxAdvance;
|
||||
nscoord mXHeight;
|
||||
nscoord mSuperscriptOffset;
|
||||
nscoord mSubscriptOffset;
|
||||
nscoord mStrikeoutSize;
|
||||
nscoord mStrikeoutOffset;
|
||||
nscoord mUnderlineSize;
|
||||
nscoord mUnderlineOffset;
|
||||
|
||||
#ifdef FONT_SWITCHING
|
||||
|
||||
PRUint16 mPixelSize;
|
||||
PRUint8 mStretchIndex;
|
||||
PRUint8 mStyleIndex;
|
||||
|
||||
#endif /* FONT_SWITCHING */
|
||||
};
|
||||
|
||||
#endif
|
||||
205
mozilla/gfx/src/gtk/nsGfxFactoryGTK.cpp
Normal file
205
mozilla/gfx/src/gtk/nsGfxFactoryGTK.cpp
Normal file
@@ -0,0 +1,205 @@
|
||||
/* -*- 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 <gtk/gtk.h>
|
||||
|
||||
#include "nscore.h"
|
||||
#include "nsIFactory.h"
|
||||
#include "nsISupports.h"
|
||||
#include "nsGfxCIID.h"
|
||||
#include "nsFontMetricsGTK.h"
|
||||
#include "nsRenderingContextGTK.h"
|
||||
#include "nsImageGTK.h"
|
||||
#include "nsDeviceContextGTK.h"
|
||||
#include "nsRegionGTK.h"
|
||||
#include "nsBlender.h"
|
||||
#include "nsDeviceContextSpecG.h"
|
||||
#include "nsDeviceContextSpecFactoryG.h"
|
||||
#include "nsIDeviceContextSpecPS.h"
|
||||
|
||||
static NS_DEFINE_IID(kCFontMetrics, NS_FONT_METRICS_CID);
|
||||
static NS_DEFINE_IID(kCRenderingContext, NS_RENDERING_CONTEXT_CID);
|
||||
static NS_DEFINE_IID(kCImage, NS_IMAGE_CID);
|
||||
static NS_DEFINE_IID(kCDeviceContext, NS_DEVICE_CONTEXT_CID);
|
||||
static NS_DEFINE_IID(kCRegion, NS_REGION_CID);
|
||||
|
||||
static NS_DEFINE_IID(kCBlender, NS_BLENDER_CID);
|
||||
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
static NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID);
|
||||
|
||||
static NS_DEFINE_IID(kCDeviceContextSpec, NS_DEVICE_CONTEXT_SPEC_CID);
|
||||
static NS_DEFINE_IID(kCDeviceContextSpecFactory, NS_DEVICE_CONTEXT_SPEC_FACTORY_CID);
|
||||
|
||||
|
||||
class nsGfxFactoryGTK : public nsIFactory
|
||||
{
|
||||
public:
|
||||
// nsISupports methods
|
||||
NS_IMETHOD QueryInterface(const nsIID &aIID,
|
||||
void **aResult);
|
||||
NS_IMETHOD_(nsrefcnt) AddRef(void);
|
||||
NS_IMETHOD_(nsrefcnt) Release(void);
|
||||
|
||||
// nsIFactory methods
|
||||
NS_IMETHOD CreateInstance(nsISupports *aOuter,
|
||||
const nsIID &aIID,
|
||||
void **aResult);
|
||||
|
||||
NS_IMETHOD LockFactory(PRBool aLock);
|
||||
|
||||
nsGfxFactoryGTK(const nsCID &aClass);
|
||||
virtual ~nsGfxFactoryGTK();
|
||||
|
||||
private:
|
||||
nsrefcnt mRefCnt;
|
||||
nsCID mClassID;
|
||||
};
|
||||
|
||||
nsGfxFactoryGTK::nsGfxFactoryGTK(const nsCID &aClass)
|
||||
{
|
||||
mRefCnt = 0;
|
||||
mClassID = aClass;
|
||||
}
|
||||
|
||||
nsGfxFactoryGTK::~nsGfxFactoryGTK()
|
||||
{
|
||||
NS_ASSERTION(mRefCnt == 0, "non-zero refcnt at destruction");
|
||||
}
|
||||
|
||||
nsresult nsGfxFactoryGTK::QueryInterface(const nsIID &aIID,
|
||||
void **aResult)
|
||||
{
|
||||
if (aResult == NULL) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
// Always NULL result, in case of failure
|
||||
*aResult = NULL;
|
||||
|
||||
if (aIID.Equals(kISupportsIID)) {
|
||||
*aResult = (void *)(nsISupports*)this;
|
||||
} else if (aIID.Equals(kIFactoryIID)) {
|
||||
*aResult = (void *)(nsIFactory*)this;
|
||||
}
|
||||
|
||||
if (*aResult == NULL) {
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
AddRef(); // Increase reference count for caller
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsrefcnt nsGfxFactoryGTK::AddRef()
|
||||
{
|
||||
return ++mRefCnt;
|
||||
}
|
||||
|
||||
nsrefcnt nsGfxFactoryGTK::Release()
|
||||
{
|
||||
if (--mRefCnt == 0) {
|
||||
delete this;
|
||||
return 0; // Don't access mRefCnt after deleting!
|
||||
}
|
||||
return mRefCnt;
|
||||
}
|
||||
|
||||
nsresult nsGfxFactoryGTK::CreateInstance(nsISupports *aOuter,
|
||||
const nsIID &aIID,
|
||||
void **aResult)
|
||||
{
|
||||
if (aResult == NULL) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
*aResult = NULL;
|
||||
|
||||
nsISupports *inst = nsnull;
|
||||
|
||||
if (mClassID.Equals(kCFontMetrics)) {
|
||||
inst = (nsISupports *)new nsFontMetricsGTK();
|
||||
}
|
||||
else if (mClassID.Equals(kCDeviceContext)) {
|
||||
inst = (nsISupports *)new nsDeviceContextGTK();
|
||||
}
|
||||
else if (mClassID.Equals(kCRenderingContext)) {
|
||||
inst = (nsISupports *)new nsRenderingContextGTK();
|
||||
}
|
||||
else if (mClassID.Equals(kCImage)) {
|
||||
inst = (nsISupports *)new nsImageGTK();
|
||||
}
|
||||
else if (mClassID.Equals(kCRegion)) {
|
||||
inst = (nsISupports *)new nsRegionGTK();
|
||||
}
|
||||
else if (mClassID.Equals(kCBlender)) {
|
||||
inst = (nsISupports *)new nsBlender;
|
||||
}
|
||||
else if (mClassID.Equals(kCDeviceContextSpec)) {
|
||||
nsDeviceContextSpecGTK* dcs;
|
||||
NS_NEWXPCOM(dcs, nsDeviceContextSpecGTK);
|
||||
inst = (nsISupports *)((nsIDeviceContextSpecPS *)dcs);
|
||||
}
|
||||
else if (mClassID.Equals(kCDeviceContextSpecFactory)) {
|
||||
nsDeviceContextSpecFactoryGTK* dcs;
|
||||
NS_NEWXPCOM(dcs, nsDeviceContextSpecFactoryGTK);
|
||||
inst = (nsISupports *)dcs;
|
||||
}
|
||||
|
||||
if (inst == NULL) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
nsresult res = inst->QueryInterface(aIID, aResult);
|
||||
|
||||
if (res != NS_OK) {
|
||||
// We didn't get the right interface, so clean up
|
||||
delete inst;
|
||||
}
|
||||
// else {
|
||||
// inst->Release();
|
||||
// }
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
nsresult nsGfxFactoryGTK::LockFactory(PRBool aLock)
|
||||
{
|
||||
// Not implemented in simplest case.
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// return the proper factory to the caller
|
||||
extern "C" NS_GFXNONXP nsresult NSGetFactory(nsISupports* servMgr,
|
||||
const nsCID &aClass,
|
||||
const char *aClassName,
|
||||
const char *aProgID,
|
||||
nsIFactory **aFactory)
|
||||
{
|
||||
if (nsnull == aFactory) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
*aFactory = new nsGfxFactoryGTK(aClass);
|
||||
|
||||
if (nsnull == aFactory) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
return (*aFactory)->QueryInterface(kIFactoryIID, (void**)aFactory);
|
||||
}
|
||||
77
mozilla/gfx/src/gtk/nsIDrawingSurfaceGTK.h
Normal file
77
mozilla/gfx/src/gtk/nsIDrawingSurfaceGTK.h
Normal file
@@ -0,0 +1,77 @@
|
||||
/* -*- 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 nsIDrawingSurfaceGTK_h___
|
||||
#define nsIDrawingSurfaceGTK_h___
|
||||
|
||||
#include "nsIDrawingSurface.h"
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
// windows specific drawing surface method set
|
||||
|
||||
#define NS_IDRAWING_SURFACE_GTK_IID \
|
||||
{ 0x1ed958b0, 0xcab6, 0x11d2, \
|
||||
{ 0xa8, 0x49, 0x00, 0x40, 0x95, 0x9a, 0x28, 0xc9 } }
|
||||
|
||||
class nsIDrawingSurfaceGTK : public nsISupports
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Initialize a drawing surface using a windows DC.
|
||||
* aDC is "owned" by the drawing surface until the drawing
|
||||
* surface is destroyed.
|
||||
* @param aDC HDC to initialize drawing surface with
|
||||
* @return error status
|
||||
**/
|
||||
NS_IMETHOD Init(GdkDrawable *aDrawable, GdkGC *aGC) = 0;
|
||||
|
||||
/**
|
||||
* Initialize an offscreen drawing surface using a
|
||||
* windows DC. aDC is not "owned" by this drawing surface, instead
|
||||
* it is used to create a drawing surface compatible
|
||||
* with aDC. if width or height are less than zero, aDC will
|
||||
* be created with no offscreen bitmap installed.
|
||||
* @param aDC HDC to initialize drawing surface with
|
||||
* @param aWidth width of drawing surface
|
||||
* @param aHeight height of drawing surface
|
||||
* @param aFlags flags used to control type of drawing
|
||||
* surface created
|
||||
* @return error status
|
||||
**/
|
||||
NS_IMETHOD Init(GdkGC *aGC, PRUint32 aWidth, PRUint32 aHeight,
|
||||
PRUint32 aFlags) = 0;
|
||||
|
||||
/**
|
||||
* Get a windows DC that represents the drawing surface.
|
||||
* GetDC() must be paired with ReleaseDC(). Getting a DC
|
||||
* and Lock()ing are mutually exclusive operations.
|
||||
* @param aDC out parameter for HDC
|
||||
* @return error status
|
||||
**/
|
||||
NS_IMETHOD GetGC(GdkGC *aGC) = 0;
|
||||
|
||||
/**
|
||||
* Release a windows DC obtained by GetDC().
|
||||
* ReleaseDC() must be preceded by a call to ReleaseDC().
|
||||
* @return error status
|
||||
**/
|
||||
NS_IMETHOD ReleaseGC(void) = 0;
|
||||
|
||||
};
|
||||
|
||||
#endif // nsIDrawingSurfaceGTK_h___
|
||||
515
mozilla/gfx/src/gtk/nsImageGTK.cpp
Normal file
515
mozilla/gfx/src/gtk/nsImageGTK.cpp
Normal file
@@ -0,0 +1,515 @@
|
||||
/* -*- 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 <gtk/gtk.h>
|
||||
#include <gdk/gdkx.h>
|
||||
|
||||
#include "nsImageGTK.h"
|
||||
#include "nsRenderingContextGTK.h"
|
||||
|
||||
#include "nspr.h"
|
||||
|
||||
#define IsFlagSet(a,b) (a & b)
|
||||
|
||||
#undef CHEAP_PERFORMANCE_MEASURMENT
|
||||
|
||||
|
||||
// Defining this will trace the allocation of images. This includes
|
||||
// ctor, dtor and update.
|
||||
#undef TRACE_IMAGE_ALLOCATION
|
||||
|
||||
static NS_DEFINE_IID(kIImageIID, NS_IIMAGE_IID);
|
||||
|
||||
//------------------------------------------------------------
|
||||
|
||||
nsImageGTK::nsImageGTK()
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mImageBits = nsnull;
|
||||
mWidth = 0;
|
||||
mHeight = 0;
|
||||
mDepth = 0;
|
||||
mAlphaBits = nsnull;
|
||||
mAlphaPixmap = nsnull;
|
||||
mImagePixmap = nsnull;
|
||||
mGC = nsnull;
|
||||
|
||||
#ifdef TRACE_IMAGE_ALLOCATION
|
||||
printf("nsImageGTK::nsImageGTK(this=%p)\n",
|
||||
this);
|
||||
#endif
|
||||
}
|
||||
|
||||
//------------------------------------------------------------
|
||||
|
||||
nsImageGTK::~nsImageGTK()
|
||||
{
|
||||
if(nsnull != mImageBits) {
|
||||
delete[] (PRUint8*)mImageBits;
|
||||
mImageBits = nsnull;
|
||||
}
|
||||
|
||||
if (nsnull != mAlphaBits) {
|
||||
delete[] (PRUint8*)mAlphaBits;
|
||||
mAlphaBits = nsnull;
|
||||
}
|
||||
|
||||
if (nsnull != mAlphaPixmap) {
|
||||
gdk_pixmap_unref(mAlphaPixmap);
|
||||
mAlphaPixmap = nsnull;
|
||||
}
|
||||
|
||||
if (nsnull != mImagePixmap) {
|
||||
gdk_pixmap_unref(mImagePixmap);
|
||||
mImagePixmap = nsnull;
|
||||
}
|
||||
|
||||
if (nsnull != mGC) {
|
||||
gdk_gc_unref(mGC);
|
||||
mGC = nsnull;
|
||||
}
|
||||
|
||||
#ifdef TRACE_IMAGE_ALLOCATION
|
||||
printf("nsImageGTK::~nsImageGTK(this=%p)\n",
|
||||
this);
|
||||
#endif
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS(nsImageGTK, kIImageIID);
|
||||
|
||||
//------------------------------------------------------------
|
||||
|
||||
nsresult nsImageGTK::Init(PRInt32 aWidth, PRInt32 aHeight,
|
||||
PRInt32 aDepth, nsMaskRequirements aMaskRequirements)
|
||||
{
|
||||
g_return_val_if_fail ((aWidth != 0) || (aHeight != 0), NS_ERROR_FAILURE);
|
||||
|
||||
if (nsnull != mImageBits) {
|
||||
delete[] (PRUint8*)mImageBits;
|
||||
mImageBits = nsnull;
|
||||
}
|
||||
|
||||
if (nsnull != mAlphaBits) {
|
||||
delete[] (PRUint8*)mAlphaBits;
|
||||
mAlphaBits = nsnull;
|
||||
}
|
||||
|
||||
if (nsnull != mAlphaPixmap) {
|
||||
gdk_pixmap_unref(mAlphaPixmap);
|
||||
mAlphaPixmap = nsnull;
|
||||
}
|
||||
|
||||
if (nsnull != mImagePixmap) {
|
||||
gdk_pixmap_unref(mImagePixmap);
|
||||
mImagePixmap = nsnull;
|
||||
}
|
||||
|
||||
if (24 == aDepth) {
|
||||
mNumBytesPixel = 3;
|
||||
} else {
|
||||
NS_ASSERTION(PR_FALSE, "unexpected image depth");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
mImageUpdated = PR_TRUE;
|
||||
mWidth = aWidth;
|
||||
mHeight = aHeight;
|
||||
mDepth = aDepth;
|
||||
mIsTopToBottom = PR_TRUE;
|
||||
|
||||
#ifdef TRACE_IMAGE_ALLOCATION
|
||||
printf("nsImageGTK::Init(this=%p,%d,%d,%d,%d)\n",
|
||||
this,
|
||||
aWidth,
|
||||
aHeight,
|
||||
aDepth,
|
||||
aMaskRequirements);
|
||||
#endif
|
||||
|
||||
// create the memory for the image
|
||||
ComputMetrics();
|
||||
|
||||
mImageBits = (PRUint8*) new PRUint8[mSizeImage];
|
||||
|
||||
switch(aMaskRequirements)
|
||||
{
|
||||
case nsMaskRequirements_kNoMask:
|
||||
mAlphaBits = nsnull;
|
||||
mAlphaWidth = 0;
|
||||
mAlphaHeight = 0;
|
||||
break;
|
||||
|
||||
case nsMaskRequirements_kNeeds1Bit:
|
||||
mAlphaRowBytes = (aWidth + 7) / 8;
|
||||
mAlphaDepth = 1;
|
||||
|
||||
// 32-bit align each row
|
||||
mAlphaRowBytes = (mAlphaRowBytes + 3) & ~0x3;
|
||||
|
||||
mAlphaBits = new PRUint8[mAlphaRowBytes * aHeight];
|
||||
mAlphaWidth = aWidth;
|
||||
mAlphaHeight = aHeight;
|
||||
|
||||
mAlphaPixmap = gdk_pixmap_new(nsnull, aWidth, aHeight,
|
||||
mAlphaDepth);
|
||||
break;
|
||||
|
||||
case nsMaskRequirements_kNeeds8Bit:
|
||||
mAlphaBits = nsnull;
|
||||
mAlphaWidth = 0;
|
||||
mAlphaHeight = 0;
|
||||
mAlphaDepth = 8;
|
||||
g_print("TODO: want an 8bit mask for an image..\n");
|
||||
|
||||
mAlphaPixmap = gdk_pixmap_new(nsnull, aWidth, aHeight,
|
||||
mAlphaDepth);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
mImagePixmap = gdk_pixmap_new(nsnull, aWidth, aHeight,
|
||||
gdk_rgb_get_visual()->depth);
|
||||
mGC = gdk_gc_new(mImagePixmap);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------
|
||||
|
||||
PRInt32 nsImageGTK::CalcBytesSpan(PRUint32 aWidth)
|
||||
{
|
||||
PRInt32 spanbytes;
|
||||
|
||||
spanbytes = (aWidth * mDepth) >> 5;
|
||||
|
||||
if (((PRUint32)aWidth * mDepth) & 0x1F)
|
||||
spanbytes++;
|
||||
spanbytes <<= 2;
|
||||
return(spanbytes);
|
||||
}
|
||||
|
||||
void nsImageGTK::ComputMetrics()
|
||||
{
|
||||
mRowBytes = CalcBytesSpan(mWidth);
|
||||
mSizeImage = mRowBytes * mHeight;
|
||||
}
|
||||
|
||||
PRInt32 nsImageGTK::GetHeight()
|
||||
{
|
||||
return mHeight;
|
||||
}
|
||||
|
||||
PRInt32 nsImageGTK::GetWidth()
|
||||
{
|
||||
return mWidth;
|
||||
}
|
||||
|
||||
PRUint8 *nsImageGTK::GetBits()
|
||||
{
|
||||
return mImageBits;
|
||||
}
|
||||
|
||||
void *nsImageGTK::GetBitInfo()
|
||||
{
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
PRInt32 nsImageGTK::GetLineStride()
|
||||
{
|
||||
return mRowBytes;
|
||||
}
|
||||
|
||||
nsColorMap *nsImageGTK::GetColorMap()
|
||||
{
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
PRBool nsImageGTK::IsOptimized()
|
||||
{
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
PRUint8 *nsImageGTK::GetAlphaBits()
|
||||
{
|
||||
return mAlphaBits;
|
||||
}
|
||||
|
||||
PRInt32 nsImageGTK::GetAlphaWidth()
|
||||
{
|
||||
return mAlphaWidth;
|
||||
}
|
||||
|
||||
PRInt32 nsImageGTK::GetAlphaHeight()
|
||||
{
|
||||
return mAlphaHeight;
|
||||
}
|
||||
|
||||
PRInt32 nsImageGTK::GetAlphaLineStride()
|
||||
{
|
||||
return mAlphaRowBytes;
|
||||
}
|
||||
|
||||
nsIImage *nsImageGTK::DuplicateImage()
|
||||
{
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
void nsImageGTK::SetAlphaLevel(PRInt32 aAlphaLevel)
|
||||
{
|
||||
}
|
||||
|
||||
PRInt32 nsImageGTK::GetAlphaLevel()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void nsImageGTK::MoveAlphaMask(PRInt32 aX, PRInt32 aY)
|
||||
{
|
||||
}
|
||||
|
||||
//------------------------------------------------------------
|
||||
|
||||
// set up the palette to the passed in color array, RGB only in this array
|
||||
void nsImageGTK::ImageUpdated(nsIDeviceContext *aContext,
|
||||
PRUint8 aFlags,
|
||||
nsRect *aUpdateRect)
|
||||
{
|
||||
#ifdef TRACE_IMAGE_ALLOCATION
|
||||
printf("nsImageGTK::ImageUpdated(this=%p,%d)\n",
|
||||
this,
|
||||
aFlags);
|
||||
#endif
|
||||
|
||||
if (IsFlagSet(nsImageUpdateFlags_kBitsChanged, aFlags)) {
|
||||
mImageUpdated = PR_TRUE;
|
||||
// FIXME do something with aUpdateRect
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CHEAP_PERFORMANCE_MEASURMENT
|
||||
static PRTime gConvertTime, gStartTime, gPixmapTime, gEndTime;
|
||||
#endif
|
||||
|
||||
// Draw the bitmap, this method has a source and destination coordinates
|
||||
NS_IMETHODIMP
|
||||
nsImageGTK::Draw(nsIRenderingContext &aContext, nsDrawingSurface aSurface,
|
||||
PRInt32 aSX, PRInt32 aSY, PRInt32 aSWidth, PRInt32 aSHeight,
|
||||
PRInt32 aDX, PRInt32 aDY, PRInt32 aDWidth, PRInt32 aDHeight)
|
||||
{
|
||||
g_return_val_if_fail ((aSurface != nsnull), NS_ERROR_FAILURE);
|
||||
|
||||
nsDrawingSurfaceGTK *drawing = (nsDrawingSurfaceGTK*)aSurface;
|
||||
|
||||
if (mAlphaBits)
|
||||
g_print("calling nsImageGTK::Draw() with alpha bits\n");
|
||||
|
||||
gdk_draw_rgb_image (drawing->GetDrawable(),
|
||||
mGC,
|
||||
aDX, aDY, aDWidth, aDHeight,
|
||||
GDK_RGB_DITHER_MAX,
|
||||
mImageBits + mRowBytes * aSY + 3 * aDX,
|
||||
mRowBytes);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------
|
||||
|
||||
// Draw the bitmap, this draw just has destination coordinates
|
||||
NS_IMETHODIMP
|
||||
nsImageGTK::Draw(nsIRenderingContext &aContext,
|
||||
nsDrawingSurface aSurface,
|
||||
PRInt32 aX, PRInt32 aY,
|
||||
PRInt32 aWidth, PRInt32 aHeight)
|
||||
{
|
||||
g_return_val_if_fail ((aSurface != nsnull), NS_ERROR_FAILURE);
|
||||
|
||||
|
||||
// XXX kipp: this is temporary code until we eliminate the
|
||||
// width/height arguments from the draw method.
|
||||
if ((aWidth != mWidth) || (aHeight != mHeight)) {
|
||||
aWidth = mWidth;
|
||||
aHeight = mHeight;
|
||||
}
|
||||
|
||||
#ifdef TRACE_IMAGE_ALLOCATION
|
||||
printf("nsImageGTK::Draw(this=%p,x=%d,y=%d,width=%d,height=%d)\n",
|
||||
this,
|
||||
aX,
|
||||
aY,
|
||||
aWidth,
|
||||
aHeight);
|
||||
#endif
|
||||
|
||||
nsDrawingSurfaceGTK* drawing = (nsDrawingSurfaceGTK*) aSurface;
|
||||
|
||||
XImage *x_image = nsnull;
|
||||
Pixmap pixmap = 0;
|
||||
Display *dpy = nsnull;
|
||||
Visual *visual = nsnull;
|
||||
GC gc;
|
||||
XGCValues gcv;
|
||||
|
||||
#ifdef CHEAP_PERFORMANCE_MEASURMENT
|
||||
gStartTime = gPixmapTime = PR_Now();
|
||||
#endif
|
||||
|
||||
// Create gc clip-mask on demand
|
||||
if ((mAlphaBits) && (mImageUpdated == PR_TRUE))
|
||||
{
|
||||
/* get the X primitives */
|
||||
dpy = GDK_WINDOW_XDISPLAY(mAlphaPixmap);
|
||||
|
||||
|
||||
/* this is the depth of the pixmap that we are going to draw to.
|
||||
It's always a bitmap. We're doing alpha here folks. */
|
||||
visual = GDK_VISUAL_XVISUAL(gdk_rgb_get_visual());
|
||||
|
||||
// Make an image out of the alpha-bits created by the image library
|
||||
x_image = XCreateImage(dpy, visual,
|
||||
1, /* visual depth...1 for bitmaps */
|
||||
XYPixmap,
|
||||
0, /* x offset, XXX fix this */
|
||||
(char *)mAlphaBits, /* cast away our sign. */
|
||||
aWidth,
|
||||
aHeight,
|
||||
32,/* bitmap pad */
|
||||
mAlphaRowBytes); /* bytes per line */
|
||||
|
||||
x_image->bits_per_pixel=1;
|
||||
|
||||
/* Image library always places pixels left-to-right MSB to LSB */
|
||||
x_image->bitmap_bit_order = MSBFirst;
|
||||
|
||||
/* This definition doesn't depend on client byte ordering
|
||||
because the image library ensures that the bytes in
|
||||
bitmask data are arranged left to right on the screen,
|
||||
low to high address in memory. */
|
||||
x_image->byte_order = MSBFirst;
|
||||
#if defined(IS_LITTLE_ENDIAN)
|
||||
// no, it's still MSB XXX check on this!!
|
||||
// x_image->byte_order = LSBFirst;
|
||||
#elif defined (IS_BIG_ENDIAN)
|
||||
x_image->byte_order = MSBFirst;
|
||||
#else
|
||||
#error ERROR! Endianness is unknown;
|
||||
#endif
|
||||
|
||||
// Write into the pixemap that is underneath gdk's mAlphaPixmap
|
||||
// the image we just created.
|
||||
|
||||
pixmap = GDK_WINDOW_XWINDOW(mAlphaPixmap);
|
||||
memset(&gcv, 0, sizeof(XGCValues));
|
||||
gcv.function = GXcopy;
|
||||
gc = XCreateGC(dpy, pixmap, GCFunction, &gcv);
|
||||
XPutImage(dpy, pixmap, gc, x_image, 0, 0, 0, 0,
|
||||
aWidth, aHeight);
|
||||
XFreeGC(dpy, gc);
|
||||
|
||||
// Now we are done with the temporary image
|
||||
x_image->data = 0; /* Don't free the IL_Pixmap's bits. */
|
||||
XDestroyImage(x_image);
|
||||
|
||||
#ifdef CHEAP_PERFORMANCE_MEASURMENT
|
||||
gPixmapTime = PR_Now();
|
||||
#endif
|
||||
}
|
||||
|
||||
// Render unique image bits onto an off screen pixmap only once
|
||||
// The image bits can change as a result of ImageUpdated() - for
|
||||
// example: animated GIFs.
|
||||
if (mImageUpdated == PR_TRUE)
|
||||
{
|
||||
#ifdef TRACE_IMAGE_ALLOCATION
|
||||
printf("nsImageGTK::Draw(this=%p) gdk_pixmap_new(nsnull,width=%d,height=%d,depth=%d)\n",
|
||||
this,
|
||||
aWidth,
|
||||
aHeight,
|
||||
mDepth);
|
||||
#endif
|
||||
|
||||
gdk_gc_set_clip_origin(mGC, 0, 0);
|
||||
gdk_gc_set_clip_mask(mGC, nsnull);
|
||||
|
||||
// Render the image bits into an off screen pixmap
|
||||
gdk_draw_rgb_image (mImagePixmap,
|
||||
mGC,
|
||||
0, 0, aWidth, aHeight,
|
||||
GDK_RGB_DITHER_MAX,
|
||||
mImageBits, mRowBytes);
|
||||
|
||||
if (mAlphaPixmap)
|
||||
{
|
||||
// Setup gc to use the given alpha-pixmap for clipping
|
||||
gdk_gc_set_clip_mask(mGC, mAlphaPixmap);
|
||||
gdk_gc_set_clip_origin(mGC, aX, aY);
|
||||
}
|
||||
|
||||
#ifdef TRACE_IMAGE_ALLOCATION
|
||||
printf("nsImageGTK::Draw(this=%p) gdk_draw_pixmap(x=%d,y=%d,width=%d,height=%d)\n",
|
||||
this,
|
||||
aX,
|
||||
aY,
|
||||
aWidth,
|
||||
aHeight);
|
||||
#endif
|
||||
|
||||
mImageUpdated = PR_FALSE;
|
||||
}
|
||||
|
||||
|
||||
// copy our offscreen pixmap onto the window.
|
||||
gdk_window_copy_area(drawing->GetDrawable(), // dest window
|
||||
mGC, // gc
|
||||
aX, // xsrc
|
||||
aY, // ysrc
|
||||
mImagePixmap, // source window
|
||||
0, // xdest
|
||||
0, // ydest
|
||||
aWidth, // width
|
||||
aHeight); // height
|
||||
|
||||
if (mAlphaBits)
|
||||
{
|
||||
// Revert gc to its old clip-mask and origin
|
||||
gdk_gc_set_clip_origin(mGC, 0, 0);
|
||||
gdk_gc_set_clip_mask(mGC, nsnull);
|
||||
}
|
||||
|
||||
#ifdef CHEAP_PERFORMANCE_MEASURMENT
|
||||
gEndTime = PR_Now();
|
||||
printf("nsImageGTK::Draw(this=%p,w=%d,h=%d) total=%lld pixmap=%lld, cvt=%lld\n",
|
||||
this,
|
||||
aWidth, aHeight,
|
||||
gEndTime - gStartTime,
|
||||
gPixmapTime - gStartTime,
|
||||
gConvertTime - gPixmapTime);
|
||||
#endif
|
||||
|
||||
mImageUpdated = PR_FALSE;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------
|
||||
|
||||
nsresult nsImageGTK::Optimize(nsIDeviceContext* aContext)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
115
mozilla/gfx/src/gtk/nsImageGTK.h
Normal file
115
mozilla/gfx/src/gtk/nsImageGTK.h
Normal file
@@ -0,0 +1,115 @@
|
||||
/* -*- 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 nsImageGTK_h___
|
||||
#define nsImageGTK_h___
|
||||
|
||||
#include "nsIImage.h"
|
||||
|
||||
#include "X11/Xlib.h"
|
||||
#include "X11/Xutil.h"
|
||||
#include <gdk/gdk.h>
|
||||
|
||||
#undef Bool
|
||||
|
||||
class nsImageGTK : public nsIImage
|
||||
{
|
||||
public:
|
||||
nsImageGTK();
|
||||
virtual ~nsImageGTK();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
/**
|
||||
@see nsIImage.h
|
||||
*/
|
||||
virtual PRInt32 GetBytesPix() { return mNumBytesPixel; }
|
||||
virtual PRInt32 GetHeight();
|
||||
virtual PRInt32 GetWidth();
|
||||
virtual PRUint8* GetBits();
|
||||
virtual void* GetBitInfo();
|
||||
virtual PRBool GetIsRowOrderTopToBottom() { return mIsTopToBottom; }
|
||||
virtual PRInt32 GetLineStride();
|
||||
virtual nsColorMap* GetColorMap();
|
||||
NS_IMETHOD Draw(nsIRenderingContext &aContext,
|
||||
nsDrawingSurface aSurface,
|
||||
PRInt32 aX, PRInt32 aY,
|
||||
PRInt32 aWidth, PRInt32 aHeight);
|
||||
NS_IMETHOD Draw(nsIRenderingContext &aContext,
|
||||
nsDrawingSurface aSurface,
|
||||
PRInt32 aSX, PRInt32 aSY, PRInt32 aSWidth, PRInt32 aSHeight,
|
||||
PRInt32 aDX, PRInt32 aDY, PRInt32 aDWidth, PRInt32 aDHeight);
|
||||
virtual void ImageUpdated(nsIDeviceContext *aContext,
|
||||
PRUint8 aFlags, nsRect *aUpdateRect);
|
||||
virtual nsresult Init(PRInt32 aWidth, PRInt32 aHeight,
|
||||
PRInt32 aDepth,
|
||||
nsMaskRequirements aMaskRequirements);
|
||||
virtual PRBool IsOptimized();
|
||||
|
||||
virtual nsresult Optimize(nsIDeviceContext* aContext);
|
||||
virtual PRUint8* GetAlphaBits();
|
||||
virtual PRInt32 GetAlphaWidth();
|
||||
virtual PRInt32 GetAlphaHeight();
|
||||
virtual PRInt32 GetAlphaLineStride();
|
||||
virtual nsIImage* DuplicateImage();
|
||||
|
||||
/**
|
||||
* Calculate the number of bytes spaned for this image for a given width
|
||||
* @param aWidth is the width to calculate the number of bytes for
|
||||
* @return the number of bytes in this span
|
||||
*/
|
||||
PRInt32 CalcBytesSpan(PRUint32 aWidth);
|
||||
virtual void SetAlphaLevel(PRInt32 aAlphaLevel);
|
||||
virtual PRInt32 GetAlphaLevel();
|
||||
virtual void MoveAlphaMask(PRInt32 aX, PRInt32 aY);
|
||||
|
||||
private:
|
||||
/**
|
||||
* Calculate the amount of memory needed for the initialization of the image
|
||||
*/
|
||||
void ComputMetrics();
|
||||
void ComputePaletteSize(PRIntn nBitCount);
|
||||
|
||||
private:
|
||||
PRInt32 mWidth;
|
||||
PRInt32 mHeight;
|
||||
PRInt32 mDepth; // bits per pixel
|
||||
PRInt32 mRowBytes;
|
||||
PRUint8 *mImageBits;
|
||||
PRUint8 *mConvertedBits;
|
||||
PRInt32 mSizeImage;
|
||||
PRBool mIsTopToBottom;
|
||||
PRBool mImageUpdated;
|
||||
|
||||
PRInt8 mNumBytesPixel;
|
||||
|
||||
// alpha layer members
|
||||
PRUint8 *mAlphaBits;
|
||||
GdkPixmap *mAlphaPixmap;
|
||||
PRInt8 mAlphaDepth; // alpha layer depth
|
||||
PRInt16 mAlphaRowBytes; // alpha bytes per row
|
||||
PRInt16 mAlphaWidth; // alpha layer width
|
||||
PRInt16 mAlphaHeight; // alpha layer height
|
||||
nsPoint mLocation; // alpha mask location
|
||||
|
||||
GdkPixmap *mImagePixmap;
|
||||
|
||||
GdkGC *mGC;
|
||||
};
|
||||
|
||||
#endif
|
||||
452
mozilla/gfx/src/gtk/nsPrintdGTK.c
Normal file
452
mozilla/gfx/src/gtk/nsPrintdGTK.c
Normal file
@@ -0,0 +1,452 @@
|
||||
/* -*- 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.
|
||||
*/
|
||||
|
||||
/* Original Code: Syd Logan (syd@netscape.com) 3/12/99 */
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "nspr.h"
|
||||
|
||||
#include "nsPrintdGTK.h"
|
||||
|
||||
/* A structure to hold widgets that need to be referenced in callbacks. We
|
||||
declare this statically in the caller entry point (as a field of
|
||||
UnixPrOps, below), and pass a pointer to the structure to Gtk+ for each
|
||||
signal handler registered. This avoids use of globals. */
|
||||
|
||||
typedef struct prwidgets {
|
||||
GtkWidget *toplevel; /* should be set to toplevel window */
|
||||
GtkWidget *prDialog;
|
||||
GtkWidget *cmdEntry;
|
||||
GtkWidget *pathEntry;
|
||||
GtkWidget *browseButton;
|
||||
GtkWidget *fpfToggle;
|
||||
GtkWidget *greyToggle;
|
||||
GtkWidget *letterToggle;
|
||||
GtkWidget *legalToggle;
|
||||
GtkWidget *execToggle;
|
||||
GtkWidget *topSpinner;
|
||||
GtkWidget *bottomSpinner;
|
||||
GtkWidget *leftSpinner;
|
||||
GtkWidget *rightSpinner;
|
||||
GtkFileSelection *fsWidget;
|
||||
} PrWidgets;
|
||||
|
||||
typedef struct unixprops {
|
||||
UnixPrData *prData; /* pointer to caller struct */
|
||||
PrWidgets widgets;
|
||||
} UnixPrOps;
|
||||
|
||||
/* user clicked cancel. tear things down, and set cancel field in
|
||||
caller data to PR_TRUE so printing will not happen */
|
||||
|
||||
static void
|
||||
CancelPrint (GtkWidget *widget, UnixPrOps *prOps)
|
||||
{
|
||||
gtk_main_quit();
|
||||
gtk_widget_destroy( GTK_WIDGET(prOps->widgets.prDialog) );
|
||||
prOps->prData->cancel = PR_TRUE;
|
||||
}
|
||||
|
||||
/* user selected the Print button. Collect any remaining data from the
|
||||
widgets, and set cancel field in caller data to PR_FALSE so printing
|
||||
will be performed. Also, tear down dialog and exit inner main loop */
|
||||
|
||||
static void
|
||||
DoPrint (GtkWidget *widget, UnixPrOps *prOps)
|
||||
{
|
||||
strcpy( prOps->prData->command,
|
||||
gtk_entry_get_text( GTK_ENTRY( prOps->widgets.cmdEntry ) ) );
|
||||
strcpy( prOps->prData->path,
|
||||
gtk_entry_get_text( GTK_ENTRY( prOps->widgets.pathEntry ) ) );
|
||||
|
||||
if ( GTK_TOGGLE_BUTTON( prOps->widgets.fpfToggle )->active == PR_TRUE )
|
||||
prOps->prData->fpf = PR_TRUE;
|
||||
else
|
||||
prOps->prData->fpf = PR_FALSE;
|
||||
|
||||
if ( GTK_TOGGLE_BUTTON( prOps->widgets.greyToggle )->active == PR_TRUE )
|
||||
prOps->prData->grayscale = PR_TRUE;
|
||||
else
|
||||
prOps->prData->grayscale = PR_FALSE;
|
||||
if ( GTK_TOGGLE_BUTTON( prOps->widgets.letterToggle )->active == PR_TRUE )
|
||||
prOps->prData->size = NS_LETTER_SIZE;
|
||||
else if ( GTK_TOGGLE_BUTTON( prOps->widgets.legalToggle )->active == PR_TRUE )
|
||||
prOps->prData->size = NS_LEGAL_SIZE;
|
||||
else if ( GTK_TOGGLE_BUTTON( prOps->widgets.execToggle )->active == PR_TRUE )
|
||||
prOps->prData->size = NS_EXECUTIVE_SIZE;
|
||||
else
|
||||
prOps->prData->size = NS_A4_SIZE;
|
||||
|
||||
/* margins */
|
||||
|
||||
prOps->prData->top = gtk_spin_button_get_value_as_float(
|
||||
GTK_SPIN_BUTTON(prOps->widgets.topSpinner) );
|
||||
prOps->prData->bottom = gtk_spin_button_get_value_as_float(
|
||||
GTK_SPIN_BUTTON(prOps->widgets.bottomSpinner) );
|
||||
prOps->prData->left = gtk_spin_button_get_value_as_float(
|
||||
GTK_SPIN_BUTTON(prOps->widgets.leftSpinner) );
|
||||
prOps->prData->right = gtk_spin_button_get_value_as_float(
|
||||
GTK_SPIN_BUTTON(prOps->widgets.rightSpinner) );
|
||||
|
||||
/* we got everything... bring down the dialog and tell caller
|
||||
it's o.k. to print */
|
||||
|
||||
gtk_main_quit();
|
||||
gtk_widget_destroy( GTK_WIDGET(prOps->widgets.prDialog) );
|
||||
prOps->prData->cancel = PR_FALSE;
|
||||
}
|
||||
|
||||
/* User hit ok in file selection widget brought up by the browse button.
|
||||
snarf the selected file, stuff it in caller data */
|
||||
|
||||
static void
|
||||
ModifyPrPath (GtkWidget *widget, UnixPrOps *prOps)
|
||||
{
|
||||
strcpy( prOps->prData->path,
|
||||
gtk_file_selection_get_filename(prOps->widgets.fsWidget) );
|
||||
gtk_entry_set_text (GTK_ENTRY (prOps->widgets.pathEntry),
|
||||
prOps->prData->path);
|
||||
gtk_widget_destroy( GTK_WIDGET(prOps->widgets.fsWidget) );
|
||||
}
|
||||
|
||||
/* user selected print to printer. de-sensitize print to file fields */
|
||||
|
||||
static void
|
||||
SwitchToPrinter (GtkWidget *widget, UnixPrOps *prOps)
|
||||
{
|
||||
gtk_widget_set_sensitive( prOps->widgets.cmdEntry, PR_TRUE );
|
||||
gtk_widget_set_sensitive( prOps->widgets.pathEntry, PR_FALSE );
|
||||
gtk_widget_set_sensitive( prOps->widgets.browseButton, PR_FALSE );
|
||||
prOps->prData->toPrinter = PR_TRUE;
|
||||
}
|
||||
|
||||
/* user selected print to file. de-sensitize print to printer fields */
|
||||
|
||||
static void
|
||||
SwitchToFile (GtkWidget *widget, UnixPrOps *prOps)
|
||||
{
|
||||
gtk_widget_set_sensitive( prOps->widgets.cmdEntry, PR_FALSE );
|
||||
gtk_widget_set_sensitive( prOps->widgets.pathEntry, PR_TRUE );
|
||||
gtk_widget_set_sensitive( prOps->widgets.browseButton, PR_TRUE );
|
||||
prOps->prData->toPrinter = PR_FALSE;
|
||||
}
|
||||
|
||||
/* user hit the browse button. Pop up a file selection widget and grab
|
||||
result */
|
||||
|
||||
static void
|
||||
GetPrPath (GtkWidget *widget, UnixPrOps *prOps)
|
||||
{
|
||||
GtkWidget *fs;
|
||||
|
||||
fs = gtk_file_selection_new("Netscape: File Browser");
|
||||
|
||||
gtk_file_selection_set_filename( GTK_FILE_SELECTION(fs),
|
||||
prOps->prData->path );
|
||||
|
||||
gtk_window_set_modal (GTK_WINDOW(fs),PR_TRUE);
|
||||
|
||||
#if 0
|
||||
/* XXX not sure what the toplevel window should be. */
|
||||
|
||||
gtk_window_set_transient_for (GTK_WINDOW (fs),
|
||||
GTK_WINDOW (prOps->widgets.toplevel));
|
||||
#endif
|
||||
|
||||
prOps->widgets.fsWidget = GTK_FILE_SELECTION(fs);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT(GTK_FILE_SELECTION(fs)->ok_button),
|
||||
"clicked", GTK_SIGNAL_FUNC(ModifyPrPath), prOps);
|
||||
|
||||
gtk_signal_connect_object (GTK_OBJECT(
|
||||
GTK_FILE_SELECTION(fs)->cancel_button), "clicked",
|
||||
GTK_SIGNAL_FUNC(gtk_widget_destroy), GTK_OBJECT (fs));
|
||||
|
||||
gtk_widget_show(fs);
|
||||
}
|
||||
|
||||
/* create file data dialog. XXX widget should be NULL */
|
||||
|
||||
static void
|
||||
DoPrintGTK (GtkWidget *widget, UnixPrOps *prOps)
|
||||
{
|
||||
GtkWidget *separator, *dialog, *label, *vbox, *entry, *hbox,
|
||||
*button, *fileButton, *prButton, *table, *spinner1;
|
||||
GtkAdjustment *adj;
|
||||
|
||||
prOps->widgets.prDialog = dialog =
|
||||
gtk_window_new( GTK_WINDOW_TOPLEVEL );
|
||||
gtk_window_set_modal( GTK_WINDOW(dialog), PR_TRUE );
|
||||
#if 0
|
||||
/* not yet sure what the toplevel window should be */
|
||||
|
||||
gtk_window_set_transient_for (GTK_WINDOW (dialog),
|
||||
GTK_WINDOW (prOps->widgets.toplevel));
|
||||
#endif
|
||||
gtk_window_set_title( GTK_WINDOW(dialog), "Netscape: Print" );
|
||||
|
||||
vbox = gtk_vbox_new (PR_FALSE, 0);
|
||||
gtk_container_add (GTK_CONTAINER (dialog), vbox);
|
||||
|
||||
table = gtk_table_new (3, 3, PR_FALSE);
|
||||
gtk_table_set_row_spacings (GTK_TABLE (table), 5);
|
||||
gtk_table_set_col_spacings (GTK_TABLE (table), 5);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (table), 10);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), table, PR_TRUE, PR_TRUE, 5);
|
||||
label = gtk_label_new( "Print To:" );
|
||||
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1,
|
||||
0, GTK_EXPAND | GTK_FILL, 0, 0);
|
||||
button = prButton = gtk_radio_button_new_with_label (NULL, "Printer");
|
||||
if ( prOps->prData->toPrinter == PR_TRUE )
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
|
||||
PR_TRUE);
|
||||
gtk_table_attach (GTK_TABLE (table), button, 1, 2, 0, 1,
|
||||
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
|
||||
|
||||
button = fileButton = gtk_radio_button_new_with_label (
|
||||
gtk_radio_button_group (GTK_RADIO_BUTTON (button)), "File");
|
||||
gtk_table_attach (GTK_TABLE (table), button, 2, 3, 0, 1,
|
||||
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
|
||||
if ( prOps->prData->toPrinter == PR_FALSE )
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
|
||||
PR_TRUE);
|
||||
|
||||
label = gtk_label_new( "Print Command:" );
|
||||
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2,
|
||||
0, GTK_EXPAND | GTK_FILL, 0, 0);
|
||||
entry = gtk_entry_new ();
|
||||
gtk_entry_set_text (GTK_ENTRY (entry), prOps->prData->command);
|
||||
gtk_table_attach (GTK_TABLE (table), entry, 1, 3, 1, 2,
|
||||
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
|
||||
if ( prOps->prData->toPrinter == PR_FALSE )
|
||||
gtk_widget_set_sensitive( entry, PR_FALSE );
|
||||
prOps->widgets.cmdEntry = entry;
|
||||
|
||||
label = gtk_label_new( "File Name:" );
|
||||
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 2, 3,
|
||||
0, GTK_EXPAND | GTK_FILL, 0, 0);
|
||||
entry = gtk_entry_new ();
|
||||
gtk_table_attach (GTK_TABLE (table), entry, 1, 2, 2, 3,
|
||||
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
|
||||
gtk_entry_set_text (GTK_ENTRY (entry), prOps->prData->path);
|
||||
if ( prOps->prData->toPrinter == PR_TRUE )
|
||||
gtk_widget_set_sensitive( entry, PR_FALSE );
|
||||
prOps->widgets.pathEntry = entry;
|
||||
|
||||
button = gtk_button_new_with_label ("Browse...");
|
||||
gtk_table_attach (GTK_TABLE (table), button, 2, 3, 2, 3,
|
||||
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
|
||||
gtk_signal_connect (GTK_OBJECT (button), "clicked",
|
||||
GTK_SIGNAL_FUNC (GetPrPath), prOps);
|
||||
if ( prOps->prData->toPrinter == PR_TRUE )
|
||||
gtk_widget_set_sensitive( entry, PR_FALSE );
|
||||
prOps->widgets.browseButton = button;
|
||||
|
||||
separator = gtk_hseparator_new ();
|
||||
gtk_box_pack_start (GTK_BOX (vbox), separator, PR_TRUE, PR_FALSE, 0);
|
||||
|
||||
table = gtk_table_new (2, 4, PR_FALSE);
|
||||
gtk_table_set_row_spacings (GTK_TABLE (table), 5);
|
||||
gtk_table_set_col_spacings (GTK_TABLE (table), 5);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (table), 10);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), table, PR_TRUE, PR_FALSE, 0);
|
||||
|
||||
label = gtk_label_new( "Print: " );
|
||||
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1,
|
||||
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
|
||||
button = gtk_radio_button_new_with_label (NULL, "First Page First");
|
||||
if ( prOps->prData->fpf == PR_TRUE )
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
|
||||
PR_TRUE);
|
||||
prOps->widgets.fpfToggle = button;
|
||||
gtk_table_attach (GTK_TABLE (table), button, 1, 2, 0, 1,
|
||||
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
|
||||
button = gtk_radio_button_new_with_label (
|
||||
gtk_radio_button_group (GTK_RADIO_BUTTON (button)),
|
||||
"Last Page First");
|
||||
if ( prOps->prData->fpf == PR_FALSE )
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
|
||||
PR_TRUE);
|
||||
gtk_table_attach (GTK_TABLE (table), button, 2, 3, 0, 1,
|
||||
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
|
||||
|
||||
label = gtk_label_new( "Print: " );
|
||||
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 2, 3,
|
||||
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
|
||||
button = gtk_radio_button_new_with_label (NULL, "Greyscale");
|
||||
prOps->widgets.greyToggle = button;
|
||||
if ( prOps->prData->grayscale == PR_TRUE )
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
|
||||
PR_TRUE);
|
||||
gtk_table_attach (GTK_TABLE (table), button, 1, 2, 2, 3,
|
||||
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
|
||||
button = gtk_radio_button_new_with_label (
|
||||
gtk_radio_button_group (GTK_RADIO_BUTTON (button)),
|
||||
"Color");
|
||||
if ( prOps->prData->grayscale == PR_FALSE )
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
|
||||
PR_TRUE);
|
||||
gtk_table_attach (GTK_TABLE (table), button, 2, 3, 2, 3,
|
||||
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
|
||||
|
||||
label = gtk_label_new( "Paper Size: " );
|
||||
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 3, 4,
|
||||
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
|
||||
button = gtk_radio_button_new_with_label (NULL,
|
||||
"Letter (8 1/2 x 11 in.)");
|
||||
prOps->widgets.letterToggle = button;
|
||||
if ( prOps->prData->size == NS_LETTER_SIZE )
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
|
||||
PR_TRUE);
|
||||
gtk_table_attach (GTK_TABLE (table), button, 1, 2, 3, 4,
|
||||
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
|
||||
button = gtk_radio_button_new_with_label (
|
||||
gtk_radio_button_group (GTK_RADIO_BUTTON (button)),
|
||||
"Legal (8 1/2 x 14 in.)");
|
||||
prOps->widgets.legalToggle = button;
|
||||
if ( prOps->prData->size == NS_LEGAL_SIZE )
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
|
||||
PR_TRUE);
|
||||
gtk_table_attach (GTK_TABLE (table), button, 2, 3, 3, 4,
|
||||
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
|
||||
|
||||
button = gtk_radio_button_new_with_label (
|
||||
gtk_radio_button_group (GTK_RADIO_BUTTON (button)),
|
||||
"Executive (7 1/2 x 10 in.)");
|
||||
prOps->widgets.execToggle = button;
|
||||
if ( prOps->prData->size == NS_EXECUTIVE_SIZE )
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
|
||||
PR_TRUE);
|
||||
gtk_table_attach (GTK_TABLE (table), button, 1, 2, 4, 5,
|
||||
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
|
||||
button = gtk_radio_button_new_with_label (
|
||||
gtk_radio_button_group (GTK_RADIO_BUTTON (button)),
|
||||
"A4 (210 x 297 mm)");
|
||||
if ( prOps->prData->size == NS_A4_SIZE )
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
|
||||
PR_TRUE);
|
||||
gtk_table_attach (GTK_TABLE (table), button, 2, 3, 4, 5,
|
||||
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
|
||||
|
||||
/* margins */
|
||||
|
||||
separator = gtk_hseparator_new ();
|
||||
gtk_box_pack_start (GTK_BOX (vbox), separator, PR_TRUE, PR_FALSE, 0);
|
||||
|
||||
hbox = gtk_hbox_new (PR_FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), hbox, PR_FALSE, PR_FALSE, 5);
|
||||
label = gtk_label_new( "Margins (inches):" );
|
||||
gtk_box_pack_start (GTK_BOX (hbox), label, PR_FALSE, PR_FALSE, 10);
|
||||
|
||||
table = gtk_table_new (1, 2, PR_FALSE);
|
||||
gtk_table_set_row_spacings (GTK_TABLE (table), 5);
|
||||
gtk_table_set_col_spacings (GTK_TABLE (table), 5);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (table), 10);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), table, PR_TRUE, PR_FALSE, 0);
|
||||
hbox = gtk_hbox_new (PR_FALSE, 0);
|
||||
gtk_table_attach (GTK_TABLE (table), hbox, 0, 1, 0, 1,
|
||||
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
|
||||
label = gtk_label_new( "Top: " );
|
||||
gtk_box_pack_start (GTK_BOX (hbox), label, PR_TRUE, PR_FALSE, 0);
|
||||
adj = (GtkAdjustment *) gtk_adjustment_new (1.0, 0.0, 999.0,
|
||||
0.25, 1.0, 0.0);
|
||||
prOps->widgets.topSpinner = spinner1 =
|
||||
gtk_spin_button_new (adj, 1.0, 2);
|
||||
gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spinner1), TRUE);
|
||||
gtk_widget_set_usize (spinner1, 60, 0);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), spinner1, FALSE, TRUE, 0);
|
||||
|
||||
label = gtk_label_new( "Bottom: " );
|
||||
gtk_box_pack_start (GTK_BOX (hbox), label, PR_TRUE, PR_FALSE, 0);
|
||||
adj = (GtkAdjustment *) gtk_adjustment_new (1.0, 0.0, 999.0,
|
||||
0.25, 1.0, 0.0);
|
||||
prOps->widgets.bottomSpinner = spinner1 =
|
||||
gtk_spin_button_new (adj, 1.0, 2);
|
||||
gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spinner1), TRUE);
|
||||
gtk_widget_set_usize (spinner1, 60, 0);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), spinner1, FALSE, TRUE, 0);
|
||||
|
||||
hbox = gtk_hbox_new (PR_FALSE, 0);
|
||||
gtk_table_attach (GTK_TABLE (table), hbox, 1, 2, 0, 1,
|
||||
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
|
||||
|
||||
label = gtk_label_new( "Left: " );
|
||||
gtk_box_pack_start (GTK_BOX (hbox), label, PR_TRUE, PR_FALSE, 0);
|
||||
adj = (GtkAdjustment *) gtk_adjustment_new (0.75, 0.0, 999.0,
|
||||
0.25, 1.0, 0.0);
|
||||
prOps->widgets.leftSpinner = spinner1 =
|
||||
gtk_spin_button_new (adj, 1.0, 2);
|
||||
gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spinner1), TRUE);
|
||||
gtk_widget_set_usize (spinner1, 60, 0);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), spinner1, FALSE, TRUE, 0);
|
||||
|
||||
label = gtk_label_new( "Right: " );
|
||||
gtk_box_pack_start (GTK_BOX (hbox), label, PR_TRUE, PR_FALSE, 0);
|
||||
adj = (GtkAdjustment *) gtk_adjustment_new (0.75, 0.0, 999.0,
|
||||
0.25, 1.0, 0.0);
|
||||
prOps->widgets.rightSpinner = spinner1 =
|
||||
gtk_spin_button_new (adj, 1.0, 2);
|
||||
gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spinner1), TRUE);
|
||||
gtk_widget_set_usize (spinner1, 60, 0);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), spinner1, FALSE, TRUE, 0);
|
||||
|
||||
separator = gtk_hseparator_new ();
|
||||
gtk_box_pack_start (GTK_BOX (vbox), separator, PR_TRUE, PR_FALSE, 0);
|
||||
|
||||
hbox = gtk_hbox_new (PR_FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), hbox, PR_TRUE, PR_FALSE, 5);
|
||||
button = gtk_button_new_with_label ("Print");
|
||||
gtk_signal_connect (GTK_OBJECT (button), "clicked",
|
||||
GTK_SIGNAL_FUNC (DoPrint), prOps );
|
||||
gtk_box_pack_start (GTK_BOX (hbox), button, PR_TRUE, PR_FALSE, 0);
|
||||
|
||||
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
|
||||
gtk_widget_grab_default (button);
|
||||
|
||||
button = gtk_button_new_with_label ("Cancel");
|
||||
gtk_signal_connect (GTK_OBJECT (button), "clicked",
|
||||
GTK_SIGNAL_FUNC ( CancelPrint ), prOps);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), button, PR_TRUE, PR_FALSE, 0);
|
||||
|
||||
/* Do this here, otherwise, upon creation the callbacks will be
|
||||
triggered and the widgets these callbacks set sensitivity on
|
||||
do not exist yet */
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (prButton), "clicked",
|
||||
GTK_SIGNAL_FUNC (SwitchToPrinter), prOps);
|
||||
gtk_signal_connect (GTK_OBJECT (fileButton), "clicked",
|
||||
GTK_SIGNAL_FUNC (SwitchToFile), prOps);
|
||||
|
||||
gtk_widget_show_all( dialog );
|
||||
gtk_main ();
|
||||
}
|
||||
|
||||
/* public interface to print dialog. Caller passes in preferences using
|
||||
argument, we return any changes and indication of whether to print
|
||||
or cancel. */
|
||||
|
||||
void
|
||||
UnixPrDialog( UnixPrData *prData )
|
||||
{
|
||||
static UnixPrOps prOps;
|
||||
|
||||
prOps.prData = prData;
|
||||
DoPrintGTK( (GtkWidget *) NULL, &prOps );
|
||||
}
|
||||
|
||||
60
mozilla/gfx/src/gtk/nsPrintdGTK.h
Normal file
60
mozilla/gfx/src/gtk/nsPrintdGTK.h
Normal file
@@ -0,0 +1,60 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/* Original Code: Syd Logan (syd@netscape.com) 3/12/99 */
|
||||
|
||||
#ifndef nsPrintdGTK_h___
|
||||
#define nsPrintdGTK_h___
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
PR_BEGIN_EXTERN_C
|
||||
|
||||
/* stolen from nsPostScriptObj.h. needs to be put somewhere else that
|
||||
both ps and gtk can see easily */
|
||||
|
||||
#ifndef NS_LEGAL_SIZE
|
||||
#define NS_LETTER_SIZE 0
|
||||
#define NS_LEGAL_SIZE 1
|
||||
#define NS_EXECUTIVE_SIZE 2
|
||||
#define NS_A4_SIZE 3
|
||||
#endif
|
||||
|
||||
#ifndef PATH_MAX
|
||||
#define PATH_MAX _POSIX_PATH_MAX
|
||||
#endif
|
||||
|
||||
typedef struct unixprdata {
|
||||
PRBool toPrinter; /* If PR_TRUE, print to printer */
|
||||
PRBool fpf; /* If PR_TRUE, first page first */
|
||||
PRBool grayscale; /* If PR_TRUE, print grayscale */
|
||||
int size; /* Paper size e.g., SizeLetter */
|
||||
char command[ PATH_MAX ]; /* Print command e.g., lpr */
|
||||
char path[ PATH_MAX ]; /* If toPrinter = PR_FALSE, dest file */
|
||||
PRBool cancel; /* If PR_TRUE, user cancelled */
|
||||
float left; /* left margin */
|
||||
float right; /* right margin */
|
||||
float top; /* top margin */
|
||||
float bottom; /* bottom margin */
|
||||
} UnixPrData;
|
||||
|
||||
void UnixPrDialog(UnixPrData *prData);
|
||||
|
||||
PR_END_EXTERN_C
|
||||
|
||||
#endif /* nsPrintdGTK_h___ */
|
||||
302
mozilla/gfx/src/gtk/nsRegionGTK.cpp
Normal file
302
mozilla/gfx/src/gtk/nsRegionGTK.cpp
Normal file
@@ -0,0 +1,302 @@
|
||||
/* -*- 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 <gtk/gtk.h>
|
||||
#include <gdk/gdkprivate.h>
|
||||
#include "nsRegionGTK.h"
|
||||
#include "xregion.h"
|
||||
#include "prmem.h"
|
||||
|
||||
static NS_DEFINE_IID(kRegionIID, NS_IREGION_IID);
|
||||
|
||||
nsRegionGTK::nsRegionGTK()
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
|
||||
mRegion = nsnull;
|
||||
mRegionType = eRegionComplexity_empty;
|
||||
}
|
||||
|
||||
nsRegionGTK::~nsRegionGTK()
|
||||
{
|
||||
if (mRegion)
|
||||
::gdk_region_destroy(mRegion);
|
||||
mRegion = nsnull;
|
||||
}
|
||||
|
||||
NS_IMPL_QUERY_INTERFACE(nsRegionGTK, kRegionIID)
|
||||
NS_IMPL_ADDREF(nsRegionGTK)
|
||||
NS_IMPL_RELEASE(nsRegionGTK)
|
||||
|
||||
nsresult nsRegionGTK::Init(void)
|
||||
{
|
||||
NS_ADDREF_THIS();
|
||||
mRegion = ::gdk_region_new();
|
||||
mRegionType = eRegionComplexity_empty;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void nsRegionGTK::SetTo(const nsIRegion &aRegion)
|
||||
{
|
||||
nsRegionGTK * pRegion = (nsRegionGTK *)&aRegion;
|
||||
|
||||
SetRegionEmpty();
|
||||
|
||||
GdkRegion *nRegion = ::gdk_regions_union(mRegion, pRegion->mRegion);
|
||||
::gdk_region_destroy(mRegion);
|
||||
mRegion = nRegion;
|
||||
}
|
||||
|
||||
void nsRegionGTK::SetTo(const nsRegionGTK *aRegion)
|
||||
{
|
||||
SetRegionEmpty();
|
||||
|
||||
GdkRegion *nRegion = ::gdk_regions_union(mRegion, aRegion->mRegion);
|
||||
::gdk_region_destroy(mRegion);
|
||||
mRegion = nRegion;
|
||||
}
|
||||
|
||||
void nsRegionGTK::SetTo(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight)
|
||||
{
|
||||
SetRegionEmpty();
|
||||
|
||||
GdkRectangle grect;
|
||||
|
||||
grect.x = aX;
|
||||
grect.y = aY;
|
||||
grect.width = aWidth;
|
||||
grect.height = aHeight;
|
||||
|
||||
GdkRegion *nRegion = ::gdk_region_union_with_rect(mRegion, &grect);
|
||||
::gdk_region_destroy(mRegion);
|
||||
mRegion = nRegion;
|
||||
}
|
||||
|
||||
void nsRegionGTK::Intersect(const nsIRegion &aRegion)
|
||||
{
|
||||
nsRegionGTK * pRegion = (nsRegionGTK *)&aRegion;
|
||||
|
||||
GdkRegion *nRegion = ::gdk_regions_intersect(mRegion, pRegion->mRegion);
|
||||
::gdk_region_destroy(mRegion);
|
||||
mRegion = nRegion;
|
||||
}
|
||||
|
||||
void nsRegionGTK::Intersect(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight)
|
||||
{
|
||||
GdkRegion *tRegion = CreateRectRegion(aX, aY, aWidth, aHeight);
|
||||
|
||||
GdkRegion *nRegion = ::gdk_regions_intersect(mRegion, tRegion);
|
||||
::gdk_region_destroy(tRegion);
|
||||
::gdk_region_destroy(mRegion);
|
||||
mRegion = nRegion;
|
||||
}
|
||||
|
||||
void nsRegionGTK::Union(const nsIRegion &aRegion)
|
||||
{
|
||||
nsRegionGTK * pRegion = (nsRegionGTK *)&aRegion;
|
||||
|
||||
GdkRegion *nRegion = ::gdk_regions_union(mRegion, pRegion->mRegion);
|
||||
::gdk_region_destroy(mRegion);
|
||||
mRegion = nRegion;
|
||||
}
|
||||
|
||||
void nsRegionGTK::Union(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight)
|
||||
{
|
||||
GdkRegion *tRegion = CreateRectRegion(aX, aY, aWidth, aHeight);
|
||||
|
||||
GdkRegion *nRegion = ::gdk_regions_union(mRegion, tRegion);
|
||||
::gdk_region_destroy(mRegion);
|
||||
::gdk_region_destroy(tRegion);
|
||||
mRegion = nRegion;
|
||||
}
|
||||
|
||||
void nsRegionGTK::Subtract(const nsIRegion &aRegion)
|
||||
{
|
||||
nsRegionGTK * pRegion = (nsRegionGTK *)&aRegion;
|
||||
|
||||
GdkRegion *nRegion = ::gdk_regions_subtract(mRegion, pRegion->mRegion);
|
||||
::gdk_region_destroy(mRegion);
|
||||
mRegion = nRegion;
|
||||
}
|
||||
|
||||
void nsRegionGTK::Subtract(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight)
|
||||
{
|
||||
GdkRegion *tRegion = CreateRectRegion(aX, aY, aWidth, aHeight);
|
||||
|
||||
GdkRegion *nRegion = ::gdk_regions_subtract(mRegion, tRegion);
|
||||
::gdk_region_destroy(mRegion);
|
||||
::gdk_region_destroy(tRegion);
|
||||
mRegion = nRegion;
|
||||
}
|
||||
|
||||
PRBool nsRegionGTK::IsEmpty(void)
|
||||
{
|
||||
return (::gdk_region_empty(mRegion));
|
||||
}
|
||||
|
||||
PRBool nsRegionGTK::IsEqual(const nsIRegion &aRegion)
|
||||
{
|
||||
nsRegionGTK *pRegion = (nsRegionGTK *)&aRegion;
|
||||
|
||||
return(::gdk_region_equal(mRegion, pRegion->mRegion));
|
||||
|
||||
}
|
||||
|
||||
void nsRegionGTK::GetBoundingBox(PRInt32 *aX, PRInt32 *aY, PRInt32 *aWidth, PRInt32 *aHeight)
|
||||
{
|
||||
GdkRectangle rect;
|
||||
|
||||
::gdk_region_get_clipbox(mRegion, &rect);
|
||||
|
||||
*aX = rect.x;
|
||||
*aY = rect.y;
|
||||
*aWidth = rect.width;
|
||||
*aHeight = rect.height;
|
||||
}
|
||||
|
||||
void nsRegionGTK::Offset(PRInt32 aXOffset, PRInt32 aYOffset)
|
||||
{
|
||||
::gdk_region_offset(mRegion, aXOffset, aYOffset);
|
||||
}
|
||||
|
||||
PRBool nsRegionGTK::ContainsRect(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight)
|
||||
{
|
||||
GdkOverlapType containment;
|
||||
GdkRectangle rect;
|
||||
|
||||
rect.x = aX;
|
||||
rect.y = aY;
|
||||
rect.width = aWidth;
|
||||
rect.height = aHeight;
|
||||
|
||||
containment = ::gdk_region_rect_in(mRegion, &rect);
|
||||
|
||||
if (containment != GDK_OVERLAP_RECTANGLE_OUT)
|
||||
return PR_TRUE;
|
||||
else
|
||||
return PR_FALSE;
|
||||
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsRegionGTK::GetRects(nsRegionRectSet **aRects)
|
||||
{
|
||||
nsRegionRectSet *rects;
|
||||
GdkRegionPrivate *priv = (GdkRegionPrivate *)mRegion;
|
||||
Region pRegion = priv->xregion;
|
||||
int nbox;
|
||||
BOX *pbox;
|
||||
nsRegionRect *rect;
|
||||
|
||||
NS_ASSERTION(!(nsnull == aRects), "bad ptr");
|
||||
|
||||
//code lifted from old xfe. MMP
|
||||
|
||||
pbox = pRegion->rects;
|
||||
nbox = pRegion->numRects;
|
||||
|
||||
rects = *aRects;
|
||||
|
||||
if ((nsnull == rects) || (rects->mRectsLen < (PRUint32)nbox))
|
||||
{
|
||||
void *buf = PR_Realloc(rects, sizeof(nsRegionRectSet) + (sizeof(nsRegionRect) * (nbox - 1)));
|
||||
|
||||
if (nsnull == buf)
|
||||
{
|
||||
if (nsnull != rects)
|
||||
rects->mNumRects = 0;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
rects = (nsRegionRectSet *)buf;
|
||||
rects->mRectsLen = nbox;
|
||||
}
|
||||
|
||||
rects->mNumRects = nbox;
|
||||
rects->mArea = 0;
|
||||
rect = &rects->mRects[0];
|
||||
|
||||
while (nbox--)
|
||||
{
|
||||
rect->x = pbox->x1;
|
||||
rect->width = (pbox->x2 - pbox->x1);
|
||||
rect->y = pbox->y1;
|
||||
rect->height = (pbox->y2 - pbox->y1);
|
||||
|
||||
rects->mArea += rect->width * rect->height;
|
||||
|
||||
pbox++;
|
||||
rect++;
|
||||
}
|
||||
|
||||
*aRects = rects;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsRegionGTK::FreeRects(nsRegionRectSet *aRects)
|
||||
{
|
||||
if (nsnull != aRects)
|
||||
PR_Free((void *)aRects);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsRegionGTK::GetNativeRegion(void *&aRegion) const
|
||||
{
|
||||
aRegion = (void *)mRegion;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsRegionGTK::GetRegionComplexity(nsRegionComplexity &aComplexity) const
|
||||
{
|
||||
// cast to avoid const-ness problems on some compilers
|
||||
if (((nsRegionGTK*)this)->IsEmpty())
|
||||
aComplexity = eRegionComplexity_empty;
|
||||
else
|
||||
aComplexity = eRegionComplexity_complex;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void nsRegionGTK::SetRegionEmpty()
|
||||
{
|
||||
if (!IsEmpty()) {
|
||||
::gdk_region_destroy(mRegion);
|
||||
mRegion = ::gdk_region_new();
|
||||
}
|
||||
}
|
||||
|
||||
GdkRegion *nsRegionGTK::CreateRectRegion(PRInt32 aX,
|
||||
PRInt32 aY,
|
||||
PRInt32 aWidth,
|
||||
PRInt32 aHeight)
|
||||
{
|
||||
GdkRegion *tRegion = ::gdk_region_new();
|
||||
GdkRectangle rect;
|
||||
|
||||
rect.x = aX;
|
||||
rect.y = aY;
|
||||
rect.width = aWidth;
|
||||
rect.height = aHeight;
|
||||
|
||||
GdkRegion *rRegion = ::gdk_region_union_with_rect(tRegion, &rect);
|
||||
::gdk_region_destroy(tRegion);
|
||||
|
||||
return (rRegion);
|
||||
}
|
||||
63
mozilla/gfx/src/gtk/nsRegionGTK.h
Normal file
63
mozilla/gfx/src/gtk/nsRegionGTK.h
Normal file
@@ -0,0 +1,63 @@
|
||||
/* -*- 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 nsRegionGTK_h___
|
||||
#define nsRegionGTK_h___
|
||||
|
||||
#include "nsIRegion.h"
|
||||
|
||||
class nsRegionGTK : public nsIRegion
|
||||
{
|
||||
public:
|
||||
nsRegionGTK();
|
||||
virtual ~nsRegionGTK();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
virtual nsresult Init();
|
||||
|
||||
virtual void SetTo(const nsIRegion &aRegion);
|
||||
virtual void SetTo(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight);
|
||||
void SetTo(const nsRegionGTK *aRegion);
|
||||
virtual void Intersect(const nsIRegion &aRegion);
|
||||
virtual void Intersect(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight);
|
||||
virtual void Union(const nsIRegion &aRegion);
|
||||
virtual void Union(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight);
|
||||
virtual void Subtract(const nsIRegion &aRegion);
|
||||
virtual void Subtract(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight);
|
||||
virtual PRBool IsEmpty(void);
|
||||
virtual PRBool IsEqual(const nsIRegion &aRegion);
|
||||
virtual void GetBoundingBox(PRInt32 *aX, PRInt32 *aY, PRInt32 *aWidth, PRInt32 *aHeight);
|
||||
virtual void Offset(PRInt32 aXOffset, PRInt32 aYOffset);
|
||||
virtual PRBool ContainsRect(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight);
|
||||
NS_IMETHOD GetRects(nsRegionRectSet **aRects);
|
||||
NS_IMETHOD FreeRects(nsRegionRectSet *aRects);
|
||||
NS_IMETHOD GetNativeRegion(void *&aRegion) const;
|
||||
NS_IMETHOD GetRegionComplexity(nsRegionComplexity &aComplexity) const;
|
||||
|
||||
GdkRegion *CreateRectRegion(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight);
|
||||
|
||||
private:
|
||||
GdkRegion *mRegion;
|
||||
nsRegionComplexity mRegionType;
|
||||
|
||||
virtual void SetRegionEmpty();
|
||||
|
||||
};
|
||||
|
||||
#endif // nsRegionGTK_h___
|
||||
1463
mozilla/gfx/src/gtk/nsRenderingContextGTK.cpp
Normal file
1463
mozilla/gfx/src/gtk/nsRenderingContextGTK.cpp
Normal file
File diff suppressed because it is too large
Load Diff
173
mozilla/gfx/src/gtk/nsRenderingContextGTK.h
Normal file
173
mozilla/gfx/src/gtk/nsRenderingContextGTK.h
Normal file
@@ -0,0 +1,173 @@
|
||||
/* -*- 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 nsRenderingContextGTK_h___
|
||||
#define nsRenderingContextGTK_h___
|
||||
|
||||
#include "nsIRenderingContext.h"
|
||||
#include "nsUnitConversion.h"
|
||||
#include "nsFont.h"
|
||||
#include "nsIFontMetrics.h"
|
||||
#include "nsPoint.h"
|
||||
#include "nsString.h"
|
||||
#include "nsCRT.h"
|
||||
#include "nsTransform2D.h"
|
||||
#include "nsIViewManager.h"
|
||||
#include "nsIWidget.h"
|
||||
#include "nsRect.h"
|
||||
#include "nsImageGTK.h"
|
||||
#include "nsIDeviceContext.h"
|
||||
#include "nsVoidArray.h"
|
||||
|
||||
#include "nsDrawingSurfaceGTK.h"
|
||||
#include "nsRegionGTK.h"
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
class nsRenderingContextGTK : public nsIRenderingContext
|
||||
{
|
||||
public:
|
||||
nsRenderingContextGTK();
|
||||
virtual ~nsRenderingContextGTK();
|
||||
|
||||
NS_DECL_AND_IMPL_ZEROING_OPERATOR_NEW
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
NS_IMETHOD Init(nsIDeviceContext* aContext, nsIWidget *aWindow);
|
||||
NS_IMETHOD Init(nsIDeviceContext* aContext, nsDrawingSurface aSurface);
|
||||
|
||||
NS_IMETHOD Reset(void);
|
||||
|
||||
NS_IMETHOD GetDeviceContext(nsIDeviceContext *&aContext);
|
||||
|
||||
NS_IMETHOD LockDrawingSurface(PRInt32 aX, PRInt32 aY, PRUint32 aWidth, PRUint32 aHeight,
|
||||
void **aBits, PRInt32 *aStride, PRInt32 *aWidthBytes,
|
||||
PRUint32 aFlags);
|
||||
NS_IMETHOD UnlockDrawingSurface(void);
|
||||
|
||||
NS_IMETHOD SelectOffScreenDrawingSurface(nsDrawingSurface aSurface);
|
||||
NS_IMETHOD GetDrawingSurface(nsDrawingSurface *aSurface);
|
||||
NS_IMETHOD GetHints(PRUint32& aResult);
|
||||
|
||||
NS_IMETHOD PushState(void);
|
||||
NS_IMETHOD PopState(PRBool &aClipEmpty);
|
||||
|
||||
NS_IMETHOD IsVisibleRect(const nsRect& aRect, PRBool &aVisible);
|
||||
|
||||
NS_IMETHOD SetClipRect(const nsRect& aRect, nsClipCombine aCombine, PRBool &aClipEmpty);
|
||||
NS_IMETHOD GetClipRect(nsRect &aRect, PRBool &aClipValid);
|
||||
NS_IMETHOD SetClipRegion(const nsIRegion& aRegion, nsClipCombine aCombine, PRBool &aClipEmpty);
|
||||
NS_IMETHOD GetClipRegion(nsIRegion **aRegion);
|
||||
|
||||
NS_IMETHOD SetLineStyle(nsLineStyle aLineStyle);
|
||||
NS_IMETHOD GetLineStyle(nsLineStyle &aLineStyle);
|
||||
|
||||
NS_IMETHOD SetColor(nscolor aColor);
|
||||
NS_IMETHOD GetColor(nscolor &aColor) const;
|
||||
|
||||
NS_IMETHOD SetFont(const nsFont& aFont);
|
||||
NS_IMETHOD SetFont(nsIFontMetrics *aFontMetrics);
|
||||
|
||||
NS_IMETHOD GetFontMetrics(nsIFontMetrics *&aFontMetrics);
|
||||
|
||||
NS_IMETHOD Translate(nscoord aX, nscoord aY);
|
||||
NS_IMETHOD Scale(float aSx, float aSy);
|
||||
NS_IMETHOD GetCurrentTransform(nsTransform2D *&aTransform);
|
||||
|
||||
NS_IMETHOD CreateDrawingSurface(nsRect *aBounds, PRUint32 aSurfFlags, nsDrawingSurface &aSurface);
|
||||
NS_IMETHOD DestroyDrawingSurface(nsDrawingSurface aDS);
|
||||
|
||||
NS_IMETHOD DrawLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1);
|
||||
NS_IMETHOD DrawPolyline(const nsPoint aPoints[], PRInt32 aNumPoints);
|
||||
|
||||
NS_IMETHOD DrawRect(const nsRect& aRect);
|
||||
NS_IMETHOD DrawRect(nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight);
|
||||
NS_IMETHOD FillRect(const nsRect& aRect);
|
||||
NS_IMETHOD FillRect(nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight);
|
||||
|
||||
NS_IMETHOD DrawPolygon(const nsPoint aPoints[], PRInt32 aNumPoints);
|
||||
NS_IMETHOD FillPolygon(const nsPoint aPoints[], PRInt32 aNumPoints);
|
||||
|
||||
NS_IMETHOD DrawEllipse(const nsRect& aRect);
|
||||
NS_IMETHOD DrawEllipse(nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight);
|
||||
NS_IMETHOD FillEllipse(const nsRect& aRect);
|
||||
NS_IMETHOD FillEllipse(nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight);
|
||||
|
||||
NS_IMETHOD DrawArc(const nsRect& aRect,
|
||||
float aStartAngle, float aEndAngle);
|
||||
NS_IMETHOD DrawArc(nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight,
|
||||
float aStartAngle, float aEndAngle);
|
||||
NS_IMETHOD FillArc(const nsRect& aRect,
|
||||
float aStartAngle, float aEndAngle);
|
||||
NS_IMETHOD FillArc(nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight,
|
||||
float aStartAngle, float aEndAngle);
|
||||
|
||||
NS_IMETHOD GetWidth(char aC, nscoord &aWidth);
|
||||
NS_IMETHOD GetWidth(PRUnichar aC, nscoord &aWidth,
|
||||
PRInt32 *aFontID);
|
||||
NS_IMETHOD GetWidth(const nsString& aString, nscoord &aWidth,
|
||||
PRInt32 *aFontID);
|
||||
NS_IMETHOD GetWidth(const char *aString, nscoord &aWidth);
|
||||
NS_IMETHOD GetWidth(const char *aString, PRUint32 aLength, nscoord &aWidth);
|
||||
NS_IMETHOD GetWidth(const PRUnichar *aString, PRUint32 aLength, nscoord &aWidth,
|
||||
PRInt32 *aFontID);
|
||||
|
||||
NS_IMETHOD DrawString(const char *aString, PRUint32 aLength,
|
||||
nscoord aX, nscoord aY,
|
||||
const nscoord* aSpacing);
|
||||
NS_IMETHOD DrawString(const PRUnichar *aString, PRUint32 aLength,
|
||||
nscoord aX, nscoord aY,
|
||||
PRInt32 aFontID,
|
||||
const nscoord* aSpacing);
|
||||
NS_IMETHOD DrawString(const nsString& aString, nscoord aX, nscoord aY,
|
||||
PRInt32 aFontID,
|
||||
const nscoord* aSpacing);
|
||||
|
||||
NS_IMETHOD DrawImage(nsIImage *aImage, nscoord aX, nscoord aY);
|
||||
NS_IMETHOD DrawImage(nsIImage *aImage, nscoord aX, nscoord aY,
|
||||
nscoord aWidth, nscoord aHeight);
|
||||
NS_IMETHOD DrawImage(nsIImage *aImage, const nsRect& aRect);
|
||||
NS_IMETHOD DrawImage(nsIImage *aImage, const nsRect& aSRect, const nsRect& aDRect);
|
||||
|
||||
NS_IMETHOD CopyOffScreenBits(nsDrawingSurface aSrcSurf, PRInt32 aSrcX, PRInt32 aSrcY,
|
||||
const nsRect &aDestBounds, PRUint32 aCopyFlags);
|
||||
|
||||
//locals
|
||||
NS_IMETHOD CommonInit();
|
||||
|
||||
protected:
|
||||
nsDrawingSurfaceGTK *mOffscreenSurface;
|
||||
nsDrawingSurfaceGTK *mSurface;
|
||||
nsIDeviceContext *mContext;
|
||||
nsIFontMetrics *mFontMetrics;
|
||||
nsRegionGTK *mClipRegion;
|
||||
nsTransform2D *mTMatrix;
|
||||
float mP2T;
|
||||
GdkWChar* mDrawStringBuf;
|
||||
PRUint32 mDrawStringSize;
|
||||
|
||||
// graphic state stack (GraphicsState)
|
||||
nsVoidArray *mStateCache;
|
||||
|
||||
nscolor mCurrentColor;
|
||||
GdkFont *mCurrentFont;
|
||||
nsLineStyle mCurrentLineStyle;
|
||||
};
|
||||
|
||||
#endif /* nsRenderingContextGTK_h___ */
|
||||
8196
mozilla/gfx/src/gtk/u2j208.h
Normal file
8196
mozilla/gfx/src/gtk/u2j208.h
Normal file
File diff suppressed because it is too large
Load Diff
177
mozilla/gfx/src/gtk/xregion.h
Normal file
177
mozilla/gfx/src/gtk/xregion.h
Normal file
@@ -0,0 +1,177 @@
|
||||
/* $XConsortium: region.h,v 11.13 91/09/10 08:21:49 rws Exp $ */
|
||||
/************************************************************************
|
||||
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
|
||||
and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
|
||||
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify, and distribute this software and its
|
||||
documentation for any purpose and without fee is hereby granted,
|
||||
provided that the above copyright notice appear in all copies and that
|
||||
both that copyright notice and this permission notice appear in
|
||||
supporting documentation, and that the names of Digital or MIT not be
|
||||
used in advertising or publicity pertaining to distribution of the
|
||||
software without specific, written prior permission.
|
||||
|
||||
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
||||
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
||||
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
|
||||
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
||||
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
||||
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
||||
SOFTWARE.
|
||||
|
||||
************************************************************************/
|
||||
|
||||
#ifndef _XREGION_H
|
||||
#define _XREGION_H
|
||||
|
||||
typedef struct {
|
||||
short x1, x2, y1, y2;
|
||||
} Box, BOX, BoxRec, *BoxPtr;
|
||||
|
||||
typedef struct {
|
||||
short x, y, width, height;
|
||||
}RECTANGLE, RectangleRec, *RectanglePtr;
|
||||
|
||||
#ifdef TRUE
|
||||
#undef TRUE
|
||||
#endif
|
||||
|
||||
#define TRUE 1
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#endif
|
||||
#ifndef MAXSHORT
|
||||
#define MAXSHORT 32767
|
||||
#endif
|
||||
#ifndef MINSHORT
|
||||
#define MINSHORT -MAXSHORT
|
||||
#endif
|
||||
#ifndef MAX
|
||||
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
|
||||
#endif
|
||||
#ifndef MIN
|
||||
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* clip region
|
||||
*/
|
||||
|
||||
typedef struct _XRegion {
|
||||
long size;
|
||||
long numRects;
|
||||
BOX *rects;
|
||||
BOX extents;
|
||||
} REGION;
|
||||
|
||||
/* Xutil.h contains the declaration:
|
||||
* typedef struct _XRegion *Region;
|
||||
*/
|
||||
|
||||
/* 1 if two BOXs overlap.
|
||||
* 0 if two BOXs do not overlap.
|
||||
* Remember, x2 and y2 are not in the region
|
||||
*/
|
||||
#define EXTENTCHECK(r1, r2) \
|
||||
((r1)->x2 > (r2)->x1 && \
|
||||
(r1)->x1 < (r2)->x2 && \
|
||||
(r1)->y2 > (r2)->y1 && \
|
||||
(r1)->y1 < (r2)->y2)
|
||||
|
||||
/*
|
||||
* update region extents
|
||||
*/
|
||||
#define EXTENTS(r,idRect){\
|
||||
if((r)->x1 < (idRect)->extents.x1)\
|
||||
(idRect)->extents.x1 = (r)->x1;\
|
||||
if((r)->y1 < (idRect)->extents.y1)\
|
||||
(idRect)->extents.y1 = (r)->y1;\
|
||||
if((r)->x2 > (idRect)->extents.x2)\
|
||||
(idRect)->extents.x2 = (r)->x2;\
|
||||
if((r)->y2 > (idRect)->extents.y2)\
|
||||
(idRect)->extents.y2 = (r)->y2;\
|
||||
}
|
||||
|
||||
/*
|
||||
* Check to see if there is enough memory in the present region.
|
||||
*/
|
||||
#define MEMCHECK(reg, rect, firstrect){\
|
||||
if ((reg)->numRects >= ((reg)->size - 1)){\
|
||||
(firstrect) = (BOX *) Xrealloc \
|
||||
((char *)(firstrect), (unsigned) (2 * (sizeof(BOX)) * ((reg)->size)));\
|
||||
if ((firstrect) == 0)\
|
||||
return(0);\
|
||||
(reg)->size *= 2;\
|
||||
(rect) = &(firstrect)[(reg)->numRects];\
|
||||
}\
|
||||
}
|
||||
|
||||
/* this routine checks to see if the previous rectangle is the same
|
||||
* or subsumes the new rectangle to add.
|
||||
*/
|
||||
|
||||
#define CHECK_PREVIOUS(Reg, R, Rx1, Ry1, Rx2, Ry2)\
|
||||
(!(((Reg)->numRects > 0)&&\
|
||||
((R-1)->y1 == (Ry1)) &&\
|
||||
((R-1)->y2 == (Ry2)) &&\
|
||||
((R-1)->x1 <= (Rx1)) &&\
|
||||
((R-1)->x2 >= (Rx2))))
|
||||
|
||||
/* add a rectangle to the given Region */
|
||||
#define ADDRECT(reg, r, rx1, ry1, rx2, ry2){\
|
||||
if (((rx1) < (rx2)) && ((ry1) < (ry2)) &&\
|
||||
CHECK_PREVIOUS((reg), (r), (rx1), (ry1), (rx2), (ry2))){\
|
||||
(r)->x1 = (rx1);\
|
||||
(r)->y1 = (ry1);\
|
||||
(r)->x2 = (rx2);\
|
||||
(r)->y2 = (ry2);\
|
||||
EXTENTS((r), (reg));\
|
||||
(reg)->numRects++;\
|
||||
(r)++;\
|
||||
}\
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* add a rectangle to the given Region */
|
||||
#define ADDRECTNOX(reg, r, rx1, ry1, rx2, ry2){\
|
||||
if ((rx1 < rx2) && (ry1 < ry2) &&\
|
||||
CHECK_PREVIOUS((reg), (r), (rx1), (ry1), (rx2), (ry2))){\
|
||||
(r)->x1 = (rx1);\
|
||||
(r)->y1 = (ry1);\
|
||||
(r)->x2 = (rx2);\
|
||||
(r)->y2 = (ry2);\
|
||||
(reg)->numRects++;\
|
||||
(r)++;\
|
||||
}\
|
||||
}
|
||||
|
||||
#define EMPTY_REGION(pReg) pReg->numRects = 0
|
||||
|
||||
#define REGION_NOT_EMPTY(pReg) pReg->numRects
|
||||
|
||||
#define INBOX(r, x, y) \
|
||||
( ( ((r).x2 > x)) && \
|
||||
( ((r).x1 <= x)) && \
|
||||
( ((r).y2 > y)) && \
|
||||
( ((r).y1 <= y)) )
|
||||
|
||||
/*
|
||||
* number of points to buffer before sending them off
|
||||
* to scanlines() : Must be an even number
|
||||
*/
|
||||
#define NUMPTSTOBUFFER 200
|
||||
|
||||
/*
|
||||
* used to allocate buffers for points and link
|
||||
* the buffers together
|
||||
*/
|
||||
typedef struct _POINTBLOCK {
|
||||
XPoint pts[NUMPTSTOBUFFER];
|
||||
struct _POINTBLOCK *next;
|
||||
} POINTBLOCK;
|
||||
|
||||
#endif
|
||||
@@ -1,28 +0,0 @@
|
||||
#
|
||||
# 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 = ../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
DIRS = public src prefs build resources
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
# 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.
|
||||
#
|
||||
|
||||
nsAbBaseCID.h
|
||||
@@ -1,49 +0,0 @@
|
||||
#!gmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
DEPTH=..\..\..
|
||||
MODULE=addrbook
|
||||
|
||||
################################################################################
|
||||
## exports
|
||||
|
||||
EXPORTS= \
|
||||
nsAbBaseCID.h \
|
||||
$(NULL)
|
||||
|
||||
################################################################################
|
||||
## library
|
||||
|
||||
LIBNAME = .\$(OBJDIR)\addrbook
|
||||
DLL = $(LIBNAME).dll
|
||||
|
||||
CPP_OBJS= \
|
||||
.\$(OBJDIR)\nsAbFactory.obj \
|
||||
$(NULL)
|
||||
|
||||
LLIBS= \
|
||||
$(DIST)\lib\xpcom.lib \
|
||||
$(DIST)\lib\addrbook_s.lib \
|
||||
$(LIBNSPR) \
|
||||
$(DIST)\lib\rdfutil_s.lib \
|
||||
$(NULL)
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
install:: $(DLL)
|
||||
$(MAKE_INSTALL) $(LIBNAME).$(DLL_SUFFIX) $(DIST)\bin\components
|
||||
$(MAKE_INSTALL) $(LIBNAME).$(LIB_SUFFIX) $(DIST)\lib
|
||||
@@ -1,154 +0,0 @@
|
||||
/* -*- 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 nsAbBaseCID_h__
|
||||
#define nsAbBaseCID_h__
|
||||
|
||||
#include "nsISupports.h"
|
||||
#include "nsIFactory.h"
|
||||
#include "nsIComponentManager.h"
|
||||
|
||||
//
|
||||
// nsAddressBook
|
||||
//
|
||||
#define NS_ADDRESSBOOK_PROGID \
|
||||
"component://netscape/addressbook"
|
||||
|
||||
#define NS_ADDRESSBOOK_CID \
|
||||
{ /* {D60B84F2-2A8C-11d3-9E07-00A0C92B5F0D} */ \
|
||||
0xd60b84f2, 0x2a8c, 0x11d3, \
|
||||
{ 0x9e, 0x7, 0x0, 0xa0, 0xc9, 0x2b, 0x5f, 0xd } \
|
||||
}
|
||||
|
||||
//
|
||||
// nsAbDirectoryDataSource
|
||||
//
|
||||
#define NS_ABDIRECTORYDATASOURCE_PROGID \
|
||||
NS_RDF_DATASOURCE_PROGID_PREFIX "addressdirectory"
|
||||
|
||||
#define NS_ABDIRECTORYDATASOURCE_CID \
|
||||
{ /* 0A79186D-F754-11d2-A2DA-001083003D0C */ \
|
||||
0xa79186d, 0xf754, 0x11d2, \
|
||||
{0xa2, 0xda, 0x0, 0x10, 0x83, 0x0, 0x3d, 0xc} \
|
||||
}
|
||||
|
||||
//
|
||||
// nsAbDirectory
|
||||
//
|
||||
#define NS_ABDIRECTORY_PROGID \
|
||||
NS_RDF_RESOURCE_FACTORY_PROGID_PREFIX "abdirectory"
|
||||
|
||||
#define NS_ABDIRECTORY_CID \
|
||||
{ /* {6C21831D-FCC2-11d2-A2E2-001083003D0C}*/ \
|
||||
0x6c21831d, 0xfcc2, 0x11d2, \
|
||||
{0xa2, 0xe2, 0x0, 0x10, 0x83, 0x0, 0x3d, 0xc} \
|
||||
}
|
||||
|
||||
//
|
||||
// nsAbCardDataSource
|
||||
//
|
||||
#define NS_ABCARDDATASOURCE_PROGID \
|
||||
NS_RDF_DATASOURCE_PROGID_PREFIX "addresscard"
|
||||
|
||||
#define NS_ABCARDDATASOURCE_CID \
|
||||
{ /* 1920E486-0709-11d3-A2EC-001083003D0C */ \
|
||||
0x1920e486, 0x709, 0x11d3, \
|
||||
{0xa2, 0xec, 0x0, 0x10, 0x83, 0x0, 0x3d, 0xc} \
|
||||
}
|
||||
|
||||
//
|
||||
// nsAbCard
|
||||
//
|
||||
#define NS_ABCARD_PROGID \
|
||||
NS_RDF_RESOURCE_FACTORY_PROGID_PREFIX "abcard"
|
||||
|
||||
#define NS_ABCARD_CID \
|
||||
{ /* {1920E487-0709-11d3-A2EC-001083003D0C}*/ \
|
||||
0x1920e487, 0x709, 0x11d3, \
|
||||
{0xa2, 0xec, 0x0, 0x10, 0x83, 0x0, 0x3d, 0xc} \
|
||||
}
|
||||
|
||||
//
|
||||
// nsAddressBookDB
|
||||
//
|
||||
#define NS_ADDRDATABASE_PROGID \
|
||||
"component://netscape/addressbook/carddatabase"
|
||||
|
||||
#define NS_ADDRDATABASE_CID \
|
||||
{ /* 63187917-1D19-11d3-A302-001083003D0C */ \
|
||||
0x63187917, 0x1d19, 0x11d3, \
|
||||
{0xa3, 0x2, 0x0, 0x10, 0x83, 0x0, 0x3d, 0xc} \
|
||||
}
|
||||
|
||||
//
|
||||
// nsAbCardProperty
|
||||
//
|
||||
#define NS_ABCARDPROPERTY_PROGID \
|
||||
"component://netscape/addressbook/cardproperty"
|
||||
#define NS_ABCARDPROPERTY_CID \
|
||||
{ /* 2B722171-2CEA-11d3-9E0B-00A0C92B5F0D */ \
|
||||
0x2b722171, 0x2cea, 0x11d3, \
|
||||
{0x9e, 0xb, 0x0, 0xa0, 0xc9, 0x2b, 0x5f, 0xd} \
|
||||
}
|
||||
|
||||
//
|
||||
// nsAddrBookSession
|
||||
//
|
||||
#define NS_ADDRBOOKSESSION_PROGID \
|
||||
"component://netscape/addressbook/services/session"
|
||||
|
||||
#define NS_ADDRBOOKSESSION_CID \
|
||||
{ /* C5339442-303F-11d3-9E13-00A0C92B5F0D */ \
|
||||
0xc5339442, 0x303f, 0x11d3, \
|
||||
{0x9e, 0x13, 0x0, 0xa0, 0xc9, 0x2b, 0x5f, 0xd} \
|
||||
}
|
||||
|
||||
//
|
||||
// nsAbDirProperty
|
||||
//
|
||||
#define NS_ABDIRPROPERTY_PROGID \
|
||||
"component://netscape/addressbook/directoryproperty"
|
||||
#define NS_ABDIRPROPERTY_CID \
|
||||
{ /* 6FD8EC67-3965-11d3-A316-001083003D0C */ \
|
||||
0x6fd8ec67, 0x3965, 0x11d3, \
|
||||
{0xa3, 0x16, 0x0, 0x10, 0x83, 0x0, 0x3d, 0xc} \
|
||||
}
|
||||
|
||||
//
|
||||
// nsAbAutoCompleteSession
|
||||
//
|
||||
#define NS_ABAUTOCOMPLETESESSION_PROGID \
|
||||
"component://netscape/messenger/autocomplete&type=addrbook"
|
||||
#define NS_ABAUTOCOMPLETESESSION_CID \
|
||||
{ /* 138DE9BD-362B-11d3-988E-001083010E9B */ \
|
||||
0x138de9bd, 0x362b, 0x11d3, \
|
||||
{0x98, 0x8e, 0x0, 0x10, 0x83, 0x1, 0xe, 0x9b} \
|
||||
}
|
||||
|
||||
//
|
||||
// nsAbAddressCollecter
|
||||
//
|
||||
#define NS_ABADDRESSCOLLECTER_PROGID \
|
||||
"component://netscape/addressbook/services/addressCollecter"
|
||||
#define NS_ABADDRESSCOLLECTER_CID \
|
||||
{ /* fe04c8e6-501e-11d3-a527-0060b0fc04b7 */ \
|
||||
0xfe04c8e6, 0x501e, 0x11d3, \
|
||||
{0xa5, 0x27, 0x0, 0x60, 0xb0, 0xfc, 0x4, 0xb7} \
|
||||
}
|
||||
|
||||
#endif // nsAbBaseCID_h__
|
||||
@@ -1,83 +0,0 @@
|
||||
/* -*- 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,1999 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#include "nsIFactory.h"
|
||||
#include "nsISupports.h"
|
||||
#include "nsIGenericFactory.h"
|
||||
#include "nsIModule.h"
|
||||
|
||||
#include "nsAbBaseCID.h"
|
||||
#include "pratom.h"
|
||||
#include "nsIComponentManager.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "rdf.h"
|
||||
#include "nsCRT.h"
|
||||
#include "nsCOMPtr.h"
|
||||
|
||||
|
||||
/* Include all of the interfaces our factory can generate components for */
|
||||
|
||||
#include "nsDirectoryDataSource.h"
|
||||
#include "nsCardDataSource.h"
|
||||
#include "nsAbDirectory.h"
|
||||
#include "nsAbCard.h"
|
||||
#include "nsAddrDatabase.h"
|
||||
#include "nsAddressBook.h"
|
||||
#include "nsAddrBookSession.h"
|
||||
#include "nsAbDirProperty.h"
|
||||
#include "nsAbAutoCompleteSession.h"
|
||||
#include "nsAbAddressCollecter.h"
|
||||
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAddressBook)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsAbDirectoryDataSource,Init)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAbDirectory)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsAbCardDataSource,Init)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAbCard)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAbCardProperty)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAddrDatabase)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAbDirProperty)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAddrBookSession)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAbAutoCompleteSession)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAbAddressCollecter)
|
||||
|
||||
struct components_t {
|
||||
nsCID cid;
|
||||
nsIGenericFactory::ConstructorProcPtr constructor;
|
||||
const char *progid;
|
||||
const char *description;
|
||||
};
|
||||
|
||||
static components_t components[] =
|
||||
{
|
||||
{ NS_ADDRESSBOOK_CID, &nsAddressBookConstructor, NS_ADDRESSBOOK_PROGID, },
|
||||
{ NS_ABDIRECTORYDATASOURCE_CID, &nsAbDirectoryDataSourceConstructor, NS_ABDIRECTORYDATASOURCE_PROGID, },
|
||||
{ NS_ABDIRECTORY_CID, &nsAbDirectoryConstructor, NS_ABDIRECTORY_PROGID, },
|
||||
{ NS_ABCARDDATASOURCE_CID, &nsAbCardDataSourceConstructor, NS_ABCARDDATASOURCE_PROGID, },
|
||||
{ NS_ABCARD_CID, &nsAbCardConstructor, NS_ABCARD_PROGID, },
|
||||
{ NS_ADDRDATABASE_CID, &nsAddrDatabaseConstructor, NS_ADDRDATABASE_PROGID, },
|
||||
{ NS_ABCARDPROPERTY_CID, &nsAbCardPropertyConstructor, NS_ABCARDPROPERTY_PROGID, },
|
||||
{ NS_ABDIRPROPERTY_CID, &nsAbDirPropertyConstructor, NS_ABDIRPROPERTY_PROGID, },
|
||||
{ NS_ADDRBOOKSESSION_CID, &nsAddrBookSessionConstructor, NS_ADDRBOOKSESSION_PROGID, },
|
||||
{ NS_ABAUTOCOMPLETESESSION_CID, &nsAbAutoCompleteSessionConstructor, NS_ABAUTOCOMPLETESESSION_PROGID, },
|
||||
{ NS_ABADDRESSCOLLECTER_CID, &nsAbAddressCollecterConstructor, NS_ABADDRESSCOLLECTER_PROGID, },
|
||||
|
||||
};
|
||||
|
||||
|
||||
NS_IMPL_MODULE(components)
|
||||
NS_IMPL_NSGETMODULE(nsModule)
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,21 +0,0 @@
|
||||
/* -*- 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 "MacPrefix.h"
|
||||
@@ -1,21 +0,0 @@
|
||||
/* -*- 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 "MacPrefix_debug.h"
|
||||
@@ -1,22 +0,0 @@
|
||||
#!nmake
|
||||
#
|
||||
# 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=..\..
|
||||
|
||||
DIRS=public src prefs build resources
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
@@ -1,28 +0,0 @@
|
||||
#
|
||||
# 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 = ../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
DIRS = resources
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
#!nmake
|
||||
#
|
||||
# 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=..\..\..
|
||||
|
||||
DIRS= resources
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
@@ -1,28 +0,0 @@
|
||||
#
|
||||
# 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 = ../../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
DIRS = content locale
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
# 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.
|
||||
#
|
||||
# This is a list of local files which get copied to the res\mailnews\messenger directory
|
||||
#
|
||||
|
||||
pref-addressing.xul
|
||||
@@ -1,37 +0,0 @@
|
||||
#
|
||||
# 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 = ../../../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
SAMPLES_DIR = $(DIST)/bin/chrome/addressbook/content/default
|
||||
|
||||
EXPORT_RESOURCE_SAMPLES = \
|
||||
pref-addressing.xul \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
GARBAGE += $(addprefix $(SAMPLES_DIR)/, $(EXPORT_RESOURCE_SAMPLES))
|
||||
|
||||
install::
|
||||
$(INSTALL) $(addprefix $(srcdir)/, $(EXPORT_RESOURCE_SAMPLES)) $(SAMPLES_DIR)
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
#!nmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
DEPTH=..\..\..\..\..
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
install::
|
||||
$(MAKE_INSTALL) pref-addressing.xul $(DIST)\bin\chrome\addressbook\content\default
|
||||
|
||||
clobber::
|
||||
rm -f $(DIST)\chrome\addressbook\content\default\pref-addressing.xul
|
||||
@@ -1,66 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="chrome://pref/skin/pref.css" type="text/css"?>
|
||||
|
||||
<!DOCTYPE window SYSTEM "chrome://addressbook/locale/pref-addressing.dtd">
|
||||
|
||||
<window xmlns:html="http://www.w3.org/TR/REC-html40"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
onload="StartUp('Mailnews-Main')" >
|
||||
|
||||
<html:script language="javascript" src="chrome://pref/content/PrefsWindow.js"/>
|
||||
|
||||
<html:div flex="100%">
|
||||
<html:div id="top">
|
||||
<html:span id="lefttext">&pane.title;</html:span>
|
||||
</html:div>
|
||||
|
||||
&pinpoint.label;
|
||||
<html:form>
|
||||
<html:table>
|
||||
<html:tr><html:td>&lookFor.label;</html:td></html:tr>
|
||||
<html:tr><html:td>
|
||||
<html:input type="checkbox"/>
|
||||
<html:label>&padCheck.label;</html:label>
|
||||
</html:td></html:tr>
|
||||
<html:tr><html:td>
|
||||
<html:input type="checkbox"/>
|
||||
<html:label>&dirCheck.label;</html:label>
|
||||
</html:td></html:tr>
|
||||
<html:tr><html:td>
|
||||
<html:select>
|
||||
<html:option>&nsbook.label;</html:option>
|
||||
</html:select>
|
||||
</html:td></html:tr>
|
||||
<html:tr><html:td>&mulFound.label;</html:td></html:tr>
|
||||
<html:tr><html:td>
|
||||
<html:input name="multilist" type="radio"/>
|
||||
<html:label>&showList.label;</html:label>
|
||||
</html:td></html:tr>
|
||||
<html:tr><html:td>
|
||||
<html:input name="multilist" type="radio"/>
|
||||
<html:label>&acceptList.label;</html:label>
|
||||
</html:td></html:tr>
|
||||
<html:tr><html:td>&oneMatch.label;</html:td></html:tr>
|
||||
<html:tr><html:td>
|
||||
<html:input type="checkbox"/>
|
||||
<html:label>&useAddress.label;</html:label>
|
||||
</html:td></html:tr>
|
||||
</html:table>
|
||||
</html:form>
|
||||
|
||||
&displayFullname.label;
|
||||
<html:form>
|
||||
<html:table>
|
||||
<html:tr><html:td>
|
||||
<html:input name="displayname" type="radio" id="pref:0:int:mail.addr_book.lastnamefirst" checked="true"/>
|
||||
<html:label>&useDisplayName.label;</html:label>
|
||||
</html:td></html:tr>
|
||||
<html:tr><html:td>
|
||||
<html:input name="displayname" type="radio" id="pref:1:int:mail.addr_book.lastnamefirst"/>
|
||||
<html:label>&useLastFirst.label;</html:label>
|
||||
</html:td></html:tr>
|
||||
</html:table>
|
||||
</html:form>
|
||||
|
||||
</html:div>
|
||||
</window>
|
||||
@@ -1,28 +0,0 @@
|
||||
#
|
||||
# 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 = ../../../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
DIRS = en-US
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
pref-addressing.dtd
|
||||
@@ -1,29 +0,0 @@
|
||||
#
|
||||
# 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 = ../../../../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
install::
|
||||
$(INSTALL) $(srcdir)/pref-addressing.dtd $(DIST)/bin/chrome/addressbook/locale/en-US
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
#!nmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
DEPTH=..\..\..\..\..\..
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
DISTBROWSER=$(DIST)\bin\chrome\addressbook\locale\en-US
|
||||
|
||||
|
||||
install::
|
||||
$(MAKE_INSTALL) pref-addressing.dtd $(DISTBROWSER)
|
||||
|
||||
clobber::
|
||||
rm -f $(DIST)\bin\chrome\addressbook\locale\en-US\pref-addressing.dtd
|
||||
@@ -1,35 +0,0 @@
|
||||
<!--
|
||||
The contents of this file are subject to the Netscape Public
|
||||
License Version 1.1 (the "License"); you may not use this file
|
||||
except in compliance with the License. You may obtain a copy of
|
||||
the License at http://www.mozilla.org/NPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS
|
||||
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
implied. See the License for the specific language governing
|
||||
rights and limitations under the License.
|
||||
|
||||
The Original Code is Mozilla Communicator client code, released
|
||||
March 31, 1998.
|
||||
|
||||
The Initial Developer of the Original Code is Netscape
|
||||
Communications Corporation. Portions created by Netscape are
|
||||
Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
||||
Rights Reserved.
|
||||
-->
|
||||
|
||||
<!ENTITY window.title "Addressing">
|
||||
<!ENTITY pane.title "Addressing">
|
||||
<!ENTITY pinpoint.label "Pinpoint Addressing">
|
||||
<!ENTITY lookFor.label "Look for addresses in the following">
|
||||
<!ENTITY padCheck.label "Address Books">
|
||||
<!ENTITY dirCheck.label "Directory Server">
|
||||
<!ENTITY nsbook.label "Netscape Phonebook">
|
||||
<!ENTITY mulFound.label "When there are multiple addresses found:">
|
||||
<!ENTITY showList.label "Show me a list of choices">
|
||||
<!ENTITY acceptList.label "Accept what I have typed">
|
||||
<!ENTITY oneMatch.label "If there is one match in your personal address books:">
|
||||
<!ENTITY useAddress.label "Use the address and do not search in the directory">
|
||||
<!ENTITY displayFullname.label "When displaying full names:">
|
||||
<!ENTITY useDisplayName.label "Show names using display name (from address book card)">
|
||||
<!ENTITY useLastFirst.label "Show names using last name, first name">
|
||||
@@ -1,22 +0,0 @@
|
||||
#!nmake
|
||||
#
|
||||
# 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=..\..\..\..\..
|
||||
|
||||
DIRS= en-US
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
@@ -1,22 +0,0 @@
|
||||
#!nmake
|
||||
#
|
||||
# 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=..\..\..\..
|
||||
|
||||
DIRS= content locale
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
@@ -1,18 +0,0 @@
|
||||
# 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.
|
||||
#
|
||||
# This is a list of local files which get copied to the mozilla:dist:mailnews directory
|
||||
#
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
#
|
||||
# This is a list of local files which get copied to the mozilla:dist:idl directory
|
||||
#
|
||||
|
||||
nsIAbAddressCollecter.idl
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
#
|
||||
# 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 = ../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MODULE = addrbook
|
||||
|
||||
XPIDLSRCS = \
|
||||
nsIAbListener.idl \
|
||||
nsIAbDirectory.idl \
|
||||
nsIAbCard.idl \
|
||||
nsIAddrDBAnnouncer.idl \
|
||||
nsIAddrDBListener.idl \
|
||||
nsIAddrDatabase.idl \
|
||||
nsIAddressBook.idl \
|
||||
nsIAbBase.idl \
|
||||
nsIAddrBookSession.idl \
|
||||
nsIAutoCompleteListener.idl \
|
||||
nsIAutoCompleteSession.idl \
|
||||
nsIAbAddressCollecter.idl \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
#!nmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
DEPTH=..\..\..
|
||||
MODULE=addrbook
|
||||
|
||||
XPIDLSRCS = \
|
||||
.\nsIAbListener.idl \
|
||||
.\nsIAbBase.idl \
|
||||
.\nsIAbDirectory.idl \
|
||||
.\nsIAbCard.idl \
|
||||
.\nsIAddrDBAnnouncer.idl \
|
||||
.\nsIAddrDBListener.idl \
|
||||
.\nsIAddrDatabase.idl \
|
||||
.\nsIAddressBook.idl \
|
||||
.\nsIAddrBookSession.idl \
|
||||
.\nsIAutoCompleteSession.idl \
|
||||
.\nsIAutoCompleteListener.idl \
|
||||
.\nsIAbAddressCollecter.idl \
|
||||
$(NULL)
|
||||
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
include <$(DEPTH)\config\config.mak>
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* 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) 1999 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#include "nsISupports.idl"
|
||||
|
||||
|
||||
[scriptable, uuid(fe04c8e6-501e-11d3-a527-0060b0fc04b7)]
|
||||
|
||||
interface nsIAbAddressCollecter : nsISupports {
|
||||
|
||||
void CollectAddress(in string address);
|
||||
};
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
/* -*- 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 "nsICollection.idl"
|
||||
|
||||
[scriptable, uuid(013DD009-F73B-11d2-A2DA-001083003D0C)]
|
||||
interface nsIAbBase : nsICollection {
|
||||
|
||||
readonly attribute string URI;
|
||||
attribute string name;
|
||||
|
||||
nsISupports GetChildNamed(in string name);
|
||||
attribute nsIAbBase parent;
|
||||
|
||||
nsIEnumerator GetChildNodes();
|
||||
|
||||
void AddUnique(in nsISupports element);
|
||||
void ReplaceElement(in nsISupports element, in nsISupports newElement);
|
||||
|
||||
};
|
||||
@@ -1,97 +0,0 @@
|
||||
/* -*- 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 "nsISupports.idl"
|
||||
|
||||
interface nsIAddrDatabase;
|
||||
|
||||
[ptr] native nsVoidArray(nsVoidArray);
|
||||
|
||||
%{C++
|
||||
#include "nsVoidArray.h"
|
||||
%}
|
||||
|
||||
[scriptable, uuid(FA5C977F-04C8-11d3-A2EB-001083003D0C)]
|
||||
interface nsIAbCard : nsISupports {
|
||||
|
||||
attribute wstring FirstName;
|
||||
attribute wstring LastName;
|
||||
attribute wstring DisplayName;
|
||||
attribute wstring NickName;
|
||||
attribute wstring PrimaryEmail;
|
||||
attribute wstring SecondEmail;
|
||||
attribute wstring WorkPhone;
|
||||
attribute wstring HomePhone;
|
||||
attribute wstring FaxNumber;
|
||||
attribute wstring PagerNumber;
|
||||
attribute wstring CellularNumber;
|
||||
attribute wstring HomeAddress;
|
||||
attribute wstring HomeAddress2;
|
||||
attribute wstring HomeCity;
|
||||
attribute wstring HomeState;
|
||||
attribute wstring HomeZipCode;
|
||||
attribute wstring HomeCountry;
|
||||
attribute wstring WorkAddress;
|
||||
attribute wstring WorkAddress2;
|
||||
attribute wstring WorkCity;
|
||||
attribute wstring WorkState;
|
||||
attribute wstring WorkZipCode;
|
||||
attribute wstring WorkCountry;
|
||||
attribute wstring JobTitle;
|
||||
attribute wstring Department;
|
||||
attribute wstring Company;
|
||||
attribute wstring WebPage1;
|
||||
attribute wstring WebPage2;
|
||||
attribute wstring BirthYear;
|
||||
attribute wstring BirthMonth;
|
||||
attribute wstring BirthDay;
|
||||
attribute wstring Custom1;
|
||||
attribute wstring Custom2;
|
||||
attribute wstring Custom3;
|
||||
attribute wstring Custom4;
|
||||
attribute wstring Notes;
|
||||
attribute unsigned long LastModifiedDate;
|
||||
|
||||
attribute boolean SendPlainText;
|
||||
|
||||
attribute unsigned long DbTableID;
|
||||
attribute unsigned long DbRowID;
|
||||
|
||||
void GetCardValue(in string attrname, out wstring value);
|
||||
void SetCardValue(in string attrname, in wstring value);
|
||||
void SetAbDatabase(in nsIAddrDatabase database);
|
||||
|
||||
[noscript] void GetAnonymousStrAttrubutesList(out nsVoidArray attrlist);
|
||||
[noscript] void GetAnonymousStrValuesList(out nsVoidArray valuelist);
|
||||
[noscript] void GetAnonymousIntAttrubutesList(out nsVoidArray attrlist);
|
||||
[noscript] void GetAnonymousIntValuesList(out nsVoidArray valuelist);
|
||||
[noscript] void GetAnonymousBoolAttrubutesList(out nsVoidArray attrlist);
|
||||
[noscript] void GetAnonymousBoolValuesList(out nsVoidArray valuelist);
|
||||
|
||||
void SetAnonymousStringAttribute(in string attrname, in string value);
|
||||
void SetAnonymousIntAttribute(in string attrname, in unsigned long value);
|
||||
void SetAnonymousBoolAttribute(in string attrname, in boolean value);
|
||||
void AddAnonymousAttributesToDB();
|
||||
void EditAnonymousAttributesInDB();
|
||||
|
||||
void GetCardURI(out string uri);
|
||||
void AddCardToDatabase(in string uri);
|
||||
void EditCardToDatabase(in string uri);
|
||||
void CopyCard(in nsIAbCard srcCard);
|
||||
void GetCollationKey(in wstring str, out wstring key);
|
||||
};
|
||||
@@ -1,51 +0,0 @@
|
||||
/* -*- 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 "nsISupports.idl"
|
||||
#include "nsIAbCard.idl"
|
||||
#include "nsISupportsArray.idl"
|
||||
|
||||
[ptr] native nsFileSpec(nsFileSpec);
|
||||
[ptr] native DIR_Server(DIR_Server);
|
||||
|
||||
%{C++
|
||||
#include "nsFileSpec.h"
|
||||
#include "nsDirPrefs.h"
|
||||
%}
|
||||
|
||||
[scriptable, uuid(1920E485-0709-11d3-A2EC-001083003D0C)]
|
||||
interface nsIAbDirectory : nsISupports {
|
||||
|
||||
attribute wstring DirName;
|
||||
attribute unsigned long LastModifiedDate;
|
||||
attribute DIR_Server server;
|
||||
|
||||
void GetDirFilePath(out string dbPath);
|
||||
void GetChildNodes(out nsIEnumerator childList);
|
||||
void GetChildCards(out nsIEnumerator childCards);
|
||||
void AddChildCards(in string uriName, out nsIAbCard childCard);
|
||||
void AddDirectory(in string uriName, out nsIAbDirectory childDir);
|
||||
void DeleteDirectories(in nsISupportsArray dierctories);
|
||||
void DeleteCards(in nsISupportsArray cards);
|
||||
void HasCard(in nsIAbCard cards, out boolean hasCard);
|
||||
void HasDirectory(in nsIAbDirectory dir, out boolean hasDir);
|
||||
void GetMailingList(out nsIEnumerator mailingList);
|
||||
void CreateNewDirectory(in wstring dirName, in string fileName);
|
||||
void GetDirUri(out string uri);
|
||||
|
||||
};
|
||||
@@ -1,29 +0,0 @@
|
||||
/* -*- 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 "nsISupports.idl"
|
||||
#include "nsIEnumerator.idl"
|
||||
|
||||
[scriptable, uuid(1920E484-0709-11d3-A2EC-001083003D0C)]
|
||||
interface nsIAbListener : nsISupports {
|
||||
|
||||
void OnItemAdded(in nsISupports parentDir, in nsISupports item);
|
||||
void OnItemRemoved(in nsISupports parentDir, in nsISupports item);
|
||||
void OnItemPropertyChanged(in nsISupports item, in string property, in wstring oldValue, in wstring newValue);
|
||||
|
||||
};
|
||||
@@ -1,49 +0,0 @@
|
||||
/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* 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 "nsISupports.idl"
|
||||
|
||||
/*
|
||||
* The mail session is a replacement for the old 4.x MSG_Master object. It
|
||||
* contains mail session generic information such as the account manager, etc
|
||||
* I'm starting this off as an empty interface and as people feel they need to
|
||||
* add more information to it, they can. I think this is a better approach
|
||||
* than trying to port over the old MSG_Master in its entirety as that had a
|
||||
* lot of cruft in it....
|
||||
*/
|
||||
|
||||
#include "nsISupports.idl"
|
||||
#include "nsIAbListener.idl"
|
||||
#include "nsIAbDirectory.idl"
|
||||
#include "nsIAbCard.idl"
|
||||
|
||||
[scriptable, uuid(C5339441-303F-11d3-9E13-00A0C92B5F0D)]
|
||||
interface nsIAddrBookSession : nsISupports {
|
||||
|
||||
void AddAddressBookListener(in nsIAbListener listener);
|
||||
void RemoveAddressBookListener(in nsIAbListener listener);
|
||||
void NotifyItemPropertyChanged(in nsISupports item,
|
||||
in string property,
|
||||
in wstring oldValue,
|
||||
in wstring newValue);
|
||||
void NotifyDirectoryItemAdded(in nsIAbDirectory directory, in nsISupports item);
|
||||
void NotifyDirectoryItemDeleted(in nsIAbDirectory directory, in nsISupports item);
|
||||
|
||||
[noscript] void GetUserProfileDirectory(out nsFileSpec userDir);
|
||||
};
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
/* -*- 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 "nsISupports.idl"
|
||||
#include "nsIAbCard.idl"
|
||||
|
||||
interface nsIAddrDBAnnouncer;
|
||||
|
||||
[scriptable, uuid(A4186D89-1DD0-11d3-A303-001083003D0C)]
|
||||
interface nsIAddrDBListener : nsISupports {
|
||||
|
||||
void OnCardAttribChange(in unsigned long abCode,
|
||||
in nsIAddrDBListener instigator);
|
||||
void OnCardEntryChange (in unsigned long abCode,
|
||||
in nsIAbCard card,
|
||||
in nsIAddrDBListener instigator);
|
||||
void OnAnnouncerGoingAway(in nsIAddrDBAnnouncer instigator);
|
||||
};
|
||||
@@ -1,109 +0,0 @@
|
||||
/* -*- 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.
|
||||
*/
|
||||
|
||||
/* nsFileSpec is declared in nsIAbDirectory.idl */
|
||||
#include "nsIAddrDBAnnouncer.idl"
|
||||
#include "nsIAbCard.idl"
|
||||
#include "nsIAbDirectory.idl"
|
||||
|
||||
[ptr] native nsIMdbTableRowCursor(nsIMdbTableRowCursor);
|
||||
[ptr] native nsIMdbEnv(nsIMdbEnv);
|
||||
[ptr] native nsIMdbRow(nsIMdbRow);
|
||||
|
||||
%{C++
|
||||
#include "mdb.h"
|
||||
%}
|
||||
|
||||
|
||||
[scriptable, uuid(A4186D8B-1DD0-11d3-A303-001083003D0C)]
|
||||
interface nsIAddrDatabase : nsIAddrDBAnnouncer {
|
||||
|
||||
attribute nsFileSpec dbPath;
|
||||
|
||||
[noscript] void Open(in nsFileSpec folderName, in boolean create,
|
||||
out nsIAddrDatabase pCardDB, in boolean upgrading);
|
||||
void Close(in boolean forceCommit);
|
||||
[noscript] void OpenMDB(in nsFileSpec dbName, in boolean create);
|
||||
void CloseMDB(in boolean commit);
|
||||
void OpenAnonymousDB(out nsIAddrDatabase pCardDB);
|
||||
void CloseAnonymousDB(in boolean forceCommit);
|
||||
|
||||
void Commit(in unsigned long commitType);
|
||||
void ForceClosed();
|
||||
|
||||
void CreateNewCardAndAddToDB(in nsIAbCard newCard, in boolean beNotify);
|
||||
void EnumerateCards(in nsIAbDirectory directory, out nsIEnumerator result);
|
||||
void EnumerateMailingLists(in nsIAbDirectory directory, out nsIEnumerator result);
|
||||
void DeleteCard(in nsIAbCard card, in boolean beNotify);
|
||||
void EditCard(in nsIAbCard card, in boolean beNotify);
|
||||
void ContainsCard(in nsIAbCard card, out boolean hasCard);
|
||||
|
||||
void GetCardForEmailAddress(in nsIAbDirectory directory, in string emailAddress, out nsIAbCard card);
|
||||
|
||||
void SetAnonymousStringAttribute(in string attrname, in string value);
|
||||
void GetAnonymousStringAttribute(in string attrname, out string value);
|
||||
void SetAnonymousIntAttribute(in string attrname, in unsigned long value);
|
||||
void GetAnonymousIntAttribute(in string attrname, out unsigned long value);
|
||||
void SetAnonymousBoolAttribute(in string attrname, in boolean value);
|
||||
void GetAnonymousBoolAttribute(in string attrname, out boolean value);
|
||||
void AddAnonymousAttributesToDB();
|
||||
void RemoveAnonymousAttributesFromDB();
|
||||
void EditAnonymousAttributesInDB();
|
||||
void AddAnonymousAttributesFromCard(in nsIAbCard card);
|
||||
void RemoveAnonymousAttributesFromCard(in nsIAbCard card);
|
||||
void EditAnonymousAttributesFromCard(in nsIAbCard card);
|
||||
|
||||
[noscript] void GetNewRow(out nsIMdbRow newRow);
|
||||
[noscript] void AddCardRowToDB(in nsIMdbRow newRow);
|
||||
[noscript] void AddFirstName(in nsIMdbRow row, in string value);
|
||||
[noscript] void AddLastName(in nsIMdbRow row, in string value);
|
||||
[noscript] void AddDisplayName(in nsIMdbRow row, in string value);
|
||||
[noscript] void AddNickName(in nsIMdbRow row, in string value);
|
||||
[noscript] void AddPrimaryEmail(in nsIMdbRow row, in string value);
|
||||
[noscript] void Add2ndEmail(in nsIMdbRow row, in string value);
|
||||
[noscript] void AddWorkPhone(in nsIMdbRow row, in string value);
|
||||
[noscript] void AddHomePhone(in nsIMdbRow row, in string value);
|
||||
[noscript] void AddFaxNumber(in nsIMdbRow row, in string value);
|
||||
[noscript] void AddPagerNumber(in nsIMdbRow row, in string value);
|
||||
[noscript] void AddCellularNumber(in nsIMdbRow row, in string value);
|
||||
[noscript] void AddHomeAddress(in nsIMdbRow row, in string value);
|
||||
[noscript] void AddHomeAddress2(in nsIMdbRow row, in string value);
|
||||
[noscript] void AddHomeCity(in nsIMdbRow row, in string value);
|
||||
[noscript] void AddHomeState(in nsIMdbRow row, in string value);
|
||||
[noscript] void AddHomeZipCode(in nsIMdbRow row, in string value);
|
||||
[noscript] void AddHomeCountry(in nsIMdbRow row, in string value);
|
||||
[noscript] void AddWorkAddress(in nsIMdbRow row, in string value);
|
||||
[noscript] void AddWorkAddress2(in nsIMdbRow row, in string value);
|
||||
[noscript] void AddWorkCity(in nsIMdbRow row, in string value);
|
||||
[noscript] void AddWorkState(in nsIMdbRow row, in string value);
|
||||
[noscript] void AddWorkZipCode(in nsIMdbRow row, in string value);
|
||||
[noscript] void AddWorkCountry(in nsIMdbRow row, in string value);
|
||||
[noscript] void AddJobTitle(in nsIMdbRow row, in string value);
|
||||
[noscript] void AddDepartment(in nsIMdbRow row, in string value);
|
||||
[noscript] void AddCompany(in nsIMdbRow row, in string value);
|
||||
[noscript] void AddWebPage1(in nsIMdbRow row, in string value);
|
||||
[noscript] void AddWebPage2(in nsIMdbRow row, in string value);
|
||||
[noscript] void AddBirthYear(in nsIMdbRow row, in string value);
|
||||
[noscript] void AddBirthMonth(in nsIMdbRow row, in string value);
|
||||
[noscript] void AddBirthDay(in nsIMdbRow row, in string value);
|
||||
[noscript] void AddCustom1(in nsIMdbRow row, in string value);
|
||||
[noscript] void AddCustom2(in nsIMdbRow row, in string value);
|
||||
[noscript] void AddCustom3(in nsIMdbRow row, in string value);
|
||||
[noscript] void AddCustom4(in nsIMdbRow row, in string value);
|
||||
[noscript] void AddNotes(in nsIMdbRow row, in string value);
|
||||
};
|
||||
@@ -1,43 +0,0 @@
|
||||
/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* 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 "nsISupports.idl"
|
||||
#include "xulstubs.idl"
|
||||
#include "nsIRDFCompositeDataSource.idl"
|
||||
#include "nsIAbCard.idl"
|
||||
|
||||
|
||||
%{C++
|
||||
#include "nsIDOMNodeList.h"
|
||||
#include "nsIDOMXULElement.h"
|
||||
%}
|
||||
|
||||
interface nsIDOMWindow;
|
||||
|
||||
[scriptable, uuid(D60B84F1-2A8C-11d3-9E07-00A0C92B5F0D)]
|
||||
interface nsIAddressBook : nsISupports {
|
||||
|
||||
void DeleteCards(in nsIDOMXULElement tree, in nsIDOMXULElement srcDir, in nsIDOMNodeList node);
|
||||
void NewAddressBook(in nsIRDFCompositeDataSource db, in nsIDOMXULElement srcDir, in wstring name);
|
||||
void DeleteAddressBooks(in nsIRDFCompositeDataSource db, in nsIDOMXULElement srcDir, in nsIDOMNodeList node);
|
||||
void PrintCard();
|
||||
void PrintAddressbook();
|
||||
void SetWebShellWindow(in nsIDOMWindow win);
|
||||
void ImportAddressBook();
|
||||
};
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#include "nsISupports.idl"
|
||||
#include "nsrootidl.idl"
|
||||
|
||||
[scriptable, uuid(CA2A6B08-3625-11d3-988E-001083010E9B)]
|
||||
interface nsIAutoCompleteListener : nsISupports {
|
||||
void OnAutoCompleteResult(in nsISupports aParam, in wstring aOriginalString, in wstring aMatch);
|
||||
};
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#include "nsISupports.idl"
|
||||
#include "nsrootidl.idl"
|
||||
|
||||
interface nsIAutoCompleteListener;
|
||||
|
||||
[scriptable, uuid(CA2A6B07-3625-11d3-988E-001083010E9B)]
|
||||
interface nsIAutoCompleteSession : nsISupports {
|
||||
void AutoComplete(in nsISupports aParam, in wstring aSearchString, in nsIAutoCompleteListener aResultListener);
|
||||
};
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
#
|
||||
# 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 = ../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
DIRS = content locale skin
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
# 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.
|
||||
#
|
||||
# This is a list of local files which get copied to the res\mailnews\messenger directory
|
||||
#
|
||||
|
||||
abAddressBookNameDialog.js
|
||||
abAddressBookNameDialog.xul
|
||||
abCardOverlay.js
|
||||
abCardOverlay.xul
|
||||
abCardViewOverlay.js
|
||||
abCardViewOverlay.xul
|
||||
abCommon.js
|
||||
abDirTreeOverlay.xul
|
||||
abEditCardDialog.xul
|
||||
abNewCardDialog.xul
|
||||
abResultsTreeOverlay.xul
|
||||
abSelectAddressesDialog.js
|
||||
abSelectAddressesDialog.xul
|
||||
addressbook.js
|
||||
addressbook.xul
|
||||
@@ -1,51 +0,0 @@
|
||||
#
|
||||
# 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 = ../../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
SAMPLES_DIR = $(DIST)/bin/chrome/addressbook/content/default
|
||||
|
||||
EXPORT_RESOURCE_SAMPLES = \
|
||||
abAddressBookNameDialog.js \
|
||||
abAddressBookNameDialog.xul \
|
||||
abCardOverlay.js \
|
||||
abCardOverlay.xul \
|
||||
abCardViewOverlay.js \
|
||||
abCardViewOverlay.xul \
|
||||
abCommon.js \
|
||||
abDirTreeOverlay.xul \
|
||||
abEditCardDialog.xul \
|
||||
abNewCardDialog.xul \
|
||||
abResultsTreeOverlay.xul \
|
||||
abSelectAddressesDialog.js \
|
||||
abSelectAddressesDialog.xul \
|
||||
addressbook.js \
|
||||
addressbook.xul \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
GARBAGE += $(addprefix $(SAMPLES_DIR)/, $(EXPORT_RESOURCE_SAMPLES))
|
||||
|
||||
install::
|
||||
$(INSTALL) $(addprefix $(srcdir)/, $(EXPORT_RESOURCE_SAMPLES)) $(SAMPLES_DIR)
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
var okCallback = 0;
|
||||
|
||||
function abNameOnLoad()
|
||||
{
|
||||
doSetOKCancel(abNameOKButton, 0);
|
||||
|
||||
// look in arguments[0] for parameters
|
||||
if (window.arguments && window.arguments[0])
|
||||
{
|
||||
if ( window.arguments[0].title )
|
||||
{
|
||||
dump("title = " + window.arguments[0].title + "\n");
|
||||
var title = window.arguments[0].title;
|
||||
top.window.title = title;
|
||||
}
|
||||
|
||||
if ( window.arguments[0].okCallback )
|
||||
top.okCallback = window.arguments[0].okCallback;
|
||||
}
|
||||
|
||||
// focus on input
|
||||
var name = document.getElementById('name');
|
||||
if ( name )
|
||||
name.focus();
|
||||
}
|
||||
|
||||
function abNameOKButton()
|
||||
{
|
||||
if ( top.okCallback )
|
||||
{
|
||||
var name = document.getElementById('name').value;
|
||||
|
||||
top.okCallback(name);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
The contents of this file are subject to the Netscape Public
|
||||
License Version 1.1 (the "License"); you may not use this file
|
||||
except in compliance with the License. You may obtain a copy of
|
||||
the License at http://www.mozilla.org/NPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS
|
||||
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
implied. See the License for the specific language governing
|
||||
rights and limitations under the License.
|
||||
|
||||
The Original Code is Mozilla Communicator client code, released
|
||||
March 31, 1998.
|
||||
|
||||
The Initial Developer of the Original Code is Netscape
|
||||
Communications Corporation. Portions created by Netscape are
|
||||
Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
||||
Rights Reserved.
|
||||
-->
|
||||
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
|
||||
|
||||
<!DOCTYPE window SYSTEM "chrome://addressbook/locale/abAddressBookNameDialog.dtd">
|
||||
|
||||
|
||||
<window xmlns:html="http://www.w3.org/TR/REC-html40"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
align="vertical"
|
||||
class="dialog"
|
||||
onload="abNameOnLoad()"
|
||||
style="padding:10px">
|
||||
|
||||
<html:script language="JavaScript" src="chrome://addressbook/content/abAddressBookNameDialog.js"/>
|
||||
|
||||
<keyset id="keyset"/>
|
||||
|
||||
<box align="vertical" style="width:36em; min-height:12em">
|
||||
|
||||
<spring flex="100%"/>
|
||||
|
||||
<html:div style="margin-bottom:.3em">&name.label;</html:div>
|
||||
|
||||
<html:input tabindex="0" type="text" id="name" style="width:100%"/>
|
||||
|
||||
<spring flex="100%"/>
|
||||
|
||||
<box id="okCancelButtons"/>
|
||||
|
||||
</box>
|
||||
|
||||
</window>
|
||||
@@ -1,303 +0,0 @@
|
||||
var editCard;
|
||||
|
||||
var newCardTitlePrefix = "New Card for ";
|
||||
var editCardTitlePrefix = "Card for ";
|
||||
var editCardFirstLastSeparator = " ";
|
||||
var editCardLastFirstSeparator = ", ";
|
||||
|
||||
function OnLoadNewCard()
|
||||
{
|
||||
InitEditCard();
|
||||
|
||||
doSetOKCancel(NewCardOKButton, 0);
|
||||
|
||||
editCard.card = 0;
|
||||
editCard.okCallback = 0;
|
||||
editCard.titlePrefix = newCardTitlePrefix;
|
||||
|
||||
if (window.arguments && window.arguments[0])
|
||||
{
|
||||
if ( window.arguments[0].selectedAB )
|
||||
editCard.selectedAB = window.arguments[0].selectedAB;
|
||||
}
|
||||
|
||||
// set popup with address book names
|
||||
var abPopup = document.getElementById('abPopup');
|
||||
if ( editCard.selectedAB )
|
||||
abPopup.value = editCard.selectedAB;
|
||||
|
||||
//// FIX ME - looks like we need to focus on both the text field and the tab widget
|
||||
//// probably need to do the same in the addressing widget
|
||||
|
||||
// focus on first name
|
||||
var firstName = document.getElementById('FirstName');
|
||||
if ( firstName )
|
||||
firstName.focus();
|
||||
}
|
||||
|
||||
|
||||
function OnLoadEditCard()
|
||||
{
|
||||
InitEditCard();
|
||||
|
||||
doSetOKCancel(EditCardOKButton, 0);
|
||||
|
||||
editCard.titlePrefix = editCardTitlePrefix;
|
||||
|
||||
if (window.arguments && window.arguments[0])
|
||||
{
|
||||
if ( window.arguments[0].card )
|
||||
editCard.card = window.arguments[0].card;
|
||||
if ( window.arguments[0].okCallback )
|
||||
editCard.okCallback = window.arguments[0].okCallback;
|
||||
if ( window.arguments[0].abURI )
|
||||
editCard.abURI = window.arguments[0].abURI;
|
||||
}
|
||||
|
||||
// set global state variables
|
||||
// if first or last name entered, disable generateDisplayName
|
||||
if ( editCard.generateDisplayName && (editCard.card.FirstName.length +
|
||||
editCard.card.LastName.length +
|
||||
editCard.card.DisplayName.length > 0) )
|
||||
{
|
||||
editCard.generateDisplayName = false;
|
||||
}
|
||||
|
||||
GetCardValues(editCard.card, document);
|
||||
|
||||
top.window.title = editCard.titlePrefix + editCard.card.DisplayName;
|
||||
}
|
||||
|
||||
function InitEditCard()
|
||||
{
|
||||
// create editCard object that contains global variables for editCard.js
|
||||
editCard = new Object;
|
||||
|
||||
// get pointer to nsIPref object
|
||||
var prefs = Components.classes["component://netscape/preferences"];
|
||||
if ( prefs )
|
||||
{
|
||||
prefs = prefs.getService();
|
||||
if ( prefs )
|
||||
{
|
||||
prefs = prefs.QueryInterface(Components.interfaces.nsIPref);
|
||||
editCard.prefs = prefs;
|
||||
}
|
||||
}
|
||||
|
||||
// get specific prefs that editCard will need
|
||||
if ( prefs )
|
||||
{
|
||||
try {
|
||||
editCard.displayLastNameFirst = prefs.GetBoolPref("mail.addr_book.lastnamefirst");
|
||||
}
|
||||
catch (ex) {
|
||||
dump("failed to get the mail.addr_book.lastnamefirst pref\n");
|
||||
}
|
||||
|
||||
try {
|
||||
editCard.generateDisplayName = prefs.GetBoolPref("mail.addr_book.displayName.autoGeneration");
|
||||
}
|
||||
catch (ex) {
|
||||
dump("failed to get the mail.addr_book.displayName.autoGeneration pref\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function NewCardOKButton()
|
||||
{
|
||||
var popup = document.getElementById('abPopup');
|
||||
if ( popup )
|
||||
{
|
||||
var uri = popup.value;
|
||||
|
||||
// FIX ME - hack to avoid crashing if no ab selected because of blank option bug from template
|
||||
// should be able to just remove this if we are not seeing blank lines in the ab popup
|
||||
if ( !uri )
|
||||
return false; // don't close window
|
||||
// -----
|
||||
|
||||
var cardproperty = Components.classes["component://netscape/addressbook/cardproperty"].createInstance();
|
||||
cardproperty = cardproperty.QueryInterface(Components.interfaces.nsIAbCard);
|
||||
|
||||
if ( cardproperty )
|
||||
{
|
||||
SetCardValues(cardproperty, document);
|
||||
|
||||
cardproperty.AddCardToDatabase(uri);
|
||||
}
|
||||
}
|
||||
|
||||
return true; // close the window
|
||||
}
|
||||
|
||||
function EditCardOKButton()
|
||||
{
|
||||
SetCardValues(editCard.card, document);
|
||||
|
||||
editCard.card.EditCardToDatabase(editCard.abURI);
|
||||
|
||||
// callback to allow caller to update
|
||||
if ( editCard.okCallback )
|
||||
editCard.okCallback();
|
||||
|
||||
return true; // close the window
|
||||
}
|
||||
|
||||
|
||||
// Move the data from the cardproperty to the dialog
|
||||
function GetCardValues(cardproperty, doc)
|
||||
{
|
||||
if ( cardproperty )
|
||||
{
|
||||
doc.getElementById('FirstName').value = cardproperty.FirstName;
|
||||
doc.getElementById('LastName').value = cardproperty.LastName;
|
||||
doc.getElementById('DisplayName').value = cardproperty.DisplayName;
|
||||
doc.getElementById('NickName').value = cardproperty.NickName;
|
||||
|
||||
doc.getElementById('PrimaryEmail').value = cardproperty.PrimaryEmail;
|
||||
doc.getElementById('SecondEmail').value = cardproperty.SecondEmail;
|
||||
//doc.getElementById('SendPlainText').value = cardproperty.SendPlainText;
|
||||
|
||||
doc.getElementById('WorkPhone').value = cardproperty.WorkPhone;
|
||||
doc.getElementById('HomePhone').value = cardproperty.HomePhone;
|
||||
doc.getElementById('FaxNumber').value = cardproperty.FaxNumber;
|
||||
doc.getElementById('PagerNumber').value = cardproperty.PagerNumber;
|
||||
doc.getElementById('CellularNumber').value = cardproperty.CellularNumber;
|
||||
|
||||
doc.getElementById('HomeAddress').value = cardproperty.HomeAddress;
|
||||
doc.getElementById('HomeAddress2').value = cardproperty.HomeAddress2;
|
||||
doc.getElementById('HomeCity').value = cardproperty.HomeCity;
|
||||
doc.getElementById('HomeState').value = cardproperty.HomeState;
|
||||
doc.getElementById('HomeZipCode').value = cardproperty.HomeZipCode;
|
||||
doc.getElementById('HomeCountry').value = cardproperty.HomeCountry;
|
||||
|
||||
doc.getElementById('JobTitle').value = cardproperty.JobTitle;
|
||||
doc.getElementById('Department').value = cardproperty.Department;
|
||||
doc.getElementById('Company').value = cardproperty.Company;
|
||||
doc.getElementById('WorkAddress').value = cardproperty.WorkAddress;
|
||||
doc.getElementById('WorkAddress2').value = cardproperty.WorkAddress2;
|
||||
doc.getElementById('WorkCity').value = cardproperty.WorkCity;
|
||||
doc.getElementById('WorkState').value = cardproperty.WorkState;
|
||||
doc.getElementById('WorkZipCode').value = cardproperty.WorkZipCode;
|
||||
doc.getElementById('WorkCountry').value = cardproperty.WorkCountry;
|
||||
|
||||
doc.getElementById('WebPage1').value = cardproperty.WebPage1;
|
||||
|
||||
doc.getElementById('Custom1').value = cardproperty.Custom1;
|
||||
doc.getElementById('Custom2').value = cardproperty.Custom2;
|
||||
doc.getElementById('Custom3').value = cardproperty.Custom3;
|
||||
doc.getElementById('Custom4').value = cardproperty.Custom4;
|
||||
doc.getElementById('Notes').value = cardproperty.Notes;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Move the data from the dialog to the cardproperty to be stored in the database
|
||||
function SetCardValues(cardproperty, doc)
|
||||
{
|
||||
if (cardproperty)
|
||||
{
|
||||
cardproperty.FirstName = doc.getElementById('FirstName').value;
|
||||
cardproperty.LastName = doc.getElementById('LastName').value;
|
||||
cardproperty.DisplayName = doc.getElementById('DisplayName').value;
|
||||
cardproperty.NickName = doc.getElementById('NickName').value;
|
||||
|
||||
cardproperty.PrimaryEmail = doc.getElementById('PrimaryEmail').value;
|
||||
cardproperty.SecondEmail = doc.getElementById('SecondEmail').value;
|
||||
//cardproperty.SendPlainText = doc.getElementById('SendPlainText').value;
|
||||
|
||||
cardproperty.WorkPhone = doc.getElementById('WorkPhone').value;
|
||||
cardproperty.HomePhone = doc.getElementById('HomePhone').value;
|
||||
cardproperty.FaxNumber = doc.getElementById('FaxNumber').value;
|
||||
cardproperty.PagerNumber = doc.getElementById('PagerNumber').value;
|
||||
cardproperty.CellularNumber = doc.getElementById('CellularNumber').value;
|
||||
|
||||
cardproperty.HomeAddress = doc.getElementById('HomeAddress').value;
|
||||
cardproperty.HomeAddress2 = doc.getElementById('HomeAddress2').value;
|
||||
cardproperty.HomeCity = doc.getElementById('HomeCity').value;
|
||||
cardproperty.HomeState = doc.getElementById('HomeState').value;
|
||||
cardproperty.HomeZipCode = doc.getElementById('HomeZipCode').value;
|
||||
cardproperty.HomeCountry = doc.getElementById('HomeCountry').value;
|
||||
|
||||
cardproperty.JobTitle = doc.getElementById('JobTitle').value;
|
||||
cardproperty.Department = doc.getElementById('Department').value;
|
||||
cardproperty.Company = doc.getElementById('Company').value;
|
||||
cardproperty.WorkAddress = doc.getElementById('WorkAddress').value;
|
||||
cardproperty.WorkAddress2 = doc.getElementById('WorkAddress2').value;
|
||||
cardproperty.WorkCity = doc.getElementById('WorkCity').value;
|
||||
cardproperty.WorkState = doc.getElementById('WorkState').value;
|
||||
cardproperty.WorkZipCode = doc.getElementById('WorkZipCode').value;
|
||||
cardproperty.WorkCountry = doc.getElementById('WorkCountry').value;
|
||||
|
||||
cardproperty.WebPage1 = doc.getElementById('WebPage1').value;
|
||||
|
||||
cardproperty.Custom1 = doc.getElementById('Custom1').value;
|
||||
cardproperty.Custom2 = doc.getElementById('Custom2').value;
|
||||
cardproperty.Custom3 = doc.getElementById('Custom3').value;
|
||||
cardproperty.Custom4 = doc.getElementById('Custom4').value;
|
||||
cardproperty.Notes = doc.getElementById('Notes').value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function NewCardCancelButton()
|
||||
{
|
||||
top.window.close();
|
||||
}
|
||||
|
||||
function EditCardCancelButton()
|
||||
{
|
||||
top.window.close();
|
||||
}
|
||||
|
||||
function GenerateDisplayName()
|
||||
{
|
||||
if ( editCard.generateDisplayName )
|
||||
{
|
||||
var displayName;
|
||||
|
||||
var firstNameField = document.getElementById('FirstName');
|
||||
var lastNameField = document.getElementById('LastName');
|
||||
var displayNameField = document.getElementById('DisplayName');
|
||||
|
||||
/* todo: i18N work todo here */
|
||||
/* this used to be XP_GetString(MK_ADDR_FIRST_LAST_SEP) */
|
||||
|
||||
/* todo: mscott says there was a pref in 4.5 that would */
|
||||
/* cause GenerateDisplayName() to do nothing. */
|
||||
/* the i18N people need it. */
|
||||
/* find the pref and heed it. */
|
||||
|
||||
/* trying to be smart about no using the first last sep */
|
||||
/* if first or last is missing */
|
||||
/* todo: is this i18N safe? */
|
||||
|
||||
var separator = "";
|
||||
if ( lastNameField.value && firstNameField.value )
|
||||
{
|
||||
if ( editCard.displayLastNameFirst )
|
||||
separator = editCardLastFirstSeparator;
|
||||
else
|
||||
separator = editCardFirstLastSeparator;
|
||||
}
|
||||
|
||||
if ( editCard.displayLastNameFirst )
|
||||
displayName = lastNameField.value + separator + firstNameField.value;
|
||||
else
|
||||
displayName = firstNameField.value + separator + lastNameField.value;
|
||||
|
||||
displayNameField.value = displayName;
|
||||
top.window.title = editCard.titlePrefix + displayName;
|
||||
}
|
||||
}
|
||||
|
||||
function DisplayNameChanged()
|
||||
{
|
||||
// turn off generateDisplayName if the user changes the display name
|
||||
editCard.generateDisplayName = false;
|
||||
|
||||
var title = editCard.titlePrefix + document.getElementById('DisplayName').value;
|
||||
if ( top.window.title != title )
|
||||
top.window.title = title;
|
||||
}
|
||||
@@ -1,293 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
The contents of this file are subject to the Netscape Public
|
||||
License Version 1.1 (the "License"); you may not use this file
|
||||
except in compliance with the License. You may obtain a copy of
|
||||
the License at http://www.mozilla.org/NPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS
|
||||
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
implied. See the License for the specific language governing
|
||||
rights and limitations under the License.
|
||||
|
||||
The Original Code is Mozilla Communicator client code, released
|
||||
March 31, 1998.
|
||||
|
||||
The Initial Developer of the Original Code is Netscape
|
||||
Communications Corporation. Portions created by Netscape are
|
||||
Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
||||
Rights Reserved.
|
||||
-->
|
||||
|
||||
<!DOCTYPE window SYSTEM "chrome://addressbook/locale/abCardOverlay.dtd">
|
||||
|
||||
|
||||
<overlay id="editcardOverlay"
|
||||
xmlns:html="http://www.w3.org/TR/REC-html40"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<html:script language="JavaScript" src="chrome://addressbook/content/abCardOverlay.js"/>
|
||||
|
||||
|
||||
<box id="editcard" align="vertical">
|
||||
|
||||
<tabcontrol align="vertical" style="margin:5px">
|
||||
<tabbox align="horizontal">
|
||||
<tab>&Name.tab;</tab>
|
||||
<tab>&Address.tab;</tab>
|
||||
<tab>&Other.tab;</tab>
|
||||
</tabbox>
|
||||
|
||||
<tabpanel align="vertical" flex="100%" style="border:2px groove white">
|
||||
|
||||
<!-- ** Name Tab ** -->
|
||||
<box index="name" align="vertical" flex="100%">
|
||||
|
||||
<html:fieldset flex="100%">
|
||||
<html:legend align="left">
|
||||
<html:div style="font-weight: bold">&Name.box;</html:div>
|
||||
</html:legend>
|
||||
|
||||
<box align="vertical" style="width:100%">
|
||||
<box align="horizontal" flex="100%">
|
||||
<spring flex="100%"/>
|
||||
<html:label for="FirstName">&FirstName.label;</html:label>
|
||||
<html:input type="text" id="FirstName" class="CardEdit" onkeyup="top.GenerateDisplayName()" />
|
||||
</box>
|
||||
<box align="horizontal">
|
||||
<spring flex="100%"/>
|
||||
<html:label for="LastName">&LastName.label;</html:label>
|
||||
<html:input id="LastName" type="text" class="CardEdit" onkeyup="top.GenerateDisplayName()"/>
|
||||
</box>
|
||||
<box align="horizontal">
|
||||
<spring flex="100%"/>
|
||||
<html:label for="DisplayName">&DisplayName.label;</html:label>
|
||||
<html:input id="DisplayName" type="text" class="CardEdit" onkeyup="top.DisplayNameChanged()"/>
|
||||
</box>
|
||||
<box align="horizontal">
|
||||
<spring flex="100%"/>
|
||||
<html:label for="NickName">&NickName.label;</html:label>
|
||||
<html:input id="NickName" type="text" class="CardEdit"/>
|
||||
</box>
|
||||
</box>
|
||||
</html:fieldset>
|
||||
|
||||
<html:fieldset flex="100%">
|
||||
<html:legend align="left">
|
||||
<html:div style="font-weight: bold">&Internet.box;</html:div>
|
||||
</html:legend>
|
||||
|
||||
<box align="vertical" style="width:100%">
|
||||
<box align="horizontal">
|
||||
<spring flex="100%"/>
|
||||
<html:label for="PrimaryEmail">&PrimaryEmail.label;</html:label>
|
||||
<html:input id="PrimaryEmail" type="text" class="CardEdit"/>
|
||||
</box>
|
||||
<box align="horizontal">
|
||||
<spring flex="100%"/>
|
||||
<html:label for="SecondEmail">&SecondEmail.label;</html:label>
|
||||
<html:input id="SecondEmail" type="text" class="CardEdit"/>
|
||||
</box>
|
||||
<box align="horizontal">
|
||||
<spring flex="100%"/>
|
||||
<box class="CardEditWidth">
|
||||
<html:input id="SendPlainText" type="checkbox"/>
|
||||
<html:label for="SendPlainText">&SendPlainText.label;</html:label>
|
||||
</box>
|
||||
</box>
|
||||
</box>
|
||||
</html:fieldset>
|
||||
|
||||
<html:fieldset flex="100%">
|
||||
<html:legend align="left">
|
||||
<html:div style="font-weight: bold">&Phones.box;</html:div>
|
||||
</html:legend>
|
||||
|
||||
<box align="vertical" style="width:100%">
|
||||
<box align="horizontal" style="vertical-align:baseline">
|
||||
<spring flex="100%"/>
|
||||
<html:label for="WorkPhone" style="vertical-align:baseline">&WorkPhone.label;</html:label>
|
||||
<html:input id="WorkPhone" type="text" class="CardEdit" style="vertical-align:baseline"/>
|
||||
</box>
|
||||
<box align="horizontal">
|
||||
<spring flex="100%"/>
|
||||
<html:label for="HomePhone">&HomePhone.label;</html:label>
|
||||
<html:input id="HomePhone" type="text" class="CardEdit"/>
|
||||
</box>
|
||||
<box align="horizontal">
|
||||
<spring flex="100%"/>
|
||||
<html:label for="FaxNumber">&FaxNumber.label;</html:label>
|
||||
<html:input id="FaxNumber" type="text" class="CardEdit"/>
|
||||
</box>
|
||||
<box align="horizontal">
|
||||
<spring flex="100%"/>
|
||||
<html:label for="PagerNumber">&PagerNumber.label;</html:label>
|
||||
<html:input id="PagerNumber" type="text" class="CardEdit"/>
|
||||
</box>
|
||||
<box align="horizontal">
|
||||
<spring flex="100%"/>
|
||||
<html:label for="CellularNumber">&CellularNumber.label;</html:label>
|
||||
<html:input id="CellularNumber" type="text" class="CardEdit"/>
|
||||
</box>
|
||||
</box>
|
||||
</html:fieldset>
|
||||
</box>
|
||||
|
||||
<!-- ** Address Tab ** -->
|
||||
<box index="address" align="vertical" flex="100%">
|
||||
|
||||
<html:fieldset flex="100%">
|
||||
<html:legend align="left">
|
||||
<html:div style="font-weight: bold">&Home.box;</html:div>
|
||||
</html:legend>
|
||||
|
||||
<box align="vertical" style="width:100%">
|
||||
|
||||
<box align="horizontal">
|
||||
<spring flex="100%"/>
|
||||
<html:label for="HomeAddress">&HomeAddress.label;</html:label>
|
||||
<html:input type="text" id="HomeAddress" class="CardEdit"/>
|
||||
</box>
|
||||
<box align="horizontal">
|
||||
<spring flex="100%"/>
|
||||
<html:label for="HomeAddress2">&HomeAddress2.label;</html:label>
|
||||
<html:input type="text" id="HomeAddress2" class="CardEdit"/>
|
||||
</box>
|
||||
<box align="horizontal">
|
||||
<spring flex="100%"/>
|
||||
<html:label for="HomeCity">&HomeCity.label;</html:label>
|
||||
<html:input id="HomeCity" type="text" class="CardEdit"/>
|
||||
</box>
|
||||
<box align="horizontal">
|
||||
<spring flex="100%"/>
|
||||
<html:label for="HomeState">&HomeState.label;</html:label>
|
||||
<box class="CardEditWidth">
|
||||
<html:input id="HomeState" type="text" class="CardEdit" style="min-width:1em; width:8em"/>
|
||||
<spring flex="100%"/>
|
||||
<html:label for="HomeZipCode">&HomeZipCode.label;</html:label>
|
||||
<html:input id="HomeZipCode" type="text" class="CardEdit" style="min-width:1em; width:8em"/>
|
||||
</box>
|
||||
</box>
|
||||
<box align="horizontal">
|
||||
<spring flex="100%"/>
|
||||
<html:label for="HomeCountry">&HomeCountry.label;</html:label>
|
||||
<html:input id="HomeCountry" type="text" class="CardEdit"/>
|
||||
</box>
|
||||
</box>
|
||||
</html:fieldset>
|
||||
|
||||
<html:fieldset style="width:100%">
|
||||
<html:legend align="left">
|
||||
<html:div style="font-weight: bold">&Work.box;</html:div>
|
||||
</html:legend>
|
||||
|
||||
<box align="vertical" style="width:100%">
|
||||
|
||||
<box align="horizontal">
|
||||
<spring flex="100%"/>
|
||||
<html:label for="JobTitle">&JobTitle.label;</html:label>
|
||||
<html:input type="text" id="JobTitle" class="CardEdit"/>
|
||||
</box>
|
||||
<box align="horizontal">
|
||||
<spring flex="100%"/>
|
||||
<html:label for="Department">&Department.label;</html:label>
|
||||
<html:input type="text" id="Department" class="CardEdit"/>
|
||||
</box>
|
||||
<box align="horizontal">
|
||||
<spring flex="100%"/>
|
||||
<html:label for="Company">&Company.label;</html:label>
|
||||
<html:input type="text" id="Company" class="CardEdit"/>
|
||||
</box>
|
||||
<box align="horizontal">
|
||||
<spring flex="100%"/>
|
||||
<html:label for="WorkAddress">&WorkAddress.label;</html:label>
|
||||
<html:input type="text" id="WorkAddress" class="CardEdit"/>
|
||||
</box>
|
||||
<box align="horizontal">
|
||||
<spring flex="100%"/>
|
||||
<html:label for="WorkAddress2">&WorkAddress2.label;</html:label>
|
||||
<html:input type="text" id="WorkAddress2" class="CardEdit"/>
|
||||
</box>
|
||||
<box align="horizontal">
|
||||
<spring flex="100%"/>
|
||||
<html:label for="WorkCity">&WorkCity.label;</html:label>
|
||||
<html:input id="WorkCity" type="text" class="CardEdit"/>
|
||||
</box>
|
||||
<box align="horizontal">
|
||||
<spring flex="100%"/>
|
||||
<html:label for="WorkState">&WorkState.label;</html:label>
|
||||
<box class="CardEditWidth">
|
||||
<html:input id="WorkState" type="text" class="CardEdit" style="min-width:1em; width:8em"/>
|
||||
<spring flex="100%"/>
|
||||
<html:label for="WorkZipCode">&WorkZipCode.label;</html:label>
|
||||
<html:input id="WorkZipCode" type="text" class="CardEdit" style="min-width:1em; width:8em"/>
|
||||
</box>
|
||||
</box>
|
||||
<box align="horizontal">
|
||||
<spring flex="100%"/>
|
||||
<html:label for="WorkCountry">&WorkCountry.label;</html:label>
|
||||
<html:input id="WorkCountry" type="text" class="CardEdit"/>
|
||||
</box>
|
||||
</box>
|
||||
</html:fieldset>
|
||||
|
||||
<!--html:fieldset style="width:100%">
|
||||
<html:legend align="left">
|
||||
<html:div style="font-weight: bold">&Web.box;</html:div>
|
||||
</html:legend-->
|
||||
|
||||
<box align="vertical" style="width:100%">
|
||||
|
||||
<box align="horizontal">
|
||||
<!--spring flex="100%"/-->
|
||||
<html:label for="WebPage1">&WebPage1.label;</html:label>
|
||||
<html:input type="text" id="WebPage1" class="CardEdit" flex="100%"/>
|
||||
</box>
|
||||
</box>
|
||||
<!--/html:fieldset-->
|
||||
</box>
|
||||
|
||||
<!-- ** Other Tab ** -->
|
||||
<box index="other" align="vertical" flex="100%">
|
||||
|
||||
<box align="vertical" style="width:100%">
|
||||
<box align="horizontal" flex="100%">
|
||||
<spring flex="100%"/>
|
||||
<html:label for="Custom1">&Custom1.label;</html:label>
|
||||
<html:input type="text" id="Custom1" class="CardEdit"/>
|
||||
</box>
|
||||
<box align="horizontal" flex="100%">
|
||||
<spring flex="100%"/>
|
||||
<html:label for="Custom2">&Custom2.label;</html:label>
|
||||
<html:input type="text" id="Custom2" class="CardEdit"/>
|
||||
</box>
|
||||
<box align="horizontal" flex="100%">
|
||||
<spring flex="100%"/>
|
||||
<html:label for="Custom3">&Custom3.label;</html:label>
|
||||
<html:input type="text" id="Custom3" class="CardEdit"/>
|
||||
</box>
|
||||
<box align="horizontal" flex="100%">
|
||||
<spring flex="100%"/>
|
||||
<html:label for="Custom4">&Custom4.label;</html:label>
|
||||
<html:input type="text" id="Custom4" class="CardEdit"/>
|
||||
</box>
|
||||
</box>
|
||||
|
||||
<html:fieldset style="width:100%">
|
||||
<html:legend align="left">
|
||||
<html:div style="font-weight: bold">&Notes.box;</html:div>
|
||||
</html:legend>
|
||||
|
||||
<box align="vertical" style="width:100%">
|
||||
<html:textarea id="Notes" rows="15"/>
|
||||
</box>
|
||||
</html:fieldset>
|
||||
|
||||
</box>
|
||||
|
||||
</tabpanel>
|
||||
</tabcontrol>
|
||||
</box>
|
||||
|
||||
</overlay>
|
||||
|
||||
@@ -1,231 +0,0 @@
|
||||
var zWork = "Work: ";
|
||||
var zHome = "Home: ";
|
||||
var zFax = "Fax: ";
|
||||
var zCellular = "Cellular: ";
|
||||
var zPager = "Pager: ";
|
||||
var zCustom1 = "Custom 1: ";
|
||||
var zCustom2 = "Custom 2: ";
|
||||
var zCustom3 = "Custom 3: ";
|
||||
var zCustom4 = "Custom 4: ";
|
||||
|
||||
var rdf;
|
||||
var cvData;
|
||||
|
||||
function OnLoadCardView()
|
||||
{
|
||||
// This should be in an onload for the card view window, but that is not currently working
|
||||
rdf = Components.classes["component://netscape/rdf/rdf-service"].getService();
|
||||
rdf = rdf.QueryInterface(Components.interfaces.nsIRDFService);
|
||||
|
||||
var doc = document;
|
||||
|
||||
/* data for address book, prefixes: "cvb" = card view box
|
||||
"cvh" = crad view header
|
||||
"cv" = card view (normal fields) */
|
||||
cvData = new Object;
|
||||
|
||||
// Card View Box
|
||||
cvData.CardViewBox = doc.getElementById("CardViewBox");
|
||||
// Title
|
||||
cvData.CardTitle = doc.getElementById("CardTitle");
|
||||
// Name section
|
||||
cvData.cvbName = doc.getElementById("cvbName");
|
||||
cvData.cvhName = doc.getElementById("cvhName");
|
||||
cvData.cvNickname = doc.getElementById("cvNickname");
|
||||
cvData.cvEmail1 = doc.getElementById("cvEmail1");
|
||||
cvData.cvEmail2 = doc.getElementById("cvEmail2");
|
||||
// Home section
|
||||
cvData.cvbHome = doc.getElementById("cvbHome");
|
||||
cvData.cvhHome = doc.getElementById("cvhHome");
|
||||
cvData.cvHomeAddress = doc.getElementById("cvHomeAddress");
|
||||
cvData.cvHomeAddress2 = doc.getElementById("cvHomeAddress2");
|
||||
cvData.cvHomeCityStZip = doc.getElementById("cvHomeCityStZip");
|
||||
cvData.cvHomeCountry = doc.getElementById("cvHomeCountry");
|
||||
// Other section
|
||||
cvData.cvbOther = doc.getElementById("cvbOther");
|
||||
cvData.cvhOther = doc.getElementById("cvhOther");
|
||||
cvData.cvCustom1 = doc.getElementById("cvCustom1");
|
||||
cvData.cvCustom2 = doc.getElementById("cvCustom2");
|
||||
cvData.cvCustom3 = doc.getElementById("cvCustom3");
|
||||
cvData.cvCustom4 = doc.getElementById("cvCustom4");
|
||||
cvData.cvNotes = doc.getElementById("cvNotes");
|
||||
// Phone section
|
||||
cvData.cvbPhone = doc.getElementById("cvbPhone");
|
||||
cvData.cvhPhone = doc.getElementById("cvhPhone");
|
||||
cvData.cvPhWork = doc.getElementById("cvPhWork");
|
||||
cvData.cvPhHome = doc.getElementById("cvPhHome");
|
||||
cvData.cvPhFax = doc.getElementById("cvPhFax");
|
||||
cvData.cvPhCellular = doc.getElementById("cvPhCellular");
|
||||
cvData.cvPhPager = doc.getElementById("cvPhPager");
|
||||
// Work section
|
||||
cvData.cvbWork = doc.getElementById("cvbWork");
|
||||
cvData.cvhWork = doc.getElementById("cvhWork");
|
||||
cvData.cvJobTitle = doc.getElementById("cvJobTitle");
|
||||
cvData.cvDepartment = doc.getElementById("cvDepartment");
|
||||
cvData.cvCompany = doc.getElementById("cvCompany");
|
||||
cvData.cvWorkAddress = doc.getElementById("cvWorkAddress");
|
||||
cvData.cvWorkAddress2 = doc.getElementById("cvWorkAddress2");
|
||||
cvData.cvWorkCityStZip = doc.getElementById("cvWorkCityStZip");
|
||||
cvData.cvWorkCountry = doc.getElementById("cvWorkCountry");
|
||||
}
|
||||
|
||||
function DisplayCardViewPane(abNode)
|
||||
{
|
||||
var uri = abNode.getAttribute('id');
|
||||
var cardResource = top.rdf.GetResource(uri);
|
||||
var card = cardResource.QueryInterface(Components.interfaces.nsIAbCard);
|
||||
|
||||
// FIX ME - this should use a i18n name routine in JS
|
||||
var name = card.DisplayName;
|
||||
if ( card.FirstName.length + card.LastName.length > 0 )
|
||||
name = card.FirstName + " " + card.LastName;
|
||||
|
||||
var nickname;
|
||||
if ( card.NickName )
|
||||
nickname = "\"" + card.NickName + "\"";
|
||||
|
||||
var data = top.cvData;
|
||||
var visible;
|
||||
|
||||
// set fields in card view pane
|
||||
|
||||
cvSetNode(data.CardTitle, "Card for " + card.DisplayName);
|
||||
|
||||
// Name section
|
||||
cvSetNode(data.cvhName, name);
|
||||
cvSetNode(data.cvNickname, nickname);
|
||||
cvSetNode(data.cvEmail1, card.PrimaryEmail);
|
||||
cvSetNode(data.cvEmail2, card.SecondEmail);
|
||||
// Home section
|
||||
visible = cvSetNode(data.cvHomeAddress, card.HomeAddress);
|
||||
visible = cvSetNode(data.cvHomeAddress2, card.HomeAddress2) || visible;
|
||||
visible = cvSetCityStateZip(data.cvHomeCityStZip, card.HomeCity, card.HomeState, card.HomeZipCode) || visible;
|
||||
visible = cvSetNode(data.cvHomeCountry, card.HomeCountry) || visible;
|
||||
cvSetVisible(data.cvhHome, visible);
|
||||
// Other section
|
||||
visible = cvSetNodeWithLabel(data.cvCustom1, zCustom1, card.Custom1);
|
||||
visible = cvSetNodeWithLabel(data.cvCustom2, zCustom2, card.Custom2) || visible;
|
||||
visible = cvSetNodeWithLabel(data.cvCustom3, zCustom3, card.Custom3) || visible;
|
||||
visible = cvSetNodeWithLabel(data.cvCustom4, zCustom4, card.Custom4) || visible;
|
||||
visible = cvSetNode(data.cvNotes, card.Notes) || visible;
|
||||
cvSetVisible(data.cvhOther, visible);
|
||||
// Phone section
|
||||
visible = cvSetNodeWithLabel(data.cvPhWork, zWork, card.WorkPhone);
|
||||
visible = cvSetNodeWithLabel(data.cvPhHome, zHome, card.HomePhone) || visible;
|
||||
visible = cvSetNodeWithLabel(data.cvPhFax, zFax, card.FaxNumber) || visible;
|
||||
visible = cvSetNodeWithLabel(data.cvPhCellular, zCellular, card.CellularNumber) || visible;
|
||||
visible = cvSetNodeWithLabel(data.cvPhPager, zPager, card.PagerNumber) || visible;
|
||||
cvSetVisible(data.cvhPhone, visible);
|
||||
// Work section
|
||||
visible = cvSetNode(data.cvJobTitle, card.JobTitle);
|
||||
visible = cvSetNode(data.cvDepartment, card.Department) || visible;
|
||||
visible = cvSetNode(data.cvCompany, card.Company) || visible;
|
||||
visible = cvSetNode(data.cvWorkAddress, card.WorkAddress) || visible;
|
||||
visible = cvSetNode(data.cvWorkAddress2, card.WorkAddress2) || visible;
|
||||
visible = cvSetCityStateZip(data.cvWorkCityStZip, card.WorkCity, card.WorkState, card.WorkZipCode) || visible;
|
||||
visible = cvSetNode(data.cvWorkCountry, card.WorkCountry) || visible;
|
||||
cvSetVisible(data.cvhWork, visible);
|
||||
|
||||
// make the card view box visible
|
||||
cvSetVisible(top.cvData.CardViewBox, true);
|
||||
}
|
||||
|
||||
function ClearCardViewPane()
|
||||
{
|
||||
cvSetVisible(top.cvData.CardViewBox, false);
|
||||
|
||||
/* can remove this code now that boxes handle display:none
|
||||
// HACK - we need to be able to set the entire box or div to display:none when bug fixed
|
||||
var data = top.cvData;
|
||||
|
||||
// title
|
||||
cvSetVisible(data.CardTitle, false);
|
||||
// Name section
|
||||
cvSetVisible(data.cvhName, false);
|
||||
cvSetVisible(data.cvNickname, false);
|
||||
cvSetVisible(data.cvEmail1, false);
|
||||
cvSetVisible(data.cvEmail2, false);
|
||||
// Home section
|
||||
cvSetVisible(data.cvhHome, false);
|
||||
cvSetVisible(data.cvHomeAddress, false);
|
||||
cvSetVisible(data.cvHomeAddress2, false);
|
||||
cvSetVisible(data.cvHomeCityStZip, false);
|
||||
cvSetVisible(data.cvHomeCountry, false);
|
||||
// Other section
|
||||
cvSetVisible(data.cvhOther, false);
|
||||
cvSetVisible(data.cvCustom1, false);
|
||||
cvSetVisible(data.cvCustom2, false);
|
||||
cvSetVisible(data.cvCustom3, false);
|
||||
cvSetVisible(data.cvCustom4, false);
|
||||
cvSetVisible(data.cvNotes, false);
|
||||
// Phone section
|
||||
cvSetVisible(data.cvhPhone, false);
|
||||
cvSetVisible(data.cvPhWork, false);
|
||||
cvSetVisible(data.cvPhHome, false);
|
||||
cvSetVisible(data.cvPhFax, false);
|
||||
cvSetVisible(data.cvPhCellular, false);
|
||||
cvSetVisible(data.cvPhPager, false);
|
||||
// Work section
|
||||
cvSetVisible(data.cvhWork, false);
|
||||
cvSetVisible(data.cvJobTitle, false);
|
||||
cvSetVisible(data.cvDepartment, false);
|
||||
cvSetVisible(data.cvCompany, false);
|
||||
cvSetVisible(data.cvWorkAddress, false);
|
||||
cvSetVisible(data.cvWorkAddress2, false);
|
||||
cvSetVisible(data.cvWorkCityStZip, false);
|
||||
cvSetVisible(data.cvWorkCountry, false);
|
||||
|
||||
*/
|
||||
}
|
||||
|
||||
function cvSetNodeWithLabel(node, label, text)
|
||||
{
|
||||
if ( text )
|
||||
return cvSetNode(node, label + text);
|
||||
else
|
||||
{
|
||||
cvSetVisible(node, false);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function cvSetCityStateZip(node, city, state, zip)
|
||||
{
|
||||
var text;
|
||||
|
||||
if ( city )
|
||||
{
|
||||
text = city;
|
||||
if ( state || zip )
|
||||
text += ", ";
|
||||
}
|
||||
if ( state )
|
||||
text += state + " ";
|
||||
if ( zip )
|
||||
text += zip;
|
||||
|
||||
return cvSetNode(node, text);
|
||||
}
|
||||
|
||||
function cvSetNode(node, text)
|
||||
{
|
||||
node.childNodes[0].nodeValue = text;
|
||||
var visible;
|
||||
|
||||
if ( text )
|
||||
visible = true;
|
||||
else
|
||||
visible = false;
|
||||
|
||||
cvSetVisible(node, visible);
|
||||
return visible;
|
||||
}
|
||||
|
||||
function cvSetVisible(node, visible)
|
||||
{
|
||||
if ( visible )
|
||||
node.removeAttribute("hide");
|
||||
else
|
||||
node.setAttribute("hide", "true");
|
||||
}
|
||||
|
||||
@@ -1,94 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
The contents of this file are subject to the Netscape Public
|
||||
License Version 1.1 (the "License"); you may not use this file
|
||||
except in compliance with the License. You may obtain a copy of
|
||||
the License at http://www.mozilla.org/NPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS
|
||||
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
implied. See the License for the specific language governing
|
||||
rights and limitations under the License.
|
||||
|
||||
The Original Code is Mozilla Communicator client code, released
|
||||
March 31, 1998.
|
||||
|
||||
The Initial Developer of the Original Code is Netscape
|
||||
Communications Corporation. Portions created by Netscape are
|
||||
Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
||||
Rights Reserved.
|
||||
-->
|
||||
|
||||
<!DOCTYPE window SYSTEM "chrome://addressbook/locale/abCardViewOverlay.dtd">
|
||||
|
||||
|
||||
<overlay xmlns:html="http://www.w3.org/TR/REC-html40"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<html:script language="JavaScript" src="chrome://addressbook/content/abCardViewOverlay.js"/>
|
||||
|
||||
<box id="CardViewBox"
|
||||
align="vertical"
|
||||
flex="100%"
|
||||
style="overflow:auto; background-color:#dddddd; padding-left:5px; padding-right:5px">
|
||||
|
||||
<html:div hide="true" style="font-size:150%; font-weight:bold; border-bottom:2px solid black" id="CardTitle">*</html:div>
|
||||
|
||||
<box align="horizontal" flex="100%">
|
||||
|
||||
<box align="vertical" flex="100%" style="width:100px">
|
||||
<box id="cvbName" align="vertical">
|
||||
<html:div class="CardViewHeading" hide="true" id="cvhName">*</html:div>
|
||||
<html:div class="CardViewText" hide="true" id="cvNickname">*</html:div>
|
||||
<html:div class="CardViewText" hide="true" id="cvEmail1">*</html:div>
|
||||
<html:div class="CardViewText" hide="true" id="cvEmail2">*</html:div>
|
||||
</box>
|
||||
|
||||
<box id="cvbHome" align="vertical">
|
||||
<html:div class="CardViewHeading" hide="true" id="cvhHome">&home.heading;</html:div>
|
||||
<html:div class="CardViewText" hide="true" id="cvHomeAddress">*</html:div>
|
||||
<html:div class="CardViewText" hide="true" id="cvHomeAddress2">*</html:div>
|
||||
<html:div class="CardViewText" hide="true" id="cvHomeCityStZip">*</html:div>
|
||||
<html:div class="CardViewText" hide="true" id="cvHomeCountry">*</html:div>
|
||||
</box>
|
||||
|
||||
<box id="cvbOther" align="vertical">
|
||||
<html:div class="CardViewHeading" hide="true" id="cvhOther">&other.heading;</html:div>
|
||||
<html:div class="CardViewText" hide="true" id="cvCustom1">*</html:div>
|
||||
<html:div class="CardViewText" hide="true" id="cvCustom2">*</html:div>
|
||||
<html:div class="CardViewText" hide="true" id="cvCustom3">*</html:div>
|
||||
<html:div class="CardViewText" hide="true" id="cvCustom4">*</html:div>
|
||||
<html:div class="CardViewText" hide="true" id="cvNotes">*</html:div>
|
||||
</box>
|
||||
</box>
|
||||
|
||||
<spring style="width:20px"/>
|
||||
|
||||
<box align="vertical" flex="100%" style="width:100px">
|
||||
<box id="cvbPhone" align="vertical">
|
||||
<html:div class="CardViewHeading" hide="true" id="cvhPhone">&phone.heading;</html:div>
|
||||
<html:div class="CardViewText" hide="true" id="cvPhWork">*</html:div>
|
||||
<html:div class="CardViewText" hide="true" id="cvPhHome">*</html:div>
|
||||
<html:div class="CardViewText" hide="true" id="cvPhFax">*</html:div>
|
||||
<html:div class="CardViewText" hide="true" id="cvPhCellular">*</html:div>
|
||||
<html:div class="CardViewText" hide="true" id="cvPhPager">*</html:div>
|
||||
</box>
|
||||
|
||||
<box id="cvbWork" align="vertical">
|
||||
<html:div class="CardViewHeading" hide="true" id="cvhWork">&work.heading;</html:div>
|
||||
<html:div class="CardViewText" hide="true" id="cvJobTitle">*</html:div>
|
||||
<html:div class="CardViewText" hide="true" id="cvDepartment">*</html:div>
|
||||
<html:div class="CardViewText" hide="true" id="cvCompany">*</html:div>
|
||||
<html:div class="CardViewText" hide="true" id="cvWorkAddress">*</html:div>
|
||||
<html:div class="CardViewText" hide="true" id="cvWorkAddress2">*</html:div>
|
||||
<html:div class="CardViewText" hide="true" id="cvWorkCityStZip">*</html:div>
|
||||
<html:div class="CardViewText" hide="true" id="cvWorkCountry">*</html:div>
|
||||
</box>
|
||||
</box>
|
||||
|
||||
</box>
|
||||
|
||||
</box>
|
||||
|
||||
</overlay>
|
||||
@@ -1,257 +0,0 @@
|
||||
// functions needed from abMainWindow and abSelectAddresses
|
||||
|
||||
// Controller object for Results Pane
|
||||
var ResultsPaneController =
|
||||
{
|
||||
IsCommandEnabled: function(command)
|
||||
{
|
||||
dump('ResultsPaneController::IsCommandEnabled(' + command + ')\n');
|
||||
switch ( command )
|
||||
{
|
||||
case "cmd_selectAll":
|
||||
return true;
|
||||
|
||||
case "cmd_delete":
|
||||
var resultsTree = document.getElementById('resultsTree');
|
||||
if ( resultsTree && resultsTree.selectedItems )
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
||||
DoCommand: function(command)
|
||||
{
|
||||
var resultsTree = document.getElementById('resultsTree');
|
||||
|
||||
switch ( command )
|
||||
{
|
||||
case "cmd_selectAll":
|
||||
if ( resultsTree )
|
||||
{
|
||||
dump("select all now!!!!!!" + "\n");
|
||||
resultsTree.selectAll();
|
||||
}
|
||||
break;
|
||||
|
||||
case "cmd_delete":
|
||||
if ( resultsTree )
|
||||
{
|
||||
var cardList = resultsTree.selectedItems;
|
||||
top.addressbook.DeleteCards(resultsTree, resultsTree, cardList);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// Controller object for Dir Pane
|
||||
var DirPaneController =
|
||||
{
|
||||
IsCommandEnabled: function(command)
|
||||
{
|
||||
dump('DirPaneController::IsCommandEnabled(' + command + ')\n');
|
||||
switch ( command )
|
||||
{
|
||||
case "cmd_selectAll":
|
||||
return true;
|
||||
case "cmd_delete":
|
||||
var dirTree = document.getElementById('dirTree');
|
||||
if ( dirTree && dirTree.selectedItems )
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
||||
DoCommand: function(command)
|
||||
{
|
||||
var dirTree = document.getElementById('dirTree');
|
||||
|
||||
switch ( command )
|
||||
{
|
||||
case "cmd_selectAll":
|
||||
if ( dirTree )
|
||||
{
|
||||
dump("select all now!!!!!!" + "\n");
|
||||
dirTree.selectAll();
|
||||
}
|
||||
break;
|
||||
|
||||
case "cmd_delete":
|
||||
if ( dirTree )
|
||||
top.addressbook.DeleteAddressBooks(dirTree.database, dirTree, dirTree.selectedItems);
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function SetupCommandUpdateHandlers()
|
||||
{
|
||||
var widget;
|
||||
|
||||
// dir pane
|
||||
widget = document.getElementById('dirTree');
|
||||
if ( widget )
|
||||
widget.controller = DirPaneController;
|
||||
|
||||
// results pane
|
||||
widget = document.getElementById('resultsTree');
|
||||
if ( widget )
|
||||
widget.controller = ResultsPaneController;
|
||||
}
|
||||
|
||||
|
||||
function AbNewCard()
|
||||
{
|
||||
var selectedAB = 0;
|
||||
var tree = document.getElementById('dirTree');
|
||||
if ( tree && tree.selectedItems && (tree.selectedItems.length == 1) )
|
||||
selectedAB = tree.selectedItems[0].getAttribute('id');
|
||||
|
||||
goNewCardDialog(selectedAB);
|
||||
}
|
||||
|
||||
function AbEditCard()
|
||||
{
|
||||
var rdf = Components.classes["component://netscape/rdf/rdf-service"].getService();
|
||||
rdf = rdf.QueryInterface(Components.interfaces.nsIRDFService);
|
||||
|
||||
var resultsTree = document.getElementById('resultsTree');
|
||||
|
||||
if ( resultsTree.selectedItems && resultsTree.selectedItems.length == 1 )
|
||||
{
|
||||
var uri = resultsTree.selectedItems[0].getAttribute('id');
|
||||
var card = rdf.GetResource(uri);
|
||||
card = card.QueryInterface(Components.interfaces.nsIAbCard);
|
||||
goEditCardDialog(document.getElementById('resultsTree').getAttribute('ref'),
|
||||
card, top.editCardCallback);
|
||||
}
|
||||
}
|
||||
|
||||
function AbNewMessage()
|
||||
{
|
||||
var msgComposeService = Components.classes["component://netscape/messengercompose"].getService();
|
||||
msgComposeService = msgComposeService.QueryInterface(Components.interfaces.nsIMsgComposeService);
|
||||
|
||||
msgComposeService.OpenComposeWindowWithValues(null, 0, GetSelectedAddresses(), null, null,
|
||||
null, null, null);
|
||||
}
|
||||
|
||||
function GetSelectedAddresses()
|
||||
{
|
||||
var item, uri, rdf, cardResource, card;
|
||||
var selectedAddresses = "";
|
||||
|
||||
var resultsTree = document.getElementById('resultsTree');
|
||||
|
||||
rdf = Components.classes["component://netscape/rdf/rdf-service"].getService();
|
||||
rdf = rdf.QueryInterface(Components.interfaces.nsIRDFService);
|
||||
|
||||
if ( resultsTree.selectedItems && resultsTree.selectedItems.length )
|
||||
{
|
||||
for ( item = 0; item < resultsTree.selectedItems.length; item++ )
|
||||
{
|
||||
uri = resultsTree.selectedItems[item].getAttribute('id');
|
||||
cardResource = rdf.GetResource(uri);
|
||||
card = cardResource.QueryInterface(Components.interfaces.nsIAbCard);
|
||||
if ( selectedAddresses )
|
||||
selectedAddresses += ",";
|
||||
selectedAddresses += "\"" + card.DisplayName + "\" <" + card.PrimaryEmail + ">";
|
||||
}
|
||||
}
|
||||
dump("selectedAddresses = " + selectedAddresses + "\n");
|
||||
return selectedAddresses;
|
||||
}
|
||||
|
||||
|
||||
function SelectFirstAddressBook()
|
||||
{
|
||||
var tree = document.getElementById('dirTree');
|
||||
var body = document.getElementById('dirTreeBody');
|
||||
if ( tree && body )
|
||||
{
|
||||
var treeitems = body.getElementsByTagName('treeitem');
|
||||
if ( treeitems && treeitems.length > 0 )
|
||||
{
|
||||
tree.selectItem(treeitems[0]);
|
||||
ChangeDirectoryByDOMNode(treeitems[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function DirPaneSelectionChange()
|
||||
{
|
||||
// FIX ME - deselect the items in the results pane to work around tree bug
|
||||
var resultsTree = document.getElementById('resultsTree');
|
||||
if ( resultsTree )
|
||||
resultsTree.clearItemSelection();
|
||||
// ----
|
||||
|
||||
var tree = document.getElementById('dirTree');
|
||||
if ( tree && tree.selectedItems && (tree.selectedItems.length == 1) )
|
||||
ChangeDirectoryByDOMNode(tree.selectedItems[0]);
|
||||
else
|
||||
{
|
||||
var tree = document.getElementById('resultsTree');
|
||||
if ( tree )
|
||||
tree.setAttribute('ref', null);
|
||||
}
|
||||
}
|
||||
|
||||
function ChangeDirectoryByDOMNode(dirNode)
|
||||
{
|
||||
var uri = dirNode.getAttribute('id');
|
||||
dump("uri = " + uri + "\n");
|
||||
|
||||
var tree = document.getElementById('resultsTree');
|
||||
if ( tree )
|
||||
tree.setAttribute('ref', uri);
|
||||
}
|
||||
|
||||
function ResultsPaneSelectionChange()
|
||||
{
|
||||
// FIX ME! - Should use some js var to determine abmain vs selectaddress dialog
|
||||
// not in ab window if no parent.parent.rdf
|
||||
if ( parent.parent.rdf )
|
||||
{
|
||||
var tree = document.getElementById('resultsTree');
|
||||
|
||||
if ( tree && tree.selectedItems && (tree.selectedItems.length == 1) )
|
||||
DisplayCardViewPane(tree.selectedItems[0]);
|
||||
else
|
||||
ClearCardViewPane();
|
||||
}
|
||||
}
|
||||
|
||||
function SortResultPane(column, sortKey)
|
||||
{
|
||||
var node = document.getElementById(column);
|
||||
if(!node) return(false);
|
||||
|
||||
var isupports = Components.classes["component://netscape/rdf/xul-sort-service"].getService();
|
||||
if (!isupports) return(false);
|
||||
|
||||
var xulSortService = isupports.QueryInterface(Components.interfaces.nsIXULSortService);
|
||||
if (!xulSortService) return(false);
|
||||
|
||||
// sort!!!
|
||||
sortDirection = "ascending";
|
||||
var currentDirection = node.getAttribute('sortDirection');
|
||||
if (currentDirection == "ascending")
|
||||
sortDirection = "descending";
|
||||
else if (currentDirection == "descending")
|
||||
sortDirection = "ascending";
|
||||
else sortDirection = "ascending";
|
||||
|
||||
xulSortService.Sort(node, sortKey, sortDirection);
|
||||
|
||||
return(true);
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
The contents of this file are subject to the Netscape Public
|
||||
License Version 1.1 (the "License"); you may not use this file
|
||||
except in compliance with the License. You may obtain a copy of
|
||||
the License at http://www.mozilla.org/NPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS
|
||||
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
implied. See the License for the specific language governing
|
||||
rights and limitations under the License.
|
||||
|
||||
The Original Code is Mozilla Communicator client code, released
|
||||
March 31, 1998.
|
||||
|
||||
The Initial Developer of the Original Code is Netscape
|
||||
Communications Corporation. Portions created by Netscape are
|
||||
Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
||||
Rights Reserved.
|
||||
-->
|
||||
|
||||
<!DOCTYPE window SYSTEM "chrome://addressbook/locale/abDirTreeOverlay.dtd">
|
||||
|
||||
|
||||
<overlay xmlns:html="http://www.w3.org/TR/REC-html40"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<!-- FIX ME - remove document.commandDispatcher.updateCommands() when tree selection calls this automatically -->
|
||||
<tree id="dirTree"
|
||||
class="abDirectory"
|
||||
style="width:100%; height:100%"
|
||||
ref="abdirectory://"
|
||||
open="true"
|
||||
datasources="rdf:addressdirectory"
|
||||
onselect="DirPaneSelectionChange(); document.commandDispatcher.updateCommands('select');">
|
||||
|
||||
<template>
|
||||
<rule>
|
||||
<treechildren>
|
||||
<treeitem uri="...">
|
||||
<treerow >
|
||||
<treecell indent="true" value="rdf:http://home.netscape.com/NC-rdf#DirName"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
</treechildren>
|
||||
</rule>
|
||||
</template>
|
||||
|
||||
<treecol rdf:resource="http://home.netscape.com/NC-rdf#DirName"/>
|
||||
|
||||
<treehead>
|
||||
<treerow>
|
||||
<treecell>&directoryColumn.label;</treecell>
|
||||
</treerow>
|
||||
</treehead>
|
||||
|
||||
<treechildren id="dirTreeBody"
|
||||
rdf:containment="http://home.netscape.com/NC-rdf#child"
|
||||
rdf:ignore="http://home.netscape.com/NC-rdf#CardChild">
|
||||
</treechildren>
|
||||
</tree>
|
||||
|
||||
</overlay>
|
||||
@@ -1,39 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
The contents of this file are subject to the Netscape Public
|
||||
License Version 1.1 (the "License"); you may not use this file
|
||||
except in compliance with the License. You may obtain a copy of
|
||||
the License at http://www.mozilla.org/NPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS
|
||||
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
implied. See the License for the specific language governing
|
||||
rights and limitations under the License.
|
||||
|
||||
The Original Code is Mozilla Communicator client code, released
|
||||
March 31, 1998.
|
||||
|
||||
The Initial Developer of the Original Code is Netscape
|
||||
Communications Corporation. Portions created by Netscape are
|
||||
Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
||||
Rights Reserved.
|
||||
-->
|
||||
<?xml-stylesheet href="chrome://addressbook/skin/" type="text/css"?>
|
||||
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
|
||||
<?xul-overlay href="chrome://addressbook/content/abCardOverlay.xul"?>
|
||||
|
||||
|
||||
<window xmlns:html="http://www.w3.org/TR/REC-html40"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
onload="OnLoadEditCard()"
|
||||
class="dialog"
|
||||
align="vertical">
|
||||
|
||||
<keyset id="keyset"/>
|
||||
|
||||
<box id="editcard"/>
|
||||
|
||||
<box id="okCancelButtons"/>
|
||||
|
||||
</window>
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
The contents of this file are subject to the Netscape Public
|
||||
License Version 1.1 (the "License"); you may not use this file
|
||||
except in compliance with the License. You may obtain a copy of
|
||||
the License at http://www.mozilla.org/NPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS
|
||||
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
implied. See the License for the specific language governing
|
||||
rights and limitations under the License.
|
||||
|
||||
The Original Code is Mozilla Communicator client code, released
|
||||
March 31, 1998.
|
||||
|
||||
The Initial Developer of the Original Code is Netscape
|
||||
Communications Corporation. Portions created by Netscape are
|
||||
Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
||||
Rights Reserved.
|
||||
-->
|
||||
<?xml-stylesheet href="chrome://addressbook/skin/" type="text/css"?>
|
||||
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
|
||||
<?xul-overlay href="chrome://addressbook/content/abCardOverlay.xul"?>
|
||||
|
||||
<!DOCTYPE window SYSTEM "chrome://addressbook/locale/abNewCardDialog.dtd">
|
||||
|
||||
|
||||
<window xmlns:html="http://www.w3.org/TR/REC-html40"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
title="&editcardWindow.title;"
|
||||
onload="OnLoadNewCard()"
|
||||
class="dialog"
|
||||
align="vertical">
|
||||
|
||||
<!--html:script language="JavaScript" src="resource:/res/samples/DumpDOM.js"/-->
|
||||
|
||||
<keyset id="keyset"/>
|
||||
|
||||
<box align="horizontal">
|
||||
<html:label for="abPopup">&chooseAddressBook.label;</html:label>
|
||||
<html:select id="abPopup" ref="abdirectory://" datasources="rdf:addressdirectory">
|
||||
<template>
|
||||
<html:option uri="..." value="rdf:http://home.netscape.com/NC-rdf#DirUri">
|
||||
<text value="rdf:http://home.netscape.com/NC-rdf#DirName"/>
|
||||
</html:option>
|
||||
</template>
|
||||
</html:select>
|
||||
</box>
|
||||
|
||||
<!--box align="horizontal">
|
||||
<html:label for="chooseAddressBook">&chooseAddressBook.label;</html:label>
|
||||
<html:select id="chooseAddressBook">
|
||||
</html:select>
|
||||
</box-->
|
||||
|
||||
<spring style="height:1em"/>
|
||||
|
||||
<box id="editcard"/>
|
||||
|
||||
<box id="okCancelButtons"/>
|
||||
|
||||
</window>
|
||||
@@ -1,66 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
The contents of this file are subject to the Netscape Public
|
||||
License Version 1.1 (the "License"); you may not use this file
|
||||
except in compliance with the License. You may obtain a copy of
|
||||
the License at http://www.mozilla.org/NPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS
|
||||
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
implied. See the License for the specific language governing
|
||||
rights and limitations under the License.
|
||||
|
||||
The Original Code is Mozilla Communicator client code, released
|
||||
March 31, 1998.
|
||||
|
||||
The Initial Developer of the Original Code is Netscape
|
||||
Communications Corporation. Portions created by Netscape are
|
||||
Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
||||
Rights Reserved.
|
||||
-->
|
||||
|
||||
<!DOCTYPE window SYSTEM "chrome://addressbook/locale/abResultsTreeOverlay.dtd">
|
||||
|
||||
|
||||
<overlay xmlns:html="http://www.w3.org/TR/REC-html40"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<!-- FIX ME - remove document.commandDispatcher.updateCommands() when tree selection calls this automatically -->
|
||||
<tree id="resultsTree"
|
||||
class="abResults"
|
||||
style="width:100%; height:100%"
|
||||
datasources="rdf:addressdirectory rdf:addresscard"
|
||||
onselect="top.ResultsPaneSelectionChange(); document.commandDispatcher.updateCommands('select');"
|
||||
ondblclick="top.AbEditCard()"
|
||||
containment="http://home.netscape.com/NC-rdf#CardChild">
|
||||
|
||||
<template>
|
||||
<rule>
|
||||
<treechildren>
|
||||
<treeitem uri="...">
|
||||
<treerow >
|
||||
<treecell indent="true" value="rdf:http://home.netscape.com/NC-rdf#DisplayName"/>
|
||||
<treecell value="rdf:http://home.netscape.com/NC-rdf#PrimaryEmail"/>
|
||||
<treecell value="rdf:http://home.netscape.com/NC-rdf#WorkPhone"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
</treechildren>
|
||||
</rule>
|
||||
</template>
|
||||
|
||||
<treecol style="width:20%" id="NameColumn" rdf:resource="http://home.netscape.com/NC-rdf#DisplayName"/>
|
||||
<treecol style="width:21%" id="EmailColumn" rdf:resource="http://home.netscape.com/NC-rdf#PrimaryEmail"/>
|
||||
<treecol style="width:20%" id="WorkPhoneColumn" rdf:resource="http://home.netscape.com/NC-rdf#WorkPhone"/>
|
||||
|
||||
<treehead>
|
||||
<treerow>
|
||||
<treecell onclick="return top.SortResultPane('NameColumn', 'http://home.netscape.com/NC-rdf#DisplayName');">&nameColumn.label;</treecell>
|
||||
<treecell onclick="return top.SortResultPane('EmailColumn', 'http://home.netscape.com/NC-rdf#PrimaryEmail');">&emailColumn.label;</treecell>
|
||||
<treecell onclick="return top.SortResultPane('WorkPhoneColumn', 'http://home.netscape.com/NC-rdf#WorkPhone');">&phoneColumn.label;</treecell>
|
||||
</treerow>
|
||||
</treehead>
|
||||
|
||||
</tree>
|
||||
|
||||
</overlay>
|
||||
@@ -1,183 +0,0 @@
|
||||
var addressbook = 0;
|
||||
var composeWindow = 0;
|
||||
var msgCompFields = 0;
|
||||
var editCardCallback = 0;
|
||||
|
||||
// localization strings
|
||||
var prefixTo = "To: ";
|
||||
var prefixCc = "Cc: ";
|
||||
var prefixBcc = "Bcc: ";
|
||||
|
||||
function OnLoadSelectAddress()
|
||||
{
|
||||
var toAddress="", ccAddress="", bccAddress="";
|
||||
|
||||
doSetOKCancel(SelectAddressOKButton, 0);
|
||||
|
||||
top.addressbook = Components.classes["component://netscape/addressbook"].createInstance();
|
||||
top.addressbook = top.addressbook.QueryInterface(Components.interfaces.nsIAddressBook);
|
||||
|
||||
// look in arguments[0] for parameters
|
||||
if (window.arguments && window.arguments[0])
|
||||
{
|
||||
// keep parameters in global for later
|
||||
if ( window.arguments[0].composeWindow )
|
||||
top.composeWindow = window.arguments[0].composeWindow;
|
||||
if ( window.arguments[0].msgCompFields )
|
||||
top.msgCompFields = window.arguments[0].msgCompFields;
|
||||
if ( window.arguments[0].toAddress )
|
||||
toAddress = window.arguments[0].toAddress;
|
||||
if ( window.arguments[0].ccAddress )
|
||||
ccAddress = window.arguments[0].ccAddress;
|
||||
if ( window.arguments[0].bccAddress )
|
||||
bccAddress = window.arguments[0].bccAddress;
|
||||
|
||||
dump("onload top.composeWindow: " + top.composeWindow + "\n");
|
||||
dump("onload toAddress: " + toAddress + "\n");
|
||||
|
||||
// put the addresses into the bucket
|
||||
AddAddressFromComposeWindow(toAddress, prefixTo);
|
||||
AddAddressFromComposeWindow(ccAddress, prefixCc);
|
||||
AddAddressFromComposeWindow(bccAddress, prefixBcc);
|
||||
}
|
||||
|
||||
SelectFirstAddressBook();
|
||||
}
|
||||
|
||||
function AddAddressFromComposeWindow(addresses, prefix)
|
||||
{
|
||||
if ( addresses )
|
||||
{
|
||||
var addressArray = addresses.split(",");
|
||||
|
||||
for ( var index = 0; index < addressArray.length; index++ )
|
||||
{
|
||||
// remove leading spaces
|
||||
while ( addressArray[index][0] == " " )
|
||||
addressArray[index] = addressArray[index].substring(1, addressArray[index].length);
|
||||
|
||||
AddAddressIntoBucket(prefix + addressArray[index]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function SelectAddressOKButton()
|
||||
{
|
||||
var body = document.getElementById('bucketBody');
|
||||
var item, row, cell, text, colon;
|
||||
var toAddress="", ccAddress="", bccAddress="";
|
||||
|
||||
for ( var index = 0; index < body.childNodes.length; index++ )
|
||||
{
|
||||
item = body.childNodes[index];
|
||||
if ( item.childNodes && item.childNodes.length )
|
||||
{
|
||||
row = item.childNodes[0];
|
||||
if ( row.childNodes && row.childNodes.length )
|
||||
{
|
||||
cell = row.childNodes[0];
|
||||
if ( cell.childNodes && cell.childNodes.length )
|
||||
{
|
||||
text = cell.childNodes[0];
|
||||
if ( text && text.data && text.data.length )
|
||||
{
|
||||
switch ( text.data[0] )
|
||||
{
|
||||
case prefixTo[0]:
|
||||
if ( toAddress )
|
||||
toAddress += ", ";
|
||||
toAddress += text.data.substring(prefixTo.length, text.data.length);
|
||||
break;
|
||||
case prefixCc[0]:
|
||||
if ( ccAddress )
|
||||
ccAddress += ", ";
|
||||
ccAddress += text.data.substring(prefixCc.length, text.data.length);
|
||||
break;
|
||||
case prefixBcc[0]:
|
||||
if ( bccAddress )
|
||||
bccAddress += ", ";
|
||||
bccAddress += text.data.substring(prefixBcc.length, text.data.length);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// reset the UI in compose window
|
||||
msgCompFields.SetTo(toAddress);
|
||||
msgCompFields.SetCc(ccAddress);
|
||||
msgCompFields.SetBcc(bccAddress);
|
||||
top.composeWindow.CompFields2Recipients(top.msgCompFields);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function SelectAddressToButton()
|
||||
{
|
||||
AddSelectedAddressesIntoBucket(prefixTo);
|
||||
}
|
||||
|
||||
function SelectAddressCcButton()
|
||||
{
|
||||
AddSelectedAddressesIntoBucket(prefixCc);
|
||||
}
|
||||
|
||||
function SelectAddressBccButton()
|
||||
{
|
||||
AddSelectedAddressesIntoBucket(prefixBcc);
|
||||
}
|
||||
|
||||
function AddSelectedAddressesIntoBucket(prefix)
|
||||
{
|
||||
var item, uri, rdf, cardResource, card, address;
|
||||
|
||||
rdf = Components.classes["component://netscape/rdf/rdf-service"].getService();
|
||||
rdf = rdf.QueryInterface(Components.interfaces.nsIRDFService);
|
||||
|
||||
var resultsTree = document.getElementById('resultsTree');
|
||||
|
||||
if ( resultsTree && resultsTree.selectedItems && resultsTree.selectedItems.length )
|
||||
{
|
||||
for ( item = 0; item < resultsTree.selectedItems.length; item++ )
|
||||
{
|
||||
uri = resultsTree.selectedItems[item].getAttribute('id');
|
||||
cardResource = rdf.GetResource(uri);
|
||||
card = cardResource.QueryInterface(Components.interfaces.nsIAbCard);
|
||||
address = prefix + "\"" + card.DisplayName + "\" <" + card.PrimaryEmail + ">";
|
||||
AddAddressIntoBucket(address);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function AddAddressIntoBucket(address)
|
||||
{
|
||||
var body = document.getElementById("bucketBody");
|
||||
|
||||
var item = document.createElement('treeitem');
|
||||
var row = document.createElement('treerow');
|
||||
var cell = document.createElement('treecell');
|
||||
var text = document.createTextNode(address);
|
||||
|
||||
cell.appendChild(text);
|
||||
row.appendChild(cell);
|
||||
item.appendChild(row);
|
||||
body.appendChild(item);
|
||||
}
|
||||
|
||||
function RemoveSelectedFromBucket()
|
||||
{
|
||||
var bucketTree = document.getElementById("addressBucket");
|
||||
if ( bucketTree )
|
||||
{
|
||||
var body = document.getElementById("bucketBody");
|
||||
|
||||
if ( body && bucketTree.selectedItems && bucketTree.selectedItems.length )
|
||||
{
|
||||
for ( var item = bucketTree.selectedItems.length - 1; item >= 0; item-- )
|
||||
body.removeChild(bucketTree.selectedItems[item]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,141 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
The contents of this file are subject to the Netscape Public
|
||||
License Version 1.1 (the "License"); you may not use this file
|
||||
except in compliance with the License. You may obtain a copy of
|
||||
the License at http://www.mozilla.org/NPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS
|
||||
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
implied. See the License for the specific language governing
|
||||
rights and limitations under the License.
|
||||
|
||||
The Original Code is Mozilla Communicator client code, released
|
||||
March 31, 1998.
|
||||
|
||||
The Initial Developer of the Original Code is Netscape
|
||||
Communications Corporation. Portions created by Netscape are
|
||||
Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
||||
Rights Reserved.
|
||||
-->
|
||||
<?xml-stylesheet href="chrome://addressbook/skin/" type="text/css"?>
|
||||
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
|
||||
<?xul-overlay href="chrome://addressbook/content/abDirTreeOverlay.xul"?>
|
||||
<?xul-overlay href="chrome://addressbook/content/abResultsTreeOverlay.xul"?>
|
||||
|
||||
|
||||
<!DOCTYPE window SYSTEM "chrome://addressbook/locale/abSelectAddressesDialog.dtd">
|
||||
|
||||
|
||||
<window xmlns:html="http://www.w3.org/TR/REC-html40"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
title="&selectAddressWindow.title;"
|
||||
class="dialog"
|
||||
width="640" height="480"
|
||||
style="width:100%; height:100%; padding:0px"
|
||||
onload="OnLoadSelectAddress()"
|
||||
align="vertical">
|
||||
|
||||
<html:script language="JavaScript" src="chrome://addressbook/content/abCommon.js"/>
|
||||
<html:script language="JavaScript" src="chrome://addressbook/content/abSelectAddressesDialog.js"/>
|
||||
<html:script language="JavaScript" src="chrome://messengercompose/content/MsgComposeCommands.js"/>
|
||||
<html:script language="JavaScript" src="chrome://global/content/globalOverlay.js"/>
|
||||
<!--html:script language="JavaScript" src="resource:/res/samples/DumpDOM.js"/-->
|
||||
|
||||
|
||||
<keyset id="keyset"/>
|
||||
|
||||
<!-- Thin box across top, show names containing & stop, search buttons -->
|
||||
<box align="horizontal" style="width:100%; padding:0px; padding-top:2px; padding-bottom:2px">
|
||||
<html:div flex="100%" style="vertical-align: middle;">
|
||||
<html:label for="searchtext" tabindex="0">&search.label;</html:label>
|
||||
<html:input type="text" id="searchtext" flex="100%"/>
|
||||
</html:div>
|
||||
|
||||
<spring style="width: 1em;"/>
|
||||
|
||||
<titledbutton id="stop" value="&stopButton.label;" class="push" onclick="SelectAddressStopButton()"/>
|
||||
<spring style="width:5px"/>
|
||||
<titledbutton id="search" value="&searchButton.label;" class="push" onclick="SelectAddressSearchButton()"/>
|
||||
</box>
|
||||
|
||||
<!-- Main box, 3 pane and majority of buttons -->
|
||||
<box align="horizontal" flex="100%">
|
||||
<!-- 3 Pane box -->
|
||||
<box align="horizontal" flex="100%" style="border-top:solid black 1px; border-bottom:solid black 1px">
|
||||
|
||||
<!-- dir tree -->
|
||||
<box align="horizontal"
|
||||
style="width:200px; height:100%; background-color:white; border-right:solid black 1px">
|
||||
<!-- FIX ME - div is hack to make tree scroll properly -->
|
||||
<html:div style="width:100px;height:100px" flex="1">
|
||||
<tree id="dirTree"/>
|
||||
</html:div>
|
||||
</box>
|
||||
|
||||
<splitter collapse="before"/>
|
||||
|
||||
<!-- Box that holds results pane, (to,cc,bcc buttons), and address bucket -->
|
||||
<box align="vertical" flex="100%" style="border-left:solid black 1px; border-right:solid black 1px">
|
||||
<!-- Box that holds results pane and (to,cc,bcc buttons) -->
|
||||
<box align="vertical" flex="100%">
|
||||
<!-- results tree -->
|
||||
<box flex="100%" align="vertical"
|
||||
style="background-color:white; border-bottom:solid black 1px">
|
||||
<!-- FIX ME - div is hack to make tree scroll properly -->
|
||||
<html:div style="width:100px;height:100px" flex="1">
|
||||
<tree id="resultsTree"/>
|
||||
</html:div>
|
||||
</box>
|
||||
|
||||
<!-- Box that holds (to,cc,bcc buttons) -->
|
||||
<box align="horizontal" style="padding:0.3em; border-bottom:solid black 1px">
|
||||
<spring flex="50%"/>
|
||||
<titledbutton id="toButton" value="&toButton.label;" class="push" onclick="SelectAddressToButton()"/>
|
||||
<spring style="width:10px"/>
|
||||
<titledbutton id="ccButton" value="&ccButton.label;" class="push" onclick="SelectAddressCcButton()"/>
|
||||
<spring style="width:10px"/>
|
||||
<titledbutton id="bccButton" value="&bccButton.label;" class="push" onclick="SelectAddressBccButton()"/>
|
||||
<spring flex="50%"/>
|
||||
</box>
|
||||
</box>
|
||||
|
||||
<splitter collapse="after"/>
|
||||
|
||||
<!-- Address bucket -->
|
||||
<box align="vertical" style="height:170px; background-color:white; border-top:solid black 1px">
|
||||
<html:div style="width:100px;height:100px" flex="1">
|
||||
<tree id="addressBucket" style="width:100%; height:100%">
|
||||
<treecol style="width:100%"/>
|
||||
<treechildren id="bucketBody"/>
|
||||
</tree>
|
||||
</html:div>
|
||||
</box>
|
||||
|
||||
</box>
|
||||
</box>
|
||||
|
||||
<!-- Box with buttons on right edge of window -->
|
||||
<box align="vertical" style="padding: .5em; padding-right: 0px">
|
||||
<box align="vertical" flex="50%">
|
||||
<spring style="height:10px"/>
|
||||
<titledbutton id="new" value="&newButton.label;" class="push" onclick="AbNewCard()"/>
|
||||
<spring style="height:10px"/>
|
||||
<titledbutton id="edit" value="&editButton.label;" class="push" onclick="AbEditCard()"/>
|
||||
<spring style="height:10px"/>
|
||||
<titledbutton id="view" value="&viewButton.label;" class="push" onclick="SelectAddressViewButton()"/>
|
||||
<spring flex="100%"/>
|
||||
</box>
|
||||
<box align="vertical" flex="50%">
|
||||
<spring flex="50%"/>
|
||||
<titledbutton id="remove" value="&removeButton.label;" class="push" onclick="RemoveSelectedFromBucket()"/>
|
||||
<spring flex="50%"/>
|
||||
</box>
|
||||
</box>
|
||||
</box>
|
||||
|
||||
<!-- OK & Cancel buttons -->
|
||||
<box id="okCancelButtons"/>
|
||||
|
||||
</window>
|
||||
@@ -1,183 +0,0 @@
|
||||
var addressbook = 0;
|
||||
var editCardCallback = 0;
|
||||
|
||||
// functions used only by addressbook
|
||||
|
||||
function OnLoadAddressBook()
|
||||
{
|
||||
// FIX ME - later we will be able to use onload from the overlay
|
||||
OnLoadCardView();
|
||||
|
||||
top.addressbook = Components.classes["component://netscape/addressbook"].createInstance();
|
||||
top.addressbook = top.addressbook.QueryInterface(Components.interfaces.nsIAddressBook);
|
||||
top.editCardCallback = UpdateCardView;
|
||||
|
||||
try {
|
||||
top.addressbook.SetWebShellWindow(window)
|
||||
}
|
||||
catch (ex) {
|
||||
dump("failed to set webshell window\n");
|
||||
}
|
||||
|
||||
SetupCommandUpdateHandlers();
|
||||
SelectFirstAddressBook();
|
||||
}
|
||||
|
||||
|
||||
function CommandUpdate_AddressBook()
|
||||
{
|
||||
dump("CommandUpdate_AddressBook\n");
|
||||
|
||||
// get selection info from dir pane
|
||||
var tree = document.getElementById('dirTree');
|
||||
var oneAddressBookSelected = false;
|
||||
if ( tree && tree.selectedItems && (tree.selectedItems.length == 1) )
|
||||
oneAddressBookSelected = true;
|
||||
dump("oneAddressBookSelected = " + oneAddressBookSelected + "\n");
|
||||
|
||||
// get selection info from results pane
|
||||
var selectedCards = GetSelectedAddresses();
|
||||
var oneOrMoreCardsSelected = false;
|
||||
if ( selectedCards )
|
||||
oneOrMoreCardsSelected = true;
|
||||
|
||||
// set commands to enabled / disabled
|
||||
goSetCommandEnabled('cmd_PrintCard', oneOrMoreCardsSelected);
|
||||
goSetCommandEnabled('cmd_SortByName', oneAddressBookSelected);
|
||||
goSetCommandEnabled('cmd_SortByEmail', oneAddressBookSelected);
|
||||
goSetCommandEnabled('cmd_SortByPhone', oneAddressBookSelected);
|
||||
|
||||
AbUpdateCommandDelete();
|
||||
}
|
||||
|
||||
|
||||
// This function updates the text of the delete menu item and sets the state of the delete button
|
||||
function AbUpdateCommandDelete()
|
||||
{
|
||||
var command = "cmd_delete";
|
||||
var focusedElement = document.commandDispatcher.focusedElement;
|
||||
|
||||
var id = 0;
|
||||
if ( focusedElement )
|
||||
id = focusedElement.getAttribute('id');
|
||||
|
||||
dump("focusedOn = " + id + "\n");
|
||||
|
||||
switch ( id )
|
||||
{
|
||||
case "dirTree":
|
||||
// menu text
|
||||
goSetMenuValue(command, 'valueAddressBook');
|
||||
// delete button
|
||||
var dirTree = document.getElementById('dirTree');
|
||||
var numSelected = 0;
|
||||
if ( dirTree && dirTree.selectedItems )
|
||||
numSelected = dirTree.selectedItems.length;
|
||||
goSetCommandEnabled('button_delete', (numSelected>0));
|
||||
break;
|
||||
case "resultsTree":
|
||||
// menu text
|
||||
var resultsTree = document.getElementById('resultsTree');
|
||||
var numSelected = 0;
|
||||
if ( resultsTree && resultsTree.selectedItems )
|
||||
numSelected = resultsTree.selectedItems.length;
|
||||
if ( numSelected < 2 )
|
||||
goSetMenuValue(command, 'valueCard');
|
||||
else
|
||||
goSetMenuValue(command, 'valueCards');
|
||||
// delete button
|
||||
goSetCommandEnabled('button_delete', (numSelected>0));
|
||||
break;
|
||||
default:
|
||||
goSetMenuValue(command, 'valueDefault');
|
||||
goSetCommandEnabled('button_delete', false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function UpdateCardView()
|
||||
{
|
||||
var tree = document.getElementById('resultsTree');
|
||||
|
||||
if ( tree && tree.selectedItems && (tree.selectedItems.length == 1) )
|
||||
DisplayCardViewPane(tree.selectedItems[0]);
|
||||
}
|
||||
|
||||
|
||||
function AbClose()
|
||||
{
|
||||
top.window.close();
|
||||
}
|
||||
|
||||
function AbNewAddressBook()
|
||||
{
|
||||
var dialog = window.openDialog("chrome://addressbook/content/abAddressBookNameDialog.xul",
|
||||
"",
|
||||
"chrome",
|
||||
{title:"New Address Book",
|
||||
okCallback:AbCreateNewAddressBook});
|
||||
}
|
||||
|
||||
function AbCreateNewAddressBook(name)
|
||||
{
|
||||
top.addressbook.NewAddressBook(document.getElementById('dirTree').database, document.getElementById('resultsTree'), name);
|
||||
}
|
||||
|
||||
function AbPrintCard()
|
||||
{
|
||||
dump("print card\n");
|
||||
try {
|
||||
addressbook.PrintCard();
|
||||
}
|
||||
catch (ex) {
|
||||
dump("failed to print card\n");
|
||||
}
|
||||
}
|
||||
|
||||
function AbPrintAddressBook()
|
||||
{
|
||||
dump("print address book \n");
|
||||
try {
|
||||
addressbook.PrintAddressbook();
|
||||
}
|
||||
catch (ex) {
|
||||
dump("failed to print address book\n");
|
||||
}
|
||||
}
|
||||
|
||||
function AbImport()
|
||||
{
|
||||
addressbook.ImportAddressBook();
|
||||
}
|
||||
|
||||
/*
|
||||
function AbDelete()
|
||||
{
|
||||
// dump("\AbDelete from XUL\n");
|
||||
var tree = document.getElementById('resultsTree');
|
||||
if ( tree )
|
||||
{
|
||||
//get the selected elements
|
||||
var cardList = tree.selectedItems;
|
||||
//get the current folder
|
||||
var srcDirectory = document.getElementById('resultsTree');
|
||||
dump("srcDirectory = " + srcDirectory + "\n");
|
||||
top.addressbook.DeleteCards(tree, srcDirectory, cardList);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
function AbDeleteDirectory()
|
||||
{
|
||||
// dump("\AbDeleteDirectory from XUL\n");
|
||||
var tree = document.getElementById('dirTree');
|
||||
|
||||
// if ( tree && tree.selectedItems && tree.selectedItems.length )
|
||||
if ( tree )
|
||||
top.addressbook.DeleteAddressBooks(tree.database, tree, tree.selectedItems);
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,247 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
The contents of this file are subject to the Netscape Public
|
||||
License Version 1.1 (the "License"); you may not use this file
|
||||
except in compliance with the License. You may obtain a copy of
|
||||
the License at http://www.mozilla.org/NPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS
|
||||
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
implied. See the License for the specific language governing
|
||||
rights and limitations under the License.
|
||||
|
||||
The Original Code is Mozilla Communicator client code, released
|
||||
March 31, 1998.
|
||||
|
||||
The Initial Developer of the Original Code is Netscape
|
||||
Communications Corporation. Portions created by Netscape are
|
||||
Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
||||
Rights Reserved.
|
||||
-->
|
||||
<?xml-stylesheet href="chrome://addressbook/skin/" type="text/css"?>
|
||||
<?xul-overlay href="chrome://global/content/globalOverlay.xul"?>
|
||||
<?xul-overlay href="chrome://global/content/tasksOverlay.xul"?>
|
||||
<?xul-overlay href="chrome://addressbook/content/abDirTreeOverlay.xul"?>
|
||||
<?xul-overlay href="chrome://addressbook/content/abResultsTreeOverlay.xul"?>
|
||||
<?xul-overlay href="chrome://addressbook/content/abCardViewOverlay.xul"?>
|
||||
|
||||
<!DOCTYPE window SYSTEM "chrome://addressbook/locale/abMainWindow.dtd">
|
||||
|
||||
|
||||
<window xmlns:html="http://www.w3.org/TR/REC-html40"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
height="420"
|
||||
width="600"
|
||||
align="vertical"
|
||||
title="&addressbookWindow.title;"
|
||||
windowtype="mail:addressbook"
|
||||
onload="OnLoadAddressBook()">
|
||||
|
||||
<html:script language="JavaScript" src="chrome://addressbook/content/addressbook.js"/>
|
||||
<html:script language="JavaScript" src="chrome://addressbook/content/abCommon.js"/>
|
||||
<!--html:script language="JavaScript" src="resource:/res/samples/DumpDOM.js"/-->
|
||||
|
||||
<commands id="commands">
|
||||
<commandset id="CommandUpdate_AddressBook"
|
||||
commandupdater="true"
|
||||
events="focus,blur,select"
|
||||
oncommandupdate="CommandUpdate_AddressBook()"/>
|
||||
|
||||
<commandset id="globalEditMenuItems"/>
|
||||
</commands>
|
||||
|
||||
<broadcasterset id="broadcasterset">
|
||||
<!-- File Menu -->
|
||||
<broadcaster id="cmd_newNavigator"/>
|
||||
<broadcaster id="cmd_newMessage"/>
|
||||
<broadcaster id="cmd_PrintCard" oncommand="AbPrintCard()" disabled="true"/>
|
||||
<broadcaster id="cmd_close" oncommand="AbClose()"/>
|
||||
<broadcaster id="cmd_quit"/>
|
||||
<!-- Edit Menu -->
|
||||
<broadcaster id="cmd_undo"/>
|
||||
<broadcaster id="cmd_redo"/>
|
||||
<broadcaster id="cmd_cut"/>
|
||||
<broadcaster id="cmd_copy"/>
|
||||
<broadcaster id="cmd_paste"/>
|
||||
<broadcaster id="cmd_delete"
|
||||
valueAddressBook="&deleteAbCmd.label;"
|
||||
valueCard="&deleteCardCmd.label;"
|
||||
valueCards="&deleteCardsCmd.label;"/>
|
||||
<broadcaster id='cmd_selectAll'/>
|
||||
<broadcaster id="cmd_preferences"/>
|
||||
</broadcasterset>
|
||||
|
||||
<keyset id="keyset">
|
||||
<!-- File Menu -->
|
||||
<key id="key_newNavigator"/>
|
||||
<key id="key_newMessage"/>
|
||||
<key id="key_PrintCard" command="true" key="&printCardViewCmd.key;" observes="cmd_PrintCard" />
|
||||
<key id="key_close"/>
|
||||
<key id="key_quit"/>
|
||||
<!-- Edit Menu -->
|
||||
<key id="key_undo"/>
|
||||
<key id="key_redo"/>
|
||||
<key id="key_cut"/>
|
||||
<key id="key_copy"/>
|
||||
<key id="key_paste"/>
|
||||
<key id="key_delete"/>
|
||||
<key id="key_selectAll"/>
|
||||
<key id="key_preferences"/>
|
||||
</keyset>
|
||||
|
||||
|
||||
<toolbox>
|
||||
<menubar>
|
||||
<menu id="menu_File">
|
||||
<menupopup id="menu_FilePopup">
|
||||
<menuitem value="&newCard.label;" accesskey="&newCard.accesskey;" oncommand="AbNewCard()"/>
|
||||
<menu id="menu_New">
|
||||
<menupopup>
|
||||
<menuitem value="&newListCmd.label;" accesskey="&newListCmd.accesskey;" oncommand="AbNewList()"/>
|
||||
<menuitem value="&newAddressBookCmd.label;" accesskey="&newAddressBookCmd.accesskey;" oncommand="AbNewAddressBook()"/>
|
||||
<menuitem value="&newDirectoryCmd.label;" accesskey="&newDirectoryCmd.accesskey;" oncommand="AbNewDirectoryt()"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="menu_newNavigator"/>
|
||||
<menuitem id="menu_newMessage"/>
|
||||
<menuitem id="cmd_newCard"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
<menuseparator/>
|
||||
<menuitem id="menu_close"/>
|
||||
<menuseparator/>
|
||||
<menuitem value="&importCmd.label;" oncommand="AbImport()"/>
|
||||
<menuitem value="&exportCmd.label;" oncommand="AbExport()"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="menu_pageSetup"/>
|
||||
<menuitem value="&printPreviewCmd.label;" oncommand="AbPrintPreview()"/>
|
||||
<menuitem value="&printCardViewCmd.label;" key="key_PrintCard" observes="cmd_PrintCard"/>
|
||||
<menuitem value="&printAddressBook.label;" oncommand="AbPrintAddressBook()"/>
|
||||
<menuseparator/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
|
||||
<menu id="menu_Edit">
|
||||
<menupopup>
|
||||
<menuitem id="menu_undo"/>
|
||||
<menuitem id="menu_redo"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="menu_cut"/>
|
||||
<menuitem id="menu_copy"/>
|
||||
<menuitem id="menu_paste"/>
|
||||
<menuitem id="menu_delete"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="menu_selectAll"/>
|
||||
<menuseparator/>
|
||||
<menuitem value="&editCardCmd.label;"
|
||||
accesskey="&editCardCmd.accesskey;"
|
||||
oncommand="AbEditCard();"/>
|
||||
<menuitem value="&htmlDomainCmd.label;"
|
||||
accesskey="&htmlDomainCmd.accesskey;"
|
||||
oncommand="AbHTMLDomain();"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="menu_preferences" oncommand="goPreferences('addressbook.xul', 'chrome://addressbook/content/pref-addressing.xul')"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
|
||||
<menu id="menu_View">
|
||||
<menupopup>
|
||||
<menu id="menu_Toolbars">
|
||||
<menupopup>
|
||||
<menuitem id="menu_showAbToolbar"
|
||||
value="&showAbToolbarCmd.label;"
|
||||
accesskey="&showAbToolbarCmd.accesskey;"
|
||||
oncommand="goToggleToolbar('abToolbar', 'menu_showAbToolbar')"
|
||||
checked="true"/>
|
||||
<menuitem id="menu_showTaskbar"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
<menuitem value="&showCardPane.label;" oncommand="AbShowCardPane()"/>
|
||||
<menu value="&sortMenu.label;">
|
||||
<menupopup>
|
||||
<menuitem value="&sortByNameCmd.label;"
|
||||
id="cmd_SortByName"
|
||||
disabled="true"
|
||||
oncommand="top.SortResultPane('NameColumn', 'http://home.netscape.com/NC-rdf#DisplayName')"/>
|
||||
<menuitem value="&sortByEmailCmd.label;"
|
||||
id="cmd_SortByEmail"
|
||||
disabled="true"
|
||||
oncommand="top.SortResultPane('EmailColumn', 'http://home.netscape.com/NC-rdf#PrimaryEmail')"/>
|
||||
<menuitem value="&sortByOrganizationCmd.label;" oncommand="AbSortByOrganization()"/>
|
||||
<menuitem value="&sortByNicknameCmd.label;" oncommand="AbSortByNickname()"/>
|
||||
<menuitem value="&sortByPhoneCmd.label;"
|
||||
id="cmd_SortByPhone"
|
||||
disabled="true"
|
||||
oncommand="top.SortResultPane('WorkPhoneColumn', 'http://home.netscape.com/NC-rdf#WorkPhone')"/>
|
||||
<menuitem value="&sortByCityCmd.label;" oncommand="AbSortByCity()"/>
|
||||
<menuseparator/>
|
||||
<menuitem value="&sortAscendingCmd.label;" oncommand="AbSortAscending()"/>
|
||||
<menuitem value="&sortDescendingCmd.label;" oncommand="AbSortDescending()"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
</menupopup>
|
||||
</menu>
|
||||
|
||||
<menu id="tasksMenu"/>
|
||||
<menu id="menu_Help"/>
|
||||
<spring flex="100%"/>
|
||||
</menubar>
|
||||
<toolbar id="abToolbar" persist="collapsed">
|
||||
<titledbutton src="&newcardButton.img;" align="top" value="&newcardButton.label;" onclick="AbNewCard()"/>
|
||||
<titledbutton src="&newlistButton.img;" align="top" value="&newlistButton.label;" onclick="AbNewList()"/>
|
||||
<titledbutton src="&editButton.img;" align="top" value="&editButton.label;" onclick="AbEditCard()"/>
|
||||
<titledbutton src="&newmsgButton.img;" align="top" value="&newmsgButton.label;" onclick="AbNewMessage()"/>
|
||||
<titledbutton id="button_delete" disabled="true" src="&deleteButton.img;" align="top" value="&deleteButton.label;" onclick="AbDelete()"/>
|
||||
|
||||
<html:div class="separator" align="vertical"/>
|
||||
|
||||
<box align="vertical">
|
||||
<spring flex="100%"/>
|
||||
<html:div style="padding-left:5px; padding-bottom:2px">&showNames.label;</html:div>
|
||||
<html:input id="searchtext" type="text" align="bottom" style="min-width:100px; min-height:25px; padding-bottom:0px"/>
|
||||
</box>
|
||||
|
||||
<titledbutton src="&stopButton.img;" align="top" value="&stopButton.label;" onclick="AbStop()"/>
|
||||
<titledbutton src="&searchButton.img;" align="top" value="&searchButton.label;" onclick="AbSearch()"/>
|
||||
<spring flex="100%"/>
|
||||
|
||||
<titledbutton id="Throbber" align="right" onclick="MsgHome('http://www.mozilla.org/')"/>
|
||||
</toolbar>
|
||||
</toolbox>
|
||||
|
||||
<!-- The main address book three pane -->
|
||||
<box align="horizontal" flex="100%">
|
||||
<!-- dir tree -->
|
||||
<box align="horizontal"
|
||||
style="width:200px; height:100%; background-color:white; border-right:solid black 1px">
|
||||
<!-- FIX ME - div is hack to make tree scroll properly -->
|
||||
<html:div style="width:100px;height:100px" flex="1">
|
||||
<tree id="dirTree"/>
|
||||
</html:div>
|
||||
</box>
|
||||
|
||||
<splitter collapse="before"/>
|
||||
|
||||
<box align="vertical" flex="100%" style="border-left:solid black 1px">
|
||||
<!-- results tree -->
|
||||
<box flex="50%" align="vertical"
|
||||
style="background-color:white; border-bottom:solid black 1px">
|
||||
<!-- FIX ME - div is hack to make tree scroll properly -->
|
||||
<html:div style="width:100px;height:100px" flex="1">
|
||||
<tree id="resultsTree"/>
|
||||
</html:div>
|
||||
</box>
|
||||
|
||||
<splitter collapse="after"/>
|
||||
|
||||
<!-- card view -->
|
||||
<box style="height:170px; border-top:solid black 1px">
|
||||
<box id="CardViewBox"/>
|
||||
</box>
|
||||
</box>
|
||||
</box>
|
||||
|
||||
<toolbox id="taskbox"/>
|
||||
|
||||
</window>
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
#!nmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
DEPTH=..\..\..\..
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
install::
|
||||
$(MAKE_INSTALL) abAddressBookNameDialog.js $(DIST)\bin\chrome\addressbook\content\default
|
||||
$(MAKE_INSTALL) abAddressBookNameDialog.xul $(DIST)\bin\chrome\addressbook\content\default
|
||||
$(MAKE_INSTALL) abCardOverlay.js $(DIST)\bin\chrome\addressbook\content\default
|
||||
$(MAKE_INSTALL) abCardOverlay.xul $(DIST)\bin\chrome\addressbook\content\default
|
||||
$(MAKE_INSTALL) abCardViewOverlay.js $(DIST)\bin\chrome\addressbook\content\default
|
||||
$(MAKE_INSTALL) abCardViewOverlay.xul $(DIST)\bin\chrome\addressbook\content\default
|
||||
$(MAKE_INSTALL) abCommon.js $(DIST)\bin\chrome\addressbook\content\default
|
||||
$(MAKE_INSTALL) abDirTreeOverlay.xul $(DIST)\bin\chrome\addressbook\content\default
|
||||
$(MAKE_INSTALL) abEditCardDialog.xul $(DIST)\bin\chrome\addressbook\content\default
|
||||
$(MAKE_INSTALL) abNewCardDialog.xul $(DIST)\bin\chrome\addressbook\content\default
|
||||
$(MAKE_INSTALL) abResultsTreeOverlay.xul $(DIST)\bin\chrome\addressbook\content\default
|
||||
$(MAKE_INSTALL) abSelectAddressesDialog.js $(DIST)\bin\chrome\addressbook\content\default
|
||||
$(MAKE_INSTALL) abSelectAddressesDialog.xul $(DIST)\bin\chrome\addressbook\content\default
|
||||
$(MAKE_INSTALL) addressbook.js $(DIST)\bin\chrome\addressbook\content\default
|
||||
$(MAKE_INSTALL) addressbook.xul $(DIST)\bin\chrome\addressbook\content\default
|
||||
|
||||
clobber::
|
||||
rm -f $(DIST)\chrome\addressbook\content\default\abAddressBookNameDialog.js
|
||||
rm -f $(DIST)\chrome\addressbook\content\default\abAddressBookNameDialog.xul
|
||||
rm -f $(DIST)\chrome\addressbook\content\default\abCardOverlay.js
|
||||
rm -f $(DIST)\chrome\addressbook\content\default\abCardOverlay.xul
|
||||
rm -f $(DIST)\chrome\addressbook\content\default\abCardViewOverlay.js
|
||||
rm -f $(DIST)\chrome\addressbook\content\default\abCardViewOverlay.xul
|
||||
rm -f $(DIST)\chrome\addressbook\content\default\abCommon.js
|
||||
rm -f $(DIST)\chrome\addressbook\content\default\abDirTreeOverlay.xul
|
||||
rm -f $(DIST)\chrome\addressbook\content\default\abEditCardDialog.xul
|
||||
rm -f $(DIST)\chrome\addressbook\content\default\abNewCardDialog.xul
|
||||
rm -f $(DIST)\chrome\addressbook\content\default\abResultsTreeOverlay.xul
|
||||
rm -f $(DIST)\chrome\addressbook\content\default\abSelectAddressesDialog.js
|
||||
rm -f $(DIST)\chrome\addressbook\content\default\abSelectAddressesDialog.xul
|
||||
rm -f $(DIST)\chrome\addressbook\content\default\addressbook.js
|
||||
rm -f $(DIST)\chrome\addressbook\content\default\addressbook.xul
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
#
|
||||
# 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 = ../../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
DIRS = en-US
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
abAddressBookNameDialog.dtd
|
||||
abCardOverlay.dtd
|
||||
abCardViewOverlay.dtd
|
||||
abDirTreeOverlay.dtd
|
||||
abMainWindow.dtd
|
||||
abNewCardDialog.dtd
|
||||
abResultsTreeOverlay.dtd
|
||||
abSelectAddressesDialog.dtd
|
||||
@@ -1,40 +0,0 @@
|
||||
#
|
||||
# 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 = ../../../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
EXPORT_RESOURCE_CONTENT = \
|
||||
$(srcdir)/abAddressBookNameDialog.dtd \
|
||||
$(srcdir)/abCardOverlay.dtd \
|
||||
$(srcdir)/abCardViewOverlay.dtd \
|
||||
$(srcdir)/abDirTreeOverlay.dtd \
|
||||
$(srcdir)/abMainWindow.dtd \
|
||||
$(srcdir)/abNewCardDialog.dtd \
|
||||
$(srcdir)/abResultsTreeOverlay.dtd \
|
||||
$(srcdir)/abSelectAddressesDialog.dtd \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
install::
|
||||
$(INSTALL) $(EXPORT_RESOURCE_CONTENT) $(DIST)/bin/chrome/addressbook/locale/en-US
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
<!--
|
||||
The contents of this file are subject to the Netscape Public
|
||||
License Version 1.1 (the "License"); you may not use this file
|
||||
except in compliance with the License. You may obtain a copy of
|
||||
the License at http://www.mozilla.org/NPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS
|
||||
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
implied. See the License for the specific language governing
|
||||
rights and limitations under the License.
|
||||
|
||||
The Original Code is Mozilla Communicator client code, released
|
||||
March 31, 1998.
|
||||
|
||||
The Initial Developer of the Original Code is Netscape
|
||||
Communications Corporation. Portions created by Netscape are
|
||||
Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
||||
Rights Reserved.
|
||||
-->
|
||||
|
||||
<!-- Labels -->
|
||||
<!ENTITY name.label "Address Book Name">
|
||||
@@ -1,65 +0,0 @@
|
||||
<!--
|
||||
The contents of this file are subject to the Netscape Public
|
||||
License Version 1.1 (the "License"); you may not use this file
|
||||
except in compliance with the License. You may obtain a copy of
|
||||
the License at http://www.mozilla.org/NPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS
|
||||
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
implied. See the License for the specific language governing
|
||||
rights and limitations under the License.
|
||||
|
||||
The Original Code is Mozilla Communicator client code, released
|
||||
March 31, 1998.
|
||||
|
||||
The Initial Developer of the Original Code is Netscape
|
||||
Communications Corporation. Portions created by Netscape are
|
||||
Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
||||
Rights Reserved.
|
||||
-->
|
||||
|
||||
<!-- Labels -->
|
||||
<!ENTITY Name.tab "Name">
|
||||
<!ENTITY Name.box "Name">
|
||||
<!ENTITY FirstName.label "First:">
|
||||
<!ENTITY LastName.label "Last:">
|
||||
<!ENTITY DisplayName.label "Display:">
|
||||
<!ENTITY NickName.label "Nickname:">
|
||||
<!ENTITY Internet.box "Internet">
|
||||
<!ENTITY PrimaryEmail.label "* Email:">
|
||||
<!ENTITY SecondEmail.label "Additional Email:">
|
||||
<!ENTITY SendPlainText.label "Send email as plain text (no html)">
|
||||
<!ENTITY Phones.box "Phones">
|
||||
<!ENTITY WorkPhone.label "Work:">
|
||||
<!ENTITY HomePhone.label "Home:">
|
||||
<!ENTITY FaxNumber.label "Fax:">
|
||||
<!ENTITY PagerNumber.label "Pager:">
|
||||
<!ENTITY CellularNumber.label "Cellular:">
|
||||
|
||||
<!ENTITY Address.tab "Address">
|
||||
<!ENTITY Home.box "Home">
|
||||
<!ENTITY HomeAddress.label "Address:">
|
||||
<!ENTITY HomeAddress2.label "">
|
||||
<!ENTITY HomeCity.label "City:">
|
||||
<!ENTITY HomeState.label "State:">
|
||||
<!ENTITY HomeZipCode.label "Zip:">
|
||||
<!ENTITY HomeCountry.label "Country:">
|
||||
<!ENTITY Work.box "Work">
|
||||
<!ENTITY JobTitle.label "Title:">
|
||||
<!ENTITY Department.label "Department:">
|
||||
<!ENTITY Company.label "Organization:">
|
||||
<!ENTITY WorkAddress.label "Address:">
|
||||
<!ENTITY WorkAddress2.label "">
|
||||
<!ENTITY WorkCity.label "City:">
|
||||
<!ENTITY WorkState.label "State:">
|
||||
<!ENTITY WorkZipCode.label "Zip:">
|
||||
<!ENTITY WorkCountry.label "Country:">
|
||||
<!--ENTITY Web.box "Web"-->
|
||||
<!ENTITY WebPage1.label "Web Page:">
|
||||
|
||||
<!ENTITY Other.tab "Other">
|
||||
<!ENTITY Custom1.label "Custom 1:">
|
||||
<!ENTITY Custom2.label "Custom 2:">
|
||||
<!ENTITY Custom3.label "Custom 3:">
|
||||
<!ENTITY Custom4.label "Custom 4:">
|
||||
<!ENTITY Notes.box "Notes">
|
||||
@@ -1,25 +0,0 @@
|
||||
<!--
|
||||
The contents of this file are subject to the Netscape Public
|
||||
License Version 1.1 (the "License"); you may not use this file
|
||||
except in compliance with the License. You may obtain a copy of
|
||||
the License at http://www.mozilla.org/NPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS
|
||||
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
implied. See the License for the specific language governing
|
||||
rights and limitations under the License.
|
||||
|
||||
The Original Code is Mozilla Communicator client code, released
|
||||
March 31, 1998.
|
||||
|
||||
The Initial Developer of the Original Code is Netscape
|
||||
Communications Corporation. Portions created by Netscape are
|
||||
Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
||||
Rights Reserved.
|
||||
-->
|
||||
|
||||
<!-- Box Headings -->
|
||||
<!ENTITY home.heading "Home">
|
||||
<!ENTITY other.heading "Other">
|
||||
<!ENTITY phone.heading "Phone">
|
||||
<!ENTITY work.heading "Work">
|
||||
@@ -1,22 +0,0 @@
|
||||
<!--
|
||||
The contents of this file are subject to the Netscape Public
|
||||
License Version 1.1 (the "License"); you may not use this file
|
||||
except in compliance with the License. You may obtain a copy of
|
||||
the License at http://www.mozilla.org/NPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS
|
||||
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
implied. See the License for the specific language governing
|
||||
rights and limitations under the License.
|
||||
|
||||
The Original Code is Mozilla Communicator client code, released
|
||||
March 31, 1998.
|
||||
|
||||
The Initial Developer of the Original Code is Netscape
|
||||
Communications Corporation. Portions created by Netscape are
|
||||
Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
||||
Rights Reserved.
|
||||
-->
|
||||
|
||||
<!-- Column Heading -->
|
||||
<!ENTITY directoryColumn.label "Directory">
|
||||
@@ -1,83 +0,0 @@
|
||||
<!--
|
||||
The contents of this file are subject to the Netscape Public
|
||||
License Version 1.1 (the "License"); you may not use this file
|
||||
except in compliance with the License. You may obtain a copy of
|
||||
the License at http://www.mozilla.org/NPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS
|
||||
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
implied. See the License for the specific language governing
|
||||
rights and limitations under the License.
|
||||
|
||||
The Original Code is Mozilla Communicator client code, released
|
||||
March 31, 1998.
|
||||
|
||||
The Initial Developer of the Original Code is Netscape
|
||||
Communications Corporation. Portions created by Netscape are
|
||||
Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
||||
Rights Reserved.
|
||||
-->
|
||||
|
||||
<!-- Title -->
|
||||
<!ENTITY addressbookWindow.title "Address Book">
|
||||
|
||||
<!-- Menus: the . means that the menu item isn't implemented yet -->
|
||||
|
||||
<!-- File Menu -->
|
||||
<!ENTITY newCard.label "New Address Book Card">
|
||||
<!ENTITY newCard.accesskey "n">
|
||||
<!ENTITY newListCmd.label ".Mailing List">
|
||||
<!ENTITY newListCmd.accesskey "l">
|
||||
<!ENTITY newAddressBookCmd.label "Address Book">
|
||||
<!ENTITY newAddressBookCmd.accesskey "b">
|
||||
<!ENTITY newDirectoryCmd.label ".Directory">
|
||||
<!ENTITY newDirectoryCmd.accesskey "d">
|
||||
<!ENTITY importCmd.label "Import...">
|
||||
<!ENTITY exportCmd.label ".Export...">
|
||||
<!ENTITY printPreviewCmd.label ".Print Preview">
|
||||
<!ENTITY printCardViewCmd.label ".Print Card View...">
|
||||
<!ENTITY printCardViewCmd.key "P">
|
||||
<!ENTITY printAddressBook.label ".Print Address Book...">
|
||||
|
||||
<!-- Edit Menu -->
|
||||
<!ENTITY deleteAbCmd.label "Delete Address Book">
|
||||
<!ENTITY deleteCardCmd.label "Delete Card">
|
||||
<!ENTITY deleteCardsCmd.label "Delete Selected Cards">
|
||||
<!ENTITY editCardCmd.label "Edit Card...">
|
||||
<!ENTITY editCardCmd.accesskey "e">
|
||||
<!ENTITY htmlDomainCmd.label ".HTML Domains...">
|
||||
<!ENTITY htmlDomainCmd.accesskey "h">
|
||||
|
||||
<!-- View Menu -->
|
||||
<!ENTITY showAbToolbarCmd.label "Show Address Book Toolbar">
|
||||
<!ENTITY showAbToolbarCmd.accesskey "a">
|
||||
<!ENTITY showCardPane.label ".Card Pane">
|
||||
<!ENTITY sortMenu.label "Sort">
|
||||
<!ENTITY sortByNameCmd.label "by Name">
|
||||
<!ENTITY sortByEmailCmd.label "by Email">
|
||||
<!ENTITY sortByOrganizationCmd.label ".by Organization">
|
||||
<!ENTITY sortByNicknameCmd.label ".by Nickname">
|
||||
<!ENTITY sortByPhoneCmd.label "by Phone Number">
|
||||
<!ENTITY sortByCityCmd.label ".by City">
|
||||
<!ENTITY sortAscendingCmd.label ".Ascending">
|
||||
<!ENTITY sortDescendingCmd.label ".Descending">
|
||||
<!ENTITY stopSearchingCmd.label ".Stop Searching">
|
||||
|
||||
<!-- Toolbar items -->
|
||||
<!ENTITY newcardButton.img "chrome://addressbook/skin/newcard.gif">
|
||||
<!ENTITY newcardButton.label "New Card">
|
||||
<!ENTITY newlistButton.img "chrome://addressbook/skin/newlist.gif">
|
||||
<!ENTITY newlistButton.label ".New List">
|
||||
<!ENTITY editButton.img "chrome://addressbook/skin/property.gif">
|
||||
<!ENTITY editButton.label "Edit">
|
||||
<!ENTITY newmsgButton.img "chrome://addressbook/skin/abnewmsg.gif">
|
||||
<!ENTITY newmsgButton.label "New Msg">
|
||||
<!ENTITY deleteButton.img "chrome://messenger/skin/trash.gif">
|
||||
<!ENTITY deleteButton.label "Delete">
|
||||
<!ENTITY stopButton.img "resource:/res/toolbar/TB_Stop.gif">
|
||||
<!ENTITY stopButton.label ".Stop">
|
||||
<!ENTITY searchButton.img "resource:/res/toolbar/TB_Search.gif">
|
||||
<!ENTITY searchButton.label ".Search">
|
||||
<!ENTITY showNames.label "Show names containing:">
|
||||
<!ENTITY throbber.img "resource:/res/throbber/anims00.gif">
|
||||
<!ENTITY throbber.url "http://www.mozilla.org/">
|
||||
@@ -1,24 +0,0 @@
|
||||
<!--
|
||||
The contents of this file are subject to the Netscape Public
|
||||
License Version 1.1 (the "License"); you may not use this file
|
||||
except in compliance with the License. You may obtain a copy of
|
||||
the License at http://www.mozilla.org/NPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS
|
||||
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
implied. See the License for the specific language governing
|
||||
rights and limitations under the License.
|
||||
|
||||
The Original Code is Mozilla Communicator client code, released
|
||||
March 31, 1998.
|
||||
|
||||
The Initial Developer of the Original Code is Netscape
|
||||
Communications Corporation. Portions created by Netscape are
|
||||
Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
||||
Rights Reserved.
|
||||
-->
|
||||
|
||||
<!-- Title -->
|
||||
<!ENTITY editcardWindow.title "New Card">
|
||||
<!-- Labels -->
|
||||
<!ENTITY chooseAddressBook.label "Add to: ">
|
||||
@@ -1,25 +0,0 @@
|
||||
<!--
|
||||
The contents of this file are subject to the Netscape Public
|
||||
License Version 1.1 (the "License"); you may not use this file
|
||||
except in compliance with the License. You may obtain a copy of
|
||||
the License at http://www.mozilla.org/NPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS
|
||||
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
implied. See the License for the specific language governing
|
||||
rights and limitations under the License.
|
||||
|
||||
The Original Code is Mozilla Communicator client code, released
|
||||
March 31, 1998.
|
||||
|
||||
The Initial Developer of the Original Code is Netscape
|
||||
Communications Corporation. Portions created by Netscape are
|
||||
Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
||||
Rights Reserved.
|
||||
-->
|
||||
|
||||
<!-- Column Headings -->
|
||||
<!ENTITY nameColumn.label "Name">
|
||||
<!ENTITY emailColumn.label "Email">
|
||||
<!-- LOCALIZATION NOTE (phoneColumn.label): "#" means "number" -->
|
||||
<!ENTITY phoneColumn.label "Phone#">
|
||||
@@ -1,40 +0,0 @@
|
||||
<!--
|
||||
The contents of this file are subject to the Netscape Public
|
||||
License Version 1.1 (the "License"); you may not use this file
|
||||
except in compliance with the License. You may obtain a copy of
|
||||
the License at http://www.mozilla.org/NPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS
|
||||
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
implied. See the License for the specific language governing
|
||||
rights and limitations under the License.
|
||||
|
||||
The Original Code is Mozilla Communicator client code, released
|
||||
March 31, 1998.
|
||||
|
||||
The Initial Developer of the Original Code is Netscape
|
||||
Communications Corporation. Portions created by Netscape are
|
||||
Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
||||
Rights Reserved.
|
||||
-->
|
||||
|
||||
|
||||
<!-- Title -->
|
||||
<!ENTITY selectAddressWindow.title "Select Addresses">
|
||||
|
||||
<!-- Buttons -->
|
||||
<!ENTITY toButton.label "To:">
|
||||
<!ENTITY ccButton.label "Cc:">
|
||||
<!ENTITY bccButton.label "Bcc:">
|
||||
<!ENTITY stopButton.label ".Stop">
|
||||
<!ENTITY searchButton.label ".Search...">
|
||||
<!ENTITY newButton.label "New...">
|
||||
<!ENTITY editButton.label "Edit...">
|
||||
<!ENTITY viewButton.label ".View">
|
||||
<!ENTITY removeButton.label "Remove">
|
||||
<!ENTITY okButton.label "OK">
|
||||
<!ENTITY cancelButton.label "Cancel">
|
||||
<!ENTITY helpButton.label ".Help">
|
||||
|
||||
<!-- Toolbar items -->
|
||||
<!ENTITY search.label "Show names containing:">
|
||||
@@ -1,43 +0,0 @@
|
||||
#!nmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
DEPTH=..\..\..\..\..
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
DISTBROWSER=$(DIST)\bin\chrome\addressbook\locale\en-US
|
||||
|
||||
|
||||
install::
|
||||
$(MAKE_INSTALL) abAddressBookNameDialog.dtd $(DISTBROWSER)
|
||||
$(MAKE_INSTALL) abCardOverlay.dtd $(DISTBROWSER)
|
||||
$(MAKE_INSTALL) abCardViewOverlay.dtd $(DISTBROWSER)
|
||||
$(MAKE_INSTALL) abDirTreeOverlay.dtd $(DISTBROWSER)
|
||||
$(MAKE_INSTALL) abMainWindow.dtd $(DISTBROWSER)
|
||||
$(MAKE_INSTALL) abNewCardDialog.dtd $(DISTBROWSER)
|
||||
$(MAKE_INSTALL) abResultsTreeOverlay.dtd $(DISTBROWSER)
|
||||
$(MAKE_INSTALL) abSelectAddressesDialog.dtd $(DISTBROWSER)
|
||||
|
||||
clobber::
|
||||
rm -f $(DIST)\bin\chrome\addressbook\locale\en-US\abAddressBookNameDialog.dtd
|
||||
rm -f $(DIST)\bin\chrome\addressbook\locale\en-US\abCardOverlay.dtd
|
||||
rm -f $(DIST)\bin\chrome\addressbook\locale\en-US\abCardViewOverlay.dtd
|
||||
rm -f $(DIST)\bin\chrome\addressbook\locale\en-US\abDirTreeOverlay.dtd
|
||||
rm -f $(DIST)\bin\chrome\addressbook\locale\en-US\abMainWindow.dtd
|
||||
rm -f $(DIST)\bin\chrome\addressbook\locale\en-US\abNewCardDialog.dtd
|
||||
rm -f $(DIST)\bin\chrome\addressbook\locale\en-US\abResultsTreeOverlay.dtd
|
||||
rm -f $(DIST)\bin\chrome\addressbook\locale\en-US\abSelectAddressesDialog.dtd
|
||||
@@ -1,22 +0,0 @@
|
||||
#!nmake
|
||||
#
|
||||
# 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=..\..\..\..
|
||||
|
||||
DIRS= en-US
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
@@ -1,22 +0,0 @@
|
||||
#!nmake
|
||||
#
|
||||
# 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=..\..\..
|
||||
|
||||
DIRS= content locale skin
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
@@ -1,27 +0,0 @@
|
||||
# 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.
|
||||
#
|
||||
# This is a list of local files which get copied to the res\mailnews\messenger directory
|
||||
#
|
||||
|
||||
addressbook.css
|
||||
newcard.gif
|
||||
newlist.gif
|
||||
property.gif
|
||||
abnewmsg.gif
|
||||
person.gif
|
||||
list.gif
|
||||
myaddrbk.gif
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
#
|
||||
# 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 = ../../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
SAMPLES_DIR = $(DIST)/bin/chrome/addressbook/skin/default
|
||||
|
||||
EXPORT_RESOURCE_SAMPLES = \
|
||||
addressbook.css \
|
||||
newcard.gif \
|
||||
newlist.gif \
|
||||
property.gif \
|
||||
abnewmsg.gif \
|
||||
person.gif \
|
||||
list.gif \
|
||||
myaddrbk.gif \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
GARBAGE += $(addprefix $(SAMPLES_DIR)/, $(EXPORT_RESOURCE_SAMPLES))
|
||||
|
||||
install::
|
||||
$(INSTALL) $(addprefix $(srcdir)/, $(EXPORT_RESOURCE_SAMPLES)) $(SAMPLES_DIR)
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 285 B |
@@ -1,78 +0,0 @@
|
||||
/*
|
||||
The contents of this file are subject to the Netscape Public
|
||||
License Version 1.1 (the "License"); you may not use this file
|
||||
except in compliance with the License. You may obtain a copy of
|
||||
the License at http://www.mozilla.org/NPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS
|
||||
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
implied. See the License for the specific language governing
|
||||
rights and limitations under the License.
|
||||
|
||||
The Original Code is Mozilla Communicator client code, released
|
||||
March 31, 1998.
|
||||
|
||||
The Initial Developer of the Original Code is Netscape
|
||||
Communications Corporation. Portions created by Netscape are
|
||||
Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
||||
Rights Reserved.
|
||||
*/
|
||||
|
||||
/* CardEdit styles - used in the Card Edit Dialog */
|
||||
|
||||
box[class="CardEditWidth"] {
|
||||
width : 24.4em;
|
||||
margin-left : 0px;
|
||||
margin-right : 8px;
|
||||
}
|
||||
|
||||
input[class="CardEdit"] {
|
||||
width : 25em;
|
||||
height : 1.5em;
|
||||
margin : 0px;
|
||||
padding : 0px;
|
||||
padding-right : 0px;
|
||||
min-height : 1.5em;
|
||||
}
|
||||
|
||||
|
||||
/* CardView styles - used in the Card View Pane*/
|
||||
|
||||
div[class="CardViewHeading"] {
|
||||
padding: 1px;
|
||||
padding-left: 5px;
|
||||
color: white;
|
||||
background-color: #5050ff;
|
||||
font-weight: bold;
|
||||
margin-top: 8px;
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
|
||||
div[class="CardViewText"] {
|
||||
padding-left: 20px;
|
||||
padding-right: 2px;
|
||||
color:inherit;
|
||||
}
|
||||
|
||||
|
||||
/* Custom Trees */
|
||||
|
||||
tree[class="abDirectory"] treeitem > treerow > treecell > .tree-icon {
|
||||
list-style-image: url("chrome://addressbook/skin/myaddrbk.gif");
|
||||
}
|
||||
|
||||
tree[class="abResults"] treeitem > treerow > treecell > .tree-icon {
|
||||
list-style-image: url("chrome://addressbook/skin/person.gif");
|
||||
}
|
||||
|
||||
|
||||
/* Address Book specific style */
|
||||
|
||||
[hide] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
titledbutton#Throbber
|
||||
{
|
||||
list-style-image:url(chrome://navigator/skin/animthrob_single.gif);
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 165 B |
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user