Compare commits

..

3 Commits

Author SHA1 Message Date
dkl%redhat.com
b52a1dc48a Various fixes. Added CanSeeProduct functionality back in but also left in old style product groups. Removed references to usebuggroupsentry and usebuggroups since we want it on all the time.
git-svn-id: svn://10.0.0.236/branches/Bugzilla_PgSQL_Groups_Branch@122814 18797224-902f-48f8-a5cc-f745e15eee43
2002-06-06 18:07:41 +00:00
dkl%redhat.com
48b5f960fd Initial creation of Bugzilla_PgSQL_Groups_Branch 2002/05/23
git-svn-id: svn://10.0.0.236/branches/Bugzilla_PgSQL_Groups_Branch@122087 18797224-902f-48f8-a5cc-f745e15eee43
2002-05-23 19:34:21 +00:00
(no author)
73bf11394f This commit was manufactured by cvs2svn to create branch
'Bugzilla_PgSQL_Groups_Branch'.

git-svn-id: svn://10.0.0.236/branches/Bugzilla_PgSQL_Groups_Branch@122018 18797224-902f-48f8-a5cc-f745e15eee43
2002-05-22 09:21:37 +00:00
877 changed files with 104276 additions and 119715 deletions

View File

@@ -1,142 +0,0 @@
#!/usr/bin/perl
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Mozilla Mac OS X Universal Binary Packaging System
#
# The Initial Developer of the Original Code is Google Inc.
# Portions created by the Initial Developer are Copyright (C) 2006
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Mark Mentovai <mark@moxienet.com> (Original Author)
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
use strict;
use warnings;
use Archive::Zip(':ERROR_CODES');
my ($BUILDCONFIG);
sub fixBuildconfig($$);
$BUILDCONFIG = 'content/global/buildconfig.html';
if (scalar(@ARGV) != 2) {
print STDERR ("usage: fix-buildconfig <zipfile1> <zipfile2>\n");
exit(1);
}
if (!fixBuildconfig($ARGV[0], $ARGV[1])) {
exit(1);
}
exit(0);
sub fixBuildconfig($$) {
my ($zipPath1, $zipPath2);
($zipPath1, $zipPath2) = @_;
my ($ze, $zip1, $zip2);
$zip1 = Archive::Zip->new();
if (($ze = $zip1->read($zipPath1)) != AZ_OK) {
print STDERR ($0.': could not read "'.$zipPath1.'": error '.$ze."\n");
return 0;
}
$zip2 = Archive::Zip->new();
if (($ze = $zip2->read($zipPath2)) != AZ_OK) {
print STDERR ($0.': could not read "'.$zipPath2.'": error '.$ze."\n");
return 0;
}
my ($contents1, $contents2);
if (!defined($contents1 = $zip1->contents($BUILDCONFIG))) {
print STDERR ($0.': could not get "'.$BUILDCONFIG.'" from "'.$zipPath1.'"'.
"\n");
return 0;
}
if (!defined($contents2 = $zip2->contents($BUILDCONFIG))) {
print STDERR ($0.': could not get "'.$BUILDCONFIG.'" from "'.$zipPath2.'"'.
"\n");
return 0;
}
my (@lines1, @lines2);
@lines1 = split(/\n/, $contents1);
@lines2 = split(/\n/, $contents2);
my ($line, @linesNew);
@linesNew = ();
# Copy everything from the first file up to the end of its <body>.
while ($line = shift(@lines1)) {
if ($line eq '</body>') {
last;
}
push(@linesNew, $line);
}
# Insert a <hr> between the two files.
push (@linesNew, '<hr> </hr>');
# Copy the second file's content beginning after its leading <h1> and <p>.
while ($line = shift(@lines2)) {
if ($line eq '<p> </p>') {
last;
}
}
while ($line = shift(@lines2)) {
push(@linesNew, $line);
}
my ($contentsNew);
$contentsNew = join("\n", @linesNew);
if (!defined($zip1->contents($BUILDCONFIG, $contentsNew))) {
print STDERR ($0.': could not set "'.$BUILDCONFIG.'" to "'.$zipPath1.'"'.
"\n");
return 0;
}
if (!defined($zip2->contents($BUILDCONFIG, $contentsNew))) {
print STDERR ($0.': could not set "'.$BUILDCONFIG.'" to "'.$zipPath2.'"'.
"\n");
return 0;
}
if (($ze = $zip1->overwrite()) != AZ_OK) {
print STDERR ($0.': could not write "'.$zipPath1.'": error '.$ze."\n");
return 0;
}
if (($ze = $zip2->overwrite()) != AZ_OK) {
print STDERR ($0.': could not write "'.$zipPath2.'": error '.$ze."\n");
return 0;
}
return 1;
}

View File

