mirror of https://github.com/roytam1/kmeleon.git
111 changed files with 1143 additions and 8329 deletions
@ -1,13 +0,0 @@
|
||||
# The "checkoutlist" file is used to support additional version controlled |
||||
# administrative files in $CVSROOT/CVSROOT, such as template files. |
||||
# |
||||
# The first entry on a line is a filename which will be checked out from |
||||
# the corresponding RCS file in the $CVSROOT/CVSROOT directory. |
||||
# The remainder of the line is an error message to use if the file cannot |
||||
# be checked out. |
||||
# |
||||
# File format: |
||||
# |
||||
# [<whitespace>]<filename><whitespace><error message><end-of-line> |
||||
# |
||||
# comment lines begin with '#' |
@ -1,15 +0,0 @@
|
||||
# The "commitinfo" file is used to control pre-commit checks. |
||||
# The filter on the right is invoked with the repository and a list |
||||
# of files to check. A non-zero exit of the filter program will |
||||
# cause the commit to be aborted. |
||||
# |
||||
# The first entry on a line is a regular expression which is tested |
||||
# against the directory that the change is being committed to, relative |
||||
# to the $CVSROOT. For the first match that is found, then the remainder |
||||
# of the line is the name of the filter to run. |
||||
# |
||||
# If the repository name does not match any of the regular expressions in this |
||||
# file, the "DEFAULT" line is used, if it is specified. |
||||
# |
||||
# If the name "ALL" appears as a regular expression it is always used |
||||
# in addition to the first matching regex or "DEFAULT". |
@ -1,11 +0,0 @@
|
||||
# Set this to "no" if pserver shouldn't check system users/passwords |
||||
#SystemAuth=no |
||||
|
||||
# Set `PreservePermissions' to `yes' to save file status information |
||||
# in the repository. |
||||
#PreservePermissions=no |
||||
|
||||
# Set `TopLevelAdmin' to `yes' to create a CVS directory at the top |
||||
# level of the new working directory when using the `cvs checkout' |
||||
# command. |
||||
#TopLevelAdmin=no |
@ -1,23 +0,0 @@
|
||||
# This file affects handling of files based on their names. |
||||
# |
||||
# The -t/-f options allow one to treat directories of files |
||||
# as a single file, or to transform a file in other ways on |
||||
# its way in and out of CVS. |
||||
# |
||||
# The -m option specifies whether CVS attempts to merge files. |
||||
# |
||||
# The -k option specifies keyword expansion (e.g. -kb for binary). |
||||
# |
||||
# Format of wrapper file ($CVSROOT/CVSROOT/cvswrappers or .cvswrappers) |
||||
# |
||||
# wildcard [option value][option value]... |
||||
# |
||||
# where option is one of |
||||
# -f from cvs filter value: path to filter |
||||
# -t to cvs filter value: path to filter |
||||
# -m update methodology value: MERGE or COPY |
||||
# -k expansion mode value: b, o, kkv, &c |
||||
# |
||||
# and value is a single-quote delimited value. |
||||
# For example: |
||||
#*.gif -k 'b' |
@ -1,21 +0,0 @@
|
||||
# The "editinfo" file is used to allow verification of logging |
||||
# information. It works best when a template (as specified in the |
||||
# rcsinfo file) is provided for the logging procedure. Given a |
||||
# template with locations for, a bug-id number, a list of people who |
||||
# reviewed the code before it can be checked in, and an external |
||||
# process to catalog the differences that were code reviewed, the |
||||
# following test can be applied to the code: |
||||
# |
||||
# Making sure that the entered bug-id number is correct. |
||||
# Validating that the code that was reviewed is indeed the code being |
||||
# checked in (using the bug-id number or a seperate review |
||||
# number to identify this particular code set.). |
||||
# |
||||
# If any of the above test failed, then the commit would be aborted. |
||||
# |
||||
# Actions such as mailing a copy of the report to each reviewer are |
||||
# better handled by an entry in the loginfo file. |
||||
# |
||||
# One thing that should be noted is the the ALL keyword is not |
||||
# supported. There can be only one entry that matches a given |
||||
# repository. |
@ -1,26 +0,0 @@
|
||||
# The "loginfo" file controls where "cvs commit" log information |
||||
# is sent. The first entry on a line is a regular expression which must match |
||||
# the directory that the change is being made to, relative to the |
||||
# $CVSROOT. If a match is found, then the remainder of the line is a filter |
||||
# program that should expect log information on its standard input. |
||||
# |
||||
# If the repository name does not match any of the regular expressions in this |
||||
# file, the "DEFAULT" line is used, if it is specified. |
||||
# |
||||
# If the name ALL appears as a regular expression it is always used |
||||
# in addition to the first matching regex or DEFAULT. |
||||
# |
||||
# You may specify a format string as part of the |
||||
# filter. The string is composed of a `%' followed |
||||
# by a single format character, or followed by a set of format |
||||
# characters surrounded by `{' and `}' as separators. The format |
||||
# characters are: |
||||
# |
||||
# s = file name |
||||
# V = old version number (pre-checkin) |
||||
# v = new version number (post-checkin) |
||||
# |
||||
# For example: |
||||
#DEFAULT (echo ""; id; echo %s; date; cat) >> $CVSROOT/CVSROOT/commitlog |
||||
# or |
||||
#DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog |
@ -1,26 +0,0 @@
|
||||
# Three different line formats are valid: |
||||
# key -a aliases... |
||||
# key [options] directory |
||||
# key [options] directory files... |
||||
# |
||||
# Where "options" are composed of: |
||||
# -i prog Run "prog" on "cvs commit" from top-level of module. |
||||
# -o prog Run "prog" on "cvs checkout" of module. |
||||
# -e prog Run "prog" on "cvs export" of module. |
||||
# -t prog Run "prog" on "cvs rtag" of module. |
||||
# -u prog Run "prog" on "cvs update" of module. |
||||
# -d dir Place module in directory "dir" instead of module name. |
||||
# -l Top-level directory only -- do not recurse. |
||||
# |
||||
# NOTE: If you change any of the "Run" options above, you'll have to |
||||
# release and re-checkout any working directories of these modules. |
||||
# |
||||
# And "directory" is a path to a directory relative to $CVSROOT. |
||||
# |
||||
# The "-a" option specifies an alias. An alias is interpreted as if |
||||
# everything on the right of the "-a" had been typed on the command line. |
||||
# |
||||
# You can encode a module within a module by using the special '&' |
||||
# character to interpose another module into the current module. This |
||||
# can be useful for creating a module that consists of many directories |
||||
# spread out over the entire source repository. |
@ -1,12 +0,0 @@
|
||||
# The "notify" file controls where notifications from watches set by |
||||
# "cvs watch add" or "cvs edit" are sent. The first entry on a line is |
||||
# a regular expression which is tested against the directory that the |
||||
# change is being made to, relative to the $CVSROOT. If it matches, |
||||
# then the remainder of the line is a filter program that should contain |
||||
# one occurrence of %s for the user to notify, and information on its |
||||
# standard input. |
||||
# |
||||
# "ALL" or "DEFAULT" can be used in place of the regular expression. |
||||
# |
||||
# For example: |
||||
#ALL mail %s -s "CVS notification" |
@ -1,13 +0,0 @@
|
||||
# The "rcsinfo" file is used to control templates with which the editor |
||||
# is invoked on commit and import. |
||||
# |
||||
# The first entry on a line is a regular expression which is tested |
||||
# against the directory that the change is being made to, relative to the |
||||
# $CVSROOT. For the first match that is found, then the remainder of the |
||||
# line is the name of the file that contains the template. |
||||
# |
||||
# If the repository name does not match any of the regular expressions in this |
||||
# file, the "DEFAULT" line is used, if it is specified. |
||||
# |
||||
# If the name "ALL" appears as a regular expression it is always used |
||||
# in addition to the first matching regex or "DEFAULT". |
@ -1,20 +0,0 @@
|
||||
# The "taginfo" file is used to control pre-tag checks. |
||||
# The filter on the right is invoked with the following arguments: |
||||
# |
||||
# $1 -- tagname |
||||
# $2 -- operation "add" for tag, "mov" for tag -F, and "del" for tag -d |
||||
# $3 -- repository |
||||
# $4-> file revision [file revision ...] |
||||
# |
||||
# A non-zero exit of the filter program will cause the tag to be aborted. |
||||
# |
||||
# The first entry on a line is a regular expression which is tested |
||||
# against the directory that the change is being committed to, relative |
||||
# to the $CVSROOT. For the first match that is found, then the remainder |
||||
# of the line is the name of the filter to run. |
||||
# |
||||
# If the repository name does not match any of the regular expressions in this |
||||
# file, the "DEFAULT" line is used, if it is specified. |
||||
# |
||||
# If the name "ALL" appears as a regular expression it is always used |
||||
# in addition to the first matching regex or "DEFAULT". |
@ -1,21 +0,0 @@
|
||||
# The "verifymsg" file is used to allow verification of logging |
||||
# information. It works best when a template (as specified in the |
||||
# rcsinfo file) is provided for the logging procedure. Given a |
||||
# template with locations for, a bug-id number, a list of people who |
||||
# reviewed the code before it can be checked in, and an external |
||||
# process to catalog the differences that were code reviewed, the |
||||
# following test can be applied to the code: |
||||
# |
||||
# Making sure that the entered bug-id number is correct. |
||||
# Validating that the code that was reviewed is indeed the code being |
||||
# checked in (using the bug-id number or a seperate review |
||||
# number to identify this particular code set.). |
||||
# |
||||
# If any of the above test failed, then the commit would be aborted. |
||||
# |
||||
# Actions such as mailing a copy of the report to each reviewer are |
||||
# better handled by an entry in the loginfo file. |
||||
# |
||||
# One thing that should be noted is the the ALL keyword is not |
||||
# supported. There can be only one entry that matches a given |
||||
# repository. |
@ -1,21 +0,0 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 8.00 |
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "JSBridge", "JSBridge.vcproj", "{5F7A1684-E791-4F70-A24F-FC6726273512}" |
||||
ProjectSection(ProjectDependencies) = postProject |
||||
EndProjectSection |
||||
EndProject |
||||
Global |
||||
GlobalSection(SolutionConfiguration) = preSolution |
||||
Debug = Debug |
||||
Release = Release |
||||
EndGlobalSection |
||||
GlobalSection(ProjectConfiguration) = postSolution |
||||
{5F7A1684-E791-4F70-A24F-FC6726273512}.Debug.ActiveCfg = Debug|Win32 |
||||
{5F7A1684-E791-4F70-A24F-FC6726273512}.Debug.Build.0 = Debug|Win32 |
||||
{5F7A1684-E791-4F70-A24F-FC6726273512}.Release.ActiveCfg = Release|Win32 |
||||
{5F7A1684-E791-4F70-A24F-FC6726273512}.Release.Build.0 = Release|Win32 |
||||
EndGlobalSection |
||||
GlobalSection(ExtensibilityGlobals) = postSolution |
||||
EndGlobalSection |
||||
GlobalSection(ExtensibilityAddIns) = postSolution |
||||
EndGlobalSection |
||||
EndGlobal |
@ -1,188 +0,0 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?> |
||||
<VisualStudioProject |
||||
ProjectType="Visual C++" |
||||
Version="7.10" |
||||
Name="JSBridge" |
||||
ProjectGUID="{5F7A1684-E791-4F70-A24F-FC6726273512}" |
||||
RootNamespace="JSBridge" |
||||
Keyword="Win32Proj"> |
||||
<Platforms> |
||||
<Platform |
||||
Name="Win32"/> |
||||
</Platforms> |
||||
<Configurations> |
||||
<Configuration |
||||
Name="Debug|Win32" |
||||
OutputDirectory="Debug" |
||||
IntermediateDirectory="Debug" |
||||
ConfigurationType="2" |
||||
CharacterSet="2"> |
||||
<Tool |
||||
Name="VCCLCompilerTool" |
||||
Optimization="0" |
||||
AdditionalIncludeDirectories="..\..\mozilla\mozilla\dist\include\dom;..\..\mozilla\mozilla\dist\include\xpcom;..\..\mozilla\mozilla\dist\include\nspr;..\..\mozilla\mozilla\dist\include\windowwatcher;..\..\mozilla\mozilla\dist\include\webbrwsr" |
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;JSBRIDGE_EXPORTS" |
||||
MinimalRebuild="TRUE" |
||||
BasicRuntimeChecks="3" |
||||
RuntimeLibrary="3" |
||||
UsePrecompiledHeader="0" |
||||
WarningLevel="3" |
||||
Detect64BitPortabilityProblems="TRUE" |
||||
DebugInformationFormat="4"/> |
||||
<Tool |
||||
Name="VCCustomBuildTool"/> |
||||
<Tool |
||||
Name="VCLinkerTool" |
||||
AdditionalDependencies="xpcom.lib xpcomglue_s.lib" |
||||
OutputFile="..\..\debug\kplugins\JSBridge.dll" |
||||
LinkIncremental="2" |
||||
AdditionalLibraryDirectories="..\..\mozilla\mozilla\dist\lib_debug" |
||||
GenerateDebugInformation="TRUE" |
||||
ProgramDatabaseFile="$(OutDir)/JSBridge.pdb" |
||||
SubSystem="2" |
||||
ImportLibrary="$(OutDir)/JSBridge.lib" |
||||
TargetMachine="1"/> |
||||
<Tool |
||||
Name="VCMIDLTool"/> |
||||
<Tool |
||||
Name="VCPostBuildEventTool" |
||||
CommandLine="copy js_bridge.xpt ..\..\debug\components\"/> |
||||
<Tool |
||||
Name="VCPreBuildEventTool" |
||||
CommandLine="$(ProjectDir)genidl.cmd"/> |
||||
<Tool |
||||
Name="VCPreLinkEventTool"/> |
||||
<Tool |
||||
Name="VCResourceCompilerTool"/> |
||||
<Tool |
||||
Name="VCWebServiceProxyGeneratorTool"/> |
||||
<Tool |
||||
Name="VCXMLDataGeneratorTool"/> |
||||
<Tool |
||||
Name="VCWebDeploymentTool"/> |
||||
<Tool |
||||
Name="VCManagedWrapperGeneratorTool"/> |
||||
<Tool |
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/> |
||||
</Configuration> |
||||
<Configuration |
||||
Name="Release|Win32" |
||||
OutputDirectory="Release" |
||||
IntermediateDirectory="Release" |
||||
ConfigurationType="2" |
||||
CharacterSet="2"> |
||||
<Tool |
||||
Name="VCCLCompilerTool" |
||||
AdditionalIncludeDirectories="..\..\mozilla\mozilla\dist\include\dom;..\..\mozilla\mozilla\dist\include\xpcom;..\..\mozilla\mozilla\dist\include\nspr;..\..\mozilla\mozilla\dist\include\windowwatcher;..\..\mozilla\mozilla\dist\include\webbrwsr" |
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;JSBRIDGE_EXPORTS" |
||||
RuntimeLibrary="2" |
||||
UsePrecompiledHeader="0" |
||||
WarningLevel="3" |
||||
Detect64BitPortabilityProblems="TRUE" |
||||
DebugInformationFormat="3"/> |
||||
<Tool |
||||
Name="VCCustomBuildTool"/> |
||||
<Tool |
||||
Name="VCLinkerTool" |
||||
AdditionalDependencies="xpcom.lib xpcomglue_s.lib" |
||||
OutputFile="..\..\release\kplugins\JSBridge.dll" |
||||
LinkIncremental="1" |
||||
AdditionalLibraryDirectories="..\..\mozilla\mozilla\dist\lib" |
||||
GenerateDebugInformation="TRUE" |
||||
SubSystem="2" |
||||
OptimizeReferences="2" |
||||
EnableCOMDATFolding="2" |
||||
ImportLibrary="$(OutDir)/JSBridge.lib" |
||||
TargetMachine="1"/> |
||||
<Tool |
||||
Name="VCMIDLTool"/> |
||||
<Tool |
||||
Name="VCPostBuildEventTool" |
||||
CommandLine="copy js_bridge.xpt ..\..\release\components\"/> |
||||
<Tool |
||||
Name="VCPreBuildEventTool" |
||||
CommandLine="$(ProjectDir)genidl.cmd"/> |
||||
<Tool |
||||
Name="VCPreLinkEventTool"/> |
||||
<Tool |
||||
Name="VCResourceCompilerTool"/> |
||||
<Tool |
||||
Name="VCWebServiceProxyGeneratorTool"/> |
||||
<Tool |
||||
Name="VCXMLDataGeneratorTool"/> |
||||
<Tool |
||||
Name="VCWebDeploymentTool"/> |
||||
<Tool |
||||
Name="VCManagedWrapperGeneratorTool"/> |
||||
<Tool |
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/> |
||||
</Configuration> |
||||
</Configurations> |
||||
<References> |
||||
</References> |
||||
<Files> |
||||
<Filter |
||||
Name="Source Files" |
||||
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx" |
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"> |
||||
<File |
||||
RelativePath=".\jscomp.cpp"> |
||||
</File> |
||||
<File |
||||
RelativePath=".\jsplugin.cpp"> |
||||
<FileConfiguration |
||||
Name="Debug|Win32"> |
||||
<Tool |
||||
Name="VCCLCompilerTool" |
||||
AdditionalIncludeDirectories=""../../mozilla/mozilla/dist/include/js";"../../mozilla/mozilla/dist/include/xpconnect";"../../mozilla/mozilla/dist/include/caps";"../../mozilla/mozilla/dist/include/mimetype";"../../mozilla/mozilla/dist/include/imglib2";"../../mozilla/mozilla/dist/include/content";"../../mozilla/mozilla/dist/include/locale";"../../mozilla/mozilla/dist/include/pippki";"../../mozilla/mozilla/dist/include/pipnss";"../../mozilla/mozilla/dist/include/cookie";"../../mozilla/mozilla/dist/include/xpcom_obsolete";"../../mozilla/mozilla/dist/include/typeaheadfind";"../../mozilla/mozilla/dist/include/appcomps";"../../mozilla/mozilla/dist/include/history";"../../mozilla/mozilla/dist/include/rdf";"../../mozilla/mozilla/dist/include/docshell";"../../mozilla/mozilla/dist/include/dom";"../../mozilla/mozilla/dist/include/embed_base";"../../mozilla/mozilla/dist/include/exthandler";"../../mozilla/mozilla/dist/include/find";"../../mozilla/mozilla/dist/include/gfx";"../../mozilla/mozilla/dist/include/helperAppDlg";"../../mozilla/mozilla/dist/include/intl";"../../mozilla/mozilla/dist/include/layout";"../../mozilla/mozilla/dist/include/necko";"../../mozilla/mozilla/dist/include/nkcache";"../../mozilla/mozilla/dist/include/pref";"../../mozilla/mozilla/dist/include/profile";"../../mozilla/mozilla/dist/include/shistory";"../../mozilla/mozilla/dist/include/string";"../../mozilla/mozilla/dist/include/uriloader";"../../mozilla/mozilla/dist/include/wallet";"../../mozilla/mozilla/dist/include/webBrowser_core";"../../mozilla/mozilla/dist/include/webbrowserpersist";"../../mozilla/mozilla/dist/include/webshell";"../../mozilla/mozilla/dist/include/widget";"../../mozilla/mozilla/dist/include/windowwatcher";"../../mozilla/mozilla/dist/include/xpcom";"../../mozilla/mozilla/dist/include/nspr";"../../mozilla/mozilla/dist/include/webbrwsr";"../../mozilla/mozilla/dist/include/commandhandler";"../../mozilla/mozilla/dist/include/plugin""/> |
||||
</FileConfiguration> |
||||
<FileConfiguration |
||||
Name="Release|Win32"> |
||||
<Tool |
||||
Name="VCCLCompilerTool" |
||||
AdditionalIncludeDirectories=""../../mozilla/mozilla/dist/include/js";"../../mozilla/mozilla/dist/include/xpconnect";"../../mozilla/mozilla/dist/include/caps";"../../mozilla/mozilla/dist/include/mimetype";"../../mozilla/mozilla/dist/include/imglib2";"../../mozilla/mozilla/dist/include/content";"../../mozilla/mozilla/dist/include/locale";"../../mozilla/mozilla/dist/include/pippki";"../../mozilla/mozilla/dist/include/pipnss";"../../mozilla/mozilla/dist/include/cookie";"../../mozilla/mozilla/dist/include/xpcom_obsolete";"../../mozilla/mozilla/dist/include/typeaheadfind";"../../mozilla/mozilla/dist/include/appcomps";"../../mozilla/mozilla/dist/include/history";"../../mozilla/mozilla/dist/include/rdf";"../../mozilla/mozilla/dist/include/docshell";"../../mozilla/mozilla/dist/include/dom";"../../mozilla/mozilla/dist/include/embed_base";"../../mozilla/mozilla/dist/include/exthandler";"../../mozilla/mozilla/dist/include/find";"../../mozilla/mozilla/dist/include/gfx";"../../mozilla/mozilla/dist/include/helperAppDlg";"../../mozilla/mozilla/dist/include/intl";"../../mozilla/mozilla/dist/include/layout";"../../mozilla/mozilla/dist/include/necko";"../../mozilla/mozilla/dist/include/nkcache";"../../mozilla/mozilla/dist/include/pref";"../../mozilla/mozilla/dist/include/profile";"../../mozilla/mozilla/dist/include/shistory";"../../mozilla/mozilla/dist/include/string";"../../mozilla/mozilla/dist/include/uriloader";"../../mozilla/mozilla/dist/include/wallet";"../../mozilla/mozilla/dist/include/webBrowser_core";"../../mozilla/mozilla/dist/include/webbrowserpersist";"../../mozilla/mozilla/dist/include/webshell";"../../mozilla/mozilla/dist/include/widget";"../../mozilla/mozilla/dist/include/windowwatcher";"../../mozilla/mozilla/dist/include/xpcom";"../../mozilla/mozilla/dist/include/nspr";"../../mozilla/mozilla/dist/include/webbrwsr";"../../mozilla/mozilla/dist/include/commandhandler";"../../mozilla/mozilla/dist/include/plugin""/> |
||||
</FileConfiguration> |
||||
</File> |
||||
<File |
||||
RelativePath=".\nsGenericFactory.cpp"> |
||||
</File> |
||||
<File |
||||
RelativePath=".\nsIJSBridge.idl"> |
||||
<FileConfiguration |
||||
Name="Debug|Win32" |
||||
ExcludedFromBuild="TRUE"> |
||||
<Tool |
||||
Name="VCCustomBuildTool" |
||||
CommandLine="..\..\mozilla\mozilla\dist\bin\xpidl.exe -m header |
||||
" |
||||
AdditionalDependencies="..\..\mozilla\mozilla\dist\idl\" |
||||
Outputs="-e nsIJSBridge.h $(InputFileName)"/> |
||||
</FileConfiguration> |
||||
<FileConfiguration |
||||
Name="Release|Win32" |
||||
ExcludedFromBuild="TRUE"> |
||||
<Tool |
||||
Name="VCMIDLTool"/> |
||||
</FileConfiguration> |
||||
</File> |
||||
</Filter> |
||||
<Filter |
||||
Name="Header Files" |
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd" |
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"> |
||||
<File |
||||
RelativePath=".\jscomp.h"> |
||||
</File> |
||||
<File |
||||
RelativePath=".\nsIJSBridge.h"> |
||||
</File> |
||||
</Filter> |
||||
<Filter |
||||
Name="Resource Files" |
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx" |
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"> |
||||
</Filter> |
||||
</Files> |
||||
<Globals> |
||||
</Globals> |
||||
</VisualStudioProject> |
@ -1,2 +0,0 @@
|
||||
@..\..\mozilla\mozilla\dist\bin\xpidl -m header -I ..\..\mozilla\mozilla\dist\idl nsIJSBridge.idl |
||||
@..\..\mozilla\mozilla\dist\bin\xpidl -e js_bridge.xpt -m typelib -I ..\..\mozilla\mozilla\dist\idl nsIJSBridge.idl |
@ -1,71 +0,0 @@
|
||||
#define WIN32_LEAN_AND_MEAN |
||||
#include <windows.h> |
||||
#include <string.h> |
||||
#include <stdlib.h> |
||||
#include <nsIDOMWindow.h> |
||||
#include <nsIWindowWatcher.h> |
||||
#include <nsServiceManagerUtils.h> |
||||
#include <nsIWebBrowserChrome.h> |
||||
#include <nsIEmbeddingSiteWindow.h> |
||||
|
||||
#include "..\kmeleon_plugin.h" |
||||
#include "jscomp.h" |
||||
|
||||
extern kmeleonPlugin kPlugin; |
||||
|
||||
NS_IMETHODIMP CJSBridge::SetMenu(const char *menu, PRUint16 type, const char *label, const char *command, const char *before) |
||||
{ |
||||
kmeleonMenuItem item; |
||||
item.label = label; |
||||
item.type = type - 1; |
||||
item.command = *command ? kPlugin.kFuncs->GetID(command) : 1; |
||||
if (before && *before) { |
||||
item.before = atoi(before); |
||||
if (!item.before && strcmp(before, "0") != 0) { |
||||
item.before = kPlugin.kFuncs->GetID(before); |
||||
if (!item.before)
|
||||
item.before = (long)before; |
||||
} |
||||
} |
||||
else item.before = -1; |
||||
kPlugin.kFuncs->SetMenu(menu, &item); |
||||
|
||||
return NS_OK; |
||||
} |
||||
|
||||
/* void RebuildMenu (in string menu); */ |
||||
NS_IMETHODIMP CJSBridge::RebuildMenu(const char *menu) |
||||
{ |
||||
kPlugin.kFuncs->RebuildMenu(menu); |
||||
return NS_OK; |
||||
} |
||||
|
||||
/* void id (in string id); */ |
||||
NS_IMETHODIMP CJSBridge::Id(nsIDOMWindow *window, const char *id) |
||||
{ |
||||
nsCOMPtr<nsIWindowWatcher> mWWatch(do_GetService(NS_WINDOWWATCHER_CONTRACTID)); |
||||
NS_ENSURE_TRUE (mWWatch, nsnull); |
||||
|
||||
nsCOMPtr<nsIWebBrowserChrome> chrome; |
||||
HWND hWin = NULL; |
||||
|
||||
if (mWWatch) { |
||||
nsCOMPtr<nsIDOMWindow> fosterParent; |
||||
if (!window) { // it will be a dependent window. try to find a foster parent.
|
||||
mWWatch->GetActiveWindow(getter_AddRefs(fosterParent)); |
||||
window = fosterParent; |
||||
} |
||||
mWWatch->GetChromeForWindow(window, getter_AddRefs(chrome)); |
||||
} |
||||
|
||||
if (chrome) { |
||||
nsCOMPtr<nsIEmbeddingSiteWindow> site(do_QueryInterface(chrome)); |
||||
if (site) |
||||
site->GetSiteWindow(reinterpret_cast<void **>(&hWin)); |
||||
} |
||||
|
||||
NS_ENSURE_TRUE(hWin, NS_ERROR_FAILURE); |
||||
|
||||
SendMessage(hWin, WM_COMMAND, kPlugin.kFuncs->GetID(id), (LPARAM)NULL); |
||||
return NS_OK; |
||||
} |
@ -1,21 +0,0 @@
|
||||
#define MOZILLA_STRICT_API |
||||
#include <nsXPCOM.h> |
||||
#include <nsCOMPtr.h> |
||||
#include <nsISupports.h> |
||||
#include "nsIJSBridge.h" |
||||
|
||||
#define JSBRIDGE_CID { 0x842170a0, 0x5210, 0x11db, { 0xb0, 0xde, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66}} |
||||
static NS_DEFINE_CID(kJSBridgeCID, JSBRIDGE_CID); |
||||
|
||||
|
||||
class CJSBridge : public nsIJSBridge
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIJSBRIDGE |
||||
|
||||
CJSBridge() {}; |
||||
virtual ~CJSBridge() {}; |
||||
|
||||
}; |
||||
|
@ -1,107 +0,0 @@
|
||||
#define WIN32_LEAN_AND_MEAN |
||||
#include <windows.h> |
||||
#include <stdio.h> |
||||
|
||||
#define KMELEON_PLUGIN_EXPORTS |
||||
#include "..\kmeleon_plugin.h" |
||||
#include "..\KMeleonConst.h" |
||||
|
||||
#define PLUGIN_NAME "Kmeleon JS Bridge" |
||||
long DoMessage(const char *, const char *, const char *, long, long); |
||||
kmeleonPlugin kPlugin = { |
||||
KMEL_PLUGIN_VER, |
||||
PLUGIN_NAME, |
||||
DoMessage |
||||
}; |
||||
|
||||
#define MOZILLA_STRICT_API |
||||
#include <nsXPCOM.h> |
||||
#include <nsCOMPtr.h> |
||||
#include <nsISupports.h> |
||||
#include <nsIComponentRegistrar.h> |
||||
#include <nsIGenericFactory.h> |
||||
#include <nsIServiceManager.h> |
||||
#include <nsServiceManagerUtils.h> |
||||
#include "nsIJSBridge.h" |
||||
#include "jscomp.h" |
||||
#include "nsEmbedString.h" |
||||
|
||||
NS_IMPL_ISUPPORTS1(CJSBridge, nsIJSBridge);
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(CJSBridge)
|
||||
|
||||
static const nsModuleComponentInfo components =
|
||||
{ |
||||
"Kmeleon JS Bridge",
|
||||
JSBRIDGE_CID,
|
||||
"@kmeleon/jsbridge;1",
|
||||
CJSBridgeConstructor |
||||
}; |
||||
|
||||
static nsCOMPtr<nsIGenericFactory> componentFactory; |
||||
|
||||
BOOL Init()
|
||||
{ |
||||
nsCOMPtr<nsIComponentRegistrar> compReg; |
||||
nsresult rv = NS_GetComponentRegistrar(getter_AddRefs(compReg)); |
||||
NS_ENSURE_SUCCESS(rv, FALSE); |
||||
|
||||
rv = NS_NewGenericFactory(getter_AddRefs(componentFactory), &components); |
||||
if (NS_FAILED(rv) || !componentFactory) |
||||
return FALSE; |
||||
|
||||
rv = compReg->RegisterFactory(components.mCID, |
||||
components.mDescription, |
||||
components.mContractID, |
||||
componentFactory); |
||||
|
||||
return NS_SUCCEEDED(rv) ? TRUE : FALSE; |
||||
} |
||||
|
||||
BOOL Quit() |
||||
{ |
||||
nsresult rv; |
||||
nsCOMPtr<nsIComponentRegistrar> compReg; |
||||
rv = NS_GetComponentRegistrar(getter_AddRefs (compReg)); |
||||
NS_ENSURE_SUCCESS(rv, FALSE); |
||||
|
||||
|
||||
rv = compReg->UnregisterFactory(components.mCID, componentFactory); |
||||
return NS_SUCCEEDED(rv) ? TRUE : FALSE; |
||||
} |
||||
|
||||
|
||||
long DoMessage(const char *to, const char *from, const char *subject, |
||||
long data1, long data2) |
||||
{ |
||||
if (to[0] == '*' || stricmp(to, kPlugin.dllname) == 0) { |
||||
if (stricmp(subject, "Init") == 0) { |
||||
Init(); |
||||
} |
||||
else if (stricmp(subject, "Quit") == 0) { |
||||
Quit(); |
||||
} |
||||
else return 0; |
||||
return 1; |
||||
} |
||||
return 0; |
||||
} |
||||
|
||||
BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ) { |
||||
switch (ul_reason_for_call) { |
||||
case DLL_PROCESS_ATTACH: |
||||
case DLL_THREAD_ATTACH: |
||||
case DLL_THREAD_DETACH: |
||||
case DLL_PROCESS_DETACH: |
||||
break; |
||||
} |
||||
return TRUE; |
||||
} |
||||
|
||||
extern "C" { |
||||
|
||||
KMELEON_PLUGIN kmeleonPlugin *GetKmeleonPlugin() { |
||||
return &kPlugin; |
||||
} |
||||
|
||||
} |
||||
|
@ -1,214 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
||||
/* ***** 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) 1998 |
||||
* the Initial Developer. All Rights Reserved. |
||||
* |
||||
* Contributor(s): |
||||
* Pierre Phaneuf <pp@ludusdesign.com> |
||||
* |
||||
* Alternatively, the contents of this file may be used under the terms of |
||||
* either of 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 ***** */ |
||||
|
||||
// DO NOT COPY THIS CODE INTO YOUR SOURCE! USE NS_IMPL_NSGETMODULE()
|
||||
|
||||
#include "nsGenericFactory.h" |
||||
#include "nsMemory.h" |
||||
#include "nsCOMPtr.h" |
||||
#include "nsIComponentManager.h" |
||||
#include "nsIComponentRegistrar.h" |
||||
|
||||
#include "nsXPCOMGlue.h" |
||||
//#include "nsXPCOMPrivate.h"
|
||||
|
||||
nsGenericFactory::nsGenericFactory(const nsModuleComponentInfo *info) |
||||
: mInfo(info) |
||||
{ |
||||
if (mInfo && mInfo->mClassInfoGlobal) |
||||
*mInfo->mClassInfoGlobal = NS_STATIC_CAST(nsIClassInfo *, this); |
||||
} |
||||
|
||||
nsGenericFactory::~nsGenericFactory() |
||||
{ |
||||
if (mInfo) { |
||||
if (mInfo->mFactoryDestructor) |
||||
mInfo->mFactoryDestructor(); |
||||
if (mInfo->mClassInfoGlobal) |
||||
*mInfo->mClassInfoGlobal = 0; |
||||
} |
||||
} |
||||
|
||||
NS_IMPL_ISUPPORTS3(nsGenericFactory, |
||||
nsIGenericFactory,
|
||||
nsIFactory, |
||||
nsIClassInfo) |
||||
|
||||
NS_IMETHODIMP nsGenericFactory::CreateInstance(nsISupports *aOuter, |
||||
REFNSIID aIID, void **aResult) |
||||
{ |
||||
if (mInfo->mConstructor) { |
||||
return mInfo->mConstructor(aOuter, aIID, aResult); |
||||
} |
||||
|
||||
return NS_ERROR_FACTORY_NOT_REGISTERED; |
||||
} |
||||
|
||||
NS_IMETHODIMP nsGenericFactory::LockFactory(PRBool aLock) |
||||
{ |
||||
// XXX do we care if (mInfo->mFlags & THREADSAFE)?
|
||||
return NS_OK; |
||||
} |
||||
|
||||
NS_IMETHODIMP nsGenericFactory::GetInterfaces(PRUint32 *countp, |
||||
nsIID* **array) |
||||
{ |
||||
if (!mInfo->mGetInterfacesProc) { |
||||
*countp = 0; |
||||
*array = nsnull; |
||||
return NS_OK; |
||||
} |
||||
return mInfo->mGetInterfacesProc(countp, array); |
||||
} |
||||
|
||||
NS_IMETHODIMP nsGenericFactory::GetHelperForLanguage(PRUint32 language, |
||||
nsISupports **helper) |
||||
{ |
||||
if (mInfo->mGetLanguageHelperProc) |
||||
return mInfo->mGetLanguageHelperProc(language, helper); |
||||
*helper = nsnull; |
||||
return NS_OK; |
||||
} |
||||
|
||||
NS_IMETHODIMP nsGenericFactory::GetContractID(char **aContractID) |
||||
{ |
||||
if (mInfo->mContractID) { |
||||
*aContractID = (char *)nsMemory::Alloc(strlen(mInfo->mContractID) + 1); |
||||
if (!*aContractID) |
||||
return NS_ERROR_OUT_OF_MEMORY; |
||||
strcpy(*aContractID, mInfo->mContractID); |
||||
} else { |
||||
*aContractID = nsnull; |
||||
} |
||||
return NS_OK; |
||||
} |
||||
|
||||
NS_IMETHODIMP nsGenericFactory::GetClassDescription(char * *aClassDescription) |
||||
{ |
||||
if (mInfo->mDescription) { |
||||
*aClassDescription = (char *) |
||||
nsMemory::Alloc(strlen(mInfo->mDescription) + 1); |
||||
if (!*aClassDescription) |
||||
return NS_ERROR_OUT_OF_MEMORY; |
||||
strcpy(*aClassDescription, mInfo->mDescription); |
||||
} else { |
||||
*aClassDescription = nsnull; |
||||
} |
||||
return NS_OK; |
||||
} |
||||
|
||||
NS_IMETHODIMP nsGenericFactory::GetClassID(nsCID * *aClassID) |
||||
{ |
||||
*aClassID = |
||||
NS_REINTERPRET_CAST(nsCID*, |
||||
nsMemory::Clone(&mInfo->mCID, sizeof mInfo->mCID)); |
||||
if (! *aClassID) |
||||
return NS_ERROR_OUT_OF_MEMORY; |
||||
return NS_OK; |
||||
} |
||||
|
||||
NS_IMETHODIMP nsGenericFactory::GetClassIDNoAlloc(nsCID *aClassID) |
||||
{ |
||||
*aClassID = mInfo->mCID; |
||||
return NS_OK; |
||||
} |
||||
|
||||
NS_IMETHODIMP nsGenericFactory::GetImplementationLanguage(PRUint32 *langp) |
||||
{ |
||||
*langp = nsIProgrammingLanguage::CPLUSPLUS; |
||||
return NS_OK; |
||||
} |
||||
|
||||
NS_IMETHODIMP nsGenericFactory::GetFlags(PRUint32 *flagsp) |
||||
{ |
||||
*flagsp = mInfo->mFlags; |
||||
return NS_OK; |
||||
} |
||||
|
||||
// nsIGenericFactory: component-info accessors
|
||||
NS_IMETHODIMP nsGenericFactory::SetComponentInfo(const nsModuleComponentInfo *info) |
||||
{ |
||||
if (mInfo && mInfo->mClassInfoGlobal) |
||||
*mInfo->mClassInfoGlobal = 0; |
||||
mInfo = info; |
||||
if (mInfo && mInfo->mClassInfoGlobal) |
||||
*mInfo->mClassInfoGlobal = NS_STATIC_CAST(nsIClassInfo *, this); |
||||
return NS_OK; |
||||
} |
||||
|
||||
NS_IMETHODIMP nsGenericFactory::GetComponentInfo(const nsModuleComponentInfo **infop) |
||||
{ |
||||
*infop = mInfo; |
||||
return NS_OK; |
||||
} |
||||
|
||||
NS_METHOD nsGenericFactory::Create(nsISupports* outer, const nsIID& aIID, void* *aInstancePtr) |
||||
{ |
||||
// sorry, aggregation not spoken here.
|
||||
nsresult res = NS_ERROR_NO_AGGREGATION; |
||||
if (outer == NULL) { |
||||
nsGenericFactory* factory = new nsGenericFactory; |
||||
if (factory != NULL) { |
||||
res = factory->QueryInterface(aIID, aInstancePtr); |
||||
if (res != NS_OK) |
||||
delete factory; |
||||
} else { |
||||
res = NS_ERROR_OUT_OF_MEMORY; |
||||
} |
||||
} |
||||
return res; |
||||
} |
||||
|
||||
NS_COM_GLUE nsresult |
||||
NS_NewGenericFactory(nsIGenericFactory* *result, |
||||
const nsModuleComponentInfo *info) |
||||
{ |
||||
nsresult rv; |
||||
nsIGenericFactory* fact; |
||||
rv = nsGenericFactory::Create(NULL, NS_GET_IID(nsIGenericFactory), (void**)&fact); |
||||
if (NS_FAILED(rv)) return rv; |
||||
rv = fact->SetComponentInfo(info); |
||||
if (NS_FAILED(rv)) goto error; |
||||
*result = fact; |
||||
return rv; |
||||
|
||||
error: |
||||
NS_RELEASE(fact); |
||||
return rv; |
||||
} |
||||
|
@ -1,24 +0,0 @@
|
||||
|
||||
#include "nsISupports.idl" |
||||
#include "nsIDOMWindow.idl" |
||||
interface nsISimpleEnumerator; |
||||
[scriptable, uuid(3d8ce8f0-5214-11db-b0de-0800200c9a66)] |
||||
|
||||
interface nsIJSBridge : nsISupports |
||||
{ |
||||
const unsigned short MENU_COMMAND = 1; |
||||
const unsigned short MENU_POPUP = 2; |
||||
const unsigned short MENU_INLINE = 3; |
||||
const unsigned short MENU_PLUGIN = 4; |
||||
const unsigned short MENU_SEPARATOR = 5; |
||||
|
||||
void SetMenu(in string menu,in unsigned short type, in string label, in string command, in string before); |
||||
void RebuildMenu(in string menu); |
||||
|
||||
void id(in nsIDOMWindow window, in string id); |
||||
|
||||
//void SendMessage(in string plugin, in string to, in string from, in long data1, inout long data2); |
||||
//void test(); |
||||
|
||||
}; |
||||
|
@ -1,8 +0,0 @@
|
||||
// stdafx.cpp : source file that includes just the standard includes
|
||||
// kmeleon_winamp.pch will be the pre-compiled header
|
||||
// stdafx.obj will contain the pre-compiled type information
|
||||
|
||||
#include "stdafx.h" |
||||
|
||||
// TODO: reference any additional headers you need in STDAFX.H
|
||||
// and not in this file
|
@ -1,30 +0,0 @@
|
||||
// stdafx.h : include file for standard system include files,
|
||||
// or project specific include files that are used frequently, but
|
||||
// are changed infrequently
|
||||
//
|
||||
#define WINVER 0x0400 |
||||
|
||||
#if !defined(AFX_STDAFX_H__42896FF3_F6AF_11D4_AA28_00E02916DA72__INCLUDED_) |
||||
#define AFX_STDAFX_H__42896FF3_F6AF_11D4_AA28_00E02916DA72__INCLUDED_ |
||||
|
||||
#if _MSC_VER > 1000 |
||||
#pragma once |
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
// Insert your headers here
|
||||
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
|
||||
|
||||
#include <windows.h> |
||||
|
||||
#include <commctrl.h> |
||||
|
||||
#include <afxres.h> |
||||
|
||||
#include <shellapi.h> |
||||
|
||||
// TODO: reference additional headers your program requires here
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_STDAFX_H__42896FF3_F6AF_11D4_AA28_00E02916DA72__INCLUDED_)
|
@ -1,801 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2000 Brian Harris |
||||
* |
||||
* This program is free software; you can redistribute it and/or modify |
||||
* it under the terms of the GNU General Public License as published by |
||||
* the Free Software Foundation; either version 2, or (at your option) |
||||
* any later version. |
||||
* |
||||
* This program is distributed in the hope that it will be useful, |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
* GNU General Public License for more details. |
||||
* |
||||
* You should have received a copy of the GNU General Public License |
||||
* along with this program; if not, write to the Free Software |
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
||||
*/ |
||||
// adds icons to the menus
|
||||
//
|
||||
|
||||
#include "stdafx.h" |
||||
#include <tchar.h> |
||||
#include <malloc.h> |
||||
#include "../resource.h" |
||||
#include "../Utils.h" |
||||
|
||||
#define PLUGIN_NAME "Bitmapped Menus" |
||||
|
||||
#pragma warning( disable : 4786 ) // C4786 bitches about the std::map template name expanding beyond 255 characters
|
||||
#include <map> |
||||
#include <string> |
||||
#include <vector> |
||||
|
||||
#define KMELEON_PLUGIN_EXPORTS |
||||
#include "../kmeleon_plugin.h" |
||||
|
||||
#define CONFIG_FILE _T("menuicons.cfg") |
||||
|
||||
//#define BMP_PADDING_LEFT 3
|
||||
//#define BMP_PADDING_RIGHT 4
|
||||
#define BMP_PADDING_LEFT 2 |
||||
#define BMP_PADDING_RIGHT 2 |
||||
#define BMP_HEIGHT 16 |
||||
#define BMP_WIDTH 16 |
||||
int SPACE_BETWEEN = 0; // the space between the text and the accelerator, set to the width of 'X'
|
||||
LONG MARGIN_LEFT = max(GetSystemMetrics(SM_CXMENUCHECK)+ BMP_PADDING_LEFT + BMP_PADDING_RIGHT, BMP_WIDTH + BMP_PADDING_LEFT + BMP_PADDING_RIGHT); |
||||
#define MARGIN_RIGHT 16 |
||||
|
||||
typedef int (*DRAWBITMAPPROC)(DRAWITEMSTRUCT *dis); |
||||
|
||||
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); |
||||
WNDPROC KMeleonWndProc; |
||||
|
||||
int DrawBitmap(DRAWITEMSTRUCT *dis); |
||||
|
||||
void DrawCheckMark(HDC pDC,int x,int y,COLORREF color); |
||||
void SetOwnerDrawn(HMENU menu, DRAWBITMAPPROC DrawProc, BOOL topLevel); |
||||
void UnSetOwnerDrawn(HMENU menu); |
||||
|
||||
int Init(); |
||||
void Create(HWND parent); |
||||
void Config(HWND parent); |
||||
void Quit(); |
||||
void DoMenu(HMENU menu, char *param); |
||||
//int GetConfigFiles(configFileType **configFiles);
|
||||
|
||||
long DoMessage(const char *to, const char *from, const char *subject, long data1, long data2); |
||||
|
||||
kmeleonPlugin kPlugin = { |
||||
KMEL_PLUGIN_VER, |
||||
PLUGIN_NAME, |
||||
DoMessage |
||||
}; |
||||
|
||||
/*
|
||||
# sample config |
||||
|
||||
filename1.bmp { |
||||
ID_BLAH1 |
||||
ID_BLAH2 |
||||
ID_BLAH3 |
||||
} |
||||
filename2.bmp { |
||||
ID_BLARG1 |
||||
ID_BLARG2 |
||||
} |
||||
*/ |
||||
|
||||
// this maps HMENU's to DrawProcs
|
||||
typedef std::map<HMENU, DRAWBITMAPPROC> menuMap; |
||||
menuMap menus; |
||||
|
||||
BOOL bFirstRun; |
||||
|
||||
HIMAGELIST hImageList; |
||||
|
||||
// this maps command ids to the bitmap/index
|
||||
typedef std::map<short, int> BmpMapT; |
||||
BmpMapT bmpMap; |
||||
|
||||
// maps "ID_BLAH" to ID_BLAH
|
||||
typedef std::map<std::string, int> DefineMapT; |
||||
|
||||
|
||||
|
||||
|
||||
HMENU ghMenuLast; // the last menu that we've drawn
|
||||
int giMaxAccelWidth; // the longest accelerator (used by DrawMenuItem)
|
||||
int giMaxTextMeasured; // the longest text (used by MeasureMenuItem)
|
||||
int giMaxAccelMeasured; // the longest accelerator (used by MeasureMenuItem)
|
||||
BOOL gbDrawn = TRUE; // after the menu is drawn, we should reset iMaxText and iMaxAccel
|
||||
BOOL gbMeasureAccel = TRUE; // win98 workaround - win98 automatically adjusts measuremenuitem for the width of the accel
|
||||
HFONT gMenuFont = NULL; |
||||
|
||||
|
||||
long DoMessage(const char *to, const char *from, const char *subject, long data1, long data2) |
||||
{ |
||||
if (to[0] == '*' || stricmp(to, kPlugin.dllname) == 0) { |
||||
if (stricmp(subject, "Init") == 0) { |
||||
Init(); |
||||
} |
||||
else if (stricmp(subject, "Create") == 0) { |
||||
Create((HWND)data1); |
||||
} |
||||
else if (stricmp(subject, "Config") == 0) { |
||||
Config((HWND)data1); |
||||
} |
||||
else if (stricmp(subject, "Quit") == 0) { |
||||
Quit(); |
||||
} |
||||
else if (stricmp(subject, "DoMenu") == 0) { |
||||
DoMenu((HMENU)data1, (char *)data2); |
||||
} |
||||
else if (stricmp(subject, "UnSetOwnerDrawn") == 0) { |
||||
UnSetOwnerDrawn((HMENU)data1); |
||||
} |
||||
else if (stricmp(subject, "SetOwnerDrawn") == 0) { |
||||
|
||||
// if this menu has already been "ownerdrawn", then it's
|
||||
// probably being called again as a result of an update,
|
||||
// so we remove it from the mapping because the SetOwnerDrawn
|
||||
// function exits if it's listed in the mapping
|
||||
menuMap::iterator menuIter = menus.find((HMENU)data1); |
||||
if (menuIter != menus.end()) |
||||
menus.erase(menuIter); |
||||
|
||||
SetOwnerDrawn((HMENU)data1, (DRAWBITMAPPROC)data2, FALSE); |
||||
} |
||||
else return 0; |
||||
|
||||
return 1; |
||||
} |
||||
return 0; |
||||
} |
||||
|
||||
|
||||
#include "../findskin.cpp" |
||||
|
||||
|
||||
void ParseConfig(char *buffer) { |
||||
hImageList = ImageList_Create(BMP_WIDTH, BMP_HEIGHT, ILC_MASK | ILC_COLOR8, 32, 256); |
||||
|
||||
DefineMapT defineMap; |
||||
DefineMapT::iterator defineMapIt; |
||||
#define DEFINEMAP_ADD(entry) defineMap[std::string(#entry)] = entry; |
||||
#include "../definemap.cpp" |
||||
|
||||
BOOL currentBitmap = false; |
||||
int index = 0; |
||||
|
||||
char *p; |
||||
while ((p = strtok(NULL, "\n")) != NULL) { |
||||
|
||||
// ignore the comments
|
||||
if (*p == '#') { |
||||
continue; |
||||
} |
||||
else if (!currentBitmap) { |
||||
char *b = strchr(p, '{'); |
||||
if (b) { |
||||
*b = 0; |
||||
TrimWhiteSpace(p); |
||||
p = SkipWhiteSpace(p); |
||||
#ifdef _UNICODE |
||||
wchar_t q[MAX_PATH]; |
||||
MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, p, -1, q, MAX_PATH); |
||||
#else |
||||
char* q = p; |
||||
#endif |
||||
HBITMAP bitmap; |
||||
// if it's relative to the root (ie: c:\blah or \blah or /blah
|
||||
if (*p == '/' || *p == '\\' || *(p+1) == ':') { |
||||
bitmap = (HBITMAP)LoadImage(NULL, q, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE | LR_DEFAULTSIZE); |
||||
} |
||||
// else it's relative to the settings directory (just plain blah)
|
||||
else { |
||||
TCHAR bmpPath[MAX_PATH]; |
||||
FindSkinFile(bmpPath, q); |
||||
bitmap = (HBITMAP)LoadImage(NULL, bmpPath, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE | LR_DEFAULTSIZE); |
||||
} |
||||
ImageList_AddMasked(hImageList, bitmap, RGB(255, 0, 255)); |
||||
|
||||
DeleteObject(bitmap); |
||||
|
||||
currentBitmap = true; |
||||
} |
||||
} |
||||
else { |
||||
if ( strchr( p, '}' )) { |
||||
currentBitmap = false; |
||||
index = ImageList_GetImageCount(hImageList); |
||||
continue; |
||||
} |
||||
|
||||
TrimWhiteSpace(p); |
||||
p = SkipWhiteSpace(p); |
||||
|
||||
int id; |
||||
defineMapIt = defineMap.find(std::string(p)); |
||||
if ( defineMapIt != defineMap.end() ) |
||||
id = defineMapIt->second; |
||||
else { |
||||
// check for call to other plugin
|
||||
char *op; |
||||
op = strchr(p, '('); |
||||
if (op) { |
||||
*op = 0; |
||||
char *param = op+1; |
||||
char *plugin = p; |
||||
p = strchr(param, ')'); |
||||
if (p) *p =0; |
||||
p = strchr(param, ','); |
||||
if (p) *p =0; |
||||
kPlugin.kFuncs->SendMessage(plugin, PLUGIN_NAME, "DoAccel", (long)param, (long)&id); |
||||
} |
||||
else { |
||||
id = kPlugin.kFuncs->GetID(p); |
||||
if (!id) |
||||
id = atoi(p); |
||||
} |
||||
if (id < 0) |
||||
id = 0; |
||||
} |
||||
bmpMap[id] = index; |
||||
index++; |
||||
} |
||||
} |
||||
} |
||||
|
||||
int Init() { |
||||
bFirstRun = TRUE; |
||||
|
||||
// Check for Win98
|
||||
OSVERSIONINFO osVersion; |
||||
osVersion.dwOSVersionInfoSize = sizeof( OSVERSIONINFO ); |
||||
GetVersionEx( &osVersion ); |
||||
if ( (osVersion.dwMajorVersion ==4) && (osVersion.dwMinorVersion > 0) && (osVersion.dwMinorVersion < 90) ) |
||||
gbMeasureAccel = FALSE; |
||||
|
||||
|
||||
// calculate the width of the character "X"
|
||||
// this will be used as a measurement for space between the
|
||||
// text and the accelerator
|
||||
NONCLIENTMETRICS ncm = {0}; |
||||
ncm.cbSize = sizeof(ncm); |
||||
SystemParametersInfo(SPI_GETNONCLIENTMETRICS,0,(PVOID)&ncm,FALSE); |
||||
|
||||
HDC hDC = CreateCompatibleDC(NULL); |
||||
gMenuFont = CreateFontIndirect(&ncm.lfMenuFont); |
||||
HGDIOBJ oldObj = SelectObject(hDC, gMenuFont);
|
||||
|
||||
SIZE size; |
||||
GetTextExtentPoint32(hDC, _T("X"), 1, &size); |
||||
|
||||
SPACE_BETWEEN = size.cx; |
||||
|
||||
SelectObject(hDC, oldObj); |
||||
DeleteDC(hDC); |
||||
|
||||
|
||||
TCHAR cfgPath[MAX_PATH]; |
||||
FindSkinFile(cfgPath, CONFIG_FILE); |
||||
|
||||
FILE *cfgFile = _tfopen(cfgPath, _T("r")); |
||||
if (cfgFile){ |
||||
long cfgFileSize = FileSize(cfgFile); |
||||
|
||||
char *cfgFileBuffer = new char[cfgFileSize]; |
||||
if (cfgFileBuffer) { |
||||
fread(cfgFileBuffer, sizeof(char), cfgFileSize, cfgFile); |
||||
|
||||
strtok(cfgFileBuffer, "\n"); |
||||
ParseConfig(cfgFileBuffer); |
||||
|
||||
delete [] cfgFileBuffer; |
||||
} |
||||
fclose(cfgFile); |
||||
} |
||||
return true; |
||||
} |
||||
|
||||
void Create(HWND parent){ |
||||
KMeleonWndProc = (WNDPROC) GetWindowLong(parent, GWL_WNDPROC); |
||||
SetWindowLong(parent, GWL_WNDPROC, (LONG)WndProc); |
||||
|
||||
bFirstRun=FALSE; |
||||
} |
||||
|
||||
void Config(HWND parent) |
||||
{ |
||||
TCHAR cfgPath[MAX_PATH]; |
||||
FindSkinFile(cfgPath, CONFIG_FILE); |
||||
|
||||
ShellExecute(parent, NULL, _T("notepad.exe"), cfgPath, NULL, SW_SHOW); |
||||
} |
||||
|
||||
configFileType g_configFiles[1]; |
||||
|
||||
/*int GetConfigFiles(configFileType **configFiles)
|
||||
{ |
||||
FindSkinFile(g_configFiles[0].file, CONFIG_FILE); |
||||
|
||||
strcpy(g_configFiles[0].label, "Menu Icons"); |
||||
|
||||
strcpy(g_configFiles[0].helpUrl, "http://www.kmeleon.org"); |
||||
|
||||
*configFiles = g_configFiles; |
||||
|
||||
return 1; |
||||
}*/ |
||||
|
||||
void Quit(){ |
||||
if (hImageList) |
||||
ImageList_Destroy(hImageList); |
||||
|
||||
DeleteObject(gMenuFont); |
||||
|
||||
while(menus.size()) { |
||||
UnSetOwnerDrawn(menus.begin()->first); |
||||
//menus.erase(menus.begin());
|
||||
} |
||||
bmpMap.clear(); |
||||
} |
||||
|
||||
void DoMenu(HMENU menu, char *param){ |
||||
// only do this the first time
|
||||
// if (bFirstRun) {
|
||||
|
||||
// WinNT4 is unhappy when we subclass the top level menus, it's probably a bug in
|
||||
// the way we do it now (since it worked before the recent changes), this is a bad
|
||||
// workaround, and needs to be fixed better.
|
||||
|
||||
// Don't ownerdraw the top level menu items (File, Edit, View, etc)
|
||||
// We can't actually be sure that this is going to be that menu.
|
||||
// To identify it, the user MUST put bmpmenu(top) for this menu
|
||||
BOOL topLevel; |
||||
DRAWBITMAPPROC DrawProc = NULL; |
||||
param = SkipWhiteSpace(param); |
||||
TrimWhiteSpace(param); |
||||
if (strcmp(param, "top") == 0) |
||||
topLevel = TRUE; |
||||
else { |
||||
topLevel = FALSE; |
||||
|
||||
if (*param) { |
||||
// plugin menus probably won't be top level
|
||||
HINSTANCE plugin = LoadLibraryA(param); |
||||
if (plugin) { |
||||
DrawProc = (DRAWBITMAPPROC)GetProcAddress(plugin, "DrawBitmap"); |
||||
} |
||||
} |
||||
} |
||||
if (!DrawProc) { |
||||
DrawProc = DrawBitmap; |
||||
} |
||||
SetOwnerDrawn(menu, DrawProc, topLevel); |
||||
// }
|
||||
} |
||||
|
||||
int DrawBitmap(DRAWITEMSTRUCT *dis) { |
||||
BmpMapT::iterator bmpMapIt; |
||||
bmpMapIt = bmpMap.find(dis->itemID); |
||||
|
||||
// Load the corresponding bitmap
|
||||
if (bmpMapIt != bmpMap.end()){ |
||||
int top = (dis->rcItem.bottom - dis->rcItem.top - BMP_HEIGHT) / 2; |
||||
top += dis->rcItem.top; |
||||
|
||||
if (dis->itemState & ODS_GRAYED) |
||||
ImageList_DrawEx(hImageList, bmpMapIt->second, dis->hDC, dis->rcItem.left+BMP_PADDING_LEFT, top, 0, 0, CLR_NONE, GetSysColor(COLOR_MENU), ILD_BLEND | ILD_TRANSPARENT); |
||||
|
||||
else if (dis->itemState & ODS_SELECTED) |
||||
ImageList_Draw(hImageList, bmpMapIt->second, dis->hDC, dis->rcItem.left+BMP_PADDING_LEFT, top, ILD_TRANSPARENT); |
||||
|
||||
else |
||||
ImageList_Draw(hImageList, bmpMapIt->second, dis->hDC, dis->rcItem.left+BMP_PADDING_LEFT, top, ILD_TRANSPARENT); |
||||
|
||||
return BMP_WIDTH; |
||||
} |
||||
else if (dis->itemState & ODS_CHECKED) { |
||||
|
||||
// The checkmark doesn't have a fixed size !!!
|
||||
HDC hdcMem = CreateCompatibleDC(dis->hDC); |
||||
if (hdcMem) { |
||||
|
||||
int cxCheck = GetSystemMetrics(SM_CXMENUCHECK); |
||||
int cyCheck = GetSystemMetrics(SM_CYMENUCHECK); |
||||
HBITMAP hbmMono = CreateBitmap(cxCheck, cyCheck, 1, 1, NULL); |
||||
if (hbmMono) { |
||||
HBITMAP hbmPrev = (HBITMAP)SelectObject(hdcMem, (HGDIOBJ)hbmMono); |
||||
if (hbmPrev) { |
||||
RECT rc = { 0, 0, cxCheck, cyCheck }; |
||||
DrawFrameControl(hdcMem, &rc, DFC_MENU, DFCS_MENUCHECK); |
||||
|
||||
/*COLORREF text, bgk;
|
||||
if (dis->itemState & ODS_SELECTED) { |
||||
text = GetSysColor(COLOR_HIGHLIGHTTEXT); |
||||
bgk = GetSysColor(COLOR_HIGHLIGHT); |
||||
} else { |
||||
text = GetSysColor(COLOR_MENUTEXT); |
||||
bgk = GetSysColor(COLOR_MENU); |
||||
} |
||||
|
||||
if (dis->itemState & ODS_GRAYED)
|
||||
text = GetSysColor(COLOR_GRAYTEXT); |
||||
*/ |
||||
// COLORREF clrTextPrev = SetTextColor(dis->hDC, text );
|
||||
//COLORREF clrBkPrev = SetBkColor(dis->hDC, bgk );
|
||||
BitBlt(dis->hDC, dis->rcItem.left + BMP_PADDING_LEFT,
|
||||
dis->rcItem.top + (dis->rcItem.bottom - dis->rcItem.top - cyCheck)/2, // Seems like it need some margin
|
||||
cxCheck, cyCheck, hdcMem, 0, 0, SRCCOPY); |
||||
//SetBkColor(dis->hDC, clrBkPrev);
|
||||
//SetTextColor(dis->hDC, clrTextPrev);
|
||||
SelectObject(hdcMem, (HGDIOBJ)hbmPrev); |
||||
} |
||||
DeleteObject(hbmMono); |
||||
} |
||||
DeleteDC(hdcMem); |
||||
} |
||||
|
||||
/* // the check mark is only 6x6, so we need to offset its drawing position
|
||||
if (dis->itemState & ODS_SELECTED) |
||||
DrawCheckMark(dis->hDC, dis->rcItem.left+BMP_PADDING_LEFT+4, dis->rcItem.top+5, GetSysColor(COLOR_HIGHLIGHTTEXT)); |
||||
else |
||||
DrawCheckMark(dis->hDC, dis->rcItem.left+BMP_PADDING_LEFT+4, dis->rcItem.top+5, GetSysColor(COLOR_MENUTEXT)); |
||||
return BMP_WIDTH;*/ |
||||
} |
||||
|
||||
return 0; |
||||
} |
||||
/*
|
||||
void DrawCheckMark(HDC pDC,int x,int y,COLORREF color) { |
||||
SetPixel(pDC, x, y+2, color); |
||||
SetPixel(pDC, x, y+3, color); |
||||
SetPixel(pDC, x, y+4, color); |
||||
|
||||
SetPixel(pDC, x+1, y+3, color); |
||||
SetPixel(pDC, x+1, y+4, color); |
||||
SetPixel(pDC, x+1, y+5, color); |
||||
|
||||
SetPixel(pDC, x+2, y+4, color); |
||||
SetPixel(pDC, x+2, y+5, col |