Merge branch 'master' into script-manager

This commit is contained in:
Merlijn Wajer 2011-07-30 00:15:22 +02:00
commit bd415f596a
17 changed files with 290 additions and 106 deletions

View File

@ -12,20 +12,26 @@ PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
.PHONY: help clean html dirhtml pickle json htmlhelp qthelp latex changes linkcheck doctest .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest
help: help:
@echo "Please use \`make <target>' where <target> is one of" @echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files" @echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories" @echo " dirhtml to make HTML files named index.html in directories"
@echo " pickle to make pickle files" @echo " singlehtml to make a single large HTML file"
@echo " json to make JSON files" @echo " pickle to make pickle files"
@echo " htmlhelp to make HTML files and a HTML help project" @echo " json to make JSON files"
@echo " qthelp to make HTML files and a qthelp project" @echo " htmlhelp to make HTML files and a HTML help project"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" @echo " qthelp to make HTML files and a qthelp project"
@echo " changes to make an overview of all changed/added/deprecated items" @echo " devhelp to make HTML files and a Devhelp project"
@echo " linkcheck to check all external links for integrity" @echo " epub to make an epub"
@echo " doctest to run all doctests embedded in the documentation (if enabled)" @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
clean: clean:
-rm -rf $(BUILDDIR)/* -rm -rf $(BUILDDIR)/*
@ -40,6 +46,11 @@ dirhtml:
@echo @echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
singlehtml:
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
pickle: pickle:
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo @echo
@ -65,12 +76,42 @@ qthelp:
@echo "To view the help file:" @echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Simba.qhc" @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Simba.qhc"
devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/Simba"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Simba"
@echo "# devhelp"
epub:
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
latex: latex:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo @echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \ @echo "Run \`make' in that directory to run these through (pdf)latex" \
"run these through (pdf)latex." "(use \`make latexpdf' here to do that automatically)."
latexpdf:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
make -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
text:
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@echo
@echo "Build finished. The text files are in $(BUILDDIR)/text."
man:
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
changes: changes:
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes

View File

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# #
# Simba documentation build configuration file, created by # Simba documentation build configuration file, created by
# sphinx-quickstart on Wed Jun 9 23:55:23 2010. # sphinx-quickstart on Sun Jul 24 18:24:27 2011.
# #
# This file is execfile()d with the current directory set to its containing dir. # This file is execfile()d with the current directory set to its containing dir.
# #
@ -16,16 +16,19 @@ import sys, os
# If extensions (or modules to document with autodoc) are in another directory, # If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the # add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here. # documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.append(os.path.abspath('.')) #sys.path.insert(0, os.path.abspath('.'))
sys.path.append(os.path.abspath('../../Projects/libmml/pymml/mml')) sys.path.append(os.path.abspath('../../Projects/libmml/pymml/mml'))
sys.path.append(os.path.abspath('../../Projects/libmml/pymml')) sys.path.append(os.path.abspath('../../Projects/libmml/pymml'))
# -- General configuration ----------------------------------------------------- # -- General configuration -----------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be extensions # Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc'] extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode']
# Add any paths that contain templates here, relative to this directory. # Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates'] templates_path = ['_templates']
@ -34,14 +37,14 @@ templates_path = ['_templates']
source_suffix = '.rst' source_suffix = '.rst'
# The encoding of source files. # The encoding of source files.
#source_encoding = 'utf-8' #source_encoding = 'utf-8-sig'
# The master toctree document. # The master toctree document.
master_doc = 'index' master_doc = 'index'
# General information about the project. # General information about the project.
project = u'Simba' project = u'Simba'
copyright = u'2010, Merlijn Wajer, Raymond van Venetie' copyright = u'2011, Merlijn Wajer, Raymond van Venetie'
# The version info for the project you're documenting, acts as replacement for # The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the # |version| and |release|, also used in various other places throughout the
@ -62,12 +65,9 @@ release = '0.97'
# Else, today_fmt is used as the format for a strftime call. # Else, today_fmt is used as the format for a strftime call.
#today_fmt = '%B %d, %Y' #today_fmt = '%B %d, %Y'
# List of documents that shouldn't be included in the build. # List of patterns, relative to source directory, that match files and
#unused_docs = [] # directories to ignore when looking for source files.
exclude_patterns = ['_build']
# List of directories, relative to source directory, that shouldn't be searched
# for source files.
exclude_trees = ['_build']
# The reST default role (used for this markup: `text`) to use for all documents. # The reST default role (used for this markup: `text`) to use for all documents.
#default_role = None #default_role = None
@ -92,8 +92,8 @@ pygments_style = 'sphinx'
# -- Options for HTML output --------------------------------------------------- # -- Options for HTML output ---------------------------------------------------
# The theme to use for HTML and HTML Help pages. Major themes that come with # The theme to use for HTML and HTML Help pages. See the documentation for
# Sphinx are currently 'default' and 'sphinxdoc'. # a list of builtin themes.
html_theme = 'nature' html_theme = 'nature'
# Theme options are theme-specific and customize the look and feel of a theme # Theme options are theme-specific and customize the look and feel of a theme
@ -141,7 +141,7 @@ html_static_path = ['_static']
#html_additional_pages = {} #html_additional_pages = {}
# If false, no module index is generated. # If false, no module index is generated.
#html_use_modindex = True #html_domain_indices = True
# If false, no index is generated. # If false, no index is generated.
#html_use_index = True #html_use_index = True
@ -152,13 +152,19 @@ html_static_path = ['_static']
# If true, links to the reST sources are added to the pages. # If true, links to the reST sources are added to the pages.
#html_show_sourcelink = True #html_show_sourcelink = True
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
#html_show_sphinx = True
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
#html_show_copyright = True
# If true, an OpenSearch description file will be output, and all pages will # If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the # contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served. # base URL from which the finished HTML is served.
#html_use_opensearch = '' #html_use_opensearch = ''
# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml"). # This is the file name suffix for HTML files (e.g. ".xhtml").
#html_file_suffix = '' #html_file_suffix = None
# Output file base name for HTML help builder. # Output file base name for HTML help builder.
htmlhelp_basename = 'Simbadoc' htmlhelp_basename = 'Simbadoc'
@ -176,7 +182,7 @@ htmlhelp_basename = 'Simbadoc'
# (source start file, target name, title, author, documentclass [howto/manual]). # (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [ latex_documents = [
('index', 'Simba.tex', u'Simba Documentation', ('index', 'Simba.tex', u'Simba Documentation',
u'Merlijn Wajer, Raymond van Venetië, Nielsie95', 'manual'), u'Merlijn Wajer, Raymond van Venetie', 'manual'),
] ]
# The name of an image file (relative to this directory) to place at the top of # The name of an image file (relative to this directory) to place at the top of
@ -187,6 +193,12 @@ latex_documents = [
# not chapters. # not chapters.
#latex_use_parts = False #latex_use_parts = False
# If true, show page references after internal links.
#latex_show_pagerefs = False
# If true, show URL addresses after external links.
#latex_show_urls = False
# Additional stuff for the LaTeX preamble. # Additional stuff for the LaTeX preamble.
#latex_preamble = '' #latex_preamble = ''
@ -194,4 +206,54 @@ latex_documents = [
#latex_appendices = [] #latex_appendices = []
# If false, no module index is generated. # If false, no module index is generated.
#latex_use_modindex = True #latex_domain_indices = True
# -- Options for manual page output --------------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'simba', u'Simba Documentation',
[u'Merlijn Wajer, Raymond van Venetie'], 1)
]
# -- Options for Epub output ---------------------------------------------------
# Bibliographic Dublin Core info.
epub_title = u'Simba'
epub_author = u'Merlijn Wajer, Raymond van Venetie'
epub_publisher = u'Merlijn Wajer, Raymond van Venetie'
epub_copyright = u'2011, Merlijn Wajer, Raymond van Venetie'
# The language of the text. It defaults to the language option
# or en if the language is not set.
#epub_language = ''
# The scheme of the identifier. Typical schemes are ISBN or URL.
#epub_scheme = ''
# The unique identifier of the text. This can be a ISBN number
# or the project homepage.
#epub_identifier = ''
# A unique identification for the text.
#epub_uid = ''
# HTML files that should be inserted before the pages created by sphinx.
# The format is a list of tuples containing the path and title.
#epub_pre_files = []
# HTML files shat should be inserted after the pages created by sphinx.
# The format is a list of tuples containing the path and title.
#epub_post_files = []
# A list of files that should not be packed into the epub file.
#epub_exclude_files = []
# The depth of the table of contents in toc.ncx.
#epub_tocdepth = 3
# Allow duplicate toc entries.
#epub_tocdup = True

View File

@ -14,9 +14,17 @@ Recommended Simba Extensions
---------------------------- ----------------------------
Recommended: Recommended:
* SRL Updater (and Downloader)
* DTM Editor * Extension Updater (highly recommended)
* SRL Updater (and Installer/Download)
* Associate Files * Associate Files
* Security extension. (Implements a File and Fire wall)
For developers:
* DTM Editor
* Paster Extension
* CRov, Crash Recovery.
.. note:: .. note::
You can also use the Reflection Updater (and Downloader) for updating You can also use the Reflection Updater (and Downloader) for updating

View File

@ -1,5 +1,5 @@
Simba Script Manager Simba Script Manager
==================== ====================
Community-created scripts will be available for download from the Community-created scripts will be available for download from the
Script Manager. The script manager will appear in release 1.0. Script Manager. The script manager will appear in release 1.0.

View File

@ -87,7 +87,7 @@ begin
HOST := HOSTDef; HOST := HOSTDef;
if (InputQuery(GetName + ' ' + GetVersion + ' Extension', 'Which ID would you like to grab?', Data)) then if (InputQuery(GetName + ' ' + GetVersion + ' Extension', 'Which ID would you like to grab?', Data)) then
begin begin
if IntToStr(StrToInt(Data)) = Data then if IntToStr(StrToIntDef(Data, -1)) = Data then
Data := '{"paste_id": ' + Data + '}' Data := '{"paste_id": ' + Data + '}'
else else
Data := '{"paste_id": "' + Data + '"}'; Data := '{"paste_id": "' + Data + '"}';

View File

@ -8,9 +8,9 @@
AppId={{524C9B9A-B57F-4FEC-89BE-292202EBA44D} AppId={{524C9B9A-B57F-4FEC-89BE-292202EBA44D}
AppName=Simba AppName=Simba
AppVerName=Simba 0.97 AppVerName=Simba 0.97
AppPublisherURL=http://simba.villavu.com/ AppPublisherURL=http://wizzup.org/simba
AppSupportURL=http://simba.villavu.com/ AppSupportURL=http://wizzup.org/simba
AppUpdatesURL=http://simba.villavu.com/ AppUpdatesURL=http://wizzup.org/simba
DefaultDirName={sd}\Simba DefaultDirName={sd}\Simba
DefaultGroupName=Simba DefaultGroupName=Simba
OutputDir=C:\simba\Install\windows\ OutputDir=C:\simba\Install\windows\
@ -43,8 +43,8 @@ Source: "C:\Simba\Extensions\paster.sex"; DestDir: "{app}\Extensions"; Flags: ig
Source: "C:\Simba\Extensions\CRov.sex"; DestDir: "{app}\Extensions"; Flags: ignoreversion Source: "C:\Simba\Extensions\CRov.sex"; DestDir: "{app}\Extensions"; Flags: ignoreversion
Source: "C:\Simba\Extensions\Updater.sei"; DestDir: "{app}\Extensions"; Flags: ignoreversion Source: "C:\Simba\Extensions\Updater.sei"; DestDir: "{app}\Extensions"; Flags: ignoreversion
Source: "C:\Simba\Includes\mml.simba"; DestDir: "{app}\Includes"; Flags: ignoreversion Source: "C:\Simba\Includes\mml.simba"; DestDir: "{app}\Includes"; Flags: ignoreversion
Source: "C:\Simba\Fonts\*"; DestDir: "{app}\Fonts"; Flags: ignoreversion recursesubdirs createallsubdirs ; Source: "C:\Simba\Fonts\*"; DestDir: "{app}\Fonts"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "C:\Simba\Tests\PS\*"; DestDir:"{app}\Scripts\Tests"; Flags: ignoreversion ; Source: "C:\Simba\Tests\PS\*"; DestDir:"{app}\Scripts\Tests"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files ; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons] [Icons]

View File

@ -26,11 +26,13 @@
// See Units/Linux/keybinder.pas // See Units/Linux/keybinder.pas
{$ENDIF} {$ENDIF}
//{$DEFINE SIMBA_VERBOSE} // For more verbosity.
//{$DEFINE USE_RUTIS} //{$DEFINE USE_RUTIS}
//{$DEFINE USE_CPASCAL} // TODO //{$DEFINE USE_CPASCAL} // TODO
//{$DEFINE USE_LAPE} // TODO //{$DEFINE USE_LAPE} // TODO
//{$DEFINE USE_EXTENSIONS} {$DEFINE USE_EXTENSIONS}
//{$DEFINE USE_CODECOMPLETION} // TODO //{$DEFINE USE_CODECOMPLETION} // TODO
//{$DEFINE TERMINALWRITELN} // Only used once. Remove from SimbaUnit? //{$DEFINE TERMINALWRITELN} // Only used once. Remove from SimbaUnit?

View File

@ -35,20 +35,16 @@
<LaunchingApplication PathPlusParams="/usr/bin/gnome-terminal -t 'Lazarus Run Output' -e '$(LazarusDir)/tools/runwait.sh $(TargetCmdLine)'"/> <LaunchingApplication PathPlusParams="/usr/bin/gnome-terminal -t 'Lazarus Run Output' -e '$(LazarusDir)/tools/runwait.sh $(TargetCmdLine)'"/>
</local> </local>
</RunParams> </RunParams>
<RequiredPackages Count="3"> <RequiredPackages Count="2">
<Item1> <Item1>
<PackageName Value="LCLBase"/>
<MinVersion Major="1" Release="1" Valid="True"/>
</Item1>
<Item2>
<PackageName Value="SynEdit"/> <PackageName Value="SynEdit"/>
<MinVersion Major="1" Valid="True"/> <MinVersion Major="1" Valid="True"/>
</Item2> </Item1>
<Item3> <Item2>
<PackageName Value="LCL"/> <PackageName Value="LCL"/>
</Item3> </Item2>
</RequiredPackages> </RequiredPackages>
<Units Count="48"> <Units Count="50">
<Unit0> <Unit0>
<Filename Value="Simba.lpr"/> <Filename Value="Simba.lpr"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
@ -308,10 +304,19 @@
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="os_linux"/> <UnitName Value="os_linux"/>
</Unit47> </Unit47>
<Unit48>
<Filename Value="../../Units/MMLCore/tpa.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="tpa"/>
</Unit48>
<Unit49>
<Filename Value="../../Units/MMLAddon/PSInc/psexportedmethods.inc"/>
<IsPartOfProject Value="True"/>
</Unit49>
</Units> </Units>
</ProjectOptions> </ProjectOptions>
<CompilerOptions> <CompilerOptions>
<Version Value="10"/> <Version Value="9"/>
<Target> <Target>
<Filename Value="../../Simba"/> <Filename Value="../../Simba"/>
</Target> </Target>

View File

@ -33,7 +33,7 @@ uses
{$ENDIF}{$ENDIF} {$ENDIF}{$ENDIF}
Interfaces, Forms, SimbaUnit, colourhistory, About, internets, debugimage, Interfaces, Forms, SimbaUnit, colourhistory, About, internets, debugimage,
framefunctionlist, simpleanalyzer, updater, updateform, Simbasettings, framefunctionlist, simpleanalyzer, updater, updateform, Simbasettings,
libloader, mufasabase, v_ideCodeInsight, libloader, mufasabase, tpa, v_ideCodeInsight,
PSDump, v_ideCodeParser, PSDump, v_ideCodeParser,
v_AutoCompleteForm, CastaliaPasLex, CastaliaPasLexTypes, CastaliaSimplePasPar, v_AutoCompleteForm, CastaliaPasLex, CastaliaPasLexTypes, CastaliaSimplePasPar,
CastaliaSimplePasParTypes, dcpbase64, mPasLex, v_Constants, v_MiscFunctions, CastaliaSimplePasParTypes, dcpbase64, mPasLex, v_Constants, v_MiscFunctions,

Binary file not shown.

View File

@ -143,6 +143,11 @@ begin
FilterPointsLine(points,radial,radius,mx,my); FilterPointsLine(points,radial,radius,mx,my);
end; end;
procedure ps_FilterTPADist(var TPA: TPointArray; maxDist: integer);
begin
FilterTPADist(TPA, maxDist);
end;
function ps_GetATPABounds(const ATPA: T2DPointArray): TBox;extdecl; function ps_GetATPABounds(const ATPA: T2DPointArray): TBox;extdecl;
begin begin
result := GetATPABounds(ATPA); result := GetATPABounds(ATPA);

View File

@ -458,6 +458,7 @@ AddFunction(@ps_FloodFillTPA,'function FloodFillTPA(const TPA : TPointArray) : T
AddFunction(@ps_FilterPointsPie,'procedure FilterPointsPie(var Points: TPointArray; const SD, ED, MinR, MaxR: Extended; Mx, My: Integer);'); AddFunction(@ps_FilterPointsPie,'procedure FilterPointsPie(var Points: TPointArray; const SD, ED, MinR, MaxR: Extended; Mx, My: Integer);');
AddFunction(@ps_FilterPointsLine,'procedure FilterPointsLine(var Points: TPointArray; Radial: Extended; Radius, MX, MY: Integer);'); AddFunction(@ps_FilterPointsLine,'procedure FilterPointsLine(var Points: TPointArray; Radial: Extended; Radius, MX, MY: Integer);');
AddFunction(@ps_filterpointsdist,'procedure FilterPointsDist(var Points: TPointArray; const MinDist, MaxDist: Extended; Mx, My: Integer);'); AddFunction(@ps_filterpointsdist,'procedure FilterPointsDist(var Points: TPointArray; const MinDist, MaxDist: Extended; Mx, My: Integer);');
AddFunction(@ps_filterTPADist, 'procedure FilterTPADist(var TPA: TPointArray; maxDist: integer);');
AddFunction(@ps_GetATPABounds,'function GetATPABounds(const ATPA: T2DPointArray): TBox;'); AddFunction(@ps_GetATPABounds,'function GetATPABounds(const ATPA: T2DPointArray): TBox;');
AddFunction(@ps_GetTPABounds,'function GetTPABounds(const TPA: TPointArray): TBox;'); AddFunction(@ps_GetTPABounds,'function GetTPABounds(const TPA: TPointArray): TBox;');
AddFunction(@ps_FindTPAinTPA,'function FindTPAinTPA(const SearchTPA, TotalTPA: TPointArray; var Matches: TPointArray): Boolean;'); AddFunction(@ps_FindTPAinTPA,'function FindTPAinTPA(const SearchTPA, TotalTPA: TPointArray; var Matches: TPointArray): Boolean;');

View File

@ -746,11 +746,15 @@ begin
if (path <> '') then if (path <> '') then
if Includes.Find(path,i) then if Includes.Find(path,i) then
begin begin
psWriteln('Include_Once file already included'); {$IFDEF SIMBA_VERBOSE}
Result := False; psWriteln('Include_Once file already included:' + Path);
{$ENDIF}
Result := True;
Exit;
end; end;
Includes.Add(path); Includes.Add(path);
Result := True; Result := False;
end; end;
procedure SIRegister_Mufasa(cl: TPSPascalCompiler); procedure SIRegister_Mufasa(cl: TPSPascalCompiler);

View File

@ -413,34 +413,40 @@ implementation
result := xmask and ButtonP > 0; result := xmask and ButtonP > 0;
end; end;
procedure TWindow.SendString(str: string); procedure TWindow.SendString(str: string);
var var
i: integer; I, L: Integer;
key: byte; K: Byte;
HoldShift : boolean; HoldShift: Boolean;
begin
HoldShift := False;
L := Length(str);
for I := 1 to L do
begin begin
HoldShift := false; if (((str[I] >= 'A') and (str[I] <= 'Z')) or
for i := 1 to length(str) do ((str[I] >= '!') and (str[I] <= '&')) or
((str[I] >= '(') and (str[I] <= '+')) or
(str[I] = ':') or
((str[I] >= '<') and (str[I] <= '@')) or
((str[I] >= '^') and (str[I] <= '_')) or
((str[I] >= '{') and (str[I] <= '~'))) then
begin begin
if((str[i] >= 'A') and (str[i] <= 'Z')) then HoldKey(VK_SHIFT);
begin HoldShift := True;
HoldKey(VK_SHIFT);
HoldShift:= True;
str[i] := lowerCase(str[i]);
end else
if HoldShift then
begin
HoldShift:= false;
ReleaseKey(VK_SHIFT);
end;
key:= GetKeyCode(str[i]);
HoldKey(key);
//BenLand100: You should probably wait here...
ReleaseKey(key);
end; end;
if HoldShift then
K := GetKeyCode(str[I]);
HoldKey(K);
Sleep(20);
ReleaseKey(K);
if (HoldShift) then
begin
HoldShift := False;
ReleaseKey(VK_SHIFT); ReleaseKey(VK_SHIFT);
end;
end; end;
end;
procedure TWindow.HoldKey(key: integer); procedure TWindow.HoldKey(key: integer);
begin begin

View File

@ -366,34 +366,34 @@ begin
end; end;
end; end;
procedure TWindow.SendString(str: string); procedure TWindow.SendString(str: string);
var var
i: integer; I, L: integer;
key: byte; C: Byte;
HoldShift : boolean; ScanCode, VK: Word;
Shift: boolean;
begin
L := Length(str);
for I := 1 to L do
begin begin
HoldShift := false; VK := VkKeyScan(str[I]);
for i := 1 to length(str) do Shift := (Hi(VK) > 0);
begin C := LoByte(VK);
if((str[i] >= 'A') and (str[i] <= 'Z')) then ScanCode := MapVirtualKey(C, 0);
begin if (ScanCode = 0) then
HoldKey(VK_SHIFT); Continue;
HoldShift:= True;
str[i] := lowerCase(str[i]); if (Shift) then
end else Keybd_Event(VK_SHIFT, $2A, 0, 0);
if HoldShift then
begin Keybd_Event(C, ScanCode, 0, 0);
HoldShift:= false; Keybd_Event(C, ScanCode, KEYEVENTF_KEYUP, 0);
ReleaseKey(VK_SHIFT);
end; if (Shift) then
key:= GetKeyCode(str[i]); Keybd_Event(VK_SHIFT, $2A, KEYEVENTF_KEYUP, 0);
HoldKey(key);
//BenLand100 note: probably should wait here
ReleaseKey(key);
end;
if HoldShift then
ReleaseKey(VK_SHIFT);
end; end;
end;
procedure TWindow.HoldKey(key: integer); procedure TWindow.HoldKey(key: integer);
begin begin
keyinput.Down(key); keyinput.Down(key);

View File

@ -67,6 +67,7 @@ function FloodFillTPA(const TPA : TPointArray) : T2DPointArray;
procedure FilterPointsPie(var Points: TPointArray; const SD, ED, MinR, MaxR: Extended; Mx, My: Integer); procedure FilterPointsPie(var Points: TPointArray; const SD, ED, MinR, MaxR: Extended; Mx, My: Integer);
procedure FilterPointsDist(var Points: TPointArray; const MinDist,MaxDist: Extended; Mx, My: Integer); procedure FilterPointsDist(var Points: TPointArray; const MinDist,MaxDist: Extended; Mx, My: Integer);
procedure FilterPointsLine(var Points: TPointArray; Radial: Extended; Radius, MX, MY: Integer); procedure FilterPointsLine(var Points: TPointArray; Radial: Extended; Radius, MX, MY: Integer);
procedure FilterTPADist(var TPA: TPointArray; maxDist: integer);
function RemoveDistTPointArray(x, y, dist: Integer;const ThePoints: TPointArray; RemoveHigher: Boolean): TPointArray; function RemoveDistTPointArray(x, y, dist: Integer;const ThePoints: TPointArray; RemoveHigher: Boolean): TPointArray;
function GetATPABounds(const ATPA: T2DPointArray): TBox; function GetATPABounds(const ATPA: T2DPointArray): TBox;
function GetTPABounds(const TPA: TPointArray): TBox; function GetTPABounds(const TPA: TPointArray): TBox;
@ -1168,6 +1169,55 @@ begin
Points:= P; Points:= P;
end; end;
{/\
Removes points in the TPA that are within maxDist of each other.
/\}
procedure FilterTPADist(var TPA: TPointArray; maxDist: integer);
var
c, i, j, l, h, maxDistSq: integer;
newTPA: TPointArray;
inBadElements: TBooleanArray;
begin
h := high(TPA);
l := (h + 1);
maxDistSq := (maxDist * maxDist);
setLength(inBadElements, l);
setLength(newTPA, l);
for i := 0 to h do
inBadElements[i] := false;
for i := 0 to (h - 1) do
begin
if (inBadElements[i]) then
continue;
for j := (i + 1) to h do
begin
if (inBadElements[j]) then
continue;
// simplified -> a^2 + b^2 <= c^2
if (((TPA[i].x - TPA[j].x) * (TPA[i].x - TPA[j].x)) + ((TPA[i].y - TPA[j].y) * (TPA[i].y - TPA[j].y)) <= maxDistSq) then
inBadElements[j] := true;
end;
end;
c := 0;
// set the new TPA
for i := 0 to h do
if (not inBadElements[i]) then
begin
newTPA[c] := TPA[i];
inc(c);
end;
setLength(newTPA, c);
TPA := newTPA;
end;
{/\ {/\
Removes the points that are inside or outside the distance Dist from the point (x, y) from the TPointArray ThePoints. Removes the points that are inside or outside the distance Dist from the point (x, y) from the TPointArray ThePoints.
/\} /\}

@ -1 +1 @@
Subproject commit 1b8211db373428cd2916905980ad51be8fab1f83 Subproject commit 940053e16d79c3d76b6b70d6a1bf56507ad0e627