@@ -1,112 +0,0 @@
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Mozilla Mac OS X Universal Binary Packaging System
#
# The Initial Developer of the Original Code is Google Inc.
# Portions created by the Initial Developer are Copyright (C) 2006
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Mark Mentovai <mark@moxienet.com> (Original Author)
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
# BE CAREFUL! This makefile handles a postflight_all rule for a
# multi-project build, so DON'T rely on anything that might differ between
# the two OBJDIRs.
ifndef OBJDIR
OBJDIR_PPC = $(MOZ_OBJDIR)/ppc
OBJDIR_X86 = $(MOZ_OBJDIR)/i386
DIST_PPC = $(OBJDIR_PPC)/dist
DIST_X86 = $(OBJDIR_X86)/dist
DIST_UNI = $(DIST_PPC)/universal
OBJDIR = $(OBJDIR_PPC)
endif
include $(OBJDIR)/config/autoconf.mk
DIST = $(OBJDIR)/dist
ifdef MOZ_DEBUG
DBGTAG = Debug
else
DBGTAG =
endif
APP_CONTENTS = Contents/MacOS
ifeq ($(MOZ_BUILD_APP),macbrowser) # {
INSTALLER_DIR = camino/installer
MOZ_PKG_APPNAME = camino
APPNAME = Camino.app
BUILDCONFIG_JAR = Contents/MacOS/chrome/embed.jar
else # } {
MOZ_PKG_APPNAME = $(MOZ_APP_NAME)
APPNAME = $(MOZ_APP_DISPLAYNAME)$(DBGTAG).app
BUILDCONFIG_JAR = Contents/MacOS/chrome/toolkit.jar
INSTALLER_DIR = $(MOZ_BUILD_APP)/installer
ifeq ($(MOZ_BUILD_APP),suite) # {
INSTALLER_DIR = xpinstall/packager
endif # } suite
ifeq ($(MOZ_BUILD_APP),xulrunner) # {
INSTALLER_DIR = xulrunner/installer/mac
BUILDCONFIG_JAR = Versions/Current/chrome/toolkit.jar
APPNAME = XUL.framework
APP_CONTENTS = Versions/Current
endif # } xulrunner
endif # } !camino
postflight_all:
# Build the universal package out of only the bits that would be released.
# Call the packager to set this up. Set UNIVERSAL_BINARY= to avoid producing
# a universal binary too early, before the unified bits have been staged.
# Set SIGN_NSS= to skip shlibsign.
$(MAKE) -C $(OBJDIR_PPC)/$(INSTALLER_DIR) \
UNIVERSAL_BINARY= SIGN_NSS= stage-package
$(MAKE) -C $(OBJDIR_X86)/$(INSTALLER_DIR) \
UNIVERSAL_BINARY= SIGN_NSS= stage-package
# Remove .chk files that may have been copied from the NSS build. These will
# cause unify to warn or fail if present. New .chk files that are
# appropriate for the merged libraries will be generated when the universal
# dmg is built.
rm -f $(DIST_PPC)/$(MOZ_PKG_APPNAME)/$(APPNAME)/$(APP_CONTENTS)/*.chk \
$(DIST_X86)/$(MOZ_PKG_APPNAME)/$(APPNAME)/$(APP_CONTENTS)/*.chk
# The only difference betewen the two trees now should be the
# about:buildconfig page. Fix it up.
$(TOPSRCDIR)/build/macosx/universal/fix-buildconfig \
$(DIST_PPC)/$(MOZ_PKG_APPNAME)/$(APPNAME)/$(BUILDCONFIG_JAR) \
$(DIST_X86)/$(MOZ_PKG_APPNAME)/$(APPNAME)/$(BUILDCONFIG_JAR)
mkdir -p $(DIST_UNI)/$(MOZ_PKG_APPNAME)
rm -f $(DIST_X86)/universal
ln -s $(DIST_UNI) $(DIST_X86)/universal
rm -rf $(DIST_UNI)/$(MOZ_PKG_APPNAME)/$(APPNAME)
$(TOPSRCDIR)/build/macosx/universal/unify \
$(DIST_PPC)/$(MOZ_PKG_APPNAME)/$(APPNAME) \
$(DIST_X86)/$(MOZ_PKG_APPNAME)/$(APPNAME) \
$(DIST_UNI)/$(MOZ_PKG_APPNAME)/$(APPNAME)
# A universal .dmg can now be produced by making in either architecture's
# INSTALLER_DIR.

View File

@@ -1,102 +0,0 @@
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Mozilla Mac OS X Universal Binary Packaging System
#
# The Initial Developer of the Original Code is Google Inc.
# Portions created by the Initial Developer are Copyright (C) 2006
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Mark Mentovai <mark@moxienet.com> (Original Author)
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
# As used here, arguments in $MOZ_BUILD_PROJECTS are suitable as arguments
# to gcc's -arch parameter.
mk_add_options MOZ_BUILD_PROJECTS="ppc i386"
mk_add_options MOZ_UNIFY_BDATE=1
mk_add_options MOZ_POSTFLIGHT_ALL+=build/macosx/universal/flight.mk
DARWIN_VERSION=`uname -r`
ac_add_app_options ppc --target=powerpc-apple-darwin$DARWIN_VERSION
ac_add_app_options i386 --target=i386-apple-darwin$DARWIN_VERSION
# ppc builds run on older systems. The minimum SDK for x86 is 10.4u.
ac_add_app_options ppc --with-macos-sdk=/Developer/SDKs/MacOSX10.2.8.sdk
ac_add_app_options i386 --with-macos-sdk=/Developer/SDKs/MacOSX10.4u.sdk
# $MOZ_BUILD_APP is only defined when sourced by configure. That's not a
# problem, because the variables it affects only need to be set for
# configure.
if test -n "$MOZ_BUILD_APP" ; then
TARGET_CPU=$MOZ_BUILD_APP
# When compiling C++, Apple gcc 4.0 produces output that requires a minimum
# of 10.3.9. Use 4.0 for the x86 build, which has a higher minimum than
# that. Use 3.3 for ppc, which must run on older systems. This will
# completely override the compiler selected with the gcc_select command.
if test "$TARGET_CPU" = "ppc" ; then
GCC_VERSION=3.3
else
GCC_VERSION=4.0
fi
# It's not strictly necessary to specify -arch during native builds, but it
# makes the merged about:buildconfig easier to follow, and it reduces
# conditionalized differences between builds.
CC="gcc-$GCC_VERSION -arch $TARGET_CPU"
CXX="g++-$GCC_VERSION -arch $TARGET_CPU"
# $HOST_CXX is presently unused. $HOST_CC will only be used during a cross
# compile. Always use the 4.0 compiler, since it will always be present and
# will always work.
HOST_CC=gcc-4.0
HOST_CXX=g++-4.0
# These must be set for cross builds, and don't hurt straight builds.
RANLIB=ranlib
AR=ar
AS=$CC
LD=ld
STRIP="strip -x -S"
NATIVE_CPU=`uname -p`
if test "$NATIVE_CPU" = "powerpc" ; then
NATIVE_CPU=ppc
fi
# Let configure know that we mean business.
if test "$NATIVE_CPU" != "$TARGET_CPU" ; then
CROSS_COMPILE=1
fi
# Each per-CPU build should be entirely oblivious to the fact that a
# universal binary will be produced. The exception is packager.mk, which
# needs to know to look for universal bits when building the .dmg.
UNIVERSAL_BINARY=1
fi

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,876 +0,0 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 39;
objects = {
0259C573FE90428111CA0C5A = {
buildSettings = {
MACOSX_DEPLOYMENT_TARGET = 10.2;
SDKROOT = /Developer/SDKs/MacOSX10.2.8.sdk;
};
buildStyles = (
2E58F360FFB2326E11CA0CBA,
2E58F361FFB2326E11CA0CBA,
);
hasScannedForEncodings = 1;
isa = PBXProject;
mainGroup = 0259C574FE90428111CA0C5A;
projectDirPath = "";
targets = (
8D1AC9600486D14A00FE50C9,
53DF68FC067E5B5A0090B5B0,
53DF6901067E5B8E0090B5B0,
);
};
0259C574FE90428111CA0C5A = {
children = (
32DBCF9E0370C38000C91783,
54D33B2C06778E4400C9C163,
0259C582FE90428111CA0C5A,
1ED78706FE9D4A0611CA0C5A,
2E58F364FFB232C311CA0CBA,
);
isa = PBXGroup;
name = CaminoViewsPalette;
refType = 4;
sourceTree = "<group>";
};
0259C582FE90428111CA0C5A = {
children = (
8D1AC9730486D14A00FE50C9,
53DF68FE067E5B5A0090B5B0,
8D1AC97F0486D23B00FE50C9,
);
isa = PBXGroup;
name = Resources;
refType = 4;
sourceTree = "<group>";
};
0259C583FE90428111CA0C5A = {
fileEncoding = 4;
isa = PBXFileReference;
lastKnownFileType = text.xml;
name = palette.table;
path = resources/palette.table;
refType = 4;
sourceTree = "<group>";
};
//020
//021
//022
//023
//024
//0F0
//0F1
//0F2
//0F3
//0F4
0F1C93520934047000C95167 = {
fileEncoding = 30;
isa = PBXFileReference;
lastKnownFileType = sourcecode.c.objc;
name = CaminoViewsInspector.m;
path = src/CaminoViewsInspector.m;
refType = 2;
sourceTree = SOURCE_ROOT;
};
0F1C93530934047000C95167 = {
fileEncoding = 30;
isa = PBXFileReference;
lastKnownFileType = sourcecode.c.objc;
name = CaminoViewsPalette.m;
path = src/CaminoViewsPalette.m;
refType = 2;
sourceTree = SOURCE_ROOT;
};
0F1C93540934047000C95167 = {
fileEncoding = 30;
isa = PBXFileReference;
lastKnownFileType = sourcecode.c.h;
name = CaminoViewsInspector.h;
path = src/CaminoViewsInspector.h;
refType = 2;
sourceTree = SOURCE_ROOT;
};
0F1C93550934047000C95167 = {
fileEncoding = 30;
isa = PBXFileReference;
lastKnownFileType = sourcecode.c.h;
name = CaminoViewsPalette.h;
path = src/CaminoViewsPalette.h;
refType = 2;
sourceTree = SOURCE_ROOT;
};
0F1C93560934047000C95167 = {
fileRef = 0F1C93520934047000C95167;
isa = PBXBuildFile;
settings = {
};
};
0F1C93570934047000C95167 = {
fileRef = 0F1C93530934047000C95167;
isa = PBXBuildFile;
settings = {
};
};
0F4523E509401BB100F61E1E = {
fileEncoding = 30;
isa = PBXFileReference;
lastKnownFileType = sourcecode.c.h;
name = CaminoViewsFramework_Prefix.pch;
path = src/CaminoViewsFramework_Prefix.pch;
refType = 2;
sourceTree = SOURCE_ROOT;
};
0F67D8CF09397D1C00A84327 = {
isa = PBXFileReference;
lastKnownFileType = image.tiff;
name = FlippedShrinkWrapView.tiff;
path = resources/images/FlippedShrinkWrapView.tiff;
refType = 2;
sourceTree = SOURCE_ROOT;
};
0F67D8D009397D1C00A84327 = {
fileRef = 0F67D8CF09397D1C00A84327;
isa = PBXBuildFile;
settings = {
};
};
0F7EAC5A0932996D0082C3EA = {
fileEncoding = 30;
isa = PBXFileReference;
lastKnownFileType = sourcecode.c.h;
name = CHStackView.h;
path = ../src/extensions/CHStackView.h;
refType = 2;
sourceTree = SOURCE_ROOT;
};
0F7EAC5B0932996D0082C3EA = {
fileEncoding = 30;
isa = PBXFileReference;
lastKnownFileType = sourcecode.c.objc;
name = CHStackView.m;
path = ../src/extensions/CHStackView.m;
refType = 2;
sourceTree = SOURCE_ROOT;
};
0F7EAC5D0932996D0082C3EA = {
fileRef = 0F7EAC5B0932996D0082C3EA;
isa = PBXBuildFile;
settings = {
};
};
0F7EAC930932C4EE0082C3EA = {
fileEncoding = 30;
isa = PBXFileReference;
lastKnownFileType = sourcecode.c.objc;
name = "NSView+Utils.m";
path = "../src/extensions/NSView+Utils.m";
refType = 2;
sourceTree = SOURCE_ROOT;
};
0F7EAC940932C4EE0082C3EA = {
fileEncoding = 30;
isa = PBXFileReference;
lastKnownFileType = sourcecode.c.h;
name = "NSView+Utils.h";
path = "../src/extensions/NSView+Utils.h";
refType = 2;
sourceTree = SOURCE_ROOT;
};
0F7EAC950932C4EE0082C3EA = {
fileRef = 0F7EAC930932C4EE0082C3EA;
isa = PBXBuildFile;
settings = {
};
};
0F7EACFD0932D1090082C3EA = {
fileEncoding = 30;
isa = PBXFileReference;
lastKnownFileType = sourcecode.c.objc;
name = AutoSizingTextField.m;
path = ../src/extensions/AutoSizingTextField.m;
refType = 2;
sourceTree = SOURCE_ROOT;
};
0F7EACFE0932D1090082C3EA = {
fileEncoding = 30;
isa = PBXFileReference;
lastKnownFileType = sourcecode.c.h;
name = AutoSizingTextField.h;
path = ../src/extensions/AutoSizingTextField.h;
refType = 2;
sourceTree = SOURCE_ROOT;
};
0F7EACFF0932D1090082C3EA = {
fileRef = 0F7EACFD0932D1090082C3EA;
isa = PBXBuildFile;
settings = {
};
};
0F9481960933E76D00D80EC8 = {
isa = PBXFileReference;
lastKnownFileType = image.tiff;
name = ShrinkWrapView.tiff;
path = resources/images/ShrinkWrapView.tiff;
refType = 4;
sourceTree = "<group>";
};
0F9481970933E76D00D80EC8 = {
fileRef = 0F9481960933E76D00D80EC8;
isa = PBXBuildFile;
settings = {
};
};
0F9481980933E77200D80EC8 = {
isa = PBXFileReference;
lastKnownFileType = image.tiff;
name = StackView.tiff;
path = resources/images/StackView.tiff;
refType = 4;
sourceTree = "<group>";
};
0F9481990933E77200D80EC8 = {
fileRef = 0F9481980933E77200D80EC8;
isa = PBXBuildFile;
settings = {
};
};
0F9481A30933E7BA00D80EC8 = {
children = (
0F9481A40933E7BA00D80EC8,
);
isa = PBXVariantGroup;
name = CaminoViewsPalette.nib;
path = "";
refType = 4;
sourceTree = "<group>";
};
0F9481A40933E7BA00D80EC8 = {
isa = PBXFileReference;
lastKnownFileType = wrapper.nib;
name = English;
path = resources/English.lproj/CaminoViewsPalette.nib;
refType = 4;
sourceTree = "<group>";
};
0F9481A50933E7BA00D80EC8 = {
children = (
0F9481A60933E7BA00D80EC8,
);
isa = PBXVariantGroup;
name = CaminoViewsInspector.nib;
path = "";
refType = 4;
sourceTree = "<group>";
};
0F9481A60933E7BA00D80EC8 = {
isa = PBXFileReference;
lastKnownFileType = wrapper.nib;
name = English;
path = resources/English.lproj/CaminoViewsInspector.nib;
refType = 4;
sourceTree = "<group>";
};
0F9481A70933E7BA00D80EC8 = {
fileRef = 0F9481A30933E7BA00D80EC8;
isa = PBXBuildFile;
settings = {
};
};
0F9481A80933E7BA00D80EC8 = {
fileRef = 0F9481A50933E7BA00D80EC8;
isa = PBXBuildFile;
settings = {
};
};
//0F0
//0F1
//0F2
//0F3
//0F4
//130
//131
//132
//133
//134
131E8FE8067F80F40006E0CE = {
children = (
0F9481A30933E7BA00D80EC8,
0F9481A50933E7BA00D80EC8,
0259C583FE90428111CA0C5A,
0F9481960933E76D00D80EC8,
0F9481980933E77200D80EC8,
0F67D8CF09397D1C00A84327,
);
isa = PBXGroup;
name = Resources;
refType = 4;
sourceTree = "<group>";
};
13EB9DBD07DE0F1E00EB933A = {
isa = PBXFileReference;
lastKnownFileType = wrapper.framework;
name = InterfaceBuilder.framework;
path = /System/Library/Frameworks/InterfaceBuilder.framework;
refType = 0;
sourceTree = "<absolute>";
};
13EB9DBE07DE0F1E00EB933A = {
fileRef = 13EB9DBD07DE0F1E00EB933A;
isa = PBXBuildFile;
settings = {
};
};
13F8B6FD07B43410008AE28D = {
children = (
13EB9DBD07DE0F1E00EB933A,
DD92D38A0106425D02CA0E72,
);
isa = PBXGroup;
name = "Linked Frameworks";
refType = 4;
sourceTree = "<group>";
};
13F8B70407B43425008AE28D = {
children = (
13F8B88807B434F6008AE28D,
13F8B88907B434F6008AE28D,
13F8B88A07B434F6008AE28D,
);
isa = PBXGroup;
name = "Other Frameworks";
refType = 4;
sourceTree = "<group>";
};
13F8B88807B434F6008AE28D = {
isa = PBXFileReference;
lastKnownFileType = wrapper.framework;
name = AppKit.framework;
path = /System/Library/Frameworks/AppKit.framework;
refType = 0;
sourceTree = "<absolute>";
};
13F8B88907B434F6008AE28D = {
isa = PBXFileReference;
lastKnownFileType = wrapper.framework;
name = CoreData.framework;
path = /System/Library/Frameworks/CoreData.framework;
refType = 0;
sourceTree = "<absolute>";
};
13F8B88A07B434F6008AE28D = {
isa = PBXFileReference;
lastKnownFileType = wrapper.framework;
name = Foundation.framework;
path = /System/Library/Frameworks/Foundation.framework;
refType = 0;
sourceTree = "<absolute>";
};
13F8B89007B43554008AE28D = {
fileRef = DD92D38A0106425D02CA0E72;
isa = PBXBuildFile;
settings = {
};
};
//130
//131
//132
//133
//134
//1E0
//1E1
//1E2
//1E3
//1E4
1ED78706FE9D4A0611CA0C5A = {
children = (
8D1AC9740486D14A00FE50C9,
53DF68FD067E5B5A0090B5B0,
);
isa = PBXGroup;
name = Products;
refType = 4;
sourceTree = "<group>";
};
//1E0
//1E1
//1E2
//1E3
//1E4
//2E0
//2E1
//2E2
//2E3
//2E4
2E58F360FFB2326E11CA0CBA = {
buildSettings = {
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
PREBINDING = NO;
ZERO_LINK = NO;
};
isa = PBXBuildStyle;
name = Development;
};
2E58F361FFB2326E11CA0CBA = {
buildSettings = {
COPY_PHASE_STRIP = YES;
GCC_ENABLE_FIX_AND_CONTINUE = NO;
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
PREBINDING = NO;
ZERO_LINK = NO;
};
isa = PBXBuildStyle;
name = Deployment;
};
2E58F364FFB232C311CA0CBA = {
children = (
13F8B6FD07B43410008AE28D,
13F8B70407B43425008AE28D,
);
isa = PBXGroup;
name = Frameworks;
refType = 4;
sourceTree = "<group>";
};
//2E0
//2E1
//2E2
//2E3
//2E4
//320
//321
//322
//323
//324
32DBCF980370C29C00C91783 = {
fileEncoding = 4;
isa = PBXFileReference;
lastKnownFileType = sourcecode.c.h;
name = CaminoViewsPalette_Prefix.pch;
path = src/CaminoViewsPalette_Prefix.pch;
refType = 4;
sourceTree = "<group>";
};
32DBCF9E0370C38000C91783 = {
children = (
54D33B2406778DD400C9C163,
54D33B2506778DF000C9C163,
32DBCF9F0370C38200C91783,
131E8FE8067F80F40006E0CE,
);
isa = PBXGroup;
name = Palette;
path = "";
refType = 4;
sourceTree = "<group>";
};
32DBCF9F0370C38200C91783 = {
children = (
32DBCF980370C29C00C91783,
0F4523E509401BB100F61E1E,
);
isa = PBXGroup;
name = "Other Sources";
path = "";
refType = 4;
sourceTree = "<group>";
};
//320
//321
//322
//323
//324
//530
//531
//532
//533
//534
53DF68F8067E5B5A0090B5B0 = {
buildActionMask = 2147483647;
files = (
);
isa = PBXHeadersBuildPhase;
runOnlyForDeploymentPostprocessing = 0;
};
53DF68F9067E5B5A0090B5B0 = {
buildActionMask = 2147483647;
files = (
);
isa = PBXResourcesBuildPhase;
runOnlyForDeploymentPostprocessing = 0;
};
53DF68FA067E5B5A0090B5B0 = {
buildActionMask = 2147483647;
files = (
0F7EAC5D0932996D0082C3EA,
0F7EAC950932C4EE0082C3EA,
0F7EACFF0932D1090082C3EA,
);
isa = PBXSourcesBuildPhase;
runOnlyForDeploymentPostprocessing = 0;
};
53DF68FB067E5B5A0090B5B0 = {
buildActionMask = 2147483647;
files = (
13F8B89007B43554008AE28D,
);
isa = PBXFrameworksBuildPhase;
runOnlyForDeploymentPostprocessing = 0;
};
53DF68FC067E5B5A0090B5B0 = {
buildPhases = (
53DF68F8067E5B5A0090B5B0,
53DF68F9067E5B5A0090B5B0,
53DF68FA067E5B5A0090B5B0,
53DF68FB067E5B5A0090B5B0,
);
buildRules = (
);
buildSettings = {
DEPLOYMENT_LOCATION = YES;
DSTROOT = /;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
FRAMEWORK_VERSION = A;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = src/CaminoViewsFramework_Prefix.pch;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_FILE = "resources/CaminoViewsPaletteFramework-Info.plist";
INSTALL_PATH = "$(HOME)/Library/Frameworks";
OTHER_CFLAGS = "";
OTHER_LDFLAGS = "-framework Foundation -framework AppKit";
OTHER_REZFLAGS = "";
PREBINDING = NO;
PRODUCT_NAME = CaminoViewsPaletteFramework;
SECTORDER_FLAGS = "";
WARNING_CFLAGS = "-Wno-four-char-constants -Wno-unknown-pragmas";
};
dependencies = (
);
isa = PBXNativeTarget;
name = CaminoViewsFramework;
productName = CaminoViewsPaletteFramework;
productReference = 53DF68FD067E5B5A0090B5B0;
productSettingsXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
<plist version=\"1.0\">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>CaminoViewsPaletteFramework</string>
<key>CFBundleIdentifier</key>
<string>com.yourcompany._PROJECTNAME_Framework</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
</dict>
</plist>
";
productType = "com.apple.product-type.framework";
};
53DF68FD067E5B5A0090B5B0 = {
explicitFileType = wrapper.framework;
includeInIndex = 0;
isa = PBXFileReference;
path = CaminoViewsPaletteFramework.framework;
refType = 3;
sourceTree = BUILT_PRODUCTS_DIR;
};
53DF68FE067E5B5A0090B5B0 = {
isa = PBXFileReference;
lastKnownFileType = text.xml;
name = "CaminoViewsPaletteFramework-Info.plist";
path = "resources/CaminoViewsPaletteFramework-Info.plist";
refType = 4;
sourceTree = "<group>";
};
53DF6901067E5B8E0090B5B0 = {
buildPhases = (
);
buildSettings = {
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OTHER_CFLAGS = "";
OTHER_LDFLAGS = "";
OTHER_REZFLAGS = "";
PRODUCT_NAME = All;
SECTORDER_FLAGS = "";
WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
};
dependencies = (
53DF6903067E5B930090B5B0,
53DF6905067E5B930090B5B0,
);
isa = PBXAggregateTarget;
name = All;
productName = All;
};
53DF6902067E5B930090B5B0 = {
containerPortal = 0259C573FE90428111CA0C5A;
isa = PBXContainerItemProxy;
proxyType = 1;
remoteGlobalIDString = 8D1AC9600486D14A00FE50C9;
remoteInfo = CaminoViewsPalette;
};
53DF6903067E5B930090B5B0 = {
isa = PBXTargetDependency;
target = 8D1AC9600486D14A00FE50C9;
targetProxy = 53DF6902067E5B930090B5B0;
};
53DF6904067E5B930090B5B0 = {
containerPortal = 0259C573FE90428111CA0C5A;
isa = PBXContainerItemProxy;
proxyType = 1;
remoteGlobalIDString = 53DF68FC067E5B5A0090B5B0;
remoteInfo = CaminoViewsPaletteFramework;
};
53DF6905067E5B930090B5B0 = {
isa = PBXTargetDependency;
target = 53DF68FC067E5B5A0090B5B0;
targetProxy = 53DF6904067E5B930090B5B0;
};
//530
//531
//532
//533
//534
//540
//541
//542
//543
//544
546DEAEF067F62F70098DCC4 = {
containerPortal = 0259C573FE90428111CA0C5A;
isa = PBXContainerItemProxy;
proxyType = 1;
remoteGlobalIDString = 53DF68FC067E5B5A0090B5B0;
remoteInfo = CaminoViewsPaletteFramework;
};
546DEAF0067F62F70098DCC4 = {
isa = PBXTargetDependency;
target = 53DF68FC067E5B5A0090B5B0;
targetProxy = 546DEAEF067F62F70098DCC4;
};
546DEAF3067F632A0098DCC4 = {
fileRef = 53DF68FD067E5B5A0090B5B0;
isa = PBXBuildFile;
settings = {
};
};
54D33B2406778DD400C9C163 = {
children = (
54D33B2806778E3300C9C163,
);
isa = PBXGroup;
name = "Undo Support";
path = "";
refType = 4;
sourceTree = "<group>";
};
54D33B2506778DF000C9C163 = {
children = (
0F1C93540934047000C95167,
0F1C93520934047000C95167,
0F1C93550934047000C95167,
0F1C93530934047000C95167,
);
isa = PBXGroup;
name = Classes;
path = "";
refType = 4;
sourceTree = "<group>";
};
54D33B2806778E3300C9C163 = {
fileEncoding = 4;
isa = PBXFileReference;
lastKnownFileType = text;
name = CaminoViewsPalette.ibclassdescription;
path = resources/CaminoViewsPalette.ibclassdescription;
refType = 4;
sourceTree = "<group>";
};
54D33B2906778E3300C9C163 = {
fileRef = 54D33B2806778E3300C9C163;
isa = PBXBuildFile;
settings = {
};
};
54D33B2C06778E4400C9C163 = {
children = (
0F7EAC940932C4EE0082C3EA,
0F7EAC930932C4EE0082C3EA,
0F7EAC5A0932996D0082C3EA,
0F7EAC5B0932996D0082C3EA,
0F7EACFE0932D1090082C3EA,
0F7EACFD0932D1090082C3EA,
);
isa = PBXGroup;
name = Framework;
refType = 4;
sourceTree = "<group>";
};
//540
//541
//542
//543
//544
//8D0
//8D1
//8D2
//8D3
//8D4
8D1AC9600486D14A00FE50C9 = {
buildPhases = (
8D1AC9660486D14A00FE50C9,
8D1AC96A0486D14A00FE50C9,
8D1AC96E0486D14A00FE50C9,
);
buildRules = (
);
buildSettings = {
DEPLOYMENT_LOCATION = YES;
DSTROOT = /;
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = src/CaminoViewsPalette_Prefix.pch;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_FILE = resources/Info.plist;
INSTALL_PATH = "$(HOME)/Library/Palettes";
OTHER_LDFLAGS = "-bundle";
PREBINDING = NO;
PRODUCT_NAME = CaminoViews;
WRAPPER_EXTENSION = palette;
};
dependencies = (
546DEAF0067F62F70098DCC4,
);
isa = PBXNativeTarget;
name = CaminoViewsPalette;
productInstallPath = "$(HOME)/Developer/Palettes";
productName = CaminoViewsPalette;
productReference = 8D1AC9740486D14A00FE50C9;
productType = "com.apple.product-type.bundle";
};
8D1AC9660486D14A00FE50C9 = {
buildActionMask = 2147483647;
files = (
8D1AC9690486D14A00FE50C9,
8D1AC9800486D23B00FE50C9,
54D33B2906778E3300C9C163,
0F9481970933E76D00D80EC8,
0F9481990933E77200D80EC8,
0F9481A70933E7BA00D80EC8,
0F9481A80933E7BA00D80EC8,
0F67D8D009397D1C00A84327,
);
isa = PBXResourcesBuildPhase;
runOnlyForDeploymentPostprocessing = 0;
};
8D1AC9690486D14A00FE50C9 = {
fileRef = 0259C583FE90428111CA0C5A;
isa = PBXBuildFile;
settings = {
};
};
8D1AC96A0486D14A00FE50C9 = {
buildActionMask = 2147483647;
files = (
0F1C93560934047000C95167,
0F1C93570934047000C95167,
);
isa = PBXSourcesBuildPhase;
runOnlyForDeploymentPostprocessing = 0;
};
8D1AC96E0486D14A00FE50C9 = {
buildActionMask = 2147483647;
files = (
8D1AC9700486D14A00FE50C9,
546DEAF3067F632A0098DCC4,
13EB9DBE07DE0F1E00EB933A,
);
isa = PBXFrameworksBuildPhase;
runOnlyForDeploymentPostprocessing = 0;
};
8D1AC9700486D14A00FE50C9 = {
fileRef = DD92D38A0106425D02CA0E72;
isa = PBXBuildFile;
settings = {
};
};
8D1AC9730486D14A00FE50C9 = {
fileEncoding = 4;
isa = PBXFileReference;
lastKnownFileType = text.xml;
name = Info.plist;
path = resources/Info.plist;
refType = 4;
sourceTree = "<group>";
};
8D1AC9740486D14A00FE50C9 = {
explicitFileType = wrapper.cfbundle;
includeInIndex = 0;
isa = PBXFileReference;
path = CaminoViews.palette;
refType = 3;
sourceTree = BUILT_PRODUCTS_DIR;
};
8D1AC97B0486D23100FE50C9 = {
fileEncoding = 10;
isa = PBXFileReference;
lastKnownFileType = text.plist.strings;
name = InfoPlist.strings;
path = resources/English.lproj/InfoPlist.strings;
refType = 4;
sourceTree = "<group>";
};
8D1AC97F0486D23B00FE50C9 = {
children = (
8D1AC97B0486D23100FE50C9,
);
isa = PBXVariantGroup;
name = InfoPlist.strings;
refType = 4;
sourceTree = "<group>";
};
8D1AC9800486D23B00FE50C9 = {
fileRef = 8D1AC97F0486D23B00FE50C9;
isa = PBXBuildFile;
settings = {
};
};
//8D0
//8D1
//8D2
//8D3
//8D4
//DD0
//DD1
//DD2
//DD3
//DD4
DD92D38A0106425D02CA0E72 = {
isa = PBXFileReference;
lastKnownFileType = wrapper.framework;
name = Cocoa.framework;
path = /System/Library/Frameworks/Cocoa.framework;
refType = 0;
sourceTree = "<absolute>";
};
};
rootObject = 0259C573FE90428111CA0C5A;
}

View File

@@ -1,75 +0,0 @@
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications.
# Portions created by the Initial Developer are Copyright (C) 2003
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Simon Fraser <smfr@smfr.org>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
DEPTH = ../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
APP_NAME = Camino
ifdef MOZ_DEBUG
BUILDSTYLE = Development
else
BUILDSTYLE = Deployment
endif
TARGET = All
GARBAGE_DIRS += build
include $(topsrcdir)/config/rules.mk
unexport CC CXX
ABS_topsrcdir := $(shell cd $(topsrcdir); pwd)
export::
ifneq ($(ABS_topsrcdir),$(MOZ_BUILD_ROOT))
rsync -a --exclude .DS_Store --exclude "CVS/" --exclude "*.mode1" --exclude "*.pbxuser" $(srcdir)/CaminoViewsPalette.xcode .
ln -fs $(srcdir)/src
ln -fs $(srcdir)/resources
endif
libs::
$(PBBUILD) -project CaminoViewsPalette.xcode -target $(TARGET) -buildstyle $(BUILDSTYLE) $(PBBUILD_SETTINGS)
# convenience target for PB script build phases
echo_srcdir:
@echo $(srcdir)

View File

@@ -1,22 +0,0 @@
{
CHShrinkWrapView = {
SuperClass = NSView;
Attributes = {
};
};
CHFlippedShrinkWrapView = {
SuperClass = CHShrinkWrapView;
Attributes = {
};
};
CHStackView = {
SuperClass = CHShrinkWrapView;
Attributes = {
};
};
AutoSizingTextField = {
SuperClass = NSTextField;
Attributes = {
};
};
}

View File

@@ -1,22 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>CaminoViewsFramework</string>
<key>CFBundleIdentifier</key>
<string>org.mozilla.CaminoViewsFramework</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>NSPrincipalClass</key>
<string>CaminoViewsPalette</string>
</dict>
</plist>

View File

@@ -1,11 +0,0 @@
{
IBClasses = (
{
CLASS = CaminoViewsPaletteInspector;
LANGUAGE = ObjC;
SUPERCLASS = IBInspector;
},
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }
);
IBVersion = 1;
}

View File

@@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
<string>79 12 356 240 0 0 1600 1002 </string>
<key>IBFramework Version</key>
<string>437.0</string>
<key>IBSystem Version</key>
<string>8F46</string>
</dict>
</plist>

View File

@@ -1,33 +0,0 @@
{
IBClasses = (
{CLASS = AutoSizingTextField; LANGUAGE = ObjC; SUPERCLASS = NSTextField; },
{
CLASS = CHFlippedShrinkWrapView;
LANGUAGE = ObjC;
SUPERCLASS = CHShrinkWrapView;
},
{CLASS = CHShrinkWrapView; LANGUAGE = ObjC; SUPERCLASS = NSView; },
{
CLASS = CHStackView;
LANGUAGE = ObjC;
OUTLETS = {mDataSource = id; };
SUPERCLASS = CHShrinkWrapView;
},
{
CLASS = CaminoViewsPalette;
LANGUAGE = ObjC;
OUTLETS = {
mFlippedShrinkWrapView = CHFlippedShrinkWrapView;
mFlippedShrinkWrapViewImageView = NSImageView;
mShrinkWrapView = CHShrinkWrapView;
mShrinkWrapViewImageView = NSImageView;
mStackView = CHStackView;
mStackViewImageView = NSImageView;
};
SUPERCLASS = IBPalette;
},
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{CLASS = NSObject; LANGUAGE = ObjC; }
);
IBVersion = 1;
}

View File

@@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
<string>24 103 356 240 0 0 1600 1002 </string>
<key>IBFramework Version</key>
<string>437.0</string>
<key>IBSystem Version</key>
<string>8F46</string>
</dict>
</plist>

View File

@@ -1,22 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>CaminoViews</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>org.mozilla.caminoIBPalette</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
</dict>
</plist>

View File

@@ -1,36 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
<plist version="0.9">
<dict>
<!-- a subclass of IBPalette -->
<key>Class</key> <string>CaminoViewsPalette</string>
<!-- a nib file name -->
<key>NibFile</key> <string>CaminoViewsPalette</string>
<!-- a tiff file name for icon used for palette -->
<key>Icon</key> <string>CaminoViewsPalette</string>
<!-- Tool Tips string for the palette icon -->
<key>ToolTips</key> <string>CaminoViewsPalette</string>
<!-- a list of class names exported from palette to IB -->
<key>ExportClasses</key>
<array>
<string>CHShrinkWrapView</string>
<string>CHStackView</string>
<string>AutoSizingTextField</string>
</array>
<!-- a list of image names exported from palette to IB -->
<key>ExportImages</key>
<array>
</array>
<!-- a list of sound names exported from palette to IB -->
<key>ExportSounds</key>
<array>
</array>
</dict>
</plist>

View File

@@ -1,7 +0,0 @@
//
// Prefix header for all source files of the 'CaminoViewsFrame' target in the 'CaminoViewsPalette' project
//
#ifdef __OBJC__
#import <Cocoa/Cocoa.h>
#endif

View File

@@ -1,14 +0,0 @@
//
// CaminoViewsInspector.h
// CaminoViewsPalette
//
// Created by Simon Fraser on 21/11/05.
// Copyright __MyCompanyName__ 2005. All rights reserved.
//
#import <InterfaceBuilder/InterfaceBuilder.h>
@interface CaminoViewsInspector : IBInspector
{
}
@end

View File

@@ -1,33 +0,0 @@
//
// CaminoViewsInspector.m
// CaminoViewsPalette
//
// Created by Simon Fraser on 21/11/05.
// Copyright __MyCompanyName__ 2005 . All rights reserved.
//
#import "CaminoViewsInspector.h"
#import "CaminoViewsPalette.h"
@implementation CaminoViewsInspector
- (id)init
{
self = [super init];
[NSBundle loadNibNamed:@"CaminoViewsInspector" owner:self];
return self;
}
- (void)ok:(id)sender
{
/* Your code Here */
[super ok:sender];
}
- (void)revert:(id)sender
{
/* Your code Here */
[super revert:sender];
}
@end

View File

@@ -1,59 +0,0 @@
//
// CaminoViewsPalette.h
// CaminoViewsPalette
//
// Created by Simon Fraser on 21/11/05.
// Copyright __MyCompanyName__ 2005 . All rights reserved.
//
#import <InterfaceBuilder/InterfaceBuilder.h>
#import "CHStackView.h"
#import "AutoSizingTextField.h"
@interface CaminoViewsPalette : IBPalette
{
IBOutlet NSImageView* mShrinkWrapViewImageView;
IBOutlet NSImageView* mFlippedShrinkWrapViewImageView;
IBOutlet NSImageView* mStackViewImageView;
IBOutlet CHShrinkWrapView* mShrinkWrapView;
IBOutlet CHFlippedShrinkWrapView* mFlippedShrinkWrapView;
IBOutlet CHStackView* mStackView;
}
@end
@interface NSObject(CaminoViewsInspector)
+ (BOOL)editingInInterfaceBuilder;
@end
@interface CHShrinkWrapView(CaminoViewsInspector)
- (NSString *)inspectorClassName;
- (BOOL)ibIsContainer;
@end
@interface CHFlippedShrinkWrapView(CaminoViewsInspector)
- (NSString *)inspectorClassName;
- (BOOL)ibIsContainer;
@end
@interface CHStackView(CaminoViewsInspector)
- (NSString *)inspectorClassName;
- (BOOL)ibIsContainer;
@end
@interface AutoSizingTextField(CaminoViewsInspector)
- (NSString *)inspectorClassName;
@end

View File

@@ -1,204 +0,0 @@
//
// CaminoViewsPalette.m
// CaminoViewsPalette
//
// Created by Simon Fraser on 21/11/05.
// Copyright __MyCompanyName__ 2005 . All rights reserved.
//
#import "CaminoViewsPalette.h"
@interface NSObject(PrivateAPI)
+ (BOOL)isInInterfaceBuilder;
@end
@implementation CaminoViewsPalette
- (void)finishInstantiate
{
[self associateObject:mShrinkWrapView
ofType:IBViewPboardType
withView:mShrinkWrapViewImageView];
[self associateObject:mFlippedShrinkWrapView
ofType:IBViewPboardType
withView:mFlippedShrinkWrapViewImageView];
[self associateObject:mStackView
ofType:IBViewPboardType
withView:mStackViewImageView];
}
- (NSString*)toolTipForObject:(id)object
{
if (object == mShrinkWrapViewImageView)
return @"CHShrinkWrapView";
if (object == mFlippedShrinkWrapViewImageView)
return @"CHFlippedShrinkWrapView";
if (object == mStackViewImageView)
return @"CHStackView";
return @"";
}
@end
#pragma mark -
@implementation NSObject(CaminoViewsPalettePaletteInspector)
+ (BOOL)editingInInterfaceBuilder
{
return ([self respondsToSelector:@selector(isInInterfaceBuilder)] && [self isInInterfaceBuilder]) &&
([NSApp respondsToSelector:@selector(isTestingInterface)] && ![NSApp isTestingInterface]);
}
@end
#pragma mark -
@implementation CHShrinkWrapView(CaminoViewsPalettePaletteInspector)
#if 0
- (NSString *)inspectorClassName
{
return @"CaminoViewsInspector";
}
#endif
- (BOOL)ibIsContainer
{
return YES;
}
- (BOOL)ibDrawFrameWhileResizing
{
return YES;
}
- (id)ibNearestTargetForDrag
{
return self;
}
- (BOOL)canEditSelf
{
return YES;
}
- (BOOL)ibShouldShowContainerGuides
{
return YES;
}
- (BOOL)ibSupportsInsideOutSelection
{
return YES;
}
@end
#pragma mark -
@implementation CHFlippedShrinkWrapView(CaminoViewsPalettePaletteInspector)
#if 0
- (NSString *)inspectorClassName
{
return @"CaminoViewsInspector";
}
#endif
- (BOOL)ibIsContainer
{
return YES;
}
- (BOOL)ibDrawFrameWhileResizing
{
return YES;
}
- (id)ibNearestTargetForDrag
{
return self;
}
- (BOOL)canEditSelf
{
return YES;
}
- (BOOL)ibShouldShowContainerGuides
{
return YES;
}
- (BOOL)ibSupportsInsideOutSelection
{
return YES;
}
@end
#pragma mark -
@implementation CHStackView(CaminoViewsPalettePaletteInspector)
#if 0
- (NSString *)inspectorClassName
{
return @"CaminoViewsInspector";
}
#endif
- (BOOL)ibIsContainer
{
return YES;
}
- (BOOL)ibDrawFrameWhileResizing
{
return YES;
}
- (id)ibNearestTargetForDrag
{
return self;
}
- (BOOL)canEditSelf
{
return YES;
}
- (BOOL)ibShouldShowContainerGuides
{
return YES;
}
- (BOOL)ibSupportsInsideOutSelection
{
return YES;
}
@end
@implementation AutoSizingTextField(CaminoViewsPalettePaletteInspector)
#if 0
- (NSString *)inspectorClassName
{
return @"CaminoViewsInspector";
}
#endif
- (BOOL)ibDrawFrameWhileResizing
{
return YES;
}
@end

View File

@@ -1,8 +0,0 @@
//
// Prefix header for all source files of the 'CaminoViewsPalette' target in the 'CaminoViewsPalette' project
//
#ifdef __OBJC__
#import <Cocoa/Cocoa.h>
#import <InterfaceBuilder/InterfaceBuilder.h>
#endif

View File

@@ -1,32 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>Appearance</string>
<key>CFBundleGetInfoString</key>
<string></string>
<key>CFBundleIconFile</key>
<string>Appearance.tiff</string>
<key>CFBundleIdentifier</key>
<string>org.mozilla.camino.preference.appearance</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Appearance</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string></string>
<key>CFBundleSignature</key>
<string>MOZC</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>NSMainNibFile</key>
<string>Appearance</string>
<key>NSPrincipalClass</key>
<string>OrgMozillaChimeraPreferenceAppearance</string>
</dict>
</plist>

View File

@@ -1,202 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>html</string>
<string>htm</string>
<string>shtml</string>
<string>xml</string>
<string>xhtml</string>
<string>shtm</string>
<string>xhtm</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>fileHtml.icns</string>
<key>CFBundleTypeName</key>
<string>HTML Document</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>HTML</string>
</array>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>txt</string>
<string>text</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>fileBookmark.icns</string>
<key>CFBundleTypeName</key>
<string>Text Document</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>TEXT</string>
<string>utxt</string>
</array>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>jpeg</string>
<string>jpg</string>
<string>png</string>
<string>gif</string>
<string>svg</string>
<string>svgz</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>fileBookmark.icns</string>
<key>CFBundleTypeName</key>
<string>Image Document</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>GIFf</string>
<string>JPEG</string>
<string>PNGf</string>
<string>SVG </string>
<string>SVGZ</string>
</array>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>webloc</string>
<string>ftploc</string>
<string>url</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>fileBookmark.icns</string>
<key>CFBundleTypeName</key>
<string>Web Document</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>ilht</string>
<string>ilft</string>
<string>LINK</string>
</array>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
</array>
<key>CFBundleExecutable</key>
<string>Camino</string>
<key>CFBundleGetInfoString</key>
<string>Camino %CM_APP_VERSION%, © 1998-%CM_COPYRIGHT_YEAR% Contributors</string>
<key>CFBundleIconFile</key>
<string>appicon.icns</string>
<key>CFBundleIdentifier</key>
<string>org.mozilla.camino</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Camino</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>%CM_APP_VERSION%</string>
<key>CFBundleSignature</key>
<string>MOZC</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLIconFile</key>
<string>fileHtml.icns</string>
<key>CFBundleURLName</key>
<string>http URL</string>
<key>CFBundleURLSchemes</key>
<array>
<string>http</string>
</array>
</dict>
<dict>
<key>CFBundleURLIconFile</key>
<string>fileHtml.icns</string>
<key>CFBundleURLName</key>
<string>https URL</string>
<key>CFBundleURLSchemes</key>
<array>
<string>https</string>
</array>
</dict>
<dict>
<key>CFBundleURLName</key>
<string>ftp URL</string>
<key>CFBundleURLSchemes</key>
<array>
<string>ftp</string>
</array>
</dict>
<dict>
<key>CFBundleURLName</key>
<string>gopher URL</string>
<key>CFBundleURLSchemes</key>
<array>
<string>gopher</string>
</array>
</dict>
<dict>
<key>CFBundleURLName</key>
<string>file URL</string>
<key>CFBundleURLSchemes</key>
<array>
<string>file</string>
</array>
</dict>
</array>
<key>CFBundleVersion</key>
<string>%CM_APP_VERSION%</string>
<key>LSFileQuarantineEnabled</key>
<true/>
<key>LSFileQuarantineExcludedPathPatterns</key>
<array>
<string>~/Library/*</string>
</array>
<key>LSMinimumSystemVersion</key>
<string>10.3</string>
<key>NSAppleScriptEnabled</key>
<true/>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>NSServices</key>
<array>
<dict>
<key>NSKeyEquivalent</key>
<dict>
<key>default</key>
<string>U</string>
</dict>
<key>NSMenuItem</key>
<dict>
<key>default</key>
<string>Open URL in Camino</string>
</dict>
<key>NSMessage</key>
<string>openURL</string>
<key>NSPortName</key>
<string>Camino</string>
<key>NSSendTypes</key>
<array>
<string>NSStringPboardType</string>
</array>
</dict>
</array>
<key>mozProfileDirName</key>
<string>Camino</string>
</dict>
</plist>

View File

@@ -1,202 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>html</string>
<string>htm</string>
<string>shtml</string>
<string>xml</string>
<string>xhtml</string>
<string>shtm</string>
<string>xhtm</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>fileHtml.icns</string>
<key>CFBundleTypeName</key>
<string>HTML Document</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>HTML</string>
</array>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>txt</string>
<string>text</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>fileBookmark.icns</string>
<key>CFBundleTypeName</key>
<string>Text Document</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>TEXT</string>
<string>utxt</string>
</array>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>jpeg</string>
<string>jpg</string>
<string>png</string>
<string>gif</string>
<string>svg</string>
<string>svgz</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>fileBookmark.icns</string>
<key>CFBundleTypeName</key>
<string>Image Document</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>GIFf</string>
<string>JPEG</string>
<string>PNGf</string>
<string>SVG </string>
<string>SVGZ</string>
</array>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>webloc</string>
<string>ftploc</string>
<string>url</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>fileBookmark.icns</string>
<key>CFBundleTypeName</key>
<string>Web Document</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>ilht</string>
<string>ilft</string>
<string>LINK</string>
</array>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
</array>
<key>CFBundleExecutable</key>
<string>Camino</string>
<key>CFBundleGetInfoString</key>
<string>Camino %CM_APP_VERSION%, © 1998-%CM_COPYRIGHT_YEAR% Contributors</string>
<key>CFBundleIconFile</key>
<string>appicon.icns</string>
<key>CFBundleIdentifier</key>
<string>org.mozilla.camino</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Camino</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>%CM_APP_VERSION%</string>
<key>CFBundleSignature</key>
<string>MOZC</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLIconFile</key>
<string>fileHtml.icns</string>
<key>CFBundleURLName</key>
<string>http URL</string>
<key>CFBundleURLSchemes</key>
<array>
<string>http</string>
</array>
</dict>
<dict>
<key>CFBundleURLIconFile</key>
<string>fileHtml.icns</string>
<key>CFBundleURLName</key>
<string>https URL</string>
<key>CFBundleURLSchemes</key>
<array>
<string>https</string>
</array>
</dict>
<dict>
<key>CFBundleURLName</key>
<string>ftp URL</string>
<key>CFBundleURLSchemes</key>
<array>
<string>ftp</string>
</array>
</dict>
<dict>
<key>CFBundleURLName</key>
<string>gopher URL</string>
<key>CFBundleURLSchemes</key>
<array>
<string>gopher</string>
</array>
</dict>
<dict>
<key>CFBundleURLName</key>
<string>file URL</string>
<key>CFBundleURLSchemes</key>
<array>
<string>file</string>
</array>
</dict>
</array>
<key>CFBundleVersion</key>
<string>%CM_APP_VERSION%</string>
<key>LSFileQuarantineEnabled</key>
<true/>
<key>LSFileQuarantineExcludedPathPatterns</key>
<array>
<string>~/Library/*</string>
</array>
<key>LSMinimumSystemVersion</key>
<string>10.3</string>
<key>NSAppleScriptEnabled</key>
<true/>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>NSServices</key>
<array>
<dict>
<key>NSKeyEquivalent</key>
<dict>
<key>default</key>
<string>U</string>
</dict>
<key>NSMenuItem</key>
<dict>
<key>default</key>
<string>Open URL in Camino</string>
</dict>
<key>NSMessage</key>
<string>openURL</string>
<key>NSPortName</key>
<string>Camino</string>
<key>NSSendTypes</key>
<array>
<string>NSStringPboardType</string>
</array>
</dict>
</array>
<key>mozProfileDirName</key>
<string>Camino</string>
</dict>
</plist>

View File

@@ -1,26 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>Downloads</string>
<key>CFBundleIconFile</key>
<string>Downloads.tiff</string>
<key>CFBundleIdentifier</key>
<string>org.mozilla.camino.preference.downloads</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleSignature</key>
<string>MOZC</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>NSMainNibFile</key>
<string>Downloads</string>
<key>NSPrincipalClass</key>
<string>OrgMozillaChimeraPreferenceDownloads</string>
</dict>
</plist>

View File

@@ -1,26 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>History</string>
<key>CFBundleIconFile</key>
<string>History.tiff</string>
<key>CFBundleIdentifier</key>
<string>org.mozilla.camino.preference.history</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleSignature</key>
<string>MOZC</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>NSMainNibFile</key>
<string>History</string>
<key>NSPrincipalClass</key>
<string>OrgMozillaChimeraPreferenceHistory</string>
</dict>
</plist>

View File

@@ -1,32 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>Navigation</string>
<key>CFBundleGetInfoString</key>
<string></string>
<key>CFBundleIconFile</key>
<string>Navigation.tiff</string>
<key>CFBundleIdentifier</key>
<string>org.mozilla.camino.preference.navigation</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Navigation</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string></string>
<key>CFBundleSignature</key>
<string>MOZC</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>NSMainNibFile</key>
<string>Navigation</string>
<key>NSPrincipalClass</key>
<string>OrgMozillaChimeraPreferenceNavigation</string>
</dict>
</plist>

View File

@@ -1,34 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>Personal</string>
<key>CFBundleGetInfoString</key>
<string></string>
<key>CFBundleIconFile</key>
<string>Personal.tiff</string>
<key>CFBundleIdentifier</key>
<string>org.mozilla.chimera.preference.personal</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Personal</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string></string>
<key>CFBundleSignature</key>
<string>MOZC</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>NSMainNibFile</key>
<string>Personal</string>
<key>NSPrefPaneIconFIle</key>
<string>Personal.tiff</string>
<key>NSPrincipalClass</key>
<string>OrgMozillaChimeraPreferencePersonal</string>
</dict>
</plist>

View File

@@ -1,32 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>Privacy</string>
<key>CFBundleGetInfoString</key>
<string></string>
<key>CFBundleIconFile</key>
<string>Privacy.tiff</string>
<key>CFBundleIdentifier</key>
<string>org.mozilla.camino.preference.privacy</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Privacy</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string></string>
<key>CFBundleSignature</key>
<string>MOZC</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>NSMainNibFile</key>
<string>Privacy</string>
<key>NSPrincipalClass</key>
<string>OrgMozillaChimeraPreferencePrivacy</string>
</dict>
</plist>

View File

@@ -1,32 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>Security</string>
<key>CFBundleGetInfoString</key>
<string></string>
<key>CFBundleIconFile</key>
<string>Security.tiff</string>
<key>CFBundleIdentifier</key>
<string>org.mozilla.camino.preference.security</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Security</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string></string>
<key>CFBundleSignature</key>
<string>MOZC</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>NSMainNibFile</key>
<string>Security</string>
<key>NSPrincipalClass</key>
<string>OrgMozillaChimeraPreferenceSecurity</string>
</dict>
</plist>

View File

@@ -1,28 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>Tabs</string>
<key>CFBundleIconFile</key>
<string>Tabs.tiff</string>
<key>CFBundleIdentifier</key>
<string>org.mozilla.camino.preference.tabs</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Tabbed Browsing</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleSignature</key>
<string>MOZC</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>NSMainNibFile</key>
<string>Tabs</string>
<key>NSPrincipalClass</key>
<string>OrgMozillaChimeraPreferenceTabs</string>
</dict>
</plist>

View File

@@ -1,32 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>WebFeatures</string>
<key>CFBundleGetInfoString</key>
<string></string>
<key>CFBundleIconFile</key>
<string>WebFeatures.tiff</string>
<key>CFBundleIdentifier</key>
<string>org.mozilla.camino.preference.webfeatures</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Web Features</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string></string>
<key>CFBundleSignature</key>
<string>MOZC</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>NSMainNibFile</key>
<string>WebFeatures</string>
<key>NSPrincipalClass</key>
<string>OrgMozillaChimeraPreferenceWebFeatures</string>
</dict>
</plist>

View File

@@ -1,135 +0,0 @@
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications.
# Portions created by the Initial Developer are Copyright (C) 2003
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Brian Ryner <bryner@brianryner.com>
# Mark Mentovai <mark@moxienet.com>
# Smokey Ardisson <alqahira@ardisson.org>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
DEPTH = ..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
DIRS = \
flashblock \
$(NULL)
APP_NAME = Camino
CM_APP_VERSION_FILE = $(srcdir)/config/version.txt
CM_APP_VERSION := $(shell cat $(CM_APP_VERSION_FILE))
CM_COPYRIGHT_YEAR_FILE = $(srcdir)/config/year.txt
CM_COPYRIGHT_YEAR := $(shell cat $(CM_COPYRIGHT_YEAR_FILE))
ifdef MOZ_DEBUG
BUILDSTYLE = Development
else
ifdef CHIMERA_OPT_SYMBOLS
BUILDSTYLE = DeploymentSymbols
else
BUILDSTYLE = Deployment
endif
endif
ifdef BUILD_STATIC_LIBS
TARGET = CaminoStatic
else
TARGET = Camino
endif
GARBAGE_DIRS += build \
$(DIST)/$(APP_NAME).app \
embed-replacements.tmp \
generated \
$(NULL)
include $(topsrcdir)/config/rules.mk
unexport CC CXX
ABS_topsrcdir := $(shell cd $(topsrcdir); pwd)
export::
mkdir -p ./wallet/tables && ln -sf $(ABS_topsrcdir)/extensions/wallet/src/*.tbl ./wallet/tables
ifneq ($(ABS_topsrcdir),$(MOZ_BUILD_ROOT))
rsync -a --exclude .DS_Store --exclude "CVS/" --exclude "*.mode1" --exclude "*.pbxuser" $(srcdir)/Camino.xcode .
ln -fs $(srcdir)/src
ln -fs $(srcdir)/resources
ln -fs $(srcdir)/PreferencePanes
ln -fs $(srcdir)/Info-*.plist .
endif
generated:
mkdir -p $@
generated/English.lproj: generated
mkdir -p $@
# Generate files which need to pull version numbers or dates from other files in the tree
generated/all-camino.js: $(srcdir)/resources/application/all-camino.js.in $(CM_APP_VERSION_FILE) generated
sed -e "s/%CM_APP_VERSION%/$(CM_APP_VERSION)/" $< > $@
generated/Info-Camino.plist: $(srcdir)/Info-Camino.plist.in $(CM_APP_VERSION_FILE) $(CM_COPYRIGHT_YEAR_FILE) generated
sed -e "s/%CM_APP_VERSION%/$(CM_APP_VERSION)/" \
-e "s/%CM_COPYRIGHT_YEAR%/$(CM_COPYRIGHT_YEAR)/" $< > $@
generated/Info-CaminoStatic.plist: $(srcdir)/Info-CaminoStatic.plist.in $(CM_APP_VERSION_FILE) $(CM_COPYRIGHT_YEAR_FILE) generated
sed -e "s/%CM_APP_VERSION%/$(CM_APP_VERSION)/" \
-e "s/%CM_COPYRIGHT_YEAR%/$(CM_COPYRIGHT_YEAR)/" $< > $@
generated/English.lproj/InfoPlist.strings: $(srcdir)/resources/localized/English.lproj/InfoPlist.strings.in $(CM_APP_VERSION_FILE) $(CM_COPYRIGHT_YEAR_FILE) generated/English.lproj
sed -e "s/%CM_APP_VERSION%/$(CM_APP_VERSION)/" \
-e "s/%CM_COPYRIGHT_YEAR%/$(CM_COPYRIGHT_YEAR)/" $< | \
iconv -f UTF-8 -t UTF-16 > $@
# The embed-replacements rsync is done for both srcdir and objdir builds
# to avoid adding CVS stuff to embed.jar.
libs:: generated/all-camino.js generated/Info-Camino.plist generated/Info-CaminoStatic.plist generated/English.lproj/InfoPlist.strings
rsync -aC --delete $(srcdir)/embed-replacements/ embed-replacements.tmp
cd embed-replacements.tmp && $(ZIP) -r0DX ../../dist/Embed/chrome/embed.jar *
$(PBBUILD) -project Camino.xcode -target $(TARGET) -buildstyle $(BUILDSTYLE) $(PBBUILD_SETTINGS)
libs::
rsync -a --copy-unsafe-links $(XCODE_PRODUCT_DIR)/Camino.app/ $(DIST)/$(APP_NAME).app
$(RM) $(DIST)/$(APP_NAME).app/Contents/MacOS/components/camino.xpt
$(XPIDL_LINK) $(DIST)/$(APP_NAME).app/Contents/MacOS/camino.xpt $(DIST)/$(APP_NAME).app/Contents/MacOS/components/*.xpt
$(RM) $(DIST)/$(APP_NAME).app/Contents/MacOS/components/*.xpt
mv $(DIST)/$(APP_NAME).app/Contents/MacOS/camino.xpt $(DIST)/$(APP_NAME).app/Contents/MacOS/components/camino.xpt
# convenience target for PB script build phases
echo_srcdir:
@echo $(srcdir)

View File

@@ -1,112 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Simon Fraser <sfraser@netscape.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#import "PreferencePaneBase.h"
@interface OrgMozillaChimeraPreferenceAppearance : PreferencePaneBase
{
IBOutlet NSTabView* mTabView;
// colors tab
IBOutlet NSColorWell* mTextColorWell;
IBOutlet NSColorWell* mBackgroundColorWell;
IBOutlet NSColorWell* mVisitedLinksColorWell;
IBOutlet NSColorWell* mUnvisitedLinksColorWell;
IBOutlet NSButton* mUnderlineLinksCheckbox;
IBOutlet NSButton* mUseMyColorsCheckbox;
IBOutlet NSButton* mColorsResetButton;
// fonts tab
IBOutlet NSButton* mChooseProportionalFontButton;
IBOutlet NSButton* mChooseMonospaceFontButton;
IBOutlet NSPopUpButton* mFontRegionPopup;
IBOutlet NSTextField* mFontSampleProportional;
IBOutlet NSTextField* mFontSampleMonospace;
IBOutlet NSTextField* mProportionalSampleLabel;
IBOutlet NSTextField* mProportionalSubLabel;
IBOutlet NSButton* mUseMyFontsCheckbox;
IBOutlet NSButton* mFontsResetButton;
// advanced panel stuff
IBOutlet NSPanel* mAdvancedFontsDialog;
IBOutlet NSPopUpButton* mSerifFontPopup;
IBOutlet NSPopUpButton* mSansSerifFontPopup;
IBOutlet NSPopUpButton* mCursiveFontPopup;
IBOutlet NSPopUpButton* mFantasyFontPopup;
IBOutlet NSPopUpButton* mMinFontSizePopup;
IBOutlet NSTextField* mAdvancedFontsLabel;
IBOutlet NSMatrix* mDefaultFontMatrix;
NSArray* mCarbonSystemFontFamilies;
NSArray* mRegionMappingTable;
NSButton* mFontButtonForEditor;
NSTextView* mPropSampleFieldEditor;
NSTextView* mMonoSampleFieldEditor;
BOOL mFontPanelWasVisible;
}
- (void)mainViewDidLoad;
- (IBAction)buttonClicked:(id)sender;
- (IBAction)colorChanged:(id)sender;
- (IBAction)proportionalFontChoiceButtonClicked:(id)sender;
- (IBAction)useMyFontsButtonClicked:(id)sender;
- (IBAction)monospaceFontChoiceButtonClicked:(id)sender;
- (IBAction)fontRegionPopupClicked:(id)sender;
- (IBAction)showAdvancedFontsDialog:(id)sender;
- (IBAction)advancedFontsDone:(id)sender;
- (IBAction)resetColorsToDefaults:(id)sender;
- (IBAction)resetFontsToDefaults:(id)sender;
@end

View File

@@ -1,985 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Simon Fraser <sfraser@netscape.com>
* Asaf Romano <mozilla.mano@sent.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#import "Appearance.h"
@interface OrgMozillaChimeraPreferenceAppearance(Private)
- (void)setupFontRegionPopup;
- (void)updateFontPreviews;
- (void)loadFontPrefs;
- (void)saveFontPrefs;
- (NSMutableDictionary *)makeDictFromPrefsForFontType:(NSString*)fontType andRegion:(NSString*)regionCode;
- (NSMutableDictionary *)makeDefaultFontTypeDictFromPrefsForRegion:(NSString*)regionCode;
- (NSMutableDictionary *)makeFontSizesDictFromPrefsForRegion:(NSString*)regionCode;
- (NSMutableDictionary*)settingsForCurrentRegion;
- (NSString*)defaultProportionalFontTypeForCurrentRegion;
- (void)saveFontNamePrefsForRegion:(NSDictionary*)regionDict forFontType:(NSString*)fontType;
- (void)saveFontSizePrefsForRegion:(NSDictionary*)entryDict;
- (void)saveDefaultFontTypePrefForRegion:(NSDictionary*)entryDict;
- (BOOL)useMyFontsPref;
- (void)setUseMyFontsPref:(BOOL)checkboxState;
- (void)setupFontSamplesFromDict:(NSDictionary*)regionDict;
- (void)setupFontSampleOfType:(NSString*)fontType fromDict:(NSDictionary*)regionDict;
- (NSFont*)getFontOfType:(NSString*)fontType fromDict:(NSDictionary*)regionDict;
- (void)setFontSampleOfType:(NSString *)fontType withFont:(NSFont*)font andDict:(NSMutableDictionary*)regionDict;
- (void)saveFont:(NSFont*)font toDict:(NSMutableDictionary*)regionDict forType:(NSString*)fontType;
- (void)updateFontSampleOfType:(NSString *)fontType;
- (NSTextField*)getFontSampleForType:(NSString *)fontType;
- (NSString*)getFontSizeType:(NSString*)fontType;
- (void)buildFontPopup:(NSPopUpButton*)popupButton;
- (void)setupFontPopup:(NSPopUpButton*)popupButton forType:(NSString*)fontType fromDict:(NSDictionary*)regionDict;
- (void)getFontFromPopup:(NSPopUpButton*)popupButton forType:(NSString*)fontType intoDict:(NSDictionary*)regionDict;
- (NSString*)carbonNameForFontFamily:(ATSFontFamilyRef)fontFamily;
- (NSArray*)sortedCarbonSystemFontFamilies;
@end
#pragma mark -
// We use instances of this class as the field editor, to allow us to catch
// |changeFont:| messages.
@interface SampleTextView : NSTextView
{
id mPrefPane;
}
- (void)setPrefPane:(id)inPrefPane;
@end
@implementation SampleTextView
- (void)setPrefPane:(id)inPrefPane
{
mPrefPane = inPrefPane;
}
- (void)changeFont:(id)sender
{
[mPrefPane changeFont:sender];
}
- (BOOL)fontManager:(id)theFontManager willIncludeFont:(NSString *)fontName
{
return [mPrefPane fontManager:theFontManager willIncludeFont:fontName];
}
- (unsigned int)validModesForFontPanel:(NSFontPanel *)fontPanel
{
return [mPrefPane validModesForFontPanel:fontPanel];
}
@end
#pragma mark -
@implementation OrgMozillaChimeraPreferenceAppearance
- (void)dealloc
{
[mRegionMappingTable release];
[mPropSampleFieldEditor release];
[mMonoSampleFieldEditor release];
[mCarbonSystemFontFamilies release];
[super dealloc];
}
- (id)initWithBundle:(NSBundle *)bundle
{
self = [super initWithBundle:bundle];
mFontButtonForEditor = nil;
return self;
}
- (void)mainViewDidLoad
{
BOOL gotPref;
[mUnderlineLinksCheckbox setState:
[self getBooleanPref:"browser.underline_anchors" withSuccess:&gotPref]];
[mUseMyColorsCheckbox setState:
![self getBooleanPref:"browser.display.use_document_colors" withSuccess:&gotPref]];
// should save and restore this
[[NSColorPanel sharedColorPanel] setContinuous:NO];
[mBackgroundColorWell setColor:[self getColorPref:"browser.display.background_color" withSuccess:&gotPref]];
[mTextColorWell setColor:[self getColorPref:"browser.display.foreground_color" withSuccess:&gotPref]];
[mUnvisitedLinksColorWell setColor:[self getColorPref:"browser.anchor_color" withSuccess:&gotPref]];
[mVisitedLinksColorWell setColor:[self getColorPref:"browser.visited_color" withSuccess:&gotPref]];
[mUseMyFontsCheckbox setState:[self useMyFontsPref]];
[self setupFontRegionPopup];
[self updateFontPreviews];
}
- (void)willUnselect
{
// time to save stuff
[self saveFontPrefs];
}
- (void)tabView:(NSTabView *)tabView didSelectTabViewItem:(NSTabViewItem *)tabViewItem
{
}
- (void)setupFontRegionPopup
{
NSBundle* prefBundle = [NSBundle bundleForClass:[self class]];
NSString* resPath = [prefBundle pathForResource:@"RegionMapping" ofType:@"plist"];
// we use the dictionaries in this array as temporary storage of font
// values until the pane is unloaded, at which time they are saved
[mRegionMappingTable release];
mRegionMappingTable = [[NSArray arrayWithContentsOfFile:resPath] retain];
[self loadFontPrefs];
[mFontRegionPopup removeAllItems];
for (unsigned int i = 0; i < [mRegionMappingTable count]; i++) {
NSDictionary* regionDict = [mRegionMappingTable objectAtIndex:i];
[mFontRegionPopup addItemWithTitle:[regionDict objectForKey:@"region"]];
}
}
- (IBAction)buttonClicked:(id)sender
{
if (sender == mUnderlineLinksCheckbox)
[self setPref:"browser.underline_anchors" toBoolean:[sender state]];
else if (sender == mUseMyColorsCheckbox)
[self setPref:"browser.display.use_document_colors" toBoolean:![sender state]];
}
- (IBAction)colorChanged:(id)sender
{
const char* prefName = NULL;
if (sender == mBackgroundColorWell)
prefName = "browser.display.background_color";
else if (sender == mTextColorWell)
prefName = "browser.display.foreground_color";
else if (sender == mUnvisitedLinksColorWell)
prefName = "browser.anchor_color";
else if (sender == mVisitedLinksColorWell)
prefName = "browser.visited_color";
if (prefName)
[self setPref:prefName toColor:[sender color]];
}
- (IBAction)proportionalFontChoiceButtonClicked:(id)sender
{
NSFontManager *fontManager = [NSFontManager sharedFontManager];
NSString* defaultFontType = [self defaultProportionalFontTypeForCurrentRegion];
NSFont *newFont = [[self getFontSampleForType:defaultFontType] font];
mFontButtonForEditor = mChooseProportionalFontButton;
[fontManager setSelectedFont:newFont isMultiple:NO];
[[fontManager fontPanel:YES] makeKeyAndOrderFront:self];
}
- (IBAction)monospaceFontChoiceButtonClicked:(id)sender
{
NSFontManager *fontManager = [NSFontManager sharedFontManager];
NSFont *newFont = [[self getFontSampleForType:@"monospace"] font];
mFontButtonForEditor = mChooseMonospaceFontButton;
[fontManager setSelectedFont:newFont isMultiple:NO];
[[fontManager fontPanel:YES] makeKeyAndOrderFront:self];
}
- (IBAction)useMyFontsButtonClicked:(id)sender
{
[self setUseMyFontsPref:[sender state]];
}
- (IBAction)fontRegionPopupClicked:(id)sender
{
// save the old values
[self updateFontPreviews];
}
- (void)loadFontPrefs
{
for (unsigned int i = 0; i < [mRegionMappingTable count]; i++) {
NSMutableDictionary *regionDict = [mRegionMappingTable objectAtIndex:i];
NSString *regionCode = [regionDict objectForKey:@"code"];
/*
For each region in the array, there is a dictionary of
{
code =
region = (from localized strings file)
to which we add here a sub-dictionary per font type, thus:
serif = {
fontfamily = Times-Regular
}
sans-serif = {
fontfamily =
missing = // set if a font is missing
}
cursive = {
fontfamily =
}
monospace = {
fontfamily =
}
an entry that stores the default font type:
defaultFontType = {
type =
}
and an entry that stores font sizes:
fontsize = {
variable =
fixed =
minimum = // optional
}
}
*/
NSString *regionName = NSLocalizedStringFromTableInBundle(regionCode, @"RegionNames",
[NSBundle bundleForClass:[OrgMozillaChimeraPreferenceAppearance class]], @"");
[regionDict setObject:regionName forKey:@"region"];
NSMutableDictionary *serifDict = [self makeDictFromPrefsForFontType:@"serif" andRegion:regionCode];
[regionDict setObject:serifDict forKey:@"serif"];
NSMutableDictionary *sanssDict = [self makeDictFromPrefsForFontType:@"sans-serif" andRegion:regionCode];
[regionDict setObject:sanssDict forKey:@"sans-serif"];
NSMutableDictionary *monoDict = [self makeDictFromPrefsForFontType:@"monospace" andRegion:regionCode];
[regionDict setObject:monoDict forKey:@"monospace"];
NSMutableDictionary *cursDict = [self makeDictFromPrefsForFontType:@"cursive" andRegion:regionCode];
[regionDict setObject:cursDict forKey:@"cursive"];
NSMutableDictionary *fantasyDict = [self makeDictFromPrefsForFontType:@"fantasy" andRegion:regionCode];
[regionDict setObject:fantasyDict forKey:@"fantasy"];
// font sizes dict
NSMutableDictionary *sizesDict = [self makeFontSizesDictFromPrefsForRegion:regionCode];
[regionDict setObject:sizesDict forKey:@"fontsize"];
// default font type dict
NSMutableDictionary *defaultFontTypeDict = [self makeDefaultFontTypeDictFromPrefsForRegion:regionCode];
[regionDict setObject:defaultFontTypeDict forKey:@"defaultFontType"];
}
}
- (void)saveFontPrefs
{
if (!mRegionMappingTable)
return;
for (unsigned int i = 0; i < [mRegionMappingTable count]; i++) {
NSMutableDictionary *regionDict = [mRegionMappingTable objectAtIndex:i];
[self saveFontNamePrefsForRegion:regionDict forFontType:@"serif"];
[self saveFontNamePrefsForRegion:regionDict forFontType:@"sans-serif"];
[self saveFontNamePrefsForRegion:regionDict forFontType:@"monospace"];
[self saveFontNamePrefsForRegion:regionDict forFontType:@"cursive"];
[self saveFontNamePrefsForRegion:regionDict forFontType:@"fantasy"];
[self saveDefaultFontTypePrefForRegion:regionDict];
[self saveFontSizePrefsForRegion:regionDict];
}
}
#pragma mark -
- (NSMutableDictionary *)makeDictFromPrefsForFontType:(NSString*)fontType andRegion:(NSString*)regionCode
{
NSMutableDictionary *fontDict = [NSMutableDictionary dictionaryWithCapacity:1];
NSString *fontPrefName = [NSString stringWithFormat:@"font.name.%@.%@", fontType, regionCode];
BOOL gotPref;
NSString *fontName = [self getStringPref:[fontPrefName cString] withSuccess:&gotPref];
if (gotPref)
[fontDict setObject:fontName forKey:@"fontfamily"];
return fontDict;
}
- (NSMutableDictionary *)makeDefaultFontTypeDictFromPrefsForRegion:(NSString*)regionCode
{
NSMutableDictionary *fontTypeDict = [NSMutableDictionary dictionaryWithCapacity:1];
NSString *prefName = [NSString stringWithFormat:@"font.default.%@", regionCode];
BOOL gotPref;
NSString *fontType = [self getStringPref:[prefName cString] withSuccess:&gotPref];
if (gotPref)
[fontTypeDict setObject:fontType forKey:@"type"];
return fontTypeDict;
}
- (NSMutableDictionary *)makeFontSizesDictFromPrefsForRegion:(NSString*)regionCode
{
NSMutableDictionary *fontDict = [NSMutableDictionary dictionaryWithCapacity:2];
NSString *variableSizePref = [NSString stringWithFormat:@"font.size.variable.%@", regionCode];
NSString *fixedSizePref = [NSString stringWithFormat:@"font.size.fixed.%@", regionCode];
NSString *minSizePref = [NSString stringWithFormat:@"font.minimum-size.%@", regionCode];
BOOL gotFixed, gotVariable, gotMinSize;
int variableSize = [self getIntPref:[variableSizePref cString] withSuccess:&gotVariable];
int fixedSize = [self getIntPref:[fixedSizePref cString] withSuccess:&gotFixed];
int minSize = [self getIntPref:[minSizePref cString] withSuccess:&gotMinSize];
if (gotVariable)
[fontDict setObject:[NSNumber numberWithInt:variableSize] forKey:@"variable"];
if (gotFixed)
[fontDict setObject:[NSNumber numberWithInt:fixedSize] forKey:@"fixed"];
if (gotMinSize)
[fontDict setObject:[NSNumber numberWithInt:minSize] forKey:@"minimum"];
return fontDict;
}
- (NSMutableDictionary*)settingsForCurrentRegion
{
int selectedRegion = [mFontRegionPopup indexOfSelectedItem];
if (selectedRegion == -1)
return nil;
return [mRegionMappingTable objectAtIndex:selectedRegion];
}
- (NSString*)defaultProportionalFontTypeForCurrentRegion
{
NSDictionary* regionDict = [self settingsForCurrentRegion];
return [[regionDict objectForKey:@"defaultFontType"] objectForKey:@"type"];
}
- (void)saveFontNamePrefsForRegion:(NSDictionary*)regionDict forFontType:(NSString*)fontType
{
NSString *regionCode = [regionDict objectForKey:@"code"];
if (!regionDict || !fontType || !regionCode) return;
NSDictionary* fontTypeDict = [regionDict objectForKey:fontType];
NSString *fontName = [fontTypeDict objectForKey:@"fontfamily"];
NSString *fontPrefName = [NSString stringWithFormat:@"font.name.%@.%@", fontType, regionCode];
if (fontName)
[self setPref:[fontPrefName cString] toString:fontName];
else
// If the preferences were reset to defaults, this key could be gone.
[self clearPref:[fontPrefName cString]];
}
- (void)saveFontSizePrefsForRegion:(NSDictionary*)regionDict
{
NSString *regionCode = [regionDict objectForKey:@"code"];
NSString *variableSizePref = [NSString stringWithFormat:@"font.size.variable.%@", regionCode];
NSString *fixedSizePref = [NSString stringWithFormat:@"font.size.fixed.%@", regionCode];
NSString *minSizePref = [NSString stringWithFormat:@"font.minimum-size.%@", regionCode];
NSDictionary* fontSizeDict = [regionDict objectForKey:@"fontsize"];
int variableSize = [[fontSizeDict objectForKey:@"variable"] intValue];
int fixedSize = [[fontSizeDict objectForKey:@"fixed"] intValue];
int minSize = [[fontSizeDict objectForKey:@"minimum"] intValue];
// If the preferences were reset to defaults, these keys could be gone.
if (variableSize)
[self setPref:[variableSizePref cString] toInt:variableSize];
else
[self clearPref:[variableSizePref cString]];
if (fixedSize)
[self setPref:[fixedSizePref cString] toInt:fixedSize];
else
[self clearPref:[fixedSizePref cString]];
if (minSize)
[self setPref:[minSizePref cString] toInt:minSize];
else
[self clearPref:[minSizePref cString]];
}
- (void)saveDefaultFontTypePrefForRegion:(NSDictionary*)regionDict
{
NSString *regionCode = [regionDict objectForKey:@"code"];
NSString *prefName = [NSString stringWithFormat:@"font.default.%@", regionCode];
NSString *value = [[regionDict objectForKey:@"defaultFontType"] objectForKey:@"type"];
// If the preferences were reset to defaults, this key could be gone.
if (value)
[self setPref:[prefName cString] toString:value];
else
[self clearPref:[prefName cString]];
}
// The exposed "Use My Fonts" pref has reverse logic from the internal pref
// (when mUseMyFontsCheckbox == 1, use_document_fonts == 0). These private accessor methods allow code
// elsewhere to use the exposed pref's logic
- (BOOL)useMyFontsPref
{
BOOL gotPref;
return [self getIntPref:"browser.display.use_document_fonts" withSuccess:&gotPref] == 0;
}
- (void)setUseMyFontsPref:(BOOL)checkboxState
{
int useDocumentFonts = checkboxState ? 0 : 1;
[self setPref:"browser.display.use_document_fonts" toInt:useDocumentFonts];
}
#pragma mark -
- (void)saveFont:(NSFont*)font toDict:(NSMutableDictionary*)regionDict forType:(NSString*)fontType
{
NSMutableDictionary *fontTypeDict = [regionDict objectForKey:fontType];
NSMutableDictionary *fontSizeDict = [regionDict objectForKey:@"fontsize"];
if (font)
{
// clear any missing flag
[fontTypeDict removeObjectForKey:@"missing"];
[fontTypeDict setObject:[font familyName] forKey:@"fontfamily"];
[fontSizeDict setObject:[NSNumber numberWithInt:(int)[font pointSize]] forKey:[self getFontSizeType:fontType]];
}
}
- (NSFont*)getFontOfType:(NSString*)fontType fromDict:(NSDictionary*)regionDict
{
NSDictionary *fontTypeDict = [regionDict objectForKey:fontType];
NSDictionary *fontSizeDict = [regionDict objectForKey:@"fontsize"];
NSString *fontName = [fontTypeDict objectForKey:@"fontfamily"];
int fontSize = [[fontSizeDict objectForKey:[self getFontSizeType:fontType]] intValue];
NSFont *returnFont = nil;
if (fontName && fontSize > 0) {
// we can't use [NSFont fontWithName] here, because we only store font
// family names in the prefs file. So use the font manager instead
// returnFont = [NSFont fontWithName:fontName size:fontSize];
returnFont = [[NSFontManager sharedFontManager] fontWithFamily:fontName traits:0 weight:5 size:fontSize];
} else if (fontName) {
// no size
returnFont = [[NSFontManager sharedFontManager] fontWithFamily:fontName traits:0 weight:5 size:16.0];
}
// if still no font, get defaults
if (fontName == nil && returnFont == nil)
returnFont = ([fontType isEqualToString:@"monospace"]) ?
[NSFont userFixedPitchFontOfSize:14.0] :
[NSFont userFontOfSize:16.0];
// we return nil if the font was not found
return returnFont;
}
- (void)setupFontSamplesFromDict:(NSDictionary*)regionDict
{
// For proportional, show either serif or sans-serif font,
// per region's default-font-type (font.default.%regionCode% pref)
NSString *defaultFontType = [[regionDict objectForKey:@"defaultFontType"] objectForKey:@"type"];
[self setupFontSampleOfType:defaultFontType fromDict:regionDict];
[self setupFontSampleOfType:@"monospace" fromDict:regionDict];
}
- (void)setupFontSampleOfType:(NSString*)fontType fromDict:(NSDictionary*)regionDict
{
NSFont *foundFont = [self getFontOfType:fontType fromDict:regionDict];
[self setFontSampleOfType:fontType withFont:foundFont andDict:regionDict];
}
- (void)setFontSampleOfType:(NSString *)fontType withFont:(NSFont*)font andDict:(NSMutableDictionary*)regionDict
{
NSMutableDictionary *fontTypeDict = [regionDict objectForKey:fontType];
NSString *fontInformationFormat = @"%@, %dpt";
NSString *displayString = nil;
if (font) {
displayString = [NSString stringWithFormat:fontInformationFormat, [font familyName], (int)[font pointSize]];
// make sure we don't have a missing entry
[fontTypeDict removeObjectForKey:@"missing"];
}
else {
// a nil font either means it's missing entirely or that a carbon name was
// chosen from the advanced panel and could not be used to create a NSFont.
NSDictionary *fontSizeDict = [regionDict objectForKey:@"fontsize"];
NSString *fontName = [fontTypeDict objectForKey:@"fontfamily"];
int fontSize = [[fontSizeDict objectForKey:[self getFontSizeType:fontType]] intValue];
displayString = [NSString stringWithFormat:fontInformationFormat, fontName, fontSize];
if ([[self sortedCarbonSystemFontFamilies] containsObject:fontName]) {
[fontTypeDict removeObjectForKey:@"missing"];
}
else { // font is definitely missing
displayString = [displayString stringByAppendingFormat:@" %@", [self getLocalizedString:@"Missing"]];
[fontTypeDict setObject:[NSNumber numberWithBool:YES] forKey:@"missing"];
}
font = [NSFont userFontOfSize:14.0];
if (!regionDict) // Should never happen, but this would mean a displayString with no info
displayString = @"Font missing"; // XXX localize
}
// Set the font of the sample to a font that is not bold, italic etc.
NSFont* baseFont = [[NSFontManager sharedFontManager] fontWithFamily:[font familyName] traits:0 weight:5 /* normal weight */ size:[font pointSize]];
NSTextField *sampleCell = [self getFontSampleForType:fontType];
[sampleCell setFont:baseFont];
[sampleCell setStringValue:displayString];
}
- (void)updateFontSampleOfType:(NSString *)fontType
{
NSMutableDictionary* regionDict = [self settingsForCurrentRegion];
if (!regionDict) return;
NSTextField *sampleCell = [self getFontSampleForType:fontType];
NSFont *sampleFont = [[NSFontManager sharedFontManager] convertFont:[sampleCell font]];
// save the font in the dictionaries
[self saveFont:sampleFont toDict:regionDict forType:fontType];
// and update the sample
[self setFontSampleOfType:fontType withFont:sampleFont andDict:regionDict];
}
- (NSTextField*)getFontSampleForType:(NSString *)fontType
{
if ([fontType isEqualToString:@"serif"] || [fontType isEqualToString:@"sans-serif"])
return mFontSampleProportional;
if ([fontType isEqualToString:@"monospace"])
return mFontSampleMonospace;
return nil;
}
- (NSString*)getFontSizeType:(NSString*)fontType
{
if ([fontType isEqualToString:@"monospace"])
return @"fixed";
return @"variable";
}
- (void)updateFontPreviews
{
NSDictionary* regionDict = [self settingsForCurrentRegion];
if (!regionDict) return;
NSString* defaultFontType = [self defaultProportionalFontTypeForCurrentRegion];
// make sure the 'proportional' label matches
NSString* propLabelString = [NSString stringWithFormat:[self getLocalizedString:@"ProportionalLabelFormat"], [self getLocalizedString:defaultFontType]];
[mProportionalSampleLabel setStringValue:propLabelString];
NSString* sublabelValue = [self getLocalizedString:[defaultFontType stringByAppendingString:@"_note"]];
[mProportionalSubLabel setStringValue:sublabelValue];
NSString* noteFontExample = [defaultFontType isEqualToString:@"serif"] ? @"Times" : @"Helvetica";
[mProportionalSubLabel setFont:[[NSFontManager sharedFontManager] fontWithFamily:noteFontExample
traits:0
weight:5 /* normal weight */
size:[[mProportionalSubLabel font] pointSize]]];
[self setupFontSamplesFromDict:regionDict];
}
#pragma mark -
const int kDefaultFontSerifTag = 0;
const int kDefaultFontSansSerifTag = 1;
- (IBAction)showAdvancedFontsDialog:(id)sender
{
NSDictionary* regionDict = [self settingsForCurrentRegion];
if (!regionDict) return;
NSString* advancedLabel = [NSString stringWithFormat:[self getLocalizedString:@"AdditionalFontsLabelFormat"], [regionDict objectForKey:@"region"]];
[mAdvancedFontsLabel setStringValue:advancedLabel];
// set up the dialog for the current region
[self setupFontPopup:mSerifFontPopup forType:@"serif" fromDict:regionDict];
[self setupFontPopup:mSansSerifFontPopup forType:@"sans-serif" fromDict:regionDict];
[self setupFontPopup:mCursiveFontPopup forType:@"cursive" fromDict:regionDict];
[self setupFontPopup:mFantasyFontPopup forType:@"fantasy" fromDict:regionDict];
// setup min size popup
int itemIndex = 0;
NSMutableDictionary *fontSizeDict = [regionDict objectForKey:@"fontsize"];
NSNumber* minSize = [fontSizeDict objectForKey:@"minimum"];
if (minSize) {
itemIndex = [mMinFontSizePopup indexOfItemWithTag:[minSize intValue]];
if (itemIndex == -1)
itemIndex = 0;
}
[mMinFontSizePopup selectItemAtIndex:itemIndex];
// set up default font radio buttons (default to serif)
NSString* defaultFontType = [self defaultProportionalFontTypeForCurrentRegion];
[mDefaultFontMatrix selectCellWithTag:([defaultFontType isEqualToString:@"sans-serif"] ? kDefaultFontSansSerifTag : kDefaultFontSerifTag)];
mFontPanelWasVisible = [[NSFontPanel sharedFontPanel] isVisible];
[[NSFontPanel sharedFontPanel] orderOut:nil];
[NSApp beginSheet:mAdvancedFontsDialog
modalForWindow:[mTabView window] // any old window accessor
modalDelegate:self
didEndSelector:@selector(advancedFontsSheetDidEnd:returnCode:contextInfo:)
contextInfo:NULL];
}
- (IBAction)advancedFontsDone:(id)sender
{
// save settings
NSDictionary* regionDict = [self settingsForCurrentRegion];
if (!regionDict) return;
[self getFontFromPopup:mSerifFontPopup forType:@"serif" intoDict:regionDict];
[self getFontFromPopup:mSansSerifFontPopup forType:@"sans-serif" intoDict:regionDict];
[self getFontFromPopup:mCursiveFontPopup forType:@"cursive" intoDict:regionDict];
[self getFontFromPopup:mFantasyFontPopup forType:@"fantasy" intoDict:regionDict];
int minSize = [[mMinFontSizePopup selectedItem] tag];
// a value of 0 indicates 'none'; we'll clear the pref on save
NSMutableDictionary *fontSizeDict = [regionDict objectForKey:@"fontsize"];
[fontSizeDict setObject:[NSNumber numberWithInt:(int)minSize] forKey:@"minimum"];
// save the default font type
NSMutableDictionary* defaultFontTypeDict = [regionDict objectForKey:@"defaultFontType"];
NSString* defaultFontType = ([[mDefaultFontMatrix selectedCell] tag] == kDefaultFontSerifTag) ? @"serif" : @"sans-serif";
[defaultFontTypeDict setObject:defaultFontType forKey:@"type"];
[mAdvancedFontsDialog orderOut:self];
[NSApp endSheet:mAdvancedFontsDialog];
[self updateFontPreviews];
if (mFontPanelWasVisible)
[[NSFontPanel sharedFontPanel] makeKeyAndOrderFront:self];
}
// Reset the "Colors and Links" tab to application factory defaults.
- (IBAction)resetColorsToDefaults:(id)sender
{
[self clearPref:"browser.underline_anchors"];
[self clearPref:"browser.display.use_document_colors"];
[self clearPref:"browser.display.background_color"];
[self clearPref:"browser.display.foreground_color"];
[self clearPref:"browser.anchor_color"];
[self clearPref:"browser.visited_color"];
// update the UI of the Appearance pane
int state;
state = [self getBooleanPref:"browser.underline_anchors" withSuccess:NULL] ? NSOnState : NSOffState;
[mUnderlineLinksCheckbox setState:state];
state = [self getBooleanPref:"browser.display.use_document_colors" withSuccess:NULL] ? NSOffState : NSOnState;
[mUseMyColorsCheckbox setState:state];
[mBackgroundColorWell setColor:[self getColorPref:"browser.display.background_color" withSuccess:NULL]];
[mTextColorWell setColor:[self getColorPref:"browser.display.foreground_color" withSuccess:NULL]];
[mUnvisitedLinksColorWell setColor:[self getColorPref:"browser.anchor_color" withSuccess:NULL]];
[mVisitedLinksColorWell setColor:[self getColorPref:"browser.visited_color" withSuccess:NULL]];
}
// Reset the Fonts tab to application factory defaults.
- (IBAction)resetFontsToDefaults:(id)sender
{
// clear all the preferences for the font regions
for (unsigned int i = 0; i < [mRegionMappingTable count]; i++)
{
NSMutableDictionary* regionDict = [mRegionMappingTable objectAtIndex:i];
// NSString* regionCode = [regionDict objectForKey:@"code"];
// for each region, we reset the dictionaries to be empty.
[regionDict setObject:[NSMutableDictionary dictionary] forKey:@"serif"];
[regionDict setObject:[NSMutableDictionary dictionary] forKey:@"sans-serif"];
[regionDict setObject:[NSMutableDictionary dictionary] forKey:@"monospace"];
[regionDict setObject:[NSMutableDictionary dictionary] forKey:@"cursive"];
[regionDict setObject:[NSMutableDictionary dictionary] forKey:@"fantasy"];
[regionDict setObject:[NSMutableDictionary dictionary] forKey:@"fontsize"];
[regionDict setObject:[NSMutableDictionary dictionary] forKey:@"defaultFontType"];
}
[self clearPref:"browser.display.use_document_fonts"];
// commit the changes
// first, we clear the preferences by saving them. This clears the values that are returned by
// -[self getPref:].
[self saveFontPrefs];
// Since the rest of the Appearance code doesn't access the prefs by getPref directly,
// we need to re-store the default preference values in the region dicts.
[self loadFontPrefs];
// Update the UI of the Appearance pane
// order is important here -- syncing the font panel depends on the font previews being correct.
[self updateFontPreviews];
[mUseMyFontsCheckbox setState:[self useMyFontsPref]];
}
- (void)advancedFontsSheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo
{
}
const int kMissingFontPopupItemTag = 9999;
- (void)setupFontPopup:(NSPopUpButton*)popupButton forType:(NSString*)fontType fromDict:(NSDictionary*)regionDict
{
NSDictionary* fontTypeDict = [regionDict objectForKey:fontType];
NSString* defaultValue = [fontTypeDict objectForKey:@"fontfamily"];
[self buildFontPopup:popupButton];
NSArray* systemFontList = [self sortedCarbonSystemFontFamilies];
if (![systemFontList containsObject:defaultValue]) {
// indicate that the font saved in defaults is missing
NSMenuItem* missingFontItem = [[popupButton menu] itemWithTag:kMissingFontPopupItemTag];
if (!missingFontItem) {
missingFontItem = [[[NSMenuItem alloc] initWithTitle:@"temp" action:NULL keyEquivalent:@""] autorelease];
[missingFontItem setTag:kMissingFontPopupItemTag];
[[popupButton menu] addItem:missingFontItem];
}
NSString* itemTitle = [NSString stringWithFormat:@"%@ %@", defaultValue, [self getLocalizedString:@"Missing"]];
[missingFontItem setTitle:itemTitle];
[popupButton selectItem:missingFontItem];
} else {
// remove the missing item if it exists
NSMenuItem* missingFontItem = [[popupButton menu] itemWithTag:kMissingFontPopupItemTag];
if (missingFontItem)
[[popupButton menu] removeItem: missingFontItem];
[popupButton selectItemWithTitle:defaultValue];
}
}
- (void)getFontFromPopup:(NSPopUpButton*)popupButton forType:(NSString*)fontType intoDict:(NSDictionary*)regionDict
{
NSMenuItem* selectedItem = [popupButton selectedItem];
if ([selectedItem tag] != kMissingFontPopupItemTag)
[[regionDict objectForKey:fontType] setObject:[selectedItem title] forKey:@"fontfamily"];
}
- (void)buildFontPopup:(NSPopUpButton*)popupButton
{
NSMenu* menu = [popupButton menu];
[menu setAutoenablesItems:NO];
// remove existing items
while ([menu numberOfItems] > 0)
[menu removeItemAtIndex:0];
// Gecko is unable to recognize non-western font names in the
// representation returned by NSFontManager. As a workaround,
// use Apple Type Services to supply the names of installed fonts.
NSEnumerator* fontNameEnumerator = [[self sortedCarbonSystemFontFamilies] objectEnumerator];
NSString* fontName;
while (fontName = [fontNameEnumerator nextObject]) {
NSMenuItem* newMenuItem = [[[NSMenuItem alloc] initWithTitle:fontName action:nil keyEquivalent:@""] autorelease];
[menu addItem:newMenuItem];
}
}
#pragma mark -
- (NSString*)carbonNameForFontFamily:(ATSFontFamilyRef)fontFamily
{
OSStatus status = noErr;
Str255 quickDrawFontName;
status = ATSFontFamilyGetQuickDrawName(fontFamily, quickDrawFontName);
// Fonts with certain prefixes are not useful.
if (status != noErr || quickDrawFontName[0] == 0 || quickDrawFontName[1] == '.' || quickDrawFontName[1] == '#')
return nil;
TextEncoding unicodeTextEncoding = CreateTextEncoding(kTextEncodingUnicodeDefault,
kTextEncodingDefaultVariant,
kUnicode16BitFormat);
TECObjectRef textEncodingConverter = NULL;
TextEncoding fontEncoding = ATSFontFamilyGetEncoding(fontFamily);
status = TECCreateConverter(&textEncodingConverter, fontEncoding, unicodeTextEncoding);
if (status != noErr)
return nil;
// Convert the QuickDraw name to Unicode, allocating a buffer
// twice the capacity to ensure ample room for the conversion.
UniChar unicodeFontName[(sizeof(quickDrawFontName) * 2)];
ByteCount actualInputLength, actualOutputLength;
status = TECConvertText(textEncodingConverter, &quickDrawFontName[1], quickDrawFontName[0], &actualInputLength,
(TextPtr)unicodeFontName , sizeof(unicodeFontName), &actualOutputLength);
TECDisposeConverter(textEncodingConverter);
if (status != noErr)
return nil;
return [NSString stringWithCharacters:unicodeFontName length:(actualOutputLength / sizeof(UniChar))];
}
- (NSArray*)sortedCarbonSystemFontFamilies
{
if (!mCarbonSystemFontFamilies) {
NSMutableArray* fontFamilies = [NSMutableArray array];
OSStatus status = noErr;
ATSFontFamilyIterator fontFamilyIterator;
status = ATSFontFamilyIteratorCreate(kATSFontContextLocal, NULL, NULL,
kATSOptionFlagsDefaultScope,
&fontFamilyIterator);
if (status != noErr)
return nil;
ATSFontFamilyRef fontFamily;
while (status == noErr) {
status = ATSFontFamilyIteratorNext(fontFamilyIterator, &fontFamily);
if (status == noErr) {
NSString* familyName = [self carbonNameForFontFamily:fontFamily];
if (familyName)
[fontFamilies addObject:familyName];
}
else if (status == kATSIterationScopeModified) {
// font database has changed; reset the iterator and start over.
status = ATSFontFamilyIteratorReset(kATSFontContextLocal, nil, nil,
kATSOptionFlagsUnRestrictedScope,
&fontFamilyIterator);
[fontFamilies removeAllObjects];
}
}
ATSFontFamilyIteratorRelease(&fontFamilyIterator);
mCarbonSystemFontFamilies = [[fontFamilies sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)] retain];
}
return mCarbonSystemFontFamilies;
}
@end
#pragma mark -
@implementation OrgMozillaChimeraPreferenceAppearance (FontManagerDelegate)
- (id)fieldEditorForObject:(id)inObject
{
if (inObject == mFontSampleProportional)
{
if (!mPropSampleFieldEditor)
{
SampleTextView* propFieldEditor = [[SampleTextView alloc] initWithFrame:[inObject bounds]];
[propFieldEditor setPrefPane:self];
[propFieldEditor setFieldEditor:YES];
[propFieldEditor setDelegate:inObject];
mPropSampleFieldEditor = propFieldEditor;
}
return mPropSampleFieldEditor;
}
else if (inObject == mFontSampleMonospace)
{
if (!mMonoSampleFieldEditor)
{
SampleTextView* monoFieldEditor = [[SampleTextView alloc] initWithFrame:[inObject bounds]];
[monoFieldEditor setPrefPane:self];
[monoFieldEditor setFieldEditor:YES];
[monoFieldEditor setDelegate:inObject];
mMonoSampleFieldEditor = monoFieldEditor;
}
return mMonoSampleFieldEditor;
}
return nil;
}
- (void)changeFont:(id)sender
{
// ignore font panel changes if the advanced panel is up
if ([mAdvancedFontsDialog isVisible])
return;
if (mFontButtonForEditor == mChooseProportionalFontButton)
{
NSString* fontType = [self defaultProportionalFontTypeForCurrentRegion];
[self updateFontSampleOfType:fontType];
}
else if (mFontButtonForEditor == mChooseMonospaceFontButton)
{
[self updateFontSampleOfType:@"monospace"];
}
}
- (BOOL)fontManager:(id)theFontManager willIncludeFont:(NSString *)fontName
{
// filter out fonts for the selected language
//NSLog(@"willIncludeFont:%@", fontName);
return YES;
}
// this allows us to hide the font face panel
- (unsigned int)validModesForFontPanel:(NSFontPanel *)fontPanel
{
// hide the face panel
return (NSFontPanelStandardModesMask & ~NSFontPanelFaceModeMask);
}
@end

View File

@@ -1,69 +0,0 @@
{
IBClasses = (
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{
CLASS = FontReceiverView;
LANGUAGE = ObjC;
OUTLETS = {delegate = id; };
SUPERCLASS = NSView;
},
{CLASS = NSObject; LANGUAGE = ObjC; },
{
CLASS = NSPreferencePane;
LANGUAGE = ObjC;
OUTLETS = {
"_firstKeyView" = id;
"_initialKeyView" = id;
"_lastKeyView" = id;
"_window" = id;
};
SUPERCLASS = NSObject;
},
{
ACTIONS = {
advancedFontsDone = id;
buttonClicked = id;
colorChanged = id;
fontRegionPopupClicked = id;
monospaceFontChoiceButtonClicked = id;
proportionalFontChoiceButtonClicked = id;
resetColorsToDefaults = id;
resetFontsToDefaults = id;
showAdvancedFontsDialog = id;
useMyFontsButtonClicked = id;
};
CLASS = OrgMozillaChimeraPreferenceAppearance;
LANGUAGE = ObjC;
OUTLETS = {
mAdvancedFontsDialog = NSPanel;
mAdvancedFontsLabel = NSTextField;
mBackgroundColorWell = NSColorWell;
mChooseMonospaceFontButton = NSButton;
mChooseProportionalFontButton = NSButton;
mColorsResetButton = NSButton;
mCursiveFontPopup = NSPopUpButton;
mDefaultFontMatrix = NSMatrix;
mFantasyFontPopup = NSPopUpButton;
mFontRegionPopup = NSPopUpButton;
mFontSampleMonospace = NSTextField;
mFontSampleProportional = NSTextField;
mFontsResetButton = NSButton;
mMinFontSizePopup = NSPopUpButton;
mProportionalSampleLabel = NSTextField;
mProportionalSubLabel = NSTextField;
mSansSerifFontPopup = NSPopUpButton;
mSerifFontPopup = NSPopUpButton;
mTabView = NSTabView;
mTextColorWell = NSColorWell;
mUnderlineLinksCheckbox = NSButton;
mUnvisitedLinksColorWell = NSColorWell;
mUseMyColorsCheckbox = NSButton;
mUseMyFontsCheckbox = NSButton;
mVisitedLinksColorWell = NSColorWell;
};
SUPERCLASS = PreferencePaneBase;
},
{CLASS = PreferencePaneBase; LANGUAGE = ObjC; SUPERCLASS = NSPreferencePane; }
);
IBVersion = 1;
}

View File

@@ -1,21 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
<string>46 26 458 263 0 0 1024 746 </string>
<key>IBEditorPositions</key>
<dict>
<key>214</key>
<string>61 395 157 99 0 0 1024 746 </string>
</dict>
<key>IBFramework Version</key>
<string>446.1</string>
<key>IBOpenObjects</key>
<array>
<integer>99</integer>
</array>
<key>IBSystem Version</key>
<string>8J135</string>
</dict>
</plist>

View File

@@ -1,50 +0,0 @@
(
{
code = "x-western";
},
{
code = "x-central-euro";
},
{
code = "x-cyrillic";
},
{
code = "x-baltic";
},
{
code = "el";
},
{
code = "tr";
},
{
code = "he";
},
{
code = "ar";
},
{
code = "ko";
},
{
code = "th";
},
{
code = "zh-CN";
},
{
code = "zh-TW";
},
{
code = "zh-HK";
},
{
code = "ja";
},
{
code = "x-unicode";
},
{
code = "x-user-def";
}
)

View File

@@ -1,55 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Mozilla browser.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* william@dell.wisner.name (William Dell Wisner)
* josh@mozilla.com (Josh Aas)
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#import <PreferencePaneBase.h>
@interface OrgMozillaChimeraPreferenceDownloads : PreferencePaneBase
{
IBOutlet NSPopUpButton* mDownloadFolder;
IBOutlet NSPopUpButton* mDownloadRemovalPolicy;
IBOutlet NSButton* mAutoCloseDLManager;
IBOutlet NSButton* mEnableHelperApps;
}
- (IBAction)checkboxClicked:(id)sender;
- (IBAction)chooseDownloadFolder:(id)sender;
- (IBAction)chooseDownloadRemovalPolicy:(id)sender;
@end

View File

@@ -1,266 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Mozilla browser.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* william@dell.wisner.name (William Dell Wisner)
* josh@mozilla.com (Josh Aas)
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#import <Carbon/Carbon.h>
#import <Cocoa/Cocoa.h>
#import "Downloads.h"
#import "NSString+Utils.h"
#include "nsCOMPtr.h"
#include "nsILocalFileMac.h"
#include "nsDirectoryServiceDefs.h"
const int kDefaultExpireDays = 9;
// handly stack-based class to start and stop an Internet Config session
class StInternetConfigSession
{
public:
StInternetConfigSession(OSType inSignature)
: mICInstance(NULL)
, mStartedOK(false)
{
mStartedOK = (::ICStart(&mICInstance, inSignature) == noErr);
}
~StInternetConfigSession()
{
if (mStartedOK)
::ICStop(mICInstance);
}
bool Available() const { return mStartedOK; }
ICInstance Instance() const { return mICInstance; }
private:
ICInstance mICInstance;
bool mStartedOK;
};
@interface OrgMozillaChimeraPreferenceDownloads(Private)
- (NSString*)getDownloadFolderDescription;
- (void)setupDownloadMenuWithPath:(NSString*)inDLPath;
- (void)setDownloadFolder:(NSString*)inNewFolder;
@end
@implementation OrgMozillaChimeraPreferenceDownloads
- (id)initWithBundle:(NSBundle *)bundle
{
self = [super initWithBundle:bundle];
return self;
}
- (void)dealloc
{
[super dealloc];
}
- (void)mainViewDidLoad
{
if (!mPrefService)
return;
BOOL gotPref;
[mAutoCloseDLManager setState:![self getBooleanPref:"browser.download.progressDnldDialog.keepAlive" withSuccess:&gotPref]];
[mEnableHelperApps setState:[self getBooleanPref:"browser.download.autoDispatch" withSuccess:&gotPref]];
[mDownloadRemovalPolicy selectItem:[[mDownloadRemovalPolicy menu] itemWithTag:[self getIntPref:"browser.download.downloadRemoveAction" withSuccess:&gotPref]]];
NSString* downloadFolderDesc = [self getDownloadFolderDescription];
if ([downloadFolderDesc length] == 0)
downloadFolderDesc = [self getLocalizedString:@"MissingDlFolder"];
[self setupDownloadMenuWithPath:downloadFolderDesc];
// [mDownloadFolder setStringValue:[self getDownloadFolderDescription]];
}
- (IBAction)checkboxClicked:(id)sender
{
if (!mPrefService)
return;
if (sender == mAutoCloseDLManager) {
[self setPref:"browser.download.progressDnldDialog.keepAlive" toBoolean:![sender state]];
}
if (sender == mEnableHelperApps) {
[self setPref:"browser.download.autoDispatch" toBoolean:[sender state]];
}
}
- (NSString*)getDownloadFolderDescription
{
NSString* downloadStr = @"";
nsCOMPtr<nsIFile> downloadsDir;
NS_GetSpecialDirectory(NS_MAC_DEFAULT_DOWNLOAD_DIR, getter_AddRefs(downloadsDir));
if (!downloadsDir)
return downloadStr;
nsCOMPtr<nsILocalFileMac> macDir = do_QueryInterface(downloadsDir);
if (!macDir)
return downloadStr;
FSRef folderRef;
nsresult rv = macDir->GetFSRef(&folderRef);
if (NS_FAILED(rv))
return downloadStr;
UInt8 utf8path[PATH_MAX + 1];
::FSRefMakePath(&folderRef, utf8path, PATH_MAX);
return [NSString stringWithUTF8String:(const char*)utf8path];
}
// Sets the IC download pref to the given path. We write to Internet Config
// because Gecko reads from IC when getting NS_MAC_DEFAULT_DOWNLOAD_DIR.
- (void)setDownloadFolder:(NSString*)inNewFolder
{
if (!inNewFolder)
return;
// it would be nice to use PreferenceManager, but I don't want to drag
// all that code into the plugin
StInternetConfigSession icSession('MOZC');
if (!icSession.Available())
return;
// make a ICFileSpec out of our path and shove it into IC. This requires
// creating an FSSpec and an alias.
FSRef fsRef;
Boolean isDir;
OSStatus error = ::FSPathMakeRef((UInt8 *)[inNewFolder fileSystemRepresentation], &fsRef, &isDir);
if (error != noErr)
return;
FSSpec fsSpec;
error = ::FSGetCatalogInfo(&fsRef, kFSCatInfoNone, nil, nil, &fsSpec, nil);
if (error != noErr)
return;
AliasHandle alias = nil;
error = ::FSNewAlias(nil, &fsRef, &alias);
// copy the data out of our variables into the ICFileSpec and hand it to IC.
if (error == noErr && alias)
{
long headerSize = offsetof(ICFileSpec, alias);
long aliasSize = ::GetHandleSize((Handle)alias);
ICFileSpec* realbuffer = (ICFileSpec*) calloc(headerSize + aliasSize, 1);
realbuffer->fss = fsSpec;
memcpy(&realbuffer->alias, *alias, aliasSize);
::ICSetPref(icSession.Instance(), kICDownloadFolder, kICAttrNoChange, (const void*)realbuffer, headerSize + aliasSize);
free(realbuffer);
::DisposeHandle((Handle)alias);
}
}
// Given a full path to the d/l dir, display the leaf name and the finder icon associated
// with that folder in the first item of the download folder popup.
//
- (void)setupDownloadMenuWithPath:(NSString*)inDLPath
{
NSMenuItem* placeholder = [mDownloadFolder itemAtIndex:0];
if (!placeholder)
return;
// get the finder icon and scale it down to 16x16
NSImage* icon = [[NSWorkspace sharedWorkspace] iconForFile:inDLPath];
[icon setScalesWhenResized:YES];
[icon setSize:NSMakeSize(16.0, 16.0)];
// set the title to the leaf name and the icon to what we gathered above
[placeholder setTitle:[[NSFileManager defaultManager] displayNameAtPath:inDLPath]];
[placeholder setImage:icon];
// ensure first item is selected
[mDownloadFolder selectItemAtIndex:0];
}
// display a file picker sheet allowing the user to set their new download folder
- (IBAction)chooseDownloadFolder:(id)sender
{
NSString* oldDLFolder = [self getDownloadFolderDescription];
NSOpenPanel* panel = [NSOpenPanel openPanel];
[panel setCanChooseFiles:NO];
[panel setCanChooseDirectories:YES];
[panel setAllowsMultipleSelection:NO];
[panel setCanCreateDirectories:YES];
[panel setPrompt:NSLocalizedString(@"ChooseDirectoryOKButton", @"")];
[panel beginSheetForDirectory:oldDLFolder file:nil types:nil modalForWindow:[mDownloadFolder window]
modalDelegate:self didEndSelector:@selector(openPanelDidEnd:returnCode:contextInfo:)
contextInfo:nil];
}
//
// Set the download removal policy
//
- (IBAction)chooseDownloadRemovalPolicy:(id)sender
{
// The three options in the popup contains tags 0-2, set the pref according to the
// selected menu item's tag.
int selectedTagValue = [mDownloadRemovalPolicy selectedTag];
[self setPref:"browser.download.downloadRemoveAction" toInt:selectedTagValue];
}
// called when the user closes the open panel sheet for selecting a new d/l folder.
// if they clicked ok, change the IC pref and re-display the new choice in the
// popup menu
- (void)openPanelDidEnd:(NSOpenPanel*)sheet returnCode:(int)returnCode contextInfo:(void*)contextInfo
{
if (returnCode == NSOKButton) {
// stuff path into pref
NSString* newPath = [[sheet filenames] objectAtIndex:0];
[self setDownloadFolder:newPath];
// update the menu
[self setupDownloadMenuWithPath:newPath];
}
else
[mDownloadFolder selectItemAtIndex:0];
}
@end

View File

@@ -1,34 +0,0 @@
{
IBClasses = (
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{
CLASS = NSPreferencePane;
LANGUAGE = ObjC;
OUTLETS = {
"_firstKeyView" = NSView;
"_initialKeyView" = NSView;
"_lastKeyView" = NSView;
"_window" = NSWindow;
};
SUPERCLASS = NSObject;
},
{
ACTIONS = {
checkboxClicked = id;
chooseDownloadFolder = id;
chooseDownloadRemovalPolicy = id;
};
CLASS = OrgMozillaChimeraPreferenceDownloads;
LANGUAGE = ObjC;
OUTLETS = {
mAutoCloseDLManager = NSButton;
mDownloadFolder = NSPopUpButton;
mDownloadRemovalPolicy = NSPopUpButton;
mEnableHelperApps = NSButton;
};
SUPERCLASS = PreferencePaneBase;
},
{CLASS = PreferencePaneBase; LANGUAGE = ObjC; SUPERCLASS = NSPreferencePane; }
);
IBVersion = 1;
}

View File

@@ -1,16 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
<string>34 11 522 320 0 0 1024 746 </string>
<key>IBFramework Version</key>
<string>446.1</string>
<key>IBOpenObjects</key>
<array>
<integer>5</integer>
</array>
<key>IBSystem Version</key>
<string>8J135</string>
</dict>
</plist>

View File

@@ -1,25 +0,0 @@
{
IBClasses = (
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{
CLASS = NSPreferencePane;
LANGUAGE = ObjC;
OUTLETS = {
"_firstKeyView" = NSView;
"_initialKeyView" = NSView;
"_lastKeyView" = NSView;
"_window" = NSWindow;
};
SUPERCLASS = NSObject;
},
{
ACTIONS = {clearDiskCache = id; clearGlobalHistory = id; historyDaysModified = id; };
CLASS = OrgMozillaChimeraPreferenceHistory;
LANGUAGE = ObjC;
OUTLETS = {textFieldHistoryDays = NSTextField; };
SUPERCLASS = PreferencePaneBase;
},
{CLASS = PreferencePaneBase; LANGUAGE = ObjC; SUPERCLASS = NSPreferencePane; }
);
IBVersion = 1;
}

View File

@@ -1,16 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
<string>32 25 522 320 0 0 1024 746 </string>
<key>IBFramework Version</key>
<string>446.1</string>
<key>IBOpenObjects</key>
<array>
<integer>5</integer>
</array>
<key>IBSystem Version</key>
<string>8J135</string>
</dict>
</plist>

View File

@@ -1,53 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Mozilla browser.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* william@dell.wisner.name (William Dell Wisner)
* josh@mozilla.com (Josh Aas)
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#import <Cocoa/Cocoa.h>
#import <PreferencePaneBase.h>
@interface OrgMozillaChimeraPreferenceHistory : PreferencePaneBase
{
IBOutlet NSTextField *textFieldHistoryDays;
}
- (IBAction)historyDaysModified:(id)sender;
- (IBAction)clearGlobalHistory:(id)sender;
- (IBAction)clearDiskCache:(id)aSender;
@end

View File

@@ -1,196 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Mozilla browser.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* william@dell.wisner.name (William Dell Wisner)
* josh@mozilla.com (Josh Aas)
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#import "History.h"
#include "nsCOMPtr.h"
#include "nsIServiceManager.h"
#include "nsIBrowserHistory.h"
#include "nsICacheService.h"
const int kDefaultExpireDays = 9;
@interface OrgMozillaChimeraPreferenceHistory(Private)
- (void)doClearDiskCache;
- (void)doClearGlobalHistory;
- (BOOL)historyDaysValid;
@end
@implementation OrgMozillaChimeraPreferenceHistory
- (id)initWithBundle:(NSBundle *)bundle
{
self = [super initWithBundle:bundle];
return self;
}
- (void)dealloc
{
[super dealloc];
}
- (void)mainViewDidLoad
{
if (!mPrefService)
return;
BOOL gotPref;
int expireDays = [self getIntPref:"browser.history_expire_days" withSuccess:&gotPref];
if (!gotPref)
expireDays = kDefaultExpireDays;
[textFieldHistoryDays setIntValue:expireDays];
}
- (NSPreferencePaneUnselectReply)shouldUnselect
{
// make sure the history days value is numbers only (should use a formatter for this?)
if (![self historyDaysValid])
{
[[textFieldHistoryDays window] makeFirstResponder:textFieldHistoryDays];
[textFieldHistoryDays selectText:nil];
NSBeep();
return NSUnselectCancel;
}
return NSUnselectNow;
}
- (void)didUnselect
{
if (!mPrefService)
return;
if ([self historyDaysValid])
[self setPref:"browser.history_expire_days" toInt:[textFieldHistoryDays intValue]];
}
- (IBAction)historyDaysModified:(id)sender
{
if (!mPrefService)
return;
if ([self historyDaysValid])
{
[self setPref:"browser.history_expire_days" toInt:[sender intValue]];
}
else
{
// If any non-numeric characters were entered make some noise and spit it out.
BOOL gotPref;
int prefValue = [self getIntPref:"browser.history_expire_days" withSuccess:&gotPref];
if (!gotPref)
prefValue = kDefaultExpireDays;
[textFieldHistoryDays setIntValue:prefValue];
NSBeep();
}
}
// Clear the user's disk cache
-(IBAction) clearDiskCache:(id)aSender
{
NSBeginCriticalAlertSheet([self getLocalizedString:@"EmptyCacheTitle"],
[self getLocalizedString:@"EmptyButton"],
[self getLocalizedString:@"CancelButtonText"],
nil,
[textFieldHistoryDays window], // any view will do
self,
@selector(clearDiskCacheSheetDidEnd:returnCode:contextInfo:),
nil,
NULL,
[self getLocalizedString:@"EmptyCacheMessage"]);
}
// use the browser history service to clear out the user's global history
- (IBAction)clearGlobalHistory:(id)sender
{
NSBeginCriticalAlertSheet([self getLocalizedString:@"ClearHistoryTitle"],
[self getLocalizedString:@"ClearHistoryButton"],
[self getLocalizedString:@"CancelButtonText"],
nil,
[textFieldHistoryDays window], // any view willl do
self,
@selector(clearGlobalHistorySheetDidEnd:returnCode:contextInfo:),
nil,
NULL,
[self getLocalizedString:@"ClearHistoryMessage"]);
}
#pragma mark -
- (void)clearDiskCacheSheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo
{
if (returnCode == NSAlertDefaultReturn)
{
[self doClearDiskCache];
}
}
- (void)clearGlobalHistorySheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo
{
if (returnCode == NSAlertDefaultReturn)
{
[self doClearGlobalHistory];
}
}
- (void)doClearDiskCache
{
nsCOMPtr<nsICacheService> cacheServ ( do_GetService("@mozilla.org/network/cache-service;1") );
if ( cacheServ )
cacheServ->EvictEntries(nsICache::STORE_ANYWHERE);
}
- (void)doClearGlobalHistory
{
nsCOMPtr<nsIBrowserHistory> hist ( do_GetService("@mozilla.org/browser/global-history;2") );
if ( hist )
hist->RemoveAllPages();
}
- (BOOL)historyDaysValid
{
NSCharacterSet* nonDigitsSet = [[NSCharacterSet decimalDigitCharacterSet] invertedSet];
NSRange nonDigitsRange = [[textFieldHistoryDays stringValue] rangeOfCharacterFromSet:nonDigitsSet];
return (nonDigitsRange.length == 0);
}
@end

View File

@@ -1,43 +0,0 @@
{
IBClasses = (
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{
CLASS = NSPreferencePane;
LANGUAGE = ObjC;
OUTLETS = {
"_firstKeyView" = NSView;
"_initialKeyView" = NSView;
"_lastKeyView" = NSView;
"_window" = NSWindow;
};
SUPERCLASS = NSObject;
},
{
ACTIONS = {
checkDefaultBrowserOnLaunchClicked = id;
checkboxStartPageClicked = id;
defaultBrowserChange = id;
defaultFeedViewerChange = id;
rememberWindowStateCheckboxClicked = id;
runOpenDialogToSelectBrowser = id;
runOpenDialogToSelectFeedViewer = id;
warningCheckboxClicked = id;
};
CLASS = OrgMozillaChimeraPreferenceNavigation;
LANGUAGE = ObjC;
OUTLETS = {
checkboxCheckDefaultBrowserOnLaunch = NSButton;
checkboxNewTabBlank = NSButton;
checkboxNewWindowBlank = NSButton;
checkboxRememberWindowState = NSButton;
checkboxWarnWhenClosing = NSButton;
defaultBrowserPopUp = NSPopUpButton;
defaultFeedViewerPopUp = NSPopUpButton;
textFieldHomePage = NSTextField;
};
SUPERCLASS = PreferencePaneBase;
},
{CLASS = PreferencePaneBase; LANGUAGE = ObjC; SUPERCLASS = NSPreferencePane; }
);
IBVersion = 1;
}

View File

@@ -1,16 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
<string>10 8 462 260 0 0 1024 746 </string>
<key>IBFramework Version</key>
<string>446.1</string>
<key>IBOpenObjects</key>
<array>
<integer>5</integer>
</array>
<key>IBSystem Version</key>
<string>8L127</string>
</dict>
</plist>

View File

@@ -1,70 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Mozilla browser.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* william@dell.wisner.name (William Dell Wisner)
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#import <PreferencePaneBase.h>
@interface OrgMozillaChimeraPreferenceNavigation : PreferencePaneBase
{
IBOutlet NSTextField* textFieldHomePage;
IBOutlet NSButton* checkboxNewTabBlank;
IBOutlet NSButton* checkboxNewWindowBlank;
IBOutlet NSPopUpButton* defaultBrowserPopUp;
IBOutlet NSPopUpButton* defaultFeedViewerPopUp;
IBOutlet NSButton* checkboxCheckDefaultBrowserOnLaunch;
IBOutlet NSButton* checkboxWarnWhenClosing;
IBOutlet NSButton* checkboxRememberWindowState;
}
- (IBAction)checkboxStartPageClicked:(id)sender;
- (IBAction)defaultBrowserChange:(id)sender;
- (IBAction)defaultFeedViewerChange:(id)sender;
- (IBAction)warningCheckboxClicked:(id)sender;
- (IBAction)rememberWindowStateCheckboxClicked:(id)sender;
- (IBAction)checkDefaultBrowserOnLaunchClicked:(id)sender;
// method to be called so that when the default feed viewer is modified
// in FeedServiceController, we can rebuild the list here as well.
-(void)updateDefaultFeedViewerMenu;
-(IBAction)defaultFeedViewerChange:(id)sender;
-(IBAction)runOpenDialogToSelectBrowser:(id)sender;
-(IBAction)runOpenDialogToSelectFeedViewer:(id)sender;
@end

View File

@@ -1,268 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Mozilla browser.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* william@dell.wisner.name (William Dell Wisner)
* josh@mozilla.com (Josh Aas)
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#import <Carbon/Carbon.h>
#import <Cocoa/Cocoa.h>
#import <ApplicationServices/ApplicationServices.h>
#import "NSWorkspace+Utils.h"
#import "AppListMenuFactory.h"
#import "Navigation.h"
const int kDefaultExpireDays = 9;
@interface OrgMozillaChimeraPreferenceNavigation(Private)
- (NSString*)getCurrentHomePage;
- (void)updateDefaultBrowserMenu;
- (void)browserSelectionPanelDidEnd:(NSOpenPanel*)sheet returnCode:(int)returnCode contextInfo:(void*)contextInfo;
- (void)feedSelectionPanelDidEnd:(NSOpenPanel*)sheet returnCode:(int)returnCode contextInfo:(void*)contextInfo;
@end
@implementation OrgMozillaChimeraPreferenceNavigation
- (id)initWithBundle:(NSBundle *)bundle
{
if ((self = [super initWithBundle:bundle])) {
[[NSUserDefaults standardUserDefaults] registerDefaults:[NSDictionary dictionaryWithObject:[NSArray array]
forKey:kUserChosenBrowserUserDefaultsKey]];
[[NSUserDefaults standardUserDefaults] registerDefaults:[NSDictionary dictionaryWithObject:[NSArray array]
forKey:kUserChosenFeedViewerUserDefaultsKey]];
}
return self;
}
- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
[super dealloc];
}
- (void)mainViewDidLoad
{
if (!mPrefService)
return;
BOOL gotPref;
// 0: blank page. 1: home page. 2: last page visited. Our behaviour here should
// match what the browser does when the prefs don't exist.
if (([self getIntPref:"browser.startup.page" withSuccess:&gotPref] == 1) || !gotPref)
[checkboxNewWindowBlank setState:NSOnState];
if (([self getIntPref:"browser.tabs.startPage" withSuccess:&gotPref] == 1))
[checkboxNewTabBlank setState:NSOnState];
if ([self getBooleanPref:"camino.check_default_browser" withSuccess:&gotPref] || !gotPref)
[checkboxCheckDefaultBrowserOnLaunch setState:NSOnState];
if ([self getBooleanPref:"camino.warn_when_closing" withSuccess:&gotPref])
[checkboxWarnWhenClosing setState:NSOnState];
if ([self getBooleanPref:"camino.remember_window_state" withSuccess:&gotPref])
[checkboxRememberWindowState setState:NSOnState];
[textFieldHomePage setStringValue:[self getCurrentHomePage]];
// set up default browser menu
[self updateDefaultBrowserMenu];
// set up the feed viewer menu
[self updateDefaultFeedViewerMenu];
// register notification if the default feed viewer is changed in the FeedServiceController
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(updateDefaultFeedViewerMenu)
name:kDefaultFeedViewerChanged
object:nil];
}
- (void) didUnselect
{
if (!mPrefService)
return;
[self setPref:"browser.startup.homepage" toString:[textFieldHomePage stringValue]];
// ensure that the prefs exist
[self setPref:"browser.startup.page" toInt:[checkboxNewWindowBlank state] ? 1 : 0];
[self setPref:"browser.tabs.startPage" toInt:[checkboxNewTabBlank state] ? 1 : 0];
}
- (IBAction)checkboxStartPageClicked:(id)sender
{
if (!mPrefService)
return;
char *prefName = NULL;
if (sender == checkboxNewTabBlank)
prefName = "browser.tabs.startPage";
else if (sender == checkboxNewWindowBlank)
prefName = "browser.startup.page";
if (prefName)
[self setPref:prefName toInt: [sender state] ? 1 : 0];
}
- (IBAction)warningCheckboxClicked:(id)sender
{
if (sender == checkboxWarnWhenClosing)
[self setPref:"camino.warn_when_closing" toBoolean:([sender state] == NSOnState)];
}
- (IBAction)rememberWindowStateCheckboxClicked:(id)sender
{
if (sender == checkboxRememberWindowState)
[self setPref:"camino.remember_window_state" toBoolean:([sender state] == NSOnState)];
}
- (IBAction)checkDefaultBrowserOnLaunchClicked:(id)sender
{
if (sender == checkboxCheckDefaultBrowserOnLaunch)
[self setPref:"camino.check_default_browser" toBoolean:([sender state] == NSOnState)];
}
- (NSString*)getCurrentHomePage
{
BOOL gotPref;
return [self getStringPref:"browser.startup.homepage" withSuccess:&gotPref];
}
// called when the users changes the selection in the default browser menu
- (IBAction)defaultBrowserChange:(id)sender
{
[[AppListMenuFactory sharedAppListMenuFactory] validateAndRegisterDefaultBrowser:[sender representedObject]];
[self updateDefaultBrowserMenu];
}
-(IBAction)defaultFeedViewerChange:(id)sender
{
[[AppListMenuFactory sharedAppListMenuFactory] validateAndRegisterDefaultFeedViewer:[sender representedObject]];
[self updateDefaultFeedViewerMenu];
}
-(IBAction)runOpenDialogToSelectBrowser:(id)sender
{
NSOpenPanel *op = [NSOpenPanel openPanel];
[op setCanChooseDirectories:NO];
[op setAllowsMultipleSelection:NO];
[op beginSheetForDirectory:nil
file:nil
types:[NSArray arrayWithObject:@"app"]
modalForWindow:[defaultBrowserPopUp window]
modalDelegate:self
didEndSelector:@selector(browserSelectionPanelDidEnd:returnCode:contextInfo:)
contextInfo:nil];
}
-(IBAction)runOpenDialogToSelectFeedViewer:(id)sender
{
NSOpenPanel *op = [NSOpenPanel openPanel];
[op setCanChooseDirectories:NO];
[op setAllowsMultipleSelection:NO];
[op beginSheetForDirectory:nil
file:nil
types:[NSArray arrayWithObject:@"app"]
modalForWindow:[defaultFeedViewerPopUp window]
modalDelegate:self
didEndSelector:@selector(feedSelectionPanelDidEnd:returnCode:contextInfo:)
contextInfo:nil];
}
- (void)browserSelectionPanelDidEnd:(NSOpenPanel*)sheet returnCode:(int)returnCode contextInfo:(void*)contextInfo
{
if (returnCode == NSOKButton) {
NSString *chosenBundleID = [[NSWorkspace sharedWorkspace] identifierForBundle:[[sheet URLs] objectAtIndex:0]];
if (chosenBundleID) {
// add this browser to a list of apps we should always consider as browsers
NSMutableArray *userChosenBundleIDs = [NSMutableArray arrayWithCapacity:2];
[userChosenBundleIDs addObjectsFromArray:[[NSUserDefaults standardUserDefaults] objectForKey:kUserChosenBrowserUserDefaultsKey]];
if (![userChosenBundleIDs containsObject:chosenBundleID]) {
[userChosenBundleIDs addObject:chosenBundleID];
[[NSUserDefaults standardUserDefaults] setObject:userChosenBundleIDs forKey:kUserChosenBrowserUserDefaultsKey];
}
// make it the default browser
[[NSWorkspace sharedWorkspace] setDefaultBrowserWithIdentifier:chosenBundleID];
}
}
[self updateDefaultBrowserMenu];
}
- (void)feedSelectionPanelDidEnd:(NSOpenPanel*)sheet returnCode:(int)returnCode contextInfo:(void*)contextInfo
{
if (returnCode == NSOKButton) {
NSString* chosenBundleID = [[NSWorkspace sharedWorkspace] identifierForBundle:[[sheet URLs] objectAtIndex:0]];
if (chosenBundleID) {
// add this browser to a list of apps we should always consider as browsers
NSMutableArray* userChosenBundleIDs = [NSMutableArray arrayWithCapacity:2];
[userChosenBundleIDs addObjectsFromArray:[[NSUserDefaults standardUserDefaults] objectForKey:kUserChosenFeedViewerUserDefaultsKey]];
if (![userChosenBundleIDs containsObject:chosenBundleID]) {
[userChosenBundleIDs addObject:chosenBundleID];
[[NSUserDefaults standardUserDefaults] setObject:userChosenBundleIDs forKey:kUserChosenFeedViewerUserDefaultsKey];
}
// set the default feed viewer
[[NSWorkspace sharedWorkspace] setDefaultFeedViewerWithIdentifier:chosenBundleID];
[self updateDefaultFeedViewerMenu];
}
}
// The open action was cancelled, re-select the default application
else
[defaultFeedViewerPopUp selectItemAtIndex:0];
}
-(void)updateDefaultBrowserMenu
{
[[AppListMenuFactory sharedAppListMenuFactory] buildBrowserAppsMenuForPopup:defaultBrowserPopUp
andAction:@selector(defaultBrowserChange:)
andSelectAction:@selector(runOpenDialogToSelectBrowser:)
andTarget:self];
}
-(void)updateDefaultFeedViewerMenu
{
[[AppListMenuFactory sharedAppListMenuFactory] buildFeedAppsMenuForPopup:defaultFeedViewerPopUp
andAction:@selector(defaultFeedViewerChange:)
andSelectAction:@selector(runOpenDialogToSelectFeedViewer:)
andTarget:self];
}
@end

View File

@@ -1,17 +0,0 @@
{
IBClasses = (
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{
CLASS = NSPreferencePane;
LANGUAGE = ObjC;
OUTLETS = {_firstKeyView = id; _initialKeyView = id; _lastKeyView = id; _window = id; };
SUPERCLASS = NSObject;
},
{
CLASS = OrgMozillaChimeraPreferencePersonal;
LANGUAGE = ObjC;
SUPERCLASS = NSPreferencePane;
}
);
IBVersion = 1;
}

View File

@@ -1,22 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
<plist version="0.9">
<dict>
<key>IBDocumentLocation</key>
<string>185 70 356 240 0 0 1152 746 </string>
<key>IBFramework Version</key>
<string>248.0</string>
<key>IBGroupedObjects</key>
<dict>
<key>3</key>
<array>
<string>153</string>
<string>155</string>
</array>
</dict>
<key>IBLastGroupID</key>
<string>4</string>
<key>IBSystem Version</key>
<string>5S66</string>
</dict>
</plist>

View File

@@ -1,9 +0,0 @@
#import <Cocoa/Cocoa.h>
#import <PreferencePanes/NSPreferencePane.h>
@interface OrgMozillaChimeraPreferencePersonal : NSPreferencePane
{
}
@end

View File

@@ -1,19 +0,0 @@
#import "PersonalPane.h"
@implementation OrgMozillaChimeraPreferencePersonal
- (id) initWithBundle:(NSBundle *) bundle {
self = [super initWithBundle:bundle] ;
return self ;
}
- (void)awakeFromNib
{
}
- (void)mainViewDidLoad
{
}
@end

View File

@@ -1,61 +0,0 @@
{
IBClasses = (
{CLASS = ExtendedTableView; LANGUAGE = ObjC; SUPERCLASS = NSTableView; },
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{
CLASS = NSPreferencePane;
LANGUAGE = ObjC;
OUTLETS = {
"_firstKeyView" = id;
"_initialKeyView" = id;
"_lastKeyView" = id;
"_window" = id;
};
SUPERCLASS = NSObject;
},
{CLASS = NSTableView; LANGUAGE = ObjC; SUPERCLASS = NSControl; },
{
ACTIONS = {
blockCookiesFromSites = id;
clickAskAboutCookies = id;
clickAutoFillPasswords = id;
clickCookieBehavior = id;
clickStorePasswords = id;
editCookies = id;
editCookiesDone = id;
editPermissions = id;
editPermissionsDone = id;
launchKeychainAccess = id;
removeAllCookiePermissions = id;
removeAllCookies = id;
removeCookiePermissions = id;
removeCookies = id;
removeCookiesAndBlockSites = id;
};
CLASS = OrgMozillaChimeraPreferencePrivacy;
LANGUAGE = ObjC;
OUTLETS = {
mAskAboutCookies = NSButton;
mCookieBehavior = NSMatrix;
mCookiesFilterField = SearchTextField;
mCookiesPanel = id;
mCookiesTable = ExtendedTableView;
mPermissionColumn = NSTableColumn;
mPermissionFilterField = SearchTextField;
mPermissionsPanel = id;
mPermissionsTable = ExtendedTableView;
mStorePasswords = NSButton;
};
SUPERCLASS = PreferencePaneBase;
},
{CLASS = PopupMenuButton; LANGUAGE = ObjC; SUPERCLASS = NSButton; },
{CLASS = PreferencePaneBase; LANGUAGE = ObjC; SUPERCLASS = NSPreferencePane; },
{
ACTIONS = {selectText = id; };
CLASS = SearchTextField;
LANGUAGE = ObjC;
SUPERCLASS = NSTextField;
}
);
IBVersion = 1;
}

View File

@@ -1,24 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
<string>36 15 406 307 0 0 1024 746 </string>
<key>IBEditorPositions</key>
<dict>
<key>622</key>
<string>135 203 252 130 0 0 1024 746 </string>
<key>635</key>
<string>813 503 126 68 0 0 1600 1002 </string>
</dict>
<key>IBFramework Version</key>
<string>446.1</string>
<key>IBOpenObjects</key>
<array>
<integer>401</integer>
<integer>5</integer>
</array>
<key>IBSystem Version</key>
<string>8J135</string>
</dict>
</plist>

View File

@@ -1,41 +0,0 @@
{
IBClasses = (
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{
CLASS = NSPreferencePane;
LANGUAGE = ObjC;
OUTLETS = {
"_firstKeyView" = id;
"_initialKeyView" = id;
"_lastKeyView" = id;
"_window" = id;
};
SUPERCLASS = NSObject;
},
{
ACTIONS = {
clearCookies = id;
clickEnableCookies = id;
clickEnableJS = id;
clickEnableJava = id;
clickEnableLeaveEncrypted = id;
clickEnableLoadLowGrade = id;
clickEnableViewMixed = id;
clickPromptForCookie = id;
};
CLASS = OrgMozillaChimeraPreferencePrivacy;
LANGUAGE = ObjC;
OUTLETS = {
mCookies = id;
mEnableJS = NSButton;
mEnableJava = NSButton;
mLeaveEncrypted = NSButton;
mLoadLowGrade = NSButton;
mPromptForCookie = NSButton;
mViewMixed = NSButton;
};
SUPERCLASS = NSPreferencePane;
}
);
IBVersion = 1;
}

View File

@@ -1,16 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
<string>66 140 356 240 0 0 1280 832 </string>
<key>IBFramework Version</key>
<string>364.0</string>
<key>IBOpenObjects</key>
<array>
<integer>5</integer>
</array>
<key>IBSystem Version</key>
<string>7S215</string>
</dict>
</plist>

View File

@@ -1,146 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#import <Cocoa/Cocoa.h>
#import <PreferencePanes/NSPreferencePane.h>
#import "PreferencePaneBase.h"
#import "nsCOMArray.h"
#import "ExtendedTableView.h"
#import "SearchTextField.h"
class nsIPref;
class nsIPermissionManager;
class nsIPermission;
class nsICookieManager;
class nsICookie;
@class ExtendedTableView;
// network.cookie.cookieBehavior settings
// these are the defaults, overriden by whitelist/blacklist
typedef enum ECookieBehaviorSettings
{
eAcceptAllCookies,
eAcceptCookiesFromOriginatingServer,
eDenyAllCookies
} ECookieBehaviorSettings;
// for the "Policy" column in the Exceptions List
typedef enum ECookiePolicyPopupIndex
{
eAllowIndex,
eSessionOnlyIndex,
eDenyIndex
} ECookiePolicyPopupIndex;
@interface OrgMozillaChimeraPreferencePrivacy : PreferencePaneBase
{
// pane
IBOutlet NSMatrix* mCookieBehavior;
IBOutlet NSButton* mAskAboutCookies;
IBOutlet NSButton* mStorePasswords;
BOOL mSortedAscending; // sort direction for tables in sheets
// permission sheet
IBOutlet id mPermissionsPanel;
IBOutlet ExtendedTableView* mPermissionsTable;
IBOutlet NSTableColumn* mPermissionColumn;
IBOutlet SearchTextField* mPermissionFilterField;
nsIPermissionManager* mPermissionManager; // STRONG (should be nsCOMPtr)
nsCOMArray<nsIPermission>* mCachedPermissions; // parallel list for speed, STRONG
// cookie sheet
IBOutlet id mCookiesPanel;
IBOutlet ExtendedTableView* mCookiesTable;
IBOutlet SearchTextField* mCookiesFilterField;
nsICookieManager* mCookieManager;
nsCOMArray<nsICookie>* mCachedCookies;
}
// main panel button actions
-(IBAction) clickCookieBehavior:(id)aSender;
-(IBAction) clickAskAboutCookies:(id)sender;
-(IBAction) clickStorePasswords:(id)sender;
-(IBAction) launchKeychainAccess:(id)sender;
// cookie editing functions
-(void) populateCookieCache;
-(IBAction) editCookies:(id)aSender;
-(IBAction) editCookiesDone:(id)aSender;
-(IBAction) removeCookies:(id)aSender;
-(IBAction) removeAllCookies:(id)aSender;
-(IBAction) blockCookiesFromSites:(id)aSender;
-(IBAction) removeCookiesAndBlockSites:(id)aSender;
// permission editing functions
-(void) populatePermissionCache;
-(IBAction) editPermissions:(id)aSender;
-(IBAction) editPermissionsDone:(id)aSender;
-(IBAction) removeCookiePermissions:(id)aSender;
-(IBAction) removeAllCookiePermissions:(id)aSender;
-(int) getRowForPermissionWithHost:(NSString *)aHost;
-(void) mapCookiePrefToGUI:(int)pref;
// data source informal protocol (NSTableDataSource)
- (int)numberOfRowsInTableView:(NSTableView *)aTableView;
- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex;
- (void)tableView:(NSTableView *)aTableView setObjectValue:anObject forTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex;
// NSTableView delegate methods
- (void)tableView:(NSTableView *)aTableView didClickTableColumn:(NSTableColumn *)aTableColumn;
// sorting support methods
- (void)sortCookiesByColumn:(NSTableColumn *)aTableColumn inAscendingOrder:(BOOL)ascending;
- (void)sortPermissionsByColumn:(NSTableColumn *)aTableColumn inAscendingOrder:(BOOL)ascending;
//filtering methods
- (void) filterCookiesPermissionsWithString: (NSString*) inFilterString;
- (void) filterCookiesWithString: (NSString*) inFilterString;
@end
// custom formatter for cookies list to handle session cookie expiration sanely
@interface CookieDateFormatter : NSDateFormatter
{
CFDateFormatterRef mLocaleFormatter; // strong
}
@end

File diff suppressed because it is too large Load Diff

View File

@@ -1,34 +0,0 @@
{
IBClasses = (
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{
CLASS = NSPreferencePane;
LANGUAGE = ObjC;
OUTLETS = {
"_firstKeyView" = id;
"_initialKeyView" = id;
"_lastKeyView" = id;
"_window" = id;
};
SUPERCLASS = NSObject;
},
{
ACTIONS = {
clickCertificateSelectionBehavior = id;
clickEnableLeaveEncrypted = id;
clickEnableViewMixed = id;
showCertificates = id;
};
CLASS = OrgMozillaChimeraPreferenceSecurity;
LANGUAGE = ObjC;
OUTLETS = {
mCertificateBehavior = NSMatrix;
mLeaveEncrypted = NSButton;
mViewMixed = NSButton;
};
SUPERCLASS = PreferencePaneBase;
},
{CLASS = PreferencePaneBase; LANGUAGE = ObjC; SUPERCLASS = NSPreferencePane; }
);
IBVersion = 1;
}

View File

@@ -1,28 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
<string>89 2 356 240 0 0 1680 1028 </string>
<key>IBFramework Version</key>
<string>446.1</string>
<key>IBOpenObjects</key>
<array>
<integer>5</integer>
</array>
<key>IBSystem Version</key>
<string>8L2127</string>
<key>IBUserGuides</key>
<dict>
<key>5</key>
<dict>
<key>guideLocations</key>
<array>
<string>Vertical:297.000000</string>
</array>
<key>guidesLocked</key>
<false/>
</dict>
</dict>
</dict>
</plist>

View File

@@ -1,59 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#import <Cocoa/Cocoa.h>
#import <PreferencePanes/NSPreferencePane.h>
#import "PreferencePaneBase.h"
class nsIPref;
@interface OrgMozillaChimeraPreferenceSecurity : PreferencePaneBase
{
IBOutlet NSButton* mLeaveEncrypted;
IBOutlet NSButton* mViewMixed;
IBOutlet NSMatrix* mCertificateBehavior;
}
- (IBAction)clickEnableLeaveEncrypted:(id)sender;
- (IBAction)clickEnableViewMixed:(id)sender;
- (IBAction)clickCertificateSelectionBehavior:(id)sender;
- (IBAction)showCertificates:(id)sender;
@end

View File

@@ -1,130 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#import "SecurityPane.h"
#include "nsServiceManagerUtils.h"
#include "nsIPref.h"
// prefs for showing security dialogs
#define LEAVE_SITE_PREF "security.warn_leaving_secure"
#define MIXEDCONTENT_PREF "security.warn_viewing_mixed"
const unsigned int kSelectAutomaticallyMatrixRowValue = 0;
const unsigned int kAskEveryTimeMatrixRowValue = 1;
@implementation OrgMozillaChimeraPreferenceSecurity
- (void)dealloc
{
[super dealloc];
}
- (void)updateButtons
{
// Set initial value on Security checkboxes
PRBool leaveEncrypted = PR_TRUE;
mPrefService->GetBoolPref(LEAVE_SITE_PREF, &leaveEncrypted);
[mLeaveEncrypted setState:(leaveEncrypted ? NSOnState : NSOffState)];
PRBool viewMixed = PR_TRUE;
mPrefService->GetBoolPref(MIXEDCONTENT_PREF, &viewMixed);
[mViewMixed setState:(viewMixed ? NSOnState : NSOffState)];
BOOL gotPref;
NSString* certificateBehavior = [self getStringPref:"security.default_personal_cert" withSuccess:&gotPref];
if (gotPref) {
if ([certificateBehavior isEqual:@"Select Automatically"])
[mCertificateBehavior selectCellAtRow:kSelectAutomaticallyMatrixRowValue column:0];
else if ([certificateBehavior isEqual:@"Ask Every Time"])
[mCertificateBehavior selectCellAtRow:kAskEveryTimeMatrixRowValue column:0];
}
}
- (void)mainViewDidLoad
{
if ( !mPrefService )
return;
[self updateButtons];
}
- (void)didActivate
{
[self updateButtons];
}
//
// clickEnableViewMixed:
// clickEnableLeaveEncrypted:
//
// Set prefs for warnings/alerts wrt secure sites
//
- (IBAction)clickEnableViewMixed:(id)sender
{
[self setPref:MIXEDCONTENT_PREF toBoolean:[sender state] == NSOnState];
}
- (IBAction)clickEnableLeaveEncrypted:(id)sender
{
[self setPref:LEAVE_SITE_PREF toBoolean:[sender state] == NSOnState];
}
- (IBAction)clickCertificateSelectionBehavior:(id)sender
{
unsigned int row = [mCertificateBehavior selectedRow];
if (row == kSelectAutomaticallyMatrixRowValue)
[self setPref:"security.default_personal_cert" toString:@"Select Automatically"];
else // row == kAskEveryTimeMatrixRowValue
[self setPref:"security.default_personal_cert" toString:@"Ask Every Time"];
}
- (IBAction)showCertificates:(id)sender
{
// we'll just fire off a notification and let the application show the UI
NSDictionary* userInfoDict = [NSDictionary dictionaryWithObject:[mLeaveEncrypted window] // any view's window
forKey:@"parent_window"];
[[NSNotificationCenter defaultCenter] postNotificationName:@"ShowCertificatesNotification"
object:nil
userInfo:userInfoDict];
}
@end

View File

@@ -1,72 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2001
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Simon Fraser
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#import <PreferencePanes/PreferencePanes.h>
class nsIPref;
// optional methods that our prefs panes can implement
@interface NSObject(CaminoPreferencePane)
// the prefs window was activated; pane should update its state
- (void)didActivate;
@end
@interface PreferencePaneBase : NSPreferencePane
{
nsIPref* mPrefService; // strong, but can't use a comptr here
}
- (NSString*)getStringPref: (const char*)prefName withSuccess:(BOOL*)outSuccess;
- (NSColor*)getColorPref: (const char*)prefName withSuccess:(BOOL*)outSuccess;
- (BOOL)getBooleanPref: (const char*)prefName withSuccess:(BOOL*)outSuccess;
- (int)getIntPref: (const char*)prefName withSuccess:(BOOL*)outSuccess;
- (void)setPref: (const char*)prefName toString:(NSString*)value;
- (void)setPref: (const char*)prefName toColor:(NSColor*)value;
- (void)setPref: (const char*)prefName toBoolean:(BOOL)value;
- (void)setPref: (const char*)prefName toInt:(int)value;
- (void)clearPref: (const char*)prefName;
- (NSString*)getLocalizedString:(NSString*)key;
@end

View File

@@ -1,177 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2001
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Simon Fraser
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#import "PreferencePaneBase.h"
#include "nsCOMPtr.h"
#include "nsIServiceManager.h"
#include "nsIPref.h"
@implementation PreferencePaneBase
- (void) dealloc
{
NS_IF_RELEASE(mPrefService);
[super dealloc];
}
- (id) initWithBundle:(NSBundle *) bundle
{
self = [super initWithBundle:bundle] ;
nsCOMPtr<nsIPref> prefService ( do_GetService(NS_PREF_CONTRACTID) );
NS_ASSERTION(prefService, "Could not get pref service, pref panel left uninitialized");
mPrefService = prefService.get();
NS_IF_ADDREF(mPrefService);
return self;
}
#pragma mark -
- (NSString*)getStringPref: (const char*)prefName withSuccess:(BOOL*)outSuccess
{
NSString *prefValue = @"";
char *buf = nsnull;
nsresult rv = mPrefService->GetCharPref(prefName, &buf);
if (NS_SUCCEEDED(rv) && buf) {
// prefs are UTF-8
prefValue = [NSString stringWithUTF8String:buf];
free(buf);
if (outSuccess) *outSuccess = YES;
} else {
if (outSuccess) *outSuccess = NO;
}
return prefValue;
}
- (NSColor*)getColorPref: (const char*)prefName withSuccess:(BOOL*)outSuccess
{
// colors are stored in HTML-like #FFFFFF strings
NSString* colorString = [self getStringPref:prefName withSuccess:outSuccess];
NSColor* returnColor = [NSColor blackColor];
if ([colorString hasPrefix:@"#"] && [colorString length] == 7)
{
unsigned int redInt, greenInt, blueInt;
sscanf([colorString cString], "#%02x%02x%02x", &redInt, &greenInt, &blueInt);
float redFloat = ((float)redInt / 255.0);
float greenFloat = ((float)greenInt / 255.0);
float blueFloat = ((float)blueInt / 255.0);
returnColor = [NSColor colorWithCalibratedRed:redFloat green:greenFloat blue:blueFloat alpha:1.0f];
}
else
{
*outSuccess = NO;
}
return returnColor;
}
- (BOOL)getBooleanPref: (const char*)prefName withSuccess:(BOOL*)outSuccess
{
PRBool boolPref = PR_FALSE;
nsresult rv = mPrefService->GetBoolPref(prefName, &boolPref);
if (outSuccess)
*outSuccess = NS_SUCCEEDED(rv);
return boolPref ? YES : NO;
}
- (int)getIntPref: (const char*)prefName withSuccess:(BOOL*)outSuccess
{
PRInt32 intPref = 0;
nsresult rv = mPrefService->GetIntPref(prefName, &intPref);
if (outSuccess)
*outSuccess = NS_SUCCEEDED(rv);
return intPref;
}
- (void)setPref: (const char*)prefName toString:(NSString*)value
{
// prefs are UTF-8
if (mPrefService) {
mPrefService->SetCharPref(prefName, [value UTF8String]);
}
}
- (void)setPref: (const char*)prefName toColor:(NSColor*)value
{
// make sure we have a color in the RGB colorspace
NSColor* rgbColor = [value colorUsingColorSpaceName:NSCalibratedRGBColorSpace];
int redInt = (int)([rgbColor redComponent] * 255.0);
int greenInt = (int)([rgbColor greenComponent] * 255.0);
int blueInt = (int)([rgbColor blueComponent] * 255.0);
NSString* colorString = [NSString stringWithFormat:@"#%02x%02x%02x", redInt, greenInt, blueInt];
[self setPref:prefName toString:colorString];
}
- (void)setPref: (const char*)prefName toBoolean:(BOOL)value
{
if (mPrefService) {
mPrefService->SetBoolPref(prefName, value ? PR_TRUE : PR_FALSE);
}
}
- (void)setPref: (const char*)prefName toInt:(int)value
{
if (mPrefService) {
PRInt32 prefValue = value;
mPrefService->SetIntPref(prefName, prefValue);
}
}
- (void)clearPref: (const char*)prefName
{
if (mPrefService) {
mPrefService->ClearUserPref(prefName);
}
}
- (NSString*)getLocalizedString:(NSString*)key
{
return NSLocalizedStringFromTableInBundle(key, nil, [NSBundle bundleForClass:[self class]], @"");
}
@end

View File

@@ -1,31 +0,0 @@
{
IBClasses = (
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{
CLASS = NSPreferencePane;
LANGUAGE = ObjC;
OUTLETS = {
"_firstKeyView" = NSView;
"_initialKeyView" = NSView;
"_lastKeyView" = NSView;
"_window" = NSWindow;
};
SUPERCLASS = NSObject;
},
{
ACTIONS = {checkboxClicked = id; };
CLASS = OrgMozillaChimeraPreferenceTabs;
LANGUAGE = ObjC;
OUTLETS = {
mCheckboxLoadTabsInBackground = NSButton;
mCheckboxOpenTabsForCommand = NSButton;
mCheckboxOpenTabsForExternalLinks = NSButton;
mSingleWindowMode = NSButton;
mTabBarVisiblity = NSButton;
};
SUPERCLASS = PreferencePaneBase;
},
{CLASS = PreferencePaneBase; LANGUAGE = ObjC; SUPERCLASS = NSPreferencePane; }
);
IBVersion = 1;
}

View File

@@ -1,16 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
<string>15 12 522 320 0 0 1024 746 </string>
<key>IBFramework Version</key>
<string>446.1</string>
<key>IBOpenObjects</key>
<array>
<integer>5</integer>
</array>
<key>IBSystem Version</key>
<string>8J135</string>
</dict>
</plist>

View File

@@ -1,56 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Mozilla browser.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* william@dell.wisner.name (William Dell Wisner)
* josh@mozilla.com (Josh Aas)
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#import <Cocoa/Cocoa.h>
#import <PreferencePaneBase.h>
@interface OrgMozillaChimeraPreferenceTabs : PreferencePaneBase
{
IBOutlet NSButton* mCheckboxOpenTabsForCommand;
IBOutlet NSButton* mCheckboxOpenTabsForExternalLinks;
IBOutlet NSButton* mSingleWindowMode;
IBOutlet NSButton* mCheckboxLoadTabsInBackground;
IBOutlet NSButton* mTabBarVisiblity;
}
- (IBAction)checkboxClicked:(id)sender;
@end

Some files were not shown because too many files have changed in this diff Show More